Skip to content

Instantly share code, notes, and snippets.

@Siecje
Last active January 26, 2017 17:15
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Siecje/7948458a7e46f7e7033b7efe07ee7351 to your computer and use it in GitHub Desktop.
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`
#!/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_())
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