TopicSelector.hh
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2012-2016 Open Source Robotics Foundation
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  *
16  */
17 #ifndef _TOPICSELECTOR_HH_
18 #define _TOPICSELECTOR_HH_
19 
20 #include <string>
21 
22 #include "gazebo/common/Time.hh"
23 #include "gazebo/gui/qt.h"
24 #include "gazebo/util/system.hh"
25 
26 namespace gazebo
27 {
28  namespace gui
29  {
32 
35  class GZ_GUI_VISIBLE TopicSelector : public QDialog
36  {
37  Q_OBJECT
38 
41  public: TopicSelector(QWidget *_parent = 0);
42 
44  public: virtual ~TopicSelector();
45 
49  public: std::string GetTopic() const;
50 
53  public: std::string GetMsgType() const;
54 
56  private: void GetTopicList();
57 
59  private slots: void OnOkay();
60 
62  private slots: void OnCancel();
63 
67  private slots: void OnSelection(QTreeWidgetItem *_item, int _column);
68 
72  private slots: void OnDoubleClickSelection(QTreeWidgetItem *_item,
73  int _column);
74 
76  private: QTreeWidget *treeWidget;
77 
79  private: QPushButton *okayButton;
80 
82  private: std::string topicName;
83 
85  private: std::string msgType;
86 
88  private: common::Time prevTime;
89  };
91  }
92 }
93 #endif
A widget that provides a list of topics to select from.
Definition: TopicSelector.hh:35
A Time class, can be used to hold wall- or sim-time.
Definition: Time.hh:44