Skip to content
Permalink
Browse files

Bump minimum Qt version to 5.12

  • Loading branch information
nyalldawson committed Feb 23, 2021
1 parent 9532a5a commit f08387638383ebb292ac77c76cbaec1dbe7cdbac
Showing with 4 additions and 572 deletions.
  1. +1 −1 CMakeLists.txt
  2. +0 −4 src/3d/chunks/qgschunkboundsentity_p.cpp
  3. +0 −4 src/3d/materials/qgsgoochmaterialsettings.cpp
  4. +0 −4 src/3d/materials/qgsphongmaterialsettings.cpp
  5. +0 −13 src/3d/materials/qgsphongtexturedmaterialsettings.cpp
  6. +0 −10 src/3d/mesh/qgsmesh3dgeometry_p.cpp
  7. +0 −13 src/3d/qgs3dmapscene.cpp
  8. +0 −12 src/3d/qgs3dsceneexporter.cpp
  9. +0 −4 src/3d/qgspostprocessingentity.cpp
  10. +0 −4 src/3d/qgspreviewquad.cpp
  11. +0 −2 src/3d/qgsshadowrenderingframegraph.cpp
  12. +0 −4 src/3d/qgstessellatedpolygongeometry.cpp
  13. +0 −4 src/3d/symbols/qgsbillboardgeometry.cpp
  14. +0 −8 src/3d/symbols/qgslinevertexdata_p.cpp
  15. +0 −8 src/3d/symbols/qgspoint3dsymbol_p.cpp
  16. +0 −4 src/3d/symbols/qgspointcloud3dsymbol_p.cpp
  17. +0 −6 src/3d/terrain/qgsdemterraintilegeometry_p.cpp
  18. +0 −10 src/3d/terrain/qgsterraintileloader_p.cpp
  19. +0 −4 src/app/layout/qgslayoutdesignerdialog.cpp
  20. +1 −3 src/app/main.cpp
  21. +0 −6 src/app/qgisapp.cpp
  22. +0 −5 src/app/qgsidentifyresultsdialog.cpp
  23. +0 −4 src/app/qgspointrotationitem.cpp
  24. +0 −4 src/app/vectortile/qgsvectortilelayerproperties.cpp
  25. +0 −36 src/auth/oauth2/qjsonwrapper/Json.cpp
  26. +0 −4 src/core/diagram/qgstextdiagram.cpp
  27. +0 −9 src/core/expression/qgsexpressionfunction.cpp
  28. +0 −4 src/core/expression/qgsexpressionutils.h
  29. +0 −16 src/core/labeling/qgspallabeling.cpp
  30. +0 −13 src/core/labeling/qgstextlabelfeature.cpp
  31. +0 −4 src/core/layout/qgslayoututils.cpp
  32. +1 −4 src/core/network/qgsnetworkreply.cpp
  33. +0 −9 src/core/qgsfield.h
  34. +0 −7 src/core/qgsfileutils.cpp
  35. +0 −4 src/core/qgslegendsettings.cpp
  36. +0 −6 src/core/qgsthreadingutils.h
  37. +0 −4 src/core/qgstiledownloadmanager.cpp
  38. +0 −8 src/core/raster/qgsrasterblock.cpp
  39. +0 −9 src/core/scalebar/qgsscalebarrenderer.cpp
  40. +0 −8 src/core/symbology/qgsmarkersymbollayer.cpp
  41. +0 −4 src/core/symbology/qgspointdistancerenderer.cpp
  42. +0 −16 src/core/symbology/qgsstylemodel.cpp
  43. +0 −8 src/core/textrenderer/qgstextfragment.cpp
  44. +0 −20 src/core/textrenderer/qgstextrenderer.cpp
  45. +0 −4 src/core/vector/qgsvectorlayerutils.cpp
  46. +0 −4 src/gui/attributetable/qgsfeaturelistviewdelegate.cpp
  47. +0 −4 src/gui/attributetable/qgsfieldconditionalformatwidget.cpp
  48. +0 −4 src/gui/editorwidgets/qgshtmlwidgetwrapper.cpp
  49. +0 −4 src/gui/layertree/qgslayertreeembeddedwidgetsimpl.cpp
  50. +0 −4 src/gui/layertree/qgslayertreeview.cpp
  51. +0 −5 src/gui/layout/qgslayoutitemslistview.cpp
  52. +0 −4 src/gui/layout/qgslayoutpicturewidget.cpp
  53. +0 −4 src/gui/layout/qgslayoutruler.cpp
  54. +0 −4 src/gui/layout/qgslayoutview.cpp
  55. +0 −4 src/gui/processing/models/qgsmodelgraphicsview.cpp
  56. +0 −4 src/gui/processing/qgsprocessingwidgetwrapperimpl.cpp
  57. +0 −3 src/gui/qgscollapsiblegroupbox.cpp
  58. +0 −4 src/gui/qgscolorbutton.cpp
  59. +0 −8 src/gui/qgscolorschemelist.cpp
  60. +0 −19 src/gui/qgscolorswatchgrid.cpp
  61. +0 −24 src/gui/qgscolorwidgets.cpp
  62. +0 −5 src/gui/qgscompoundcolorwidget.cpp
  63. +0 −4 src/gui/qgsfontbutton.cpp
  64. +0 −4 src/gui/qgslegendpatchshapebutton.cpp
  65. +0 −4 src/gui/qgsmenuheader.cpp
  66. +1 −5 src/gui/qgsnewnamedialog.cpp
  67. +0 −4 src/gui/qgsratiolockbutton.cpp
  68. +0 −9 src/gui/qgsstyleitemslistwidget.cpp
  69. +0 −4 src/gui/qgssymbolbutton.cpp
  70. +0 −17 src/gui/qgstaskmanagerwidget.cpp
  71. +0 −5 src/gui/qgswidgetstatehelper_p.cpp
  72. +0 −4 src/gui/raster/qgscolorrampshaderwidget.cpp
  73. +0 −4 src/gui/raster/qgspalettedrendererwidget.cpp
  74. +0 −4 src/gui/raster/qgsrasterlayerproperties.cpp
  75. +0 −4 src/gui/symbology/qgsellipsesymbollayerwidget.cpp
  76. +0 −4 src/gui/symbology/qgsstyleexportimportdialog.cpp
  77. +0 −8 src/gui/symbology/qgsstylemanagerdialog.cpp
  78. +0 −4 src/gui/symbology/qgssvgselectorwidget.cpp
  79. +0 −12 src/gui/symbology/qgssymbollayerwidget.cpp
  80. +0 −4 src/gui/vector/qgsdiagramproperties.cpp
  81. +0 −4 src/native/linux/qgslinuxnative.cpp
  82. +0 −6 tests/src/core/testqgsexpression.cpp
  83. +0 −8 tests/src/core/testqgsfield.cpp
  84. +0 −4 tests/src/gui/testqgsscalecombobox.cpp
@@ -432,7 +432,7 @@ if(WITH_CORE)

#############################################################
# search for Qt5
set(QT_MIN_VERSION 5.9.0)
set(QT_MIN_VERSION 5.12.0)

# Use Qt5SerialPort optionally for GPS
set (WITH_QT5SERIALPORT TRUE CACHE BOOL "Determines whether Qt5SerialPort should be tried for GPS positioning")
@@ -26,11 +26,7 @@
LineMeshGeometry::LineMeshGeometry( Qt3DCore::QNode *parent )
: Qt3DRender::QGeometry( parent )
, mPositionAttribute( new Qt3DRender::QAttribute( this ) )
#if QT_VERSION < QT_VERSION_CHECK(5, 10, 0)
, mVertexBuffer( new Qt3DRender::QBuffer( Qt3DRender::QBuffer::VertexBuffer, this ) )
#else
, mVertexBuffer( new Qt3DRender::QBuffer( this ) )
#endif
{
mPositionAttribute->setAttributeType( Qt3DRender::QAttribute::VertexAttribute );
mPositionAttribute->setBuffer( mVertexBuffer );
@@ -170,11 +170,7 @@ int QgsGoochMaterialSettings::dataDefinedByteStride() const

void QgsGoochMaterialSettings::applyDataDefinedToGeometry( Qt3DRender::QGeometry *geometry, int vertexCount, const QByteArray &data ) const
{
#if QT_VERSION < QT_VERSION_CHECK(5, 10, 0)
Qt3DRender::QBuffer *dataBuffer = new Qt3DRender::QBuffer( Qt3DRender::QBuffer::VertexBuffer, geometry );
#else
Qt3DRender::QBuffer *dataBuffer = new Qt3DRender::QBuffer( geometry );
#endif

Qt3DRender::QAttribute *diffuseAttribute = new Qt3DRender::QAttribute( geometry );
diffuseAttribute->setName( QStringLiteral( "dataDefinedDiffuseColor" ) );
@@ -176,11 +176,7 @@ int QgsPhongMaterialSettings::dataDefinedByteStride() const {return 9 * sizeof(

void QgsPhongMaterialSettings::applyDataDefinedToGeometry( Qt3DRender::QGeometry *geometry, int vertexCount, const QByteArray &data ) const
{
#if QT_VERSION < QT_VERSION_CHECK(5, 10, 0)
Qt3DRender::QBuffer *dataBuffer = new Qt3DRender::QBuffer( Qt3DRender::QBuffer::VertexBuffer, geometry );
#else
Qt3DRender::QBuffer *dataBuffer = new Qt3DRender::QBuffer( geometry );
#endif

Qt3DRender::QAttribute *diffuseAttribute = new Qt3DRender::QAttribute( geometry );
diffuseAttribute->setName( QStringLiteral( "dataDefinedDiffuseColor" ) );
@@ -19,11 +19,7 @@
#include "qgsapplication.h"
#include "qgsimagecache.h"
#include "qgsimagetexture.h"
#if QT_VERSION < QT_VERSION_CHECK(5, 10, 0)
#include <Qt3DExtras/QDiffuseMapMaterial>
#else
#include <Qt3DExtras/QDiffuseSpecularMaterial>
#endif
#include <Qt3DExtras/QPhongMaterial>
#include <Qt3DRender/QPaintedTextureImage>
#include <Qt3DRender/QTexture>
@@ -113,14 +109,6 @@ Qt3DRender::QMaterial *QgsPhongTexturedMaterialSettings::toMaterial( QgsMaterial
if ( !textureSourceImage.isNull() )
{
QgsImageTexture *textureImage = new QgsImageTexture( textureSourceImage );
#if QT_VERSION < QT_VERSION_CHECK(5, 10, 0)
Qt3DExtras::QDiffuseMapMaterial *material = new Qt3DExtras::QDiffuseMapMaterial;
material->diffuse()->addTextureImage( textureImage );

material->diffuse()->wrapMode()->setX( Qt3DRender::QTextureWrapMode::Repeat );
material->diffuse()->wrapMode()->setY( Qt3DRender::QTextureWrapMode::Repeat );
material->diffuse()->wrapMode()->setZ( Qt3DRender::QTextureWrapMode::Repeat );
#else
Qt3DExtras::QDiffuseSpecularMaterial *material = new Qt3DExtras::QDiffuseSpecularMaterial;

Qt3DRender::QTexture2D *texture = new Qt3DRender::QTexture2D();
@@ -137,7 +125,6 @@ Qt3DRender::QMaterial *QgsPhongTexturedMaterialSettings::toMaterial( QgsMaterial
texture->setMinificationFilter( Qt3DRender::QTexture2D::Linear );

material->setDiffuse( QVariant::fromValue( texture ) );
#endif

material->setSpecular( mSpecular );
material->setAmbient( mAmbient );
@@ -348,13 +348,8 @@ void QgsMeshDataset3dGeometry::init()
scalarMagnitude.count() != mTriangulaMesh.vertices().count() )
return;

#if QT_VERSION < QT_VERSION_CHECK(5, 10, 0)
Qt3DRender::QBuffer *vertexBuffer = new Qt3DRender::QBuffer( Qt3DRender::QBuffer::VertexBuffer, this );
Qt3DRender::QBuffer *indexBuffer = new Qt3DRender::QBuffer( Qt3DRender::QBuffer::IndexBuffer, this );
#else
Qt3DRender::QBuffer *vertexBuffer = new Qt3DRender::QBuffer( this );
Qt3DRender::QBuffer *indexBuffer = new Qt3DRender::QBuffer( this );
#endif

const int stride = ( 3 /*position*/ +
3 /*normale*/ +
@@ -450,13 +445,8 @@ QgsMeshTerrain3dGeometry::QgsMeshTerrain3dGeometry(

void QgsMeshTerrain3dGeometry::init()
{
#if QT_VERSION < QT_VERSION_CHECK(5, 10, 0)
Qt3DRender::QBuffer *vertexBuffer = new Qt3DRender::QBuffer( Qt3DRender::QBuffer::VertexBuffer, this );
Qt3DRender::QBuffer *indexBuffer = new Qt3DRender::QBuffer( Qt3DRender::QBuffer::IndexBuffer, this );
#else
Qt3DRender::QBuffer *vertexBuffer = new Qt3DRender::QBuffer( this );
Qt3DRender::QBuffer *indexBuffer = new Qt3DRender::QBuffer( this );
#endif

const int stride = ( 3 /*position*/ +
3 /*normale*/ ) * sizeof( float );
@@ -94,10 +94,8 @@ Qgs3DMapScene::Qgs3DMapScene( const Qgs3DMapSettings &map, QgsAbstract3DEngine *
// actually it is more busy than with the default "Always" policy although there are no changes in the scene.
//mRenderer->renderSettings()->setRenderPolicy( Qt3DRender::QRenderSettings::OnDemand );

#if QT_VERSION >= 0x050900
// we want precise picking of terrain (also bounding volume picking does not seem to work - not sure why)
mEngine->renderSettings()->pickingSettings()->setPickMethod( Qt3DRender::QPickingSettings::TrianglePicking );
#endif

QRect viewportRect( QPoint( 0, 0 ), mEngine->size() );

@@ -389,17 +387,6 @@ void Qgs3DMapScene::updateScene()
if ( entity->isEnabled() )
entity->update( _sceneState( mCameraController ) );
}
#if QT_VERSION < QT_VERSION_CHECK(5, 10, 0)
QgsWindow3DEngine *windowEngine = qobject_cast<QgsWindow3DEngine *>( mEngine );
if ( windowEngine != nullptr )
{
QVector<Qt3DRender::QLayer *> layers;
layers.push_back( windowEngine->shadowRenderingFrameGraph()->castShadowsLayer() );
layers.push_back( windowEngine->shadowRenderingFrameGraph()->forwardRenderLayer() );
removeQLayerComponentsFromHierarchy( this );
addQLayerComponentsToHierarchy( this, layers );
}
#endif
updateSceneState();
}

@@ -26,11 +26,7 @@
#include <Qt3DExtras/QPlaneGeometry>
#include <Qt3DCore/QTransform>
#include <Qt3DRender/QMaterial>
#if QT_VERSION < QT_VERSION_CHECK(5, 10, 0)
#include <Qt3DExtras/QDiffuseMapMaterial>
#else
#include <Qt3DExtras/QDiffuseSpecularMaterial>
#endif
#include <Qt3DExtras/QTextureMaterial>
#include <Qt3DRender/QTextureImage>
#include <Qt3DRender/QTexture>
@@ -231,19 +227,11 @@ void Qgs3DSceneExporter::processEntityMaterial( Qt3DCore::QEntity *entity, Qgs3D
QgsPhongMaterialSettings material = Qgs3DUtils::phongMaterialFromQt3DComponent( phongMaterial );
object->setupMaterial( &material );
}
#if QT_VERSION < QT_VERSION_CHECK(5, 10, 0)
Qt3DExtras::QDiffuseMapMaterial *diffuseMapMaterial = findTypedComponent<Qt3DExtras::QDiffuseMapMaterial>( entity );
#else
Qt3DExtras::QDiffuseSpecularMaterial *diffuseMapMaterial = findTypedComponent<Qt3DExtras::QDiffuseSpecularMaterial>( entity );
#endif

if ( diffuseMapMaterial != nullptr )
{
#if QT_VERSION < QT_VERSION_CHECK(5, 10, 0)
QVector<Qt3DRender::QAbstractTextureImage *> textureImages = diffuseMapMaterial->diffuse()->textureImages();
#else
QVector<Qt3DRender::QAbstractTextureImage *> textureImages = diffuseMapMaterial->diffuse().value< Qt3DRender::QTexture2D * >()->textureImages();
#endif
QgsImageTexture *imageTexture = nullptr;
for ( Qt3DRender::QAbstractTextureImage *tex : textureImages )
{
@@ -35,11 +35,7 @@ QgsPostprocessingEntity::QgsPostprocessingEntity( QgsShadowRenderingFrameGraph *

QByteArray vertexArr( ( const char * ) vert.constData(), vert.size() * sizeof( float ) );
Qt3DRender::QBuffer *vertexBuffer = nullptr;
#if QT_VERSION < QT_VERSION_CHECK(5, 10, 0)
vertexBuffer = new Qt3DRender::QBuffer( Qt3DRender::QBuffer::VertexBuffer, this );
#else
vertexBuffer = new Qt3DRender::QBuffer( this );
#endif
vertexBuffer->setData( vertexArr );

positionAttribute->setName( Qt3DRender::QAttribute::defaultPositionAttributeName() );
@@ -38,11 +38,7 @@ QgsPreviewQuad::QgsPreviewQuad( Qt3DRender::QAbstractTexture *texture,

QByteArray vertexArr( ( const char * ) vert.constData(), vert.size() * sizeof( float ) );
Qt3DRender::QBuffer *vertexBuffer = nullptr;
#if QT_VERSION < QT_VERSION_CHECK(5, 10, 0)
vertexBuffer = new Qt3DRender::QBuffer( Qt3DRender::QBuffer::VertexBuffer, this );
#else
vertexBuffer = new Qt3DRender::QBuffer( this );
#endif
vertexBuffer->setData( vertexArr );

positionAttribute->setName( Qt3DRender::QAttribute::defaultPositionAttributeName() );
@@ -151,12 +151,10 @@ QgsShadowRenderingFrameGraph::QgsShadowRenderingFrameGraph( QWindow *window, QSi
mCastShadowsLayer = new Qt3DRender::QLayer;
mForwardRenderLayer = new Qt3DRender::QLayer;

#if QT_VERSION >= QT_VERSION_CHECK(5, 10, 0)
mPostprocessPassLayer->setRecursive( true );
mPreviewLayer->setRecursive( true );
mCastShadowsLayer->setRecursive( true );
mForwardRenderLayer->setRecursive( true );
#endif

mRenderSurfaceSelector = new Qt3DRender::QRenderSurfaceSelector;
mRenderSurfaceSelector->setSurface( window );
@@ -32,11 +32,7 @@ QgsTessellatedPolygonGeometry::QgsTessellatedPolygonGeometry( bool _withNormals,
mAddBackFaces( _addBackFaces ),
mAddTextureCoords( _addTextureCoords )
{
#if QT_VERSION < QT_VERSION_CHECK(5, 10, 0)
mVertexBuffer = new Qt3DRender::QBuffer( Qt3DRender::QBuffer::VertexBuffer, this );
#else
mVertexBuffer = new Qt3DRender::QBuffer( this );
#endif

QgsTessellator tmpTess( 0, 0, mWithNormals, false, false, false, mAddTextureCoords );
const int stride = tmpTess.stride();
@@ -20,11 +20,7 @@
QgsBillboardGeometry::QgsBillboardGeometry( Qt3DCore::QNode *parent )
: Qt3DRender::QGeometry( parent )
, mPositionAttribute( new Qt3DRender::QAttribute( this ) )
#if QT_VERSION < QT_VERSION_CHECK(5, 10, 0)
, mVertexBuffer( new Qt3DRender::QBuffer( Qt3DRender::QBuffer::VertexBuffer, this ) )
#else
, mVertexBuffer( new Qt3DRender::QBuffer( this ) )
#endif
{

mPositionAttribute->setAttributeType( Qt3DRender::QAttribute::VertexAttribute );
@@ -70,18 +70,10 @@ QByteArray QgsLineVertexData::createIndexBuffer()

Qt3DRender::QGeometry *QgsLineVertexData::createGeometry( Qt3DCore::QNode *parent )
{
#if QT_VERSION < QT_VERSION_CHECK(5, 10, 0)
Qt3DRender::QBuffer *vertexBuffer = new Qt3DRender::QBuffer( Qt3DRender::QBuffer::VertexBuffer, parent );
#else
Qt3DRender::QBuffer *vertexBuffer = new Qt3DRender::QBuffer( parent );
#endif
vertexBuffer->setData( createVertexBuffer() );

#if QT_VERSION < QT_VERSION_CHECK(5, 10, 0)
Qt3DRender::QBuffer *indexBuffer = new Qt3DRender::QBuffer( Qt3DRender::QBuffer::IndexBuffer, parent );
#else
Qt3DRender::QBuffer *indexBuffer = new Qt3DRender::QBuffer( parent );
#endif
indexBuffer->setData( createIndexBuffer() );

QgsDebugMsgLevel( QString( "vertex buffer %1 MB index buffer %2 MB " ).arg( vertexBuffer->data().count() / 1024. / 1024. ).arg( indexBuffer->data().count() / 1024. / 1024. ), 2 );
@@ -34,9 +34,7 @@

#include <Qt3DRender/QMesh>

#if QT_VERSION >= 0x050900
#include <Qt3DExtras/QExtrudedTextGeometry>
#endif

#include <QUrl>
#include <QVector3D>
@@ -222,11 +220,7 @@ Qt3DRender::QGeometryRenderer *QgsInstancedPoint3DSymbolHandler::renderer( const
ba.resize( byteCount );
memcpy( ba.data(), positions.constData(), byteCount );

#if QT_VERSION < QT_VERSION_CHECK(5, 10, 0)
Qt3DRender::QBuffer *instanceBuffer = new Qt3DRender::QBuffer( Qt3DRender::QBuffer::VertexBuffer );
#else
Qt3DRender::QBuffer *instanceBuffer = new Qt3DRender::QBuffer();
#endif
instanceBuffer->setData( ba );

Qt3DRender::QAttribute *instanceDataAttribute = new Qt3DRender::QAttribute;
@@ -318,7 +312,6 @@ Qt3DRender::QGeometry *QgsInstancedPoint3DSymbolHandler::symbolGeometry( QgsPoin
return g;
}

#if QT_VERSION >= 0x050900
case QgsPoint3DSymbol::ExtrudedText:
{
float depth = shapeProperties[QStringLiteral( "depth" )].toFloat();
@@ -328,7 +321,6 @@ Qt3DRender::QGeometry *QgsInstancedPoint3DSymbolHandler::symbolGeometry( QgsPoin
g->setText( text );
return g;
}
#endif

default:
Q_ASSERT( false );
@@ -39,11 +39,7 @@ QgsPointCloud3DGeometry::QgsPointCloud3DGeometry( Qt3DCore::QNode *parent, unsig
, mPositionAttribute( new Qt3DRender::QAttribute( this ) )
, mParameterAttribute( new Qt3DRender::QAttribute( this ) )
, mColorAttribute( new Qt3DRender::QAttribute( this ) )
#if QT_VERSION < QT_VERSION_CHECK(5, 10, 0)
, mVertexBuffer( new Qt3DRender::QBuffer( Qt3DRender::QBuffer::VertexBuffer, this ) )
#else
, mVertexBuffer( new Qt3DRender::QBuffer( this ) )
#endif
, mByteStride( byteStride )
{

@@ -356,14 +356,8 @@ void DemTerrainTileGeometry::init()
mNormalAttribute = new QAttribute( this );
mTexCoordAttribute = new QAttribute( this );
mIndexAttribute = new QAttribute( this );
#if QT_VERSION < QT_VERSION_CHECK(5, 10, 0)
mVertexBuffer = new Qt3DRender::QBuffer( Qt3DRender::QBuffer::VertexBuffer, this );
mIndexBuffer = new Qt3DRender::QBuffer( Qt3DRender::QBuffer::IndexBuffer, this );
#else
mVertexBuffer = new Qt3DRender::QBuffer( this );
mIndexBuffer = new Qt3DRender::QBuffer( this );
#endif


int nVertsX = mResolution + 2;
int nVertsZ = mResolution + 2;
@@ -26,11 +26,7 @@
#include <Qt3DRender/QTexture>

#include <Qt3DExtras/QTextureMaterial>
#if QT_VERSION < QT_VERSION_CHECK(5, 10, 0)
#include <Qt3DExtras/QDiffuseMapMaterial>
#else
#include <Qt3DExtras/QDiffuseSpecularMaterial>
#endif
#include <Qt3DExtras/QPhongMaterial>

#include "quantizedmeshterraingenerator.h"
@@ -73,15 +69,9 @@ void QgsTerrainTileLoader::createTextureComponent( QgsTerrainTileEntity *entity,
{
if ( isShadingEnabled )
{
#if QT_VERSION < QT_VERSION_CHECK(5, 10, 0)
Qt3DExtras::QDiffuseMapMaterial *diffuseMapMaterial;
diffuseMapMaterial = new Qt3DExtras::QDiffuseMapMaterial;
diffuseMapMaterial->setDiffuse( texture );
#else
Qt3DExtras::QDiffuseSpecularMaterial *diffuseMapMaterial = new Qt3DExtras::QDiffuseSpecularMaterial;
diffuseMapMaterial->setDiffuse( QVariant::fromValue( texture ) );
material = diffuseMapMaterial;
#endif
diffuseMapMaterial->setAmbient( shadingMaterial.ambient() );
diffuseMapMaterial->setSpecular( shadingMaterial.specular() );
diffuseMapMaterial->setShininess( shadingMaterial.shininess() );
@@ -864,11 +864,7 @@ QgsLayoutDesignerDialog::QgsLayoutDesignerDialog( QWidget *parent, Qt::WindowFla
mMenuProvider = new QgsLayoutAppMenuProvider( this );
mView->setMenuProvider( mMenuProvider );

#if QT_VERSION < QT_VERSION_CHECK(5, 11, 0)
int minDockWidth( fontMetrics().width( QStringLiteral( "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX" ) ) );
#else
int minDockWidth = fontMetrics().horizontalAdvance( 'X' ) * 38;
#endif

setTabPosition( Qt::AllDockWidgetAreas, QTabWidget::North );
mGeneralDock = new QgsDockWidget( tr( "Layout" ), this );
@@ -886,16 +886,14 @@ int main( int argc, char *argv[] )
QCoreApplication::setOrganizationDomain( QgsApplication::QGIS_ORGANIZATION_DOMAIN );
QCoreApplication::setApplicationName( QgsApplication::QGIS_APPLICATION_NAME );
QCoreApplication::setAttribute( Qt::AA_DontShowIconsInMenus, false );
#if QT_VERSION >= QT_VERSION_CHECK(5, 10, 0)
QCoreApplication::setAttribute( Qt::AA_DisableWindowContextHelpButton, true );
#endif

// Set up an OpenGL Context to be shared between threads beforehand
// for plugins that depend on Qt WebEngine module.
// As suggested by Qt documentation at:
// - https://doc.qt.io/qt-5/qtwebengine.html
// - https://code.qt.io/cgit/qt/qtwebengine.git/plain/src/webenginewidgets/api/qtwebenginewidgetsglobal.cpp
#if defined(QT_OS_WIN) && !defined(QT_NO_OPENGL) && (QT_VERSION >= QT_VERSION_CHECK(5, 4, 0) )
#if defined(QT_OS_WIN) && !defined(QT_NO_OPENGL)
QCoreApplication::setAttribute( Qt::AA_ShareOpenGLContexts, true );
#endif

@@ -2571,11 +2571,7 @@ int QgisApp::chooseReasonableDefaultIconSize() const
}
else
{
#if QT_VERSION < QT_VERSION_CHECK(5, 11, 0)
double size = fontMetrics().width( QStringLiteral( "XXX" ) );
#else
double size = fontMetrics().horizontalAdvance( 'X' ) * 3;
#endif
if ( size < 24 )
return 16;
else if ( size < 32 )
@@ -3094,13 +3090,11 @@ void QgisApp::createActionGroups()

void QgisApp::setAppStyleSheet( const QString &stylesheet )
{
#if QT_VERSION >= QT_VERSION_CHECK(5, 11, 0)
// avoid crash on stylesheet change -- see https://bugreports.qt.io/browse/QTBUG-69204
static bool sOnce = false;
if ( sOnce )
return;
sOnce = true;
#endif

setStyleSheet( stylesheet );

0 comments on commit f083876

Please sign in to comment.