blob: 65f60d79de0bdde6c4fb24220a3c4fe1ff2dce0a [file] [log] [blame]
Jose Fonseca9653f952015-05-19 16:32:43 +01001#pragma once
Zack Rusinf04cf8a2011-04-12 23:21:52 -04002
3#include "ui_searchwidget.h"
4#include <QPalette>
5#include <QWidget>
6
7class QShowEvent;
8
9class SearchWidget : public QWidget
10{
11 Q_OBJECT
12public:
13 SearchWidget(QWidget *parent=0);
14
15 void setFound(bool f);
Zack Rusinf54c4fc2011-04-12 23:39:13 -040016 void show();
Zack Rusinf04cf8a2011-04-12 23:21:52 -040017signals:
Ruslan Kabatsayev75d69052019-02-20 13:41:18 +030018 void searchNext(const QString &str, Qt::CaseSensitivity cs = Qt::CaseInsensitive, bool useRegex=false);
19 void searchPrev(const QString &str, Qt::CaseSensitivity cs = Qt::CaseInsensitive, bool useRegex=false);
Zack Rusinf04cf8a2011-04-12 23:21:52 -040020
21private slots:
22 void slotSearchNext();
23 void slotSearchPrev();
24 void slotCancel();
25
26protected:
Jose Fonseca010f9962016-03-05 14:45:41 +000027 virtual bool eventFilter(QObject *object, QEvent* event) override;
28 virtual void showEvent(QShowEvent *event) override;
Zack Rusinf04cf8a2011-04-12 23:21:52 -040029
30private:
31 Qt::CaseSensitivity caseSensitivity() const;
Ruslan Kabatsayev75d69052019-02-20 13:41:18 +030032 bool regexEnabled() const;
Zack Rusinf04cf8a2011-04-12 23:21:52 -040033private:
34 Ui_SearchWidget m_ui;
35 QPalette m_origPalette;
36};