how to know window is open in qt

c++, qt

Solution

You can use the visible property:

if (window2->isVisible()) {
   ...
}

Problem

I have created two Main windows. How to know whether 2nd window is open in QT? ``` QMainWindow *window1 = new QMainWindow(); QMainWindow *window2 = new QMainWindow(); ``` Now I have to find whther window2 is already opened in my one instance. How to know it

Original source