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. Application instructions
Forum Updated to NodeBB v4.3 + New Features

Application instructions

Scheduled Pinned Locked Moved General and Desktop
9 Posts 4 Posters 3.6k 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.
  • C Offline
    C Offline
    croussou
    wrote on last edited by
    #1

    Hi there,

    I am following this book C++ GUI Programming with Qt 4, Second Edition and I am stuck somewhere. Would appreciate it if you could have a look here and let me know.

    It says,

    Save the dialog as gotocelldialog.ui in a directory called gotocell (is that a new Qt project name or just a normal folder), and create a main.cpp file in the same directory using a plain text editor:
    @
    #include <QApplication>
    #include <QDialog>

    #include "ui_gotocelldialog.h"

    int main(int argc, char *argv[])
    {
    QApplication app(argc, argv);

    Ui::GoToCellDialog ui;
    QDialog *dialog = new QDialog;
    ui.setupUi(dialog);
    dialog->show();
    
    return app.exec&#40;&#41;;
    

    }
    @
    This part is the most hard,

    Now run qmake to create a .pro file and a makefile (qmake -project; qmake gotocell.pro). The qmake tool is smart enough to detect the user interface file gotocelldialog.ui and to generate the appropriate makefile rules to invoke uic, Qt's user interface compiler. The uic tool converts gotocelldialog.ui into C++ and puts the result in ui_gotocelldialog.h.

    Where do I need to run qmake? In command prompt? If so what should be the filename? qmake <filename>

    In the folder I have only,

    gotocelldialog.ui and main.cpp

    Thank you in advance.

    Regards,

    croussou

    1 Reply Last reply
    0
    • S Offline
      S Offline
      Scylla
      wrote on last edited by
      #2

      Yes in a cmd/console. You can specify with "-o filename" a filename. Otherwise qmake creates one.

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

        qmake gotocelldialog.ui

        qmake main.cpp

        or

        qmake <folder name>

        Regards,

        croussou

        1 Reply Last reply
        0
        • S Offline
          S Offline
          Scylla
          wrote on last edited by
          #4

          qmake -project -o filename

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

            just as written in the book:

            @
            qmake -project
            @

            it will create a project file with the name of the folder. Thats why the folder name was given in the book.

            If you follow the instructions, it works. The only thing that is missing is:
            Open a conmmand shell and navigate to the created directory. There call....

            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
            • C Offline
              C Offline
              croussou
              wrote on last edited by
              #6

              Works perfectly indeed. I noticed also I was using wrong command prompt.

              Thanks a lot guys.

              But in truth, what's the point of this? I mean, you can always use the Qt Creator and Add New Project right?

              Regards,

              croussou

              1 Reply Last reply
              0
              • M Offline
                M Offline
                mlong
                wrote on last edited by
                #7

                You can, indeed. Remember, though, that Qt Creator is a relatively new asset in the Qt toolbox. Before we had the luxury of Creator's integrated project management features, qmake -project was pretty much the de facto standard for getting a project started.

                Software Engineer
                My views and opinions do not necessarily reflect those of anyone -- living or dead, real or fictional -- in this universe or any other similar multiverse node. Void where prohibited. Your mileage may vary. Caveat emptor.

                1 Reply Last reply
                0
                • C Offline
                  C Offline
                  croussou
                  wrote on last edited by
                  #8

                  Right, well this sounds reasonable.

                  Thanks everyone for your replies. Problem solved now and I can continue with the book.

                  Regards,

                  croussou

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

                    Qt creator came with Wt 4.6 I think. Afaik, the book is assigned to Qt 4.3. But everything he describes should also work with 4.7. There are only more features there.

                    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

                    • Login

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