[prev in list] [next in list] [prev in thread] [next in thread]
List: pykde
Subject: [PyQt] hover in setStyleSheet
From: uahmed <gleam.uahmed () gmail ! com>
Date: 2011-08-23 23:22:45
Message-ID: CAEUvQQyAcRorQKyrVBnE8fJoX+diCXawog5Eu4vfwqy4CYVtJw () mail ! gmail ! com
[Download RAW message or body]
[Attachment #2 (multipart/alternative)]
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 .
[Attachment #5 (text/html)]
Hi <br><br>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 <br> <br><br><br>buttons[text] = \
QtGui.QToolButton(widget)<br> \
buttons[text].setToolButtonStyle(QtCore.Qt.ToolButtonTextUnderIcon)<br> \
buttons[text].setIcon(QtGui.QIcon('default.gif'))<br> \
buttons[text].setIconSize(QtCore.QSize(100,100))<br> \
buttons[text].setText(QtCore.QString(full_name))<br> \
buttons[text].setStyleSheet("background-color:"+button_colour+";border-radius: \
10px;selection-background-color: blue;")<br> <br>What should i add on this line \
to achieve hover <br><br><b>buttons[text].setStyleSheet("background-color:"+button_colour+";border-radius:
10px;selection-background-color: blue;")</b><br><br>Its a chunk of code and \
all variables are alive in my code .<br>
_______________________________________________
PyQt mailing list PyQt@riverbankcomputing.com
http://www.riverbankcomputing.com/mailman/listinfo/pyqt
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic