QGIS API Documentation  3.16.0-Hannover (43b64b13f3)
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
7  email : [email protected]
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"
22 
24 
25 class QgsEditFormConfigPrivate : public QSharedData
26 {
27  public:
28  QgsEditFormConfigPrivate()
29  : mInvisibleRootContainer( new QgsAttributeEditorContainer( QString(), nullptr ) )
30  {}
31 
32  QgsEditFormConfigPrivate( const QgsEditFormConfigPrivate &o )
33  : QSharedData( o )
34  , mInvisibleRootContainer( static_cast<QgsAttributeEditorContainer *>( o.mInvisibleRootContainer->clone( nullptr ) ) )
35  , mConfiguredRootContainer( o.mConfiguredRootContainer )
36  , mFieldEditables( o.mFieldEditables )
37  , mLabelOnTop( o.mLabelOnTop )
38  , mDataDefinedFieldProperties( o.mDataDefinedFieldProperties )
39  , mWidgetConfigs( o.mWidgetConfigs )
40  , mEditorLayout( o.mEditorLayout )
41  , mUiFormPath( o.mUiFormPath )
42  , mInitFunction( o.mInitFunction )
43  , mInitFilePath( o.mInitFilePath )
44  , mInitCodeSource( o.mInitCodeSource )
45  , mInitCode( o.mInitCode )
46  , mSuppressForm( o.mSuppressForm )
47  , mFields( o.mFields )
48  {}
49 
50  ~QgsEditFormConfigPrivate()
51  {
52  delete mInvisibleRootContainer;
53  }
54 
55  static QgsPropertiesDefinition &propertyDefinitions()
56  {
57  static QgsPropertiesDefinition sPropertyDefinitions
58  {
59  {
60  QgsEditFormConfig::DataDefinedProperty::Alias,
61  QgsPropertyDefinition( "dataDefinedAlias",
62  QObject::tr( "Alias" ),
64  },
65  };
66  return sPropertyDefinitions;
67  };
68 
70  QgsAttributeEditorContainer *mInvisibleRootContainer = nullptr;
71 
73  bool mConfiguredRootContainer = false;
74 
75  QMap< QString, bool> mFieldEditables;
76  QMap< QString, bool> mLabelOnTop;
77  QMap< QString, QgsPropertyCollection> mDataDefinedFieldProperties;
78 
79  QMap<QString, QVariantMap > mWidgetConfigs;
80 
82  QgsEditFormConfig::EditorLayout mEditorLayout = QgsEditFormConfig::EditorLayout::GeneratedLayout;
83 
85  QString mUiFormPath;
87  QString mInitFunction;
89  QString mInitFilePath;
91  QgsEditFormConfig::PythonInitCodeSource mInitCodeSource = QgsEditFormConfig::PythonInitCodeSource::CodeSourceNone;
93  QString mInitCode;
94 
96  QgsEditFormConfig::FeatureFormSuppress mSuppressForm = QgsEditFormConfig::FeatureFormSuppress::SuppressDefault;
97 
98  QgsFields mFields;
99 
100  private:
101  QgsEditFormConfigPrivate &operator= ( const QgsEditFormConfigPrivate & ) = delete;
102 };
103 
104 
106 
107 #endif // QGSEDITFORMCONFIG_P_H
qgsfields.h
QgsEditFormConfig::PythonInitCodeSource
PythonInitCodeSource
The Python init code source options.
Definition: qgseditformconfig.h:94
QgsFields
Container of fields for a vector layer.
Definition: qgsfields.h:45
QgsEditFormConfig::FeatureFormSuppress
FeatureFormSuppress
Types of feature form suppression after feature creation.
Definition: qgseditformconfig.h:83
QgsPropertyDefinition::String
@ String
Any string value.
Definition: qgsproperty.h:62
QgsPropertiesDefinition
QMap< int, QgsPropertyDefinition > QgsPropertiesDefinition
Definition of available properties.
Definition: qgspropertycollection.h:29
QgsPropertyDefinition
Definition for a property.
Definition: qgsproperty.h:48
qgseditformconfig.h
QgsAttributeEditorContainer
This is a container for attribute editors, used to group them visually in the attribute form if it is...
Definition: qgsattributeeditorelement.h:172
QgsEditFormConfig::EditorLayout
EditorLayout
The different types to layout the attribute editor.
Definition: qgseditformconfig.h:46