Cancel closing QWidget after clicking close button
Asked Answered
S

1

8

Is it possible to keep a QWidget open after close button clicked? Suppose that widget is main widget. i.e. not child of another widget.

Spate answered 10/9, 2013 at 9:26 Comment(0)
E
12

I would try to:

void Widget::closeEvent(QCloseEvent *event)
{
    [..]
    event->ignore();
}

As documentation say:

"For example, you can prevent the window from closing by calling ignore() on all events."

Econah answered 10/9, 2013 at 9:33 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.