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. [solved] how to recompile all headers in VS?
Forum Updated to NodeBB v4.3 + New Features

[solved] how to recompile all headers in VS?

Scheduled Pinned Locked Moved Qt Creator and other tools
2 Posts 1 Posters 1.5k 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.
  • N Offline
    N Offline
    neurocod
    wrote on last edited by
    #1

    Is there any way to recompile all headers to invoke moc in Visual Studio? I deleted all moc files and need to generate them again, but Visual Studio "rebuild all" command compiles only source files. Currently the only known solution for me is to open each header manually and recompile, which is boring.

    1 Reply Last reply
    0
    • N Offline
      N Offline
      neurocod
      wrote on last edited by
      #2

      Solved:

      1. Replace Q_OBJECT in all files to something like QOBJECT_REPLACEMENT, save files, then replace again - this will re-add moc files
      2. now have many open files, repeatedly call temporary macro to compile all:
        @Sub makeMoc()
        DTE.ExecuteCommand("Build.Compile")
        DTE.ActiveWindow.Close(vsSaveChanges.vsSaveChangesNo)
        DTE.ActiveWindow.Close(vsSaveChanges.vsSaveChangesNo)
        End Sub@
      3. in other configuration (release), build called moc properly, so no changes required.
      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