ユーザーが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 *にキャストする必要がありますか?