我试图检测用户何时双击 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* 吗?