aboutsummaryrefslogtreecommitdiffstats
path: root/SQLiteStudio3/guiSQLiteStudio/common/configcombobox.h
blob: dd4c71c539f22a1702bfc242eabe6ef6b3c37a9c (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
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