PDA

View Full Version : "Creating a Qt Widget Based Application"



mdavidjohnson
22nd August 2016, 14:00
Being a complete newbie (I'm using Qt Creator 4.02 with Qt 5.7.0 [32-bit msvc2015] on Windows 7 Pro 64-bit SP1), I decided to start with "Creating a Qt Widget Based Application" at doc.qt.io/qtcreator/creator-writing-program.html .

Unfortunately, when I get to the step:

-----

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

QMetaObject::connectSlotsByName(TextFinder);

-----

there appears to be no ui_textfinder.h file in my project.

Also, at steps:

-----

5. Select Add > Add Prefix.
6. In the Prefix field, replace the default prefix with a slash (/).
7. Select Add > Add Files, to locate and add input.txt.

-----

there appears to be no "Add" in either the menu or any of the context popups in the code editor.

The project compiles, but (after entering a keyword in the lineEdit) clicking the Find button seems to do nothing.

What am I missing?

Lesiok
22nd August 2016, 14:21
ui_*.h files are auto generated from *.ui files in building process.

mdavidjohnson
22nd August 2016, 20:15
ui_*.h files are auto generated from *.ui files in building process.

Thank you -

Why then does the ui_textfinder.h file not show up in the list of files after the successful build?

And, where is the "Add" button/menu item/popup/whatever in the code editor?

anda_skoa
23rd August 2016, 09:49
The generated files are just build artefacts, like the object file for each C++ source file.

There is no need to pollute the object tree with those, since not relevant for the programmer as such.

As for the "Add" button of the resource editor: http://doc.qt.io/vs-addin/vs-addin-managing-resources.html

Cheers,
_