diff options
| author | 2014-12-06 17:33:25 -0500 | |
|---|---|---|
| committer | 2014-12-06 17:33:25 -0500 | |
| commit | 7167ce41b61d2ba2cdb526777a4233eb84a3b66a (patch) | |
| tree | a35c14143716e1f2c98f808c81f89426045a946f /SQLiteStudio3/guiSQLiteStudio/common/configcombobox.h | |
Imported Upstream version 2.99.6upstream/2.99.6
Diffstat (limited to 'SQLiteStudio3/guiSQLiteStudio/common/configcombobox.h')
| -rw-r--r-- | SQLiteStudio3/guiSQLiteStudio/common/configcombobox.h | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/SQLiteStudio3/guiSQLiteStudio/common/configcombobox.h b/SQLiteStudio3/guiSQLiteStudio/common/configcombobox.h new file mode 100644 index 0000000..dd4c71c --- /dev/null +++ b/SQLiteStudio3/guiSQLiteStudio/common/configcombobox.h @@ -0,0 +1,34 @@ +#ifndef CONFIGCOMBOBOX_H +#define CONFIGCOMBOBOX_H + +#include "guiSQLiteStudio_global.h" +#include <QComboBox> + +/** + * @brief Config-oriented combo box. + * + * It's just like a regular QComboBox, except it honors additional Qt dynamic property + * called "modelName". The "modelName" property should name a CfgEntry key (together with its category, + * just like "cfg" properties for CfgEntry linked widgets), that is of QStringList type. + * The QStringList is used as a data model for QComboBox. Every time that the CfgEntry + * with QStringList changes, the combo box data entries are updated. + */ +class GUI_API_EXPORT ConfigComboBox : public QComboBox +{ + Q_OBJECT + + Q_PROPERTY(QVariant modelName READ getModelName WRITE setModelName) + + public: + explicit ConfigComboBox(QWidget* parent = 0); + + QVariant getModelName() const; + + public slots: + void setModelName(QVariant arg); + + private: + QVariant modelName; +}; + +#endif // CONFIGCOMBOBOX_H |
