Wizard fails to generate code
-
Hi all, very basic question here.
I am trying to follow the tutorial about making a Notepad app at http://doc.qt.io/qt-5/qtwidgets-tutorials-notepad-example.html.
I try to follow the steps exactly, but when I get to the Notepad Header File section, the Wizard has not created any of the code I expect. My application also doesn't have any of the buttons shown in the tutorial when I run it.
I'm using QT Creator 4.8.0. Can anyone guess what I've done wrong?
Thank you!
-
@efjellanger Hi and welcome? Did you install Qt? Are there any errors when you create your project? What is generated?
-
Yes, I have QT version 5.11.0 (which is the version used by a different project I am working on). The tutorial builds and runs just fine, but when it runs I get a window that looks very blank compared to what the tutorial shows. No File or Edit menu, no buttons below it. Just a text box.
-
Hi and welcome to devnet,
Did you create the GUI with Designer ?
-
@SGaist Yes, as I said, I followed these instructions:
http://doc.qt.io/qt-5/qtwidgets-tutorials-notepad-example.html
-
What code are you expecting to be generated ?
-
@SGaist
So right here it says "The wizard generated a header file for the Notepad class that has the necessary #includes, a constructor, a destructor, and the Ui object. The file looks as follows:"But the wizard didn't generate anything, my header file doesn't look as follows, it has almost nothing in it.
-
@efjellanger
Hi
The buttons and menus are first added in section
"Adding User Interaction"
So first after than your .h file will have
private slots:
void newDocument();
void open();
void save();
void saveAs();
void print();
void exit();
and the other elements.