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:
- Open this dev environment
- Create this type of project
- 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
- Open Qt Creator
- File->NewFile or Project
- Application->Widget Project
- Type any project name
- Next
- BaseClass - QWidget
- Uncheck "Generate Form"
- Done
Compile your project and n'joy.
-
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?
-
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.