C ++ QT4检测用户何时双击qtablewidget标头
|
我正在尝试检测用户何时双击qtablewidget中的标题。为此,我将信号\“ sectionDoubleClicked(int)\”连接到具有相同参数的函数(我从1得到它)。我的问题是,我收到以下编译时错误:
mainwindow.cpp:117: error: no matching function for call to âMainWindow::connect(QHeaderView*, const char [27], MainWindow* const, const char [24])â
/usr/lib64/qt4/include/QtCore/qobject.h:181: note: candidates are: static bool QObject::connect(const QObject*, const char*, const QObject*, const char*, Qt::ConnectionType)
/usr/lib64/qt4/include/QtCore/qobject.h:282: note: bool QObject::connect(const QObject*, const char*, const char*, Qt::ConnectionType) const
这是我的代码:
QObject::connect(ui->table_results->horizontalHeader(),SIGNAL(sectionDoubleClicked(int)),
this,SIGNAL(headerclickedscan(int)));
我只需要将horizontalHeader()的结果强制转换为QObject *?
没有找到相关结果
已邀请:
1 个回复
眠缝
或未在MainWindow类中将\“ headerclickedscan(int)\”声明为信号。 另外,您确定要\“ headerclickedscan(int)\”是信号但不是插槽吗?