Qwheeledit hide of edition widget and returnPressed forwarding
Our scientist asked for few things in the TaurusWheelEdit:
- Values should be applied not only with an enter, but also with a custom button.
- When edition widget is shown, it should not disappear on focusOut.
- Accepting value from the edition widget should also write an attribute.
To achieve this I had to change the way the edition widget is hide in qwheel
module. First of all variable _editing
is set in method hiding and showing editing widget now, because earlier there were some cases, where this variable didn't changed properly (edition widget was hidden but _editing
was set to True) and I didn't want to change it in the application, as it is supposed to be private. I think it should be now more consistent.
3rd point: I make this with emitting QWheelEdit.returnPressed
when edition widget's returnPressed
is emitted.
2nd and 3rd points are disabled by default.
In the application I made a button connected to 3 methods
set_button = QtGui.QPushButton()
set_button.setText("Apply")
set_button.clicked.connect(taurus_wheel_edit.editingFinished)
set_button.clicked.connect(taurus_wheel_edit.returnPressed)
set_button.clicked.connect(taurus_wheel_edit.hideEditWidget)
Can you tell me if this approach is ok? Anyway, if anyone will find this useful and it's ok, feel free to merge it.