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
16class QDESIGNER_WIDGET_EXPORT InformationIdEdit
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 {
55 return true;
56 };
57
61 void setTypeId(gii::TypeId typeId);
62
66 [[nodiscard]] gii::TypeId getTypeId() const;
67
68 protected:
72 void focusOutEvent(QFocusEvent* event) override;
73
74 protected:
78 void resizeEvent(QResizeEvent*) override;
79
80 private:
84 QToolButton* btnOpenDialog;
88 gii::TypeId _typeId;
89};
90
91}// namespace sf
Line edit having a button.
Definition InformationIdEdit.h:19
bool isRequiredProperty(const QString &name) override
Overridden from base class sf::ObjectExtension.
Definition InformationIdEdit.h:53
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
InformationTypes::id_type IdType
Short type definition for Qt code.
Definition Namespace.h:16
TypeId
Types of id's.
Definition Namespace.h:22
Definition Application.h:10