From 7167ce41b61d2ba2cdb526777a4233eb84a3b66a Mon Sep 17 00:00:00 2001 From: Unit 193 Date: Sat, 6 Dec 2014 17:33:25 -0500 Subject: Imported Upstream version 2.99.6 --- .../guiSQLiteStudio/common/configcombobox.h | 34 ++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 SQLiteStudio3/guiSQLiteStudio/common/configcombobox.h (limited to 'SQLiteStudio3/guiSQLiteStudio/common/configcombobox.h') 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 + +/** + * @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 -- cgit v1.2.3