this, SLOT(changed_adaptor()));
connect(referenceED, SIGNAL(textChanged(QString)),
this, SLOT(changed_adaptor()));
- connect(findLE, SIGNAL(returnPressed()),
- this, SLOT(on_searchPB_clicked()));
+ connect(findLE, SIGNAL(textEdited(QString)),
+ this, SLOT(filterLabels()));
connect(csFindCB, SIGNAL(clicked()),
- this, SLOT(on_searchPB_clicked()));
+ this, SLOT(filterLabels()));
connect(nameED, SIGNAL(textChanged(QString)),
this, SLOT(changed_adaptor()));
connect(refsTW, SIGNAL(itemClicked(QTreeWidgetItem *, int)),
void GuiRef::updateClicked()
{
- findLE->clear();
updateRefs();
}
refsTW->setUpdatesEnabled(true);
refsTW->update();
+ // redo filter
+ filterLabels();
+
// Re-activate the emission of signals by these widgets.
refsTW->blockSignals(false);
referenceED->blockSignals(false);
}
-void GuiRef::on_findLE_textChanged(const QString & text)
+void GuiRef::filterLabels()
{
- searchPB->setDisabled(text.isEmpty());
-}
-
-
-void GuiRef::on_searchPB_clicked()
-{
- QTreeWidgetItemIterator it(refsTW);
Qt::CaseSensitivity cs = csFindCB->isChecked() ?
Qt::CaseSensitive : Qt::CaseInsensitive;
+ QTreeWidgetItemIterator it(refsTW);
while (*it) {
(*it)->setHidden(
(*it)->childCount() == 0
<x>0</x>
<y>0</y>
<width>386</width>
- <height>479</height>
+ <height>443</height>
</rect>
</property>
<property name="windowTitle" >
<property name="spacing" >
<number>6</number>
</property>
+ <item row="2" column="0" colspan="3" >
+ <layout class="QHBoxLayout" >
+ <property name="margin" >
+ <number>0</number>
+ </property>
+ <property name="spacing" >
+ <number>6</number>
+ </property>
+ <item>
+ <widget class="QLabel" name="findKeysLA" >
+ <property name="text" >
+ <string>Fil&ter:</string>
+ </property>
+ <property name="alignment" >
+ <set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter</set>
+ </property>
+ <property name="buddy" >
+ <cstring>findLE</cstring>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QLineEdit" name="findLE" >
+ <property name="toolTip" >
+ <string>Enter string to filter the label list</string>
+ </property>
+ <property name="text" >
+ <string/>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QCheckBox" name="csFindCB" >
+ <property name="toolTip" >
+ <string>Filter case-sensitively</string>
+ </property>
+ <property name="text" >
+ <string>Case-sensiti&ve</string>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </item>
<item row="7" column="0" colspan="3" >
<layout class="QHBoxLayout" >
<property name="margin" >
<item row="1" column="0" colspan="3" >
<widget class="QTreeWidget" name="refsTW" />
</item>
- <item row="2" column="0" colspan="3" >
- <widget class="QFrame" name="frame" >
- <property name="frameShape" >
- <enum>QFrame::StyledPanel</enum>
- </property>
- <property name="frameShadow" >
- <enum>QFrame::Plain</enum>
- </property>
- <layout class="QGridLayout" >
- <property name="margin" >
- <number>9</number>
- </property>
- <property name="spacing" >
- <number>6</number>
- </property>
- <item row="1" column="1" >
- <widget class="QCheckBox" name="csFindCB" >
- <property name="text" >
- <string>Case-sensiti&ve</string>
- </property>
- </widget>
- </item>
- <item row="0" column="1" >
- <widget class="QLineEdit" name="findLE" >
- <property name="toolTip" >
- <string>Enter the text to search for and press Enter or click the button to search</string>
- </property>
- <property name="text" >
- <string/>
- </property>
- </widget>
- </item>
- <item row="0" column="2" >
- <widget class="QPushButton" name="searchPB" >
- <property name="enabled" >
- <bool>false</bool>
- </property>
- <property name="toolTip" >
- <string>Click or press Enter in the search box to search</string>
- </property>
- <property name="text" >
- <string>&Search</string>
- </property>
- <property name="autoDefault" >
- <bool>false</bool>
- </property>
- </widget>
- </item>
- <item row="0" column="0" >
- <widget class="QLabel" name="findKeysLA" >
- <property name="text" >
- <string>Searc&h:</string>
- </property>
- <property name="alignment" >
- <set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter</set>
- </property>
- <property name="buddy" >
- <cstring>findLE</cstring>
- </property>
- </widget>
- </item>
- </layout>
- </widget>
- </item>
</layout>
</widget>
<tabstops>