File: configcombobox.h

package info (click to toggle)
sqlitestudio 3.4.21%2Bds-1
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 54,880 kB
  • sloc: ansic: 406,208; cpp: 123,872; yacc: 2,692; tcl: 497; sh: 462; xml: 426; makefile: 19
file content (34 lines) | stat: -rw-r--r-- 984 bytes parent folder | download
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