Hide mainWindow title bar

Hi all.

I would like to hide the title bar of the mainWindow (as shown in the figure below). Thus, I have tried the code below, But the mainWindow itself closed.
Could I get solution about this ?

flags = qt.Qt.FramelessWindowHint

main = slicer.util.mainWindow()
main.setWindowFlags(flags)

titlebar

You might have to set the flag before the window is created.

Since this is basically just Qt, you could experiment with Qt examples and then port what you learn to the Slicer code.

You can find the solution on the Qt forum:

main = slicer.util.mainWindow()
main.hide()
main.setWindowFlags(qt.Qt.FramelessWindowHint)
main.show()
1 Like

Thanks @lassoan @pieper .
This is exactly what I wanted !