Results 1 to 11 of 11

Thread: Qt 4 and Visual Studio 2005 Add-in project

  1. #1

    Default Qt 4 and Visual Studio 2005 Add-in project

    Hi,

    I need to use Qt4 to create a GUI in a Visual Studio 2005 add-in project. Is there a way to do this?

    Thanks

  2. #2
    Join Date
    Jan 2006
    Location
    Mountain View, CA
    Posts
    279
    Thanked 42 Times in 37 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Qt 4 and Visual Studio 2005 Add-in project

    Yes .
    Save yourself some pain. Learn C++ before learning Qt.

  3. #3

    Default Re: Qt 4 and Visual Studio 2005 Add-in project

    Yes, you mean there is a way to have automaticaly generated .h, .cpp, and the code to generate the QMainWindow in a Add-in project. If the anwser is still yes, please describe a quick walkthrough.

    Thanks.

  4. #4
    Join Date
    Jan 2006
    Location
    Mountain View, CA
    Posts
    279
    Thanked 42 Times in 37 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Qt 4 and Visual Studio 2005 Add-in project

    When you say "Add in" I presume that you are using the Visual Studio Add-in that comes with the commercial version of Qt?

    If so, the instructions to do this should have been provided with the Add-in. Take a look at this thread if you have problems:

    http://lists.trolltech.com/qt-intere...ad00449-0.html

    Without the Add-in, you will have to set up the project manually, you can add custom build rules in Visual Studio for UI files and mocable headers. See here for more info:

    http://doc.trolltech.com/4.2/uic.html
    http://doc.trolltech.com/4.2/moc.html

    The rules are for make, but you should be able to translate them into VS custom build syntax.
    Save yourself some pain. Learn C++ before learning Qt.

  5. #5

    Default Re: Qt 4 and Visual Studio 2005 Add-in project

    No, I already install the Qt4 integration on visual studio. With that I know Qt projects are available and I know how to use it, but thats not what I want. What I want is when I create a Visual Studio add-in, to be able to have all the generated files in that project when I visually construct a .ui. Otherwise I have to make a Qt project and integrate it "manualy" in my add-in project. Not very practical!

  6. #6
    Join Date
    Jan 2006
    Location
    Mountain View, CA
    Posts
    279
    Thanked 42 Times in 37 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Qt 4 and Visual Studio 2005 Add-in project

    I think I see what you mean (A VS 'Add-in' is a plugin for Visual Studio, right?).

    It seems like you have two choices then:

    1) Create a VS add-in project, add the build rules for each ui/mocable file manually (as you say, not very practical, but not too much trouble if you only have a few files that need it).
    2) Create a Qt project and see how it differs to an Add-in project. Then canibalize the bits from the Add-in project that you need to turn the Qt project into an Add-in project.

    I no longer work on the Windows platform, so I don't have VS in order to see how to do this. Maybe someone else can help. Try experimenting in the meantime.
    Save yourself some pain. Learn C++ before learning Qt.

  7. #7
    Join Date
    Jan 2007
    Location
    Augsburg, Germany
    Posts
    75
    Thanks
    4
    Thanked 6 Times in 5 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: Qt 4 and Visual Studio 2005 Add-in project

    In Visual Studio 2005 you can define your own build rules for .ui files. In the .net 2003 version it's too much work ...

  8. #8

    Default Re: Qt 4 and Visual Studio 2005 Add-in project

    Yes, I think making my own build rule is the best way to do it. Any walkthrough on that?

  9. #9
    Join Date
    Jan 2007
    Location
    Augsburg, Germany
    Posts
    75
    Thanks
    4
    Thanked 6 Times in 5 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: Qt 4 and Visual Studio 2005 Add-in project

    Simply click on a project, open the context menu and navigate to "Custom Build Rules ...". There are already two items added, you can use them as example. It's very easy, about one minute of work

  10. #10

    Default Re: Qt 4 and Visual Studio 2005 Add-in project

    I looked at those rule files and I didn't understand how to use it. Maybe a little more explanation could help me. Thanks.

  11. #11
    Join Date
    Jan 2007
    Location
    Augsburg, Germany
    Posts
    75
    Thanks
    4
    Thanked 6 Times in 5 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: Qt 4 and Visual Studio 2005 Add-in project

    Quote Originally Posted by JSPoly View Post
    I looked at those rule files and I didn't understand how to use it. Maybe a little more explanation could help me. Thanks.
    I've added a build rule for the .ui files. You can add it by opening the context menu on a project, navigating to "Custom Build Rules ..." -> "Find Existing ...".

    You may add another rule for the meta object compiler. It's much more work than using a Qt makefile. Thats why I'm using Visual Studio with makefiles.
    Attached Files Attached Files

Similar Threads

  1. Qt + gSoap + Visual Studio 2005
    By xgoan in forum General Programming
    Replies: 3
    Last Post: 17th December 2007, 18:27
  2. Qt-4.2.2 qmake won't compile under visual studio 2005 on vista
    By moowy in forum Installation and Deployment
    Replies: 7
    Last Post: 13th January 2007, 21:06
  3. problem with linking
    By mickey in forum Qt Programming
    Replies: 49
    Last Post: 12th August 2006, 21:41
  4. Qt 4.1.0 on Visual Studio 2005
    By nErnie in forum Installation and Deployment
    Replies: 8
    Last Post: 6th July 2006, 00:56
  5. Qt Designer & Visual Studio 2005
    By pSiCho in forum Qt Tools
    Replies: 6
    Last Post: 9th February 2006, 13:40

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.