Skip to content
Permalink
Browse files

Fix 'actions' button in attribute table dialog only shows menu after

extended click and hold
  • Loading branch information
nyalldawson committed Mar 27, 2018
1 parent 9551471 commit 556668e0670e44bc1334beafad5e49c1b28c50ff
Showing with 108 additions and 81 deletions.
  1. +8 −0 src/app/qgsattributetabledialog.cpp
  2. +1 −0 src/app/qgsattributetabledialog.h
  3. +99 −81 src/ui/qgsattributetabledialog.ui
@@ -187,6 +187,14 @@ QgsAttributeTableDialog::QgsAttributeTableDialog( QgsVectorLayer *layer, QgsAttr
mActionVisibleFilter->setIcon( filterIcon );
mActionEditedFilter->setIcon( filterIcon );

mActionFeatureActions = new QToolButton();
mActionFeatureActions->setAutoRaise( false );
mActionFeatureActions->setPopupMode( QToolButton::InstantPopup );
mActionFeatureActions->setIcon( QgsApplication::getThemeIcon( QStringLiteral( "/mAction.svg" ) ) );
mActionFeatureActions->setText( tr( "Actions" ) );
mActionFeatureActions->setToolTip( tr( "Actions" ) );
mToolbar->addWidget( mActionFeatureActions );

// Connect filter signals
connect( mActionAdvancedFilter, &QAction::triggered, this, &QgsAttributeTableDialog::filterExpressionBuilder );
connect( mActionShowAllFilter, &QAction::triggered, this, &QgsAttributeTableDialog::filterShowAll );
@@ -228,6 +228,7 @@ class APP_EXPORT QgsAttributeTableDialog : public QDialog, private Ui::QgsAttrib

private:
QMenu *mMenuActions = nullptr;
QToolButton *mActionFeatureActions = nullptr;

QgsDockWidget *mDock = nullptr;
QgsDistanceArea *myDa = nullptr;
@@ -29,6 +29,77 @@
<property name="spacing">
<number>3</number>
</property>
<item row="6" column="0">
<widget class="QgsDualView" name="mMainView">
<property name="currentIndex">
<number>-1</number>
</property>
</widget>
</item>
<item row="5" column="0">
<widget class="QFrame" name="mUpdateExpressionBox">
<layout class="QHBoxLayout" name="horizontalLayout_3">
<property name="spacing">
<number>3</number>
</property>
<property name="leftMargin">
<number>3</number>
</property>
<property name="topMargin">
<number>1</number>
</property>
<property name="rightMargin">
<number>0</number>
</property>
<property name="bottomMargin">
<number>3</number>
</property>
<item>
<widget class="QgsFieldComboBox" name="mFieldCombo"/>
</item>
<item>
<widget class="QLabel" name="label">
<property name="sizePolicy">
<sizepolicy hsizetype="Maximum" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>=</string>
</property>
</widget>
</item>
<item>
<widget class="QgsFieldExpressionWidget" name="mUpdateExpressionText" native="true">
<property name="sizePolicy">
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="focusPolicy">
<enum>Qt::StrongFocus</enum>
</property>
</widget>
</item>
<item>
<widget class="QToolButton" name="mRunFieldCalc">
<property name="text">
<string>Update All</string>
</property>
</widget>
</item>
<item>
<widget class="QToolButton" name="mRunFieldCalcSelected">
<property name="text">
<string>Update Selected</string>
</property>
</widget>
</item>
</layout>
</widget>
</item>
<item row="8" column="0">
<layout class="QHBoxLayout">
<property name="leftMargin">
@@ -189,78 +260,6 @@
<addaction name="separator"/>
<addaction name="mActionSetStyles"/>
<addaction name="separator"/>
<addaction name="mActionFeatureActions"/>
</widget>
</item>
<item row="6" column="0">
<widget class="QgsDualView" name="mMainView">
<property name="currentIndex">
<number>-1</number>
</property>
</widget>
</item>
<item row="5" column="0">
<widget class="QFrame" name="mUpdateExpressionBox">
<layout class="QHBoxLayout" name="horizontalLayout_3">
<property name="spacing">
<number>3</number>
</property>
<property name="leftMargin">
<number>3</number>
</property>
<property name="topMargin">
<number>1</number>
</property>
<property name="rightMargin">
<number>0</number>
</property>
<property name="bottomMargin">
<number>3</number>
</property>
<item>
<widget class="QgsFieldComboBox" name="mFieldCombo"/>
</item>
<item>
<widget class="QLabel" name="label">
<property name="sizePolicy">
<sizepolicy hsizetype="Maximum" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>=</string>
</property>
</widget>
</item>
<item>
<widget class="QgsFieldExpressionWidget" name="mUpdateExpressionText" native="true">
<property name="sizePolicy">
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="focusPolicy">
<enum>Qt::StrongFocus</enum>
</property>
</widget>
</item>
<item>
<widget class="QToolButton" name="mRunFieldCalc">
<property name="text">
<string>Update All</string>
</property>
</widget>
</item>
<item>
<widget class="QToolButton" name="mRunFieldCalcSelected">
<property name="text">
<string>Update Selected</string>
</property>
</widget>
</item>
</layout>
</widget>
</item>
</layout>
@@ -634,15 +633,6 @@
<string>Conditional formatting</string>
</property>
</action>
<action name="mActionFeatureActions">
<property name="icon">
<iconset resource="../../images/images.qrc">
<normaloff>:/images/themes/default/mAction.svg</normaloff>:/images/themes/default/mAction.svg</iconset>
</property>
<property name="text">
<string>Actions</string>
</property>
</action>
</widget>
<customwidgets>
<customwidget>
@@ -681,6 +671,34 @@
</tabstops>
<resources>
<include location="../../images/images.qrc"/>
<include location="../../images/images.qrc"/>
<include location="../../images/images.qrc"/>
<include location="../../images/images.qrc"/>
<include location="../../images/images.qrc"/>
<include location="../../images/images.qrc"/>
<include location="../../images/images.qrc"/>
<include location="../../images/images.qrc"/>
<include location="../../images/images.qrc"/>
<include location="../../images/images.qrc"/>
<include location="../../images/images.qrc"/>
<include location="../../images/images.qrc"/>
<include location="../../images/images.qrc"/>
<include location="../../images/images.qrc"/>
<include location="../../images/images.qrc"/>
<include location="../../images/images.qrc"/>
<include location="../../images/images.qrc"/>
<include location="../../images/images.qrc"/>
<include location="../../images/images.qrc"/>
<include location="../../images/images.qrc"/>
<include location="../../images/images.qrc"/>
<include location="../../images/images.qrc"/>
<include location="../../images/images.qrc"/>
<include location="../../images/images.qrc"/>
<include location="../../images/images.qrc"/>
<include location="../../images/images.qrc"/>
<include location="../../images/images.qrc"/>
<include location="../../images/images.qrc"/>
<include location="../../images/images.qrc"/>
</resources>
<connections>
<connection>

0 comments on commit 556668e

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