4

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)?

Russia Must Remove Putin
  • 374,368
  • 89
  • 403
  • 331
nam
  • 3,542
  • 9
  • 46
  • 68

2 Answers2

11

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

  • plastique
  • cde
  • motif
  • sgi
  • windows
  • cleanlooks
  • mac
8
app.setStyle(QStyleFactory.create("plastique"))

is the way to go

eyllanesc
  • 235,170
  • 19
  • 170
  • 241
nam
  • 3,542
  • 9
  • 46
  • 68
  • 2
    Note that you can skip the `QStyleFactory.create` part to `app.setStyle("plastique")` –  Jan 07 '13 at 18:05
  • Thanks, but when I just the mac style, it does not show the mac widget, does the mac style work only for mac os? – nam Jan 08 '13 at 09:40
  • Haven't tested it Mac OS, but there probably are some elements that can only be displayed on certain OS... –  Jan 08 '13 at 11:34