Comments (10)
And if we could get PyQt5/PyQt6/PySide2/PySide6 compat all at once via qtpy
, that would be great...
from mne-gui-addons.
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.
Related to mne-tools/mne-python#9586
from mne-gui-addons.
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.
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.
@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.
The biggest changes I see would be anything based on enum
s. 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.
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:
We should probably look to see how Spyder did it
from mne-gui-addons.
Hm... It could be this one:
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.
When I experimented with this I discovered that the resource system has not been migrated to PyQt6
:
This is problematic for our icons but multiple solutions are suggested in the thread:
QDir
to add the path to where the icons are locatedimportlib.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
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 mne-gui-addons.