really stupid question about Frameless
-
Hello,
Today I have a very stupid question... I want to redisplay the frame of a frameless window
my Widget is a QPushButton (for test purpose)
widget.setWindowFlags(QtCore.Qt.Widget | QtCore.Qt.FramelessWindowHint)now, i want to RE display the frame
I ve tried this but it didn't do anything except closing the window...
widget.setWindowFlags(widget.windowFlags() ^ QtCore.Qt.FramelessWindowHint)What is wrong with this ?
Thx !
-
Oh No, not like that.
I asked to remove the complete line
setWindowFlags(QtCore.Qt.Widget | QtCore.Qt.FramelessWindowHint).
//This line of code,. gives you frameless window. So remove it and you will have window with frame.Lets take an example:
QDialog * dialog = new QDialog;
dialog->setWindowFlags(setWindowFlags(Qt::FramelessWindowHint | Qt::Dialog););
// If you have this setwidnowFlag with FramlessWindowHint mean asking for //frames less Dialog.If you don't have this line mean , that you will have dialog with //default frame and hint icon ,m basing on your OS.ObjectName->setWindowsFlags(....) or directly in constructor setWindowsFlags(....) is used to specify the window-system properties of the widget. When you don't want change / specify window properties, then you don't need to set any windowFlags.
-
-
Yes, that's it
The idea it to create a custom drag to take a widget out of the main window. So by setting its parent to None it automatically creates a frame around it that I am removing so i looks like the QDrag and then when i "drop" I want to re display the frame so it looks like a window. -
After you've changed window flags on a visible window you need to call
show()
again for the new setting to take effect. That's just how window managers work. It's documented here.