Results 1 to 6 of 6

Thread: Return a pointer from a QItemdelegate

  1. #1
    Join Date
    Mar 2008
    Posts
    57
    Thanked 1 Time in 1 Post
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Unix/X11

    Default Return a pointer from a QItemdelegate

    I have an QItemDelegate with two spinboxes (one for double and one for int) and I would like to be able to return a pointer (QObject*) from the QItemdelegate with the spinbox being edited.

    Is it possible?

  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: Return a pointer from a QItemdelegate

    What do you need it for? The delegate is surely not the right place to do it...

  3. #3
    Join Date
    Mar 2008
    Posts
    57
    Thanked 1 Time in 1 Post
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Unix/X11

    Default Re: Return a pointer from a QItemdelegate

    I am trying to automate my use case tests so I can run them on a daily build.

    I can generate keypresses to traverse to correct view and go to chosen cell in the tablewidget and open it for editing. But from here on the spinbox of the itemdelegate has the focus. So to be able to edit the value in the spinbox i need its address to generate a keypress up/down?

  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: Return a pointer from a QItemdelegate

    How about using QApplication::focusWidget()?

  5. #5
    Join Date
    Mar 2008
    Posts
    57
    Thanked 1 Time in 1 Post
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Unix/X11

    Default Re: Return a pointer from a QItemdelegate

    I will check it out first thing tomorrow.
    Thank you!

  6. #6
    Join Date
    Mar 2008
    Posts
    57
    Thanked 1 Time in 1 Post
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Unix/X11

    Default Re: Return a pointer from a QItemdelegate

    ...it sound that it will solve my problem.

Similar Threads

  1. Possible signal mapper problem
    By MarkoSan in forum Qt Programming
    Replies: 13
    Last Post: 25th January 2008, 13:11
  2. Once more : QAbstractItemModel woes
    By Valheru in forum Qt Programming
    Replies: 10
    Last Post: 15th January 2008, 10:44
  3. QTableView Repaint/Refresh
    By millsks in forum Newbie
    Replies: 9
    Last Post: 10th January 2008, 17:18
  4. Qt Cryptographic Architecture
    By vermarajeev in forum Qt Programming
    Replies: 6
    Last Post: 9th February 2007, 13:15
  5. Version 4.1.3 and QTreeView
    By greencastor in forum Qt Programming
    Replies: 2
    Last Post: 13th June 2006, 10:37

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.