旧的Qt4称之为
app = QApplication(sys.argv) app.setStyle(QStyleFactory.create('Cleanlooks'))
正如建议here什么都不做.
他们被弃用了吗?
https://blog.qt.io/blog/2012/10/30/cleaning-up-styles-in-qt5-and-adding-fusion/
谢谢!
['Windows', 'GTK+', 'Fusion']
编辑:
here you find the qstyleplugin
包含6个其他样式,你必须自己编译
>编辑:
在ubuntu 16.04,python3.5我通过将样式插件安装到QT5并从源代码对这个QT5编译pyqt5来实现它:
通过onlineinstaller安装QT 5.7
在installationdirectory中搜索qmake,在我的例子中是/opt/Qt/5.7/gcc_64/bin/qmake
将qtstyleplugin下载到任意目录git clone https://code.qt.io/qt/qtstyleplugins.git并安装它:
cd qtstyleplugins /opt/Qt/5.7/gcc_64/bin/qmake # the qmake from the fresh installation make make install
现在/opt/Qt/5.7/gcc_64/plugins/中有一个包含其他样式的文件夹“styles”.
download sip-source,编译安装
download pyqt5-source,编译并安装它,在步骤python3 configure.py中通过–qmake-option从QT5-Installation提供qmake,并在输出中查找缺少的依赖项.
现在可以使用以下样式:
['bb10dark', 'bb10bright', 'cleanlooks', 'cde', 'motif', 'plastique', 'Windows', 'Fusion']
我有一个sip-error:
RuntimeError: the sip module implements API v11.0 to v11.2 but the PyQt5.QtCore module requires API v11.3
为了防止它,在安装sip as described here之前运行sudo apt-get purge python3-sip