Commit c92f962f authored by Rafaël Carré's avatar Rafaël Carré

qt4 preferences: the label is not mandatory in object constructor

parent 1359fbd1
...@@ -117,8 +117,8 @@ public: ...@@ -117,8 +117,8 @@ public:
QLabel*, QSlider* ); QLabel*, QSlider* );
virtual ~IntegerConfigControl() {}; virtual ~IntegerConfigControl() {};
virtual int getValue(); virtual int getValue();
virtual void show() { spin->show(); label->show(); } virtual void show() { spin->show(); if( label ) label->show(); }
virtual void hide() { spin->hide(); label->hide(); } virtual void hide() { spin->hide(); if( label ) label->hide(); }
protected: protected:
QSpinBox *spin; QSpinBox *spin;
...@@ -161,8 +161,8 @@ public: ...@@ -161,8 +161,8 @@ public:
QComboBox*, bool ); QComboBox*, bool );
virtual ~IntegerListConfigControl() {}; virtual ~IntegerListConfigControl() {};
virtual int getValue(); virtual int getValue();
virtual void hide() { combo->hide(); label->hide(); } virtual void hide() { combo->hide(); if( label ) label->hide(); }
virtual void show() { combo->show(); label->show(); } virtual void show() { combo->show(); if( label ) label->show(); }
private: private:
void finish( bool ); void finish( bool );
QLabel *label; QLabel *label;
...@@ -211,8 +211,8 @@ public: ...@@ -211,8 +211,8 @@ public:
QLabel*, QDoubleSpinBox* ); QLabel*, QDoubleSpinBox* );
virtual ~FloatConfigControl() {}; virtual ~FloatConfigControl() {};
virtual float getValue(); virtual float getValue();
virtual void show() { spin->show(); label->show(); } virtual void show() { spin->show(); if( label ) label->show(); }
virtual void hide() { spin->hide(); label->hide(); } virtual void hide() { spin->hide(); if( label ) label->hide(); }
protected: protected:
QDoubleSpinBox *spin; QDoubleSpinBox *spin;
...@@ -260,8 +260,8 @@ public: ...@@ -260,8 +260,8 @@ public:
QLineEdit*, bool pwd ); QLineEdit*, bool pwd );
virtual ~StringConfigControl() {}; virtual ~StringConfigControl() {};
virtual QString getValue() { return text->text(); }; virtual QString getValue() { return text->text(); };
virtual void show() { text->show(); label->show(); } virtual void show() { text->show(); if( label ) label->show(); }
virtual void hide() { text->hide(); label->hide(); } virtual void hide() { text->hide(); if( label ) label->hide(); }
private: private:
void finish(); void finish();
QLineEdit *text; QLineEdit *text;
...@@ -278,8 +278,8 @@ public: ...@@ -278,8 +278,8 @@ public:
QLineEdit *, QPushButton *, bool pwd ); QLineEdit *, QPushButton *, bool pwd );
virtual ~FileConfigControl() {}; virtual ~FileConfigControl() {};
virtual QString getValue() { return text->text(); }; virtual QString getValue() { return text->text(); };
virtual void show() { text->show(); label->show(); browse->show(); } virtual void show() { text->show(); if( label ) label->show(); browse->show(); }
virtual void hide() { text->hide(); label->hide(); browse->hide(); } virtual void hide() { text->hide(); if( label ) label->hide(); browse->hide(); }
public slots: public slots:
virtual void updateField(); virtual void updateField();
protected: protected:
...@@ -324,8 +324,8 @@ public: ...@@ -324,8 +324,8 @@ public:
QComboBox*, bool ); QComboBox*, bool );
virtual ~ModuleConfigControl() {}; virtual ~ModuleConfigControl() {};
virtual QString getValue(); virtual QString getValue();
virtual void hide() { combo->hide(); label->hide(); } virtual void hide() { combo->hide(); if( label ) label->hide(); }
virtual void show() { combo->show(); label->show(); } virtual void show() { combo->show(); if( label ) label->show(); }
private: private:
void finish( bool ); void finish( bool );
QLabel *label; QLabel *label;
...@@ -367,8 +367,8 @@ public: ...@@ -367,8 +367,8 @@ public:
QComboBox*, bool ); QComboBox*, bool );
virtual ~StringListConfigControl() {}; virtual ~StringListConfigControl() {};
virtual QString getValue(); virtual QString getValue();
virtual void hide() { combo->hide(); label->hide(); } virtual void hide() { if( combo ) combo->hide(); if( label ) label->hide(); }
virtual void show() { combo->show(); label->show(); } virtual void show() { if( combo ) combo->show(); if( label ) label->show(); }
private: private:
void finish( bool ); void finish( bool );
QLabel *label; QLabel *label;
...@@ -422,8 +422,8 @@ public: ...@@ -422,8 +422,8 @@ public:
QGridLayout*, int& ); QGridLayout*, int& );
virtual int getType() { return 4; } virtual int getType() { return 4; }
virtual ~KeySelectorControl() {}; virtual ~KeySelectorControl() {};
virtual void hide() { table->hide(); label->hide(); } virtual void hide() { table->hide(); if( label ) label->hide(); }
virtual void show() { table->show(); label->show(); } virtual void show() { table->show(); if( label ) label->show(); }
void doApply(); void doApply();
private: private:
void finish(); void finish();
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment