Results 1 to 5 of 5

Thread: Adding a QT dialog in VS2003 doesn't generate files

  1. #1

    Question Adding a QT dialog in VS2003 doesn't generate files

    I am using QT4.1.3 and QT Visual Studio Integration with Visual Studio 2003. Everything seems to work fine when I have an application with just one form, but when I try to add new dialogs to my project, I am running into problems.

    When I create a new QT Application in VS2003, I get a default form with corresponding ui,cpp,h files and everything works fine. I can add a button to my form, and I can double click on this button to have an event handler automatically generated. That is great and that is what I expect, but when I go add a new form to my project, the only file that is generated is the ui file. How do I get the cpp and h files? Also, when I add a button to this new dialog and then double click on it in the designer, I don't get my auto generated event handler like I did in the main form. I would expect that when I add a new dialog to my project, I should get the same files generated that are generated for the main form. What am I doing wrong?
    Last edited by jrbloch; 6th June 2006 at 23:10.

  2. #2
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    6,264
    Thanks
    36
    Thanked 1,519 Times in 1,389 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows Symbian S60 Maemo/MeeGo

    Default Re: Adding a QT dialog in VS2003 doesn't generate files

    Sounds weird, but just to assure, did you setup correct Qt installation dir (Qt itself, not the integration) in VS (Tools->Options->Qt->Builds)?

    Edit: Does an automatically generated template project compile fine? How do you add the form?
    Last edited by jpn; 7th June 2006 at 05:20. Reason: More questions
    J-P Nurmi

  3. #3

    Default Re: Adding a QT dialog in VS2003 doesn't generate files

    Under VS Tools->Options->Qt->Builds, I see
    4.1.3 and its cooresponding path C:\Qt\4.1.3.
    Under VS Tools->Options->Qt->general there is
    Generated Files
    - MocDirectory .\GeneratedFiles\$(ConfigurationName)
    - UicDirectory .\GeneratedFiles
    Misc
    - AutoRunUic true
    - AutoUpdateBuildSteps true

    An automatically generated template project compiles and runs fine, and I can load existing QT4 projects, compile and build them as well.

    The way I am trying to add a new dialog to the project is
    VS File->Add New Item->QT Forms->QT Dialog Form

    I can add the dialog and get only the ui file. It seems like uic is not being run. I tried manually running uic on a command line and only was able to get a .h file. When you add a dialog, do you get all the files generated for you?
    Last edited by jrbloch; 7th June 2006 at 23:08.

  4. #4

    Default Re: Adding a QT dialog in VS2003 doesn't generate files

    It works only if you right click on the project you want to add the new form and then select Add ->Add Qt Gui class.

  5. #5
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    6,264
    Thanks
    36
    Thanked 1,519 Times in 1,389 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows Symbian S60 Maemo/MeeGo

    Default Re: Adding a QT dialog in VS2003 doesn't generate files

    Ahh right. I've always used that way to add new qt ui classes.

    It even kind of makes sense to me. A new file (File->New) is a single new file. The shortcut for adding a new .ui file with corresponding header and implementation files is a different thing than just adding a single new file (let it be any type of file).. I think it's a matter of taste
    J-P Nurmi

Similar Threads

  1. dialog box
    By Bahar in forum Qt Programming
    Replies: 3
    Last Post: 31st January 2006, 14:52

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.