Hi
you could find all QDoubleSpinBox in mainwindow and then loop them
and do the setting of filter on each.
QList<QDoubleSpinBox *> spins = MainWindow->findChildren<QDoubleSpinBox *>();
http://doc.qt.io/qt-5/qobject.html#findChildren
Hi
you could find all QDoubleSpinBox in mainwindow and then loop them
and do the setting of filter on each.
QList<QDoubleSpinBox *> spins = MainWindow->findChildren<QDoubleSpinBox *>();
http://doc.qt.io/qt-5/qobject.html#findChildren
Last edited by Metavoid; 8th February 2016 at 08:19.
Derive from QDoubleSpinBox, implement the customization, use your spinbox instead of the default one.
Then you don't have to do anything in MainWindow::MainWindow() other then calling setupUi();
Cheers,
_
1) derive a custom class from QDoubleSpinBox
2) implement the event filter in that class and install it on "this" and on the line edit (you have direct access to the line edit through a protected method declared in the base class)
3) Use designer's "promote widget" function to replace the QDoubleSpinBoxes with your class.
Cheers,
_
Bookmarks