This extension is work in progress, so some command/settings can change over time.
This is NOT an official tool by The Qt Company!!
This is a Qt extension for VSCode. It is designed to be a similar tool to the Qt Visual Studio Tools from The Qt Company, but it tries to cooperate with other extensions for some functionality like e.g. debugging.
The extension supports Qt file location extractions via
PATH
environment variableChoosing a different Qt version from disk via this extension is not supported!
.ui
file in Qt Designer.ui
and .qrc
files can be opened in Qt Creator. You can also open the whole workspace in Qt Creator too.qttools.creator
settings if the extension can't find Qt Creator (for whatever reason)PATH
environment variablelaunch.json
file (per default). If you don't like that feature you can turn it of via qttools.injectNatvisFile
setting.qttools.visualizerFile
to a filepath or url (f.e. you can set qttools.visualizerFile
to the natvis file from the offical Qt Visual Studio Tools https://github.com/qt-labs/vstools/blob/dev/QtVsTools.Package/qt5.natvis.xml
). When you set an url, the extension will only download it ones and cache it and will use the cached local versioncmake
mode, because this extension extracts some data from it!The search mode defines how this extension search the Qt binaries like qmake, Qt designer and so on.
"qttools.searchMode": "cmake"
Extract the Qt file locations from the cmake cache (CMakeCache.txt
). The cmake build directory is extracted from the VSCode extension CMake Tools setting cmake.buildDirectory
.
You need to configure your project for the first time and afterwards every Qt tool is found automatically (when it is installed on your disk ;-) ) otherwise the launch of commands like Launch Qt Designer
will fail.
The benefit of this mode is that VSCode see the same Qt version as cmake is using, so it is automatically configured for you.
"qttools.searchMode": "path"
Search Qt in the PATH
environment variable like it is done in the terminal. This mode helpful when you have a system wide Qt installation like on Linux based operating systems.
You don't need to configure anything to be able to use the commands of this extension.
Scan for Qt kits
command in the command palette.launch.json
setting visualizerFile
from the C/C++ extension ). They work really well on windows, but on mac and linux there are some problems, because it is not based on the same implementation. If you have any problems with them create an issue on their issue tracker.The cmake.buildDirectory
from cmake tools
support variable substitution which looks like ${myvariable}
(example ${generator}
).
This extension supports every variable substitution from cmake tools
when the cmake tools
extension is installed and active.
If cmake tools
is not active the extension will fallback to the content of the cmake.buildDirectory
. In this mode only ${buildType}
, ${buildKit}
and ${workspaceFolder}
are supported variable substitutions!
The Qt online help can be used with this extension. Right now only the latest Qt 5 version will be searched.
You have 2 commands:
.cpp
or .h
file and your cursor is inside a text block then the command will search that word as a class in the documentation.By default the qt website will be opened inside VSCode itself.
The integrate webview has some limitations:
CTRL
+ F
does not work in many scenarios, see #96307CTRL
+ F
You can also turn of the embedded webview for the online help and use your external browser by setting the qttools.useExternalBrowser
to true
. Be aware that you will get a popup from VSCode which informs you about opening an external website. To avoid getting this popup every time just press on Configure Trusted Domains
and choose trust qt.io and all its subdomains
.
If you have problems with the extension just file a issue on GitHub. It's mostly a good idea to attach the log output of this extension to the issue. You can active the logger by adding "qttools.loglevel": "debug"
to your settings.json
file. Just copy the content of the Qt
output pane into your GitHub issue.
Pull requests are welcome :-D
MIT