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_
mapviz::ConfigItem::Name
QString Name() const
Definition: config_item.h:62
mapviz::ConfigItem::SetName
void SetName(QString name)
Definition: config_item.cpp:78
mapviz
Definition: color_button.h:36
mapviz::ConfigItem::ToggledDraw
void ToggledDraw(QListWidgetItem *plugin, bool visible)
mapviz::ConfigItem::EditName
void EditName()
Definition: config_item.cpp:96
mapviz::ConfigItem::UpdateSizeHint
void UpdateSizeHint()
mapviz::ConfigItem::SetType
void SetType(QString type)
Definition: config_item.cpp:84
mapviz::ConfigItem::edit_name_action_
QAction * edit_name_action_
Definition: config_item.h:84
mapviz::ConfigItem::name_
QString name_
Definition: config_item.h:82
mapviz::ConfigItem::Hide
void Hide()
Definition: config_item.cpp:117
mapviz::ConfigItem::SetWidget
void SetWidget(QWidget *widget)
Definition: config_item.cpp:90
mapviz::ConfigItem::visible_
bool visible_
Definition: config_item.h:86
mapviz::ConfigItem::ToggleDraw
void ToggleDraw(bool toggled)
Definition: config_item.cpp:56
mapviz::ConfigItem::RemoveRequest
void RemoveRequest(QListWidgetItem *plugin)
mapviz::ConfigItem::~ConfigItem
~ConfigItem()
Definition: config_item.cpp:52
mapviz::ConfigItem
Definition: config_item.h:48
mapviz::ConfigItem::remove_item_action_
QAction * remove_item_action_
Definition: config_item.h:85
mapviz::ConfigItem::SetListItem
void SetListItem(QListWidgetItem *item)
Definition: config_item.h:60
mapviz::ConfigItem::Collapsed
bool Collapsed() const
Definition: config_item.h:61
mapviz::ConfigItem::Remove
void Remove()
Definition: config_item.cpp:112
mapviz::ConfigItem::contextMenuEvent
virtual void contextMenuEvent(QContextMenuEvent *event) override
Definition: config_item.cpp:70
mapviz::ConfigItem::ui_
Ui::configitem ui_
Definition: config_item.h:64
mapviz::ConfigItem::type_
QString type_
Definition: config_item.h:83
mapviz::ConfigItem::ConfigItem
ConfigItem(QWidget *parent=0, Qt::WindowFlags flags=0)
Definition: config_item.cpp:37
mapviz::ConfigItem::item_
QListWidgetItem * item_
Definition: config_item.h:81
name
string name


mapviz
Author(s): Marc Alban
autogenerated on Sun Sep 8 2024 02:27:09