2012-01-06 16:09:03 +00:00
|
|
|
#ifndef _PAYSAGES_QT_BASEINPUT_H_
|
|
|
|
#define _PAYSAGES_QT_BASEINPUT_H_
|
2012-01-05 18:39:17 +00:00
|
|
|
|
2013-11-14 20:46:47 +00:00
|
|
|
#include "desktop_global.h"
|
|
|
|
|
2013-08-23 22:50:56 +00:00
|
|
|
#include <QObject>
|
|
|
|
class QWidget;
|
|
|
|
class QLabel;
|
2012-01-05 18:39:17 +00:00
|
|
|
|
2013-11-14 20:46:47 +00:00
|
|
|
namespace paysages {
|
|
|
|
namespace desktop {
|
|
|
|
|
2012-01-05 18:39:17 +00:00
|
|
|
class BaseInput:public QObject
|
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
public:
|
|
|
|
BaseInput(QWidget* form, QString label);
|
2013-08-23 22:50:56 +00:00
|
|
|
inline QLabel* label() {return _label;}
|
2012-01-05 18:39:17 +00:00
|
|
|
inline QWidget* preview() {return _preview;}
|
|
|
|
inline QWidget* control() {return _control;}
|
2012-06-23 22:11:25 +00:00
|
|
|
void setVisibilityCondition(int* value, int condition);
|
2012-07-04 15:47:22 +00:00
|
|
|
void setEnabledCondition(int* value, int condition);
|
2012-01-05 18:39:17 +00:00
|
|
|
|
|
|
|
public slots:
|
2012-01-08 10:31:01 +00:00
|
|
|
virtual void updatePreview();
|
|
|
|
virtual void revert();
|
2012-01-05 19:41:10 +00:00
|
|
|
virtual void applyValue();
|
2012-06-27 14:03:19 +00:00
|
|
|
void checkVisibility(bool enabled);
|
2012-01-05 18:39:17 +00:00
|
|
|
|
|
|
|
signals:
|
|
|
|
void valueChanged();
|
|
|
|
|
|
|
|
protected:
|
2012-04-14 15:52:16 +00:00
|
|
|
QLabel* _label;
|
2012-01-05 18:39:17 +00:00
|
|
|
QWidget* _preview;
|
|
|
|
QWidget* _control;
|
2012-06-23 22:11:25 +00:00
|
|
|
int* _visibility_value;
|
|
|
|
int _visibility_condition;
|
2012-07-04 15:47:22 +00:00
|
|
|
int* _enabled_value;
|
|
|
|
int _enabled_condition;
|
2012-06-23 22:11:25 +00:00
|
|
|
bool _visible;
|
2012-06-27 14:03:19 +00:00
|
|
|
bool _enabled;
|
2012-01-05 18:39:17 +00:00
|
|
|
};
|
|
|
|
|
2013-11-14 20:46:47 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2012-04-14 15:52:16 +00:00
|
|
|
#endif
|