Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Unsolved

    Oddities in "Getting Started Programming with Qt"

    Wiki Discussion
    13
    26
    18559
    Loading More Posts
    • 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.
    • M
      mgran last edited by

      Thank you Volker, excellent feedback.

      I'll make sure the Doc team gets it.

      Project Manager - Qt Development Frameworks

      1 Reply Last reply Reply Quote 0
      • G
        goetz last edited by

        I found another one:

        Subclassing QWidget not complete
        The header file contains a quit() slot which is actually not implemented. Also, the modified main.cpp is missing, so the example cannot be compiled.

        The missing code:

        from notepad.cpp:

        @
        void Notepad::quit()
        {
        if( QMessageBox::question(
        this,
        tr("Quit?"),
        tr("Do you really want to quit the Notepad?"),
        QMessageBox::Yes | QMessageBox::No,
        QMessageBox::No
        ) == QMessageBox::Yes
        )
        {
        qApp->quit();
        }
        }
        @

        main.cpp:

        @
        #include <QtGui>
        #include "notepad.h"

        int main(int argv, char **args)
        {
        QApplication app(argv, args);

        Notepad window;
        window.show();
        
        return app.exec();
        

        }
        @

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

        1 Reply Last reply Reply Quote 0
        • G
          goetz last edited by

          There's a ticket "QTWEBSITE-163":http://bugreports.qt.nokia.com/browse/QTWEBSITE-163 for this now.

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

          1 Reply Last reply Reply Quote 0
          • D
            dangelog last edited by

            Bugs in Qt documentation should be filed against QTWEBSITE or against Qt itself? I'd say the latter, because the documentation is also shipped offline (in assistant / html).

            [Edited to add]: or, of course, Trolls can add a QTDOCS category for bugs in the "official" Qt documentation...

            Software Engineer
            KDAB (UK) Ltd., a KDAB Group company

            1 Reply Last reply Reply Quote 0
            • G
              goetz last edited by

              I would file against QTWEBSITE and choose doc.qt.nokia.com as the "project" for the issue. Marius did not veto against that for another one ("QTWEBSITE-161":http://bugreports.qt.nokia.com/browse/QTWEBSITE-161) - so it seems ok :-)

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

              1 Reply Last reply Reply Quote 0
              • M
                mgran last edited by

                [quote author="Volker" date="1294157071"]I would file against QTWEBSITE and choose doc.qt.nokia.com as the "project" for the issue.[/quote]

                This is the correct way. When you create the bug report -> just start typing "doc" in the field called "Component/s" and it pops up:

                !http://developer.qt.nokia.com/uploads/image_upload/mariusg_2011-01-04_000192.png(bugreport)!

                Project Manager - Qt Development Frameworks

                1 Reply Last reply Reply Quote 0
                • M
                  mohsen last edited by

                  Congrats! Make an article and teach us German first. lol

                  1 Reply Last reply Reply Quote 0
                  • M
                    mgran last edited by

                    [quote author="mohsen" date="1294168643"]Congrats! Make an article and teach us German first. lol[/quote]

                    I'm not sure I understand, care to elaborate?

                    Project Manager - Qt Development Frameworks

                    1 Reply Last reply Reply Quote 0
                    • G
                      goetz last edited by

                      [quote author="mohsen" date="1294168643"]Congrats! Make an article and teach us German first. lol[/quote]

                      Do I have missed something?

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

                      1 Reply Last reply Reply Quote 0
                      • M
                        mohsen last edited by

                        No Volker! just kidding. You did your best. Thank you very much :)

                        1 Reply Last reply Reply Quote 0
                        • B
                          Bertus last edited by

                          In the section "Using a QMainWindow" there are a few typo's in the 2nd code snippet:

                          @
                          Notepad::Notepad()
                          {
                          saveAction = new QAction(tr("&Open"), this);
                          saveAction = new QAction(tr("&Save"), this);
                          exitAction = new QAction(tr("E&xit"), this);
                          ...
                          connect(exitAction, SIGNAL(triggered()), qApp, SLOT(quit()));
                          ...
                          @

                          Which should be:

                          @
                          Notepad::Notepad()
                          {
                          openAction = new QAction(tr("&Open"), this);
                          saveAction = new QAction(tr("&Save"), this);
                          exitAction = new QAction(tr("&Exit"), this);
                          ...
                          ...
                          connect(exitAction, SIGNAL(triggered()), this, SLOT(quit()));
                          ...
                          @

                          connect(exitAction, SIGNAL(triggered()), qApp, SLOT(quit())); also works, but then QT's standard quit()-function is used, not the one with the confirmation window (QMessageBox) that Volker posted earlier.

                          1 Reply Last reply Reply Quote 0
                          • N
                            nonot1 last edited by

                            As a new user, my first attempt at trying Qt was "Getting Started Programming with Qt". It seemed like a reasonable choice given the title. :-)

                            I've had much trouble given the subtle errors (and errors by omission) in the document, and now I have a rather involuntary bad taste for Qt.

                            The very first document your website recommends reading should be much higher quality. :)

                            At the very least, test all the steps on a fresh install of Qt on popular newbie platforms. (Windows, Mac, and Ubuntu come to mind)

                            Thank you

                            1 Reply Last reply Reply Quote 0
                            • T
                              troubalex last edited by

                              @nonot1: I have passed your points on to our documentation team. I'm sure they will look into the issues. I assume you have used the latest version of the docs?

                              THE CAKE IS A LIE
                              Web Community Manager - Qt Development Frameworks

                              1 Reply Last reply Reply Quote 0
                              • N
                                nonot1 last edited by

                                @Alexandra : Thank you for sending this to the doc team.

                                Also, the tutorial tells you to use the "make" command, but this is missing from the Qt SDK 1.1 RC installed environment. Dunno if that's correct or not. Seems wrong, though. Tested on Windows 7, using the "Qt 4.7.3 for Desktop (MinGW)" command prompt window. This should be fixed, or if it's not a bug, spoken about in the tutorial.

                                (By searching the /bin folder, I found "mingw32-make.exe"... annoying to type, but that seemed to work.)

                                The final as-built applications also only work when instantiated via the development command line window. I assume it's a DLL linking issue, but no mention is made in the tutorial on how to fix this. So, how am I supposed to share my new text-edit application with friends? ;-) This should be spoken about in the tutorial.

                                Thank you

                                1 Reply Last reply Reply Quote 0
                                • G
                                  giesbert last edited by

                                  Hi nonot1,

                                  the make command you need, depends on the tool-chain you use. On windows, this is typically mingw (mingw32-make.exe) or MSVS (nmake).

                                  For linux using gcc it's make.

                                  Regarding the start of the app, the dlls need to be found. On windows, thats is done in the following way:

                                  Look in the executable dir

                                  look in the current dir

                                  look inside windows system dir

                                  search the %PATH% environment variable for it

                                  On Linux, it's different (but I'm not sure, how), also for Mac.

                                  What works for windows, copy the dlls to the executable :-)
                                  This is also stated in the docs for "distributing":http://doc.qt.nokia.com/4.7/deployment.html

                                  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 Reply Quote 0
                                  • N
                                    nonot1 last edited by

                                    Hi Gerolf,

                                    Thank you for clearing up those points. (And providing background justification)

                                    As I said, I did eventually figure our how to build and run the application, but the main issue is that the introduction tutorial does not even mention these issues. (Aside from other errors covered earlier in this thread.)

                                    Not to get the thread off-topic, but there should also be a simple introductory level how-to for using the QtSDK, and it's supplied MinGW tool-chain, to generate size-minimized "single .exe" Qt applications.

                                    1 Reply Last reply Reply Quote 0
                                    • G
                                      goetz last edited by

                                      The size minimize singele .exe can be achieved by using static libs. But this approach is discouraged due to causing problems with plugins and the like. Additionally, if you use WebKit you must use dynamic libs, it's not supported with static linking.

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

                                      1 Reply Last reply Reply Quote 0
                                      • N
                                        nonot1 last edited by

                                        @Alexandra

                                        Quick question.....

                                        Some of the issues I had were due to rough edges in the 1.1 RC SDK install.

                                        Where is the correct place to ask about these?

                                        1 Reply Last reply Reply Quote 0
                                        • V
                                          vcsala last edited by

                                          [quote author="nonot1" date="1304358997"]
                                          @Alexandra

                                          Quick question.....

                                          Some of the issues I had were due to rough edges in the 1.1 RC SDK install.

                                          Where is the correct place to ask about these?
                                          [/quote]

                                          Just for future reference: you can send a personal message to a person by using the link on her/his profile page

                                          1 Reply Last reply Reply Quote 0
                                          • A
                                            andre last edited by

                                            I think it is usually good form to keep the discussion on the (public) forum, even if you address one person in particular. That way, also others have the opportunity to answer as well as learn from that answer.

                                            Like in this case, I might answer - even though my name is not Alexandra - : the right place would be in the Installation and Deployment forum :-)

                                            1 Reply Last reply Reply Quote 0
                                            • First post
                                              Last post