Results 1 to 7 of 7

Thread: [SOLVED]QTreeWidget doesn't want to be edited

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    May 2010
    Posts
    30
    Qt products
    Qt4
    Platforms
    Windows
    Thanks
    2
    Thanked 1 Time in 1 Post

    Default Re: QTreeWidget doesn't want to be edited

    That did it, thanks.

    As a followup, as best I can tell, the QTreeWidgetItem doesn't emit any signals, where would I connect to handle pushing the new name back into the database?

  2. #2
    Join Date
    Jan 2006
    Location
    Germany
    Posts
    4,380
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows Symbian S60
    Thanks
    19
    Thanked 1,005 Times in 913 Posts
    Wiki edits
    5

    Default Re: QTreeWidget doesn't want to be edited

    Cant you use a QTreeView with a proper model? That will simplify things a lot.

  3. #3
    Join Date
    May 2010
    Posts
    30
    Qt products
    Qt4
    Platforms
    Windows
    Thanks
    2
    Thanked 1 Time in 1 Post

    Default Re: QTreeWidget doesn't want to be edited

    Quote Originally Posted by Lykurg View Post
    That will simplify things a lot.
    Perhaps, but the conversion process at this point is not simple.

  4. #4
    Join Date
    Feb 2008
    Posts
    491
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11
    Thanks
    12
    Thanked 142 Times in 135 Posts

    Default Re: QTreeWidget doesn't want to be edited

    Quote Originally Posted by grabalon View Post
    where would I connect to handle pushing the new name back into the database?
    Maybe in a custom delegate? By reimplementing setModelData() to update your DB.

  5. #5
    Join Date
    May 2010
    Posts
    30
    Qt products
    Qt4
    Platforms
    Windows
    Thanks
    2
    Thanked 1 Time in 1 Post

    Default Re: QTreeWidget doesn't want to be edited

    Posted for benefit of future readers:

    QTreeWidget::itemChanged(QTreeWidgetItem*, int)
    This signal solved my problems, but be sure to disconnect it if repopulating the QTreeWidget or you get some hyper signal emissions.

Similar Threads

  1. Replies: 5
    Last Post: 26th October 2014, 12:56
  2. Custom controls when QTreeWidgetItem edited.
    By kubas in forum Qt Programming
    Replies: 3
    Last Post: 4th September 2009, 10:27
  3. QSpinbox can not be edited through keyboard on Linux
    By sanjayshelke in forum Qt Programming
    Replies: 0
    Last Post: 28th May 2008, 09:21
  4. QTreeWidget - Edited Rows
    By Preeteesh in forum Qt Programming
    Replies: 5
    Last Post: 18th June 2007, 16:44
  5. How to know when field is edited within QTableView
    By dkite in forum Qt Programming
    Replies: 3
    Last Post: 1st January 2007, 18: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
  •  
Qt is a trademark of The Qt Company.