Qt World Summit: Submit your Presentation

Include UI header file before it was generated

  • I'm moving from Visual Studio (2008) to Qt Creator 2.7.2 and I'm a bit confused on the subject of referencing generated UI / form files.

    Let's say I have a monkey.ui file In my visual studio project, I knew that there will be a generated file called ui_monkey.h in "./generatedfiles" so I included that header file so that I could create a UI::MonkeyClass member in my monkey.cpp file. This worked fine for me in visual studio.

    However now in Qt Creator I get the error saying that I cannot include the "ui_monkey.h" since it doesn't exist. I understand it won't exist till the form files are processed and the files are generated. But how should I write this so it compiles and works?

    And if there's a chance I'm really off here, feel free to point me to the right direction!

    Thank you!

  • Hi, seems something wrong with your .pro file.

  • You're right. I'm not sure what I did wrong, or what I did right, but I cleaned up and tried again and it worked.

Log in to reply