ObjectExplorerWidget.h
Go to the documentation of this file.
1 /*
2  * This file is part of ArmarX.
3  *
4  * Copyright (C) 2012-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 MemoryX::gui-plugins::SceneEditor
19  * @date 2015
20  * @copyright http://www.gnu.org/licenses/gpl-2.0.txt
21  * GNU General Public License
22  */
23 
24 #pragma once
25 
26 /* Qt headers */
27 #include <QWidget>
28 #include <QPointer>
29 #include <QSortFilterProxyModel>
30 
31 /* C++ headers */
32 #include <string>
33 #include <vector>
34 
35 #include "../controller/Controller.h"
36 #include "ObjectInspectorWidget.h"
37 #include "ObjectExplorerModel.h"
38 
39 namespace Ui
40 {
41  class ObjectExplorerWidget;
42 }
43 
44 namespace gui
45 {
46  /**
47  * This class provides a QWidget which displays all object classes from PriorKnowledge in their collections in a tree view.
48  * The object class can be filtered via a line edit.
49  *
50  */
51  class ObjectExplorerWidget : public QWidget
52  {
53  Q_OBJECT
54 
55  public:
56 
57  /**
58  * Constructor.
59  * Constructs a object explorer widget.
60  * Expects a controller::ControllerPtr to get the data to display and a <i>parent</i> Qt::QWidget.
61  *
62  * @param control shared pointer to controller::Controller
63  * @param parent parent widget
64  *
65  */
66  explicit ObjectExplorerWidget(const controller::ControllerPtr& control, QWidget* parent = 0);
67  ~ObjectExplorerWidget() override;
68 
69  /**
70  * Populates the gui::ObjectExplorerModel with data and sets up all child widgets.
71  *
72  * @see gui::ObjectExplorerModel
73  *
74  */
75  void onConnect();
76 
77  /**
78  * Translates all translatable strings in this dialog.
79  */
80  void retranslate();
81 
82  private Q_SLOTS:
83  void filterFixedString();
84  void getSelectedObject(const QModelIndex& index);
85 
86  private:
87  Ui::ObjectExplorerWidget* ui;
89  QPointer<gui::ObjectExplorerModel> sourceModel;
90 
91  };
92 }
93 
ObjectInspectorWidget.h
gui::ObjectExplorerWidget::retranslate
void retranslate()
Translates all translatable strings in this dialog.
Definition: ObjectExplorerWidget.cpp:102
gui::ObjectExplorerWidget::~ObjectExplorerWidget
~ObjectExplorerWidget() override
Definition: ObjectExplorerWidget.cpp:97
index
uint8_t index
Definition: EtherCATFrame.h:59
controller::ControllerWeakPtr
std::weak_ptr< Controller > ControllerWeakPtr
Definition: ClassDefinitions.h:42
gui::ObjectExplorerWidget::ObjectExplorerWidget
ObjectExplorerWidget(const controller::ControllerPtr &control, QWidget *parent=0)
Constructor.
Definition: ObjectExplorerWidget.cpp:40
Ui
ArmarX Headers.
Definition: ArmarXMainWindow.h:54
controller::ControllerPtr
std::shared_ptr< Controller > ControllerPtr
Definition: ClassDefinitions.h:41
gui::ObjectExplorerWidget
This class provides a QWidget which displays all object classes from PriorKnowledge in their collecti...
Definition: ObjectExplorerWidget.h:51
gui::ObjectExplorerWidget::onConnect
void onConnect()
Populates the gui::ObjectExplorerModel with data and sets up all child widgets.
Definition: ObjectExplorerWidget.cpp:91
control
This file is part of ArmarX.
ObjectExplorerModel.h