I have been trying to disable the resize grip after setting the fixed width of the main window. I read in the Qt forms that setting the statusBar()->setSizeGripEnabled()
as false
would disable the resize grip, but no luck. I am running this on Qt5
.
I know that removing the frame would remove this problem but that's a bigger problem (creating ways to drag the window, adding buttons to close etc.). So far this is what I have in my main
method:
#if defined(Q_OS_WIN)
QCoreApplication::setAttribute(Qt::AA_EnableHighDpiScaling);
#endif
QApplication a(argc, argv);
Compressor w;
w.statusBar()->setSizeGripEnabled( false );
w.setFixedSize(QSize(360,450));
w.setGeometry(
QStyle::alignedRect(
Qt::LeftToRight,
Qt::AlignCenter,
w.size(),
a.desktop()->availableGeometry()
)
);
w.show();
The setGeometry
sets the window on the centre of the screen on startup, Fixed it to a size. I am not sure what the problem is. Is there any way to fix this?
Update
Setting the w.setSizePolicy(QSizePolicy::Ignored, QSizePolicy::Fixed);
Didn't work. Tried fixing both to Fixed
, no luck.
Update 2
I even remove the status bar, but still no luck.
Update 3
Example:
On Windows 10 using version Qt 5.10.1