Results 1 to 7 of 7

Thread: Example code doesn't match help provided

  1. #1
    Join Date
    Oct 2011
    Posts
    2
    Qt products
    Qt4
    Platforms
    Windows

    Question Example code doesn't match help provided

    As a complete beginner to Qt, I have Qt Creator installed. The main screen gives a very simple example of how to create and then extend a simple application. The only problem I have is that when I follow the instructions I get a 'Hello World' application that bears no relationship to the example being explained, and the remaining instructions are just meaningless.
    I would like to see the code that generates squares with Qt in it, but the example doesn't do that.
    I have a background in C, I have been learning C++ for a while. I have Visual Studio 2010 C++ Express that does some of what I want, but the full .NET application seems unduly complex (and I couldn't afford a license, in any case). This is why I am looking into Qt, and it would help to have some help that actually matches the code that is generated.
    Can someone please point me in the correct direction?
    (I am only interested in desktop applications at this time)

  2. #2
    Join Date
    Sep 2009
    Location
    Wroclaw, Poland
    Posts
    1,394
    Thanked 342 Times in 324 Posts
    Qt products
    Qt4 Qt5
    Platforms
    MacOS X Unix/X11 Windows Android

    Default Re: Example code doesn't match help provided

    Can someone please point me in the correct direction?
    It will be difficult, because, personally, I think your post is too general and quite confusing. I guess this could be a good starting point : http://qt.nokia.com/learning/online/training
    Be more specific, then it'll be easier to help.

  3. #3
    Join Date
    Feb 2008
    Posts
    491
    Thanks
    12
    Thanked 142 Times in 135 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11

    Default Re: Example code doesn't match help provided

    In addition to stampede's link, you might try this:

    Start Qt Creator.
    Select "Getting Started"
    Next to "Explore Qt C++ examples:", click on the "Choose an Example" combo box.

    You should get a popup menu with the list of example projects. I don't know which example "generates squares with Qt in it". Maybe Animation Framework -> Animated Tiles? Although you should probably start with something simpler like Widgets -> Digital Clock.

    HTH
    Norm

  4. #4
    Join Date
    Mar 2009
    Location
    Brisbane, Australia
    Posts
    7,729
    Thanks
    13
    Thanked 1,610 Times in 1,537 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows
    Wiki edits
    17

    Default Re: Example code doesn't match help provided

    A veritable smorgasbord of tutorials and examples are trivially located in the documentation that comes with Qt. Typically there are many built demo programs accessible by running qtdemo, most of which link to a relevant part of the documentation that comes with Qt. You should also take the advice of the How to Learn Qt pages in the documentation. All of this documentation is also installed with Qt: just run assistant or access it (in slightly different arrangement) through Qt Creator (press Ctrl-6).

    BTW: I think the reference to "generates squares with Qt in it" is to this: Icons Example
    Last edited by ChrisW67; 31st October 2011 at 22:09.

  5. #5
    Join Date
    Apr 2010
    Posts
    769
    Thanks
    1
    Thanked 94 Times in 86 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11

    Default Re: Example code doesn't match help provided

    You do realize that several of the example programs that ship with Qt are implemented across several files, not just one, right? It would be helpful if you bothered mentioning exactly which example it is you're talking about, what your expectations for it were and how they differ from the source code you're looking at.

  6. #6
    Join Date
    Oct 2011
    Posts
    2
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Example code doesn't match help provided

    Firstly, thanks to ChrisW67 for a sensible response.
    Let's get something straight. I am not stupid. I have been in this game for a very long time. In fact, I have lost count of the languages, operating systems, hardware (and applications) that I have learnt over the years.
    I suppose I am going to have to do it in pictures for stampede, norobro and Six Degrees.
    When I open Qt Creator I get screen qt1.jpg.
    When I click on Building and Running an Example Application I get qt2.jpg
    When I click on Show Examples and Demos, I only get three additional entries qt3.jpg
    When I click on Create a Qt Quick Application I get qt4.jpg and qt5.jpg
    When I follow the instructions shown I get the code in qt6.jpg and a window qt7.jpg comes up which does NOT match the information given in the right hand pane!
    That's what I'm complaining about!
    (Look like I need a second post to get 6 and 7 in)
    Attached Images Attached Images

  7. #7
    Join Date
    Mar 2009
    Location
    Brisbane, Australia
    Posts
    7,729
    Thanks
    13
    Thanked 1,610 Times in 1,537 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows
    Wiki edits
    17

    Default Re: Example code doesn't match help provided

    Unfortunately (annoyingly IMHO) every version of Qt Creator has changed the arrangement of the Welcome screen. Each Qt release of late has added more QML examples. My version doesn't quite match yours and I cannot find the example you are after. They should all be accessible by searching in Assistant (or the Qt Creator Help page) and most visible in qtdemo.

    If the instructions in the Getting Started material are broken in the current Qt Creator/Qt then you should report it as a bug (https://bugreports.qt.nokia.com/secure/Dashboard.jspa).

Similar Threads

  1. Replies: 2
    Last Post: 2nd August 2011, 15:05
  2. Replies: 6
    Last Post: 29th October 2010, 22:14
  3. Replies: 1
    Last Post: 2nd June 2010, 16:14
  4. Replies: 2
    Last Post: 25th April 2009, 08:50
  5. Why this code doesn't work?
    By prykHetQuo in forum Qt Programming
    Replies: 2
    Last Post: 11th February 2009, 19:08

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Qt is a trademark of The Qt Company.