Qt Creator is the Qt framework’s default built-in growth setting (IDE) and therefore the glue between Qt’s wealthy set of libraries and the consumer. In addition to its fundamental options comparable to clever code completion, debugging, and challenge administration, Qt Creator gives numerous good options that make software program growth simpler.
In this text, I’ll spotlight a few of my favourite Qt Creator options.
My first query when working with a brand new software is: Is there a darkish mode? Qt Creator solutions with: Which darkish mode do you favor?
You can activate darkish mode within the Options menu. On the highest menu bar, go to Tools, choose Options, and go to the Environment part. Here is the place you’ll be able to choose the overall look:
Like each Qt software, Qt Creator’s look is extremely customizable with fashion sheets. Below, you’ll be able to comply with together with my strategy to provide Qt Creator a flowery look.
Create the file
mycustomstylesheet.css with the next content material:
QMenu background-color : beige; coloration : black
Then begin Qt Creator from the command line and cross the fashion sheet as a parameter with:
It ought to appear like this:
Read extra about fashion sheets within the documentation.
Qt Creator accepts many command-line choices. For instance, if you wish to robotically load your present challenge at startup, cross the trail to the
You may even cross the file and the road quantity that must be opened by default. This command opens the file
foremost.cpp at line 20:
Read extra in regards to the Qt Creator-specific command-line choices within the documentation.
Qt Creator lets you outline a number of toolchains, referred to as Kits. A equipment defines the binaries and SDK for constructing and operating an software:
This lets you swap between fully completely different toolchains with simply two clicks:
Read extra about kits within the manual.
Qt Creator integrates a number of of the most well-liked analyzers, comparable to:
When it involves debugging, Qt Creator has a pleasant interface for GNU Debugger (GDB). I like its straightforward method of inspecting container sorts and creating conditional breakpoints:
If you want Vim, allow PretendVim within the settings to regulate Qt Creator like Vim. Go to Tools and choose Options. In the PretendVim part, you’ll find many switches to customise PretendVim’s habits. In addition to the editor features, you may as well map your personal features to customized Vim instructions.
For instance, you’ll be able to map the perform Build Project to the
Back within the editor, whenever you press the colon button and enter
construct, Qt Creator begins a construct course of with the configured toolchain:
You can discover extra details about PretendVim in the docs.
When growing in C++, open the proper window by clicking on the button within the bottom-right nook of Qt Creator. Then select Outline from the dropdown menu on the highest border. If you could have a header file open on the left pane, you get a pleasant overview of the outlined lessons or sorts. If you turn to a supply file (
*.cpp), the proper pane will record all outlined strategies, and you’ll bounce to 1 by double-clicking on it:
Qt Creator tasks are constructed across the
*.pro-file within the challenge’s listing. You can add your personal customized configuration to the challenge’s
*.pro-file of your challenge. I added
my_special_config to the
*.pro-file, which provides
MY_SPECIAL_CONFIG to the compiler outlined:
QT -= gui
CONFIG += c++11 console
CONFIG -= app_bundle
CONFIG += my_special_config
DEFINES += MY_SPECIAL_CONFIG
Qt Creator robotically highlights the code in accordance with the energetic configuration:
*.pro-file is written within the qmake language.
These options are solely the tip of the iceberg of what Qt Creator gives. Beginners should not really feel overwhelmed by the various options, as Qt Creator is totally beginner-friendly. It might even be the simplest option to begin growing in C++. To get an entire overview of its options, check with the official Qt Creator documentation.