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 #include <ArmarXGui/gui-plugins/ScenarioManager/gui/ui_applicationdatabaseview.h>
28 
30 
31 #include <qthread.h>
32 
34  QWidget(parent),
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 
53 {
54  delete ui;
55 }
56 
58 {
59  this->model = model;
60 
61  model->setSortCaseSensitivity(Qt::CaseInsensitive);
62 
63  ui->treeView->setModel(model.get());
64  ui->treeView->setColumnWidth(0, 200);
65  ui->treeView->expandAll();
66 }
67 
68 
69 
70 void ApplicationDatabaseView::on_lineEdit_textEdited(const QString& text)
71 {
72  model->setFilterRegExp(QRegExp(text, Qt::CaseInsensitive, QRegExp::FixedString));
73  ui->treeView->expandAll();
74 }
75 
76 void ApplicationDatabaseView::on_treeView_clicked(const QModelIndex& index)
77 {
78  emit itemClicked(index);
79 }
80 
82 {
83  return mutex;
84 }
ApplicationDatabaseView::getMutex
std::mutex & getMutex()
Definition: applicationdatabaseview.cpp:81
index
uint8_t index
Definition: EtherCATFrame.h:59
ApplicationDatabaseView::testSignal
void testSignal()
ApplicationDatabaseView::~ApplicationDatabaseView
~ApplicationDatabaseView() override
Definition: applicationdatabaseview.cpp:52
ApplicationDatabaseView
View containing the packages and their Applications. The user can select applications and drag them i...
Definition: applicationdatabaseview.h:46
applicationdatabaseview.h
Ui
ArmarX Headers.
Definition: ArmarXMainWindow.h:58
ApplicationDatabaseView::ApplicationDatabaseView
ApplicationDatabaseView(QWidget *parent=0)
Constructor setting up the UI.
Definition: applicationdatabaseview.cpp:33
FilterableTreeModelSortFilterProxyModelPtr
std::shared_ptr< FilterableTreeModelSortFilterProxyModel > FilterableTreeModelSortFilterProxyModelPtr
Definition: filterabletreemodelsortfilterproxymodel.h:65
ApplicationDatabaseView::setModel
void setModel(FilterableTreeModelSortFilterProxyModelPtr model)
Sets the model of this view.
Definition: applicationdatabaseview.cpp:57
ApplicationDatabaseView::itemClicked
void itemClicked(const QModelIndex &index)
Logging.h