Skip to content

Commit

Permalink
[composer] Add a manual 'refresh' button to attribute tables, to refr…
Browse files Browse the repository at this point in the history
…esh table if data has changed outside of QGIS
  • Loading branch information
nyalldawson committed Apr 22, 2014
1 parent a386e89 commit 6fa26cf
Show file tree
Hide file tree
Showing 3 changed files with 48 additions and 27 deletions.
10 changes: 10 additions & 0 deletions src/app/composer/qgscomposertablewidget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,16 @@ void QgsComposerTableWidget::refreshMapComboBox()
}
}

void QgsComposerTableWidget::on_mRefreshPushButton_clicked()
{
if ( !mComposerTable )
{
return;
}

mComposerTable->refreshAttributes();
}

void QgsComposerTableWidget::on_mAttributesPushButton_clicked()
{
if ( !mComposerTable )
Expand Down
1 change: 1 addition & 0 deletions src/app/composer/qgscomposertablewidget.h
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ class QgsComposerTableWidget: public QWidget, private Ui::QgsComposerTableWidget
void refreshMapComboBox();

private slots:
void on_mRefreshPushButton_clicked();
void on_mAttributesPushButton_clicked();
void on_mComposerMapComboBox_activated( int index );
void on_mMaximumColumnsSpinBox_valueChanged( int i );
Expand Down
64 changes: 37 additions & 27 deletions src/ui/qgscomposertablewidgetbase.ui
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,10 @@
<bool>false</bool>
</property>
<layout class="QFormLayout" name="formLayout">
<item row="0" column="0">
<property name="fieldGrowthPolicy">
<enum>QFormLayout::AllNonFixedFieldsGrow</enum>
</property>
<item row="1" column="0">
<widget class="QLabel" name="mLayerLabel">
<property name="text">
<string>Layer</string>
Expand All @@ -73,14 +76,38 @@
</property>
</widget>
</item>
<item row="8" column="0" colspan="2">
<item row="1" column="1">
<widget class="QgsMapLayerComboBox" name="mLayerComboBox">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
</widget>
</item>
<item row="4" column="0" colspan="2">
<widget class="QPushButton" name="mRefreshPushButton">
<property name="text">
<string>Refresh table data</string>
</property>
</widget>
</item>
<item row="5" column="0" colspan="2">
<widget class="QPushButton" name="mAttributesPushButton">
<property name="text">
<string>Attributes...</string>
</property>
</widget>
</item>
<item row="9" column="0" colspan="2">
<widget class="QCheckBox" name="mShowOnlyVisibleFeaturesCheckBox">
<property name="text">
<string>Show only visible features</string>
</property>
</widget>
</item>
<item row="10" column="0">
<item row="11" column="0">
<widget class="QLabel" name="mComposerMapLabel">
<property name="text">
<string>Composer map</string>
Expand All @@ -93,17 +120,17 @@
</property>
</widget>
</item>
<item row="10" column="1">
<item row="11" column="1">
<widget class="QComboBox" name="mComposerMapComboBox"/>
</item>
<item row="12" column="0">
<item row="13" column="0">
<widget class="QCheckBox" name="mFeatureFilterCheckBox">
<property name="text">
<string>Filter with</string>
</property>
</widget>
</item>
<item row="12" column="1">
<item row="13" column="1">
<layout class="QHBoxLayout" name="horizontalLayout">
<item>
<widget class="QLineEdit" name="mFeatureFilterEdit"/>
Expand All @@ -121,7 +148,7 @@
</item>
</layout>
</item>
<item row="14" column="0">
<item row="15" column="0">
<widget class="QLabel" name="mMaxNumFeaturesLabel">
<property name="text">
<string>Maximum rows</string>
Expand All @@ -134,10 +161,10 @@
</property>
</widget>
</item>
<item row="14" column="1">
<item row="15" column="1">
<widget class="QSpinBox" name="mMaximumColumnsSpinBox"/>
</item>
<item row="16" column="0">
<item row="17" column="0">
<widget class="QLabel" name="mMarginLabel">
<property name="text">
<string>Margin</string>
Expand All @@ -150,26 +177,9 @@
</property>
</widget>
</item>
<item row="16" column="1">
<item row="17" column="1">
<widget class="QDoubleSpinBox" name="mMarginSpinBox"/>
</item>
<item row="0" column="1">
<widget class="QgsMapLayerComboBox" name="mLayerComboBox">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
</widget>
</item>
<item row="4" column="0" colspan="2">
<widget class="QPushButton" name="mAttributesPushButton">
<property name="text">
<string>Attributes...</string>
</property>
</widget>
</item>
</layout>
</widget>
</item>
Expand Down

0 comments on commit 6fa26cf

Please sign in to comment.