Results 1 to 3 of 3

Thread: QTreeWidget Dilemma

  1. #1
    Join Date
    Aug 2011
    Location
    The Internet
    Posts
    29
    Thanks
    5
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default QTreeWidget Dilemma

    I'm having a hard time trying to figure out what I need to do with the application I'm writing. I'll give some psuedocode to explain.

    Basically, I have a QTreeWidget holding two different sets of QTreeWidgetItems

    On Launch I Want Set A to appear.

    As soon as Set B data is avaiable, i want it to display automatically and CLEAR Set A's data.

    I want to display Set A's data off and on (clearing Set B) with a Toggle button (QAbstractButton).

    Qt Code:
    1. Constructor:
    2. connect(ui.FullSystemButton, SIGNAL(toggled()), this, SLOT(FullSystem())); //will this work when the button is pushed in?
    To copy to clipboard, switch view to plain text mode 
    Qt Code:
    1. MainWindow::CheckPackets
    2. {
    3. //This function contains Set B and will refresh every 5 seconds on a QTimer. Once started it will ALWAYS run.
    4. }
    To copy to clipboard, switch view to plain text mode 
    Qt Code:
    1. MainWindow::FullSystem
    2. {
    3. //This function contains Set A and will show on default. I want this function to show data on a toggle switch.
    4. }
    To copy to clipboard, switch view to plain text mode 

  2. #2
    Join Date
    Jan 2008
    Location
    Alameda, CA, USA
    Posts
    5,230
    Thanks
    302
    Thanked 864 Times in 851 Posts
    Qt products
    Qt5
    Platforms
    Windows

    Default Re: QTreeWidget Dilemma

    A really simple way to do this is to use TWO QTreeWidget instances inside a QStackedWidget or QStackedLayout and simply toggle between them. Use one tree for A and one for B, and display whichever one of them is appropriate.

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

    JediSpam (18th November 2011)

  4. #3
    Join Date
    Aug 2011
    Location
    The Internet
    Posts
    29
    Thanks
    5
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: QTreeWidget Dilemma

    Thanks I will give that a try!

Similar Threads

  1. Scope dilemma.
    By kuzulis in forum Qt Programming
    Replies: 2
    Last Post: 24th June 2011, 05:24
  2. destructor dilemma
    By Petr_Kropotkin in forum General Programming
    Replies: 3
    Last Post: 17th March 2010, 15:58
  3. Replies: 2
    Last Post: 17th March 2008, 12:53
  4. Replies: 1
    Last Post: 19th October 2007, 01:29
  5. Caching QAbstractProxyModel dilemma
    By Alessandro in forum Qt Programming
    Replies: 2
    Last Post: 11th April 2006, 19:51

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.