Testing foreground, background, etc. colors of Qt widgets (Qt)

Last edited on

The following example shows how to use the Qt API in Squish test scripts to test colors of Qt widgets:

import names

def main():
    # ...

    check_box = waitForObject(names.MyQCheckBox)
    c = check_box.palette.color(check_box.backgroundRole())
    test.compare("#f0f0f0", c.name)

    # ...
test.py