Native KDE look for Qt 5 app

自闭症网瘾萝莉.ら 提交于 2019-12-04 22:30:37

Oxygen is part of KDE, so that's where you find it. It's not a stand-alone theme. You cannot build KDE against Qt 5, it's not supported. The next major version of KDE (KDE 5) will be using Qt 5.

So right now, there's absolutely nothing you can do. If you want your application to look and behave nice in KDE 4, use Qt 4.

It's not your app -- it's just that Oxygen is compiled against Qt 4 and not Qt 5, so Qt 5 can't use it and falls back to the default style ("fusion"). Remember that styles are actually plugins -- i.e. code, subject to API/ABI requirements in order to be loaded and used. You need an Oxygen style compiled against Qt 5.

try

QApplication::setStyle(QStyleFactory::create("GTK+"));

as workaround, it looks native, if oxygen-gtk is installed.

Start your Qt5 application with parameter:

-style=gtk

There is no global setting that i know of, that makes this for all QT5 apps.

Good luck!

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!