How to disconnect buttons (setEnabled(false)) close, maximize and minimize of QMainWindow? Or make the window size fixed.
Printable View
How to disconnect buttons (setEnabled(false)) close, maximize and minimize of QMainWindow? Or make the window size fixed.
Code:
setWindowFlags ( Qt::WindowFlags type )
I don't know if it's possible to do what you want to. If you call setWindowFlags(Qt::CustomizeWindowHint) you remove all buttons and a title bar from a window but you still can resize it. Each flag from Qt namespace simply adds a button one by one and other window features. You should read this:
http://doc.qt.nokia.com/4.7-snapshot...indowType-enum
Perhaps there is a lower level hard coding fulfil this but I don't know about it.
Works well doing:But, using the class QMainWindow some event is enabled and you can resize the window. An attached image shows where the event occurs.Code:
setWindowFlags( Qt::WindowTitleHint | Qt::CustomizeWindowHint | Qt::MSWindowsFixedSizeDialogHint);
Attachment 8125
Hi. Good job with what you have achieved so far :). In your example though I still could still resize a window. I have also found the function setFixedSize(windoWidth, windowHeigth). If you use it as follows:
MainWindow w;
w.setWindowFlags(Qt::CustomizeWindowHint | Qt::WindowTitleHint ); // or whatever other flags
w.setFixedSize(w.width(),w.height());
w.show();
You may have your window fixed but I still have seen the "resize" icon at the window's corner.
Reference:
http://stackoverflow.com/questions/6...e-a-fixed-size