Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Merge pull request #38202 from m-kuhn/qt514
Setup Qt 5.14 github workflow
  • Loading branch information
m-kuhn committed Aug 10, 2020
2 parents fb14618 + e2e7d31 commit 988ffcf
Show file tree
Hide file tree
Showing 22 changed files with 145 additions and 37 deletions.
38 changes: 38 additions & 0 deletions .ci/qt5_14/Dockerfile
@@ -0,0 +1,38 @@
FROM fedora:32
MAINTAINER Matthias Kuhn <matthias@opengis.ch>

RUN dnf -y install \
bison \
ccache \
clang \
clazy \
exiv2-devel \
fcgi-devel \
flex \
gdal-devel \
geos-devel \
gsl-devel \
libpq-devel \
libspatialite-devel \
libzip-devel \
ninja-build \
proj-devel \
protobuf-devel \
protobuf-lite-devel \
python3-pyqt5-sip \
python3-qscintilla-qt5 \
python3-qt5-devel \
qca-qt5-devel \
qscintilla-qt5-devel \
qt5-qt3d-devel \
qt5-qtbase-devel \
qt5-qtlocation-devel \
qt5-qtserialport-devel \
qt5-qttools-static \
qt5-qtwebkit-devel \
qtkeychain-qt5-devel \
qwt-qt5-devel \
spatialindex-devel \
sqlite-devel \
unzip

37 changes: 37 additions & 0 deletions .ci/qt5_14/build.sh
@@ -0,0 +1,37 @@
#!/bin/bash

mkdir /usr/src/qgis/build
cd /usr/src/qgis/build || exit -1

ccache -s

cmake -GNinja \
-DUSE_CCACHE=ON \
-DWITH_QUICK=OFF \
-DWITH_3D=ON \
-DWITH_STAGED_PLUGINS=ON \
-DWITH_GRASS=OFF \
-DSUPPRESS_QT_WARNINGS=ON \
-DENABLE_MODELTEST=ON \
-DENABLE_PGTEST=ON \
-DENABLE_SAGA_TESTS=ON \
-DENABLE_MSSQLTEST=ON \
-DWITH_QSPATIALITE=OFF \
-DWITH_QWTPOLAR=OFF \
-DWITH_APIDOC=OFF \
-DWITH_ASTYLE=OFF \
-DWITH_DESKTOP=ON \
-DWITH_BINDINGS=ON \
-DWITH_SERVER=ON \
-DWITH_ORACLE=OFF \
-DDISABLE_DEPRECATED=ON \
-DCXX_EXTRA_FLAGS="${CLANG_WARNINGS}" \
-DCMAKE_C_COMPILER=/usr/bin/clang \
-DCMAKE_CXX_COMPILER=/usr/bin/clang++ \
-DADD_CLAZY_CHECKS=ON \
-DWERROR=TRUE \
..

ninja

ccache -s
34 changes: 34 additions & 0 deletions .github/workflows/qt5_14.yml
@@ -0,0 +1,34 @@
name: Build QGIS with Qt 5.14

on:
push:
branches:
- master
- release-**
pull_request:
branches:
- master
- release-**

jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@master

- name: Setup build dependencies
run: |
docker build -t qgis_build_deps -f .ci/qt5_14/Dockerfile .
- name: Cache
id: cache
uses: actions/cache@v2
with:
path: ~/.ccache
key: qt514

- name: Run build
run: |
docker run -v ~/.ccache:/root/ccache -v $(pwd):/usr/src/qgis qgis_build_deps /usr/src/qgis/.ci/qt5_14/build.sh
12 changes: 7 additions & 5 deletions external/libdxfrw/CMakeLists.txt
@@ -1,11 +1,13 @@
INCLUDE_DIRECTORIES(
${CMAKE_SOURCE_DIR}/src/core
${CMAKE_SOURCE_DIR}/src/core/geometry
${CMAKE_SOURCE_DIR}/src/core
${CMAKE_SOURCE_DIR}/src/core/geometry

${CMAKE_BINARY_DIR}/src/core
${CMAKE_BINARY_DIR}/src/core/geometry
${CMAKE_BINARY_DIR}/src/core
${CMAKE_BINARY_DIR}/src/core/geometry
)

${Qt5Core_INCLUDE_DIRS}
INCLUDE_DIRECTORIES(SYSTEM
${Qt5Core_INCLUDE_DIRS}
)

ADD_LIBRARY(libdxfrw STATIC
Expand Down
6 changes: 3 additions & 3 deletions external/mdal/frmts/mdal_selafin.cpp
Expand Up @@ -399,9 +399,9 @@ void MDAL::SelafinFile::populateDataset( MDAL::Mesh *mesh, std::shared_ptr<MDAL:
}

// now calculate statistics
for ( const std::shared_ptr<DatasetGroup> group : groupsInOrder )
for ( const std::shared_ptr<DatasetGroup> &group : groupsInOrder )
{
for ( const std::shared_ptr<Dataset> dataset : group->datasets )
for ( const std::shared_ptr<Dataset> &dataset : group->datasets )
{
MDAL::Statistics stats = MDAL::calculateStatistics( dataset );
dataset->setStatistics( stats );
Expand All @@ -412,7 +412,7 @@ void MDAL::SelafinFile::populateDataset( MDAL::Mesh *mesh, std::shared_ptr<MDAL:
}

// As everything seems to be ok (no exception thrown), push the groups in the mesh
for ( const std::shared_ptr<DatasetGroup> group : groupsInOrder )
for ( const std::shared_ptr<DatasetGroup> &group : groupsInOrder )
mesh->datasetGroups.push_back( group );
}

Expand Down
8 changes: 4 additions & 4 deletions src/analysis/processing/qgsalgorithmlayoutatlastoimage.cpp
Expand Up @@ -83,8 +83,8 @@ void QgsLayoutAtlasToImageAlgorithm::initAlgorithm( const QVariantMap & )
addParameter( layersParam.release() );

QStringList imageFormats;
const auto supportedImageFormats { QImageWriter::supportedImageFormats() };
for ( const auto format : QImageWriter::supportedImageFormats() )
const QList<QByteArray> supportedImageFormats { QImageWriter::supportedImageFormats() };
for ( const QByteArray &format : supportedImageFormats )
{
if ( format == QByteArray( "svg" ) )
continue;
Expand Down Expand Up @@ -219,8 +219,8 @@ QVariantMap QgsLayoutAtlasToImageAlgorithm::processAlgorithm( const QVariantMap
QString fileName = QDir( directory ).filePath( QStringLiteral( "atlas" ) );

QStringList imageFormats;
const auto supportedImageFormats { QImageWriter::supportedImageFormats() };
for ( const auto format : QImageWriter::supportedImageFormats() )
const QList<QByteArray> supportedImageFormats { QImageWriter::supportedImageFormats() };
for ( const QByteArray &format : supportedImageFormats )
{
if ( format == QByteArray( "svg" ) )
continue;
Expand Down
2 changes: 1 addition & 1 deletion src/app/mesh/qgsmeshdatasetgrouptreeview.cpp
Expand Up @@ -683,7 +683,7 @@ QMenu *QgsMeshDatasetGroupSaveMenu::createSaveMenu( int groupIndex, QMenu *paren
if ( providerMetadata )
{
const QList<QgsMeshDriverMetadata> allDrivers = providerMetadata->meshDriversMetadata();
for ( const QgsMeshDriverMetadata driver : allDrivers )
for ( const QgsMeshDriverMetadata &driver : allDrivers )
{
QString driverName = driver.name();
QString suffix = driver.writeDatasetOnFileSuffix();
Expand Down
2 changes: 1 addition & 1 deletion src/app/qgsmaptooladdcircle.cpp
Expand Up @@ -97,7 +97,7 @@ void QgsMapToolAddCircle::deactivate()

// keep z value from the first snapped point
std::unique_ptr<QgsCircularString> lineString( mCircle.toCircularString() );
for ( const QgsPoint point : qgis::as_const( mPoints ) )
for ( const QgsPoint &point : qgis::as_const( mPoints ) )
{
if ( QgsWkbTypes::hasZ( point.wkbType() ) &&
point.z() != defaultZValue() )
Expand Down
2 changes: 1 addition & 1 deletion src/app/qgsmaptooladdellipse.cpp
Expand Up @@ -97,7 +97,7 @@ void QgsMapToolAddEllipse::deactivate()

// keep z value from the first snapped point
std::unique_ptr<QgsLineString> ls( mEllipse.toLineString( segments() ) );
for ( const QgsPoint point : qgis::as_const( mPoints ) )
for ( const QgsPoint &point : qgis::as_const( mPoints ) )
{
if ( QgsWkbTypes::hasZ( point.wkbType() ) &&
point.z() != defaultZValue() )
Expand Down
2 changes: 1 addition & 1 deletion src/app/qgsmaptooladdregularpolygon.cpp
Expand Up @@ -115,7 +115,7 @@ void QgsMapToolAddRegularPolygon::deactivate()

// keep z value from the first snapped point
std::unique_ptr<QgsLineString> ls( mRegularPolygon.toLineString() );
for ( const QgsPoint point : qgis::as_const( mPoints ) )
for ( const QgsPoint &point : qgis::as_const( mPoints ) )
{
if ( QgsWkbTypes::hasZ( point.wkbType() ) &&
point.z() != defaultZValue() )
Expand Down
2 changes: 1 addition & 1 deletion src/core/expression/qgsexpressionfunction.cpp
Expand Up @@ -404,7 +404,7 @@ static QVariant fcnRndF( const QVariantList &values, const QgsExpressionContext
}

// Return a random double in the range [min, max] (inclusive)
double f = static_cast< double >( generator() ) / generator.max();
double f = static_cast< double >( generator() ) / static_cast< double >( generator.max() );
return QVariant( min + f * ( max - min ) );
}
static QVariant fcnRnd( const QVariantList &values, const QgsExpressionContext *, QgsExpression *parent, const QgsExpressionNodeFunction * )
Expand Down
2 changes: 1 addition & 1 deletion src/core/labeling/qgsvectorlayerlabelprovider.cpp
Expand Up @@ -630,7 +630,7 @@ void QgsVectorLayerLabelProvider::drawLabelPrivate( pal::LabelPosition *label, Q
{
const QgsTextCharacterFormat c = lf->characterFormat( label->getPartId() );
const QStringList multiLineList = QgsPalLabeling::splitToLines( txt, tmpLyr.wrapChar, tmpLyr.autoWrapLength, tmpLyr.useMaxLineLengthForAutoWrap );
for ( const QString line : multiLineList )
for ( const QString &line : multiLineList )
document.append( QgsTextBlock( QgsTextFragment( line, c ) ) );
}
else
Expand Down
4 changes: 2 additions & 2 deletions src/core/mesh/qgsmeshlayer.cpp
Expand Up @@ -546,11 +546,11 @@ void QgsMeshLayer::applyClassificationOnScalarSettings( const QgsMeshDatasetGrou
units = meta.extraOptions()[ QStringLiteral( "units" )];

QVector<QVector<double>> bounds;
for ( const QString classe : classes )
for ( const QString &classe : classes )
{
QStringList boundsStr = classe.split( ',' );
QVector<double> bound;
for ( const QString boundStr : boundsStr )
for ( const QString &boundStr : boundsStr )
bound.append( boundStr.toDouble() );
bounds.append( bound );
}
Expand Down
2 changes: 1 addition & 1 deletion src/core/qgsfield.cpp
Expand Up @@ -472,7 +472,7 @@ bool QgsField::convertCompatible( QVariant &v, QString *errorMessage ) const
}

double round = std::round( dbl );
if ( round > std::numeric_limits<long long>::max() || round < -std::numeric_limits<long long>::max() )
if ( round > static_cast<double>( std::numeric_limits<long long>::max() ) || round < static_cast<double>( -std::numeric_limits<long long>::max() ) )
{
//double too large to fit in longlong
v = QVariant( d->type );
Expand Down
2 changes: 1 addition & 1 deletion src/core/qgsfileutils.cpp
Expand Up @@ -191,7 +191,7 @@ QStringList QgsFileUtils::findFile( const QString &file, const QString &basePath


const QFileInfoList subdirs = folder.entryInfoList( QDir::AllDirs );
for ( const QFileInfo subdir : subdirs )
for ( const QFileInfo &subdir : subdirs )
{
if ( ! searchedFolder.contains( subdir.absolutePath() ) )
{
Expand Down
2 changes: 1 addition & 1 deletion src/core/qgsvectordataprovider.cpp
Expand Up @@ -639,7 +639,7 @@ QStringList QgsVectorDataProvider::availableEncodings()
std::call_once( initialized, [ = ]
{
const auto codecs { QTextCodec::availableCodecs() };
for ( const QString &codec : codecs )
for ( const QByteArray &codec : codecs )
{
sEncodings << codec;
}
Expand Down
2 changes: 1 addition & 1 deletion src/core/qobjectuniqueptr.h
Expand Up @@ -245,7 +245,7 @@ template<typename T>
QObjectUniquePtr<T>
QObjectUniquePtrFromVariant( const QVariant &variant )
{
return QObjectUniquePtr<T>( qobject_cast<T *>( QtSharedPointer::weakPointerFromVariant_internal( variant ).data() ) );
return QObjectUniquePtr<T>( qobject_cast<T *>( QtSharedPointer::weakPointerFromVariant_internal( variant ).toStrongRef().data() ) );
}

#endif // QOBJECTUNIQUEPTR_H
2 changes: 1 addition & 1 deletion src/providers/wfs/qgsoapifcollection.cpp
Expand Up @@ -385,7 +385,7 @@ void QgsOapifCollectionsRequest::processReply()
const auto collections = j["collections"];
if ( collections.is_array() )
{
for ( const auto jCollection : collections )
for ( const auto &jCollection : collections )
{
QgsOapifCollection collection;
if ( collection.deserialize( jCollection ) )
Expand Down
9 changes: 4 additions & 5 deletions src/providers/wms/qgswmssourceselect.cpp
Expand Up @@ -288,8 +288,8 @@ bool QgsWMSSourceSelect::populateLayerList( const QgsWmsCapabilities &capabiliti

bool first = true;
QSet<QString> alreadyAddedLabels;
const auto constSupportedImageEncodings = capabilities.supportedImageEncodings();
for ( const QString &encoding : constSupportedImageEncodings )
const auto supportedImageEncodings = capabilities.supportedImageEncodings();
for ( const QString &encoding : supportedImageEncodings )
{
int id = mMimeMap.value( encoding, -1 );
if ( id < 0 )
Expand Down Expand Up @@ -540,8 +540,7 @@ void QgsWMSSourceSelect::addButtonClicked()

const QgsWmtsTileLayer *layer = nullptr;

const auto constMTileLayers = mTileLayers;
for ( const QgsWmtsTileLayer &l : constMTileLayers )
for ( const QgsWmtsTileLayer &l : qgis::as_const( mTileLayers ) )
{
if ( l.identifier == layers.join( QStringLiteral( "," ) ) )
{
Expand Down Expand Up @@ -1032,7 +1031,7 @@ void QgsWMSSourceSelect::collectSelectedLayers( QStringList &layers, QStringList

void QgsWMSSourceSelect::collectDimensions( QStringList &layers, QgsDataSourceUri &uri )
{
for ( const QgsWmsLayerProperty layerProperty : mLayerProperties )
for ( const QgsWmsLayerProperty &layerProperty : qgis::as_const( mLayerProperties ) )
{
if ( layerProperty.name == layers.join( ',' ) )
{
Expand Down
2 changes: 1 addition & 1 deletion tests/src/analysis/testqgsprocessingalgs.cpp
Expand Up @@ -4636,7 +4636,7 @@ void TestQgsProcessingAlgs::exportAtlasLayoutPng()
{
QDir dir( QDir::tempPath() + "/my_atlas" );
const QStringList files = dir.entryList( QStringList() << "*.*", QDir::Files );
for ( const QString file : files )
for ( const QString &file : files )
QFile::remove( QDir::tempPath() + "/my_atlas/" + file );
}

Expand Down
2 changes: 1 addition & 1 deletion tests/src/core/testqgis.cpp
Expand Up @@ -356,7 +356,7 @@ void TestQgis::testQgsRound()
QGSCOMPARENEAR( qgsRound( 98765432198, 13 ), 98765432198, 1.0 );
QGSCOMPARENEAR( qgsRound( 98765432198, 14 ), 98765432198, 1.0 );
QGSCOMPARENEAR( qgsRound( 98765432198765, 14 ), 98765432198765, 1.0 );
QGSCOMPARENEAR( qgsRound( 98765432198765432, 20 ), 98765432198765432, 1.0 );
QGSCOMPARENEAR( qgsRound( 98765432198765432., 20 ), 98765432198765432., 1.0 );
QGSCOMPARENEAR( qgsRound( 9.8765432198765, 2 ), 9.88, 0.001 );
QGSCOMPARENEAR( qgsRound( 9.8765432198765, 3 ), 9.877, 0.0001 );
QGSCOMPARENEAR( qgsRound( 9.8765432198765, 4 ), 9.8765, 0.00001 );
Expand Down
8 changes: 3 additions & 5 deletions tests/src/quickgui/testqgsquickpositionkit.cpp
Expand Up @@ -22,9 +22,8 @@

#include "qgsquickpositionkit.h"
#include "qgsquicksimulatedpositionsource.h"
#include "qgsquickutils.h"

class TestQgsQuickUtils: public QObject
class TestQgsQuickPositionKit: public QObject
{
Q_OBJECT
private slots:
Expand All @@ -34,11 +33,10 @@ class TestQgsQuickUtils: public QObject
void simulated_position();

private:
QgsQuickUtils utils;
QgsQuickPositionKit positionKit;
};

void TestQgsQuickUtils::simulated_position()
void TestQgsQuickPositionKit::simulated_position()
{
QVERIFY( !positionKit.isSimulated() );
positionKit.useSimulatedLocation( -92.36, 38.93, -1 );
Expand All @@ -57,5 +55,5 @@ void TestQgsQuickUtils::simulated_position()
QVERIFY( !positionKit.isSimulated() );
}

QGSTEST_MAIN( TestQgsQuickUtils )
QGSTEST_MAIN( TestQgsQuickPositionKit )
#include "testqgsquickpositionkit.moc"

0 comments on commit 988ffcf

Please sign in to comment.