Results 1 to 3 of 3

Thread: mouse event not working in buttons

  1. #1
    Join Date
    Aug 2011
    Posts
    1
    Qt products
    Qt4
    Platforms
    Windows

    Default mouse event not working in buttons

    mouse click worked in central widget ,but not working in buttons??




    Qt Code:
    1. void DotsDeluxe::mousePressEvent(QMouseEvent *e)
    2. {
    3. if(e->button()==Qt::LeftButton)
    4. {
    5.  
    6. QPixmap* pixmaptw = new QPixmap(":/Images/ccursor0.png");
    7. ui->centralWidget->setCursor(QCursor (*pixmaptw,0,0));
    8.  
    9.  
    10. }
    11.  
    12. }
    To copy to clipboard, switch view to plain text mode 
    Last edited by wysota; 22nd August 2011 at 10:40. Reason: missing [code] tags

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

    Default Re: mouse event not working in buttons

    Define "not working".
    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
    Jun 2011
    Location
    Finland
    Posts
    164
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows Maemo/MeeGo
    Thanks
    1
    Thanked 26 Times in 26 Posts

    Default Re: mouse event not working in buttons

    ui->centralWidget->setCursor(QCursor (*pixmaptw,0,0));
    Are you sure this belongs to what I assume is the code for your buttons?
    Are you sure it is not working?
    Don't write a post just to thank someone, use "Thanks" button.

Similar Threads

  1. tab order not working properly for radio buttons
    By netmat in forum Qt Programming
    Replies: 1
    Last Post: 1st April 2010, 15:58
  2. Mouse hovering or press event not working?
    By qtzcute in forum Newbie
    Replies: 11
    Last Post: 15th July 2009, 11:53
  3. Replies: 7
    Last Post: 20th November 2007, 13:15
  4. Problem with Parent QWidget and Buttons not working
    By VireX in forum Qt Programming
    Replies: 7
    Last Post: 11th May 2007, 23:24
  5. Sorry another problem. Mouse Buttons.
    By Zephro in forum Qt Programming
    Replies: 14
    Last Post: 24th February 2006, 17:08

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.