Scanframe Modular Application 0.1.0
Loading...
Searching...
No Matches
InformationIdEdit.h
Go to the documentation of this file.
1#pragma once
2#include <QLineEdit>
3#include <QtUiPlugin/QDesignerExportWidget>
5#include <gii/global.h>
7#include <gii/qt/Namespace.h>
9
10namespace sf
11{
12
17 : public QLineEdit
18 , public ObjectExtension
19{
20 public:
21 // Declarations in these macros are made private.
22 Q_OBJECT
23 // Need full namespace for this property macro.
24 Q_PROPERTY(sf::gii::TypeId typeId READ getTypeId WRITE setTypeId)
25
26 public:
30 explicit InformationIdEdit(QWidget* parent = nullptr);
31
36
41
48 bool selectDialog(QWidget* parent = nullptr);
49
53 bool isRequiredProperty(const QString& name) override;
54
58 void setTypeId(gii::TypeId typeId);
59
63 [[nodiscard]] gii::TypeId getTypeId() const;
64
65 protected:
69 void focusOutEvent(QFocusEvent* event) override;
70
71 protected:
75 void resizeEvent(QResizeEvent*) override;
76
77 private:
81 QToolButton* btnOpenDialog;
85 gii::TypeId _typeId;
86};
87
88}// namespace sf
Line edit having a button.
Definition InformationIdEdit.h:19
bool isRequiredProperty(const QString &name) override
Overridden from base class sf::ObjectExtension.
void setTypeId(gii::TypeId typeId)
Set the type of id set with setId().
gii::IdType getId()
Gets the id from the text in the line edit.
void focusOutEvent(QFocusEvent *event) override
overridden from base class.
InformationIdEdit(QWidget *parent=nullptr)
void setId(gii::IdType id)
Sets the id in the line edit.
gii::TypeId getTypeId() const
Gets the type of id set with setId().
void resizeEvent(QResizeEvent *) override
Overridden from base class QLineEdit.
bool selectDialog(QWidget *parent=nullptr)
Opens the id selection dialog.
Interface class to multiple inherit when the sf::FormWriter class needs to be restricted in writing o...
Definition ObjectExtension.h:17
#define _GII_CLASS
Definition gii/global.h:38
TypeId
Types of id's.
Definition gii/qt/Namespace.h:22
InformationTypes::id_type IdType
Short type definition for Qt code.
Definition gii/qt/Namespace.h:16
Definition Application.h:10