aboutsummaryrefslogtreecommitdiffstats
path: root/src/findwidget.h
diff options
context:
space:
mode:
authorNils Achtergarde <[email protected]>2018-01-04 21:39:25 +0000
committerNils Achtergarde <[email protected]>2018-01-04 21:39:25 +0000
commitb36dc4d79f446ae69aeb85137663a4e0ca23eba2 (patch)
tree23d0ae5e94e874064143735c249a2ad2cb95ad16 /src/findwidget.h
parentadded .gitignore with mocfiles-dir and objectfiles-dir (diff)
downloadgpg4usb-b36dc4d79f446ae69aeb85137663a4e0ca23eba2.tar.gz
gpg4usb-b36dc4d79f446ae69aeb85137663a4e0ca23eba2.zip
put *.h and *.cpp to src-subdirectory
Diffstat (limited to 'src/findwidget.h')
-rw-r--r--src/findwidget.h42
1 files changed, 42 insertions, 0 deletions
diff --git a/src/findwidget.h b/src/findwidget.h
new file mode 100644
index 0000000..4e69fa6
--- /dev/null
+++ b/src/findwidget.h
@@ -0,0 +1,42 @@
+
+#ifndef FINDWIDGET_H
+#define FINDWIDGET_H
+
+#include "editorpage.h"
+
+#include <QWidget>
+
+/**
+ * @brief Class for handling the find widget shown at buttom of a textedit-page
+ */
+class FindWidget : public QWidget
+{
+ Q_OBJECT
+
+public:
+ /**
+ * @brief
+ *
+ * @param parent The parent widget
+ */
+ explicit FindWidget(QWidget *parent, QTextEdit *edit);
+
+private:
+ void keyPressEvent( QKeyEvent* e );
+ /**
+ * @details Set background of findEdit to red, if no match is found (Documents textcursor position equals -1),
+ * otherwise set it to white.
+ */
+ void setBackground();
+
+ QTextEdit *mTextpage; /** Textedit associated to the notification */
+ QLineEdit *findEdit; /** Label holding the text shown in verifyNotification */
+ QTextCharFormat cursorFormat;
+
+private slots:
+ void slotFindNext();
+ void slotFindPrevious();
+ void slotFind();
+ void slotClose();
+};
+#endif // FINDWIDGET_H