swift
Loading...
Searching...
No Matches
countryfilterbar.cpp
1// SPDX-FileCopyrightText: Copyright (C) 2015 swift Project Community / Contributors
2// SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-swift-pilot-client-1
3
5
6#include <QLineEdit>
7
8#include "ui_countryfilterbar.h"
9
13#include "misc/countrylist.h"
14
15using namespace swift::gui;
16using namespace swift::gui::models;
17using namespace swift::misc;
18
19namespace swift::gui::filters
20{
22 {
23 ui->setupUi(this);
24 this->setButtonsAndCount(ui->filter_Buttons);
27
28 auto *ucv = new CUpperCaseValidator(this);
29 ui->le_IsoCode->setValidator(ucv);
30
31 // reset form
32 this->clearForm();
33 }
34
36
37 std::unique_ptr<swift::gui::models::IModelFilter<CCountryList>> CCountryFilterBar::createModelFilter() const
38 {
39 return std::make_unique<CCountryFilter>(ui->le_IsoCode->text(), ui->le_Name->text());
40 }
41
42 void CCountryFilterBar::onRowCountChanged(int count, bool withFilter)
43 {
44 ui->filter_Buttons->onRowCountChanged(count, withFilter);
45 }
46
48 {
49 ui->le_IsoCode->clear();
50 ui->le_Name->clear();
51 }
52} // namespace swift::gui::filters
CCountryFilterBar(QWidget *parent=nullptr)
Constructor.
std::unique_ptr< swift::gui::models::IModelFilter< swift::misc::CCountryList > > createModelFilter() const
Get the filter, this is the filter itself, not its widget or dialog.
void onRowCountChanged(int count, bool withFilter)
Row count has been changed.
virtual void triggerFilter()
Trigger filtering.
void setButtonsAndCount(CFilterBarButtons *buttons)
Set and connect filter bar buttons.
CFilterWidget(QWidget *parent=nullptr)
Constructor.
Filter to search data sets.
Models to be used with views, mainly QTableView.
GUI related classes.
Free functions in swift::misc.
void returnPressed()
QMetaObject::Connection connect(const QObject *sender, PointerToMemberFunction signal, Functor functor)
QObject * parent() const const
QWidget(QWidget *parent, Qt::WindowFlags f)