Page 2 of 2 FirstFirst 12
Results 21 to 23 of 23

Thread: rowCount() is calling for all the top level items

  1. #21
    Join Date
    Jun 2015
    Location
    India
    Posts
    185
    Thanks
    8
    Thanked 14 Times in 14 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: rowCount() is calling for all the top level items

    I report a bug in Qt bug tracker for this.

    Quote Originally Posted by wysota View Post
    You can hide the original header and replace it with your own instance of QHeaderView that is not tied to the model as I understand you want your header to reflect the current view state rather than the model's data.
    I want my header to be changed depends on the row I clicked (for ex: if I click on a even row (index.row()%2 == 0 ) I put one header set & for odd row I put another header set).
    in this case how a customized header can help me ?
    And I could not see any function for setting data (if I customize QHeaderView) rather than QHeaderView::setRootIndex(QModelIndex);

    Thanks.
    Last edited by prasad_N; 15th July 2015 at 20:39.
    Thanks :-)

  2. #22
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: rowCount() is calling for all the top level items

    The header takes its data from headerData() method of the model. Simply provide a custom model for it. It can even be empty just make it return whatever you need from headerData().
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  3. The following user says thank you to wysota for this useful post:

    prasad_N (16th July 2015)

  4. #23
    Join Date
    Jun 2015
    Location
    India
    Posts
    185
    Thanks
    8
    Thanked 14 Times in 14 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: rowCount() is calling for all the top level items

    Quote Originally Posted by wysota View Post
    The header takes its data from headerData() method of the model. Simply provide a custom model for it. It can even be empty just make it return whatever you need from headerData().
    Thanks, It did worked with the sample I provided here, need to check with my project hope will work :-)
    Thanks :-)

Similar Threads

  1. Replies: 10
    Last Post: 21st May 2015, 19:11
  2. Replies: 16
    Last Post: 12th May 2015, 22:46
  3. Replies: 1
    Last Post: 14th March 2013, 23:50
  4. QTreeWidget::findItems only searches top level items ?
    By krisha in forum Qt Programming
    Replies: 3
    Last Post: 27th October 2011, 09:28
  5. Replies: 4
    Last Post: 4th June 2007, 13:07

Tags for this Thread

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.