# The Add Data button is not working properly

**URL:** <https://discourse.slicer.org/t/the-add-data-button-is-not-working-properly/44557>\
**Category:** Support\
**Tags:** data-loading\
**Created:** [September 23, 2025, 8:45am UTC](https://discourse.slicer.org/t/the-add-data-button-is-not-working-properly/44557 "2025-09-23T08:45:18Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Victor\_Wayne](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/victor_wayne/32/80778_2.png) [@Victor\_Wayne](https://discourse.slicer.org/u/Victor_Wayne)\
**Post date:** [September 23, 2025, 8:45am UTC](https://discourse.slicer.org/t/the-add-data-button-is-not-working-properly/44557/1 "2025-09-23T08:45:18Z")

</div>

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)

---

<div class="post-metadata">

**Author:** ![jamesobutler](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/jamesobutler/32/7511_2.png) [@jamesobutler](https://discourse.slicer.org/u/jamesobutler)\
**Post date:** [September 23, 2025, 10:59am UTC](https://discourse.slicer.org/t/the-add-data-button-is-not-working-properly/44557/2 "2025-09-23T10:59:37Z")

</div>

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:

> <https://github.com/Slicer/Slicer/issues/8579>
>
> \## Summary
> 
> When using 3D Slicer 5.8.1 on a Linux server, I encounter an issue w…here the “Add Data” dialog becomes non-functional (black screen) after closing it with the window’s “X” button instead of using \*\*OK\*\* or \*\*Cancel\*\*.
> 
> \## Steps to reproduce
> 
> 1. Open 3D Slicer  
> 2. Click the Add Data icon  
> 3. Close the dialog using the window manager’s “X” button (see gif)  
> 4. Attempt to open \*\*Add Data\*\* again.  
> 
> \## Notes
> \- This issue only occurs on Linux.
> \- I could not reproduce it on Windows 11.
> 
> \## Environment
> \- \*\*3D Slicer version:\*\* 5.8.1
> \- \*\*OS:\*\* Red Hat Enterprise Linux (RHEL 9.5)
> 
> !\[Image\](https://github.com/user-attachments/assets/026ef675-3497-4d59-b641-9a309c4edd47)
> 
> !\[Image\](https://github.com/user-attachments/assets/4f5cfe7b-c289-4678-8942-36c0c0d013a5)

---

<div class="post-metadata">

**Author:** ![Suhaim](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/suhaim/32/81421_2.png) [@Suhaim](https://discourse.slicer.org/u/Suhaim)\
**Post date:** [November 28, 2025, 5:28am UTC](https://discourse.slicer.org/t/the-add-data-button-is-not-working-properly/44557/3 "2025-11-28T05:28:08Z")

</div>

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)

---

<div class="post-metadata">

**Author:** ![Suhaim](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/suhaim/32/81421_2.png) [@Suhaim](https://discourse.slicer.org/u/Suhaim)\
**Post date:** [November 28, 2025, 6:32am UTC](https://discourse.slicer.org/t/the-add-data-button-is-not-working-properly/44557/4 "2025-11-28T06:32:02Z")

</div>

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.
