-
-
Notifications
You must be signed in to change notification settings - Fork 3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
drag'n'drop improvements #34479
Merged
Merged
drag'n'drop improvements #34479
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd call it form widget (since these are not for attributes only)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd leave it as since it's named accordingly to the others (like the relation edit)