Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Installation and Deployment
  4. [Solved] [How?] Generate moc files automatically using Visual Studio 2008
Forum Updated to NodeBB v4.3 + New Features

[Solved] [How?] Generate moc files automatically using Visual Studio 2008

Scheduled Pinned Locked Moved Installation and Deployment
7 Posts 4 Posters 11.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.
  • B Offline
    B Offline
    Bekos
    wrote on 11 May 2011, 11:53 last edited by
    #1

    Hello guys

    I have a simple question. :)
    Is there some way to configure Microsoft Visual Studio 2008 to automatically generate and use moc files every time I add the Q_OBJECT macro in a class? Right now this is done when I create my Visual Studio project as a "Qt Application" but not when I have a simple 'Win32 Project' or 'Win32 Console Application'. What project properties I should add to the last two types of projects, in order to generate automatically the moc files?

    Thank you in Advance!

    1 Reply Last reply
    0
    • D Offline
      D Offline
      DenisKormalev
      wrote on 11 May 2011, 12:37 last edited by
      #2

      Can you say why you don't want to use Qt App projec template? Are there any reasons for it?

      1 Reply Last reply
      0
      • B Offline
        B Offline
        Bekos
        wrote on 12 May 2011, 08:24 last edited by
        #3

        Heya,
        Thank you for your reply dude. Well, there is no any very serious reason for it. I just want to know how to do it without the Qt Application project template.

        Cheers

        [quote author="Denis Kormalev" date="1305117479"]Can you say why you don't want to use Qt App projec template? Are there any reasons for it? [/quote]

        1 Reply Last reply
        0
        • G Offline
          G Offline
          goetz
          wrote on 12 May 2011, 11:28 last edited by
          #4

          You can add some preparation and compilation steps manually. There is no help from other tools.

          Just go with a Qt project and you're done.

          You can always analyze a VS project file with Qt support enabled. It's just an XML file.

          http://www.catb.org/~esr/faqs/smart-questions.html

          1 Reply Last reply
          0
          • B Offline
            B Offline
            Bekos
            wrote on 13 May 2011, 10:21 last edited by
            #5

            Thanks for your reply Volker.
            Indeed I found a guide explaining how to configure the project settings for the thing I ask. Although, I might have a look at the project files when I find some free time to see how the Qt App template works.
            Thanks again for your help guys!

            1 Reply Last reply
            0
            • G Offline
              G Offline
              goetz
              wrote on 13 May 2011, 10:23 last edited by
              #6

              I've never done that manually, but always used the VS addin for the "dirty work" (I'm lazy regarding such stuff :) )

              http://www.catb.org/~esr/faqs/smart-questions.html

              1 Reply Last reply
              0
              • G Offline
                G Offline
                giesbert
                wrote on 13 May 2011, 10:26 last edited by
                #7

                And it is really dirty, as you have to deal with all the compiler defines etc.
                You can also just add some xml stuff in thge end of the vcproj file and the plugin does all for you, even if it was not created with the qt templates.

                Nokia Certified Qt Specialist.
                Programming Is Like Sex: One mistake and you have to support it for the rest of your life. (Michael Sinz)

                1 Reply Last reply
                0

                1/7

                11 May 2011, 11:53

                • Login

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