File: combodatawidget.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 (35 lines) | stat: -rw-r--r-- 1,340 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
35
#ifndef COMBODATAWIDGET_H
#define COMBODATAWIDGET_H

#include "customconfigwidgetplugin.h"
#include "plugins/genericplugin.h"
#include "guiSQLiteStudio_global.h"

/**
 * @brief Config entry handler for combo box items with dynamic data set
 *
 * This config entry handler runs only for specified "assigned key", so even it's implements CustomConfigWidgetPlugin,
 * it's created explicitly for each combo.
 *
 * It is used to convert CfgEntry value to one of combo's entries and set that value in the combo.
 * It also works the other way, of course (from combo value to CfgEntry value).
 *
 * Currently it is used only by ConfigDialog because of its specific case with custom formatter combo,
 * which has dynamic contents based on what's added/removed from the combo.
 */
class GUI_API_EXPORT ComboDataWidget : public GenericPlugin, public CustomConfigWidgetPlugin
{
    public:
        explicit ComboDataWidget(CfgEntry* key);

        bool isConfigForWidget(CfgEntry* key, QWidget* widget);
        void applyConfigToWidget(CfgEntry* key, QWidget* widget, const QVariant& value);
        QVariant getWidgetConfigValue(QWidget* widget, bool& ok);
        const char*getModifiedNotifier() const;
        QString getFilterString(QWidget* widget) const;

    private:
        CfgEntry* assignedKey = nullptr;
};

#endif // COMBODATAWIDGET_H