Good day.
There is an MDI application. When you click the menu items open QMdiSubWindow 's. It is necessary that in the presence of an already open internal window, the same does not open when you click on the same menu item again.
So far I solve this problem by checking the WindowTitle parameter in each list object from the mdiArea->subWindowList() method for a match (so that there are not two identical ones). But this method looks painfully crutch. Surely there is a more elegant way. I ask experts to prompt.
Thank.
Shl I reached this method, has the right to exist ?:
void MainWindow::CatProducts_open() { CatProducts *buf = QObject::findChild<CatProducts*>("catProducts"); if(buf==0) { CatProducts *catProducts = new CatProducts; catProducts->setObjectName("catProducts"); mdiArea->addSubWindow(catProducts); catProducts->show(); } }