문제

How can I make a PyQt5 application to look like the same when run on Windows, and Linux? I would prefer the Windows style on both systems.

Thanks

도움이 되었습니까?

해결책

You can call QApplication::setStyle("windows") before creating QApplication object to set a style by name. However, Qt on Linux is usually built without modern Windows styles, so it's possible that the best you will accomplish is the classic (old) Windows style, which is not very attractive. You can also try to use "fusion" style or other values that QStyleFactory::keys() returns.

다른 팁

You can use existing styles mentioned above

or you can specify the styles of your widgets using Stylesheet, which is quite powerful.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top