How can i set and then get a specific indentifier for a QDialog window when i create it

23 Views Asked by At

So here is the thing - i have a button in mainwindow which creates a QDialog window with a QCustomPlot in it(there are QScrollArea and QVBoxLayout in it). This button can be pushed any number of times and so many windows will be created. When user closes any of them by clicking close button, exectly the one QDialog he closed must be deleted and the objects of QCustomPlot, QScrollArea and QVBoxLayout must be deleted too. But i cant do it without having an indetificator using which i can do it. So the question is there something using which ill be able to mark each new QDialog when creating it and which ill recive after user will close this window?

I have locked over QDialog class docs and didnt find anything i could use. I have tried to create an arrey of pointers of QDialog and tried to manege it numbers some how but in result if QDialogs are closed in the order they were created it works, but if it is some random order, then the window which was closed and the last one created are closed. I have tried to google it but didnt find the answer or solution.

0

There are 0 best solutions below