pyqt - How to change style in Qt5qt -


i writing qt5 application using pyqt. understand how change style of entire application.

the old qt4 calls like

app = qapplication(sys.argv) app.setstyle(qstylefactory.create('cleanlooks')) 

as suggested here nothing.

are deprecated? https://blog.qt.io/blog/2012/10/30/cleaning-up-styles-in-qt5-and-adding-fusion/

thank you!

may cleanlooks no longer available on system. qstylefactory.keys() can ask available styles on system. on ubuntu 16.04 , pyqt5 get:

['windows', 'gtk+', 'fusion'] 

edit:

here find qstyleplugin

containing 6 additional styles, have compile yourself

  1. edit:

on ubuntu 16.04, python3.5 got working installing styleplugins qt5 , compile pyqt5 source against qt5:

install qt 5.7 onlineinstaller

in installationdirectory search qmake, in case /opt/qt/5.7/gcc_64/bin/qmake

download qtstyleplugin arbitrary directory git clone https://code.qt.io/qt/qtstyleplugins.git , install it:

cd qtstyleplugins /opt/qt/5.7/gcc_64/bin/qmake # qmake fresh installation make make install 

now there folder „styles“ in /opt/qt/5.7/gcc_64/plugins/ containing additional styles.

download sip-source, compile , install it

download pyqt5-source, compile , install it, in step python3 configure.py provide qmake qt5-installation --qmake-option , in output missing dependencies.

now following styles available:

['bb10dark', 'bb10bright', 'cleanlooks', 'cde', 'motif', 'plastique', 'windows', 'fusion'] 

i got sip-error:

runtimeerror: sip module implements api v11.0 v11.2 pyqt5.qtcore module requires api v11.3 

to prevent it, run sudo apt-get purge python3-sip before installing sip as described here


Comments

Popular posts from this blog

amazon web services - S3 Pre-signed POST validate file type? -

c# - Check Keyboard Input Winforms -