gepetto-viewer
4.13.0
An user-friendly Graphical Interface
action-search-bar.hh
Go to the documentation of this file.
1
// Copyright (c) 2015-2018, LAAS-CNRS
2
// Authors: Joseph Mirabel (joseph.mirabel@laas.fr)
3
//
4
// This file is part of gepetto-viewer.
5
// gepetto-viewer is free software: you can redistribute it
6
// and/or modify it under the terms of the GNU Lesser General Public
7
// License as published by the Free Software Foundation, either version
8
// 3 of the License, or (at your option) any later version.
9
//
10
// gepetto-viewer is distributed in the hope that it will be
11
// useful, but WITHOUT ANY WARRANTY; without even the implied warranty
12
// of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13
// General Lesser Public License for more details. You should have
14
// received a copy of the GNU Lesser General Public License along with
15
// gepetto-viewer. If not, see <http://www.gnu.org/licenses/>.
16
17
#ifndef GEPETTO_GUI_ACTION_SEARCH_BAR_HH
18
#define GEPETTO_GUI_ACTION_SEARCH_BAR_HH
19
20
#include <QLineEdit>
21
#include <QMap>
22
#include <QString>
23
#include <QStringListModel>
24
#include <
gepetto/gui/fwd.hh
>
25
26
namespace
gepetto
{
27
namespace
gui {
28
class
ActionSearchBar
:
public
QLineEdit {
29
Q_OBJECT
30
31
public
:
32
ActionSearchBar
(QWidget* parent);
33
34
void
addAction
(QAction* action);
35
36
QAction*
showAction
()
const
{
return
showAction_; }
37
38
protected
:
39
virtual
void
keyPressEvent
(QKeyEvent* event);
40
virtual
void
showEvent
(QShowEvent* event);
41
42
private
slots:
43
bool
trigger(
const
QString& s);
44
void
handleReturnPressed();
45
46
private
:
47
QStringListModel* model_;
48
QCompleter* completer_;
49
QMap<QString, QAction*> actions_;
50
QAction* showAction_;
51
};
52
}
// namespace gui
53
}
// namespace gepetto
54
55
#endif // GEPETTO_GUI_ACTION_SEARCH_BAR_HH
gepetto
Definition:
action-search-bar.hh:26
gepetto::gui::ActionSearchBar::showAction
QAction * showAction() const
Definition:
action-search-bar.hh:36
fwd.hh
gepetto::gui::ActionSearchBar::addAction
void addAction(QAction *action)
gepetto::gui::ActionSearchBar::keyPressEvent
virtual void keyPressEvent(QKeyEvent *event)
gepetto::gui::ActionSearchBar::showEvent
virtual void showEvent(QShowEvent *event)
gepetto::gui::ActionSearchBar::ActionSearchBar
ActionSearchBar(QWidget *parent)
gepetto::gui::ActionSearchBar
Definition:
action-search-bar.hh:28
include
gepetto
gui
action-search-bar.hh
Generated by
1.8.17