How to choose the graphic toolkit for PyQt

2019-05-08 07:10发布

问题:

I'm developing an PyQt application for my clients. The problem is that my default graphical is Gnome and my client KDE. So there is some difference I can not contrôle.

How can I force the pyQt to choose the good graphical system (Gnome) instead of the default system (KDE)?

回答1:

Use QApplication::setStyle ( QStyle * style ) with one of these values as parameter:

  • plastique
  • cde
  • motif
  • sgi
  • windows
  • cleanlooks
  • mac


回答2:

app.setStyle(QStyleFactory.create("plastique")

is the way to go



回答3:

app.setStyle(QStyleFactory.create("plastique") is the way to go

Not really - the brackets don't match!