Go to the documentation of this file.00001
00034
00035 #include <ros/exception.h>
00036
00037 #include <rqt_cpp_common/widgets_list.h>
00038
00039 using namespace rqt_cpp_common;
00040
00041 WidgetsList::WidgetsList()
00042 {
00043 this->ui_._vlayout_for_widgets = new QVBoxLayout(
00044 ui_._scrollarea_holder_widget);
00045 }
00046
00055 void WidgetsList::add_widget(QString id_widget, QWidget *widget)
00056 {
00057 if (this->table_widgets->contains(id_widget))
00058 {
00059 }
00060 else
00061 {
00062 this->table_widgets->insert(id_widget, widget);
00063 this->ui_._vlayout_for_widgets->addWidget(widget);
00064 }
00065 }
00066
00071 void WidgetsList::remove_node(QString widget_id)
00072 {
00073 QWidget widget_tobe_removed;
00074 QWidget *tobe_returned_when_correspondent_notfound;
00075
00076 if (this->table_widgets->contains(widget_id))
00077 {
00078 ros::Exception(
00079 "The given widget_id = " + widget_id.toStdString()
00080 + " doesn't exist or no item is associated.");
00081 }
00082 this->ui_._vlayout_for_widgets->removeWidget(&widget_tobe_removed);
00083 this->table_widgets->take(widget_id);
00084 }