Results 1 to 3 of 3

Thread: How QTreeWidget 4.8.5 different from 5.2.1?

  1. #1
    Join Date
    Feb 2014
    Posts
    24
    Qt products
    Qt4 Qt5
    Platforms
    Windows

    Default How QTreeWidget 4.8.5 different from 5.2.1?

    Greetings,

    QTreeWidget 5.2.1 refresh differently from 4.8.5 for some reason but I cant find out why so far.

    While version 4.8.5 works beautifully, using QTreeWidgetItem::setItemWidget column 1 to a QTreeWidget long enough to display a scrollbar doesn't refresh well when scrolling the QTreeWidget in 5.1. Although, column 0 seText displays well, I'm ending with multiple copies of the widgets in column 1 as if the embedded widgets paint was occurring only partially. Code works perfectly when compiling with 4.8.5 but the same code does not refresh well with 5.2.1.

    Any thoughts would be greatly appreciated.

    thank you,

  2. #2
    Join Date
    Mar 2009
    Location
    Brisbane, Australia
    Posts
    7,729
    Thanks
    13
    Thanked 1,610 Times in 1,537 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows
    Wiki edits
    17

    Default Re: How QTreeWidget 4.8.5 different from 5.2.1?

    Since we have no idea what you are doing in your code it will be hard to say where the problem lies.

  3. #3
    Join Date
    Feb 2014
    Posts
    24
    Qt products
    Qt4 Qt5
    Platforms
    Windows

    Default Re: How QTreeWidget 4.8.5 different from 5.2.1?

    Alright, I'll try to simplify my setup as it is rather didficult to extract the whole thing. But mainly it goes like this:

    Qt Code:
    1. myDockWidget::myDockWidget(QWidget *in_parent): QDockWidget(in_parent),
    2. {
    3. setAllowedAreas(Qt::AllDockWidgetAreas);
    4.  
    5. m_QLayout = new QBoxLayout(QBoxLayout::TopToBottom);
    6.  
    7. m_QWidget = AX6_New QWidget();
    8. m_QWidget->setLayout(m_QLayout);
    9. setWidget(m_QWidget);
    10.  
    11. QStringList l_labels;
    12. l_labels << "Label" << "Value";
    13. m_QTreeWidget = new QTreeWidget(this);
    14. m_QTreeWidget->setHeaderLabels(l_labels);
    15. m_QTreeWidget->setColumnCount(2);
    16. m_QTreeWidget->setAutoFillBackground(true);
    17.  
    18. m_QLayout->addWidget(m_QTreeWidget);
    19.  
    20. for (int i = 0; i < 100; ++i)
    21. {
    22. QTreeWidgetItem *l_item = new QTreeWidgetItem(m_QTreeWidget);
    23. l_item->setText(0, "hello");
    24. m_QTreeWidget->setItemWidget(l_item, 1, new QCheckBox());
    25. }
    26. }
    To copy to clipboard, switch view to plain text mode 

Similar Threads

  1. Replies: 0
    Last Post: 21st October 2013, 09:16
  2. Replies: 2
    Last Post: 17th March 2008, 12:53
  3. Replies: 1
    Last Post: 19th October 2007, 01:29
  4. QTreeWidget
    By merry in forum Qt Programming
    Replies: 4
    Last Post: 28th May 2007, 12:51
  5. QTreeWidget how to's
    By bruccutler in forum Qt Programming
    Replies: 3
    Last Post: 6th March 2007, 16:23

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.