Qt+VC开发的界面默认是XP风格的,怎样取消XP
答案:1 悬赏:60 手机版
解决时间 2021-11-10 14:01
- 提问者网友:抽煙菂渘情少年
- 2021-11-10 00:47
Qt+VC开发的界面默认是XP风格的,怎样取消XP
最佳答案
- 五星知识达人网友:野味小生
- 2021-11-10 02:12
Qt+VC开发的界面默认是XP风格的,怎样取消XP风格?
如题
------解决方案--------------------
class QStyle
The QStyle class is an abstract base class that encapsulates the look and feel of a GUI.
Qt contains a set of QStyle subclasses that emulate the styles of the different platforms supported by Qt (QWindowsStyle, QMacStyle, QMotifStyle, etc.). By default, these styles are built into the QtGui library. Styles can also be made available as plugins.
Qt's built-in widgets use QStyle to perform nearly all of their drawing, ensuring that they look exactly like the equivalent native widgets. The diagram below shows a QComboBox in eight different styles.
------解决方案--------------------
xp系统当然是xp风格。
windows7下就是这几个风格可用:
("Windows", "WindowsXP", "WindowsVista", "Motif", "CDE", "Plastique", "Cleanlooks")
一般的main.cpp如下:
int main(int argc, char *argv[])
{
QApplication a(argc, argv);
MainWindow w;
w.show();
return a.exec();
}
增加两行:
int main(int argc, char *argv[])
{
QApplication a(argc, argv);
MainWindow w;
qDebug() << QStyleFactory::keys();//输出可用风格,帖子第三行的内容
a.setStyle(QStyleFactory::create("Windows"));// 修改默认风格。
w.show();
return a.exec();
}
------解决方案--------------------
lz说的意思是Qt的风格么?如果是Qt的风格的话,可以在main.cpp文件,添加:
C/C++ code#include //这里的风格可以自己选择
如题
------解决方案--------------------
class QStyle
The QStyle class is an abstract base class that encapsulates the look and feel of a GUI.
Qt contains a set of QStyle subclasses that emulate the styles of the different platforms supported by Qt (QWindowsStyle, QMacStyle, QMotifStyle, etc.). By default, these styles are built into the QtGui library. Styles can also be made available as plugins.
Qt's built-in widgets use QStyle to perform nearly all of their drawing, ensuring that they look exactly like the equivalent native widgets. The diagram below shows a QComboBox in eight different styles.
------解决方案--------------------
xp系统当然是xp风格。
windows7下就是这几个风格可用:
("Windows", "WindowsXP", "WindowsVista", "Motif", "CDE", "Plastique", "Cleanlooks")
一般的main.cpp如下:
int main(int argc, char *argv[])
{
QApplication a(argc, argv);
MainWindow w;
w.show();
return a.exec();
}
增加两行:
int main(int argc, char *argv[])
{
QApplication a(argc, argv);
MainWindow w;
qDebug() << QStyleFactory::keys();//输出可用风格,帖子第三行的内容
a.setStyle(QStyleFactory::create("Windows"));// 修改默认风格。
w.show();
return a.exec();
}
------解决方案--------------------
lz说的意思是Qt的风格么?如果是Qt的风格的话,可以在main.cpp文件,添加:
C/C++ code#include
我要举报
如以上回答内容为低俗、色情、不良、暴力、侵权、涉及违法等信息,可以点下面链接进行举报!
点此我要举报以上问答信息
大家都在看
推荐资讯