PDA

View Full Version : Question: Moving Widgets (wiki Tutorial)



ericV
11th September 2009, 13:31
Hi!
I am trying to work with a tutorial from the wiki, its called Moving Widgets:

http://wiki.qtcentre.org/index.php?title=Moving_widgets

My Problem is that i keep getting the following errors:

error: no match for call to `(QPoint) (const QPoint)'
error: no match for call to `(QPoint) (QPoint)'

in this code:

void LED::mouseMoveEvent(QMouseEvent *me)
{
me->accept(); // do not propagate
if (isWindow())
move(me->globalPos() - move); //<- error: no match for call to `(QPoint) (const QPoint)'
else
move(mapToParent(me->pos() - move)); //<- error: no match for call to `(QPoint) (QPoint)'
}

LED is a subclass from QLable
and move has been declared as QPoint

It is basically the same as the tutorial, and i don't understand what the error is trying to tell me.

yogeshgokul
11th September 2009, 13:58
move(me->globalPos() - move);
Why you are passing move itself as argument. :confused::confused::confused:

ericV
11th September 2009, 14:05
"move" is also a variable of Type QPoint declared in the class header...
Its probably a poor choice of name, will test with an other name....

ericV
11th September 2009, 14:07
OOps... That was the error!

I should try to improve my creativity when giving variables names!


Thanks.