QGIS API Documentation 3.30.0-'s-Hertogenbosch (f186b8efe0)
qgseditformconfig_p.h
Go to the documentation of this file.
1/***************************************************************************
2 qgseditformconfig_p - %{Cpp:License:ClassName}
3
4 ---------------------
5 begin : 18.8.2016
6 copyright : (C) 2016 by Matthias Kuhn
8 ***************************************************************************
9 * *
10 * This program is free software; you can redistribute it and/or modify *
11 * it under the terms of the GNU General Public License as published by *
12 * the Free Software Foundation; either version 2 of the License, or *
13 * (at your option) any later version. *
14 * *
15 ***************************************************************************/
16#ifndef QGSEDITFORMCONFIG_P_H
17#define QGSEDITFORMCONFIG_P_H
18
19#include <QMap>
20#include "qgsfields.h"
21#include "qgseditformconfig.h"
23
25
26class QgsEditFormConfigPrivate : public QSharedData
27{
28 public:
29 QgsEditFormConfigPrivate()
30 : mInvisibleRootContainer( new QgsAttributeEditorContainer( QString(), nullptr ) )
31 {}
32
33 QgsEditFormConfigPrivate( const QgsEditFormConfigPrivate &o )
34 : QSharedData( o )
35 , mInvisibleRootContainer( static_cast<QgsAttributeEditorContainer *>( o.mInvisibleRootContainer->clone( nullptr ) ) )
36 , mConfiguredRootContainer( o.mConfiguredRootContainer )
37 , mFieldEditables( o.mFieldEditables )
38 , mLabelOnTop( o.mLabelOnTop )
39 , mReuseLastValue( o.mReuseLastValue )
40 , mDataDefinedFieldProperties( o.mDataDefinedFieldProperties )
41 , mWidgetConfigs( o.mWidgetConfigs )
42 , mEditorLayout( o.mEditorLayout )
43 , mUiFormPath( o.mUiFormPath )
44 , mInitFunction( o.mInitFunction )
45 , mInitFilePath( o.mInitFilePath )
46 , mInitCodeSource( o.mInitCodeSource )
47 , mInitCode( o.mInitCode )
48 , mSuppressForm( o.mSuppressForm )
49 , mFields( o.mFields )
50 {}
51
52 ~QgsEditFormConfigPrivate()
53 {
54 delete mInvisibleRootContainer;
55 }
56
57 static QgsPropertiesDefinition &propertyDefinitions()
58 {
59 static QgsPropertiesDefinition sPropertyDefinitions
60 {
61 {
62 QgsEditFormConfig::DataDefinedProperty::Alias,
63 QgsPropertyDefinition( "dataDefinedAlias",
64 QObject::tr( "Alias" ),
66 },
67 {
68 QgsEditFormConfig::DataDefinedProperty::Editable,
69 QgsPropertyDefinition( "dataDefinedEditable",
70 QObject::tr( "Editable" ),
72 },
73 };
74 return sPropertyDefinitions;
75 };
76
78 QgsAttributeEditorContainer *mInvisibleRootContainer = nullptr;
79
81 bool mConfiguredRootContainer = false;
82
83 QMap< QString, bool> mFieldEditables;
84 QMap< QString, bool> mLabelOnTop;
85 QMap< QString, bool> mReuseLastValue;
86 QMap< QString, QgsPropertyCollection> mDataDefinedFieldProperties;
87
88 QMap<QString, QVariantMap > mWidgetConfigs;
89
91 QgsEditFormConfig::EditorLayout mEditorLayout = QgsEditFormConfig::EditorLayout::GeneratedLayout;
92
94 QString mUiFormPath;
96 QString mInitFunction;
98 QString mInitFilePath;
100 QgsEditFormConfig::PythonInitCodeSource mInitCodeSource = QgsEditFormConfig::PythonInitCodeSource::CodeSourceNone;
102 QString mInitCode;
103
105 QgsEditFormConfig::FeatureFormSuppress mSuppressForm = QgsEditFormConfig::FeatureFormSuppress::SuppressDefault;
106
107 QgsFields mFields;
108
109 private:
110 QgsEditFormConfigPrivate &operator= ( const QgsEditFormConfigPrivate & ) = delete;
111};
112
113
115
116#endif // QGSEDITFORMCONFIG_P_H
This is a container for attribute editors, used to group them visually in the attribute form if it is...
EditorLayout
The different types to layout the attribute editor.
FeatureFormSuppress
Types of feature form suppression after feature creation.
PythonInitCodeSource
The Python init code source options.
Container of fields for a vector layer.
Definition: qgsfields.h:45
Definition for a property.
Definition: qgsproperty.h:46
@ String
Any string value.
Definition: qgsproperty.h:60
@ Boolean
Boolean value.
Definition: qgsproperty.h:52
QMap< int, QgsPropertyDefinition > QgsPropertiesDefinition
Definition of available properties.