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. Moc not run after adding Q_OBJECT macro (VS 2010)
Forum Updated to NodeBB v4.3 + New Features

Moc not run after adding Q_OBJECT macro (VS 2010)

Scheduled Pinned Locked Moved Qt Creator and other tools
5 Posts 2 Posters 1.3k 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

    In VS 2010, when a Q_OBJECT macro has been added to a file, moc will not automatically run.
    I also found no way to manually "re-moc" the file using the addin's menu.

    The best solution so far is removing and re-adding the header file from the solution.

    Does anyone know a more convenient way?

    1 Reply Last reply
    0
    • sierdzioS Offline
      sierdzioS Offline
      sierdzio
      Moderators
      wrote on last edited by
      #2

      You need to run QMake so that it can create a Makefile, which will, in turn, tell moc to run on that file.

      (Z(:^

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

        How do I run qmake on a VS solution?

        1 Reply Last reply
        0
        • sierdzioS Offline
          sierdzioS Offline
          sierdzio
          Moderators
          wrote on last edited by
          #4

          I do not know that, I am not using VS. In "normal" qmake projects, qmake needs to be rerun when a Q_OBJECT macro is added to a class.

          (Z(:^

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

            Ah, that would explain why I couldn't make sense of your suggestion. There is no visible makefile when working with VS. It all happens pretty much behind the scenes of the IDE.

            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