HOW and WHERE do I start with the Hello Notepad example?



  • I am trying to get started with Qt programming, and have landed on the following page:
    https://qt-project.org/doc/qt-4.7/gettingstartedqt.html
    It sounds great, but it starts in the middle of the story.

    Exactly HOW and WHERE do I type in the code?
    Can I do this with Qt Creator?
    If so, what kind of project should I create?
    This code looks like C++, so do I need to create a new C++ file for it, or is that supposed to happen automatically if I select the right type of project?

    I need precise steps saying something like:

    1. Open this dev environment
    2. Create this type of project
    3. Add this type of file to it
      and so on.

    I'm sure this is very obvious to anyone who has been using this software for awhile, but to a complete novice it is anything but obvious.

    Note: I have a great deal of programming experience and don't have any difficulty with the code itself. The question is where to put it so that it will build and I can try it out. I'm also a multiply published author who has a lot of experience explaining things to people who don't already know them, so I realize that it is often difficult for an experienced person to realize what things are not obvious to people who don't have that experience.

    Thanks.



  • Welcome to the forum

    1. Open Qt Creator
    2. File->NewFile or Project
    3. Application->Widget Project
    4. Type any project name
    5. Next
    6. BaseClass - QWidget
    7. Uncheck "Generate Form"
    8. Done

    Compile your project and n'joy.


  • Lifetime Qt Champion

    Hi and welcome to devnet,

    To add to Dheendra, you should also take a more recent version of the documentation and example. Qt 4.7 is pretty old, you should match the version you installed



  • Thanks, I'll look for a newer version. I have installed Qt Creator 3.2.1, which says it is based on Qt 5.3.2.

    However, there is no "Widget Project" listed under "Applications" (not "Application"). I tried "Qt Widgets Application" but it doesn't look very similar to the example. Which type of project should I use?


  • Lifetime Qt Champion

    You took the correct project. However, don't block on the look of the widget/window. If I'm not mistaken the style of the widgets comes from an old version of KDE 4 maybe even 3.



  • Never mind, I think I know what's wrong.



  • Never mind. See post above.


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.