Details
-
Bug
-
Resolution: Invalid
-
Not Evaluated
-
None
-
2.7.1 (rev.15)
-
None
Description
When you generate a new UI class in Visual Studio it creates a class that uses this format...
#include <QDialog> #include "ui_DialogTest.h" class DialogTest : public QDialog { Q_OBJECT public: DialogTest(QWidget *parent = Q_NULLPTR); ~DialogTest(); private: Ui::DialogTest ui; };
This makes it so the class can not be exported and used in other parts of your application because the "ui_DialogTest.h" file cannot be found.
If you create the same class in Creator then it uses this format...
#include <QDialog> namespace Ui { class DialogTest; } class DialogTest : public QDialog { Q_OBJECT public: DialogTest(QWidget *parent = Q_NULLPTR); ~DialogTest(); private: Ui::DialogTest *ui; };
It then includes "ui_DialogTest.h" in the cpp and initializes the ui pointer in the constructor.
This allows the header to be included in other parts of your code without an error and the class to be used as expected. The VS Tools templates should use the same format.