is there an event/signal which happens when the QMdiarea become empty?
Solved
General and Desktop
-
Hi! If you're using tabs as your subwindows, then listening to the subWindowActivated signal might be enough. But I'm not 100% sure.
-
connect(mdiArea,SIGNAL(subWindowActivated(QMdiSubWindow*)),this,SLOT(getSubwindowCount()));
static int count = mdiArea->subWindowList().size();
if(!subWindow->isVisible()) {
--count;
}
if(!subWindow1->isVisible()) {
--count;
}
qDebug() << Q_FUNC_INFO <<count;if count is Zero, mdiArea will be empty.
-
Yes, it's work fine. so the
subWindowActivated
is the right signal for that job.
I thank @Wieland and @Vinod-Kuntoji for helping me.