<div dir="ltr"><div>in my program I have widget which visibility which visibility is controlled by some variable in internal settings object. In this case I meet verid bug that it works on Linux (my main system) but does not work on Windows and Macos. Due to this I would like to cover it with my test. <br></div><div><br></div><div>Control of this variable state is such that I cannot connect <font face="monospace">setVisible</font> to <font face="monospace">stateChanged</font> of control Widget. But this change is done when widow with widget is inactive. <br></div><div>My current code is</div><div><div><br></div><div> <pre style="background-color:rgb(39,40,34);color:rgb(248,248,242);font-family:"JetBrains Mono Medium""><span style="color:rgb(102,217,239);font-style:italic">def </span><span style="color:rgb(166,226,46)">event</span>(<span style="color:rgb(148,85,141)">self</span>, <span style="color:rgb(253,151,31);font-style:italic">event</span><span style="color:rgb(249,38,114)">: </span>QEvent)<span style="color:rgb(249,38,114)">:<br></span><span style="color:rgb(249,38,114)">    </span><span style="color:rgb(102,217,239);font-style:italic">if </span><span style="color:rgb(253,151,31);font-style:italic">event</span>.<span style="color:rgb(102,217,239)">type</span>() <span style="color:rgb(249,38,114)">== </span>QEvent.WindowActivate<span style="color:rgb(249,38,114)">:<br></span><span style="color:rgb(249,38,114)">        </span><span style="color:rgb(148,85,141)">self</span>.widget.<span style="color:rgb(102,217,239)">setVisible</span>(<span style="color:rgb(148,85,141)">self</span>.settings.control_variable)<br>    <span style="color:rgb(102,217,239);font-style:italic">return </span><span style="color:rgb(102,217,239)">super</span>().<span style="color:rgb(102,217,239)">event</span>(<span style="color:rgb(253,151,31);font-style:italic">event</span>)</pre></div></div><div>And this works for all system (problem with multiple system were connected with setting this variable), but when I try to test it using <font face="monospace">pytest</font> and <font face="monospace">pytest-qt</font> the test fail because widget visibility does not change. I try to use <span style="font-family:monospace">qtbot.waitActive</span> and similar. <br></div><div><br></div><div>Anyone of you meet with such problem and can suggest how to write test which allow to test changing widget visibility, when it changes on windows activation? <br></div><div><br></div><div>Regards,</div><div>Grzegorz Bokota<br></div><div></div></div>