Skip to content

Commit

Permalink
Speed up QGIS compilation by removing all Qt Module-wide includes
Browse files Browse the repository at this point in the history
  • Loading branch information
nyalldawson committed Mar 5, 2021
1 parent 9c721a6 commit c6370c7
Show file tree
Hide file tree
Showing 299 changed files with 532 additions and 48 deletions.
8 changes: 8 additions & 0 deletions .github/workflows/code_layout.yml
Expand Up @@ -99,6 +99,14 @@ jobs:
- name: No brace initialization of QVariant variables
run: ./tests/code_layout/test_qvariant_no_brace_init.sh

qt_module_wide_imports:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: No module-wide imports of Qt modules
run: ./tests/code_layout/test_qt_imports.sh

doxygen_layout_check:
runs-on: ubuntu-latest
steps:
Expand Down
Expand Up @@ -11,6 +11,7 @@




class QgsAnnotation : QObject
{
%Docstring
Expand Down
Expand Up @@ -9,6 +9,7 @@




class QgsFileDownloader : QObject
{
%Docstring
Expand Down
Expand Up @@ -10,7 +10,6 @@




class QgsFetchedContent : QObject
{
%Docstring
Expand Down
Expand Up @@ -11,6 +11,7 @@




class QgsProcessingContext
{
%Docstring
Expand Down
1 change: 1 addition & 0 deletions python/core/auto_generated/qgspointlocator.sip.in
Expand Up @@ -16,6 +16,7 @@




class QgsPointLocator : QObject
{
%Docstring
Expand Down
1 change: 1 addition & 0 deletions python/core/auto_generated/qgsproxyprogresstask.sip.in
Expand Up @@ -9,6 +9,7 @@




class QgsProxyProgressTask : QgsTask
{
%Docstring
Expand Down
1 change: 1 addition & 0 deletions python/core/auto_generated/qgssourcecache.sip.in
Expand Up @@ -10,6 +10,7 @@




class QgsSourceCache : QgsAbstractContentCacheBase
{
%Docstring
Expand Down
Expand Up @@ -10,6 +10,7 @@




typedef QMap<QString, QString> QgsStringMap;
typedef QMap<QString, QgsSymbol * > QgsSymbolMap;

Expand Down
Expand Up @@ -10,6 +10,7 @@




class QgsVectorLayerExporter : QgsFeatureSink
{
%Docstring
Expand Down
Expand Up @@ -11,6 +11,7 @@




class QgsDualView : QStackedWidget
{
%Docstring
Expand Down
1 change: 1 addition & 0 deletions python/gui/auto_generated/qgsdoublevalidator.sip.in
Expand Up @@ -9,6 +9,7 @@




class QgsDoubleValidator : QRegularExpressionValidator
{
%Docstring
Expand Down
Expand Up @@ -11,6 +11,7 @@




class QgsPalettedRendererWidget: QgsRasterRendererWidget
{

Expand Down
1 change: 1 addition & 0 deletions src/3d/materials/qgsgoochmaterialsettings.cpp
Expand Up @@ -25,6 +25,7 @@
#include <Qt3DRender/QEffect>
#include <Qt3DRender/QTechnique>
#include <Qt3DRender/QGraphicsApiFilter>
#include <QUrl>

QString QgsGoochMaterialSettings::type() const
{
Expand Down
1 change: 1 addition & 0 deletions src/3d/qgs3dmapscene.cpp
Expand Up @@ -36,6 +36,7 @@
#include <Qt3DRender/QCullFace>
#include <Qt3DRender/QDepthTest>
#include <QSurface>
#include <QUrl>

#include <QOpenGLContext>
#include <QOpenGLFunctions>
Expand Down
1 change: 1 addition & 0 deletions src/3d/qgspostprocessingentity.cpp
Expand Up @@ -23,6 +23,7 @@
#include <Qt3DRender/QTechnique>
#include <Qt3DRender/QGraphicsApiFilter>
#include <Qt3DRender/QDepthTest>
#include <QUrl>

#include "qgsshadowrenderingframegraph.h"

Expand Down
2 changes: 1 addition & 1 deletion src/3d/qgsrulebased3drenderer.h
Expand Up @@ -21,8 +21,8 @@
#include "qgs3drendererregistry.h"
#include "qgsabstractvectorlayer3drenderer.h"
#include "qgsabstract3dsymbol.h"

#include "qgsmaplayerref.h"
#include <QUuid>

class Qgs3DRenderContext;
class QgsFeature3DHandler;
Expand Down
1 change: 1 addition & 0 deletions src/3d/qgsrulebasedchunkloader_p.h
Expand Up @@ -31,6 +31,7 @@
#include "qgsfeature3dhandler_p.h"
#include "qgschunkedentity_p.h"
#include "qgsrulebased3drenderer.h"
#include <QFutureWatcher>

#define SIP_NO_FILE

Expand Down
1 change: 1 addition & 0 deletions src/3d/qgsskyboxentity.cpp
Expand Up @@ -29,6 +29,7 @@
#include <Qt3DRender/QSeamlessCubemap>
#include <Qt3DRender/QParameter>
#include <Qt3DRender/QTextureImage>
#include <QUrl>

#include "qgsimagecache.h"
#include "qgsimagetexture.h"
Expand Down
1 change: 1 addition & 0 deletions src/3d/symbols/qgspoint3dbillboardmaterial.cpp
Expand Up @@ -21,6 +21,7 @@
#include <Qt3DRender/QBlendEquationArguments>
#include <Qt3DRender/QBlendEquation>
#include <Qt3DRender/QNoDepthMask>
#include <QUrl>

#include "qgslogger.h"
#include "qgspoint3dbillboardmaterial.h"
Expand Down
1 change: 1 addition & 0 deletions src/3d/symbols/qgspointcloud3dsymbol_p.cpp
Expand Up @@ -33,6 +33,7 @@
#include <Qt3DRender/QGraphicsApiFilter>
#include <Qt3DRender/QEffect>
#include <QPointSize>
#include <QUrl>

QgsPointCloud3DGeometry::QgsPointCloud3DGeometry( Qt3DCore::QNode *parent, unsigned int byteStride )
: Qt3DRender::QGeometry( parent )
Expand Down
2 changes: 2 additions & 0 deletions src/analysis/processing/qgsalgorithmexportmesh.cpp
Expand Up @@ -27,6 +27,8 @@
#include "qgsrasterfilewriter.h"
#include "qgslinestring.h"

#include <QTextStream>

///@cond PRIVATE


Expand Down
3 changes: 3 additions & 0 deletions src/analysis/processing/qgsalgorithmimportphotos.cpp
Expand Up @@ -18,6 +18,9 @@
#include "qgsalgorithmimportphotos.h"
#include "qgsogrutils.h"
#include "qgsvectorlayer.h"
#include <QDirIterator>
#include <QFileInfo>
#include <QRegularExpression>

///@cond PRIVATE

Expand Down
Expand Up @@ -17,6 +17,7 @@

#include "qgsalgorithmnearestneighbouranalysis.h"
#include "qgsapplication.h"
#include <QTextStream>

///@cond PRIVATE

Expand Down
3 changes: 3 additions & 0 deletions src/analysis/processing/qgsalgorithmpointstopaths.cpp
Expand Up @@ -19,6 +19,9 @@
#include "qgsvectorlayer.h"
#include "qgsmultipoint.h"

#include <QCollator>
#include <QTextStream>

///@cond PRIVATE

QString QgsPointsToPathsAlgorithm::name() const
Expand Down
Expand Up @@ -17,6 +17,7 @@

#include "qgsalgorithmrasterlayeruniquevalues.h"
#include "qgsstringutils.h"
#include <QTextStream>

///@cond PRIVATE

Expand Down
2 changes: 1 addition & 1 deletion src/analysis/processing/qgsalgorithmrasterstatistics.cpp
Expand Up @@ -16,7 +16,7 @@
***************************************************************************/

#include "qgsalgorithmrasterstatistics.h"

#include <QTextStream>

///@cond PRIVATE

Expand Down
Expand Up @@ -17,6 +17,7 @@

#include "qgsalgorithmrastersurfacevolume.h"
#include "qgsstringutils.h"
#include <QTextStream>

///@cond PRIVATE

Expand Down
1 change: 1 addition & 0 deletions src/analysis/processing/qgsalgorithmsavefeatures.cpp
Expand Up @@ -17,6 +17,7 @@

#include "qgsalgorithmsavefeatures.h"
#include "qgsvectorfilewriter.h"
#include <QRegularExpression>

///@cond PRIVATE

Expand Down
1 change: 1 addition & 0 deletions src/analysis/processing/qgsalgorithmsavelog.cpp
Expand Up @@ -16,6 +16,7 @@
***************************************************************************/

#include "qgsalgorithmsavelog.h"
#include <QTextStream>

///@cond PRIVATE

Expand Down
Expand Up @@ -21,6 +21,7 @@
#include "qgscircularstring.h"
#include "qgscompoundcurve.h"
#include "qgsgeometrycollection.h"
#include <QRegularExpression>

///@cond PRIVATE

Expand Down
Expand Up @@ -23,6 +23,8 @@
#include "qgis_sip.h"
#include "qgsprocessingalgorithm.h"

#include <QRegularExpression>

///@cond PRIVATE

/**
Expand Down
1 change: 1 addition & 0 deletions src/analysis/processing/qgsalgorithmwritevectortiles.cpp
Expand Up @@ -18,6 +18,7 @@
#include "qgsprocessingparametervectortilewriterlayers.h"
#include "qgsvectorlayer.h"
#include "qgsvectortilewriter.h"
#include <QUrl>

///@cond PRIVATE

Expand Down
2 changes: 2 additions & 0 deletions src/analysis/vector/geometry_checker/qgsfeaturepool.cpp
Expand Up @@ -24,6 +24,8 @@
#include "qgsreadwritelocker.h"

#include <QMutexLocker>
#include <QThread>



QgsFeaturePool::QgsFeaturePool( QgsVectorLayer *layer )
Expand Down
Expand Up @@ -18,6 +18,7 @@
#include <QFutureWatcher>
#include <QMutex>
#include <QTimer>
#include <QTextStream>

#include "qgsgeometrycheckcontext.h"
#include "qgsgeometrychecker.h"
Expand Down
1 change: 1 addition & 0 deletions src/app/3d/qgs3dicongenerator.cpp
Expand Up @@ -15,6 +15,7 @@

#include "qgs3dicongenerator.h"
#include "qgsapplication.h"
#include <QDir>

Qgs3DIconGenerator::Qgs3DIconGenerator( QObject *parent )
: QgsAbstractStyleEntityIconGenerator( parent )
Expand Down
2 changes: 1 addition & 1 deletion src/app/3d/qgsrulebased3drendererwidget.cpp
Expand Up @@ -27,7 +27,7 @@
#include <QAction>
#include <QClipboard>
#include <QMessageBox>

#include <QMimeData>

QgsRuleBased3DRendererWidget::QgsRuleBased3DRendererWidget( QWidget *parent )
: QgsPanelWidget( parent )
Expand Down
1 change: 1 addition & 0 deletions src/app/browser/qgsinbuiltdataitemproviders.cpp
Expand Up @@ -49,6 +49,7 @@
#include <QDesktopServices>
#include <QFileDialog>
#include <QMessageBox>
#include <QUrl>

QString QgsAppDirectoryItemGuiProvider::name()
{
Expand Down
1 change: 1 addition & 0 deletions src/app/devtools/networklogger/qgsnetworkloggernode.h
Expand Up @@ -19,6 +19,7 @@
#include <QElapsedTimer>
#include <QVariant>
#include <QColor>
#include <QUrl>
#include <memory>
#include <deque>

Expand Down
Expand Up @@ -28,6 +28,7 @@
#include <QScrollBar>
#include <QToolButton>
#include <QCheckBox>
#include <QTextStream>

#include <nlohmann/json.hpp>

Expand Down
1 change: 1 addition & 0 deletions src/app/georeferencer/qgsgeorefmainwindow.cpp
Expand Up @@ -29,6 +29,7 @@
#include <QPen>
#include <QStringList>
#include <QList>
#include <QUrl>

#include "qgssettings.h"
#include "qgisinterface.h"
Expand Down
2 changes: 1 addition & 1 deletion src/app/gps/qgsgpsinformationwidget.cpp
Expand Up @@ -69,7 +69,7 @@
#include <QFileDialog>
#include <QPixmap>
#include <QPen>

#include <QTimeZone>

const int MAXACQUISITIONINTERVAL = 3000; // max gps information acquisition suspension interval (in seconds)
const int MAXDISTANCETHRESHOLD = 200; // max gps distance threshold (in meters)
Expand Down
1 change: 1 addition & 0 deletions src/app/gps/qgsgpsinformationwidget.h
Expand Up @@ -32,6 +32,7 @@
#include <qwt_polar_grid.h>
#include <qwt_polar_marker.h>
#endif
#include <QTextStream>

class QextSerialPort;
class QgsGpsConnection;
Expand Down
2 changes: 2 additions & 0 deletions src/app/layout/qgslayoutdesignerdialog.cpp
Expand Up @@ -93,6 +93,8 @@
#include <QWidgetAction>
#include <QProgressBar>
#include <QClipboard>
#include <QRegularExpression>
#include <QUrl>

#ifdef Q_OS_MACX
#include <ApplicationServices/ApplicationServices.h>
Expand Down
2 changes: 2 additions & 0 deletions src/app/layout/qgslayoutimagedrophandler.cpp
Expand Up @@ -20,6 +20,8 @@
#include "qgslayoutitempicture.h"

#include <QImageReader>
#include <QFileInfo>
#include <QMimeData>

QgsLayoutImageDropHandler::QgsLayoutImageDropHandler( QObject *parent )
: QgsLayoutCustomDropHandler( parent )
Expand Down
1 change: 1 addition & 0 deletions src/app/locator/qgsinbuiltlocatorfilters.cpp
Expand Up @@ -21,6 +21,7 @@
#include <QString>
#include <QToolButton>
#include <QUrl>
#include <QRegularExpression>

#include "qgsapplication.h"
#include "qgscoordinatereferencesystem.h"
Expand Down
1 change: 1 addition & 0 deletions src/app/main.cpp
Expand Up @@ -33,6 +33,7 @@
#include <QDesktopWidget>
#include <QImageReader>
#include <QMessageBox>
#include <QStandardPaths>

#include <cstdio>
#include <cstdlib>
Expand Down

0 comments on commit c6370c7

Please sign in to comment.