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;
64 DnDTreeRole = Qt::UserRole,
76 bool forceSuppressFormPopup =
false;
97 bool drawLine =
false;
123 DnDTreeItemData(
Type type,
const QString &name,
const QString &displayName,
const QColor &backgroundColor = QColor() )
126 , mDisplayName( displayName )
127 , mBackgroundColor( backgroundColor )
130 QString
name()
const {
return mName; }
131 void setName(
const QString &name ) { mName = name; }
134 void setDisplayName(
const QString &displayName ) { mDisplayName = displayName; }
139 operator QVariant() {
return QVariant::fromValue<DnDTreeItemData>( *
this ); }
193 bool showLabel()
const;
194 void setShowLabel(
bool showLabel );
320 QColor backgroundColor()
const;
321 void setBackgroundColor(
const QColor &backgroundColor );
338 QString mDisplayName;
339 int mColumnCount = 1;
341 bool mShowLabel =
true;
342 int mHorizontalStretch = 0;
343 int mVerticalStretch = 0;
350 QColor mBackgroundColor;
351 bool mCollapsed =
false;
365 bool mEditable =
true;
366 bool mLabelOnTop =
false;
367 bool mReuseLastValues =
false;
369 QPushButton *mButton =
nullptr;
404 void initAvailableWidgetsTree();
405 void initFormLayoutTree();
406 void initLayoutConfig();
407 void initInitPython();
408 void initSuppressCombo();
421 QgsAttributeWidgetEdit *mAttributeWidgetEdit =
nullptr;
422 QgsAttributeTypeDialog *mAttributeTypeDialog =
nullptr;
423 QgsAttributeFormContainerEdit *mAttributeContainerEdit =
nullptr;
424 QLabel *mInfoTextWidget =
nullptr;
428 void removeTabOrGroupButton();
429 void mEditorLayoutComboBox_currentIndexChanged(
int index );
430 void pbnSelectEditForm_clicked();
431 void mTbInitCode_clicked();
433 void onInvertSelectionButtonClicked(
bool checked );
435 void onAttributeSelectionChanged();
436 void onFormLayoutSelectionChanged();
439 void onContextMenuRequested( QPoint );
441 void updatedFields();
445 void clearAttributeTypeFrame();
447 void loadAttributeWidgetEdit();
448 void storeAttributeWidgetEdit();
450 void loadAttributeTypeDialog();
451 void loadAttributeTypeDialogFromConfiguration(
const FieldConfig &cfg );
452 void storeAttributeTypeDialog();
454 void storeAttributeContainerEdit();
455 void loadAttributeContainerEdit();
457 void loadInfoWidget(
const QString &infoText );
459 void copyWidgetConfiguration();
460 void pasteWidgetConfiguration();
467 QString mInitFunction;
468 QString mInitFilePath;
470 int mBlockUpdates = 0;
473 QMenu *mAvailableWidgetsTreeContextMenu =
nullptr;
474 QAction *mActionCopyWidgetConfiguration =
nullptr;
475 QAction *mActionPasteWidgetConfiguration =
nullptr;
477 friend class TestQgsAttributesFormProperties;
530 void dragMoveEvent( QDragMoveEvent *event )
override;
531 void dropEvent( QDropEvent *event )
override;
532 bool dropMimeData( QTreeWidgetItem *parent,
int index,
const QMimeData *data, Qt::DropAction action )
override;
537 QStringList mimeTypes()
const override;
539#if QT_VERSION < QT_VERSION_CHECK( 6, 0, 0 )
540 QMimeData *mimeData(
const QList<QTreeWidgetItem *> items )
const override;
542 QMimeData *mimeData(
const QList<QTreeWidgetItem *> &items )
const override;
546 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.
FieldDomainSplitPolicy
Split policy for field domains.
@ Duplicate
Duplicate original value.
FieldDuplicatePolicy
Duplicate policy for fields.
@ Duplicate
Duplicate original value.
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.
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 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.