Function to update all autowidgets
This commit is contained in:
@@ -24,7 +24,7 @@
|
||||
|
||||
#include <QCheckBox>
|
||||
|
||||
class AutoBitsetCheckBox: public QCheckBox, AutoWidget
|
||||
class AutoBitsetCheckBox: public QCheckBox, public AutoWidget
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
|
||||
#include <QCheckBox>
|
||||
|
||||
class AutoCheckBox : public QCheckBox, AutoWidget
|
||||
class AutoCheckBox : public QCheckBox, public AutoWidget
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
|
||||
@@ -26,7 +26,7 @@
|
||||
|
||||
#include <QComboBox>
|
||||
|
||||
class AutoComboBox : public QComboBox, AutoWidget
|
||||
class AutoComboBox : public QComboBox, public AutoWidget
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
|
||||
@@ -28,7 +28,7 @@
|
||||
#include <math.h>
|
||||
#endif
|
||||
|
||||
class AutoDoubleSpinBox : public QDoubleSpinBox, AutoWidget
|
||||
class AutoDoubleSpinBox : public QDoubleSpinBox, public AutoWidget
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
|
||||
@@ -27,7 +27,7 @@
|
||||
|
||||
class QRegExpValidator;
|
||||
|
||||
class AutoHexSpinBox : public QSpinBox, AutoWidget
|
||||
class AutoHexSpinBox : public QSpinBox, public AutoWidget
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
|
||||
#include <QLabel>
|
||||
|
||||
class AutoLabel: public QLabel, AutoWidget
|
||||
class AutoLabel: public QLabel, public AutoWidget
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
#include <QLineEdit>
|
||||
#include <QRegExpValidator>
|
||||
|
||||
class AutoLineEdit: public QLineEdit, AutoWidget
|
||||
class AutoLineEdit: public QLineEdit, public AutoWidget
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
#include <QComboBox>
|
||||
#include <QString>
|
||||
|
||||
class AutoPrecisionComboBox : public QComboBox, AutoWidget
|
||||
class AutoPrecisionComboBox : public QComboBox, public AutoWidget
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
|
||||
#include <QSlider>
|
||||
|
||||
class AutoSlider : public QSlider, AutoWidget
|
||||
class AutoSlider : public QSlider, public AutoWidget
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
|
||||
#include <QSpinBox>
|
||||
|
||||
class AutoSpinBox : public QSpinBox, AutoWidget
|
||||
class AutoSpinBox : public QSpinBox, public AutoWidget
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
|
||||
#include <QTimeEdit>
|
||||
|
||||
class AutoTimeEdit : public QTimeEdit, AutoWidget
|
||||
class AutoTimeEdit : public QTimeEdit, public AutoWidget
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
|
||||
@@ -25,6 +25,8 @@ class GenericPanel;
|
||||
// Note: cannot be a Qt object otherwise it will create a compiler ambiguity in the inheriting class
|
||||
class AutoWidget
|
||||
{
|
||||
friend class GenericPanel;
|
||||
|
||||
public:
|
||||
explicit AutoWidget();
|
||||
~AutoWidget();
|
||||
|
||||
@@ -19,6 +19,7 @@
|
||||
*/
|
||||
|
||||
#include "genericpanel.h"
|
||||
#include "autowidget.h"
|
||||
|
||||
#include <TimerEdit>
|
||||
#include <QComboBox>
|
||||
@@ -127,3 +128,13 @@ void GenericPanel::disableMouseScrolling()
|
||||
foreach(QWidget * te, findChildren<TimerEdit*>())
|
||||
setFocusFilter(te);
|
||||
}
|
||||
|
||||
void GenericPanel::updateAutoWidgets()
|
||||
{
|
||||
foreach(QWidget *wdgt, findChildren<QWidget *>()) {
|
||||
AutoWidget *autowdgt = dynamic_cast<AutoWidget *>(wdgt);
|
||||
if (autowdgt) {
|
||||
autowdgt->updateValue();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -58,4 +58,5 @@ class GenericPanel : public QWidget
|
||||
virtual bool eventFilter(QObject *obj, QEvent *event);
|
||||
void setFocusFilter(QWidget * w);
|
||||
void disableMouseScrolling();
|
||||
void updateAutoWidgets();
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user