首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 移动开发 > 移动开发 >

QT Creator 怎么建槽

2012-09-19 
QT Creator 如何建槽本想继承一个槽,但是发现编译不过,只好新建一个槽,有些东西要设置,不过很简单定义一个

QT Creator 如何建槽

本想继承一个槽,但是发现编译不过,只好新建一个槽,有些东西要设置,不过很简单

定义一个槽

Q_OBJECT//一定要加上public:    SelfDifineTree();    virtual ~SelfDifineTree();//Q_SIGNALS://    void expanded(const QModelIndex &index);public Q_SLOTS:    void itemclicked(const QModelIndex &index);
?

链接槽

?

SelfDifineTree::SelfDifineTree()    : QTreeView(){    qDebug()<<"create this file";;    QObject::connect(this,SIGNAL(clicked(QModelIndex)),this,SLOT(itemclicked(QModelIndex)));}void SelfDifineTree::itemclicked(const QModelIndex &index){    qDebug()<<"expanded~~";;    //this->QTreeView::expanded(&index);}

?设置编译器


QT Creator 怎么建槽

?

热点排行