In this post I want to share a small command line tool with you, which is able to automatically generate Qt Creator projects from Unreal Projects.
I also wrote a small tutorial (partially based on Antares’ tutorial) which covers initial setup of Qt Creator for Unreal development, usage of my tool and (optionally) doxygen help generation for the Unreal Engine classes.
EDIT: Tool now open-source, available on GitHub
As some of you may have noticed, Visual Studio 2013/2015 (in particular the default IntelliSense auto completion) performs pretty badly when it comes to C++ development with huge codebases (like the Unreal Engine), unless you use something like VisualAssistX (which is not free).
To address this issue, Antares created a nice tutorial (Link | Wiki) on how to manually create a Qt Creator project for Unreal game logic development a few months ago.
Qt Creator is a C++ IDE, which is written in native C++.
Some advantages over vanilla Visual Studio:
- Fast auto completion
- Fast go to declaration
- Refactoring support
- Doxygen documentation sidebar
This tool allows you to take advantage of Qt Creator without having to bother with manual creation of projects files.
In theory it should work with any version of Unreal Engine 4. You just have to rerun it whenever you upgrade your project to a new version.
- Visual Studio 2013/2015 (Express / Community / Professional)
- Unreal Engine 4
- .Net Framework 4.0 Client Profile
- Windows, 64-Bit
The tool can generate .pro files with:
- Configuration for Unreal Engine development (C++11 support, no Qt)
- All your current source and header files (+ build.cs) included
- All Unreal Engine defines and includes added
- 5 different build and launch targets, which are included in the Visual Studio project file (Debug game, Development Editor, Shipping, etc…)
Here is the link to the GitHub page for download (for usage tutorial with instructions see below)
I cannot guarantee that there are no bugs.
I have tested the tool on two different computers with one small project, some templates and under the following configurations
- Windows 8.1 64 bit
- Unreal Engine 4.6/4.7/4.8/4.9/4.13
- Visual Studio 2013 Community Update 4 / Visual Studio 2015 Community Update 3
- Qt 5.4/5.5/5.7 and Qt Creator 3.3.0/3.5.0/4.1.0.
By downloading this tool you accept that I am not liable for any damage caused by the use of this tool.
**+++ DOWNLOAD LINK +++ **
Instructions (Partially based on Antares’ tutorial)
These steps you only have to do once
- Download Qt 5.x (Link), Debugging Tools for Windows (part of Windows SDK, Link) and my Qt Project Generator Tool (download link above)
- Run Windows SDK installer (you only have to install Debugging Tools)
- Install Qt, during installation depending on your Visual Studio version select either “msvc2013 64-bit" or “msvc2015 64-bit” under “Qt\Qt 5.x” (where x = latest version, tested with 5.7)
- Now you have to configure the debugger. Open Qt Creator, go to “tools/options/Build & Run/Debugger”, click “add” and fill out the details according to this screenshot:
- Next go to “tools/options/Debugger”. In the “CDB” tab tick “ignore first chance access violations”. In the “CDB Paths” tab insert the following paths (replace <YOUR USERNAME> by your actual windows username):
symsrv*symsrv.dll*C:\Users\<YOUR USERNAME>\AppData\Local\Temp\symbolcache cache*cache*C:\Users\<YOUR USERNAME>\AppData\Local\Temp\symbolcache
- IMPORTANT, when you debug a project for the first time, Qt Creator asks whether it should use Microsoft Symbol Server. Untick the corresponding checkbox (Otherwise it will get symbol data from the internet which can be very slow).
For the original debugger setup tutorial from Antares see [Link](https://wiki.unrealengine.com/Using_QtCreator_With_UnrealEngine4#Setting_up_the_debugger_for_Qt_Creator).
- Next you have to configure a new build kit. Go to “tools/options/Build & Run/Kits”. Click “add” and adjust the new configuration to match this screenshot
UPDATE: If you use Visual Studio 2015 you should select Visual C++ 14.0 (amd64) under Compiler and Qt 5.x.x MSVC2015_64bit under Qt version
- UPDATE: If you are using QtCreator >= 4.7 or have manually enabled “Clang code model” you might experience very slow or unreliable autocompletion. Clang code model offers many advantages over the legacy built-in code model (see link), but on most systems it doesn’t perform well enough to handle UE’s complex codebase. So if you have issues with completion I recommend turning off “Clang code model”.
This can be done globally by disabling the "ClangCodeModel" plugin in QtCreator under Help -> About Plugins -> C++.
The following steps have to be performed every time you create a new project or if you upgrade your project to a new Unreal Engine version.
- Run my tool and follow the instructions, the generated project file is stored in the directory <YOUR PROJECT>\Intermediate\ProjectFiles
- Done, happy coding If you want to build or run the project you can just use the preconfigured build / launch targets (you can switch the target in the bottom left corner).
Targets are the same as in Visual Studio, just remember to always switch both, the compile and the launch target.
If you want to use a standalone target, you have to make sure your content is already cooked. You can cook by building once with the “Cook” build target.
OPTIONAL (but recommended): If you also want nice documentation for the engine within Qt Creator (hover over symbol and hit F1 to display Doxygen inside Qt Creator), here is a quick tutorial:
- Install Doxygen (Link), make sure the Doxywizard GUI is selected during installation
- Open Doxywizard, choose a working directory (doesn’t really matter what you select, as we don’t use relative paths) and go to the “Expert” tab
- Configure Doxywizard according to the screenshots (you can do this for any engine version of course, I chose 4.6 just as an example. Also the Qt path may vary depending on your Qt version)
- When you are done, go to the “Run” tab and hit “Run doxygen”, this will take some time.
- When generation is finished, shift right-click inside the “html” folder of the Doxygen output and select “open command window here”
- Drag and drop qhelpgenerator.exe from your “<QT_Installation>\5.x<your qt msvc kit>\bin” folder into the command window
- Insert the command “ index.qhp -o UnrealEngine.qch” and hit enter
- When the qch file is generated, open Qt Creator and add your .qch file under “Tools\Options\Help\Documentation”