Comments (12)
Hi, just in case, updating to QtPy 2.4.0 should fix this issue (at least the issues/traceback related with the drag and drop event)
from qtconsole.
Hi, just in case, updating to QtPy 2.4.0 should fix this issue (at least the issues/traceback related with the drag and drop event)
That worked. Thanks!
from qtconsole.
Just for the record, upgrading to QtPy v2.4.0 does indeed fix the issue in NeXpy when using PyQt6. @dalthviz, thanks for the fix! I'll update our dependencies.
from qtconsole.
Thanks @dalthviz! I'll bump our QtPy requirement and release a new Qtconsole version shortly so the fix can reach more users.
from qtconsole.
I couldn't reproduce this in PyQt5, but it looks as if there may have been changes in PyQt6 that need addressing. If I try to drag a selection in qtconsole 5.4.3, I get the following:
---------------------------------------------------------------------------
AttributeError Traceback (most recent call last)
File ~/opt/miniconda3/envs/pyqt6/lib/python3.9/site-packages/qtconsole/console_widget.py:400, in ConsoleWidget.dragMoveEvent(self, e)
398 pass
399 elif e.mimeData().hasText():
--> 400 cursor = self._control.cursorForPosition(e.pos())
401 if self._in_buffer(cursor.position()):
402 e.setDropAction(QtCore.Qt.CopyAction)
AttributeError: 'QDragMoveEvent' object has no attribute 'pos'
2023-08-08 13:51:08,444 - ERROR - Exception in GUI event loop
---------------------------------------------------------------------------
AttributeError Traceback (most recent call last)
File ~/opt/miniconda3/envs/pyqt6/lib/python3.9/site-packages/qtconsole/console_widget.py:400, in ConsoleWidget.dragMoveEvent(self, e)
398 pass
399 elif e.mimeData().hasText():
--> 400 cursor = self._control.cursorForPosition(e.pos())
401 if self._in_buffer(cursor.position()):
402 e.setDropAction(QtCore.Qt.CopyAction)
AttributeError: 'QDragMoveEvent' object has no attribute 'pos'
2023-08-08 13:51:16,031 - ERROR - Exception in GUI event loop
---------------------------------------------------------------------------
AttributeError Traceback (most recent call last)
File ~/opt/miniconda3/envs/pyqt6/lib/python3.9/site-packages/qtconsole/console_widget.py:400, in ConsoleWidget.dragMoveEvent(self, e)
398 pass
399 elif e.mimeData().hasText():
--> 400 cursor = self._control.cursorForPosition(e.pos())
401 if self._in_buffer(cursor.position()):
402 e.setDropAction(QtCore.Qt.CopyAction)
AttributeError: 'QDragMoveEvent' object has no attribute 'pos'
from qtconsole.
According to https://stackoverflow.com/questions/67496362/qmouseevent-object-has-no-attribute-pos, the fix may be as simple as changing e.pos
to e.position
, or at least catching the AttributeError
and switching to the correct attribute. This will need a little looking into.
from qtconsole.
By the way, if your whole application aborts with this bug, then you might be experiencing the issue discussed here. Customizing sys.excepthook
in qtconsole might be worth thinking about, although it might interfere with other applications using the library. Such errors should produce an exception, not a core dump.
from qtconsole.
I am indeed on PyQt6, on both machines. And thanks for taking a look!
from qtconsole.
the fix may be as simple as changing e.pos to e.position
I think this case is already covered in Qtpy so the code is compatible between Qt5 and 6, right @dalthviz?
from qtconsole.
I think some handling was added but only for QMouseEvent
at spyder-ide/qtpy#408 and in general all the child classes of QSinglePointEvent
at spyder-ide/qtpy#417
from qtconsole.
Thanks for checking @dalthviz.
@rayosborn, then a fix for this would require adding to Qtpy something similar to spyder-ide/qtpy#408 for QDragMoveEvent
.
from qtconsole.
I released 5.4.4 with an increased requirement on QtPy.
from qtconsole.
Related Issues (20)
- Catching Ctrl-Z and Ctrl-\
- Question: Removal of ipython_genutils HOT 1
- Values missing from console when running automatically
- AttributeError: 'QtInProcessChannel' object has no attribute 'closed' HOT 2
- How to access objects in my application follow the example qtconsole/examples/inprocess_qtconsole.py? HOT 2
- Qt bindings version outdated in documentation HOT 2
- Matplotlib Qt5Agg backend is given anonymous icon when used with qtconsole on macOS HOT 3
- Weird pytest error: 'CompletionHtml' object has no attribute '_text_edit' HOT 4
- Segmentation Fault on `jupyter qtconsole` HOT 10
- Stop using `IPythonLexer` from ` IPython.lib.lexers` HOT 3
- TypeError due to wrong spelling in keyword HOT 1
- compute_item_matrix() got an unexpected keyword argument 'displaywidth' HOT 1
- New tab causes crash for --existing kernels
- intersphinx warning HOT 1
- possibly removing `qtconsole` from jupyter metapackage HOT 2
- Horizontal scrolling not updated until wndow resize event HOT 3
- misspelled keyword arg in qtconsole.util.compute_item_matrix HOT 2
- Segfault on import running against Qt 6.7 on 64 bit Windows 11 w/ python 3.12 HOT 3
- Embed interactive matplotlib widgets? HOT 4
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 qtconsole.