Solved is there an event/signal which happens when the QMdiarea become empty?
-
I want to implement a code when
QMdiarea
is empty i.e. (has noQSubWindow
children).For example:
is there an event or signal which happens when the
QMdiarea
become empty? -
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.