代码如下
int main(int argc, char *argv[])
{
QApplication a(argc, argv);
//QSurfaceFormat::setDefaultFormat(QVTKOpenGLStereoWidget::defaultFormat());
QPalette darkpalette;
a.setStyle(QStyleFactory::create("Fusion"));
darkpalette.setColor(QPalette::Window, QColor(53, 53, 53));
darkpalette.setColor(QPalette::WindowText, QColor(255, 255, 255));
darkpalette.setColor(QPalette::Base, QColor(15, 15, 15));
darkpalette.setColor(QPalette::AlternateBase, QColor(53, 53, 53));
darkpalette.setColor(QPalette::ToolTipBase, QColor(255, 255, 255));
darkpalette.setColor(QPalette::ToolTipText, QColor(255, 255, 255));
darkpalette.setColor(QPalette::Text, QColor(255, 255, 255));
darkpalette.setColor(QPalette::Button, QColor(53, 53, 53));
darkpalette.setColor(QPalette::ButtonText, QColor(255, 255, 255));
darkpalette.setColor(QPalette::BrightText, QColor(255, 0, 0));
darkpalette.setColor(QPalette::Highlight, QColor(142, 45, 197).lighter());
darkpalette.setColor(QPalette::HighlightedText, QColor(0, 0, 0));
a.setPalette(darkpalette);
//vtkObject::GlobalWarningDisplayOff();
CMainWidget w;
w.showMaximized();
return a.exec();
}
显示界面效果如下
???????
?
|