accessing the QPushButton of QWindow
-
Hi all,
I have one Qt destkop application in which I am having one QWindow with some QlineEdits and QPushButtons. I am this app I am using .exec() function to show my window. Now I have to write QTest to check the functionality of the QPushButton which is used in that window. Here is one issue that I am using .exec() function so it will go in a loop and it not execute the main thread until I close the window. So I want to ask that is there any way to access the QPushButton in the QTest while that window in executed. -
Yes I have already read the documentation but there nothing related to my query.
-
Yes I have already read the documentation but there nothing related to my query.
So it's a good start. Usually, when designing a widget such as a dialog, it should be usable without calling exec but using the open method. Hence my recommendation would be to ensure that yours can be used with open to make it properly testable.
-
Hi
Thank you for your suggestion, So, you telling about show() method or you taking about some other method.
So in my case I am using exec() to open the window because it will enter in a new loop and won't allow the main thread to execute further code until you close the window. I am using this because I don't want the user do something else while this window is open. So now I want to test this window. -
Hi
Thank you for your suggestion, So, you telling about show() method or you taking about some other method.
So in my case I am using exec() to open the window because it will enter in a new loop and won't allow the main thread to execute further code until you close the window. I am using this because I don't want the user do something else while this window is open. So now I want to test this window.No, not show, open which allows to have the same blocking effect as exec without requiring a second event loop.