PDA

View Full Version : on_tableWidget_itemChanged



nowire75
24th June 2007, 20:09
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

marcel
24th June 2007, 20:16
Try with the QAbstractItemDelegate::closeEditor signal.

Regards

nowire75
24th June 2007, 22:21
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

marcel
24th June 2007, 22:31
You have access to the default table widget item delegate, therefore you have access to that signal.

Regards

nowire75
25th June 2007, 21:41
Hi,

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


void StarDelegate::commitAndCloseEditor()
{
StarEditor *editor = qobject_cast<StarEditor *>(sender());
emit commitData(editor);
emit closeEditor(editor);
qDebug("commitData and closeEditor");
}

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

marcel
25th June 2007, 22:01
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?

nowire75
25th June 2007, 22:54
I thought you needed to see when the editing is finished

yes



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