mainWindow disable maximize button
Unsolved
General and Desktop
-
Hi,
I'm trying to disable the maximize button in mainWindow.
I use this line 2:// main.cpp int main(int argc, char *argv[]) { QApplication a(argc, argv); MainWindow w; w.setWindowFlags(Qt::CustomizeWindowHint | Qt::WindowCloseButtonHint); w.showMaximized(); }
In windows it works well (qt 5.7.0 and win 10) while on Ubuntu 14.04 32bit (qt 5.5.1) the maximize button remains active.
is a bug or something wrong with my code?
Thank you -
I need to be as big as the screen.
Before I used this code to display it as big as the screenint Height = 0; int Width = 0; foreach (QScreen *screen, QGuiApplication::screens()) { if(QGuiApplication::primaryScreen()->name() == screen->name()) { QRect rec = screen->availableGeometry(); Height = rec.height(); Width = rec.width(); } } w.setFixedSize(Width,Height);
Unfortunately, I do not know why, the height is still longer than the screen. This is why I decided to use showMaximized (), unfortunately this does not seem to go well for both systems.