[PyQt] hover in setStyleSheet

uahmed gleam.uahmed at gmail.com
Wed Aug 24 00:22:45 BST 2011


Hi

I am generating buttons in the form of loop now i want that i dont use
external css file and use the property "setStyleSheet" and do the "hover" .
So whenever mouse comes over the button the button color should change ,When
i try to putt"hover" in setStyleSheet it dont work , can any body tell me
how to do that



buttons[text] = QtGui.QToolButton(widget)

buttons[text].setToolButtonStyle(QtCore.Qt.ToolButtonTextUnderIcon)

buttons[text].setIcon(QtGui.QIcon('default.gif'))

buttons[text].setIconSize(QtCore.QSize(100,100))

buttons[text].setText(QtCore.QString(full_name))

buttons[text].setStyleSheet("background-color:"+button_colour+";border-radius:
10px;selection-background-color: blue;")

What should i add on this line to achieve hover

*buttons[text].setStyleSheet("background-color:"+button_colour+";border-radius:
10px;selection-background-color: blue;")*

Its a chunk of code and all variables are alive in my code .
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.riverbankcomputing.com/pipermail/pyqt/attachments/20110824/b6fa7e2d/attachment.html>


More information about the PyQt mailing list