Comments (10)
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.
from qtpy.
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 :-)
from qtpy.
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.
from qtpy.
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.
from qtpy.
@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 :-)
from qtpy.
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)
from qtpy.
This is somehow related to #115
from qtpy.
Yep, this is now updated, we should close
from qtpy.
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 ?
from qtpy.
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.
from qtpy.
Related Issues (20)
- Testssuite fails to run: pytest.PytestDeprecationWarning: The hookimpl CovPlugin.pytest_configure_node uses old-style configuration options HOT 2
- Typo causes failed QWebEngineScript with PySide6 HOT 4
- Release QtPy 2.4.1 HOT 1
- Qt namespace is littered with service functions HOT 2
- `uic.py` inconsistencies and logic errors
- Odd code found for `PyQt6`: always raises an exception
- QtBindingsNotFoundError on Importing Spyder with Python 3.11.6 HOT 7
- QMenu.add_action() got an unexpected keyword argument 'shortcut' HOT 3
- Why can't I import QAction normally using qtpy? HOT 1
- Allow to specify Qt version via an environment variable (`QT_VERSION`) HOT 4
- BUG: Incompatible with PySide6 6.7.0 HOT 3
- 30 tests fail HOT 1
- Qtpy is non-functional with PySide 6.7.0 HOT 12
- Type stubs? Possible integration with PyQt5-stubs and PySide6-stubs packages? HOT 6
- PySide6 bug HOT 2
- Update tests to be compatible with pytest 8.2
- QWidget.setLayout() broken HOT 1
- Improve `Qt bindings not found` error details HOT 2
- `Qt.MouseButtons` and `Qt.Key` potential unification for Qt5 vs Qt6 HOT 5
- Please unify `QUndoStack`? HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from qtpy.