QGIS support for 3D canvas is ready for testing. A possible hurdle in getting QGIS compiled with 3D support may be the fact that we require Qt in version at least 5.8 and it is recommended to use Qt 5.9 which introduces further enhancements. The current QGIS master branch (to be 3.0 release) is usually built against earlier versions of Qt. For example in Ubuntu 16.04, the default Qt package version is 5.5.
Continue reading for more detail on how to build QGIS with the latest Qt on Ubuntu …
Build of QGIS
The default Qt (from official repositories) on (K)Ubuntu 16.04 is too old and does not include the new Qt 3D framework.
We build QGIS with Qt 5.9.1. We are going to install QT to
/opt/Qt5.9.1/ and QGIS dependencies built with Qt5.9 to
so make sure you have these folders created and ready to use.
To add Qt 5.9.1, we can use a ppa:
1 2 3
This will install Qt 5.9.1 side-by-side your current system Qt under /opt folder. You can later remove the package without affecting dependencies in your system.
alternatively you can download QT 5.9.1 installer from http://download.qt.io/official_releases/qt/5.9/5.9.1/qt-opensource-linux-x64-5.9.1.run and install it to the same location.
Another dependency is Qwt. You can download the package and build it with Qt 5.9.1. To download the package, click here: https://sourceforge.net/projects/qwt/files/qwt/6.1.3/ Make a new folder and move the zip file there:
1 2 3 4 5
We need to define the prefix path. To do that, open
qwtconfig.pri in a text editor and change the prefix path:
QWT_INSTALL_PREFIX = /opt/qt59_libs/qwt-6.1.3 (more occurrences in the file!)
You can now compile the project:
1 2 3
Check if the library has been installed correctly:
Use the compressed file from here: https://www.riverbankcomputing.com/software/qscintilla/download
Download and copy to
1 2 3 4 5 6 7
You should now have the compiled qscintilla in the following path:
First clone (or add as another remote) QGIS fork
wonder-sk/QGIS and change branch to
1 2 3
Now you can follow standard instructions on QGIS repo for building the applications: https://raw.githubusercontent.com/qgis/QGIS/master/INSTALL
Once you have created the build directory (after step https://github.com/qgis/QGIS/blob/master/INSTALL#L266) you need to configure the cmake with the following options:
1 2 3 4 5 6 7 8 9 10 11 12 13 14
The new flag is WITH_3D=TRUE.
In the output, make sure it has found built libraries (NOT Qt 5.7 line)
1 2 3
Note that if you are using your own compiled version of GDAL, you need to define it using this flag:
If all dependencies are detected properly, you should be able to build QGIS using ninja:
To run QGIS from your build folder:
To verify that you are using the right version of QGIS, you can go to Help > About and check which version of Qt your application has been built against.
Loading the data
Now in QGIS, open 3D Canvas in menu:
View->New 3D Map View. For 3D styling of vector layers, open Layer Styling dock widget and enable 3D Renderer in the newly added tab with 3D cube icon.