Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Behind the Scenes
  3. Wiki Discussion
  4. Oddities in "Getting Started Programming with Qt"

Oddities in "Getting Started Programming with Qt"

Scheduled Pinned Locked Moved Wiki Discussion
26 Posts 13 Posters 21.4k 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.
  • M Offline
    M Offline
    mgran
    wrote on 1 Nov 2010, 17:35 last edited by
    #2

    Thank you Volker, excellent feedback.

    I'll make sure the Doc team gets it.

    Project Manager - Qt Development Frameworks

    1 Reply Last reply
    0
    • G Offline
      G Offline
      goetz
      wrote on 8 Dec 2010, 13:42 last edited by
      #3

      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
      0
      • G Offline
        G Offline
        goetz
        wrote on 4 Jan 2011, 15:33 last edited by
        #4

        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
        0
        • D Offline
          D Offline
          dangelog
          wrote on 4 Jan 2011, 16:01 last edited by
          #5

          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
          0
          • G Offline
            G Offline
            goetz
            wrote on 4 Jan 2011, 16:04 last edited by
            #6

            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
            0
            • M Offline
              M Offline
              mgran
              wrote on 4 Jan 2011, 16:22 last edited by
              #7

              [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
              0
              • M Offline
                M Offline
                mohsen
                wrote on 4 Jan 2011, 19:17 last edited by
                #8

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

                1 Reply Last reply
                0
                • M Offline
                  M Offline
                  mgran
                  wrote on 4 Jan 2011, 19:21 last edited by
                  #9

                  [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
                  0
                  • G Offline
                    G Offline
                    goetz
                    wrote on 4 Jan 2011, 19:23 last edited by
                    #10

                    [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
                    0
                    • M Offline
                      M Offline
                      mohsen
                      wrote on 4 Jan 2011, 20:34 last edited by
                      #11

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

                      1 Reply Last reply
                      0
                      • B Offline
                        B Offline
                        Bertus
                        wrote on 6 Mar 2011, 11:42 last edited by
                        #12

                        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
                        0
                        • N Offline
                          N Offline
                          nonot1
                          wrote on 21 Apr 2011, 19:46 last edited by
                          #13

                          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
                          0
                          • T Offline
                            T Offline
                            troubalex
                            wrote on 26 Apr 2011, 11:34 last edited by
                            #14

                            @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
                            0
                            • N Offline
                              N Offline
                              nonot1
                              wrote on 28 Apr 2011, 17:20 last edited by
                              #15

                              @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
                              0
                              • G Offline
                                G Offline
                                giesbert
                                wrote on 28 Apr 2011, 19:21 last edited by
                                #16

                                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
                                0
                                • N Offline
                                  N Offline
                                  nonot1
                                  wrote on 28 Apr 2011, 20:04 last edited by
                                  #17

                                  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
                                  0
                                  • G Offline
                                    G Offline
                                    goetz
                                    wrote on 28 Apr 2011, 22:10 last edited by
                                    #18

                                    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
                                    0
                                    • N Offline
                                      N Offline
                                      nonot1
                                      wrote on 2 May 2011, 17:56 last edited by
                                      #19

                                      @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
                                      0
                                      • V Offline
                                        V Offline
                                        vcsala
                                        wrote on 2 May 2011, 17:58 last edited by
                                        #20

                                        [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
                                        0
                                        • A Offline
                                          A Offline
                                          andre
                                          wrote on 2 May 2011, 20:56 last edited by
                                          #21

                                          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
                                          0

                                          • Login

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