Results 1 to 7 of 7

Thread: on_tableWidget_itemChanged

  1. #1
    Join Date
    Jun 2007
    Posts
    28
    Thanks
    7
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default on_tableWidget_itemChanged

    Hi,

    I have the itemChanged signal on tablewidget at every item change, also when I insert a new item.
    I need this signal only when the user finish to edit the item. Is possible?

    thanks,
    Massimiliano

  2. #2
    Join Date
    Feb 2006
    Location
    Romania
    Posts
    2,744
    Thanks
    8
    Thanked 541 Times in 521 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: on_tableWidget_itemChanged

    Try with the QAbstractItemDelegate::closeEditor signal.

    Regards

  3. #3
    Join Date
    Jun 2007
    Posts
    28
    Thanks
    7
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: on_tableWidget_itemChanged

    Hi marcel,

    In the Qt class reference I read:
    "The QAbstractItemDelegate class is used to display and edit data items from a model."
    I use a Item view convenience classes and not model/view architecture.
    Can I use this? Ok, I'm new :-) I must read more documentation.

    thanks,
    nowire75

  4. #4
    Join Date
    Feb 2006
    Location
    Romania
    Posts
    2,744
    Thanks
    8
    Thanked 541 Times in 521 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: on_tableWidget_itemChanged

    You have access to the default table widget item delegate, therefore you have access to that signal.

    Regards

  5. #5
    Join Date
    Jun 2007
    Posts
    28
    Thanks
    7
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: on_tableWidget_itemChanged

    Hi,

    I start whit "Star Delegate Example" and I look this part of code

    Qt Code:
    1. void StarDelegate::commitAndCloseEditor()
    2. {
    3. StarEditor *editor = qobject_cast<StarEditor *>(sender());
    4. emit commitData(editor);
    5. emit closeEditor(editor);
    6. qDebug("commitData and closeEditor");
    7. }
    To copy to clipboard, switch view to plain text mode 

    but I have not a debug message after the star edit.
    After this question I go to the beginner thread...

  6. #6
    Join Date
    Feb 2006
    Location
    Romania
    Posts
    2,744
    Thanks
    8
    Thanked 541 Times in 521 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: on_tableWidget_itemChanged

    I thought you needed to see when the editing is finished, meaning you had to connect the signal in the delegate to one of your slots.

    Why do you emit the signal manually?

  7. #7
    Join Date
    Jun 2007
    Posts
    28
    Thanks
    7
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: on_tableWidget_itemChanged

    Quote Originally Posted by marcel View Post
    I thought you needed to see when the editing is finished
    yes

    Quote Originally Posted by marcel View Post
    Why do you emit the signal manually?
    No, I want a automatic signal when editing is finished.
    Now I have only copy and edit the "star delegate example" because I never use a delegate. I want to know how it work whit an examples.

    nowire75

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.