• 4893阅读
  • 0回复

QT 怎么实现一个属性控件,属性来自于鼠标点击Qtreewidget的点击对象的属性 [复制链接]

上一主题 下一主题
离线pan869823184
 

只看楼主 倒序阅读 楼主  发表于: 2012-04-20
我解析一个XML,并把它封装到一个Mode里面,通过鼠标的点击事件,怎么用ModeIndex获取我点击的那个对象,我现在的做法是
  QTreeWidgetItem *treeCurrentItem=icdtree->currentItem(); //获取到选中的当前对象
并且写了下面几个方法的实现,可是,我不知道在什么地方写相应的信号
       QWidget *createEditor(QWidget *parent, const QStyleOptionViewItem &option,const QModelIndex &index,int type,QString strValue) const;    void setEditorData(QWidget *editor, const QModelIndex &index) const;    void setModelData(QWidget *editor, QAbstractItemModel *model,const QModelIndex &index) const;   void updateEditorGeometry(QWidget *editor,const QStyleOptionViewItem &option, const QModelIndex &index) const;
快速回复
限100 字节
 
上一个 下一个