QApplication::setStyle(QStyleFactory::create("plastique"));
QStyle * QStyleFactory::create ( const QString & key ) [static]
使用QApplication::setStyle可以改變應(yīng)用程序的外觀, QStyleFactory中提供了幾種經(jīng)典的外觀.
The valid keys can be retrieved using the keys() function. Typically they include "windows", "motif", "cde", "plastique" and "cleanlooks". Depending on the platform, "windowsxp", "windowsvista" and "macintosh" may be available. Note that keys are case insensitive.
另外還可以創(chuàng)建自己的外觀風(fēng)格, 這個(gè)是相當(dāng)?shù)膹?fù)雜, 然后使用如 QApplication::setStyle(new NorwegianWoodStyle) 來(lái)進(jìn)行加載使用外觀. Demo中的widgets/styles例子創(chuàng)建了一個(gè)新的NorwegianWoodStyle外觀.