Skip to content
Permalink
Browse files

[feature][needs-docs] Toggle selection button in form d&d designer

Funded by ARPA Piemonte
  • Loading branch information
elpaso committed Mar 23, 2019
1 parent 78b5678 commit d317cf4658866da0e2ec1c7dff9e1f5c2b20fa31
@@ -66,6 +66,7 @@ QgsAttributesFormProperties::QgsAttributesFormProperties( QgsVectorLayer *layer,
connect( mAvailableWidgetsTree, &QTreeWidget::itemSelectionChanged, this, &QgsAttributesFormProperties::onAttributeSelectionChanged );
connect( mAddTabOrGroupButton, &QAbstractButton::clicked, this, &QgsAttributesFormProperties::addTabOrGroupButton );
connect( mRemoveTabOrGroupButton, &QAbstractButton::clicked, this, &QgsAttributesFormProperties::removeTabOrGroupButton );
connect( mInvertSelectionButton, &QAbstractButton::clicked, this, &QgsAttributesFormProperties::onInvertSelectionButtonClicked );
connect( mEditorLayoutComboBox, static_cast<void ( QComboBox::* )( int )>( &QComboBox::currentIndexChanged ), this, &QgsAttributesFormProperties::mEditorLayoutComboBox_currentIndexChanged );
connect( pbnSelectEditForm, &QToolButton::clicked, this, &QgsAttributesFormProperties::pbnSelectEditForm_clicked );
connect( mTbInitCode, &QPushButton::clicked, this, &QgsAttributesFormProperties::mTbInitCode_clicked );
@@ -523,6 +524,16 @@ void QgsAttributesFormProperties::onAttributeSelectionChanged()
}
}

void QgsAttributesFormProperties::onInvertSelectionButtonClicked( bool checked )
{
Q_UNUSED( checked );
const auto selectedItemList { mFormLayoutTree->selectedItems() };
const auto rootItem { mFormLayoutTree->invisibleRootItem() };
for ( int i = 0; i < rootItem->childCount(); ++i )
{
rootItem->child( i )->setSelected( ! selectedItemList.contains( rootItem->child( i ) ) );
}
}

void QgsAttributesFormProperties::addTabOrGroupButton()
{
@@ -185,7 +185,6 @@ class APP_EXPORT QgsAttributesFormProperties : public QWidget, private Ui_QgsAtt
void init();
void apply();

void onAttributeSelectionChanged();

void loadRelations();

@@ -195,6 +194,11 @@ class APP_EXPORT QgsAttributesFormProperties : public QWidget, private Ui_QgsAtt
void initInitPython();
void initSuppressCombo();

public slots:

void onInvertSelectionButtonClicked( bool checked );
void onAttributeSelectionChanged();

protected:
void updateButtons();

@@ -6,7 +6,7 @@
<rect>
<x>0</x>
<y>0</y>
<width>653</width>
<width>1041</width>
<height>556</height>
</rect>
</property>
@@ -151,18 +151,7 @@ Use this function to add extra logic to your forms.</string>
<property name="bottomMargin">
<number>0</number>
</property>
<item row="0" column="2">
<widget class="QToolButton" name="mAddTabOrGroupButton">
<property name="text">
<string>…</string>
</property>
<property name="icon">
<iconset resource="../../images/images.qrc">
<normaloff>:/images/themes/default/symbologyAdd.svg</normaloff>:/images/themes/default/symbologyAdd.svg</iconset>
</property>
</widget>
</item>
<item row="0" column="1" rowspan="6">
<item row="0" column="1" rowspan="7">
<widget class="QWidget" name="mFormLayoutWidget" native="true">
<property name="minimumSize">
<size>
@@ -172,18 +161,7 @@ Use this function to add extra logic to your forms.</string>
</property>
</widget>
</item>
<item row="2" column="2">
<widget class="QToolButton" name="mRemoveTabOrGroupButton">
<property name="text">
<string>…</string>
</property>
<property name="icon">
<iconset resource="../../images/images.qrc">
<normaloff>:/images/themes/default/symbologyRemove.svg</normaloff>:/images/themes/default/symbologyRemove.svg</iconset>
</property>
</widget>
</item>
<item row="3" column="2">
<item row="4" column="2">
<spacer name="verticalSpacer">
<property name="orientation">
<enum>Qt::Vertical</enum>
@@ -196,7 +174,7 @@ Use this function to add extra logic to your forms.</string>
</property>
</spacer>
</item>
<item row="0" column="0" rowspan="6">
<item row="0" column="0" rowspan="7">
<widget class="QWidget" name="mAvailableWidgetsWidget" native="true">
<property name="minimumSize">
<size>
@@ -206,6 +184,42 @@ Use this function to add extra logic to your forms.</string>
</property>
</widget>
</item>
<item row="2" column="2">
<widget class="QToolButton" name="mRemoveTabOrGroupButton">
<property name="text">
<string>…</string>
</property>
<property name="icon">
<iconset resource="../../images/images.qrc">
<normaloff>:/images/themes/default/symbologyRemove.svg</normaloff>:/images/themes/default/symbologyRemove.svg</iconset>
</property>
</widget>
</item>
<item row="0" column="2">
<widget class="QToolButton" name="mAddTabOrGroupButton">
<property name="text">
<string>…</string>
</property>
<property name="icon">
<iconset resource="../../images/images.qrc">
<normaloff>:/images/themes/default/symbologyAdd.svg</normaloff>:/images/themes/default/symbologyAdd.svg</iconset>
</property>
</widget>
</item>
<item row="3" column="2">
<widget class="QToolButton" name="mInvertSelectionButton">
<property name="toolTip">
<string>Invert selection</string>
</property>
<property name="text">
<string>Invert selection</string>
</property>
<property name="icon">
<iconset resource="../../images/images.qrc">
<normaloff>:/images/themes/default/mActionInvertSelection.svg</normaloff>:/images/themes/default/mActionInvertSelection.svg</iconset>
</property>
</widget>
</item>
</layout>
</widget>
<widget class="QScrollArea" name="scrollArea_2">
@@ -223,8 +237,8 @@ Use this function to add extra logic to your forms.</string>
<rect>
<x>0</x>
<y>0</y>
<width>596</width>
<height>428</height>
<width>598</width>
<height>490</height>
</rect>
</property>
<layout class="QGridLayout" name="gridLayout_4">

0 comments on commit d317cf4

Please sign in to comment.
You can’t perform that action at this time.