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 --- .../configwidgets/combodatawidget.h | 35 ++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 SQLiteStudio3/guiSQLiteStudio/configwidgets/combodatawidget.h (limited to 'SQLiteStudio3/guiSQLiteStudio/configwidgets/combodatawidget.h') diff --git a/SQLiteStudio3/guiSQLiteStudio/configwidgets/combodatawidget.h b/SQLiteStudio3/guiSQLiteStudio/configwidgets/combodatawidget.h new file mode 100644 index 0000000..302186e --- /dev/null +++ b/SQLiteStudio3/guiSQLiteStudio/configwidgets/combodatawidget.h @@ -0,0 +1,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 -- cgit v1.2.3