Results 1 to 11 of 11

Thread: Problem in enabling QtreeWidget items dynamically

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Apr 2006
    Posts
    28
    Thanks
    1
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Problem in enabling QtreeWidget items dynamically

    Hi,
    Initially I have disabled tree widget items, now I want to enable them after some processing, but the items are not getting enabled unless I minimize & maximize the main window.
    Pls suggest.
    Pls see the code below -
    Qt Code:
    1. QFlags<Qt::ItemFlag> flag(Qt::ItemIsEnabled);
    2. flag = flag | Qt::ItemIsSelectable;
    3.  
    4. //CPSSRouterInterface::getUniqueInstance(m_uiMainWindow)->runRouter();
    5.  
    6. QList<QTreeWidgetItem *> widgetList = m_uiMainWindow.routingFlowTree->findItems(QString("View Routing Solution"),Qt::MatchRecursive);
    7. if (widgetList.size() > 0 )
    8. {
    9. widgetList.takeFirst()->setFlags(flag);
    10. }
    11.  
    12. widgetList = m_uiMainWindow.routingFlowTree->findItems(QString("Reports"),Qt::MatchRecursive);
    13. if (widgetList.size() > 0 )
    14. {
    15. widgetList.takeFirst()->setFlags(flag);
    16. }
    17.  
    18. widgetList = m_uiMainWindow.routingFlowTree->findItems(QString("Routing Statistics"),Qt::MatchRecursive);
    19. if (widgetList.size() > 0 )
    20. {
    21. widgetList.takeFirst()->setFlags(flag);
    22. }
    23.  
    24. widgetList = m_uiMainWindow.routingFlowTree->findItems(QString("Routing Solution Cell View"),Qt::MatchRecursive);
    25. if (widgetList.size() > 0 )
    26. {
    27. widgetList.takeFirst()->setFlags(flag);
    28. }
    29.  
    30. widgetList = m_uiMainWindow.routingFlowTree->findItems(QString("Routing Solution Net View"),Qt::MatchRecursive);
    31. if (widgetList.size() > 0 )
    32. {
    33. widgetList.takeFirst()->setFlags(flag);
    34. }
    35.  
    36. //m_uiMainWindow.routingFlowTree->setFocus();
    37. m_uiMainWindow.routingFlowTree->repaint();
    38. CFacade::getUniqueInstance()->repaint();
    To copy to clipboard, switch view to plain text mode 
    Last edited by wysota; 31st May 2006 at 08:11.

Similar Threads

  1. QTreeWidget problem!!
    By mcenatie in forum Qt Programming
    Replies: 2
    Last Post: 10th March 2006, 11:47

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
  •  
Qt is a trademark of The Qt Company.