Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
drag'n'drop improvements part 3 (#34479)
* drag'n'drop improvements part 3 this completely removes hidden config accessible under double click now a widget groupbox (by opposition to the field config) is shown on top of the right panel
- Loading branch information
Showing
19 changed files
with
281 additions
and
64 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
# The following has been generated automatically from src/core/qgseditformconfig.h | ||
QgsEditFormConfig.EditorLayout.baseClass = QgsEditFormConfig | ||
QgsEditFormConfig.FeatureFormSuppress.baseClass = QgsEditFormConfig | ||
QgsEditFormConfig.PythonInitCodeSource.baseClass = QgsEditFormConfig |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,87 @@ | ||
/*************************************************************************** | ||
qgsattributewidgetedit.cpp | ||
--------------------- | ||
begin : February 2020 | ||
copyright : (C) 2020 Denis Rouzaud | ||
email : denis@opengis.ch | ||
*************************************************************************** | ||
* * | ||
* This program is free software; you can redistribute it and/or modify * | ||
* it under the terms of the GNU General Public License as published by * | ||
* the Free Software Foundation; either version 2 of the License, or * | ||
* (at your option) any later version. * | ||
* * | ||
***************************************************************************/ | ||
|
||
#include "qgsattributewidgetedit.h" | ||
#include "qgsattributesformproperties.h" | ||
|
||
|
||
QgsAttributeWidgetEdit::QgsAttributeWidgetEdit( QTreeWidgetItem *item, QWidget *parent ) | ||
: QgsCollapsibleGroupBox( parent ) | ||
, mTreeItem( item ) | ||
|
||
{ | ||
setupUi( this ); | ||
|
||
const QgsAttributesFormProperties::DnDTreeItemData itemData = mTreeItem->data( 0, QgsAttributesFormProperties::DnDTreeRole ).value<QgsAttributesFormProperties::DnDTreeItemData>(); | ||
Q_ASSERT( itemData.type() == QgsAttributesFormProperties::DnDTreeItemData::Container ); | ||
|
||
// common configs | ||
mShowLabelCheckBox->setChecked( itemData.showLabel() ); | ||
|
||
// hide specific configs | ||
mRelationShowLinkCheckBox->hide(); | ||
mRelationShowUnlinkCheckBox->hide(); | ||
|
||
switch ( itemData.type() ) | ||
{ | ||
case QgsAttributesFormProperties::DnDTreeItemData::Relation: | ||
{ | ||
mRelationShowLinkCheckBox->show(); | ||
mRelationShowUnlinkCheckBox->show(); | ||
mRelationShowLinkCheckBox->setChecked( itemData.relationEditorConfiguration().showLinkButton ); | ||
mRelationShowUnlinkCheckBox->setChecked( itemData.relationEditorConfiguration().showUnlinkButton ); | ||
} | ||
break; | ||
|
||
case QgsAttributesFormProperties::DnDTreeItemData::Field: | ||
case QgsAttributesFormProperties::DnDTreeItemData::Container: | ||
case QgsAttributesFormProperties::DnDTreeItemData::QmlWidget: | ||
case QgsAttributesFormProperties::DnDTreeItemData::HtmlWidget: | ||
case QgsAttributesFormProperties::DnDTreeItemData::WidgetType: | ||
break; | ||
} | ||
|
||
|
||
} | ||
|
||
void QgsAttributeWidgetEdit::updateItemData() | ||
{ | ||
QgsAttributesFormProperties::DnDTreeItemData itemData = mTreeItem->data( 0, QgsAttributesFormProperties::DnDTreeRole ).value<QgsAttributesFormProperties::DnDTreeItemData>(); | ||
|
||
// common configs | ||
itemData.setShowLabel( mShowLabelCheckBox->isChecked() ); | ||
|
||
// specific configs | ||
switch ( itemData.type() ) | ||
{ | ||
case QgsAttributesFormProperties::DnDTreeItemData::Relation: | ||
{ | ||
QgsAttributesFormProperties::RelationEditorConfiguration relEdCfg; | ||
relEdCfg.showLinkButton = mRelationShowLinkCheckBox->isChecked(); | ||
relEdCfg.showUnlinkButton = mRelationShowUnlinkCheckBox->isChecked(); | ||
itemData.setRelationEditorConfiguration( relEdCfg ); | ||
} | ||
break; | ||
|
||
case QgsAttributesFormProperties::DnDTreeItemData::Field: | ||
case QgsAttributesFormProperties::DnDTreeItemData::Container: | ||
case QgsAttributesFormProperties::DnDTreeItemData::QmlWidget: | ||
case QgsAttributesFormProperties::DnDTreeItemData::HtmlWidget: | ||
case QgsAttributesFormProperties::DnDTreeItemData::WidgetType: | ||
break; | ||
} | ||
|
||
mTreeItem->setData( 0, QgsAttributesFormProperties::DnDTreeRole, itemData ); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
/*************************************************************************** | ||
qgsattributewidgetedit.h | ||
--------------------- | ||
begin : February 2020 | ||
copyright : (C) 2020 Denis Rouzaud | ||
email : denis@opengis.ch | ||
*************************************************************************** | ||
* * | ||
* This program is free software; you can redistribute it and/or modify * | ||
* it under the terms of the GNU General Public License as published by * | ||
* the Free Software Foundation; either version 2 of the License, or * | ||
* (at your option) any later version. * | ||
* * | ||
***************************************************************************/ | ||
|
||
#ifndef QGSATTRIBUTEWIDGETEDIT_H | ||
#define QGSATTRIBUTEWIDGETEDIT_H | ||
|
||
#include <QWidget> | ||
|
||
#include "ui_qgsattributewidgeteditgroupbox.h" | ||
|
||
#include "qgis_app.h" | ||
|
||
class QTreeWidgetItem; | ||
|
||
/** | ||
* Widget to edit a container (tab or group box) of a form configuration | ||
*/ | ||
class APP_EXPORT QgsAttributeWidgetEdit: public QgsCollapsibleGroupBox, private Ui_QgsAttributeWidgetEditGroupBox | ||
{ | ||
Q_OBJECT | ||
|
||
public: | ||
explicit QgsAttributeWidgetEdit( QTreeWidgetItem *item, QWidget *parent = nullptr ); | ||
|
||
|
||
void updateItemData(); | ||
|
||
|
||
private: | ||
QTreeWidgetItem *mTreeItem; | ||
}; | ||
|
||
#endif // QGSATTRIBUTEWIDGETEDIT_H |
Oops, something went wrong.