Forum Discussion

googleid_117965's avatar
googleid_117965
New Contributor
13 years ago

No access to public Qt methods

Hi everybody,



I have a Qt application that's debug compiled with the MSVC2008 compiler through Qt Creator. TestComplete displays the 'open application' logo next to the process and it's able to see all the application's controls. However, it doesn't seem to be able to access the public methods defined in any of these GUI classes. For example, the application has a custom widget that inherits from QWidget and has public methods like this:



class CustomWidget : public QWidget

{

    Q_OBJECT



public:

    bool isOpen() const;

    void setOpen(bool open);



    [...]

}



These methods are not shown in the object browser or object spy. On the other hand, public properties that are defined with the Q_PROPERTY macro are visible to TestComplete and can be accessed without any problems.



I tried compiling the application with Qt 4.8.0, Qt 4.8.1, Qt 4.8.4, different compiler flags (using qmake arguments) aswell as playing around with various TestComplete settings -- all to no avail. Does anyone have an idea what else might be the problem here?



Thanks in advance,

Nik



4 Replies

  • Hi Tanya,



    I did already, it says that TestComplete, by default, enables me to access all public methods from my tests. That's exactly the problem, because unfortunately TestComplete does not enable me to do so.



    I can see a lot of methods in the object browsers "Qt" section when inspecting our application's objects, but it seems like these are only the default Qt methods provided by the default Qt classes that our classes inherit from. In my above example I would see all the standard QWidget methods but none of our public CustomWidget methods. TestComplete seems to be able to access our classes' slots and signals though...



    Any help would be highly appreciated,

    Nik
  • --- Push ---



    I'm currently doing an evaluation of TestComplete for my bachelor's thesis that I have to hand in within the next two weeks. It would be great to solve this issue until then as I don't really want to conclude in my final review, that TestComplete just doesn't support access to public Qt methods in some projects for some reason.



    Regards,

    Nik