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.
button->setAutoFillBackground(true);
QPalette palette2
= myclassbutton
->palette
();
palette2.
setColor(QPalette::Button, Qt
::green);
palette2.
setColor(QPalette::Light, Qt
::yellow);
button->setPalette(palette2);
button->setAutoFillBackground(true);
button->setStyle(new QPlastiqueStyle);
QPalette palette2 = myclassbutton->palette();
palette2.setColor(QPalette::Button, Qt::green);
palette2.setColor(QPalette::Light, Qt::yellow);
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
Bookmarks