Qt GUI theme looks old-fashioned

后端 未结 4 1662
有刺的猬
有刺的猬 2021-02-12 18:54

When I cross-compile Qt 5.8.0 from source myself and use it to build the Qt \"Dynamic Layouts\" example from Qt Widgets for Microsoft Windows, it looks old-fashioned, as if it w

4条回答
  •  [愿得一人]
    2021-02-12 19:32

    I had this same issue when upgrading from a static Qt 5.6.3 to static 5.12.0. I solved it after I tried to manually set the "windowsvista" style with QApplication::setStyle() and noticed that it returned null when debugging. It turns out in 5.12.0 the windowsvista style is its own separate plugin and you need to link against plugins/styles/qwindowsvistastyle.lib and add Q_IMPORT_PLUGIN(QWindowsVistaStylePlugin) to the cpp file containing your main function. After that there is no need to manually set the style, it is chosen automatically.

提交回复
热议问题