Skip to content

Releases: mottosso/Qt.py

1.2.5

19 Mar 06:23
7df798b

Choose a tag to compare

New environment variable QT_PREFERRED_BINDING_JSON added by @MHendricks to dynamically pick binding based on parent package.

Usage Author

  1. As a library author, self-host Qt by storing it along with your package, e.g. mypackage.vendor.Qt
  2. Inform the user that most but not all bindings are supported such as PySide and PyQt4 only (e.g. in your README)
  3. Pray they see it

Usage User

  1. As a user, read a library's README
  2. If you see mention of which bindings are supported
  3. Add those bindings to your QT_PREFERRED_BINDING_JSON environment variable.

Python

import os
import json

os.environ["QT_PREFERRED_BINDING_JSON"] = json.dumps({
  "pyblish.vendor.Qt": ["PyQt5", "PySide"],
  "studiotool.vendor.Qt": ["PyQt4", "PyQt5"]
})

Cmd

set QT_PREFERRED_BINDING_JSON={"pyblish.vendor.Qt": ["PyQt5", "PySide"], "studiotool.vendor.Qt": ["PyQt4", "PyQt5"]}

Powershell

$env:QT_PREFERRED_BINDING_JSON='{"pyblish.vendor.Qt": ["PyQt5", "PySide"], "studiotool.vendor.Qt": ["PyQt4", "PyQt5"]}'

Bash

export QT_PREFERRED_BINDING_JSON={"pyblish.vendor.Qt": ["PyQt5", "PySide"], "studiotool.vendor.Qt": ["PyQt4", "PyQt5"]}

Now whenever Pyblish from .vendor import Qt, it'll try and use PyQt5 whereas Studio Tool would try PyQt4. This can help narrow the supported bindings of your library to some but not all of the 4 supported bindings, if your library doesn't support e.g. PySide2. Ideally of course, as a library author, you shouldn't need this and should always strive for support by all bindings where possible.

See #335 for details.

1.2.4

10 Feb 12:32
4bcc646

Choose a tag to compare

Extended support for sip and PyQt 5.11+

  • See #334 for details.

Thanks @maxnbk for this fix.

1.2.3

12 Dec 07:20
62dc86b

Choose a tag to compare

New mechanism for warning about members that are missing and supposed to be missing, currently only QtGui.QMatrix.

If you discover or know about a member that isn't in Qt.py and shouldn't be, you can add a it to _missing_members.

_missing_members = {
    "QtGui": {
        "QMatrix": "Deprecated in PyQt5",
        "YOUR MEMBER": "Message to display whenever anyone tries to access it"
    },
}

1.2.2

16 Nov 09:40
e4f13d0

Choose a tag to compare

  • Added QtCompat.QStyleOptionViewItemV4
>>> from Qt import QtCompat
>>> QtCompat.QStyleOptionViewItemV4
<class 'PyQt5.QtWidgets.QStyleOptionViewItem'>

See #329 for details.

1.2.1

24 Jun 18:16
5b3b7e5

Choose a tag to compare

Cosmetic change only.

Support for Rez's version resolution algorithm, which puts pre-releases ahead of stable releases.

1.2.0

03 Jun 12:44
b322b1e

Choose a tag to compare

Added:

  • QtCompat.dataChanged
  • QtCompat.isValid

Merged:

1.2.0.b3

04 Jan 08:31
1f7e1ca

Choose a tag to compare

1.2.0.b3 Pre-release
Pre-release

Workaround to pyside-77 bug.

See #306 for details. Thanks to @aoblet for this fix!

1.2.0.b2

24 Apr 00:28
2c4a0e0

Choose a tag to compare

1.2.0.b2 Pre-release
Pre-release

Internal changes to facilitate the QtPyConvert project, should not affect the end-user.

1.1.0

25 Jan 10:48
8a3be69

Choose a tag to compare

Improved detection of common members

The ability to automatically generate the common members, used by Qt.py, makes it much easier to spot new additions to e.g. PySide2. Run build_membership.sh to generate a JSON file per binding, which are then compared. The result is written to a common_members.json and can be copy-pasted into Qt.py. This comparison leverages the tests suite and uses the binding versions used in the latest test suite.

Once the binding versions used by the tests suite gets updated (usually annually during a VFX Platform update), we will check for new members, using this new approach.

See DOCKER.md for more info.


New members

QtCore.QItemSelectionRange  # thanks to @Ahuge 
QtCore.QT_TRANSLATE_NOOP
QtCore.QT_TR_NOOP
QtCore.QT_TR_NOOP_UTF8

QtGui.DesktopServices
QtGui.QTouchEvent
QtGui.qRgba

QtMultimedia.QAbstractVideoBuffer
QtMultimedia.QAbstractVideoSurface
QtMultimedia.QAudio
QtMultimedia.QAudioDeviceInfo
QtMultimedia.QAudioFormat
QtMultimedia.QAudioInput
QtMultimedia.QAudioOutput
QtMultimedia.QVideoFrame
QtMultimedia.QVideoSurfaceFormat

QtPrintSupport.QAbstractPrintDialog
QtPrintSupport.QPageSetupDialog
QtPrintSupport.QPrintDialog
QtPrintSupport.QPrintEngine
QtPrintSupport.QPrintPreviewDialog
QtPrintSupport.QPrintPreviewWidget
QtPrintSupport.QPrinter
QtPrintSupport.QPrinterInfo

QtSql.QSql
QtSql.QSqlDatabase
QtSql.QSqlDriver
QtSql.QSqlDriverCreatorBase
QtSql.QSqlError
QtSql.QSqlField
QtSql.QSqlIndex
QtSql.QSqlQuery
QtSql.QSqlQueryModel
QtSql.QSqlRecord
QtSql.QSqlRelation
QtSql.QSqlRelationalDelegate
QtSql.QSqlRelationalTableModel
QtSql.QSqlResult
QtSql.QSqlTableModelQtSql

QtSvg.QGraphicsSvgItem
QtSvg.QSvgGenerator
QtSvg.QSvgRenderer
QtSvg.QSvgWidget

QTest.QTest

QtX11Extras.QX11Info  # thanks to @assumptionsoup

QtXmlPatterns.QAbstractMessageHandler
QtXmlPatterns.QAbstractUriResolver
QtXmlPatterns.QAbstractXmlNodeModel
QtXmlPatterns.QAbstractXmlReceiver
QtXmlPatterns.QSourceLocation
QtXmlPatterns.QXmlFormatter
QtXmlPatterns.QXmlItem
QtXmlPatterns.QXmlName
QtXmlPatterns.QXmlNamePool
QtXmlPatterns.QXmlNodeModelIndex
QtXmlPatterns.QXmlQuery
QtXmlPatterns.QXmlResultItems
QtXmlPatterns.QXmlSchema
QtXmlPatterns.QXmlSchemaValidator
QtXmlPatterns.QXmlSerializer"

Removed QtCore.QMetaType member

The QtCore.QMetaType member was removed as it was wrongly added to Qt.py.


New tests suite

A new tests suite was added. Qt and its bindings are compiled from source using the CY2018 VFX Platform standards. This adds better support for testing with Python 3.x and removes the dependency of the Ubuntu PPAs previously used to install the Qt bindings.

cd Qt.py

# Run nosetests (Linux/OSX)
docker run --rm -v $(pwd):/Qt.py -e PYTHON=2.7 fredrikaverpil/qt.py:2018
docker run --rm -v $(pwd):/Qt.py -e PYTHON=3.4 fredrikaverpil/qt.py:2018
docker run --rm -v $(pwd):/Qt.py -e PYTHON=3.5 fredrikaverpil/qt.py:2018
docker run --rm -v $(pwd):/Qt.py -e PYTHON=3.6 fredrikaverpil/qt.py:2018

# Run nosetests (Windows)
docker run --rm -v %CD%:/Qt.py -e PYTHON=2.7 fredrikaverpil/qt.py:2018
docker run --rm -v %CD%:/Qt.py -e PYTHON=3.4 fredrikaverpil/qt.py:2018
docker run --rm -v %CD%:/Qt.py -e PYTHON=3.5 fredrikaverpil/qt.py:2018
docker run --rm -v %CD%:/Qt.py -e PYTHON=3.6 fredrikaverpil/qt.py:2018

The test suite will be updated anually, around the time of SIGGRAPH and when the VFX Platform usually gets updated.

For more information on running the tests, see README.md and DOCKER.md.


Support for Python 2.6

Qt.py now works with Python 2.6, thanks to contributions made by @Ahuge (see #245). However, keep in mind that the automatic tests don't apply to Python 2.6.


Upgraded QtCompat

An additional layer was added to QtCompat to facilitate more members.

Before

from Qt import QtCompat
QtCompat.setSectionResizeMode

After

from Qt import QtCompat
QtCompat.QHeaderView.setSectionResizeMode

Backwards compatibility is maintained, at least till the next major version release.


Pre-release installation

Install

To install a pre-release, prepend --pre to your pip install.

$ pip install --pre -U Qt.py

To upgrade an existing install, prepend -U as well.

$ pip install --pre Qt.py

QtSiteConfig

Version 1.1.0.b3 added support for overriding available members of Qt.py on import, to either add custom members and modules, or remove them.


Added wrapInstance and getCppPointer

The shiboken of PySide and sip of PyQt have found a home in QtCompat.

from Qt import QtCompat
QtCompat.wrapInstance(...)

They work similar as you would expect. See the release notes for 1.1.0.b1 for details and examples.

1.1.0.b10

15 Jan 11:47
71991d3

Choose a tag to compare

1.1.0.b10 Pre-release
Pre-release

Adds support for from Qt.QtCompat import X.

See #265 for details.