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 
26 
27 #include <QApplication>
28 #include<QComboBox>
29 #include<QDirModel>
30 #include<QTreeView>
31 #include<QEvent>
32 #include<QMouseEvent>
33 #include<QModelIndex>
34 #include<QDir>
35 #include <QItemDelegate>
36 #include <QStyledItemDelegate>
37 #include <QStandardItemModel>
38 #include <QLineEdit>
39 #include "StateItemModel.h"
40 
41 class QVBoxLayout;
42 class TreeBox;
43 
44 class TreeBox :
45  public QComboBox
46 {
47  Q_OBJECT
48 public:
49  TreeBox(QStandardItemModel* model, bool hideChildren = true, QWidget* parent = 0);
50 
51 
52 
53  bool eventFilter(QObject* object, QEvent* event) override;
54 
55  void showPopup() override;
56 
57  void hidePopup() override;
58 signals:
59  void itemSelected(QModelIndex index);
60 public slots:
61  void applyFilter(QString searchString);
62 private slots:
63  void delayedIndexChanging();
64 private:
65  bool applyFilter(const QStandardItem* parent, QString searchString);
66  bool skipNextHide;
67  QTreeView* treeView ;
68  QModelIndex selectedIndex;
69 
70 };
71 
72 
TreeBox::hidePopup
void hidePopup() override
Definition: TreeBox.cpp:97
index
uint8_t index
Definition: EtherCATFrame.h:59
TreeBox::applyFilter
void applyFilter(QString searchString)
Definition: TreeBox.cpp:119
TreeBox::TreeBox
TreeBox(QStandardItemModel *model, bool hideChildren=true, QWidget *parent=0)
Definition: TreeBox.cpp:38
TreeBox::showPopup
void showPopup() override
Definition: TreeBox.cpp:92
StateItemModel.h
TreeBox
Definition: TreeBox.h:44
TreeBox::eventFilter
bool eventFilter(QObject *object, QEvent *event) override
Definition: TreeBox.cpp:57
TreeBox::itemSelected
void itemSelected(QModelIndex index)
Logging.h