Skip to content

Releases: mottosso/Qt.py

0.6.5

21 Nov 12:16
Compare
Choose a tag to compare

This release fixes an edgecase whereby (1) using Qt.py in conjunction with PyQt and (2) attempting to import Qt.QtCore directly causes remappings - such as pyqtSignal -> Signal - to vanish.

See #158 for details.

0.6.4

20 Nov 17:10
Compare
Choose a tag to compare

Fixed QtCompat.translate.

The argument signature is native to PySide2 and mirrors the Qt documentation as well.

# Example
import Qt

result = Qt.QtCompat.translate("CustomDialog",  # context
                               "Status",        # sourceText
                               None,            # disambiguation
                               -1)              # n

assert result == u'Status', result

0.6.3

15 Nov 21:00
Compare
Choose a tag to compare

Qt.py + LICENSE = <3

With this release, you may safely copy/paste or otherwise use the Qt.py file standalone, without the LICENSE file, and still fully comply with the (MIT) license.

Win-win!

0.6.2

31 Oct 15:30
Compare
Choose a tag to compare

No end-user changes; pure refactoring to simplify understanding and future development/contributions of the project.

0.6.1

10 Oct 07:42
Compare
Choose a tag to compare

Minor refactoring.

0.6.0

21 Sep 05:30
Compare
Choose a tag to compare

Move added functionality to QtCompat module.

# Before
import Qt
Qt.load_ui("my.ui")
Qt.__binding__ == "PyQt5"

# After
from Qt import QtCompat
QtCompat.load_ui("my.ui")
QtCompat.__binding__ == "PyQt5"

This module will contain anything that isn't remapped, but added to Qt.py. The reduces the risk of nameclashes, more explicitly points out what is unique to Qt.py while at the same time makes your code more readable via the use of the similar, but unique, module.

button = QtWidgets.QPushButton("Button")
QtCompat.load_ui(...)

Backwards compatibility is maintained

Previous members are preserved, but deprecated. You are advised to transition when you are able.

0.5.0

17 Sep 09:17
Compare
Choose a tag to compare

Alpha release of --convert for Qt Designer files.

Steps

  1. Have your .ui file ready.
  2. Compile your .ui file using the PySide2 uic module.
  3. Convert your compiled .ui file with Qt.py

Demo

$ pyside2-uic my_ui.ui -o my_ui.py
$ python -m Qt --convert my_ui.py
# Creating "my_ui_backup.py"..
# Successfully converted "my_ui.py"

Note to Maya 2017-users: You can find pyside2-uic in your Maya installation directory

Implementation

The method at which the conversion happens is early alpha and is expected to work in common cases, but may not cover all edge cases.

What we need is for you to test this, and let us know where it fails so we can repair it.

The implementation will, at this point in time:

  1. Replace occurrences of from PySide2 import with from Qt import
  2. Replace occurrences of QtWidgets.QApplication.translate with Qt.translate

And that's it.

The function is idempotent and will create a backup of your original, as my_ui_backup.py

Let us know what you think!

0.4.3

16 Sep 10:31
Compare
Choose a tag to compare

Disable run-time validation of attribute overrides, safe those for tests.

If you've experienced issues where Qt.py is telling you it tried overriding an existing attribute..

AttributeError: Cannot override existing name: PySide.QtWidgets # 
# Error: AttributeError: Cannot override existing name: PySide.QtWidgets # 

Then this one's for you.

It maintains the safety of ensuring no original attributes are overridden, while at the same time enabling further flexibility for the users.

Enjoy!

0.4.2

10 Sep 07:50
Compare
Choose a tag to compare

Added compatibility with custom distribution of PyQt5, https://github.com/pyqt/python-qt5.

0.4.1

08 Sep 19:27
Compare
Choose a tag to compare

Added support for importing widgets directly from QtWidgets with bindings for Qt 4.

from Qt.Widgets import QPushButton