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
42class QVBoxLayout;
43class TreeBox;
44
45class TreeBox : public QComboBox
46{
47 Q_OBJECT
48public:
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;
57signals:
58 void itemSelected(QModelIndex index);
59public slots:
60 void applyFilter(QString searchString);
61private slots:
62 void delayedIndexChanging();
63
64private:
65 bool applyFilter(const QStandardItem* parent, QString searchString);
66 bool skipNextHide;
67 QTreeView* treeView;
68 QModelIndex selectedIndex;
69};
uint8_t index
TreeBox(QStandardItemModel *model, bool hideChildren=true, QWidget *parent=0)
Definition TreeBox.cpp:37
void hidePopup() override
Definition TreeBox.cpp:99
void showPopup() override
Definition TreeBox.cpp:93
bool eventFilter(QObject *object, QEvent *event) override
Definition TreeBox.cpp:58
void applyFilter(QString searchString)
Definition TreeBox.cpp:124
void itemSelected(QModelIndex index)