Default ctors for LED checkbox and LCD spinbox. Fixes for knob.

This commit is contained in:
Johannes Lorenz
2014-04-15 13:43:23 +02:00
parent f32f7689b4
commit 51ed1105df
6 changed files with 140 additions and 55 deletions

View File

@@ -35,8 +35,8 @@ class EXPORT LcdWidget : public QWidget
{
Q_OBJECT
public:
LcdWidget( QWidget* parent, const QString& name = QString::null );
LcdWidget( int numDigits, QWidget* parent, const QString& name = QString::null );
LcdWidget( int numDigits, const QString& style, QWidget* parent, const QString& name = QString::null );
virtual ~LcdWidget();
@@ -50,6 +50,10 @@ public:
update();
}
Q_PROPERTY( int numDigits READ numDigits WRITE setNumDigits )
inline int numDigits() const { return m_numDigits; }
inline void setNumDigits( int n ) { m_numDigits = n; updateSize(); }
public slots:
virtual void setMarginWidth( int _width );
@@ -82,6 +86,8 @@ private:
int m_numDigits;
int m_marginWidth;
void initUi( const QString& name, const QString &style = QString("19green") ); //!< to be called by ctors
} ;
#endif

View File

@@ -66,7 +66,8 @@ class EXPORT knob : public QWidget, public FloatModelView
Q_PROPERTY(knobTypes knobNum READ knobNum WRITE setknobNum)
void init( const QString & _name ); //!< to be called by ctors
void initUi( const QString & _name ); //!< to be called by ctors
void onKnobNumUpdated(); //!< to be called when you updated @a m_knobNum
public:
knob( knobTypes _knob_num, QWidget * _parent = NULL, const QString & _name = QString() );

View File

@@ -47,6 +47,10 @@ public:
ledCheckBox( const QString & _txt, QWidget * _parent,
const QString & _name = QString::null,
LedColors _color = Yellow );
ledCheckBox( QWidget * _parent,
const QString & _name = QString::null,
LedColors _color = Yellow );
virtual ~ledCheckBox();
@@ -55,6 +59,9 @@ public:
return( m_text );
}
void setText( const QString& s );
Q_PROPERTY( QString text READ text WRITE setText )
protected:
virtual void paintEvent( QPaintEvent * _pe );
@@ -66,6 +73,9 @@ private:
QString m_text;
void initUi( LedColors _color ); //!< to be called by ctors
void onTextUpdated(); //!< to be called when you updated @a m_text
} ;
#endif