TreeBox.h
Go to the documentation of this file.
1 /*
2 * This file is part of ArmarX.
3 *
4 * ArmarX is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License version 2 as
6 * published by the Free Software Foundation.
7 *
8 * ArmarX is distributed in the hope that it will be useful, but
9 * WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
12 *
13 * You should have received a copy of the GNU General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 *
16 * @package ArmarX::
17 * @author Mirko Waechter ( mirko.waechter at kit dot edu)
18 * @date 2012
19 * @copyright http://www.gnu.org/licenses/gpl-2.0.txt
20 * GNU General Public License
21 */
22 
23 #pragma once
24 
25 #include <QApplication>
26 #include <QComboBox>
27 #include <QDir>
28 #include <QDirModel>
29 #include <QEvent>
30 #include <QItemDelegate>
31 #include <QLineEdit>
32 #include <QModelIndex>
33 #include <QMouseEvent>
34 #include <QStandardItemModel>
35 #include <QStyledItemDelegate>
36 #include <QTreeView>
37 
39 
40 #include "StateItemModel.h"
41 
42 class QVBoxLayout;
43 class TreeBox;
44 
45 class TreeBox : public QComboBox
46 {
47  Q_OBJECT
48 public:
49  TreeBox(QStandardItemModel* model, bool hideChildren = true, QWidget* parent = 0);
50 
51 
52  bool eventFilter(QObject* object, QEvent* event) override;
53 
54  void showPopup() override;
55 
56  void hidePopup() override;
57 signals:
58  void itemSelected(QModelIndex index);
59 public slots:
60  void applyFilter(QString searchString);
61 private slots:
62  void delayedIndexChanging();
63 
64 private:
65  bool applyFilter(const QStandardItem* parent, QString searchString);
66  bool skipNextHide;
67  QTreeView* treeView;
68  QModelIndex selectedIndex;
69 };
TreeBox::hidePopup
void hidePopup() override
Definition: TreeBox.cpp:99
index
uint8_t index
Definition: EtherCATFrame.h:59
TreeBox::applyFilter
void applyFilter(QString searchString)
Definition: TreeBox.cpp:124
TreeBox::TreeBox
TreeBox(QStandardItemModel *model, bool hideChildren=true, QWidget *parent=0)
Definition: TreeBox.cpp:37
TreeBox::showPopup
void showPopup() override
Definition: TreeBox.cpp:93
StateItemModel.h
TreeBox
Definition: TreeBox.h:45
TreeBox::eventFilter
bool eventFilter(QObject *object, QEvent *event) override
Definition: TreeBox.cpp:58
TreeBox::itemSelected
void itemSelected(QModelIndex index)
Logging.h