qt之rviz组件的开发

  • Post author:
  • Post category:其他


在界面上添加layout来显示rviz的panel, 还需要设置下拉框

table Widget:

ui.treeWidget->setWindowTitle("Display");
ui.treeWidget->setWindowIcon(QIcon("://images/classes/Displays.svg"));
//设置头为两列:
ui.treeWidget->setHeaderLabels(QStringList()<<"key"<<"value");
QTreeWidgetItem* Global=new QTreeWidgetItem(QStringList()<<"Global Options");
Global->setIcon(0,QIcon("://images/options.png"));
ui.treeWidget->addTopLevelItem(Global);
Global->setExpanded(true);
//FixFrame
QTreeWidgetItem* Fixed_frame=new QTreeWidgetItem(QStringList()<<"Fixed Frame");
fixed_box=new QComboBox();
fixed_box->addItem("map");
fixed_box->setMaximumWidth(150);
fixed_box->setEditable(true);
 connect(fixed_box,SIGNAL(currentTextChanged(QString)),this,SLOT(slot_treewidget_value_change(QString)));
Global->addChild(Fixed_frame);



版权声明:本文为yoga_wyj原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明。