16#ifndef QGSATTRIBUTESFORMPROPERTIES_H
17#define QGSATTRIBUTESFORMPROPERTIES_H
24#include <QTableWidget>
28#include <QTreeWidgetItem>
30#include <QTableWidgetItem>
35#include <QPlainTextEdit>
37#include "ui_qgsattributesformproperties.h"
53class QgsAttributeFormContainerEdit;
54class QgsAttributeTypeDialog;
55class QgsAttributeWidgetEdit;
69 DnDTreeRole = Qt::UserRole,
81 bool forceSuppressFormPopup =
false;
116 DnDTreeItemData(
Type type,
const QString &name,
const QString &displayName,
const QColor &backgroundColor = QColor() )
119 , mDisplayName( displayName )
120 , mBackgroundColor( backgroundColor )
123 QString
name()
const {
return mName; }
124 void setName(
const QString &name ) { mName = name; }
127 void setDisplayName(
const QString &displayName ) { mDisplayName = displayName; }
132 operator QVariant() {
return QVariant::fromValue<DnDTreeItemData>( *
this ); }
137 bool showAsGroupBox()
const;
138 void setShowAsGroupBox(
bool showAsGroupBox );
173 bool showLabel()
const;
174 void setShowLabel(
bool showLabel );
215 QColor backgroundColor()
const;
216 void setBackgroundColor(
const QColor &backgroundColor );
221 QString mDisplayName;
222 int mColumnCount = 1;
223 bool mShowAsGroupBox =
false;
224 bool mShowLabel =
true;
229 QColor mBackgroundColor;
230 bool mCollapsed =
false;
244 bool mEditable =
true;
245 bool mEditableEnabled =
true;
246 bool mLabelOnTop =
false;
247 bool mReuseLastValues =
false;
249 QPushButton *mButton =
nullptr;
270 void initAvailableWidgetsTree();
271 void initFormLayoutTree();
272 void initLayoutConfig();
273 void initInitPython();
274 void initSuppressCombo();
287 QgsAttributeWidgetEdit *mAttributeWidgetEdit =
nullptr;
288 QgsAttributeTypeDialog *mAttributeTypeDialog =
nullptr;
289 QgsAttributeFormContainerEdit *mAttributeContainerEdit =
nullptr;
290 QLabel *mInfoTextWidget =
nullptr;
294 void onInvertSelectionButtonClicked(
bool checked );
296 void onAttributeSelectionChanged();
297 void onFormLayoutSelectionChanged();
301 void clearAttributeTypeFrame();
303 void loadAttributeWidgetEdit();
304 void storeAttributeWidgetEdit();
306 void loadAttributeTypeDialog();
307 void storeAttributeTypeDialog( );
309 void storeAttributeContainerEdit();
310 void loadAttributeContainerEdit();
312 void loadInfoWidget(
const QString &infoText );
317 QString mInitFunction;
318 QString mInitFilePath;
322 void addTabOrGroupButton();
323 void removeTabOrGroupButton();
324 void mEditorLayoutComboBox_currentIndexChanged(
int index );
325 void pbnSelectEditForm_clicked();
326 void mTbInitCode_clicked();
357 QTreeWidgetItem *addContainer( QTreeWidgetItem *parent,
const QString &title,
int columnCount );
373 void dragMoveEvent( QDragMoveEvent *event )
override;
374 void dropEvent( QDropEvent *event )
override;
375 bool dropMimeData( QTreeWidgetItem *parent,
int index,
const QMimeData *data, Qt::DropAction action )
override;
380 QStringList mimeTypes()
const override;
382#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
383 QMimeData *mimeData(
const QList<QTreeWidgetItem *> items )
const override;
385 QMimeData *mimeData(
const QList<QTreeWidgetItem *> &items )
const override;
389 void onItemDoubleClicked( QTreeWidgetItem *item,
int column );
393 Type mType = QgsAttributesDnDTree::Type::Drag;
This is an abstract base class for any elements of a drag and drop form.
This class overrides mime type handling to be able to work with the drag and drop attribute editor.
Abstract interface for generating an expression context.
virtual QgsExpressionContext createExpressionContext() const =0
This method needs to be reimplemented in all classes which implement this interface and return an exp...
Expression contexts are used to encapsulate the parameters around which a QgsExpression should be eva...
Stores information about constraints which may be present on a field.
An expression with an additional enabled flag.
A grouped map of multiple QgsProperty objects, each referenced by a integer key value.
Represents a vector layer which manages a vector based data sets.
Q_DECLARE_METATYPE(QgsDatabaseQueryLogEntry)
The TabStyle struct defines color and font overrides for form fields, tabs and groups labels.