6 #include <QSignalMapper>
11 EmptyServiceCallInterfaceAction::EmptyServiceCallInterfaceAction( QWidget* parent )
16 QHBoxLayout*
h_layout =
new QHBoxLayout;
17 h_layout->setAlignment(Qt::AlignLeft);
18 layout =
new QVBoxLayout();
23 QToolButton* tbutton =
new QToolButton(
this);
24 tbutton->setText(target_button.
text.c_str());
25 tbutton->setToolButtonStyle(Qt::ToolButtonTextUnderIcon);
26 tbutton->setIconSize(QSize(100, 100));
27 tbutton->setIcon(QIcon(QPixmap(QString(target_button.
icon_file_path.c_str()))));
28 connect(tbutton, SIGNAL(clicked()),
signal_mapper, SLOT(map()));
42 std::string icon_package_name;
43 nh.
param<std::string>(
"icon_include_package", icon_package_name, std::string(
"jsk_rviz_plugins"));
44 ROS_INFO(
"Find Icons In %s package.", icon_package_name.c_str());
46 std::string icon_path_prefix;
47 if(!icon_package_name.empty())
51 nh.
getParam(
"rviz_service_call/buttons", buttons_list);
52 for (int32_t i = 0; i < buttons_list.
size(); ++i)
55 new_button.
icon_file_path = icon_path_prefix +
static_cast<std::string
>(buttons_list[i][
"icon"]);
56 new_button.
service_name =
static_cast<std::string
>(buttons_list[i][
"service_name"]);
57 new_button.
text =
static_cast<std::string
>(buttons_list[i][
"text"]);