我继承了一个MainTree
类QTreeview
maintree.cpp 文件
void MainTree::LaunchTree()
{
//Tree launching
connect(this, SIGNAL(customContextMenuRequested(const QPoint& )),this,SLOT(showCustomContextMenu(const QPoint&)));
}
void MainTree::showCustomContextMenu(const QPoint &pos)
{
//Add actions
}
但我收到以下错误
QObject::connect: No such slot QTreeView::showCustomContextMenu(const QPoint&)
我不明白为什么,我错过了什么?
类的定义MainTree
class MainTree : public QTreeView
{
public:
MainTree();
MainTree(QWidget *parent = 0);
public slots:
private slots:
void showCustomContextMenu(const QPoint& pos);
private:
void launchTree();
};