Scanframe Modular Application 0.1.0
Loading...
Searching...
No Matches
VariableWidgetBase.h
Go to the documentation of this file.
1#pragma once
2#include <QFrame>
3#include <QtUiPlugin/QDesignerExportWidget>
4#include <gii/qt/Namespace.h>
6
7namespace sf
8{
9
13class Variable;
14
19 : public QWidget
20 , public ObjectExtension
21{
22 Q_OBJECT
23 Q_PROPERTY(qulonglong idVariable READ getId WRITE setId)
24 Q_PROPERTY(bool converted READ getConverted WRITE setConverted)
25 Q_PROPERTY(bool readOnly READ getReadOnly WRITE setReadOnly)
26 Q_PROPERTY(bool useTemporary READ isTemporary WRITE setTemporary)
27
28 public:
32 explicit VariableWidgetBase(QWidget* parent, QObject* self);
33
37 ~VariableWidgetBase() override;
38
43
47 void setId(gii::IdType id);
48
52 gii::IdType getId() const;
53
58
62 void setConverted(bool) const;
63
67 bool getConverted() const;
68
72 void setReadOnly(bool);
73
77 bool getReadOnly() const;
78
82 bool isTemporary() const;
83
87 void setTemporary(bool);
88
92 bool isRequiredProperty(const QString& name) override;
93
98 static const char* propertyNameEditorObject();
99
100 Q_SIGNALS:
104 void valueChange(QWidget* widget);
105
106 protected:
111 virtual void applyReadOnly(bool yn) = 0;
112
116 class PrivateBase;
120 PrivateBase* _p{nullptr};
121
122 private:
123 typedef QWidget base_type;
124};
125
126}// namespace sf
ObjectExtension(QObject *object)
Protected constructor only. Inlined so no external libs are need for designer.
Dialog containing multiple property pages.
Definition qt/PropertySheetDialog.h:15
bool isRequiredProperty(const QString &name) override
Overridden from base class 'ObjectExtension' to write only the properties that mean anything.
void valueChange(QWidget *widget)
Signal when the value of the variable has changed.
void setTemporary(bool)
Sets the use of a temporary value when used in forms.
bool isTemporary() const
Gets the use of a temporary value.
void setConverted(bool) const
Property 'converted' set method.
PrivateBase * _p
Holds the private object or a derived one.
Definition VariableWidgetBase.h:120
bool useTemporary
Definition VariableWidgetBase.h:26
bool converted
Definition VariableWidgetBase.h:24
static const char * propertyNameEditorObject()
Property name of the property which guides the layout editor to the proper parent.
bool readOnly
Definition VariableWidgetBase.h:25
void setId(gii::IdType id)
Property 'variableId' set method.
virtual void applyReadOnly(bool yn)=0
bool getReadOnly() const
Property 'converted' get method.
void setReadOnly(bool)
Property 'converted' set method.
VariableWidgetBase(QWidget *parent, QObject *self)
Constructor.
bool getConverted() const
Property 'converted' get method.
Variable & getVariable() const
Gets the reference to the underlying Variable instance.
qulonglong idVariable
Definition VariableWidgetBase.h:23
gii::IdType getId() const
Property 'variableId' get method.
void addPropertyPages(PropertySheetDialog *sheet) override
Overridden from base class sf::ObjectExtension::addPropertyPages().
Class for creating and referencing global or local created parameters or settings called variables....
Definition Variable.h:16
#define _GII_CLASS
Definition gii/global.h:38
Definition gii/qt/Namespace.h:9
Definition Application.h:10