How to Change the Background Color of QWidget/zh: Difference between revisions
Jump to navigation
Jump to search
No edit summary |
(Restore last good revision (2015-01-14)) |
||
(3 intermediate revisions by 3 users not shown) | |||
Line 15: | Line 15: | ||
以上改变窗体颜色的方法使用Qt <span class="caps">SDK</span> 1.1构建,并在Symbian^3 设备上测试成功。 | 以上改变窗体颜色的方法使用Qt <span class="caps">SDK</span> 1.1构建,并在Symbian^3 设备上测试成功。 | ||
[[Category:HowTo]] | |||
[[Category:Snippets]] | |||
Latest revision as of 10:37, 24 August 2015
怎样改变QWidget的背景颜色
QWidget [doc.qt.nokia.com] 是所有用户界面对象的基类,其改变背景颜色的方法同样也适用于它们。
使用调色板
第一个例子演示如何使用“QPalette“改变背景颜色:http://doc.qt.nokia.com/latest/qpalette.html
使用样式表
样式表包含对定制窗体样式的文字描述,参见“Qt Style Sheets document”:http://doc.qt.nokia.com/latest/stylesheet.html.
以上改变窗体颜色的方法使用Qt SDK 1.1构建,并在Symbian^3 设备上测试成功。