Results 1 to 4 of 4

Thread: QTreeWidget

  1. #1
    Join Date
    May 2006
    Posts
    33
    Thanks
    2
    Qt products
    Qt4
    Platforms
    Windows

    Default QTreeWidget

    Hi,

    I have a QTreeWidget that has 4 columns with several records. Three of the columns contains positional data (x,y,z) that I would like to be able to select for drag and drop. My 1st question is can you set it up like MS Excel where you can select a column (getting all of its data) and 2nd assuming you can select a column how do you set up the drag and drop of that column into a QTableWidget that has 3 columns?

    Hope this makes sense.

    TIA

  2. #2
    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: QTreeWidget

    If you use a table widget and not a tree widget, you should be able to select the whole column. As for drag and drop, you need to set a draggable flag for the items you want to drag, make the treewidget accept drops and also maybe set particular items to accept drops (depending on where you want to drop those items). Then you have to assure that the same mime type is used (I think QTreeWidget and QTableWidget will do that for you automatically).

  3. #3
    Join Date
    May 2006
    Posts
    33
    Thanks
    2
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: QTreeWidget

    Thanks, that's good info on the drag and drop.

    I actually need the tree widget, though. What I currently have only has 4 fixed columns now, but will eventually grow into a widget for browsing attributes of objects. So are you saying there is no way for selecting columns is a tree widget? If so, do you have any suggestions for selecting this data in a tree widget?

    Thanks.

  4. #4
    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: QTreeWidget

    I didn't say there was no way for selecting columns within a tree widget You can connect to the headerviews clicked signal and select all items in a particular column from within a custom slot.

Similar Threads

  1. resizing a QTreeWidget
    By drhex in forum Qt Programming
    Replies: 6
    Last Post: 27th October 2006, 22:32
  2. Replies: 1
    Last Post: 21st September 2006, 10:37
  3. How to capture resizing of QTreeWidget columns?
    By simk in forum Qt Programming
    Replies: 2
    Last Post: 27th April 2006, 06:10
  4. QTreeWidget problem!!
    By mcenatie in forum Qt Programming
    Replies: 2
    Last Post: 10th March 2006, 11:47
  5. few questions related to QTreeWidget
    By prakash in forum Qt Programming
    Replies: 9
    Last Post: 10th March 2006, 07:32

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.