PDA

View Full Version : Return a pointer from a QItemdelegate



SailinShoes
10th March 2008, 15:10
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?

wysota
11th March 2008, 12:31
What do you need it for? The delegate is surely not the right place to do it...

SailinShoes
12th March 2008, 19:47
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?

wysota
12th March 2008, 19:58
How about using QApplication::focusWidget()?

SailinShoes
12th March 2008, 20:05
I will check it out first thing tomorrow.
Thank you!

SailinShoes
12th March 2008, 20:07
...it sound that it will solve my problem.