Comments (8)
Thanks!
When I click "Press" the script does open a new window. This works both with $ python script.py
and inside $ ipython3 --gui=qt5
.
It just occured to me that e.g. the histogram window inside $ silx view
does open. It seems that only the line plot doesn't work.
from silx.
...but to me the lineplot is by far the most used feature! π
I understand though that this is not high priority for you. The workaround with QT_QPA_PLATFORM=wayland
is working for now. I mainly wanted to open an issue about it because I was confused at first and didn't know if the lineplot was working at all.
from silx.
Hi,
I don't have access to a machine to try this.
To be sure, can you check which version of Qt and which binding silx view
is loading? You can see it from the Help -> About
menu.
It would also be good to check which rendering backend is used (OpenGL or matplotlib). You can see it in the Options -> Plot rendering backend: <backend>
menu.
Also, can you run the following code from ipython3 --gui=qt5
and do a line profile as you do with silx view
? This reproduces what you do in silx view
, and would allow to check if the behavior is different.
from silx import sx; import numpy as np
w = sx.imshow(np.arange(100*100).reshape(100, 100))
To know which platform is used by default, you can run QT_DEBUG_PLUGINS=1 silx view
.
It's quite verbose, but checking the loaded library ...
lines allows to find which platform is used by default (xcb
I guess).
from silx.
I am also on Gnome on Wayland (Ubuntu 22.04) and I cannot reproduce this, whether it is with Python 3.9 or 3.12.
I think further information is needed then: see the instructions given by @t20100
from silx.
Thanks for looking into this! Sorry for my delayed response.
can you check which version of Qt and which binding
silx view
is loading?
Qt version 5.15.2, Qt binding PyQt5
It would also be good to check which rendering backend is used
At the moment it's matplotlib. Behavior is unchanged for opengl (after restart and confirming it's using opengl).
Also, can you run the following code
The lineplot also doesn't show up here.
To know which platform is used by default, you can run
QT_DEBUG_PLUGINS=1 silx view
It looks to me like that's also using qt5? Only in the first line it's PyQt5/.../libqxcb.so
.
$ grep "loaded library" silx_log.txt
loaded library "/home/clem/.local/share/pipx/venvs/silx/lib/python3.12/site-packages/PyQt5/Qt5/plugins/platforms/libqxcb.so"
loaded library "Xcursor"
loaded library "/home/clem/.local/share/pipx/venvs/silx/lib/python3.12/site-packages/PyQt5/Qt5/plugins/platformthemes/libqgtk3.so"
loaded library "/home/clem/.local/share/pipx/venvs/silx/lib/python3.12/site-packages/PyQt5/Qt5/plugins/platforminputcontexts/libibusplatforminputcontextplugin.so"
loaded library "/home/clem/.local/share/pipx/venvs/silx/lib/python3.12/site-packages/PyQt5/Qt5/plugins/imageformats/libqgif.so"
loaded library "/home/clem/.local/share/pipx/venvs/silx/lib/python3.12/site-packages/PyQt5/Qt5/plugins/imageformats/libqicns.so"
loaded library "/home/clem/.local/share/pipx/venvs/silx/lib/python3.12/site-packages/PyQt5/Qt5/plugins/imageformats/libqico.so"
loaded library "/home/clem/.local/share/pipx/venvs/silx/lib/python3.12/site-packages/PyQt5/Qt5/plugins/imageformats/libqjpeg.so"
loaded library "/home/clem/.local/share/pipx/venvs/silx/lib/python3.12/site-packages/PyQt5/Qt5/plugins/imageformats/libqsvg.so"
loaded library "/home/clem/.local/share/pipx/venvs/silx/lib/python3.12/site-packages/PyQt5/Qt5/plugins/imageformats/libqtga.so"
loaded library "/home/clem/.local/share/pipx/venvs/silx/lib/python3.12/site-packages/PyQt5/Qt5/plugins/imageformats/libqtiff.so"
loaded library "/home/clem/.local/share/pipx/venvs/silx/lib/python3.12/site-packages/PyQt5/Qt5/plugins/imageformats/libqwbmp.so"
loaded library "/home/clem/.local/share/pipx/venvs/silx/lib/python3.12/site-packages/PyQt5/Qt5/plugins/imageformats/libqwebp.so"
loaded library "/home/clem/.local/share/pipx/venvs/silx/lib/python3.12/site-packages/PyQt5/Qt5/plugins/iconengines/libqsvgicon.so"
loaded library "/home/clem/.local/share/pipx/venvs/silx/lib/python3.12/site-packages/PyQt5/Qt5/plugins/xcbglintegrations/libqxcb-glx-integration.so"
from silx.
Can you try to run this script? It reproduces what silx view
profile does with regarding windows but without silx.
My guess is that there is an issue when opening a sub-window in an application, this would allow to check it.
from PyQt5 import QtCore, QtGui, QtWidgets
class MainWindow(QtWidgets.QMainWindow):
def __init__(self):
super().__init__()
btn = QtWidgets.QPushButton("Press")
self.setCentralWidget(btn)
btn.clicked.connect(self._clicked)
def _clicked(self):
print("new window")
new_window = QtWidgets.QMainWindow(self)
new_window.show()
app = QtWidgets.QApplication([])
window = MainWindow()
window.setAttribute(QtCore.Qt.WA_DeleteOnClose)
window.show()
app.exec()
You can also try with the latest version of PyQt5 (5.15.11) and with other Qt bindings: PyQt6 and/or PySide6 to see if it is better.
silx
gives priority to PyQt5 if it is installed, so to try the other Qt bindings, you either need to set QT_API=PyQt6
(or PySide6
) or to uninstall PyQt5
.
from silx.
Thanks for opening the issue! It's the first time we hear about this issue.
I currently don't have much time to work on this project, but we'll figure out what is going wrong (It might take some time since we cannot reproduce it though).
I would still bet on an issue with sub-windows in your particular set-up:
The histogram uses a QWidget
with flags=QtCore.Qt.Window
while the profile uses a QMainWindow
with flags=QtCore.Qt.Dialog
.
Did you try with the latest PyQt5
and with PyQt6
and PySide6
? Do you have the same issue?
Could you try this code? It's almost the same as the previous one, except for flags=QtCore.Qt.Dialog
which I missed the first time I checked the profile code:
from PyQt5 import QtCore, QtGui, QtWidgets
class MainWindow(QtWidgets.QMainWindow):
def __init__(self):
super().__init__()
btn = QtWidgets.QPushButton("Press")
self.setCentralWidget(btn)
btn.clicked.connect(self._clicked)
def _clicked(self):
print("new window")
new_window = QtWidgets.QMainWindow(self, flags=QtCore.Qt.Dialog)
new_window.show()
app = QtWidgets.QApplication([])
window = MainWindow()
window.setAttribute(QtCore.Qt.WA_DeleteOnClose)
window.show()
app.exec()
You can also try patching silx
by removing flags=QtCore.Qt.Dialog
here:
silx/src/silx/gui/plot/tools/profile/manager.py
Lines 141 to 142 in a7da263
from silx.
Thanks for coming back on this.
Did you try with the latest PyQt5 and with PyQt6 and PySide6? Do you have the same issue?
Ha! It seems to work with pyqt6
. I can either force it with ipython3 --gui=qt6
, or I uninstall pyqt5
, install pyqt6
, and then silx view file
uses qt6 (reported in Help-About).
I see no downside of switching my overall workflow to --gui=qt6
.
The default of silx seems to be qt5, though? Installed with pipx
, it uses pyqt5
by default.
Could you try this code? It's almost the same as the previous one, except for flags=QtCore.Qt.Dialog which I missed the first time I checked the profile code:
This code opens a new window on click. The previous version of it also worked though.
You can also try patching silx by removing flags=QtCore.Qt.Dialog here:
Curiously, this does not change anything. Qt5 doesn't work, Qt6 works.
from silx.
Related Issues (20)
- Add `Tiled` data sources to browse Bluesky runs HOT 8
- Warning in Cython compilation HOT 3
- [2.1.0] Debian build and how to skip ascent downloading ? HOT 4
- How can I copy the data in Raw view? HOT 2
- silx view - HDF5view - improve scroll area HOT 1
- silx.gui.dialog GroupDialog and DatasetDialog are missing an API to select an hdf5 entity
- Add a 'auto' imagej like option HOT 2
- silx view: Large 2D datasets are open HOT 2
- Documentation: Describe conda packaging
- [ExternalResources] Allow to set `_data_home`
- tests failures against Pytest 8.2.0 HOT 4
- Issue with DataViewer when removing views HOT 1
- addCurve advances color index even if color is provided HOT 3
- CI random failure in TestImageFileDialogInteraction.testClickOnBackToParentTool test
- [2.1.0] pointer βpeaks0β may be used after βreallocβ [-Wuse-after-free] HOT 1
- Silx view: Y log scale and limits HOT 2
- [IO] FIO files: handle missing data
- macos-11 github runner image was removed
- opencl/codec/test/test_bitshuffle_lz4: bitshuffle import error
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 silx.