Thanks Sebastian, that's just the kind of special cases I'm looking to find.

Quite surprising that it this would happen, as the remapping happens here
as it did before. I'll be taking a closer look at this as soon as I am back
from holiday (10th of Feb), until then it would be fantastic if you could
post this as an issue under the projects GitHub page in case someone else
is able to have a look at it sooner.

- https://github.com/mottosso/Qt.py/issues

Best,
Marcus

On 31 January 2017 at 12:38, Sebastian Schoellhammer <
[email protected]> wrote:

> Luckily I just found this thread :)
>
> I have a question concerning slots and signals.
> In a previous version of qt.py something like :
>
> self.pbBrowse.connect(self.browse)
>
> @QtCore.Slot()
> def browse(self):
> pass
>
> would work just fine (in both maya 2016/17).  (like described here:
> http://wiki.qt.io/Signals_and_... )
>
> Now that I got the latest version from github, this doesn't work anymore.
> I get:
> # Error: TypeError: file wgWidgets.py line 281: 
> PySide2.QtCore.QObject.connect():
> not enough arguments #
>
> Something I had used before all before Qt.py:
> self.connect(self.pbBrowse, QtCore.SIGNAL("clicked()"),
> QtCore.SLOT(self.browse))
> doesn't work because QtCore doesn't contain SIGNAL
>
> however when I try:
> self.connect(self.pbBrowse, QtCore.Signal("clicked()"),
> QtCore.Slot(self.browse))
> I get this error:
> # Error: TypeError: file D:\Tech-Art\Core\Python\Qt\wgWidgets.py line
> 280: Unknown signal argument type: instancemethod #
>
> So I guess I'm asking what's the preferable way to connect widgets with
> the new qt.py :)
> (the binding being used for this was Pyside 2 in maya 2017)
>
>
> Thanks a lot!
> seb
>
> On Wed, Jan 25, 2017 at 3:28 PM, Marcus Ottosson <[email protected]>
> wrote:
>
>> Qt.py and safety
>>
>> Hi community,
>>
>> Today we’ve made a significant leap forwards for Qt.py and implemented a
>> guarantee where if your program runs with Qt.py and any binding, such as
>> PySide2, it will run in an identical fashion on any binding.
>>
>> This means that it will throw an error if you use any feature of any
>> particular binding that isn’t available on another binding.
>>
>>
>> What’s changed?
>>
>> This is possible with the current iteration of Qt.py.
>>
>> 1: from Qt import QtGui, QtCore2: 3: class Widget(QtGui.QWidget):4:   
>> my_signal = QtCore.pyqtSignal(str)
>>
>>
>>    - On the third line, we run into an immediate problem; QWidget is
>>    only available via QtGui in PyQt4 and PySide(1).
>>    - On the 4th line, we refer to a signal as pyqtSignal which would
>>    work well on both PyQt4 and PyQt5, but fail in PySide and PySide2.
>>    - Worst yet, these problems would not make themselves known until you
>>    run it on each of the 4 bindings and make sure, first hand that it works 
>> as
>>    you’d expect.
>>
>> With this new change, Qt.py limits the available members of each
>> submodule into a subset of members that exist across all bindings. The
>> result is finding out about these problems faster and being able to
>> guarantee that if it runs on one binding, it works on all.
>>
>> 1: from Qt import QtGui2: 3: class Widget(QtGui.QWidget):4:   pass5:
>> Traceback (most recent call last):
>>   File "<stdin>", line 1, in <module>
>> AttributeError: 'module' object has no attribute 'QWidget'
>>
>>
>> It’s a breaking change
>>
>> As it is a breaking change, this bumps Qt.py from a 0.x.x release into a
>> 1.x.x. This means some of your already-written software with Qt.py may need
>> some tweaking. On the up-side, the software that would behave badly now,
>> are those that would have already behaved badly in any of the 4 bindings.
>> So this is your chance to smoke some of that out.
>>
>> We are confident in this change and direction, but are still in
>> discussion about whether now is the right time. One of the bindings, namely
>> PySide2, is so far behind the other bindings that it the weakest link by
>> far, and critical submodules - such as QtOpenGL - is still missing.
>>
>> These are the modules supported by Qt.py with this change.
>>
>> __all__ = [
>>     "QtGui",
>>     "QtCore",
>>     "QtWidgets",
>>     "QtNetwork",
>>     "QtXml",
>>     "QtHelp",
>>     "QtCompat"
>> ]
>>
>> The second concern regards which version of this weakest link to match.
>> As PySide2 matures, more feature will be added and Qt.py could start to
>> grow. But Maya 2017 and others are currently fixed at version 2.0.0.
>> Growing Qt.py beyond what Maya 2017 is capable of would limit its
>> usefulness.
>>
>> For this I figure it wouldn’t be too cumbersome to implement
>> compatibility profiles; where the end-user specifies which version of, say,
>> the VFX Platform to provide support for.
>>
>> $ # For example
>> $ export QT_BASELINE=CY2018
>> $ python -c "from Qt import QtOpenGL"
>>
>>
>> Bridging the bindings
>>
>> For the time being, and where you need functionality exclusive to any
>> particular binding, such as sip in PyQt, there is still the __binding__
>> member that allows conditional inclusion.
>>
>> if "PySide" in __binding__:
>>   do_pyside_stuff()
>>
>> This would allow you to explicitly mark the parts of your codebase that
>> depend on any particular binding, and to enable a bridge to your code today
>> and your code sometime in the future when the required functionality is
>> officially part of Qt.py.
>>
>>
>> Guinea pigs unite!
>>
>> For now, we’d appreciate your feedback on this major change and for you
>> to test it out for yourself. The release is still considered “alpha” and is
>> available directly via GitHub for download or install.
>>
>> $ pip install git+git://github.com/mottosso/Qt.py
>>
>>
>>    - Source <https://github.com/mottosso/Qt.py/blob/master/Qt.py>
>>    - Pull request <https://github.com/mottosso/Qt.py/pull/173>
>>    - Issue <https://github.com/mottosso/Qt.py/issues/152>
>>
>> Thanks to Matthew Levine for the initial feature request
>> <https://github.com/mottosso/Qt.py/issues/152> and Fredrik Averpil for
>> the unwavering support. :)
>>
>> Best,
>> Marcus
>> ​
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "Python Programming for Autodesk Maya" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to [email protected].
>> To view this discussion on the web visit https://groups.google.com/d/ms
>> gid/python_inside_maya/CAFRtmODFjo%2BzMcM0OzmnDxJ2BeTNZ%2BjN
>> HPQVKtJoEv-w7PT%3D%2BQ%40mail.gmail.com
>> <https://groups.google.com/d/msgid/python_inside_maya/CAFRtmODFjo%2BzMcM0OzmnDxJ2BeTNZ%2BjNHPQVKtJoEv-w7PT%3D%2BQ%40mail.gmail.com?utm_medium=email&utm_source=footer>
>> .
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>
>
> --
> Sebastian Schoellhammer
>
> www.sebscorner.org
>
> --
> You received this message because you are subscribed to the Google Groups
> "Python Programming for Autodesk Maya" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> To view this discussion on the web visit https://groups.google.com/d/
> msgid/python_inside_maya/CAMLepcbyCV4wdGkKVMW62dy4%
> 3DdUJkX%2BfnvR3ToeTGAmDW2NzvQ%40mail.gmail.com
> <https://groups.google.com/d/msgid/python_inside_maya/CAMLepcbyCV4wdGkKVMW62dy4%3DdUJkX%2BfnvR3ToeTGAmDW2NzvQ%40mail.gmail.com?utm_medium=email&utm_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>



-- 
*Marcus Ottosson*
[email protected]

-- 
You received this message because you are subscribed to the Google Groups 
"Python Programming for Autodesk Maya" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/python_inside_maya/CAFRtmOCwacF%2BXaN%3Dtpj5%2BfPHMMr6GE2%2BLBMjUQqSUoU39dsMHQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to