Results 1 to 5 of 5

Thread: qmake -tp vc Breaks Visual Studio 2010 Solution

  1. #1
    Join Date
    Jun 2012
    Posts
    219
    Thanks
    28
    Thanked 3 Times in 3 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default qmake -tp vc Breaks Visual Studio 2010 Solution

    I'm still struggling to get a low maintenance development environment using Visual Studio 2010 with the integrated Qt support.

    Mostly, I love it! It's really convenient to redesign and refine dialogs using Qt designer and then just rebuild. However, whenever I have to add a new dialog, the overhead seems unreasonable.

    I mentioned in a previous post that the qmake -tp vc causes the property sheet that defines required include directories, libs, etc to be removed from the VS2010 solution. Annoying, but not such a big deal since I just add it back after doing the qmake.

    What's been much more of a hassle is getting things like "Go to declaration", "Go to definition", and "Find all References" working again after the qmake. I've done hours of surfing trying to figure out what's causing the issue and how to fix it.

    I've tried many things, nothing seems to restore these nearly essential features after doing the qmake. Just this morning I confirmed it is the qmake that messes things up, so I think that means it has nothing to do with the source files, but rather something in the VS2010 environment.

    What DOES work is starting a brand new VS2010 project, copying all the source files into a new directory, then running the qmake -tp vc there. Everything works fine until I add new source files with QObject and do qmake -tp vc again.

    Any suggestions on how to debug this would be appreciated. Or, how do others work in Vs2010 with integrated Qt? I use the property sheet for configuring stuff like include and library paths, so I don't have to go through all the different places in the VS2010 GUI every time I start a new or derivative solution.

    Thanks,

    Dave Thomas

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: qmake -tp vc Breaks Visual Studio 2010 Solution

    qmake -tp vc creates a new visual studio solution based on qmake project. If you already have a visual studio solution then there is no point in calling qmake -tp vc again. Just add appropriate files directly to your solution and they should be handled just fine.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  3. #3
    Join Date
    Jun 2012
    Posts
    219
    Thanks
    28
    Thanked 3 Times in 3 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: qmake -tp vc Breaks Visual Studio 2010 Solution

    Hmm, I thought I tried that and had issues with unresolved externals. I thought anytime I added a file with a QObject, I needed to redo the qmake -tp vc.

    Thanks,

    Dave Thomas


    Added after 6 minutes:


    Here's the thread where I asked if I really had to to the qmake -tp vc

    http://www.qtcentre.org/threads/4940...-vc?highlight=

    I think I don't get the
    Last edited by davethomaspilot; 12th July 2012 at 16:11.

  4. #4
    Join Date
    Jun 2012
    Posts
    219
    Thanks
    28
    Thanked 3 Times in 3 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: qmake -tp vc Breaks Visual Studio 2010 Solution

    Ok, I just add a new .ui file, and asslociated .h an .cpp file. So, I thought I'd try just adding these files to the Solution using the VS2010 interfaces as suggested by Wysota.

    After adding these files, I do a build, but a a ui_ header file does not get created.

    So, there must be another step to do? At this point, I'd normally do a qmake -tp vc and rebuild. That will work, but it will break the VS2010 features as I described earlier in this thread. The only way I've figured out how to fix the broken functionality, is to create a new directory, copy files from the existing VS2010 directory into the new directory, then do the qmake -tp vc newdir.pro. Everthing then works correctly.

    I know others are not doing this everytime they add a new .ui file, so I MUST be missing something!

    Thanks,

    Dave Thomas


    Added after 6 minutes:


    Found this:

    http://truth2.wordpress.com/2010/09/...l-studio-2010/

    Will try it out and post if it works.

    Dave Thomas
    Last edited by davethomaspilot; 14th July 2012 at 22:01.

  5. #5
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: qmake -tp vc Breaks Visual Studio 2010 Solution

    ui_xxx.h files should get built if you use them. Sole adding a .ui file to the project will not build the file. qmake -tp vc should add a rule to your solution on how to build ui_xxx.h files. If you add more ui files to your project, that rule should still catch that new file. At least that was the case some time ago when I last used the VS integration thingy (however that was a couple of years ago).
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


Similar Threads

  1. Qt and Visual Studio 2010
    By SixDegrees in forum Qt Programming
    Replies: 6
    Last Post: 15th November 2010, 19:56
  2. Visual Studio Plugin (1.1.6) crashes Visual Studio (2010)
    By mboeni in forum Installation and Deployment
    Replies: 0
    Last Post: 11th October 2010, 16:46
  3. Plan for Visual Studio 2010 (MSVC 2010)?
    By Vinzz in forum Qt Programming
    Replies: 1
    Last Post: 18th April 2010, 17:42
  4. Qmake DLLDESTDIR, Visual Studio "clean solution"
    By SiLiZiUMM in forum Installation and Deployment
    Replies: 4
    Last Post: 18th March 2008, 12:14
  5. Visual Studio Solution Configuration
    By SiLiZiUMM in forum Installation and Deployment
    Replies: 1
    Last Post: 14th March 2008, 16:29

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.