How to Change the Background Color of QWidget/zh

From Qt Wiki
< How to Change the Background Color of QWidget
Revision as of 10:37, 24 August 2015 by JKSH (talk | contribs) (Restore last good revision (2015-01-14))
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search
The printable version is no longer supported and may have rendering errors. Please update your browser bookmarks and please use the default browser print function instead.

English | Български |
日本語 | 中文

怎样改变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 设备上测试成功。