Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Don't delete QtCore.{pyqtSignal,pyqtSlot,pyqtProperty} #76

Closed
kernc opened this issue Sep 28, 2016 · 10 comments
Closed

Don't delete QtCore.{pyqtSignal,pyqtSlot,pyqtProperty} #76

kernc opened this issue Sep 28, 2016 · 10 comments

Comments

@kernc
Copy link

kernc commented Sep 28, 2016

The README says the API is PyQt5 compatible, yet the PyQt5 identifiers such as QtCore.pyqtSignal are explicitly deleted in favor of PySide's.

PyQt5's symbols were removed in #47 with IMHO not so great justification:

I still think that the duplicate imports are very weird and not needed

@ccordoba12
Copy link
Member

pyqtSignal works only for PyQt bindings. What we tried to do in #47 is to avoid people to use those names and use instead the more generic Signal and Slot ones.

That way it's expected that your application runs seamlessly when you move from PyQt to PySide. If you use instead pyqtSignal that certainly won't be the case :-)

@Nodd
Copy link
Contributor

Nodd commented Sep 29, 2016

The README doesn't claim to be PyQt5 compatible. It uses the PyQt5 layout for modules (other abstraction modules import everything into both QtGui and QtWidgets for example).
In "Basically, you write your code as if you were using PyQt5", the important word is "basically" 😉 It's not the case for Signals and Slot.

On the other hand we agree that the documentation is lacking, see #61.

@kernc
Copy link
Author

kernc commented Sep 29, 2016

Equivalently, you could import PySide's Signal:

from PySide.QtCore import Signal as pyqtSignal

Furthermore, you could agnostically:

if PYQT5:
    from PyQt5.QtCore import *
    Signal, Slot, Property = pyqtSignal, pyqtSlot, pyqtProperty
if PYSIDE:
    from PySide.QtCore import *
    pyqtSignal, pyqtSlot, pyqtProperty = Signal, Slot, Property

and avoid tensions to force the user to write their software in a certain way.

PySide folks, at least, seem to acknowledge this.

@ccordoba12
Copy link
Member

@Nodd, your final thoughts on this? You were the one who proposed #47 :-)

I'm -0.5 on the idea because (as I said) I'd prefer projects use the more generic Signal instead of pyqtSignal. But I understand this can be hard for big projects like Orange which decided to use pyqtSignal from the beginning :-)

@kernc
Copy link
Author

kernc commented Sep 29, 2016

I don't think we will have much problem switching to Signals and Slots here. There just isn't a reason to enforce a particular style someone randomly decided upon when working to convenience the user can prove as fruitful and, in this case, so effortless.

@goanpeca
Copy link
Member

goanpeca commented Oct 4, 2016

Hi @kernc just to update here,

There just isn't a reason to enforce a particular style someone randomly decided

Its not really random, the thing is that we follow the Qt5 layout (not the PyQt5 layout) so we need to update the readme.

Since having PyQtSignal was PyQt5 specific, that is why we decided to remove it. PySide (and eventually PySide2) will use Signal and Slot (which feels much better).

We can re-add them if that would make the use of QtPy in orange easier... (but I still think using Signal and Slot to be better than PyQtSignal and PyQtSlot)

@rlaverde
Copy link
Member

This is somehow related to #115

@goanpeca
Copy link
Member

Yep, this is now updated, we should close

@raidsan
Copy link

raidsan commented Aug 25, 2018

not use spyder, just want to use PyQt4, PyQt5 compatible, if you delete pyqtSignal and pyqtSlot and use SIgnal/Slot in spyder way, why not rename the project to spyder-qt ?

@ccordoba12
Copy link
Member

Where in this discussion do we say that we decided to use Signal and Slot due to Spyder? The only mention to Spyder is yours.

seb5g added a commit to PyMoDAQ/PyMoDAQ that referenced this issue Oct 28, 2021
all things from qt comes from the qtpy abstraction layer
renamed calls to pyqtSignal/Slot to Signal/Slot as stated in spyder-ide/qtpy#76
QtreeWidgetItem loaded from QtWidgets package
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants