• 5860阅读
  • 4回复

有关于设置各个控键属性的资料吗 [复制链接]

上一主题 下一主题
离线磐石
 
只看楼主 倒序阅读 楼主  发表于: 2009-11-23
在编辑qss文件时,发现设置各个控键属性时,不知道它们有哪些属性。比如说,我要设置QLabel时,不知道它里面的font有哪些参数, 还有什么背景,字体什么的,哪位大哥,有这方面的资料,其享一下吧,谢谢。
我的邮箱:panshi5208@163.com
不怕做不到,只怕想不到
离线dbzhang800

只看该作者 1楼 发表于: 2009-11-23
Qt 自带的 manual
离线磐石
只看该作者 2楼 发表于: 2009-11-23
引用第1楼dbzhang800于2009-11-23 15:32发表的  :
Qt 自带的 manual

谢谢,我查看了QT助手中的所有manual,不过没发现有关qss的,请详细指点一下
不怕做不到,只怕想不到
离线dbzhang800

只看该作者 3楼 发表于: 2009-11-23
离线磐石
只看该作者 4楼 发表于: 2009-11-23
引用第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 */
}
不怕做不到,只怕想不到
快速回复
限100 字节
 
上一个 下一个