Testing widget visibility

Grzegorz Bokota <[email protected]>
Newsgroups gmane.comp.python.pyqt-pykde
Message-ID <CADUBGeRET9CH7i-v+daK_6u1jC-COy92EeRAosKFvzh58MJeCQ@mail.gmail.com>
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.

Control of this variable state is such that I cannot connect setVisible to
stateChanged of control Widget. But this change is done when widow with
widget is inactive.
My current code is

def event(self, event: QEvent):
    if event.type() == QEvent.WindowActivate:
        self.widget.setVisible(self.settings.control_variable)
    return super().event(event)

And this works for all system (problem with multiple system were connected
with setting this variable), but when I try to test it using pytest and
pytest-qt the test fail because widget visibility does not change. I try to
use qtbot.waitActive and similar.

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?

Regards,
Grzegorz Bokota

_______________________________________________
PyQt mailing list    [email protected]
https://www.riverbankcomputing.com/mailman/listinfo/pyqt
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.