Results 1 to 4 of 4

Thread: Question: Moving Widgets (wiki Tutorial)

  1. #1
    Join Date
    Jul 2009
    Posts
    42
    Qt products
    Qt4
    Platforms
    Windows
    Thanks
    4

    Default Question: Moving Widgets (wiki Tutorial)

    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:
    Qt Code:
    1. void LED::mouseMoveEvent(QMouseEvent *me)
    2. {
    3. me->accept(); // do not propagate
    4. if (isWindow())
    5. move(me->globalPos() - move); //<- error: no match for call to `(QPoint) (const QPoint)'
    6. else
    7. move(mapToParent(me->pos() - move)); //<- error: no match for call to `(QPoint) (QPoint)'
    8. }
    To copy to clipboard, switch view to plain text mode 

    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.
    Last edited by ericV; 11th September 2009 at 13:53.

  2. #2
    Join Date
    Dec 2007
    Posts
    628
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    MacOS X Unix/X11 Windows
    Thanks
    3
    Thanked 89 Times in 87 Posts

    Default Re: Question: Moving Widgets (wiki Tutorial)

    Qt Code:
    1. move(me->globalPos() - move);
    To copy to clipboard, switch view to plain text mode 
    Why you are passing move itself as argument.

  3. The following user says thank you to yogeshgokul for this useful post:

    ericV (11th September 2009)

  4. #3
    Join Date
    Jul 2009
    Posts
    42
    Qt products
    Qt4
    Platforms
    Windows
    Thanks
    4

    Default Re: Question: Moving Widgets (wiki Tutorial)

    "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....

  5. #4
    Join Date
    Jul 2009
    Posts
    42
    Qt products
    Qt4
    Platforms
    Windows
    Thanks
    4

    Default Re: Question: Moving Widgets (wiki Tutorial)

    OOps... That was the error!

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


    Thanks.

Similar Threads

  1. Question about tutorial no. 6
    By jacopo in forum Newbie
    Replies: 3
    Last Post: 27th August 2009, 08:05
  2. Avoid moving widgets
    By desch in forum Qt Programming
    Replies: 5
    Last Post: 9th April 2009, 06:27
  3. hello! i have a simple child widgets question
    By ht1 in forum Qt Programming
    Replies: 3
    Last Post: 17th November 2007, 23:49
  4. Designer Question About Sizing Widgets
    By pmabie in forum Qt Tools
    Replies: 1
    Last Post: 23rd September 2007, 11:05
  5. Moving widgets within a layout.
    By importantman in forum Qt Programming
    Replies: 6
    Last Post: 26th May 2007, 20:21

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
  •  
Qt is a trademark of The Qt Company.