Merge pull request #4178 from jamierocks/qt-clear-button

NOISSUE Use Qt's clear button for ATLauncher page
This commit is contained in:
Petr Mrázek 2021-10-24 01:01:58 +02:00 committed by GitHub
commit 110c73edf2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 6 additions and 18 deletions

View File

@ -31,7 +31,6 @@ AtlPage::AtlPage(NewInstanceDialog* dialog, QWidget *parent)
ui->sortByBox->setCurrentText(filterModel->translateCurrentSorting()); ui->sortByBox->setCurrentText(filterModel->translateCurrentSorting());
connect(ui->searchEdit, &QLineEdit::textChanged, this, &AtlPage::triggerSearch); connect(ui->searchEdit, &QLineEdit::textChanged, this, &AtlPage::triggerSearch);
connect(ui->resetButton, &QPushButton::clicked, this, &AtlPage::resetSearch);
connect(ui->sortByBox, &QComboBox::currentTextChanged, this, &AtlPage::onSortingSelectionChanged); connect(ui->sortByBox, &QComboBox::currentTextChanged, this, &AtlPage::onSortingSelectionChanged);
connect(ui->packView->selectionModel(), &QItemSelectionModel::currentChanged, this, &AtlPage::onSelectionChanged); connect(ui->packView->selectionModel(), &QItemSelectionModel::currentChanged, this, &AtlPage::onSelectionChanged);
connect(ui->versionSelectionBox, &QComboBox::currentTextChanged, this, &AtlPage::onVersionSelectionChanged); connect(ui->versionSelectionBox, &QComboBox::currentTextChanged, this, &AtlPage::onVersionSelectionChanged);
@ -85,11 +84,6 @@ void AtlPage::triggerSearch()
filterModel->setSearchTerm(ui->searchEdit->text()); filterModel->setSearchTerm(ui->searchEdit->text());
} }
void AtlPage::resetSearch()
{
ui->searchEdit->setText("");
}
void AtlPage::onSortingSelectionChanged(QString data) void AtlPage::onSortingSelectionChanged(QString data)
{ {
auto toSet = filterModel->getAvailableSortings().value(data); auto toSet = filterModel->getAvailableSortings().value(data);

View File

@ -67,7 +67,6 @@ private:
private slots: private slots:
void triggerSearch(); void triggerSearch();
void resetSearch();
void onSortingSelectionChanged(QString data); void onSortingSelectionChanged(QString data);

View File

@ -15,15 +15,15 @@
<layout class="QGridLayout" name="gridLayout_3"> <layout class="QGridLayout" name="gridLayout_3">
<item row="1" column="0"> <item row="1" column="0">
<widget class="QTreeView" name="packView"> <widget class="QTreeView" name="packView">
<property name="alternatingRowColors">
<bool>true</bool>
</property>
<property name="iconSize"> <property name="iconSize">
<size> <size>
<width>96</width> <width>96</width>
<height>48</height> <height>48</height>
</size> </size>
</property> </property>
<property name="alternatingRowColors">
<bool>true</bool>
</property>
</widget> </widget>
</item> </item>
<item row="1" column="1"> <item row="1" column="1">
@ -68,25 +68,20 @@
</item> </item>
</layout> </layout>
</item> </item>
<item row="0" column="1">
<widget class="QPushButton" name="resetButton">
<property name="text">
<string>Reset</string>
</property>
</widget>
</item>
<item row="0" column="0"> <item row="0" column="0">
<widget class="QLineEdit" name="searchEdit"> <widget class="QLineEdit" name="searchEdit">
<property name="placeholderText"> <property name="placeholderText">
<string>Search and filter ...</string> <string>Search and filter ...</string>
</property> </property>
<property name="clearButtonEnabled">
<bool>true</bool>
</property>
</widget> </widget>
</item> </item>
</layout> </layout>
</widget> </widget>
<tabstops> <tabstops>
<tabstop>searchEdit</tabstop> <tabstop>searchEdit</tabstop>
<tabstop>resetButton</tabstop>
<tabstop>packView</tabstop> <tabstop>packView</tabstop>
<tabstop>packDescription</tabstop> <tabstop>packDescription</tabstop>
<tabstop>sortByBox</tabstop> <tabstop>sortByBox</tabstop>