scenariolistview.h
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
26#pragma once
27
28#include <memory>
29
30#include <QAbstractItemModel>
31#include <QAction>
32#include <QMenu>
33#include <QWidget>
34
37
38#include "buttondelegate.h"
40#include "namelocationview.h"
41
42namespace Ui
43{
44 class ScenarioListView;
45}
46
47/**
48* @class ScenarioListView
49* @brief View that shows a list of Scenarios.
50* Allows to start, stop, restart Applications and Scenarios. Also allows to open Scenarios and remove/add items.
51*/
52class ScenarioListView : public QWidget
53{
54 Q_OBJECT
55
56public:
57 /**
58 * Constructor that sets up the ui and behaviour of this view.
59 * @param parent parent widget
60 */
61 explicit ScenarioListView(QWidget* parent = 0);
62
63 /**
64 * Destructor.
65 */
66 ~ScenarioListView() override;
67
68signals:
69 void startApplication(int row, int column, QModelIndex parent);
70 void stopApplication(int row, int column, QModelIndex parent);
71 void restartApplication(int row, int column, QModelIndex parent);
74 void removeItem(QModelIndex index);
75 void itemClicked(const QModelIndex& index);
76
77public slots:
78 /**
79 * Sets the model of this view.
80 * @param model the underlying model
81 */
83
84private slots:
85 void on_searchBar_textEdited(const QString& text);
86 void startButtonClicked(int row, int column, QModelIndex parent);
87 void stopButtonClicked(int row, int column, QModelIndex parent);
88
89 void restartButtonClicked(int row, int column, QModelIndex parent);
90
91 void on_newButton_clicked();
92
93 void on_openButton_clicked();
94 void removeItemTriggered();
95
96 void onCustomContextMenu(const QPoint& point);
97
98 void on_treeView_clicked(const QModelIndex& index);
99
100private:
101 Ui::ScenarioListView* ui;
103 ButtonDelegate startButtonDelegate;
104 ButtonDelegate stopButtonDelegate;
105 ButtonDelegate restartButtonDelegate;
106 QMenu contextMenu;
107 QAction removeAction;
108};
uint8_t index
Manages a button.
~ScenarioListView() override
Destructor.
void itemClicked(const QModelIndex &index)
ScenarioListView(QWidget *parent=0)
Constructor that sets up the ui and behaviour of this view.
void stopApplication(int row, int column, QModelIndex parent)
void setModel(FilterableTreeModelSortFilterProxyModelPtr model)
Sets the model of this view.
void restartApplication(int row, int column, QModelIndex parent)
void startApplication(int row, int column, QModelIndex parent)
void removeItem(QModelIndex index)
std::shared_ptr< FilterableTreeModelSortFilterProxyModel > FilterableTreeModelSortFilterProxyModelPtr
ArmarX Headers.