Results 1 to 4 of 4

Thread: Highligh Button on mouse move.

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Oct 2010
    Posts
    13
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default Highligh Button on mouse move.

    Hi All,

    I have developed an application and succesfully ported it to my Blackfin board with touchscreen support. In the frames developed, I have some pushbuttons which I need to highlight on mouse movement over it. I have implemented both mouseMoveEvent and enterEvent functions. Now the problem is

    1) When I move across the buttons, only mouseMoveEvent function is getting executed. I dont find the enterEvent function getting called. (Is that Ok if I do the implementation in mouseMoveEvent function)?.
    2) I implemented the below code in the mouseMoveEvent function with which the highlight was not happening.

    Qt Code:
    1. button->setAutoFillBackground(true);
    2. button->setStyle(new QPlastiqueStyle);
    3. QPalette palette2 = myclassbutton->palette();
    4. palette2.setColor(QPalette::Button, Qt::green);
    5. palette2.setColor(QPalette::Light, Qt::yellow);
    6. button->setPalette(palette2);
    To copy to clipboard, switch view to plain text mode 

    I tried different combinations with the QPalette but none of them worked for me. Also please tell me how to know over which button the current mouse movement has happened as the class for which I have overriden the mouse event functions have many buttons.

    Please help me regarding this.

    Regards,
    Siva
    Last edited by wysota; 20th October 2010 at 15:03.

Similar Threads

  1. Display hint when move mouse to a button
    By baobui in forum Newbie
    Replies: 2
    Last Post: 20th October 2010, 21:14
  2. How to move the mouse ?
    By shad0w in forum Newbie
    Replies: 3
    Last Post: 2nd November 2008, 13:55
  3. Move mouse over object
    By ToddAtWSU in forum Qt Programming
    Replies: 17
    Last Post: 3rd October 2007, 15:53
  4. Mouse Move Event
    By merry in forum Newbie
    Replies: 5
    Last Post: 3rd June 2007, 06:26
  5. Move Rectangle on mouse Move
    By vermarajeev in forum Qt Programming
    Replies: 24
    Last Post: 14th May 2007, 05:34

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.