Results 1 to 6 of 6

Thread: Error: No match for call to '(QPoint)()'

  1. #1
    Join Date
    Jul 2011
    Posts
    8
    Qt products
    Qt3 Qt4 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default 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)()'

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Error: No match for call to '(QPoint)()'

    Show us the offending code (your code).
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  3. #3
    Join Date
    Jul 2011
    Posts
    8
    Qt products
    Qt3 Qt4 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default Re: Error: No match for call to '(QPoint)()'

    Please find the code below

    Qt Code:
    1. void testtab::mousePressEvent(QMouseEvent *event)
    2. {
    3. if(event->button() == Qt::LeftButton)
    4. {
    5. //QMouseEvent *e=static_cast<QMouseEvent *>(event);
    6. startPos = event->pos();
    7. if(isWindow())
    8. {
    9. p = event->globalPos() - startPos();
    10. msgBox.setText("is window");
    11. msgBox.exec();
    12. }
    13. else
    14. {
    15. p = event->pos();
    16. msgBox.setText("not window");
    17. msgBox.exec();
    18. }
    19. }
    20. }
    To copy to clipboard, switch view to plain text mode 
    Last edited by wysota; 11th October 2011 at 07:56. Reason: missing [code] tags

  4. #4
    Join Date
    Mar 2009
    Location
    Brisbane, Australia
    Posts
    7,729
    Thanks
    13
    Thanked 1,610 Times in 1,537 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows
    Wiki edits
    17

    Default Re: Error: No match for call to '(QPoint)()'

    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:
    1. 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.

  5. #5
    Join Date
    Jul 2011
    Posts
    8
    Qt products
    Qt3 Qt4 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default Re: Error: No match for call to '(QPoint)()'

    oh sorry...

    Qt Code:
    1. void testtab::mousePressEvent(QMouseEvent *event)
    2. {
    3. if(event->button() == Qt::LeftButton)
    4. {
    5. //QMouseEvent *e=static_cast<QMouseEvent *>(event);
    6. startPos = event->pos();
    7. if(isWindow())
    8. {
    9. p = event->globalPos() - startPos(); //<-Error : No match for call to '(QPoint)()'
    10. msgBox.setText("is window");
    11. msgBox.exec();
    12. }
    13. else
    14. {
    15. p = event->pos(); //<- Error : No match for call to '(QPoint)()'
    16. msgBox.setText("not window");
    17. msgBox.exec();
    18. }
    19. }
    20. }
    To copy to clipboard, switch view to plain text mode 

  6. #6
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Error: No match for call to '(QPoint)()'

    Why don't you compare your code to the one from the [wiki]Moving widgets[/wiki] article? Differences are kind of obvious.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


Similar Threads

  1. Replies: 1
    Last Post: 1st December 2010, 11:02
  2. QPainter error: no match for call ...
    By tonnot in forum Newbie
    Replies: 2
    Last Post: 7th October 2010, 12:00
  3. Replies: 4
    Last Post: 25th September 2010, 12:58
  4. None-GUI thread call widget method cause error
    By luochen601 in forum Qt Programming
    Replies: 3
    Last Post: 28th July 2010, 05:39
  5. QProcess error to call mogrify
    By mattia in forum Newbie
    Replies: 2
    Last Post: 29th October 2007, 11:46

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.