Results 1 to 7 of 7

Thread: how can i add a text box and a combo box in tree widget?

  1. #1
    Join Date
    Oct 2011
    Posts
    160
    Qt products
    Qt4
    Platforms
    Windows
    Thanks
    31

    Default how can i add a text box and a combo box in tree widget?

    Hi,
    Is there any possibility of adding a text box and a combo box inside a tree widget as child of the root...
    If so please tell me how can i achieve that?

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

    Default Re: how can i add a text box and a combo box in tree widget?

    Do you want just one such set or one for every item?
    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. #3
    Join Date
    Oct 2011
    Posts
    160
    Qt products
    Qt4
    Platforms
    Windows
    Thanks
    31

    Default Re: how can i add a text box and a combo box in tree widget?

    Quote Originally Posted by wysota View Post
    Do you want just one such set or one for every item?
    for every node in the tree....as a child..


    AND IT SHOULD BE SOMETHING LIKE THIS..
    COMBO.jpg
    Last edited by aurora; 2nd January 2012 at 12:58.

  4. #4
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,373
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Thanks
    4
    Thanked 5,019 Times in 4,795 Posts
    Wiki edits
    10

    Default Re: how can i add a text box and a combo box in tree widget?

    Qt doesn't cope well with such designs. It is best to use QScrollArea, put checkable widgets (like buttons) inside and make them show or hide the boxes you want depending on their check state. Technically what you want is possible to be done directly by using persistent editors but it will be very bad performance wise.
    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.


  5. #5
    Join Date
    Dec 2011
    Posts
    1
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: how can i add a text box and a combo box in tree widget?

    I think delegate will help you. But you should use QTreeView + custome model

  6. #6
    Join Date
    Oct 2011
    Posts
    160
    Qt products
    Qt4
    Platforms
    Windows
    Thanks
    31

    Default Re: how can i add a text box and a combo box in tree widget?

    ok....can i get any example?

  7. #7
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,373
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Thanks
    4
    Thanked 5,019 Times in 4,795 Posts
    Wiki edits
    10

    Default Re: how can i add a text box and a combo box in tree widget?

    Quote Originally Posted by Maledictus View Post
    I think delegate will help you. But you should use QTreeView + custome model
    I wouldn't go this way. It is either a lot (and I do mean a lot) of work reimplementing widgets in the delegate or it has all the down sides of what I said earlier if done straight using persistant editors.
    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.


Similar Threads

  1. Combo box is not showing any text by default
    By chandan in forum Qt Programming
    Replies: 0
    Last Post: 1st February 2011, 11:43
  2. Set selected text in combo box
    By kode in forum Newbie
    Replies: 0
    Last Post: 27th December 2010, 12:06
  3. tree widget like designer's widget tree
    By nroberts in forum Newbie
    Replies: 1
    Last Post: 20th November 2010, 01:06
  4. QSS, trying to make the text on the combo box WHITE not black.
    By technoViking in forum Qt Programming
    Replies: 3
    Last Post: 22nd June 2010, 00:57
  5. rich text in tree widget
    By magland in forum Qt Programming
    Replies: 19
    Last Post: 12th March 2009, 14:07

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.