Forum Discussion

bigA's avatar
bigA
New Contributor
7 years ago

Is it possible to access the items in a QList?

Hi, 

 

I can't seem to access data stored in a Qt QList. Qt's built-in functions for accessing QLists don't work when I call them in my scripts. I've tried writing functions in the tested application to access the QList and return the values, but calling those functions from TestComplete throws exceptions. I've looked into it, and it seems that QList objects that are members of a class appear empty when I try to access them from TC via my accessor functions, but work just fine when accessed from within the Qt application through the same accessor functions. 

 

Any info would be greatly appreciated.

5 Replies

  • tristaanogre's avatar
    tristaanogre
    Esteemed Contributor

    Couple of questions:

     

    1) What version of Qt is the application written in?

    2) What version of TestComplete are you running?

     

    These are relevant because TC 12.42 (the latest version) supports QT 5.0 to 5.8.  There are ways of supporting older version of QT but currently, TC 12.42 does not support them out of the box. (see https://support.smartbear.com/testcomplete/docs/app-testing/desktop/qt/about.html#general-notes-on-testing-qt-applications)

    • bigA's avatar
      bigA
      New Contributor

      Hi Robert, 

       

      1) Qt version: 5.9.1

      2) TestComplete: 12.42

       

      Thanks, for the quick reply. I guess the version of Qt we're using is not supported. Do you know of a way around this? 

      • tristaanogre's avatar
        tristaanogre
        Esteemed Contributor

        I'm not familiar enough with the Qt technology to answer that but my guess is that you'll have to work with the components as "black boxes" where you will not have access to internal properties and methods.  "Click" and "Keys" and such should still work but you won't be able to look for list objects etc.

         

        There's a new version of TestComplete coming out soon, or so I've been told.  Version 12.5 MIGHT have improved technology but, not being an employee of SmartBear, I don't know for certain.  You can query their staff directly at https://support.smartbear.com/message/?prod=TestComplete and see what they have to say.