-
Bug
-
Resolution: Out of scope
-
Not Evaluated
-
None
-
4.6.2
-
None
-
Microsoft Windows 7 Ultimate (32-bit)
Qt SDK 2010.02.1
Casting from QObject * to QFutureWatcher<void> * doesn't work:
QObject *obj = qobject_cast<QObject *>(new QFutureWatcher<void>);
QFutureWatcher<void> *watcher = qobject_cast<QFutureWatcher<void> *>(obj);
Such a cast may be used for example from a slot that handles the finished() signal of the QFutureWatcher:
QFutureWatcher<void> *watcher = qobject_cast<QFutureWatcher<void> *>(sender());
When compiling, the following error is generated:
c:\Qt\2010.02.1\qt\include/QtCore/../../src/corelib/concurrent/qfuturewatcher.h: In member function 'void QFutureWatcherBase::qt_check_for_QOBJECT_macro(const T&) const [with T = QFutureWatcher<void>]':
c:\Qt\2010.02.1\qt\include/QtCore/../../src/corelib/kernel/qobject.h:453: instantiated from 'T qobject_cast(QObject*) [with T = QFutureWatcher<void>*]'
mainwindow.cpp:487: instantiated from here
c:\Qt\2010.02.1\qt\include/QtCore/../../src/corelib/concurrent/qfuturewatcher.h:61: error: void value not ignored as it ought to be
It seems that the QFutureWatcher class is missing the Q_OBJECT macro.