48 QVBoxLayout* layout =
new QVBoxLayout();
52 auto header =
new HeaderWidget(
"Configure Desired Launch Files",
53 "Figure out which launch files you want to be generated.",
this);
54 layout->addWidget(header);
56 QSplitter* splitter =
new QSplitter(Qt::Horizontal,
this);
57 splitter->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);
59 list_widget_ =
new QListWidget(
this);
60 list_widget_->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);
61 list_widget_->setSelectionMode(QAbstractItemView::ExtendedSelection);
62 connect(list_widget_, SIGNAL(currentItemChanged(QListWidgetItem*, QListWidgetItem*)),
this,
63 SLOT(onNewSelectedItem(QListWidgetItem*, QListWidgetItem*)));
65 splitter->addWidget(list_widget_);
69 QListWidgetItem* item =
new QListWidgetItem(QString(lb.getTitle().c_str()), list_widget_);
70 item->setData(Qt::UserRole, QVariant(lb.getID()));
72 list_widget_->addItem(item);
75 text_widget_ =
new QLabel(
this);
76 text_widget_->setFrameShape(QFrame::StyledPanel);
77 text_widget_->setFrameShadow(QFrame::Raised);
78 text_widget_->setLineWidth(1);
79 text_widget_->setMidLineWidth(0);
80 text_widget_->setWordWrap(
true);
81 text_widget_->setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Expanding);
82 text_widget_->setMinimumWidth(100);
83 text_widget_->setAlignment(Qt::AlignTop);
84 splitter->addWidget(text_widget_);
85 layout->addWidget(splitter);
91 unsigned int getID(QListWidgetItem* item)
93 QVariant data = item->data(Qt::UserRole);
99 disconnect(list_widget_, SIGNAL(itemChanged(QListWidgetItem*)),
this, SLOT(changeCheckedState(QListWidgetItem*)));
100 for (
int i = 0; i < list_widget_->count(); ++i)
102 QListWidgetItem* item = list_widget_->item(i);
104 unsigned int id =
getID(item);
106 item->setCheckState(setup_step_.
getState(
id) ? Qt::Checked : Qt::Unchecked);
108 connect(list_widget_, SIGNAL(itemChanged(QListWidgetItem*)),
this, SLOT(changeCheckedState(QListWidgetItem*)));
111 void LaunchesWidget::onNewSelectedItem(QListWidgetItem* current, QListWidgetItem* )
113 unsigned int id =
getID(current);
117 void LaunchesWidget::changeCheckedState(QListWidgetItem* item)
119 unsigned int id =
getID(item);
120 bool state = (item->checkState() == Qt::Checked);
127 #include <pluginlib/class_list_macros.hpp>
PLUGINLIB_EXPORT_CLASS(cached_ik_kinematics_plugin::CachedIKKinematicsPlugin< kdl_kinematics_plugin::KDLKinematicsPlugin >, kinematics::KinematicsBase)
One launch file and any other bonus files that get bundled with it, i.e. the RViz launch file and its...
void setState(unsigned int id, bool state)
Sets whether the LaunchBundle with the given id is included (true) or not (false)
bool getState(unsigned int id) const
const std::vector< LaunchBundle > & getAvailableLaunchBundles() const
Get all available launch bundles.
const std::string & getDescription(unsigned int id) const
unsigned int getID(QListWidgetItem *item)