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

Malyushytsky, Alex alex at wai.com
Thu Oct 6 01:15:51 CEST 2011


If I am not mistaken such design existed in all earlier version I worked with ( starting with Qt 3.0 )
It might be some reasons under it, but I do find it weird.
It would be more natural to apply changes before editing widget loses focus.
You don't need to subclass editing widget, but may install even filter and catch focusOutEvent

Regards,
   Alex



-----Original Message-----
From: qt-interest-bounces+alex=wai.com at qt.nokia.com [mailto:qt-interest-bounces+alex=wai.com at qt.nokia.com] On Behalf Of MARTIN Pierre
Sent: Wednesday, September 28, 2011 2:41 AM
To: qt-interest at qt.nokia.com
Subject: [Qt-interest] Edition widget and push buttons, notification order is wrong?

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.

_______________________________________________
Qt-interest mailing list
Qt-interest at qt.nokia.com
http://lists.qt.nokia.com/mailman/listinfo/qt-interest


---------------------------------------------------------------------------------------------------
Weidlinger Associates, Inc. made the following annotations.

“This message and any attachments are solely for the intended recipient and may contain confidential or privileged information. If you are not the intended recipient, any disclosure, copying, use, or distribution of the information included in this message and any attachments is prohibited. If you have received this communication in error, please notify us by reply e-mail and immediately and permanently delete this message and any attachments. Thank you.”

“Please consider our environment before printing this email.”


More information about the Qt-interest-old mailing list