I have a problem with a Qt dialog customization. The dialog contains an image (QLabel with pixmap) and under a panel with buttons on it. By default the dialog has no title bar and border and the panel is not visible. When I click on the displayed image, the panel became visible and the border should be also visible in order to the user could resize the dialog.
Setting the panel visible, or invisible is easy and hide the border at the beginning is also clear:
setWindowFlags( Qt::Dialog | Qt::FramelessWindowHint );
BUT
I'm not able to restore the border of the window. I've tried this:
// this is in the header
Qt::WindowFlags m_wndFlags;
// this is in the cpp
dlgImageWindow::dlgImageWindow()
{
Qt::WindowFlags m_wndFlags = windowFlags();
setWindowFlags( Qt::Dialog | Qt::FramelessWindowHint );
}
... // border is hidden
void dlgImageWindow::_showBorder()
{
setWindowFlags( m_wndFlags );
}
Unfortunatelly the result is that the whole dialog disappears. Any idea?