Uploaded image for project: 'Qt Creator'
  1. Qt Creator
  2. QTCREATORBUG-1934

Several issues with tutorial "Creating a Qt C++ Application"

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • P2: Important
    • Qt Creator 2.0.1
    • Qt Creator 2.0.0
    • Documentation
    • None
    • 557572bb4d1bc9c0f8c8426fee7b7bbcaad0bdcd

    Description

      There are several issues with the tutorial "Creating a Qt C++ Application" that may confuse first-time users. I've added them all in a single issue report because I think it will make it much easier to fix them as well as to report them like this.

      My issues are in bullets after quotes of the tutorial text. Some comments are very cosmetic but make the tutorial a lot harder to follow than necessary.

      Creating the Text Finder Project
      Note: Create the project with the Help mode active so that you can follow these instructions while you work.

      • When you create the project in Help mode, you can't scroll down the Tutorial while the dialogs are open. So you only see one screen-full of instructions but need more than one to complete the set of dialogs
      • Solution: Open two instances of Qt Creator instead and use one in Help mode to follow the tutorial instructions. That's what I did.

      1. Select File > New File or Project > Qt Application Project > Qt Gui Application > Choose.

      • In fact File > New File or Project > Qt C++ Project > Qt Gui Application > Choose.

      3. In the Create in field, enter the path for the project files. For example, C:\Qt\examples, and then click Next

      • Probably should suggest C:\Qt\myProjects - or similar - instead (and it should be created automatically if it doesn't exist). I'd expect C:\Qt\examples to be reserved for the official, released Qt examples, and users wants to be able to find their own projects easily in future.

      3. ... The Select Required Qt Versions dialog opens.

      • It didn't show this dialog for me

      8. Select the screen area and click Lay out Vertically (or press Ctr+V) to apply a vertical layout (QVBoxLayout)

      • Should be "Ctrl" not "Ctr""
      • In fact Ctrl+L for "Lay out vertically"

      Completing the Header File
      1. In the Projects view, double-click the textfinder.h file to open it for editing.

      • In fact this is the 'Edit' view

      2. Add a private function to the private section, after the Ui::TextFinder function, as illustrated by the following code snippet
      private slots:
      void on_findButton_clicked();
      private:
      Ui::TextFinder *ui;
      void loadTextFile();

      • Ui::TextFinder is a pointer not a function
      • For consistency with actual code that has been generated it should be in the order:
      private:
      Ui::TextFinder *ui;
      void loadTextFile();
      private slots:
      void on_findButton_clicked();

      Completing the Source File
      ...
      In the Projects view, double-click the textfinder.cpp file to open it for editing.

      • In fact this is the 'Edit' view

      2. ... This is illustrated by the following code snippet:

      • The text "following snippet" is badly positioned on the page, at the bottom of the code block. Same problem with some later snippets - e.g. point 4. below.

      4. ...
      ui->textEdit->find(searchString, QTextDocument::FindWholeWords);

      • This should probably not use QTextDocument::FindWholeWords). The reader may well try to find a part of a word when running the app, and will be surprised when it isn't found. It surprised me, until I read the code.

      The on_findButton_clicked() slot is called automatically in the uic generated ui_textfinder.h file by this line of code

      • This line is cryptic to the reader. Isn't this part of the internal implementation of slots which doesn't need to be mentioned here?
      • Can't see ui_textfinder.h in the 'Edit' view.
      • Has uic been described before this point in the tutorial? Also part of internal implementation?

      7. Select Add > Add Files, to locate and add input.txt.

      • Can't locate input.txt. Where is it?
      • I found "C:\Qt\2010.04\qt\examples\uitools\textfinder\forms\input.txt" but the tutorial shouldn't refer to that.
      • Instead either tell the user to create the file in the TextFinder directory or tell them where to find it
      • I created an input.txt in the TextFinder directory myself.

      to compile your program.

      • Should say "to compile and run your program".

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            leenam Leena Miettinen
            howprice Howard Price
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes