Olive
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros
actionsearch.h
Go to the documentation of this file.
1 /***
2 
3  Olive - Non-Linear Video Editor
4  Copyright (C) 2019 Olive Team
5 
6  This program is free software: you can redistribute it and/or modify
7  it under the terms of the GNU General Public License as published by
8  the Free Software Foundation, either version 3 of the License, or
9  (at your option) any later version.
10 
11  This program is distributed in the hope that it will be useful,
12  but WITHOUT ANY WARRANTY; without even the implied warranty of
13  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  GNU General Public License for more details.
15 
16  You should have received a copy of the GNU General Public License
17  along with this program. If not, see <http://www.gnu.org/licenses/>.
18 
19 ***/
20 
21 #ifndef ACTIONSEARCH_H
22 #define ACTIONSEARCH_H
23 
24 #include <QDialog>
25 #include <QLineEdit>
26 #include <QListWidget>
27 #include <QMenu>
28 
29 class ActionSearchList;
30 
37 class ActionSearch : public QDialog
38 {
39  Q_OBJECT
40 public:
50  ActionSearch(QWidget* parent);
51 private slots:
75  void search_update(const QString& s, const QString &p = nullptr, QMenu *parent = nullptr);
76 
84  void perform_action();
85 
92  void move_selection_up();
93 
100  void move_selection_down();
101 private:
106 };
107 
114 class ActionSearchList : public QListWidget {
115  Q_OBJECT
116 public:
123  ActionSearchList(QWidget* parent);
124 protected:
128  void mouseDoubleClickEvent(QMouseEvent *);
129 signals:
133  void dbl_click();
134 };
135 
142 class ActionSearchEntry : public QLineEdit {
143  Q_OBJECT
144 public:
151  ActionSearchEntry(QWidget* parent);
152 protected:
157  void keyPressEvent(QKeyEvent * event);
158 signals:
162  void moveSelectionUp();
163 
167  void moveSelectionDown();
168 };
169 
170 #endif // ACTIONSEARCH_H
void move_selection_down()
Move selection down.
Definition: actionsearch.cpp:202
ActionSearchList * list_widget
Main widget that shows the list of commands.
Definition: actionsearch.h:105
void moveSelectionDown()
Emitted when the user presses the down arrow key.
void move_selection_up()
Move selection up.
Definition: actionsearch.cpp:186
The ActionSearchEntry class.
Definition: actionsearch.h:142
void search_update(const QString &s, const QString &p=nullptr, QMenu *parent=nullptr)
Update the list of actions according to a search query.
Definition: actionsearch.cpp:86
void dbl_click()
Signal emitted when a QListWidget item is double clicked.
The ActionSearchList class.
Definition: actionsearch.h:114
ActionSearch(QWidget *parent)
ActionSearch Constructor.
Definition: actionsearch.cpp:30
void mouseDoubleClickEvent(QMouseEvent *)
Override of QListWidget&#39;s double click event that emits a signal.
Definition: actionsearch.cpp:239
void keyPressEvent(QKeyEvent *event)
Override of QLineEdit&#39;s key press event that listens for up/down key presses.
Definition: actionsearch.cpp:220
void perform_action()
Perform the currently selected action.
Definition: actionsearch.cpp:166
The ActionSearch class.
Definition: actionsearch.h:37
ActionSearchList(QWidget *parent)
ActionSearchList Constructor.
Definition: actionsearch.cpp:237
void moveSelectionUp()
Emitted when the user presses the up arrow key.
ActionSearchEntry(QWidget *parent)
ActionSearchEntry.
Definition: actionsearch.cpp:218