Pyblish is built on a heavy dose of QML.
A 4-part series on it was just made available through ICS and I thought I’d spread the love.
Best Practices in Qt Quick/QML
- Part 1 - Building blocks of QML
- Part 2 - Creating New Items
- Part 3 - Reuse and QML modules
- Part 4 - Dynamic Item Creation
It requires sign-up, but I think it’s worthwhile.
Getting Started
Here’s something to get you started with the PyQt5 distribution shipping with Pyblish on Windows.
(1). Save these two files.
main.qml
import QtQuick 2.4
Rectangle {
width: 800
height: 600
color: "steelblue"
}
main.py
import os
import sys
from PyQt5 import QtQuick, QtCore, QtGui
# Initiate run-time
app = QtGui.QGuiApplication(sys.argv)
# Locate main.qml
source = os.path.dirname(__file__)
source = QtCore.QUrl.fromLocalFile(os.path.join(source, "main.qml"))
# Load main.qml
window = QtQuick.QQuickView()
window.setSource(source)
window.show()
# Start
app.exec_()
(2). Run main.py
using pyblish_win\bin\python.bat
(3). You will be greeted by a blue QML dialog
More
Also don’t forget the excellent QML Book for more tutorials.
Along with a very basic YouTube series by Joseph Mills.
Enjoy!