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;
102 bool drawLine =
false;
128 DnDTreeItemData(
Type type,
const QString &name,
const QString &displayName,
const QColor &backgroundColor = QColor() )
131 , mDisplayName( displayName )
132 , mBackgroundColor( backgroundColor )
135 QString
name()
const {
return mName; }
136 void setName(
const QString &name ) { mName = name; }
139 void setDisplayName(
const QString &displayName ) { mDisplayName = displayName; }
144 operator QVariant() {
return QVariant::fromValue<DnDTreeItemData>( *
this ); }
149 bool showAsGroupBox()
const;
150 void setShowAsGroupBox(
bool showAsGroupBox );
185 bool showLabel()
const;
186 void setShowLabel(
bool showLabel );
239 QColor backgroundColor()
const;
240 void setBackgroundColor(
const QColor &backgroundColor );
257 QString mDisplayName;
258 int mColumnCount = 1;
259 bool mShowAsGroupBox =
false;
260 bool mShowLabel =
true;
267 QColor mBackgroundColor;
268 bool mCollapsed =
false;
282 bool mEditable =
true;
283 bool mEditableEnabled =
true;
284 bool mLabelOnTop =
false;
285 bool mReuseLastValues =
false;
287 QPushButton *mButton =
nullptr;
308 void initAvailableWidgetsTree();
309 void initFormLayoutTree();
310 void initLayoutConfig();
311 void initInitPython();
312 void initSuppressCombo();
325 QgsAttributeWidgetEdit *mAttributeWidgetEdit =
nullptr;
326 QgsAttributeTypeDialog *mAttributeTypeDialog =
nullptr;
327 QgsAttributeFormContainerEdit *mAttributeContainerEdit =
nullptr;
328 QLabel *mInfoTextWidget =
nullptr;
332 void onInvertSelectionButtonClicked(
bool checked );
334 void onAttributeSelectionChanged();
335 void onFormLayoutSelectionChanged();
339 void clearAttributeTypeFrame();
341 void loadAttributeWidgetEdit();
342 void storeAttributeWidgetEdit();
344 void loadAttributeTypeDialog();
345 void storeAttributeTypeDialog( );
347 void storeAttributeContainerEdit();
348 void loadAttributeContainerEdit();
350 void loadInfoWidget(
const QString &infoText );
355 QString mInitFunction;
356 QString mInitFilePath;
360 void addTabOrGroupButton();
361 void removeTabOrGroupButton();
362 void mEditorLayoutComboBox_currentIndexChanged(
int index );
363 void pbnSelectEditForm_clicked();
364 void mTbInitCode_clicked();
395 QTreeWidgetItem *addContainer( QTreeWidgetItem *parent,
const QString &title,
int columnCount );
411 void dragMoveEvent( QDragMoveEvent *event )
override;
412 void dropEvent( QDropEvent *event )
override;
413 bool dropMimeData( QTreeWidgetItem *parent,
int index,
const QMimeData *data, Qt::DropAction action )
override;
418 QStringList mimeTypes()
const override;
420#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
421 QMimeData *mimeData(
const QList<QTreeWidgetItem *> items )
const override;
423 QMimeData *mimeData(
const QList<QTreeWidgetItem *> &items )
const override;
427 void onItemDoubleClicked( QTreeWidgetItem *item,
int column );
431 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.