16 #ifndef QGSATTRIBUTESFORMPROPERTIES_H
17 #define QGSATTRIBUTESFORMPROPERTIES_H
23 #include <QPushButton>
24 #include <QTableWidget>
25 #include <QTreeWidget>
28 #include <QTreeWidgetItem>
30 #include <QTableWidgetItem>
31 #include <QMessageBox>
32 #include <QFileDialog>
33 #include <QHBoxLayout>
34 #include <QFormLayout>
35 #include <QPlainTextEdit>
37 #include "ui_qgsattributesformproperties.h"
53 class QgsAttributeFormContainerEdit;
54 class QgsAttributeTypeDialog;
55 class 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;
268 void loadRelations();
270 void initAvailableWidgetsTree();
271 void initFormLayoutTree();
272 void initLayoutConfig();
273 void initInitPython();
274 void initSuppressCombo();
279 void updateButtons();
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;
401 #endif // QGSATTRIBUTESFORMPROPERTIES_H