Git Product home page Git Product logo

Comments (10)

larsoner avatar larsoner commented on June 1, 2024 1

And if we could get PyQt5/PyQt6/PySide2/PySide6 compat all at once via qtpy, that would be great...

from mne-gui-addons.

larsoner avatar larsoner commented on June 1, 2024 1

We've completed the abstraction of Qt itself, now the IEEG GUI "just" needs to be migrated to the notebook/Qt abstraction framework. I'll re-title this issue to reflect this.

from mne-gui-addons.

alexrockhill avatar alexrockhill commented on June 1, 2024

Related to mne-tools/mne-python#9586

from mne-gui-addons.

larsoner avatar larsoner commented on June 1, 2024

Also need to deal with icon setting https://github.com/mne-tools/mne-python/blob/89dba30445e759ca98102998f6b39eaca292b0fd/mne/viz/backends/_pyvista.py#L89-L105. Ideally perhaps this would be part of the qt/notebook abstraction, too.

from mne-gui-addons.

GuillaumeFavelier avatar GuillaumeFavelier commented on June 1, 2024

That would be awesome if _ieeg_locate_gui used the abstract GUI API because it means that the same features would be available on notebooks so +1 for this.

I quickly went through the list of widgets in #14 and VBoxLayout, HBoxLayout, Label, Slider, PushButton and ComboBox should not be too hard to migrate considering they are already available in the API.

That leaves out MainWindow, GridLayout, MessageBox, ListView and PlainTextEdit. I'm not familiar with all but I believe most of them can be adapted to ipywidgets somehow. Plus, I think it's fine even if we can't reach 100% compatibility. Anyway, it's good to improve the API.

from mne-gui-addons.

larsoner avatar larsoner commented on June 1, 2024

@GuillaumeFavelier what's required for us to have code that works on PyQt5 and PyQt6? Let's just think about Brain / pyvista / backends/_qt.py for now.

I think we can assume we can get it for free for the iEEG GUI once we make that use the same notebook / Qt abstraction.

from mne-gui-addons.

GuillaumeFavelier avatar GuillaumeFavelier commented on June 1, 2024

The biggest changes I see would be anything based on enums. Now they're hidden behind their namespace instead of being all exposed in QtCore.Qt.
For example, Qt.WaitCursor becomes Qt.CursorShape.WaitCursor.

So I would suggest using an intermediate variable like the following:

CursorShape = Qt.CursorShape if PYQT6 else Qt
...
renderer._window_set_cursor(CursorShape.WaitCursor)

The rest should be straightforward, like changing the actual imports.

Of course, it's possible that I miss some details but this is what I remember at the moment.

from mne-gui-addons.

larsoner avatar larsoner commented on June 1, 2024

I'd be surprised if qtpy didn't offer some abstraction for this sort of thing since Spyder must have dealt with it, so maybe we should just use / depend on qtpy for our qt stuff. I haven't read all of this, but it's probably in here or some linked issue/PR:

spyder-ide/qtpy#233

We should probably look to see how Spyder did it

from mne-gui-addons.

GuillaumeFavelier avatar GuillaumeFavelier commented on June 1, 2024

Hm... It could be this one:

spyder-ide/qtpy#271

AFAIK, it provides access to unscoped enums. Maybe I didn't try the latest version 😅

Anyway I think using qtpy is a good idea.

from mne-gui-addons.

GuillaumeFavelier avatar GuillaumeFavelier commented on June 1, 2024

When I experimented with this I discovered that the resource system has not been migrated to PyQt6:

https://stackoverflow.com/questions/66099225/how-can-resources-be-provided-in-pyqt6-which-has-no-pyrcc

This is problematic for our icons but multiple solutions are suggested in the thread:

  • QDir to add the path to where the icons are located
  • importlib.resources which is a python alternative for resource management

I'll share what I have as a draft PR.

from mne-gui-addons.

Related Issues (4)

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.