Hi ,
I am trying with the example given in Wiki Moving Widget.. i am getting an error as
Error: No match for call to '(QPoint)()'
Hi ,
I am trying with the example given in Wiki Moving Widget.. i am getting an error as
Error: No match for call to '(QPoint)()'
Please find the code below
Qt Code:
{ if(event->button() == Qt::LeftButton) { //QMouseEvent *e=static_cast<QMouseEvent *>(event); startPos = event->pos(); if(isWindow()) { p = event->globalPos() - startPos(); msgBox.setText("is window"); msgBox.exec(); } else { p = event->pos(); msgBox.setText("not window"); msgBox.exec(); } } }To copy to clipboard, switch view to plain text mode
Last edited by wysota; 11th October 2011 at 07:56. Reason: missing [code] tags
It is usually helpful to tell us which line is causing grief. We can guess but it is helpful not to have to.
Where is startPos declared? What type is it? Can you call it as a function like you do in this line.. ?
Qt Code:
p = event->globalPos() - startPos();To copy to clipboard, switch view to plain text mode
"We can't solve problems by using the same kind of thinking we used when we created them." -- Einstein
If you are posting code then please use [code] [/code] tags around it - makes addressing the problem easier.
oh sorry...
Qt Code:
{ if(event->button() == Qt::LeftButton) { //QMouseEvent *e=static_cast<QMouseEvent *>(event); startPos = event->pos(); if(isWindow()) { p = event->globalPos() - startPos(); //<-Error : No match for call to '(QPoint)()' msgBox.setText("is window"); msgBox.exec(); } else { p = event->pos(); //<- Error : No match for call to '(QPoint)()' msgBox.setText("not window"); msgBox.exec(); } } }To copy to clipboard, switch view to plain text mode
Why don't you compare your code to the one from the [wiki]Moving widgets[/wiki] article? Differences are kind of obvious.
Bookmarks