开发者

Using on_<widget>_<signal> where widget it own class

Is there a way to use the naming convention described in the title to connect a signal from your own class.

E.g:

class MyTree : public QTreeWidget
{
    Q_OBJECT

private slots:
    void on_this_itemClicked(QTreeWidgetItem* item, int column);
};

i understand i could use connect 开发者_开发技巧like this...

connect(this, SIGNAL(itemClicked(QTreeWidgetItem*, int)), this, SLOT(myItemClicked(QTreeWidgetItem*, int)));

...but i was just curious as to if it works.


I am quite sure Qt auto connection use the objectName (QObject::setObjectName()), so there is no chance it can resolve this.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜