The Add Data button is not working properly

So, when I click the Add Data button, it opens the file dialog box and I am able to load MRIs perfectly. But if I close the file dialog box without loading any MRML or MRI files and then try to open it again the file dialog box just goes full black and nothing is showing. The title bar of that window and the close button is working perfectly fine but it is not showing any files or folders to load. Just a black window. How can I fix it? Thanks for you help.

(P.S This is problem exists in both pre-built slicer and the slicer I built)

1 Like

I assume you are using Linux? This has seemingly only come up on that platform. It has something that has been noticed and there is hope that switching to a newer Qt version will resolve it. That should hopefully happen soon. For now you can track the progress at:

1 Like

Hi @jamesobutler,
Could you suggest how to temporarily remove the “X“ icon of that DataDialog window?
I found the UI file for the widget at, Base/QTGUI/Resources/UI/qSlicerDataDialog.ui.The UI file doesn’t have the “X” icon and seems to populated in the dialog window by some other code.

Could you help with identifying what part of the code to modify for users facing this problem so that there is a temporary fix until the issue is solved in the core repo? I have built Slicer from source, so I don’t mind sub-classing the core Slicer widget or even modifying the Slicer widget on my machine.
Thanks!

PS :

My environment details : -

Slicer version: 5.10.0
Operating system: Ubuntu 22.04
Desktop environment: ubuntu:GNOME
Session type: x11
GPU hardware: Mesa Intel® UHD Graphics (TGL GT1)

1 Like

Hi everyone,
I was able to do the temporary fix I asked for, I edited the following function :-
bool qSlicerDataDialog::exec(const qSlicerIO::IOProperties& readerProperties)

All one needs to do is use QWidget::setWindowFlags()

Inside qSlicerDataDialog::exec of the core slicer widget, I added one more bit-wise operation- & ~Qt::WindowCloseButtonHint to all QWidget::setWindowFlags() calls inside the function. This removes the close icon(“x“ icon)

I think sub-classing the core widget and overriding said function would be a better approach.

2 Likes