Slajoc
Slajoc

Reputation: 59

Qt: .pro file missing?

I tried to create a C++ project with Qt I stumbled across different kinds of guides which all refer to a special '.pro' file inside the project where I have to adjust a setting so the SQL part takes effect.

My problem: whenever I create a new project - doesn't matter whether its with qbs, qmake, or cmake - the project structure/ folder is lacking the '.pro' file.

Currently I'm using Qt 5.15.2 (via QT Creator) with MinGW Kit and cmake/ qbs.

Current project path

As I'd like to play around with SQL-based apps.

Maybe I'm just skipping/ overlook something?

Upvotes: 2

Views: 7500

Answers (1)

TL;DR: Use cmake. Forget about qbs and qmake.

Whenever I create a new project - doesn't matter whether its with qbs, qmake, or cmake - the project structure/ folder is lacking the '.pro' file.

A qmake project will have the .pro file, since that's the project file for qmake. Maybe you're looking in a wrong place? A qbs project will have a .qbs file, since that's what qbs uses. A cmake project will have CMakeLists.txt, since that's what cmake uses. It all works for me.

I'm just confused by all these guides stating that I have to add QT += widgets sql in the .pro file.

Those guides only apply when you use qmake, since .pro are qmake project files.

I suggest that you use cmake, as qbs is abandoned now, and there's no benefit to using Qt-specific qmake over the widely supported and continuously developed cmake.

Qt documentation covers the basics of how to use cmake to build Qt projects.

Qt support is provided natively by cmake, and it thus provides a comprehensive reference page.

Upvotes: 4

Related Questions