Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how to know window is open in qt [closed]

Tags:

c++

qt

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

like image 628
user3172864 Avatar asked Feb 15 '23 04:02

user3172864


1 Answers

You can use the visible property:

if (window2->isVisible()) {
   ...
}
like image 160
Andreas Fester Avatar answered Feb 22 '23 23:02

Andreas Fester