Filter: implement "x of y shown" text

Display the number of dives shown. Copy the UI from the old filter
widget.

Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
This commit is contained in:
Berthold Stoeger 2019-01-25 19:44:16 +01:00 committed by Dirk Hohndel
parent 7b58ea1901
commit 3915e8a0d5
2 changed files with 65 additions and 27 deletions

View file

@ -161,4 +161,7 @@ void FilterWidget2::hideEvent(QHideEvent *event)
void FilterWidget2::filterDataChanged(const FilterData &data) void FilterWidget2::filterDataChanged(const FilterData &data)
{ {
MultiFilterSortModel::instance()->filterDataChanged(data); MultiFilterSortModel::instance()->filterDataChanged(data);
ui.filterText->setText(tr("%L1/%L2 shown").arg(MultiFilterSortModel::instance()->divesDisplayed)
.arg(dive_table.nr));
} }

View file

@ -14,10 +14,17 @@
<string>Form</string> <string>Form</string>
</property> </property>
<layout class="QGridLayout" name="gridLayout"> <layout class="QGridLayout" name="gridLayout">
<item row="8" column="1" colspan="4"> <item row="0" column="0">
<widget class="QLabel" name="filterText">
<property name="text">
<string/>
</property>
</widget>
</item>
<item row="8" column="2" colspan="7">
<widget class="QLineEdit" name="tags"/> <widget class="QLineEdit" name="tags"/>
</item> </item>
<item row="1" column="1"> <item row="1" column="2">
<widget class="QLabel" name="label_3"> <widget class="QLabel" name="label_3">
<property name="text"> <property name="text">
<string>Min</string> <string>Min</string>
@ -31,7 +38,7 @@
</property> </property>
</widget> </widget>
</item> </item>
<item row="3" column="3"> <item row="3" column="7">
<widget class="QLabel" name="label_13"> <widget class="QLabel" name="label_13">
<property name="text"> <property name="text">
<string>Max</string> <string>Max</string>
@ -52,10 +59,10 @@
</property> </property>
</widget> </widget>
</item> </item>
<item row="3" column="2"> <item row="3" column="6">
<widget class="QDoubleSpinBox" name="minWaterTemp"/> <widget class="QDoubleSpinBox" name="minWaterTemp"/>
</item> </item>
<item row="12" column="1" colspan="4"> <item row="12" column="2" colspan="7">
<widget class="QCheckBox" name="invertFilter"> <widget class="QCheckBox" name="invertFilter">
<property name="toolTip"> <property name="toolTip">
<string>Display dives that will not match the search, only applies to tags, people, location and equipment</string> <string>Display dives that will not match the search, only applies to tags, people, location and equipment</string>
@ -65,14 +72,14 @@
</property> </property>
</widget> </widget>
</item> </item>
<item row="2" column="3"> <item row="2" column="7">
<widget class="QLabel" name="label_16"> <widget class="QLabel" name="label_16">
<property name="text"> <property name="text">
<string>Max</string> <string>Max</string>
</property> </property>
</widget> </widget>
</item> </item>
<item row="3" column="1"> <item row="3" column="2">
<widget class="QLabel" name="label_12"> <widget class="QLabel" name="label_12">
<property name="text"> <property name="text">
<string>Min</string> <string>Min</string>
@ -93,14 +100,14 @@
</property> </property>
</widget> </widget>
</item> </item>
<item row="4" column="1"> <item row="4" column="2">
<widget class="QLabel" name="label_17"> <widget class="QLabel" name="label_17">
<property name="text"> <property name="text">
<string>Min</string> <string>Min</string>
</property> </property>
</widget> </widget>
</item> </item>
<item row="3" column="4"> <item row="3" column="8">
<widget class="QDoubleSpinBox" name="maxWaterTemp"/> <widget class="QDoubleSpinBox" name="maxWaterTemp"/>
</item> </item>
<item row="2" column="0"> <item row="2" column="0">
@ -110,21 +117,21 @@
</property> </property>
</widget> </widget>
</item> </item>
<item row="2" column="1"> <item row="2" column="2">
<widget class="QLabel" name="label_14"> <widget class="QLabel" name="label_14">
<property name="text"> <property name="text">
<string>Min</string> <string>Min</string>
</property> </property>
</widget> </widget>
</item> </item>
<item row="1" column="3"> <item row="1" column="7">
<widget class="QLabel" name="label_15"> <widget class="QLabel" name="label_15">
<property name="text"> <property name="text">
<string>Max</string> <string>Max</string>
</property> </property>
</widget> </widget>
</item> </item>
<item row="10" column="1" colspan="4"> <item row="10" column="2" colspan="7">
<widget class="QLineEdit" name="location"/> <widget class="QLineEdit" name="location"/>
</item> </item>
<item row="11" column="0"> <item row="11" column="0">
@ -134,13 +141,13 @@
</property> </property>
</widget> </widget>
</item> </item>
<item row="4" column="2"> <item row="4" column="6">
<widget class="QDoubleSpinBox" name="minAirTemp"/> <widget class="QDoubleSpinBox" name="minAirTemp"/>
</item> </item>
<item row="4" column="4"> <item row="4" column="8">
<widget class="QDoubleSpinBox" name="maxAirTemp"/> <widget class="QDoubleSpinBox" name="maxAirTemp"/>
</item> </item>
<item row="11" column="1" colspan="4"> <item row="11" column="2" colspan="7">
<widget class="QLineEdit" name="equipment"/> <widget class="QLineEdit" name="equipment"/>
</item> </item>
<item row="3" column="0"> <item row="3" column="0">
@ -150,10 +157,10 @@
</property> </property>
</widget> </widget>
</item> </item>
<item row="9" column="1" colspan="4"> <item row="9" column="2" colspan="7">
<widget class="QLineEdit" name="people"/> <widget class="QLineEdit" name="people"/>
</item> </item>
<item row="4" column="3"> <item row="4" column="7">
<widget class="QLabel" name="label_18"> <widget class="QLabel" name="label_18">
<property name="text"> <property name="text">
<string>Max</string> <string>Max</string>
@ -174,7 +181,7 @@
</property> </property>
</widget> </widget>
</item> </item>
<item row="2" column="4"> <item row="2" column="8">
<widget class="StarWidget" name="maxVisibility" native="true"> <widget class="StarWidget" name="maxVisibility" native="true">
<property name="sizePolicy"> <property name="sizePolicy">
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Fixed"> <sizepolicy hsizetype="MinimumExpanding" vsizetype="Fixed">
@ -187,7 +194,7 @@
</property> </property>
</widget> </widget>
</item> </item>
<item row="2" column="2"> <item row="2" column="6">
<widget class="StarWidget" name="minVisibility" native="true"> <widget class="StarWidget" name="minVisibility" native="true">
<property name="sizePolicy"> <property name="sizePolicy">
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Fixed"> <sizepolicy hsizetype="MinimumExpanding" vsizetype="Fixed">
@ -200,7 +207,7 @@
</property> </property>
</widget> </widget>
</item> </item>
<item row="1" column="2"> <item row="1" column="6">
<widget class="StarWidget" name="minRating" native="true"> <widget class="StarWidget" name="minRating" native="true">
<property name="sizePolicy"> <property name="sizePolicy">
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Fixed"> <sizepolicy hsizetype="MinimumExpanding" vsizetype="Fixed">
@ -213,7 +220,7 @@
</property> </property>
</widget> </widget>
</item> </item>
<item row="1" column="4"> <item row="1" column="8">
<widget class="StarWidget" name="maxRating" native="true"> <widget class="StarWidget" name="maxRating" native="true">
<property name="sizePolicy"> <property name="sizePolicy">
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Fixed"> <sizepolicy hsizetype="MinimumExpanding" vsizetype="Fixed">
@ -226,7 +233,7 @@
</property> </property>
</widget> </widget>
</item> </item>
<item row="7" column="1"> <item row="7" column="2">
<widget class="QCheckBox" name="logged"> <widget class="QCheckBox" name="logged">
<property name="text"> <property name="text">
<string>Logged</string> <string>Logged</string>
@ -236,7 +243,7 @@
</property> </property>
</widget> </widget>
</item> </item>
<item row="7" column="2"> <item row="7" column="6">
<widget class="QCheckBox" name="planned"> <widget class="QCheckBox" name="planned">
<property name="text"> <property name="text">
<string>Planned</string> <string>Planned</string>
@ -246,26 +253,54 @@
</property> </property>
</widget> </widget>
</item> </item>
<item row="5" column="3"> <item row="5" column="7">
<widget class="QTimeEdit" name="fromTime"/> <widget class="QTimeEdit" name="fromTime"/>
</item> </item>
<item row="5" column="1" colspan="2"> <item row="5" column="2" colspan="5">
<widget class="QDateTimeEdit" name="fromDate"> <widget class="QDateTimeEdit" name="fromDate">
<property name="calendarPopup"> <property name="calendarPopup">
<bool>true</bool> <bool>true</bool>
</property> </property>
</widget> </widget>
</item> </item>
<item row="6" column="1" colspan="2"> <item row="6" column="2" colspan="5">
<widget class="QDateTimeEdit" name="toDate"> <widget class="QDateTimeEdit" name="toDate">
<property name="calendarPopup"> <property name="calendarPopup">
<bool>true</bool> <bool>true</bool>
</property> </property>
</widget> </widget>
</item> </item>
<item row="6" column="3"> <item row="6" column="7">
<widget class="QTimeEdit" name="toTime"/> <widget class="QTimeEdit" name="toTime"/>
</item> </item>
<item row="0" column="3">
<widget class="QToolButton" name="close">
<property name="toolTip">
<string>Close and reset filters</string>
</property>
<property name="icon">
<iconset>
<normaloff>:filter-close</normaloff>:filter-close</iconset>
</property>
<property name="autoRaise">
<bool>true</bool>
</property>
</widget>
</item>
<item row="0" column="2">
<widget class="QToolButton" name="clear">
<property name="toolTip">
<string>Reset filters</string>
</property>
<property name="icon">
<iconset>
<normaloff>:edit-clear-icon</normaloff>:edit-clear-icon</iconset>
</property>
<property name="autoRaise">
<bool>true</bool>
</property>
</widget>
</item>
</layout> </layout>
</widget> </widget>
<customwidgets> <customwidgets>