config_item.h
Go to the documentation of this file.
1 // *****************************************************************************
2 //
3 // Copyright (c) 2014, Southwest Research Institute® (SwRI®)
4 // All rights reserved.
5 //
6 // Redistribution and use in source and binary forms, with or without
7 // modification, are permitted provided that the following conditions are met:
8 // * Redistributions of source code must retain the above copyright
9 // notice, this list of conditions and the following disclaimer.
10 // * Redistributions in binary form must reproduce the above copyright
11 // notice, this list of conditions and the following disclaimer in the
12 // documentation and/or other materials provided with the distribution.
13 // * Neither the name of Southwest Research Institute® (SwRI®) nor the
14 // names of its contributors may be used to endorse or promote products
15 // derived from this software without specific prior written permission.
16 //
17 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
18 // AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
19 // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
20 // ARE DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> BE LIABLE FOR ANY
21 // DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
22 // (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
23 // LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
24 // ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
26 // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27 //
28 // *****************************************************************************
29 
30 #ifndef MAPVIZ_CONFIG_ITEM_H_
31 #define MAPVIZ_CONFIG_ITEM_H_
32 
33 // C++ standard libraries
34 #include <string>
35 #include <vector>
36 
37 // QT libraries
38 #include <QWidget>
39 #include <QLabel>
40 #include <QMouseEvent>
41 #include <QListWidgetItem>
42 
43 // Auto-generated UI files
44 #include "ui_configitem.h"
45 
46 namespace mapviz
47 {
48  class ConfigItem : public QWidget
49  {
50  Q_OBJECT
51 
52  public:
53  explicit ConfigItem(QWidget *parent = 0, Qt::WindowFlags flags = 0);
54  ~ConfigItem();
55 
56  void SetName(QString name);
57  void SetType(QString type);
58  void SetWidget(QWidget* widget);
59 
60  void SetListItem(QListWidgetItem* item) { item_ = item; }
61  bool Collapsed() const { return ui_.content->isHidden(); }
62  QString Name() const { return name_; }
63 
64  Ui::configitem ui_;
65 
66  Q_SIGNALS:
67  void UpdateSizeHint();
68  void ToggledDraw(QListWidgetItem* plugin, bool visible);
69  void RemoveRequest(QListWidgetItem* plugin);
70 
71  public Q_SLOTS:
72  void Hide();
73  void EditName();
74  void Remove();
75  void ToggleDraw(bool toggled);
76 
77  private:
78  virtual void contextMenuEvent(QContextMenuEvent *event) override;
79 
80  protected:
81  QListWidgetItem* item_;
82  QString name_;
83  QString type_;
86  bool visible_;
87  };
88 }
89 
90 #endif // MAPVIZ_CONFIG_ITEM_H_
void RemoveRequest(QListWidgetItem *plugin)
void SetWidget(QWidget *widget)
Definition: config_item.cpp:90
string name
Ui::configitem ui_
Definition: config_item.h:64
bool Collapsed() const
Definition: config_item.h:61
QAction * edit_name_action_
Definition: config_item.h:84
void ToggleDraw(bool toggled)
Definition: config_item.cpp:56
QString Name() const
Definition: config_item.h:62
void SetName(QString name)
Definition: config_item.cpp:78
void ToggledDraw(QListWidgetItem *plugin, bool visible)
void SetListItem(QListWidgetItem *item)
Definition: config_item.h:60
void SetType(QString type)
Definition: config_item.cpp:84
ConfigItem(QWidget *parent=0, Qt::WindowFlags flags=0)
Definition: config_item.cpp:37
QAction * remove_item_action_
Definition: config_item.h:85
virtual void contextMenuEvent(QContextMenuEvent *event) override
Definition: config_item.cpp:70
QListWidgetItem * item_
Definition: config_item.h:81


mapviz
Author(s): Marc Alban
autogenerated on Sun Nov 22 2020 03:40:00