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

‎src/core/qgstaskmanager.cpp

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -82,15 +82,11 @@ void QgsTask::cancel()
8282
return;
8383

8484
mShouldTerminate = true;
85-
86-
#if QT_VERSION >= 0x050500
87-
//can't cancel queued tasks with qt < 5.5
8885
if ( mStatus == Queued || mStatus == OnHold )
8986
{
9087
// immediately terminate unstarted jobs
9188
terminated();
9289
}
93-
#endif
9490

9591
if ( mStatus == Terminated )
9692
{
@@ -661,14 +657,11 @@ void QgsTaskManager::taskStatusChanged( int status )
661657
if ( id < 0 )
662658
return;
663659

664-
665-
#if QT_VERSION >= 0x050500
666660
mTaskMutex->lock();
667661
QgsTaskRunnableWrapper *runnable = mTasks.value( id ).runnable;
668662
mTaskMutex->unlock();
669663
if ( runnable )
670664
QThreadPool::globalInstance()->cancel( runnable );
671-
#endif
672665

673666
if ( status == QgsTask::Terminated || status == QgsTask::Complete )
674667
{
@@ -770,10 +763,8 @@ bool QgsTaskManager::cleanupAndDeleteTask( QgsTask *task )
770763
}
771764
else
772765
{
773-
#if QT_VERSION >= 0x050500
774766
if ( runnable )
775767
QThreadPool::globalInstance()->cancel( runnable );
776-
#endif
777768
if ( isParent )
778769
{
779770
//task already finished, kill it

‎src/core/qgsvectorlayer.cpp

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,7 @@
3535
#include <QVector>
3636
#include <QStringBuilder>
3737
#include <QUrl>
38-
#if QT_VERSION >= 0x050900
3938
#include <QUndoCommand>
40-
#endif
4139

4240
#include "qgssettings.h"
4341
#include "qgsvectorlayer.h"
@@ -3272,15 +3270,13 @@ void QgsVectorLayer::destroyEditCommand()
32723270
undoStack()->endMacro();
32733271
undoStack()->undo();
32743272

3275-
#if QT_VERSION >= 0x050900 // setObsolete is new in Qt 5.9
32763273
// it's not directly possible to pop the last command off the stack (the destroyed one)
32773274
// and delete, so we add a dummy obsolete command to force this to occur.
32783275
// Pushing the new command deletes the destroyed one, and since the new
32793276
// command is obsolete it's automatically deleted by the undo stack.
32803277
std::unique_ptr< QUndoCommand > command = qgis::make_unique< QUndoCommand >();
32813278
command->setObsolete( true );
32823279
undoStack()->push( command.release() );
3283-
#endif
32843280

32853281
mEditCommandActive = false;
32863282
mDeletedFids.clear();

‎src/gui/attributetable/qgsdualview.cpp

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -574,11 +574,7 @@ void QgsDualView::viewWillShowContextMenu( QMenu *menu, const QModelIndex &atInd
574574
continue;
575575

576576
QgsAttributeTableAction *a = new QgsAttributeTableAction( action.name(), this, action.id(), sourceIndex );
577-
#if QT_VERSION < QT_VERSION_CHECK(5, 6, 0)
578-
menu->addAction( action.name(), a, SLOT( execute() ) );
579-
#else
580577
menu->addAction( action.name(), a, &QgsAttributeTableAction::execute );
581-
#endif
582578
}
583579
}
584580

@@ -592,21 +588,13 @@ void QgsDualView::viewWillShowContextMenu( QMenu *menu, const QModelIndex &atInd
592588
Q_FOREACH ( QgsMapLayerAction *action, registeredActions )
593589
{
594590
QgsAttributeTableMapLayerAction *a = new QgsAttributeTableMapLayerAction( action->text(), this, action, sourceIndex );
595-
#if QT_VERSION < QT_VERSION_CHECK(5, 6, 0)
596-
menu->addAction( action->text(), a, SLOT( execut() ) );
597-
#else
598591
menu->addAction( action->text(), a, &QgsAttributeTableMapLayerAction::execute );
599-
#endif
600592
}
601593
}
602594

603595
menu->addSeparator();
604596
QgsAttributeTableAction *a = new QgsAttributeTableAction( tr( "Open Form" ), this, QString(), sourceIndex );
605-
#if QT_VERSION < QT_VERSION_CHECK(5, 6, 0)
606-
menu->addAction( tr( "Open Form" ), a, SLOT( featureForm() ) );
607-
#else
608597
menu->addAction( tr( "Open Form" ), a, &QgsAttributeTableAction::featureForm );
609-
#endif
610598
}
611599

612600

‎src/gui/qgsmapcanvas.cpp

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -697,11 +697,7 @@ QgsRectangle QgsMapCanvas::imageRect( const QImage &img, const QgsMapSettings &m
697697
QgsLogger::warning( QStringLiteral( "The renderer map has a wrong device pixel ratio" ) );
698698
}
699699
#endif
700-
#if QT_VERSION >= 0x050600
701700
double res = m2p.mapUnitsPerPixel() / img.devicePixelRatioF();
702-
#else
703-
double res = m2p.mapUnitsPerPixel() / img.devicePixelRatio();
704-
#endif
705701
QgsRectangle rect( topLeft.x(), topLeft.y(), topLeft.x() + img.width()*res, topLeft.y() - img.height()*res );
706702
return rect;
707703
}

‎src/gui/qgsmapcanvasmap.cpp

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -65,23 +65,12 @@ void QgsMapCanvasMap::paint( QPainter *painter )
6565
int h = std::round( mItemSize.height() ) - 2;
6666

6767
bool scale = false;
68-
#if QT_VERSION >= 0x050600
6968
if ( mImage.size() != QSize( w, h ) * mImage.devicePixelRatioF() )
70-
#else
71-
if ( mImage.size() != QSize( w, h ) * mImage.devicePixelRatio() )
72-
#endif
7369
{
74-
#if QT_VERSION >= 0x050600
7570
QgsDebugMsg( QStringLiteral( "map paint DIFFERENT SIZE: img %1,%2 item %3,%4" )
7671
.arg( mImage.width() / mImage.devicePixelRatioF() )
7772
.arg( mImage.height() / mImage.devicePixelRatioF() )
7873
.arg( w ).arg( h ) );
79-
#else
80-
QgsDebugMsg( QStringLiteral( "map paint DIFFERENT SIZE: img %1,%2 item %3,%4" )
81-
.arg( mImage.width() / mImage.devicePixelRatio() )
82-
.arg( mImage.height() / mImage.devicePixelRatio() )
83-
.arg( w ).arg( h ) );
84-
#endif
8574
// This happens on zoom events when ::paint is called before
8675
// the renderer has completed
8776
scale = true;

‎src/providers/postgres/qgspostgresprovider.cpp

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -373,17 +373,6 @@ QString QgsPostgresProvider::storageType() const
373373
return QStringLiteral( "PostgreSQL database with PostGIS extension" );
374374
}
375375

376-
#if QT_VERSION < 0x050600
377-
#include <algorithm>
378-
template <typename T>
379-
bool operator<( const QList<T> &lhs, const QList<T> &rhs )
380-
{
381-
return std::lexicographical_compare( lhs.begin(), lhs.end(),
382-
rhs.begin(), rhs.end() );
383-
}
384-
#endif
385-
386-
387376
QgsFeatureIterator QgsPostgresProvider::getFeatures( const QgsFeatureRequest &request ) const
388377
{
389378
if ( !mValid )

‎tests/src/core/testqgsfield.cpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -333,9 +333,7 @@ void TestQgsField::displayString()
333333
QgsField doubleFieldNoPrec( QStringLiteral( "double" ), QVariant::Double, QStringLiteral( "double" ), 10 );
334334
QCOMPARE( doubleFieldNoPrec.displayString( 5.005005 ), QString( "5.005005" ) );
335335
QCOMPARE( doubleFieldNoPrec.displayString( 5.005005005 ), QString( "5.005005005" ) );
336-
#if QT_VERSION >= 0x050700
337336
QCOMPARE( QLocale().numberOptions() & QLocale::NumberOption::OmitGroupSeparator, QLocale::NumberOption::DefaultNumberOptions );
338-
#endif
339337
QCOMPARE( doubleFieldNoPrec.displayString( 599999898999.0 ), QString( "599,999,898,999" ) );
340338

341339
//test NULL double

‎tests/src/core/testqgsogcutils.cpp

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -35,12 +35,7 @@ class TestQgsOgcUtils : public QObject
3535
void initTestCase()
3636
{
3737
// Needed on Qt 5 so that the serialization of XML is consistent among all executions
38-
#if QT_VERSION >= 0x50600
3938
qSetGlobalQHashSeed( 0 );
40-
#else
41-
extern Q_CORE_EXPORT QBasicAtomicInt qt_qhash_seed;
42-
qt_qhash_seed.store( 0 );
43-
#endif
4439

4540
//
4641
// Runs once before any tests are run

0 commit comments

Comments
 (0)
Please sign in to comment.