Skip to content

Commit dc72f06

Browse files
committedNov 5, 2018
Bump minimum Qt version to 5.9
1 parent 993dc81 commit dc72f06

30 files changed

+4
-194
lines changed
 

‎CMakeLists.txt

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -315,14 +315,7 @@ IF(WITH_CORE)
315315
ENDIF(WITH_QTWEBKIT)
316316
#############################################################
317317
# search for Qt5
318-
IF (WITH_3D)
319-
# for 3D support we strictly require Qt >= 5.9
320-
# (Qt 3D was introduced in 5.7 but it is not stable enough in that branch)
321-
# Qt 5.8 is missing some classes, https://github.com/qgis/QGIS/pull/5203#discussion_r142319862
322-
SET(QT_MIN_VERSION 5.9.0)
323-
ELSE ()
324-
SET(QT_MIN_VERSION 5.4.0)
325-
ENDIF()
318+
SET(QT_MIN_VERSION 5.9.0)
326319
FIND_PACKAGE(Qt5Core QUIET)
327320
FIND_PACKAGE(Qt5Gui REQUIRED)
328321
FIND_PACKAGE(Qt5Widgets REQUIRED)

‎INSTALL

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ Required build tools:
9797

9898
Required build dependencies:
9999

100-
- Qt >= 5.3.0
100+
- Qt >= 5.9.0
101101
- Proj >= 4.4.x
102102
- GEOS >= 3.4
103103
- Sqlite3 >= 3.0.0

‎doc/overview.t2t

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ Required build tools:
1515

1616
Required build dependencies:
1717

18-
- Qt >= 5.3.0
18+
- Qt >= 5.9.0
1919
- Proj >= 4.4.x
2020
- GEOS >= 3.4
2121
- Sqlite3 >= 3.0.0

‎python/plugins/db_manager/dlg_sql_window.py

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -97,11 +97,7 @@ def __init__(self, iface, db, parent=None):
9797
self.btnCancel.setText(self.tr("Cancel (ESC)"))
9898
self.btnCancel.setEnabled(False)
9999
self.btnCancel.clicked.connect(self.executeSqlCanceled)
100-
try:
101-
self.btnCancel.setShortcut(QKeySequence.Cancel)
102-
except AttributeError:
103-
# QKeySequence.Cancel only available in Qt >= 5.6
104-
pass
100+
self.btnCancel.setShortcut(QKeySequence.Cancel)
105101
self.progressBar.setEnabled(False)
106102
self.progressBar.setRange(0, 100)
107103
self.progressBar.setValue(0)

‎src/app/decorations/qgsdecorationcopyright.cpp

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -125,13 +125,8 @@ void QgsDecorationCopyright::render( const QgsMapSettings &mapSettings, QgsRende
125125
double textHeight = QgsTextRenderer::textHeight( context, mTextFormat, displayStringList, QgsTextRenderer::Point, &fm );
126126

127127
QPaintDevice *device = context.painter()->device();
128-
#if QT_VERSION < 0x050600
129-
int deviceHeight = device->height() / device->devicePixelRatio();
130-
int deviceWidth = device->width() / device->devicePixelRatio();
131-
#else
132128
int deviceHeight = device->height() / device->devicePixelRatioF();
133129
int deviceWidth = device->width() / device->devicePixelRatioF();
134-
#endif
135130

136131
float xOffset( 0 ), yOffset( 0 );
137132

‎src/app/decorations/qgsdecorationnortharrow.cpp

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -169,13 +169,8 @@ void QgsDecorationNorthArrow::render( const QgsMapSettings &mapSettings, QgsRend
169169
) - centerYDouble );
170170
// need width/height of paint device
171171
QPaintDevice *device = context.painter()->device();
172-
#if QT_VERSION < 0x050600
173-
int deviceHeight = device->height() / device->devicePixelRatio();
174-
int deviceWidth = device->width() / device->devicePixelRatio();
175-
#else
176172
int deviceHeight = device->height() / device->devicePixelRatioF();
177173
int deviceWidth = device->width() / device->devicePixelRatioF();
178-
#endif
179174

180175
// Set margin according to selected units
181176
int xOffset = 0;

‎src/app/decorations/qgsdecorationscalebar.cpp

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -178,13 +178,8 @@ void QgsDecorationScaleBar::render( const QgsMapSettings &mapSettings, QgsRender
178178

179179
//Get canvas dimensions
180180
QPaintDevice *device = context.painter()->device();
181-
#if QT_VERSION < 0x050600
182-
int deviceHeight = device->height() / device->devicePixelRatio();
183-
int deviceWidth = device->width() / device->devicePixelRatio();
184-
#else
185181
int deviceHeight = device->height() / device->devicePixelRatioF();
186182
int deviceWidth = device->width() / device->devicePixelRatioF();
187-
#endif
188183

189184
//Get map units per pixel. This can be negative at times (to do with
190185
//projections) and that just confuses the rest of the code in this

‎src/app/layout/qgslayoutdesignerdialog.cpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -248,9 +248,7 @@ QgsLayoutDesignerDialog::QgsLayoutDesignerDialog( QWidget *parent, Qt::WindowFla
248248
setAcceptDrops( true );
249249

250250
setAttribute( Qt::WA_DeleteOnClose );
251-
#if QT_VERSION >= 0x050600
252251
setDockOptions( dockOptions() | QMainWindow::GroupedDragging );
253-
#endif
254252

255253
//create layout view
256254
QGridLayout *viewLayout = new QGridLayout();

‎src/app/main.cpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -411,11 +411,9 @@ void myMessageOutput( QtMsgType type, const char *msg )
411411
break; // silence warnings
412412
}
413413

414-
#if QT_VERSION >= 0x050500
415414
case QtInfoMsg:
416415
myPrint( "Info: %s\n", msg );
417416
break;
418-
#endif
419417
}
420418
}
421419

‎src/app/qgisapp.cpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -712,9 +712,7 @@ QgisApp::QgisApp( QSplashScreen *splash, bool restorePlugins, bool skipVersionCh
712712
this->addAction( mActionToggleMapOnly );
713713
endProfile();
714714

715-
#if QT_VERSION >= 0x050600
716715
setDockOptions( dockOptions() | QMainWindow::GroupedDragging );
717-
#endif
718716

719717
//////////
720718

‎src/app/qgisappstylesheet.cpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,6 @@ void QgisAppStyleSheet::buildStyleSheet( const QMap<QString, QVariant> &opts )
108108
if ( fontSize != defaultSize || fontFamily != defaultFamily )
109109
ss += QStringLiteral( "* { font: %1pt \"%2\"} " ).arg( fontSize, fontFamily );
110110

111-
#if QT_VERSION >= 0x050900
112111
// Fix for macOS Qt 5.9+, where close boxes do not show on document mode tab bar tabs
113112
// See: https://bugreports.qt.io/browse/QTBUG-61092
114113
// https://bugreports.qt.io/browse/QTBUG-61742
@@ -121,7 +120,6 @@ void QgisAppStyleSheet::buildStyleSheet( const QMap<QString, QVariant> &opts )
121120
ss += QLatin1String( "QTabBar::close-button{ image: url(:/images/themes/default/mIconCloseTab.svg); }" );
122121
ss += QLatin1String( "QTabBar::close-button:hover{ image: url(:/images/themes/default/mIconCloseTabHover.svg); }" );
123122
}
124-
#endif
125123

126124
// QGroupBox and QgsCollapsibleGroupBox, mostly for Ubuntu and Mac
127125
bool gbxCustom = opts.value( QStringLiteral( "groupBoxCustom" ) ).toBool();

‎src/app/qgsapplayertreeviewmenuprovider.cpp

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -330,13 +330,7 @@ QMenu *QgsAppLayerTreeViewMenuProvider::createContextMenu()
330330
for ( int row = 0; row < model->rowCount(); ++row )
331331
{
332332
QModelIndex index = model->index( row, 0 );
333-
#if QT_VERSION <= 0x050601
334-
// in Qt 5.6.1 and former, QVariant does not correctly convert enum using value
335-
// see https://bugreports.qt.io/browse/QTBUG-53384
336-
QgsMapLayer::StyleCategory category = static_cast<QgsMapLayer::StyleCategory>( model->data( index, Qt::UserRole ).toInt() );
337-
#else
338333
QgsMapLayer::StyleCategory category = model->data( index, Qt::UserRole ).value<QgsMapLayer::StyleCategory>();
339-
#endif
340334
QString name = model->data( index, Qt::DisplayRole ).toString();
341335
QString tooltip = model->data( index, Qt::ToolTipRole ).toString();
342336
QIcon icon = model->data( index, Qt::DecorationRole ).value<QIcon>();
@@ -375,13 +369,7 @@ QMenu *QgsAppLayerTreeViewMenuProvider::createContextMenu()
375369
for ( int row = 0; row < model->rowCount(); ++row )
376370
{
377371
QModelIndex index = model->index( row, 0 );
378-
#if QT_VERSION <= 0x050601
379-
// in Qt 5.6.1 and former, QVariant does not correctly convert enum using value
380-
// see https://bugreports.qt.io/browse/QTBUG-53384
381-
QgsMapLayer::StyleCategory category = static_cast<QgsMapLayer::StyleCategory>( model->data( index, Qt::UserRole ).toInt() );
382-
#else
383372
QgsMapLayer::StyleCategory category = model->data( index, Qt::UserRole ).value<QgsMapLayer::StyleCategory>();
384-
#endif
385373
QString name = model->data( index, Qt::DisplayRole ).toString();
386374
QString tooltip = model->data( index, Qt::ToolTipRole ).toString();
387375
QIcon icon = model->data( index, Qt::DecorationRole ).value<QIcon>();

‎src/app/qgsmaplayerstylecategoriesmodel.cpp

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -242,13 +242,7 @@ bool QgsMapLayerStyleCategoriesModel::setData( const QModelIndex &index, const Q
242242

243243
if ( role == Qt::CheckStateRole )
244244
{
245-
#if QT_VERSION <= 0x050601
246-
// in Qt 5.6.1 and former, QVariant does not correctly convert enum using value
247-
// see https://bugreports.qt.io/browse/QTBUG-53384
248-
QgsMapLayer::StyleCategory category = static_cast<QgsMapLayer::StyleCategory>( data( index, Qt::UserRole ).toInt() );
249-
#else
250245
QgsMapLayer::StyleCategory category = data( index, Qt::UserRole ).value<QgsMapLayer::StyleCategory>();
251-
#endif
252246
if ( value.value<Qt::CheckState>() == Qt::Checked )
253247
{
254248
mCategories |= category;

‎src/app/qgsoptions.cpp

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1608,13 +1608,7 @@ void QgsOptions::saveOptions()
16081608
mSettings->setValue( QStringLiteral( "/qgis/digitizing/disable_enter_attribute_values_dialog" ), chkDisableAttributeValuesDlg->isChecked() );
16091609
mSettings->setValue( QStringLiteral( "/qgis/digitizing/validate_geometries" ), mValidateGeometries->currentIndex() );
16101610

1611-
#if QT_VERSION <= 0x050601
1612-
// in Qt 5.6.1 and former, QVariant does not correctly convert enum using value
1613-
// see https://bugreports.qt.io/browse/QTBUG-53384
1614-
mSettings->setEnumValue( QStringLiteral( "/qgis/digitizing/offset_join_style" ), static_cast<QgsGeometry::JoinStyle>( mOffsetJoinStyleComboBox->currentData().toInt() ) );
1615-
#else
16161611
mSettings->setEnumValue( QStringLiteral( "/qgis/digitizing/offset_join_style" ), mOffsetJoinStyleComboBox->currentData().value<QgsGeometry::JoinStyle>() );
1617-
#endif
16181612
mSettings->setValue( QStringLiteral( "/qgis/digitizing/offset_quad_seg" ), mOffsetQuadSegSpinBox->value() );
16191613
mSettings->setValue( QStringLiteral( "/qgis/digitizing/offset_miter_limit" ), mCurveOffsetMiterLimitComboBox->value() );
16201614

‎src/app/qgsrelationadddlg.cpp

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -80,13 +80,7 @@ QString QgsRelationAddDlg::relationName()
8080

8181
QgsRelation::RelationStrength QgsRelationAddDlg::relationStrength()
8282
{
83-
#if QT_VERSION <= 0x050601
84-
// in Qt 5.6.1 and former, QVariant does not correctly convert enum using value
85-
// see https://bugreports.qt.io/browse/QTBUG-53384
86-
return static_cast<QgsRelation::RelationStrength>( mCbxRelationStrength->currentData().toInt() );
87-
#else
8883
return mCbxRelationStrength->currentData().value<QgsRelation::RelationStrength>();
89-
#endif
9084
}
9185

9286
void QgsRelationAddDlg::checkDefinitionValid()

‎src/app/qgsvectorlayerloadstyledialog.cpp

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -115,13 +115,7 @@ QgsMapLayer::StyleCategories QgsVectorLayerLoadStyleDialog::styleCategories() co
115115

116116
QgsVectorLayerProperties::StyleType QgsVectorLayerLoadStyleDialog::currentStyleType() const
117117
{
118-
#if QT_VERSION <= 0x050601
119-
// in Qt 5.6.1 and former, QVariant does not correctly convert enum using value
120-
// see https://bugreports.qt.io/browse/QTBUG-53384
121-
QgsVectorLayerProperties::StyleType type = static_cast<QgsVectorLayerProperties::StyleType>( mStyleTypeComboBox->currentData().toInt() );
122-
#else
123118
QgsVectorLayerProperties::StyleType type = mStyleTypeComboBox->currentData().value<QgsVectorLayerProperties::StyleType>();
124-
#endif
125119
if ( type == QgsVectorLayerProperties::QML )
126120
{
127121
QFileInfo fi( mFileWidget->filePath() );

‎src/core/dxf/qgsdxfpaintdevice.cpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,10 +57,8 @@ int QgsDxfPaintDevice::metric( PaintDeviceMetric metric ) const
5757
return 96;
5858
case QPaintDevice::PdmDevicePixelRatio:
5959
return 1;
60-
#if (QT_VERSION >= QT_VERSION_CHECK(5, 6, 0))
6160
case QPaintDevice::PdmDevicePixelRatioScaled:
6261
return 1;
63-
#endif
6462
}
6563
return 0;
6664
}

‎src/core/processing/qgsprocessingparametertypeimpl.h

Lines changed: 0 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -562,13 +562,7 @@ class CORE_EXPORT QgsProcessingParameterTypeVectorDestination : public QgsProces
562562
ParameterFlags flags() const override
563563
{
564564
ParameterFlags flags = QgsProcessingParameterType::flags();
565-
566-
#if QT_VERSION >= 0x50700
567565
flags.setFlag( ParameterFlag::ExposeToModeler, false );
568-
#else
569-
flags &= ~ParameterFlag::ExposeToModeler;
570-
#endif
571-
572566
return flags;
573567
}
574568

@@ -613,13 +607,7 @@ class CORE_EXPORT QgsProcessingParameterTypeFileDestination : public QgsProcessi
613607
ParameterFlags flags() const override
614608
{
615609
ParameterFlags flags = QgsProcessingParameterType::flags();
616-
617-
#if QT_VERSION >= 0x50700
618610
flags.setFlag( ParameterFlag::ExposeToModeler, false );
619-
#else
620-
flags &= ~ParameterFlag::ExposeToModeler;
621-
#endif
622-
623611
return flags;
624612
}
625613

@@ -664,13 +652,7 @@ class CORE_EXPORT QgsProcessingParameterTypeFolderDestination : public QgsProces
664652
ParameterFlags flags() const override
665653
{
666654
ParameterFlags flags = QgsProcessingParameterType::flags();
667-
668-
#if QT_VERSION >= 0x50700
669655
flags.setFlag( ParameterFlag::ExposeToModeler, false );
670-
#else
671-
flags &= ~ParameterFlag::ExposeToModeler;
672-
#endif
673-
674656
return flags;
675657
}
676658

@@ -714,13 +696,7 @@ class CORE_EXPORT QgsProcessingParameterTypeRasterDestination : public QgsProces
714696
ParameterFlags flags() const override
715697
{
716698
ParameterFlags flags = QgsProcessingParameterType::flags();
717-
718-
#if QT_VERSION >= 0x50700
719699
flags.setFlag( ParameterFlag::ExposeToModeler, false );
720-
#else
721-
flags &= ~ParameterFlag::ExposeToModeler;
722-
#endif
723-
724700
return flags;
725701
}
726702

@@ -976,13 +952,7 @@ class CORE_EXPORT QgsProcessingParameterTypeFeatureSink : public QgsProcessingPa
976952
ParameterFlags flags() const override
977953
{
978954
ParameterFlags flags = QgsProcessingParameterType::flags();
979-
980-
#if QT_VERSION >= 0x50700
981955
flags.setFlag( ParameterFlag::ExposeToModeler, false );
982-
#else
983-
flags &= ~ParameterFlag::ExposeToModeler;
984-
#endif
985-
986956
return flags;
987957
}
988958

‎src/core/qgis.cpp

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -264,30 +264,9 @@ uint qHash( const QVariant &variant )
264264
case QVariant::Char:
265265
return qHash( variant.toChar() );
266266
case QVariant::List:
267-
268-
#if QT_VERSION >= 0x050600
269267
return qHash( variant.toList() );
270-
#else
271-
{
272-
QVariantList list = variant.toList();
273-
if ( list.isEmpty() )
274-
return -1;
275-
else
276-
return qHash( list.at( 0 ) );
277-
}
278-
#endif
279268
case QVariant::StringList:
280-
#if QT_VERSION >= 0x050600
281269
return qHash( variant.toStringList() );
282-
#else
283-
{
284-
QStringList list = variant.toStringList();
285-
if ( list.isEmpty() )
286-
return -1;
287-
else
288-
return qHash( list.at( 0 ) );
289-
}
290-
#endif
291270
case QVariant::ByteArray:
292271
return qHash( variant.toByteArray() );
293272
case QVariant::Date:

‎src/core/qgsfeaturefiltermodel.cpp

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -256,12 +256,7 @@ void QgsFeatureFilterModel::updateCompleter()
256256
if ( mExtraIdentifierValueIndex != 0 )
257257
{
258258
beginMoveRows( QModelIndex(), mExtraIdentifierValueIndex, mExtraIdentifierValueIndex, QModelIndex(), 0 );
259-
#if QT_VERSION < QT_VERSION_CHECK(5, 6, 0)
260-
Entry extraEntry = mEntries.takeAt( mExtraIdentifierValueIndex );
261-
mEntries.prepend( extraEntry );
262-
#else
263259
mEntries.move( mExtraIdentifierValueIndex, 0 );
264-
#endif
265260
endMoveRows();
266261
}
267262
firstRow = 1;

‎src/core/qgsfontutils.cpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -493,7 +493,6 @@ QString QgsFontUtils::asCSS( const QFont &font, double pointToPixelScale )
493493
case QFont::Black:
494494
cssWeight = 900;
495495
break;
496-
#if QT_VERSION >= 0x050500
497496
case QFont::Thin:
498497
cssWeight = 100;
499498
break;
@@ -506,7 +505,6 @@ QString QgsFontUtils::asCSS( const QFont &font, double pointToPixelScale )
506505
case QFont::ExtraBold:
507506
cssWeight = 800;
508507
break;
509-
#endif
510508
}
511509
css += QStringLiteral( "font-weight: %1;" ).arg( cssWeight );
512510

‎src/core/qgsrenderchecker.cpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -194,9 +194,7 @@ bool QgsRenderChecker::runTest( const QString &testName,
194194
mElapsedTime = myTime.elapsed();
195195

196196
QImage myImage = job.renderedImage();
197-
#if QT_VERSION >= 0x050600
198197
Q_ASSERT( myImage.devicePixelRatioF() == mMapSettings.devicePixelRatio() );
199-
#endif
200198

201199
//
202200
// Save the pixmap to disk so the user can make a

0 commit comments

Comments
 (0)
Please sign in to comment.