Results 1 to 2 of 2

Thread: QCursor::setPos

  1. #1
    Join Date
    Oct 2006
    Posts
    16
    Thanks
    1
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default QCursor::setPos

    I have re-implemented keyPressEvent for my class inherited from QDialog

    void my_dialog::keyPressEvent(QKeyEvent* e)
    {
    QCursor c = this->cursor();
    QCursor::setPos (mapToGlobal( QPoint( width()/2, height()/2 )) );

    }
    I want to move cursor to the center of widget, but nothing happens

    which is my mistake ?

  2. #2
    Join Date
    Oct 2006
    Posts
    16
    Thanks
    1
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: QCursor::setPos

    sorry ... first line in the function not used

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.