Nominate our 2022 Qt Champions!

Questions on difference between add in and creator

  • Hi,

    I'm new in Qt family ! I have two questions about some differences in creator and Add in for visual studio.

    First, in Qt creator, when I create a project, I see a pointer on ui class like this : Ui::TestApp *ui; But in visual studio, I see Ui::TestAppClass ui; I don't understand why is not a pointer ...

    My seconde question is why in creator we need to delete ui and not in visual studio ?

    Thanks in advance.

  • There are three ways to use a Designer UI in your application; this is two of them. See "Using a Designer UI File in Your Application" in the Qt docs. Qt Creator can be configured to generate code in any of the styles. I cannot vouch for the VS add-in.

    If you incorporate the UI as a pointer member then you are responsible for allocation of the UI object on the heap and deleting later. If you incorporate the UI as a member variable then normal C++ scope rules ensure it is cleaned up. This is standard C++.

  • Hi

    Thanks for the answer !

    I'm using the add in of visual studio. I read the doc and in the case that I would create project with using a Pointer Member Variable. How do I ?

    thanks !

Log in to reply