QGIS API Documentation 4.1.0-Master (376402f9aeb)
Loading...
Searching...
No Matches
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
20#include "qgseditformconfig.h"
21#include "qgsfields.h"
22
23#include <QMap>
24
26
27class QgsEditFormConfigPrivate : public QSharedData
28{
29 public:
30 QgsEditFormConfigPrivate()
31 : mInvisibleRootContainer( new QgsAttributeEditorContainer( QString(), nullptr ) )
32 {}
33
34 QgsEditFormConfigPrivate( const QgsEditFormConfigPrivate &o )
35 : QSharedData( o )
36 , mInvisibleRootContainer( static_cast<QgsAttributeEditorContainer *>( o.mInvisibleRootContainer->clone( nullptr ) ) )
37 , mConfiguredRootContainer( o.mConfiguredRootContainer )
38 , mFieldEditables( o.mFieldEditables )
39 , mLabelOnTop( o.mLabelOnTop )
40 , mReuseLastValuePolicy( o.mReuseLastValuePolicy )
41 , mDataDefinedFieldProperties( o.mDataDefinedFieldProperties )
42 , mWidgetConfigs( o.mWidgetConfigs )
43 , mEditorLayout( o.mEditorLayout )
44 , mUiFormPath( o.mUiFormPath )
45 , mInitFunction( o.mInitFunction )
46 , mInitFilePath( o.mInitFilePath )
47 , mInitCodeSource( o.mInitCodeSource )
48 , mInitCode( o.mInitCode )
49 , mSuppressForm( o.mSuppressForm )
50 , mFields( o.mFields )
51 {}
52
53 ~QgsEditFormConfigPrivate() { delete mInvisibleRootContainer; }
54
55 static QgsPropertiesDefinition &propertyDefinitions()
56 {
57 static QgsPropertiesDefinition sPropertyDefinitions {
58 { static_cast< int >( QgsEditFormConfig::DataDefinedProperty::Alias ), QgsPropertyDefinition( "dataDefinedAlias", QObject::tr( "Alias" ), QgsPropertyDefinition::String ) },
59 { static_cast< int >( QgsEditFormConfig::DataDefinedProperty::Editable ), QgsPropertyDefinition( "dataDefinedEditable", QObject::tr( "Editable" ), QgsPropertyDefinition::Boolean ) },
61 QgsPropertyDefinition( "dataDefinedCustomComment", QObject::tr( "CustomComment" ), QgsPropertyDefinition::String ) },
62 };
63 return sPropertyDefinitions;
64 };
65
67 QgsAttributeEditorContainer *mInvisibleRootContainer = nullptr;
68
70 bool mConfiguredRootContainer = false;
71
72 QMap< QString, bool> mFieldEditables;
73 QMap< QString, bool> mLabelOnTop;
74 QMap< QString, Qgis::AttributeFormReuseLastValuePolicy> mReuseLastValuePolicy;
75 QMap< QString, QgsPropertyCollection> mDataDefinedFieldProperties;
76
77 QMap<QString, QVariantMap > mWidgetConfigs;
78
81
83 QString mUiFormPath;
85 QString mInitFunction;
87 QString mInitFilePath;
91 QString mInitCode;
92
95
96 QgsFields mFields;
97
98 private:
99 QgsEditFormConfigPrivate &operator=( const QgsEditFormConfigPrivate & ) = delete;
100};
101
102
104
105#endif // QGSEDITFORMCONFIG_P_H
AttributeFormSuppression
Available form types for layout of the attribute form editor.
Definition qgis.h:6012
@ Default
Use the application-wide setting.
Definition qgis.h:6013
AttributeFormPythonInitCodeSource
The Python init code source for attribute forms.
Definition qgis.h:6027
@ NoSource
Do not use Python code at all.
Definition qgis.h:6028
AttributeFormLayout
Available form types for layout of the attribute form editor.
Definition qgis.h:5997
@ AutoGenerated
Autogenerate a simple tabular layout for the form.
Definition qgis.h:5998
@ String
Any string value.
Definition qgsproperty.h:60
@ Boolean
Boolean value.
Definition qgsproperty.h:52
QMap< int, QgsPropertyDefinition > QgsPropertiesDefinition
Definition of available properties.