File indexing completed on 2022-11-29 18:12:01

0001 /*
0002     SPDX-FileCopyrightText: 2006 Pino Toscano <toscano.pino@tiscali.it>
0003 
0004     SPDX-License-Identifier: GPL-2.0-or-later
0005 */
0006 
0007 #ifndef KALZIUMSEARCHWIDGET_H
0008 #define KALZIUMSEARCHWIDGET_H
0009 
0010 #include <QWidget>
0011 
0012 class KLineEdit;
0013 class QTimer;
0014 
0015 /**
0016  * A small widget to control the Search kept in KalziumDataObject.
0017  *
0018  * @author Pino Toscano
0019  */
0020 class SearchWidget : public QWidget
0021 {
0022     Q_OBJECT
0023 
0024 public:
0025     /**
0026      * Construct a new empty search.
0027      */
0028     explicit SearchWidget(QWidget *parent = nullptr);
0029 
0030     ~SearchWidget() override;
0031 
0032     void giveFocus();
0033 
0034 private Q_SLOTS:
0035     void searchTextChanged(const QString &text);
0036     void slotReturnPressed();
0037     void doSearch();
0038 
0039 private:
0040     KLineEdit *const m_searchLine;
0041     QTimer *m_timer = nullptr;
0042 };
0043 
0044 #endif // KALZIUMSEARCHWIDGET_H