Klasik Klasik - 1 year ago 340
C++ Question

In Qt C++, how can I fully disable resizing a window including the resize icon when the mouse hovers the border?

I used:


to stop the window from resizing, but the resize arrows still appear when the mouse is over the border of the window.

Is there a better way to disable window resizing to avoid showing the arrows when crossing the border?

Answer Source

Try something like this:


If this doesn't work, all you need to do is detect what widget is activating QSizeGrip. You can do this by installing an event filter on your app and try to catch the QSizeGrip's mouseMoveEvent. Then debug its parent widget.

Here's an example of the eventFilter function you could use:

bool MainWindow::eventFilter(QObject *obj, QEvent *event)
    if(event->type() == QEvent::MouseMove)
        QSizeGrip *sg = qobject_cast<QSizeGrip*>(obj);
            qDebug() << sg->parentWidget();
    return false;

You could probably catch its show event as well, it's up to you.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download