PDA

View Full Version : Double clicking with QTableView



DPinLV
13th September 2006, 04:33
I'm trying to get the doubleClicked signal connected to my slot, but I receive an error.
The following code produces an error:

QObject::connect(m_ui.m_myTable,
SIGNAL(doubleClicked ( const QModelIndex & index )),
this,
SLOT(myDoubleClick ( const QModelIndex & index )),
Qt::QueuedConnection);

where 'm_ui.m_myTable' is of type, QTableView*.

Here is the error message:
QMetaObject::connectSlotsByName(): No matching signal for on_clearLogButton_clicked()
Object::connect: No such signal QTableView::doubleClicked(QModelIndex&index)
Object::connect: (sender name: 'm_holdemAllTable')
Object::connect: (receiver name: 'QTPokerClientClass')

Does anyone know how to avoid this error?

I got some iunput from the following thread, but I don't know how the thread ended.
http://www.qtcentre.org/forum/f-qt-programming-2/t-qtableview-change-color-of-current-cell-1037.html

Thanks,
DP

jpn
13th September 2006, 06:04
You may not put parameter names into the connect statement, it should be:


QObject::connect(m_ui.m_myTable,
SIGNAL(doubleClicked ( const QModelIndex & )),
this,
SLOT(myDoubleClick ( const QModelIndex & )),
Qt::QueuedConnection);

DPinLV
13th September 2006, 06:22
Duh, yes I forgot about that... thanks it works now.
:o