- #include "mainwindow.h"
- #include <QApplication>
- #include <QTextCodec>
- #include <QStyleFactory>
- int main(int argc, char *argv[])
- {
- QApplication a(argc, argv);
- QTextCodec::setCodecForLocale(QTextCodec::codecForName("UTF-8"));
- /* 设置全局风格 */
- QApplication::setStyle(QStyleFactory::create("fusion"));
- MainWindow w;
- w.show();
- return a.exec();
- }
根据QT4文档的说明,windows下支持 "windows", "motif", "cde", "plastique" and "cleanlooks"
而QT5文档说明,windows下只支持 "windows" and "fusion"
设置方法基本一致
http://blog.csdn.net/emdfans/article/details/40504535