PDA

View Full Version : QTimer issue



qball2k5
31st March 2006, 18:08
Here's my code:



double Interval = 0;
int arrValues[256] = {0};

*timer = new QTimer(&messager);
connect(timer, SIGNAL(timeout()), &messager, SLOT(GetIt(arrValues)));

Interval = 1.0 / (double)ui.cbInterval->currentText.toInt() * 1000 ;
timer->start((int)Interval);


I keep getting to following error everytime I complie.



decksimulator.cpp:738: error: no match for 'operator=' in '*timer = (((QTimer*)operator new(24u)), (<anonymous>->QTimer::QTimer(((QObject*)(((Messager*)((DeckSimul ator*)this)) + 652u))), <anonymous>))'
/usr/local/Trolltech/Qt-4.1.1/include/QtCore/qtimer.h:75: note: candidates are: QTimer& QTimer::operator=(const QTimer&)
decksimulator.cpp:741: error: insufficient contextual information to determine type


Is there something I need to cast? Do I need to inherit something into my messager class.

HELP PLEASE!

Rob

SkripT
31st March 2006, 18:14
How have you declared the variable "timer"? I think that the sentence
*timer = new QTimer(&messager);
should be

timer = new QTimer(&messager)
if you have declared "timer" like this:
QTimer *timer;