Scanframe Modular Application 0.1.0
Loading...
Searching...
No Matches
ObjectExtension.h
Go to the documentation of this file.
1#pragma once
2#include <QObject>
3#include <QtDesigner/QAbstractFormBuilder>
4#include <misc/global.h>
5
6namespace sf
7{
8
9// Forward declaration.
11
17{
18 protected:
23 explicit ObjectExtension(QObject* object);
24
28 virtual ~ObjectExtension() = default;
29
30 public:
36 virtual bool isRequiredProperty(const QString& name) = 0;
37
43
48 [[nodiscard]] virtual bool getSaveChildren() const;
49
54 static bool inDesigner();
55
63 static QObject* getExtensionParent(QObject* obj, bool first = true);
64
65 private:
69 QObject* _object;
70};
71
72}// namespace sf
Interface class to multiple inherit when the sf::FormWriter class needs to be restricted in writing o...
Definition ObjectExtension.h:17
ObjectExtension(QObject *object)
Protected constructor only. Inlined so no external libs are need for designer.
static bool inDesigner()
Gets the designer status.
virtual bool getSaveChildren() const
Gets if the children needs saving by the FormBuilder class.
static QObject * getExtensionParent(QObject *obj, bool first=true)
Return if the passed object has this type as parent. It starts by testing the passed object itself.
virtual ~ObjectExtension()=default
Virtual destructor.
virtual bool isRequiredProperty(const QString &name)=0
Returns true if a property is to be saved to file.
virtual void addPropertyPages(PropertySheetDialog *sheet)
Adds the pages specific for this object.
Dialog containing multiple property pages.
Definition qt/PropertySheetDialog.h:14
#define _MISC_CLASS
Definition misc/global.h:40
Definition Application.h:10
class _MISC_CLASS PropertySheetDialog
Definition gen/PropertySheetDialog.h:18