applicationdatabaseview.cpp
Go to the documentation of this file.
1/*
2 * This file is part of ArmarX.
3 *
4 * Copyright (C) 2011-2016, High Performance Humanoid Technologies (H2T), Karlsruhe Institute of Technology (KIT), all rights reserved.
5 *
6 * ArmarX is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 2 as
8 * published by the Free Software Foundation.
9 *
10 * ArmarX is distributed in the hope that it will be useful, but
11 * WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with this program. If not, see <http://www.gnu.org/licenses/>.
17 *
18 * @package ArmarXCore::core
19 * @author Cedric Seehausen (usdnr at kit dot edu)
20 * @date 2016
21 * @copyright http://www.gnu.org/licenses/gpl-2.0.txt
22 * GNU General Public License
23 */
24
25
27
28#include <qthread.h>
29
31
32#include <ArmarXGui/gui-plugins/ScenarioManager/gui/ui_applicationdatabaseview.h>
33
35 QWidget(parent), ui(new Ui::ApplicationDatabaseView)
36{
37 ui->setupUi(this);
38
39 ui->treeView->setModel(model.get());
40
41 ui->treeView->header()->setSortIndicator(0, Qt::SortOrder::AscendingOrder);
42 ui->treeView->setSortingEnabled(true);
43
44 ui->treeView->setSelectionMode(QAbstractItemView::ExtendedSelection);
45 ui->treeView->setDragEnabled(true);
46 ui->treeView->setAcceptDrops(false);
47 ui->treeView->setDropIndicatorShown(false);
48
49 connect(this, SIGNAL(testSignal()), ui->treeView, SLOT(repaint()));
50}
51
56
57void
59{
60 this->model = model;
61
62 model->setSortCaseSensitivity(Qt::CaseInsensitive);
63
64 ui->treeView->setModel(model.get());
65 ui->treeView->setColumnWidth(0, 200);
66 ui->treeView->expandAll();
67}
68
69void
70ApplicationDatabaseView::on_lineEdit_textEdited(const QString& text)
71{
72 model->setFilterRegExp(QRegExp(text, Qt::CaseInsensitive, QRegExp::FixedString));
73 ui->treeView->expandAll();
74}
75
76void
77ApplicationDatabaseView::on_treeView_clicked(const QModelIndex& index)
78{
79 emit itemClicked(index);
80}
81
82std::mutex&
84{
85 return mutex;
86}
uint8_t index
ApplicationDatabaseView(QWidget *parent=0)
Constructor setting up the UI.
void itemClicked(const QModelIndex &index)
void setModel(FilterableTreeModelSortFilterProxyModelPtr model)
Sets the model of this view.
std::shared_ptr< FilterableTreeModelSortFilterProxyModel > FilterableTreeModelSortFilterProxyModelPtr
ArmarX Headers.