引用第3楼dbzhang800于2009-11-23 17:15发表的 :
http://qt.nokia.com/doc/4.5/stylesheet.html
恩,谢谢你的热心帮忙。这个文档对我现在要做的有较大的帮助。
我现在想对QPushButton做点效果出来,比方说,当点击时有动态效果,就像一些XP桌面中双击落图标的效果(有颜色变化,图标大小改变之类)
但我在帮助文档中只能找到如下的关于QPushButton的设置,不知道还有没有更详细的说明,关于其中各个动作效果的设置,比如说QPushButton:pressed
A QPushButton is styled as follows:
QPushButton {
border: 2px solid #8f8f91;
border-radius: 6px;
background-color: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1,
stop: 0 #f6f7fa, stop: 1 #dadbde);
min-width: 80px;
}
QPushButton:pressed {
background-color: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1,
stop: 0 #dadbde, stop: 1 #f6f7fa);
}
QPushButton:flat {
border: none; /* no border for a flat push button */
}
QPushButton:default {
border-color: navy; /* make the default button prominent */
}
For a QPushButton with a menu, use the ::menu-indicator subcontrol.
QPushButton:open { /* when the button has its menu open */
background-color: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1,
stop: 0 #dadbde, stop: 1 #f6f7fa);
}
QPushButton::menu-indicator {
image: url(menu_indicator.png);
subcontrol-origin: padding;
subcontrol-position: bottom right;
}
QPushButton::menu-indicator:pressed, QPushButton::menu-indicator:open {
position: relative;
top: 2px; left: 2px; /* shift the arrow by 2 px */
}