Search code examples
c++widgetwindowqt5.5

Qt Removing Window Widgets


I'm using Qt5.5 and I would like a window without any widgets, here is a snippet from my Window constructor:

    Qt::WindowFlags flags = (Qt::Window
                           | Qt::WindowTitleHint
                           | Qt::CustomizeWindowHint)
                          & ~Qt::WindowMaximizeButtonHint;
    setWindowFlags(flags);

This produces a window with no close widget and no minimize widget, however the maximize widget is still visible and can be clicked on to maximize the window, also the window can be resized by dragging the window edges.

I am trying to create a tool window that is always on top and doesn't have any widgets and is a fixed size.

In QtCreator I've set the sizePolicy to:

    Horizontal Policy: Fixed
    Vertical Policy: Fixed

Yet I am still able to resize the window?

I am aware that this is a very similar question to others posted before, but so far having read those and tried the suggestions nothing has worked.

I'm running on Ubtuntu 14.04.


Solution

  • By adding:

        setFixedSize(mcintWindowWidth, mcintWindowHeight);
    

    This fixed the problem and the maximize widget is no longer visible and the window can no longer be resized.