79735046

Date: 2025-08-14 06:57:43
Score: 1
Natty:
Report link

# Construct the path to the PyQt6 plugins directory

# pyqt6_plugins_path = '/opt/python-venv/venv-3.11/lib/python3.11/site-packages/PyQt6/Qt6/plugins'

pyqt6_plugins_path = os.path.join(sys.prefix, 'lib', f'python{sys.version_info.major}.{sys.version_info.minor}', 'site-packages', 'PyQt6', 'Qt6', 'plugins')

# Set QT_PLUGIN_PATH to include both the PyQt6 plugins and the system Qt plugins

os.environ['QT_PLUGIN_PATH'] = f'{pyqt6_plugins_path}:/usr/lib/qt6/plugins'

# Set the Qt Quick Controls style for Kirigami to prevent the "Fusion" warning

os.environ["QT_QUICK_CONTROLS_STYLE"] = "org.kde.desktop"

app = QGuiApplication(sys.argv)

engine = QQmlApplicationEngine()

# Add the system QML import path

engine.addImportPath("/usr/lib/qt6/qml")

Reasons:
  • Long answer (-0.5):
  • No code block (0.5):
  • Low reputation (1):
Posted by: Sameep Chandel