Last active
January 26, 2017 17:15
-
-
Save Siecje/7948458a7e46f7e7033b7efe07ee7351 to your computer and use it in GitHub Desktop.
With PyQt5==5.7.1 importing `QtQuick.Dialogs 1.2` prevents window from opening, does not happen with `qmlscene`
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
import sys | |
from PyQt5 import Qt, QtCore, QtGui, QtQml, QtWidgets | |
QML = b""" | |
import QtQuick 2.7 | |
import QtQuick.Controls 1.4 | |
import QtQuick.Dialogs 1.2 | |
ApplicationWindow { | |
visible: true | |
width: 640 | |
height: 480 | |
Text { | |
text: "hello" | |
} | |
} | |
""" | |
app = QtWidgets.QApplication(sys.argv + ["-nograb"]) | |
engine = QtQml.QQmlApplicationEngine("Main.qml") # Does not work | |
# engine = QtQml.QQmlApplicationEngine() # Works | |
# engine.loadData(QML) # Works | |
sys.exit(app.exec_()) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import QtQuick 2.3 | |
import QtQuick.Controls 1.4 | |
import QtQuick.Dialogs 1.2 | |
ApplicationWindow { | |
visible: true | |
width: 640 | |
height: 480 | |
Text { | |
text: "hello" | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment