Results 1 to 5 of 5

Thread: QListViewItems

  1. #1
    Join Date
    Jan 2007
    Posts
    326
    Thanks
    42
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    MacOS X

    Default QListViewItems

    Hi all

    How can we hide items in QListView.

    For eg.

    QListViewItem*item;
    item->setText(1,"Directory");
    Now I want to hide the text of column 1;

    How can I?


    Please reply with an example.

    Thanx
    merry

  2. #2
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    6,264
    Thanks
    36
    Thanked 1,519 Times in 1,389 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows Symbian S60 Maemo/MeeGo

    Default Re: QListViewItems

    J-P Nurmi

  3. #3
    Join Date
    Jan 2007
    Posts
    326
    Thanks
    42
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    MacOS X

    Default Re: QListViewItems

    Thanx for your reply

    But when I use this function

    QListView::hideColumn(int column)

    Then an error is generated that there is no matching function for call to `QListView::hideColumn(int).


    Thanx
    merry

  4. #4
    Join Date
    Jan 2007
    Posts
    326
    Thanks
    42
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    MacOS X

    Default Re: QListViewItems

    Hi

    Actually I am Working on Qt3.1 for Linux Operating System.And I think in this there is no function like this QListView::hideColumn().


    Merry

  5. #5
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    6,264
    Thanks
    36
    Thanked 1,519 Times in 1,389 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows Symbian S60 Maemo/MeeGo

    Default Re: QListViewItems

    Yes, the link is for Qt 3.3. But did you read it's notes anyway? It's just a convenience function which calls some other function (which is also mentioned there). Still if the convenience function was not yet introduced in 3.1, you can simulate the behavior by calling that other mentioned function.

    void QListView::hideColumn ( int column )
    Hides the column specified at column. This is a convenience function that calls setColumnWidth( column, 0 ).

    Note: The user may still be able to resize the hidden column using the header handles. To prevent this, call setResizeEnabled(FALSE, column) on the list views header.

    See also setColumnWidth().
    J-P Nurmi

  6. The following user says thank you to jpn for this useful post:

    merry (23rd February 2007)

Similar Threads

  1. moving QListViewItems
    By ct in forum Newbie
    Replies: 4
    Last Post: 21st March 2006, 01:14
  2. Tooltips for QListViewItems (QT3)?
    By gadnio in forum Newbie
    Replies: 3
    Last Post: 13th March 2006, 17:02
  3. why triggerUpdate() is not virtual?
    By gadnio in forum Qt Programming
    Replies: 3
    Last Post: 12th January 2006, 15:05

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.