00001 #ifndef _RQT_MRTA_PARAMETER_TREE_WIDGET_H_ 00002 #define _RQT_MRTA_PARAMETER_TREE_WIDGET_H_ 00003 00004 #include <QTreeWidget> 00005 00006 namespace rqt_mrta 00007 { 00008 namespace config 00009 { 00010 class Config; 00011 class Param; 00012 class Params; 00013 } 00014 typedef config::Param ParamConfig; 00015 typedef config::Params ParamsConfig; 00016 class ParamTreeWidget : public QTreeWidget 00017 { 00018 Q_OBJECT 00019 public: 00020 ParamTreeWidget(QWidget* parent = NULL); 00021 virtual ~ParamTreeWidget(); 00022 config::Config* getConfig() const; 00023 void setConfig(config::Config* config); 00024 QString validate(QTreeWidgetItem* parent = NULL) const; 00025 00026 signals: 00027 void changed(); 00028 void paramAdded(const QString& full_name); 00029 00030 private: 00031 config::Config* config_; 00032 void addParam(ParamConfig* param, QTreeWidgetItem *parent); 00033 void addParam(ParamsConfig *params, QTreeWidgetItem* parent); 00034 QTreeWidgetItem* getItem(const QString& full_name, QTreeWidgetItem* parent = NULL) const; 00035 00036 private slots: 00037 void currentItemChanged(QTreeWidgetItem* current, QTreeWidgetItem* 00038 previous); 00039 void itemDoubleClicked(QTreeWidgetItem* item, int column); 00040 void configIdChanged(const QString& config_id); 00041 void configAdded(const QString& full_name); 00042 void configRemoved(const QString& full_name); 00043 void configCleared(const QString& full_name); 00044 void configNameChanged(const QString& previous_name, const QString& name); 00045 void configValueChanged(const QString& name, const QVariant& value); 00046 void configToolTipChanged(const QString& name, const QString& tool_tip); 00047 void paramDestroyed(); 00048 00049 }; 00050 } 00051 00052 #endif // _RQT_MRTA_PARAMETER_TREE_WIDGET_H_