Forum Discussion

ebodien's avatar
ebodien
Contributor
12 years ago

Read Qt text color in TestComplete

Greetings: I am trying to read the color of text displayed by a Qt application using TestComplete and I'm not having much luck.  I've tried multiple auto complete options for the font, palette ...
  • TanyaYatskovska's avatar
    12 years ago

    Hi Eero,


     


    Try using the following code:




    function getColor()


    {


     var lbl = Sys.Process("TextColor").QtObject("TextColorClass").QtObject("label"); 


     var role = lbl.QWidget_foregroundRole();


     var color = lbl.palette.QPalette_color(role);


     Log.Message(color.QColor_value());


    }