|
是QT定时器的问题,不知为什我就是老编译不了,老报错
源码:
timer = new QTimer(this);
connect(timer,SIGNAL(timeout()),this,SLOT(repaint()));
timer->start(3000);
错误代:
mywindow.cpp: In constructor ‘MyWindow::MyWindow()’:
mywindow.cpp:66: error: invalid use of incomplete type ‘struct QTimer’
/usr/include/QtGui/qwindowdefs.h:78: error: forward declaration of ‘struct QTimer’
mywindow.cpp:67: error: no matching function for call to ‘MyWindow::connect(QTimer*&, const char [11], MyWindow* const, const char [11])’
/usr/include/QtCore/qobject.h:191: note: candidates are: static bool QObject::connect(const QObject*, const char*, const QObject*, const char*, Qt::ConnectionType)
/usr/include/QtCore/qobject.h:292: note: bool QObject::connect(const QObject*, const char*, const char*, Qt::ConnectionType) const
mywindow.cpp:68: error: invalid use of incomplete type ‘struct QTimer’
/usr/include/QtGui/qwindowdefs.h:78: error: forward declaration of ‘struct QTimer’ |
|