Hiding the test runner window

Here's the place for discussion related to coding in FreeCAD, C++ or Python. Design, interfaces and structures.
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
Post Reply
User avatar
chennes
Veteran
Posts: 3876
Joined: Fri Dec 23, 2016 3:38 pm
Location: Norman, OK, USA
Contact:

Hiding the test runner window

Post by chennes »

While the tests are running using the Test WB, sometimes the runner window seems to be getting hidden/occluded/whatever -- how is that done? I'm still trying to get testing of copy and paste working, and I think the events are going to the test runner window instead of the main 3D view. I'm hoping if I actually hide the runner window that will stop.
Chris Hennes
Pioneer Library System
GitHub profile, LinkedIn profile, chrishennes.com
User avatar
Kunda1
Veteran
Posts: 13434
Joined: Thu Jan 05, 2017 9:03 pm

Re: Hiding the test runner window

Post by Kunda1 »

I've wondered about this too!
Alone you go faster. Together we go farther
Please mark thread [Solved]
Want to contribute back to FC? Checkout:
'good first issues' | Open TODOs and FIXMEs | How to Help FreeCAD | How to report Bugs
User avatar
adrianinsaval
Veteran
Posts: 5541
Joined: Thu Apr 05, 2018 5:15 pm

Re: Hiding the test runner window

Post by adrianinsaval »

if it's a qtwidget shouldn't it have a show/hide function?
User avatar
chennes
Veteran
Posts: 3876
Joined: Fri Dec 23, 2016 3:38 pm
Location: Norman, OK, USA
Contact:

Re: Hiding the test runner window

Post by chennes »

Yeah, but how does a running test get at the widget? Do I have to get the list of windows from the QCoreApplication and iterate over it, or something along those lines?
Chris Hennes
Pioneer Library System
GitHub profile, LinkedIn profile, chrishennes.com
TheMarkster
Veteran
Posts: 5505
Joined: Thu Apr 05, 2018 1:53 am

Re: Hiding the test runner window

Post by TheMarkster »

This might (or might not) work:

Code: Select all

Gui.getMainWindow().setFocus()
User avatar
chennes
Veteran
Posts: 3876
Joined: Fri Dec 23, 2016 3:38 pm
Location: Norman, OK, USA
Contact:

Re: Hiding the test runner window

Post by chennes »

TheMarkster wrote: Sun Dec 19, 2021 2:50 am This might (or might not) work:
No luck, I think because the test runner window is modal.
Chris Hennes
Pioneer Library System
GitHub profile, LinkedIn profile, chrishennes.com
wmayer
Founder
Posts: 20241
Joined: Thu Feb 19, 2009 10:32 am
Contact:

Re: Hiding the test runner window

Post by wmayer »

No luck, I think because the test runner window is modal.
No, it's non-modal.You can easily see this when opening the test dialog but not starting the tests. Then you can still interact with the main window by opening the menus, ....

Here I already explained why directly calling the Copy & Paste commands do not give the expected result.

Now when you create a spreadsheet and open the test dialog (or any non-modal dialog) you will see that the Copy & Paste commands are greyed out. In order to make them active again a way is to switch to another application and then back to FreeCAD.

This as a regression of RT's changes of the Link branch where a timer to regularly (200 ms) update all command actions has been replaced to update them on request. There are still a couple of use cases where the commands are not updated when needed.

Now the whole thing is very fragile in order to be tested with unit tests and I recommend to avoid to use the general Copy & Paste command and instead send the messages directly to the correct window.
User avatar
chennes
Veteran
Posts: 3876
Joined: Fri Dec 23, 2016 3:38 pm
Location: Norman, OK, USA
Contact:

Re: Hiding the test runner window

Post by chennes »

wmayer wrote: Sun Dec 19, 2021 10:47 am Now the whole thing is very fragile in order to be tested with unit tests and I recommend to avoid to use the general Copy & Paste command and instead send the messages directly to the correct window.
Thanks, I will take that approach then.
Chris Hennes
Pioneer Library System
GitHub profile, LinkedIn profile, chrishennes.com
Post Reply