Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Connecting Actions to User defined Slots (I think)
Forum Updated to NodeBB v4.3 + New Features

Connecting Actions to User defined Slots (I think)

Scheduled Pinned Locked Moved General and Desktop
18 Posts 4 Posters 14.0k 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.
  • J Offline
    J Offline
    julio jerez
    wrote on last edited by
    #8

    O I see, you mean running qmake to create a makefile.
    My impression was that QMake just created a makefile.
    Does this mean that the only way to make a QT project is by using Qmake?
    I cannot make a project using by hand using Visual studio?
    I am not using Qmake, I am using Qdesigner and Visual studio to make project manually.

    I will read about QMake then and see what I am missing.

    1 Reply Last reply
    0
    • J Offline
      J Offline
      julio jerez
      wrote on last edited by
      #9

      Oh I see, I have to create a .pro file and use Qmake to create even my visual studio project,
      rather than me creating a VS project myselft.

      bq. The final step is to set the CONFIG variable. Since this is a Qt application, we need to put qt on the CONFIG line so that qmake will add the relevant libraries to be linked against and ensure that build lines for moc and uic are included in the generated Makefile.
      For Visual Studio users, qmake can also generate .dsp or .vcproj files, for example:
      qmake -tp vc -o hello.dsp hello.pro

      I will try that, thanks to the tip

      1 Reply Last reply
      0
      • G Offline
        G Offline
        giesbert
        wrote on last edited by
        #10

        If you want to work with MSVS, you can use the MSVS integration. That does all the job for MSVS, that qmake does it for all compilers on the command line.

        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
        • J Offline
          J Offline
          julio jerez
          wrote on last edited by
          #11

          Yes I know that. I tryied and it works great altought I did not try adding any user slots yet.
          Qt visual studio integration is great, but it does not works with Visual studio express and
          the large majority of my users are indies developers that mostly use free development tools like:

          Visual Studio Express, Linux, CodeBlock, and Xcode in that order.

          This is why I want t make the project using just Qt SDK, Qt designer and Visual Studio.
          I will try making a Qmake text project to create the Visual studio project, see how that goes.

          1 Reply Last reply
          0
          • G Offline
            G Offline
            goetz
            wrote on last edited by
            #12

            [quote author="julio jerez" date="1296503159"]O I see, you mean running qmake to create a makefile.
            My impression was that QMake just created a makefile.
            Does this mean that the only way to make a QT project is by using Qmake?
            I cannot make a project using by hand using Visual studio?
            I am not using Qmake, I am using Qdesigner and Visual studio to make project manually.

            I will read about QMake then and see what I am missing.
            [/quote]

            qmake creates "only" the makefiles, that's true. But it also analyzes the sources and adds the steps for moc if a class contains the Q_OBJECT macro. The moc generated sources are automagically added to the Makefile an link steps etc. If Q_OBJECT is not present, qmake does not generate the moc steps. Thus, if you add Q_OBJECT later on, you must call qmake to catch up the change.

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

            1 Reply Last reply
            0
            • G Offline
              G Offline
              goetz
              wrote on last edited by
              #13

              [quote author="julio jerez" date="1296508259"]Yes I know that. I tryied and it works great altought I did not try adding any user slots yet.
              Qt visual studio integration is great, but it does not works with Visual studio express and
              the large majority of my users are indies developers that mostly use free development tools like:

              Visual Studio Express, Linux, CodeBlock, and Xcode in that order.

              This is why I want t make the project using just Qt SDK, Qt designer and Visual Studio.
              I will try making a Qmake text project to create the Visual studio project, see how that goes.
              [/quote]

              Qt Creator works with all compiler toolchains (although debugging with the MSVS tools is still suboptimal) ... just a small hint ;-)

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

              1 Reply Last reply
              0
              • G Offline
                G Offline
                giesbert
                wrote on last edited by
                #14

                And QtCreator always calls qmake, so it creates the correct makefiles with the moc steps....

                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
                • G Offline
                  G Offline
                  giesbert
                  wrote on last edited by
                  #15

                  [quote author="julio jerez" date="1296508259"]...
                  Qt visual studio integration is great, but it does not works with Visual studio express and
                  the large majority of my users are indies developers that mostly use free development tools like:

                  Visual Studio Express, Linux, CodeBlock, and Xcode in that order.

                  This is why I want t make the project using just Qt SDK, Qt designer and Visual Studio.
                  I will try making a Qmake text project to create the Visual studio project, see how that goes.

                  [/quote]

                  MSVS Express is free, that's right, but it's also not complete :-)
                  The express edition does not support plug-ins. So If you want to use a free tool chain with Qt, I think it would be easier top use QtCreator than using MSVS free edition and always call qmake to create the vcproj files newly after adding a QObject derived class or adding Q_OBJECT macro to a class.

                  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
                  • G Offline
                    G Offline
                    goetz
                    wrote on last edited by
                    #16

                    [quote author="Gerolf" date="1296548656"]And QtCreator always calls qmake, so it creates the correct makefiles with the moc steps....[/quote]

                    No. Creator only calls qmake if the configuration (.pro and includes) has changed. Just adding Q_OBJECT to any class header does not trigger a qmake run (I just tested this). One can force a qmake run with the context menu on the project tree or from the menu bar, though.

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

                    1 Reply Last reply
                    0
                    • G Offline
                      G Offline
                      giesbert
                      wrote on last edited by
                      #17

                      Ok, I have no Creator here, thanks for the correction. But it's even much easier than with MSVS express, as you there have to recreate the vcproj and reload it to MSVS.

                      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
                      • J Offline
                        J Offline
                        julio jerez
                        wrote on last edited by
                        #18

                        Ok I got it
                        basically all I need to do is add a rule to each header file that include a Q_OBJECT macror
                        I added this rule and it seems to work very nice

                        ......\sdk\thirdParty\Qt\4.7.1\bin\moc -DUNICODE -DWIN32 ../$(InputName).h -o ../moc_$(InputName).cpp

                        Thnak every one for the help.
                        Qt seems very eassy to use and it is awesome.

                        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