Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Qt Creator and other tools
  4. VS Addin: moc not run for all files, even with clean rebuild
Qt 6.11 is out! See what's new in the release blog

VS Addin: moc not run for all files, even with clean rebuild

Scheduled Pinned Locked Moved Qt Creator and other tools
7 Posts 2 Posters 2.9k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • A Offline
    A Offline
    Asperamanca
    wrote on last edited by
    #1

    The VS Addin (in my VS 2010) often does not recognize it needs to moc files. Most notably, this happens if the Q_OBJECT macro was added outside VS.

    The real problem is that the add-in does not seem to re-evaluate which files to moc, even if I clean-rebuild.

    Is there a way to tell the Addin that it should check all files? Is there a way to manually run moc for a single file (other than remove+add in project, or doing a pseudo-code change)?

    1 Reply Last reply
    0
    • M Offline
      M Offline
      msue
      wrote on last edited by
      #2

      You have to import the pro-file again or run qmake again, after you changed something concerning MOC, UIC, etc.

      1 Reply Last reply
      0
      • A Offline
        A Offline
        Asperamanca
        wrote on last edited by
        #3

        Importing the pro file takes about 15 minutes for large projects, plus another 20 minutes manual work to get all the project settings right.

        Compared to this, removing and adding the files to the project is the easier way.

        But thanks for the suggestion.

        1 Reply Last reply
        0
        • M Offline
          M Offline
          msue
          wrote on last edited by
          #4

          Well, because of this unnerving situation for big projects, I also stopped using the pro-import of the VS Add-In and instead start the following script in a WINDOWS command line in the project's root directory:

          @%QTDIR%\bin\qmake -spec %QMAKESPEC% -tp vc -recursive@

          and reload the solution file.

          1 Reply Last reply
          0
          • A Offline
            A Offline
            Asperamanca
            wrote on last edited by
            #5

            Interesting. What exactly does it do?

            Currently, we manually update both projects and solutions when changes are made. We can live with it, but it's always extra work.

            1 Reply Last reply
            0
            • M Offline
              M Offline
              msue
              wrote on last edited by
              #6

              This call makes qmake create a Visual Studio solution file (if there is only one .pro-file in the directory).
              QMAKESPEC is something like: C:\Qt\5.3.1\mkspecs\win32-msvc2013
              So I usually unload the solution, run the script and reload the solution again. (But I edit the .pro and .pri-files manually.)

              1 Reply Last reply
              0
              • A Offline
                A Offline
                Asperamanca
                wrote on last edited by
                #7

                Good to know. Thanks!

                1 Reply Last reply
                0

                • Login

                • Login or register to search.
                • First post
                  Last post
                0
                • Categories
                • Recent
                • Tags
                • Popular
                • Users
                • Groups
                • Search
                • Get Qt Extensions
                • Unsolved