Results 1 to 5 of 5

Thread: Invoking MOC w/MSVS + Qt Visual Integration

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Jun 2007
    Posts
    62
    Thanks
    28
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Unhappy Re: Invoking MOC w/MSVS + Qt Visual Integration

    Quote Originally Posted by jpn View Post
    See Tools->Options->Qt->General->AutoUpdateMocSteps.
    Thanks, but alas, it was already set to TRUE.

    As a work-around, I opened up the properties for the *.h file in question, went to Configuration Properties|Custom Build Step|General, and entered the following:

    Command line: $(QTDIR)/bin/moc -o $(InputName)_moc.cpp $(InputPath)
    Description: Running MOC on $(InputPath)
    Outputs: $(InputName)_moc.cpp

    But it would be nice if the Qt Integrator would notice the presence of the Q_OBJECT macro and automatically add this.

  2. #2
    Join Date
    Nov 2007
    Posts
    1
    Qt products
    Qt3 Qt4
    Platforms
    Windows

    Default Re: Invoking MOC w/MSVS + Qt Visual Integration

    HI!

    I saw this question which did not seem to have been closed. I was searching for the same problem after a re-install after win crash. I have Visual .net 2003 and qt4.3.2 and the vs-integration 1.3.2

    I added a *.h with a QOBJECT and no moc stage was created.

    in previous version of the VS integration there was a moc button but no more. But as I found somewhere out there this is the trick:

    Actually so easy, just open the *.h file edit it (add a space for example) and save, then like magic the moc stage is there.

    /Anders

  3. #3
    Join Date
    Aug 2010
    Posts
    3
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Invoking MOC w/MSVS + Qt Visual Integration

    The sequence to get auto moc support is finicky but it does work if you add the .h file under Source Files by right-clicking in the solution explorer and choosing Add -> Existing Item. This must be done before the first build after the corresponding .cpp file is added. That was the mistake I made. If moc support is enabled you will see "compile" as a right-click menu item for the .h file. Also looking at the properties you will see a dependencies rule that runs moc.

    I am using Qt studio add in version 1.1.5 and VS studio 2008

Similar Threads

  1. Qt configure with msvc.net
    By jivanr in forum Installation and Deployment
    Replies: 1
    Last Post: 11th June 2007, 08:17
  2. Qt Cryptographic Architecture
    By vermarajeev in forum Qt Programming
    Replies: 6
    Last Post: 9th February 2007, 13:15
  3. problem with linking
    By mickey in forum Qt Programming
    Replies: 49
    Last Post: 12th August 2006, 21:41

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
  •  
Qt is a trademark of The Qt Company.