-3

I am using Windows 11 and I am using PyQt5 So I want to get all the styles in different OS So Can you guys please help me by saying the os name and styles available on your OS?

You can get the available styles by the following code:

import PyQt5.QtWidgets as QtWidgets
print(QtWidgets.QStyleFactory.keys())

but make sure you installed PyQt5 in your system using: "pip install PyQt5" command

eyllanesc
  • 235,170
  • 19
  • 170
  • 241

1 Answers1

2

You can create a workflow on github to get the styles on each OS:

name: get all styles

on: [push]

jobs:
  ci:
    name: ${{ matrix.os.name }}
    runs-on: ${{ matrix.os.runs-on }}
    strategy:
      fail-fast: false
      matrix:
        os:
          - name: Windows
            runs-on: windows-latest
          - name: Linux
            runs-on: ubuntu-latest
          - name: MacOS
            runs-on: macos-latest
    steps:
      - name: Checkout
        uses: actions/checkout@v1
      - name: Set up Python
        uses: actions/setup-python@v2
        with:
          python-version: 3.8
          architecture: x64
      - name: install pyqt5
        run: python -m pip install pyqt5
      - name: print styles
        run: python -c "from PyQt5.QtWidgets import QStyleFactory; print(QStyleFactory.keys())"

Output:

  • Windows:

    ['windowsvista', 'Windows', 'Fusion']
    
  • Linux:

    ['Windows', 'Fusion']
    
  • MacOS

    ['macintosh', 'Windows', 'Fusion']
    

You can also add additional styles as I point out in this post.

eyllanesc
  • 235,170
  • 19
  • 170
  • 241