GithubHelp home page GithubHelp logo

Comments (12)

dalthviz avatar dalthviz commented on July 22, 2024 3

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.

dschueler-exos avatar dschueler-exos commented on July 22, 2024 3

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.

rayosborn avatar rayosborn commented on July 22, 2024 2

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.

ccordoba12 avatar ccordoba12 commented on July 22, 2024 1

Thanks @dalthviz! I'll bump our QtPy requirement and release a new Qtconsole version shortly so the fix can reach more users.

from qtconsole.

rayosborn avatar rayosborn commented on July 22, 2024

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.

rayosborn avatar rayosborn commented on July 22, 2024

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.

rayosborn avatar rayosborn commented on July 22, 2024

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.

dschueler-exos avatar dschueler-exos commented on July 22, 2024

I am indeed on PyQt6, on both machines. And thanks for taking a look!

from qtconsole.

ccordoba12 avatar ccordoba12 commented on July 22, 2024

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.

dalthviz avatar dalthviz commented on July 22, 2024

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.

ccordoba12 avatar ccordoba12 commented on July 22, 2024

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.

ccordoba12 avatar ccordoba12 commented on July 22, 2024

I released 5.4.4 with an increased requirement on QtPy.

from qtconsole.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.