PDA

View Full Version : problem with event filter compile for S60



jimiq
24th June 2010, 16:07
Hi there,

Please can you help me with a little compile issue in my event filter.



bool MainWindow::eventFilter(QObject *obj, QEvent *event)
{
if (obj == ui->timeLabel) {
if (event->type() == QEvent::MouseButtonPress) {
QMouseEvent *mouseEvent = static_cast<QMouseEvent*>(event);
timeMousePressEvent(mouseEvent);
return true;
}
}
return QMainWindow::eventFilter(obj, event);
}


This code is being compiled for the Qt simulator under creator 2 and using Qt 4.6.3. I am sure this code works on my desktop apps, so is there something different about using this with S60 development, because I get the following compile error:

'static_cast' : cannot convert from 'QEvent *' to 'QMouseEvent *'

Can anyone help?

Many thanks
jimiq

Xandareva
6th July 2010, 19:48
I have had this problem too, but I am trying convert to QKeyEvent.
Can help?