QGIS API Documentation 4.0.0-Norrköping (1ddcee3d0e4)
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 ) },
60 };
61 return sPropertyDefinitions;
62 };
63
65 QgsAttributeEditorContainer *mInvisibleRootContainer = nullptr;
66
68 bool mConfiguredRootContainer = false;
69
70 QMap< QString, bool> mFieldEditables;
71 QMap< QString, bool> mLabelOnTop;
72 QMap< QString, Qgis::AttributeFormReuseLastValuePolicy> mReuseLastValuePolicy;
73 QMap< QString, QgsPropertyCollection> mDataDefinedFieldProperties;
74
75 QMap<QString, QVariantMap > mWidgetConfigs;
76
79
81 QString mUiFormPath;
83 QString mInitFunction;
85 QString mInitFilePath;
89 QString mInitCode;
90
93
94 QgsFields mFields;
95
96 private:
97 QgsEditFormConfigPrivate &operator=( const QgsEditFormConfigPrivate & ) = delete;
98};
99
100
102
103#endif // QGSEDITFORMCONFIG_P_H
AttributeFormSuppression
Available form types for layout of the attribute form editor.
Definition qgis.h:5856
@ Default
Use the application-wide setting.
Definition qgis.h:5857
AttributeFormPythonInitCodeSource
The Python init code source for attribute forms.
Definition qgis.h:5871
@ NoSource
Do not use Python code at all.
Definition qgis.h:5872
AttributeFormLayout
Available form types for layout of the attribute form editor.
Definition qgis.h:5841
@ AutoGenerated
Autogenerate a simple tabular layout for the form.
Definition qgis.h:5842
@ String
Any string value.
Definition qgsproperty.h:60
@ Boolean
Boolean value.
Definition qgsproperty.h:52
QMap< int, QgsPropertyDefinition > QgsPropertiesDefinition
Definition of available properties.