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. Need some assistance with qmake

Need some assistance with qmake

Scheduled Pinned Locked Moved Qt Creator and other tools
9 Posts 3 Posters 2.6k Views
  • 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.
  • C Offline
    C Offline
    Czar05
    wrote on last edited by
    #1

    I have been reading C++ programming with Qt 4 and I am stuck as I don't understand how one uses qmake, specifically when dealing with dialogs made from Qt designer. There is a passage in the book that reads:

    "Now run qmake to create a .pro file and a makefile (qmake -project; qmake gotocell.pro)". The problem is I don't know how one handles qmake when not in Qt creator. So far the book makes you create a folder called gotocell and asks you to create a main.cpp file from a plain text editor. I have done that and have placed the dialog that was created in Qt Designer (called gotocelldialog.ui) in the gotocell folder. I have tried opening the main.cpp in Qt Creator to use its built in qmake but I am unable to access Build mode from the toolbar. I have a feeling I have to use the Qt command prompt but I have been having some difficulties with it.

    If anybody can help, I would appreciate it. Thanks in advance

    (I have Qt 5.3)

    1 Reply Last reply
    0
    • dheerendraD Offline
      dheerendraD Offline
      dheerendra
      Qt Champions 2022
      wrote on last edited by
      #2

      Did you create the .pro file after creating all the necessary files. Jus open the .pro file in QtCreator. Start compiling.

      I suggest you start everything in QtCreator. It will do anything easy for you. Post that you get into doing things manually.

      Dheerendra
      @Community Service
      Certified Qt Specialist
      http://www.pthinks.com

      1 Reply Last reply
      0
      • C Offline
        C Offline
        Czar05
        wrote on last edited by
        #3

        No .pro file has not been created, the only thing in my gotocell folder is a main.cpp file and gotocelldialog.ui file that I created from Qt Designer.

        The book says I have to turn the main.cpp file into a .pro file by using qmake. I have to use the following commands (qmake -project and qmake gotocell.pro). When I enter the first command in the Qt command prompt nothing happens. I have used Notepad++ to convert the main.cpp into a main.pro file. I have also used Notepad++ to create a makefile. The problem with this approach however is that I am not able to convert a gotocelldialog.ui into a ui_gotocelldialog.h because Notepad++ doesn't have uic tool, qmake on the other hand does.

        1 Reply Last reply
        0
        • dheerendraD Offline
          dheerendraD Offline
          dheerendra
          Qt Champions 2022
          wrote on last edited by
          #4

          ok.

          1. Go to the directory and run the 'qmake -project'. This creates the pro file
          2. Now run 'qmake'
          3. Now run mingw32-make.

          It should go fine. I suggest you open the .pro file in Qt creator after the first step. Just work with QtCreator.

          Hope this helps

          Dheerendra
          @Community Service
          Certified Qt Specialist
          http://www.pthinks.com

          1 Reply Last reply
          0
          • C Offline
            C Offline
            Czar05
            wrote on last edited by
            #5

            Sorry, I need some clarification on something, for number 1 you said I should go to the directory and run the qmake -project, which directory are you referring to? the gotocell folder that has the main.cpp and gotocelldialog.ui? Because besides those two items there is nothing there

            1 Reply Last reply
            0
            • dheerendraD Offline
              dheerendraD Offline
              dheerendra
              Qt Champions 2022
              wrote on last edited by
              #6

              yes. gotocelldialog dir

              Dheerendra
              @Community Service
              Certified Qt Specialist
              http://www.pthinks.com

              1 Reply Last reply
              0
              • C Offline
                C Offline
                Czar05
                wrote on last edited by
                #7

                You said run qmake -project, does that mean I should use the Qt command prompt because I have used it and nothing happens.

                I suppose if all else fails I will redo the all thing with Qt Creator.

                1 Reply Last reply
                0
                • JKSHJ Offline
                  JKSHJ Offline
                  JKSH
                  Moderators
                  wrote on last edited by
                  #8

                  Hi,

                  That book is very old now. Much of it is still relevant, but some of its advice (running qmake manually, editing code using an external text editor, etc.) isn't considered very productive anymore. Since you are using Qt Creator, it's a lot easier to let Qt Creator take care of qmake for you.

                  Click File -> New File or Project... -> Applications -> Qt Widgets Application

                  That will set up a project folder for you. You can then follow the tutorial from within Qt Creator.

                  Qt Doc Search for browsers: forum.qt.io/topic/35616/web-browser-extension-for-improved-doc-searches

                  1 Reply Last reply
                  0
                  • C Offline
                    C Offline
                    Czar05
                    wrote on last edited by
                    #9

                    Ya, Thanks for the help Dheerendra and JKSH,

                    I have decided to just use Qt Creator for all my needs instead of handling qmake manually and using external editors. Too many headaches.

                    Thanks again.

                    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