[Qt-interest] Edition widget and push buttons, notification order is wrong?

MARTIN Pierre hickscorp at gmail.com
Wed Sep 28 11:40:53 CEST 2011


Hello dear list users,

Easy to reproduce:
- Create a very simple widget, containing a QLineEdit or a QDoubleSpinBox (Basically any widget with a read / write and notify Q_PROPERTY having it's USER flag to true).
- Create a push button, and inside the released action put a QDebug to the other field's value.

You will notice that if you are still editing the value within the field when you push the button (Basically if the text field has focus and you have edited the value), it's notify signal is called *after* the button's released signal is emited.

The consequence is very heavy... For instance, when using QDataWidgetMapper with a manual submit policy, if the user still has focused a field managed by this mapper and he pushes the button supposed to save the data, the current field edited value is reverted.

Is there anything i can do except subclassing?

Thanks,
Pierre.




More information about the Qt-interest-old mailing list