When the QListWidgetItem exit editing which signal will be sent?
-
the item delegate of your item view is responsible for the editor widget.
So you can use it to get notified whenever the editor widget closes:
@
QAbstractItemDelegate* delegate = listWidget->itemDelegate();
connect( delegate, SIGNAL(closeEditor(QWidget *, QAbstractItemDelegate::EndEditHint)), this, SLOT(...) );
@Or do you want to close the editor?
This should also be already handled by the delegate on pressing ESC key (IIRC) and on focus out. -
[quote author="raven-worx" date="1384327903"]the item delegate of your item view is responsible for the editor widget.
So you can use it to get notified whenever the editor widget closes:
@
QAbstractItemDelegate* delegate = listWidget->itemDelegate();
connect( delegate, SIGNAL(closeEditor(QWidget *, QAbstractItemDelegate::EndEditHint)), this, SLOT(...) );
@Or do you want to close the editor?
This should also be already handled by the delegate on pressing ESC key (IIRC) and on focus out.[/quote]Yes, I want to close the editor when focus out.
If I select another cell in the QTableView the editor is cloesed.
But when I click the blank area in the QTableView or I click other widgets in the QMainWindow the editor just lost the focus. It doesn't close.The SpinBox delegate works well it can be closed when focus out.
-
are you using a custom delegate?
-
and why don't you provide such important information beforehand?
And which type of widget is your editor? Can it even have the focus and thus a focus out event?
Did you reimplement the event filter in the delegate or do you just create the editor widget in there? -
[quote author="raven-worx" date="1384847896"]and why don't you provide such important information beforehand?
And which type of widget is your editor? Can it even have the focus and thus a focus out event?
Did you reimplement the event filter in the delegate or do you just create the editor widget in there?[/quote]I'm so sorry, my English is poor. so I forgot to provide these information.
OK, my question is :
I create two delegates for the QTableView.
SpinBoxDelegate's editor is QSpinbox,
ListDelegate's editor is QListWidget.I set the editable flag for the QListWidget's items so I could change the value in the QListWidget editor.
It works well. The only problem is that when the QListWidget editor is shown and I click the blank area in the QTableView or click other QWidgets in the QMainWindow , the QListwidget editor is still shown.
it didn't close automatically.If I click other cell in the QTableView, this editor will close automatically.
-
[quote author="raven-worx" date="1384847896"]
And which type of widget is your editor? Can it even have the focus and thus a focus out event?[/quote]Edit: just post the code of the delegate that isn't working...