16#ifndef QGSATTRIBUTESFORMPROPERTIES_H
17#define QGSATTRIBUTESFORMPROPERTIES_H
24#include <QTableWidget>
28#include <QTreeWidgetItem>
30#include <QTableWidgetItem>
35#include <QPlainTextEdit>
40#include "ui_qgsattributesformproperties.h"
49class QgsAttributeFormContainerEdit;
50class QgsAttributeTypeDialog;
51class QgsAttributeWidgetEdit;
65 DnDTreeRole = Qt::UserRole,
77 bool forceSuppressFormPopup =
false;
98 bool drawLine =
false;
125 DnDTreeItemData(
Type type,
const QString &name,
const QString &displayName,
const QColor &backgroundColor = QColor() )
128 , mDisplayName( displayName )
129 , mBackgroundColor( backgroundColor )
125 DnDTreeItemData(
Type type,
const QString &name,
const QString &displayName,
const QColor &backgroundColor = QColor() ) {
…}
132 QString
name()
const {
return mName; }
133 void setName(
const QString &name ) { mName = name; }
136 void setDisplayName(
const QString &displayName ) { mDisplayName = displayName; }
141 operator QVariant() {
return QVariant::fromValue<DnDTreeItemData>( *
this ); }
195 bool showLabel()
const;
196 void setShowLabel(
bool showLabel );
322 QColor backgroundColor()
const;
323 void setBackgroundColor(
const QColor &backgroundColor );
340 QString mDisplayName;
341 int mColumnCount = 1;
343 bool mShowLabel =
true;
344 int mHorizontalStretch = 0;
345 int mVerticalStretch = 0;
352 QColor mBackgroundColor;
353 bool mCollapsed =
false;
367 bool mEditable =
true;
368 bool mLabelOnTop =
false;
369 bool mReuseLastValues =
false;
371 QPushButton *mButton =
nullptr;
407 void initAvailableWidgetsTree();
408 void initFormLayoutTree();
409 void initLayoutConfig();
410 void initInitPython();
411 void initSuppressCombo();
424 QgsAttributeWidgetEdit *mAttributeWidgetEdit =
nullptr;
425 QgsAttributeTypeDialog *mAttributeTypeDialog =
nullptr;
426 QgsAttributeFormContainerEdit *mAttributeContainerEdit =
nullptr;
427 QLabel *mInfoTextWidget =
nullptr;
431 void removeTabOrGroupButton();
432 void mEditorLayoutComboBox_currentIndexChanged(
int index );
433 void pbnSelectEditForm_clicked();
434 void mTbInitCode_clicked();
436 void onInvertSelectionButtonClicked(
bool checked );
438 void onAttributeSelectionChanged();
439 void onFormLayoutSelectionChanged();
442 void onContextMenuRequested( QPoint );
444 void updatedFields();
448 void clearAttributeTypeFrame();
450 void loadAttributeWidgetEdit();
451 void storeAttributeWidgetEdit();
453 void loadAttributeTypeDialog();
454 void loadAttributeTypeDialogFromConfiguration(
const FieldConfig &cfg );
455 void storeAttributeTypeDialog();
457 void storeAttributeContainerEdit();
458 void loadAttributeContainerEdit();
460 void loadInfoWidget(
const QString &infoText );
462 void copyWidgetConfiguration();
463 void pasteWidgetConfiguration();
470 QString mInitFunction;
471 QString mInitFilePath;
473 int mBlockUpdates = 0;
476 QMenu *mAvailableWidgetsTreeContextMenu =
nullptr;
477 QAction *mActionCopyWidgetConfiguration =
nullptr;
478 QAction *mActionPasteWidgetConfiguration =
nullptr;
480 friend class TestQgsAttributesFormProperties;
533 void dragMoveEvent( QDragMoveEvent *event )
override;
534 void dropEvent( QDropEvent *event )
override;
535 bool dropMimeData( QTreeWidgetItem *parent,
int index,
const QMimeData *data, Qt::DropAction action )
override;
540 QStringList mimeTypes()
const override;
542#if QT_VERSION < QT_VERSION_CHECK( 6, 0, 0 )
543 QMimeData *mimeData(
const QList<QTreeWidgetItem *> items )
const override;
545 QMimeData *mimeData(
const QList<QTreeWidgetItem *> &items )
const override;
549 void onItemDoubleClicked( QTreeWidgetItem *item,
int column );
AttributeEditorContainerType
Attribute editor container types.
AttributeFormPythonInitCodeSource
The Python init code source for attribute forms.
@ NoSource
Do not use Python code at all.
FieldDomainMergePolicy
Merge policy for field domains.
@ DefaultValue
Use default field value.
FieldDomainSplitPolicy
Split policy for field domains.
@ Duplicate
Duplicate original value.
FieldDuplicatePolicy
Duplicate policy for fields.
@ Duplicate
Duplicate original value.
An abstract base class for any elements of a drag and drop form.
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.
A bar for displaying non-blocking messages to the user.
An expression with an additional enabled flag.
A grouped map of multiple QgsProperty objects, each referenced by an integer key value.
Represents a vector layer which manages a vector based dataset.
Q_DECLARE_METATYPE(QgsDatabaseQueryLogEntry)
The TabStyle struct defines color and font overrides for form fields, tabs and groups labels.