我继承了一个类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();
};