Why no reaction after hiding QMainWindow and then click it on Mac?
Solved
General and Desktop
-
I just wrote a very simple program on Mac, like that,
#include "main_window.h" MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent) { setCentralWidget(new QWidget); setFixedSize(100, 100); } MainWindow::~MainWindow() { } void MainWindow::closeEvent(QCloseEvent* event) { hide(); event->ignore(); }
After clicked the ❎of
MainWindow
, and then click the icon at the bottom program-dock, but there is no response, it can't show again, why? -
@Limer said in Why no reaction after hiding QMainWindow and then click it on Mac?:
After clicked the ❎of MainWindow, and then click the icon at the bottom program-dock, but there is no response, it can't show again, why?
Because it is hidden (
visible
property isfalse
).Perhaps you should have called
minimize()
instead ofhide()
?