2

I am using Python 3.8.6 and PySide 6.0.1 and get a segmentation fault running the below sample. When I comment the Text {} element the sample runs.

import sys
from PySide6.QtGui import QGuiApplication
from PySide6.QtQml import QQmlApplicationEngine

if __name__ == "__main__":
    app = QGuiApplication(sys.argv)
    engine = QQmlApplicationEngine("view.qml")
    if not engine.rootObjects():
        sys.exit(-1)
    sys.exit(app.exec_())
import QtQuick 2.0
import QtQuick.Controls 2.5

ApplicationWindow 
{
    width: 640
    height: 480
    visible: true
    title: "QML Demo"

    Text 
    {
        anchors.horizontalCenter: parent.horizontalCenter
        anchors.verticalCenter: parent.verticalCenter
        text: "Hello World"
    }
}
Olaf Japp
  • 480
  • 5
  • 19

1 Answers1

0

I can't test your code on Mac but as a suggestion you can remove all version numbers from imports in QML. This is the only difference I can see here between PyQt5 and PyQt6. (however your code works on Ubuntu 20.04)

Florian Bailly
  • 106
  • 1
  • 6