Skip to content

Commit a11e0c6

Browse files
authored
Merge pull request #5130 from nyalldawson/deprecated
Fix use of some deprecated Qt methods
2 parents 26b9c04 + 1b5fbf9 commit a11e0c6

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

42 files changed

+109
-110
lines changed

src/analysis/raster/qgsalignraster.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -568,7 +568,7 @@ QgsAlignRaster::RasterInfo::RasterInfo( const QString &layerpath )
568568
( void ) GDALGetGeoTransform( mDataset, mGeoTransform );
569569

570570
// TODO: may be null or empty string
571-
mCrsWkt = QString::fromAscii( GDALGetProjectionRef( mDataset ) );
571+
mCrsWkt = QString::fromLatin1( GDALGetProjectionRef( mDataset ) );
572572

573573
mBandCnt = GDALGetBandNumber( mDataset );
574574
}

src/app/composer/qgsattributeselectiondialog.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -290,7 +290,7 @@ QgsAttributeSelectionDialog::QgsAttributeSelectionDialog( QgsComposerAttributeTa
290290
//set up models, views and delegates
291291
mColumnModel = new QgsComposerAttributeTableColumnModelV2( mComposerTable, mColumnsTableView );
292292
mColumnsTableView->setModel( mColumnModel );
293-
mColumnsTableView->horizontalHeader()->setResizeMode( QHeaderView::Stretch );
293+
mColumnsTableView->horizontalHeader()->setSectionResizeMode( QHeaderView::Stretch );
294294

295295
mColumnSourceDelegate = new QgsComposerColumnSourceDelegate( vLayer, mColumnsTableView, mComposerTable );
296296
mColumnsTableView->setItemDelegateForColumn( 0, mColumnSourceDelegate );
@@ -312,7 +312,7 @@ QgsAttributeSelectionDialog::QgsAttributeSelectionDialog( QgsComposerAttributeTa
312312
mSortedProxyModel->sort( 0, Qt::AscendingOrder );
313313
mSortColumnTableView->setSortingEnabled( false );
314314
mSortColumnTableView->setModel( mSortedProxyModel );
315-
mSortColumnTableView->horizontalHeader()->setResizeMode( QHeaderView::Stretch );
315+
mSortColumnTableView->horizontalHeader()->setSectionResizeMode( QHeaderView::Stretch );
316316
}
317317

318318
mOrderComboBox->insertItem( 0, tr( "Ascending" ) );

src/app/composer/qgscomposer.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -591,9 +591,9 @@ QgsComposer::QgsComposer( QgsComposition *composition )
591591

592592
mItemsTreeView->setColumnWidth( 0, 30 );
593593
mItemsTreeView->setColumnWidth( 1, 30 );
594-
mItemsTreeView->header()->setResizeMode( 0, QHeaderView::Fixed );
595-
mItemsTreeView->header()->setResizeMode( 1, QHeaderView::Fixed );
596-
mItemsTreeView->header()->setMovable( false );
594+
mItemsTreeView->header()->setSectionResizeMode( 0, QHeaderView::Fixed );
595+
mItemsTreeView->header()->setSectionResizeMode( 1, QHeaderView::Fixed );
596+
mItemsTreeView->header()->setSectionsMovable( false );
597597

598598
mItemsTreeView->setDragEnabled( true );
599599
mItemsTreeView->setAcceptDrops( true );

src/app/locator/qgslocatoroptionswidget.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ QgsLocatorOptionsWidget::QgsLocatorOptionsWidget( QgsLocatorWidget *locator, QWi
3030
mFiltersTreeView->setModel( mModel );
3131

3232
mFiltersTreeView->header()->setStretchLastSection( false );
33-
mFiltersTreeView->header()->setResizeMode( 0, QHeaderView::Stretch );
33+
mFiltersTreeView->header()->setSectionResizeMode( 0, QHeaderView::Stretch );
3434

3535
mConfigureFilterButton->setEnabled( false );
3636
connect( mFiltersTreeView->selectionModel(), &QItemSelectionModel::selectionChanged, this, [ = ]( const QItemSelection & selected, const QItemSelection & )

src/app/nodetool/qgsnodetool.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1601,7 +1601,7 @@ void QgsNodeTool::deleteVertex()
16011601
QList<int> &vertexIds = it2.value();
16021602

16031603
bool res = QgsVectorLayer::Success;
1604-
qSort( vertexIds.begin(), vertexIds.end(), qGreater<int>() );
1604+
std::sort( vertexIds.begin(), vertexIds.end(), std::greater<int>() );
16051605
Q_FOREACH ( int vertexId, vertexIds )
16061606
{
16071607
if ( res != QgsVectorLayer::EmptyGeometry )

src/app/qgshandlebadlayers.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -236,7 +236,7 @@ void QgsHandleBadLayers::setFilename( int row, const QString &filename )
236236
QUrl uriSource = QUrl::fromEncoded( datasource.toLatin1() );
237237
QUrl uriDest = QUrl::fromLocalFile( filename );
238238
uriDest.setQueryItems( uriSource.queryItems() );
239-
datasource = QString::fromAscii( uriDest.toEncoded() );
239+
datasource = QString::fromLatin1( uriDest.toEncoded() );
240240
}
241241
}
242242
else

src/app/qgsidentifyresultsdialog.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -447,7 +447,7 @@ void QgsIdentifyResultsDialog::addFeature( const QgsMapToolIdentify::IdentifyRes
447447
void QgsIdentifyResultsDialog::addFeature( QgsVectorLayer *vlayer, const QgsFeature &f, const QMap<QString, QString> &derivedAttributes )
448448
{
449449
QTreeWidgetItem *layItem = layerItem( vlayer );
450-
lstResults->header()->setResizeMode( QHeaderView::ResizeToContents );
450+
lstResults->header()->setSectionResizeMode( QHeaderView::ResizeToContents );
451451
lstResults->header()->setStretchLastSection( false );
452452

453453
if ( !layItem )

src/app/qgsmaptoolannotation.cpp

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -94,12 +94,12 @@ void QgsMapToolAnnotation::canvasPressEvent( QgsMapMouseEvent *e )
9494
return;
9595
}
9696

97-
mLastMousePosition = e->posF();
97+
mLastMousePosition = e->pos();
9898

9999
QgsMapCanvasAnnotationItem *item = selectedItem();
100100
if ( item )
101101
{
102-
mCurrentMoveAction = item->moveActionForPosition( e->posF() );
102+
mCurrentMoveAction = item->moveActionForPosition( e->pos() );
103103
if ( mCurrentMoveAction != QgsMapCanvasAnnotationItem::NoAction )
104104
{
105105
return;
@@ -110,7 +110,7 @@ void QgsMapToolAnnotation::canvasPressEvent( QgsMapMouseEvent *e )
110110
{
111111
//select a new item if there is one at this position
112112
mCanvas->scene()->clearSelection();
113-
QgsMapCanvasAnnotationItem *existingItem = itemAtPos( e->posF() );
113+
QgsMapCanvasAnnotationItem *existingItem = itemAtPos( e->pos() );
114114
if ( existingItem )
115115
{
116116
existingItem->setSelected( true );
@@ -124,8 +124,8 @@ void QgsMapToolAnnotation::canvasPressEvent( QgsMapMouseEvent *e )
124124
QgsPointXY mapPos = transformCanvasToAnnotation( toMapCoordinates( e->pos() ), annotation );
125125
annotation->setMapPosition( mapPos );
126126
annotation->setMapPositionCrs( mCanvas->mapSettings().destinationCrs() );
127-
annotation->setRelativePosition( QPointF( e->posF().x() / mCanvas->width(),
128-
e->posF().y() / mCanvas->height() ) );
127+
annotation->setRelativePosition( QPointF( e->pos().x() / mCanvas->width(),
128+
e->pos().y() / mCanvas->height() ) );
129129
annotation->setFrameSize( QSizeF( 200, 100 ) );
130130

131131
QgsProject::instance()->annotationManager()->addAnnotation( annotation );
@@ -184,17 +184,17 @@ void QgsMapToolAnnotation::canvasMoveEvent( QgsMapMouseEvent *e )
184184
{
185185
QgsPointXY mapPos = transformCanvasToAnnotation( e->snapPoint(), annotation );
186186
annotation->setMapPosition( mapPos );
187-
annotation->setRelativePosition( QPointF( e->posF().x() / mCanvas->width(),
188-
e->posF().y() / mCanvas->height() ) );
187+
annotation->setRelativePosition( QPointF( e->pos().x() / mCanvas->width(),
188+
e->pos().y() / mCanvas->height() ) );
189189
item->update();
190190
QgsProject::instance()->setDirty( true );
191191
}
192192
else if ( mCurrentMoveAction == QgsMapCanvasAnnotationItem::MoveFramePosition )
193193
{
194-
QPointF newCanvasPos = item->pos() + ( e->posF() - mLastMousePosition );
194+
QPointF newCanvasPos = item->pos() + ( e->pos() - mLastMousePosition );
195195
if ( annotation->hasFixedMapPosition() )
196196
{
197-
annotation->setFrameOffsetFromReferencePoint( annotation->frameOffsetFromReferencePoint() + ( e->posF() - mLastMousePosition ) );
197+
annotation->setFrameOffsetFromReferencePoint( annotation->frameOffsetFromReferencePoint() + ( e->pos() - mLastMousePosition ) );
198198
annotation->setRelativePosition( QPointF( newCanvasPos.x() / mCanvas->width(),
199199
newCanvasPos.y() / mCanvas->height() ) );
200200
}
@@ -223,27 +223,27 @@ void QgsMapToolAnnotation::canvasMoveEvent( QgsMapMouseEvent *e )
223223
mCurrentMoveAction == QgsMapCanvasAnnotationItem::ResizeFrameRightDown ||
224224
mCurrentMoveAction == QgsMapCanvasAnnotationItem::ResizeFrameRightUp )
225225
{
226-
xmax += e->posF().x() - mLastMousePosition.x();
226+
xmax += e->pos().x() - mLastMousePosition.x();
227227
}
228228
if ( mCurrentMoveAction == QgsMapCanvasAnnotationItem::ResizeFrameLeft ||
229229
mCurrentMoveAction == QgsMapCanvasAnnotationItem::ResizeFrameLeftDown ||
230230
mCurrentMoveAction == QgsMapCanvasAnnotationItem::ResizeFrameLeftUp )
231231
{
232-
xmin += e->posF().x() - mLastMousePosition.x();
233-
relPosX = ( relPosX * mCanvas->width() + e->posF().x() - mLastMousePosition.x() ) / ( double )mCanvas->width();
232+
xmin += e->pos().x() - mLastMousePosition.x();
233+
relPosX = ( relPosX * mCanvas->width() + e->pos().x() - mLastMousePosition.x() ) / ( double )mCanvas->width();
234234
}
235235
if ( mCurrentMoveAction == QgsMapCanvasAnnotationItem::ResizeFrameUp ||
236236
mCurrentMoveAction == QgsMapCanvasAnnotationItem::ResizeFrameLeftUp ||
237237
mCurrentMoveAction == QgsMapCanvasAnnotationItem::ResizeFrameRightUp )
238238
{
239-
ymin += e->posF().y() - mLastMousePosition.y();
240-
relPosY = ( relPosY * mCanvas->height() + e->posF().y() - mLastMousePosition.y() ) / ( double )mCanvas->height();
239+
ymin += e->pos().y() - mLastMousePosition.y();
240+
relPosY = ( relPosY * mCanvas->height() + e->pos().y() - mLastMousePosition.y() ) / ( double )mCanvas->height();
241241
}
242242
if ( mCurrentMoveAction == QgsMapCanvasAnnotationItem::ResizeFrameDown ||
243243
mCurrentMoveAction == QgsMapCanvasAnnotationItem::ResizeFrameLeftDown ||
244244
mCurrentMoveAction == QgsMapCanvasAnnotationItem::ResizeFrameRightDown )
245245
{
246-
ymax += e->posF().y() - mLastMousePosition.y();
246+
ymax += e->pos().y() - mLastMousePosition.y();
247247
}
248248

249249
//switch min / max if necessary
@@ -270,18 +270,18 @@ void QgsMapToolAnnotation::canvasMoveEvent( QgsMapMouseEvent *e )
270270
}
271271
else if ( item )
272272
{
273-
QgsMapCanvasAnnotationItem::MouseMoveAction moveAction = item->moveActionForPosition( e->posF() );
273+
QgsMapCanvasAnnotationItem::MouseMoveAction moveAction = item->moveActionForPosition( e->pos() );
274274
if ( mCanvas )
275275
{
276276
mCanvas->setCursor( QCursor( item->cursorShapeForAction( moveAction ) ) );
277277
}
278278
}
279-
mLastMousePosition = e->posF();
279+
mLastMousePosition = e->pos();
280280
}
281281

282282
void QgsMapToolAnnotation::canvasDoubleClickEvent( QgsMapMouseEvent *e )
283283
{
284-
QgsMapCanvasAnnotationItem *item = itemAtPos( e->posF() );
284+
QgsMapCanvasAnnotationItem *item = itemAtPos( e->pos() );
285285
if ( !item )
286286
{
287287
return;

src/app/qgsmaptoolannotation.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ class APP_EXPORT QgsMapToolAnnotation: public QgsMapTool
6060
QgsPointXY transformCanvasToAnnotation( QgsPointXY p, QgsAnnotation *annotation ) const;
6161

6262
QgsMapCanvasAnnotationItem::MouseMoveAction mCurrentMoveAction = QgsMapCanvasAnnotationItem::NoAction;
63-
QPointF mLastMousePosition = QPointF( 0, 0 );
63+
QPoint mLastMousePosition = QPoint( 0, 0 );
6464
};
6565

6666
#endif // QGSMAPTOOLANNOTATION_H

src/app/qgsprojectproperties.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -259,7 +259,7 @@ QgsProjectProperties::QgsProjectProperties( QgsMapCanvas *mapCanvas, QWidget *pa
259259
twIdentifyLayers->setHorizontalHeaderItem( 2, new QTableWidgetItem( tr( "Identifiable" ) ) );
260260
twIdentifyLayers->setHorizontalHeaderItem( 3, new QTableWidgetItem( tr( "Read Only" ) ) );
261261
twIdentifyLayers->setRowCount( mapLayers.size() );
262-
twIdentifyLayers->verticalHeader()->setResizeMode( QHeaderView::ResizeToContents );
262+
twIdentifyLayers->verticalHeader()->setSectionResizeMode( QHeaderView::ResizeToContents );
263263

264264
int i = 0;
265265
for ( QMap<QString, QgsMapLayer *>::const_iterator it = mapLayers.constBegin(); it != mapLayers.constEnd(); ++it, i++ )
@@ -620,7 +620,7 @@ QgsProjectProperties::QgsProjectProperties( QgsMapCanvas *mapCanvas, QWidget *pa
620620
}
621621
}
622622
twWFSLayers->setRowCount( j );
623-
twWFSLayers->verticalHeader()->setResizeMode( QHeaderView::ResizeToContents );
623+
twWFSLayers->verticalHeader()->setSectionResizeMode( QHeaderView::ResizeToContents );
624624

625625
mWCSUrlLineEdit->setText( QgsProject::instance()->readEntry( QStringLiteral( "WCSUrl" ), QStringLiteral( "/" ), QLatin1String( "" ) ) );
626626
QStringList wcsLayerIdList = QgsProject::instance()->readListEntry( QStringLiteral( "WCSLayers" ), QStringLiteral( "/" ) );
@@ -659,7 +659,7 @@ QgsProjectProperties::QgsProjectProperties( QgsMapCanvas *mapCanvas, QWidget *pa
659659
}
660660
}
661661
twWCSLayers->setRowCount( j );
662-
twWCSLayers->verticalHeader()->setResizeMode( QHeaderView::ResizeToContents );
662+
twWCSLayers->verticalHeader()->setSectionResizeMode( QHeaderView::ResizeToContents );
663663

664664
// Default Styles
665665
mStyle = QgsStyle::defaultStyle();

src/app/qgsrasterlayerproperties.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -461,8 +461,8 @@ void QgsRasterLayerProperties::setupTransparencyTable( int nBands )
461461
tableTransparency->setHorizontalHeaderItem( 2, new QTableWidgetItem( tr( "Percent Transparent" ) ) );
462462
}
463463

464-
tableTransparency->horizontalHeader()->setResizeMode( 0, QHeaderView::Stretch );
465-
tableTransparency->horizontalHeader()->setResizeMode( 1, QHeaderView::Stretch );
464+
tableTransparency->horizontalHeader()->setSectionResizeMode( 0, QHeaderView::Stretch );
465+
tableTransparency->horizontalHeader()->setSectionResizeMode( 1, QHeaderView::Stretch );
466466
}
467467

468468
void QgsRasterLayerProperties::populateTransparencyTable( QgsRasterRenderer *renderer )

src/core/qgsapplication.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -318,7 +318,7 @@ bool QgsApplication::notify( QObject *receiver, QEvent *event )
318318
}
319319
catch ( std::exception &e )
320320
{
321-
QgsDebugMsg( "Caught unhandled std::exception: " + QString::fromAscii( e.what() ) );
321+
QgsDebugMsg( "Caught unhandled std::exception: " + QString::fromLatin1( e.what() ) );
322322
if ( qApp->thread() == QThread::currentThread() )
323323
QMessageBox::critical( activeWindow(), tr( "Exception" ), e.what() );
324324
}

src/core/qgsexpressionlexer.ll

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -186,14 +186,14 @@ string "'"{str_char}*"'"
186186
187187
"," { return COMMA; }
188188
189-
{num_float} { yylval->numberFloat = cLocale.toDouble( QString::fromAscii(yytext) ); return NUMBER_FLOAT; }
189+
{num_float} { yylval->numberFloat = cLocale.toDouble( QString::fromLatin1(yytext) ); return NUMBER_FLOAT; }
190190
{num_int} {
191191
bool ok;
192-
yylval->numberInt = cLocale.toInt( QString::fromAscii(yytext), &ok );
192+
yylval->numberInt = cLocale.toInt( QString::fromLatin1(yytext), &ok );
193193
if( ok )
194194
return NUMBER_INT;
195195
196-
yylval->numberFloat = cLocale.toDouble( QString::fromAscii(yytext), &ok );
196+
yylval->numberFloat = cLocale.toDouble( QString::fromLatin1(yytext), &ok );
197197
if( ok )
198198
return NUMBER_FLOAT;
199199

src/core/qgsexpressionsorter.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@ class QgsExpressionSorter
160160

161161
delete expressionContext->popScope();
162162

163-
qSort( indexedFeatures.begin(), indexedFeatures.end(), *this );
163+
std::sort( indexedFeatures.begin(), indexedFeatures.end(), *this );
164164

165165
features.clear();
166166

src/core/qgsmaplayer.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -257,7 +257,7 @@ bool QgsMapLayer::readLayerXml( const QDomElement &layerElement, const QgsReadWr
257257

258258
QUrl urlDest = QUrl::fromLocalFile( context.pathResolver().readPath( urlSource.toLocalFile() ) );
259259
urlDest.setQueryItems( urlSource.queryItems() );
260-
mDataSource = QString::fromAscii( urlDest.toEncoded() );
260+
mDataSource = QString::fromLatin1( urlDest.toEncoded() );
261261
}
262262
else if ( provider == QLatin1String( "wms" ) )
263263
{
@@ -621,7 +621,7 @@ bool QgsMapLayer::writeLayerXml( QDomElement &layerElement, QDomDocument &docume
621621
QUrl urlSource = QUrl::fromEncoded( src.toLatin1() );
622622
QUrl urlDest = QUrl::fromLocalFile( context.pathResolver().writePath( urlSource.toLocalFile() ) );
623623
urlDest.setQueryItems( urlSource.queryItems() );
624-
src = QString::fromAscii( urlDest.toEncoded() );
624+
src = QString::fromLatin1( urlDest.toEncoded() );
625625
}
626626
else if ( vlayer && vlayer->providerType() == QLatin1String( "memory" ) )
627627
{

src/core/qgsmaprenderercustompainterjob.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -223,7 +223,7 @@ void QgsMapRendererCustomPainterJob::staticRender( QgsMapRendererCustomPainterJo
223223
catch ( std::exception &e )
224224
{
225225
Q_UNUSED( e );
226-
QgsDebugMsg( "Caught unhandled std::exception: " + QString::fromAscii( e.what() ) );
226+
QgsDebugMsg( "Caught unhandled std::exception: " + QString::fromLatin1( e.what() ) );
227227
}
228228
catch ( ... )
229229
{

src/core/qgsmaprendererparalleljob.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -263,7 +263,7 @@ void QgsMapRendererParallelJob::renderLayerStatic( LayerRenderJob &job )
263263
catch ( std::exception &e )
264264
{
265265
Q_UNUSED( e );
266-
QgsDebugMsg( "Caught unhandled std::exception: " + QString::fromAscii( e.what() ) );
266+
QgsDebugMsg( "Caught unhandled std::exception: " + QString::fromLatin1( e.what() ) );
267267
}
268268
catch ( ... )
269269
{
@@ -307,7 +307,7 @@ void QgsMapRendererParallelJob::renderLabelsStatic( QgsMapRendererParallelJob *s
307307
catch ( std::exception &e )
308308
{
309309
Q_UNUSED( e );
310-
QgsDebugMsg( "Caught unhandled std::exception: " + QString::fromAscii( e.what() ) );
310+
QgsDebugMsg( "Caught unhandled std::exception: " + QString::fromLatin1( e.what() ) );
311311
}
312312
catch ( ... )
313313
{

src/core/qgssqlstatementlexer.ll

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -164,18 +164,18 @@ string "'"{str_char}*"'"
164164
165165
"," { return COMMA; }
166166
167-
{num_float} { yylval->numberFloat = cLocale.toDouble( QString::fromAscii(yytext) ); return NUMBER_FLOAT; }
167+
{num_float} { yylval->numberFloat = cLocale.toDouble( QString::fromLatin1(yytext) ); return NUMBER_FLOAT; }
168168
{num_int} {
169169
bool ok;
170-
yylval->numberInt = cLocale.toInt( QString::fromAscii(yytext), &ok );
170+
yylval->numberInt = cLocale.toInt( QString::fromLatin1(yytext), &ok );
171171
if( ok )
172172
return NUMBER_INT;
173173
174-
yylval->numberInt64 = cLocale.toLongLong( QString::fromAscii(yytext), &ok );
174+
yylval->numberInt64 = cLocale.toLongLong( QString::fromLatin1(yytext), &ok );
175175
if( ok )
176176
return NUMBER_INT64;
177177
178-
yylval->numberFloat = cLocale.toDouble( QString::fromAscii(yytext), &ok );
178+
yylval->numberFloat = cLocale.toDouble( QString::fromLatin1(yytext), &ok );
179179
if( ok )
180180
return NUMBER_FLOAT;
181181

src/core/qgsstringutils.cpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616
#include "qgsstringutils.h"
1717
#include <QVector>
1818
#include <QRegExp>
19-
#include <QTextDocument> // for Qt::escape
2019
#include <QStringList>
2120
#include <QTextBoundaryFinder>
2221

@@ -362,7 +361,7 @@ QString QgsStringUtils::insertLinks( const QString &string, bool *foundLinks )
362361
{
363362
protoUrl.prepend( "http://" );
364363
}
365-
QString anchor = QStringLiteral( "<a href=\"%1\">%2</a>" ).arg( Qt::escape( protoUrl ), Qt::escape( url ) );
364+
QString anchor = QStringLiteral( "<a href=\"%1\">%2</a>" ).arg( protoUrl.toHtmlEscaped(), url.toHtmlEscaped() );
366365
converted.replace( urlRegEx.pos( 1 ), url.length(), anchor );
367366
offset = urlRegEx.pos( 1 ) + anchor.length();
368367
}
@@ -371,7 +370,7 @@ QString QgsStringUtils::insertLinks( const QString &string, bool *foundLinks )
371370
{
372371
found = true;
373372
QString email = emailRegEx.cap( 1 );
374-
QString anchor = QStringLiteral( "<a href=\"mailto:%1\">%1</a>" ).arg( Qt::escape( email ), Qt::escape( email ) );
373+
QString anchor = QStringLiteral( "<a href=\"mailto:%1\">%1</a>" ).arg( email.toHtmlEscaped(), email.toHtmlEscaped() );
375374
converted.replace( emailRegEx.pos( 1 ), email.length(), anchor );
376375
offset = emailRegEx.pos( 1 ) + anchor.length();
377376
}

src/gui/auth/qgsautheditorwidgets.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ void QgsAuthMethodPlugins::setupTable()
6363
tblAuthPlugins->setColumnWidth( 0, 150 );
6464
tblAuthPlugins->setColumnWidth( 1, 300 );
6565
tblAuthPlugins->setRowCount( QgsAuthManager::instance()->authMethodsKeys().size() );
66-
tblAuthPlugins->verticalHeader()->setResizeMode( QHeaderView::ResizeToContents );
66+
tblAuthPlugins->verticalHeader()->setSectionResizeMode( QHeaderView::ResizeToContents );
6767
tblAuthPlugins->setSortingEnabled( true );
6868
tblAuthPlugins->setSelectionBehavior( QAbstractItemView::SelectRows );
6969
}

src/gui/layout/qgslayoutruler.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -571,7 +571,7 @@ void QgsLayoutRuler::setCursorPosition( QPointF position )
571571

572572
void QgsLayoutRuler::mouseMoveEvent( QMouseEvent *event )
573573
{
574-
mMarkerPos = event->posF();
574+
mMarkerPos = event->pos();
575575
update();
576576

577577
QPointF displayPos;
@@ -651,7 +651,7 @@ void QgsLayoutRuler::mouseMoveEvent( QMouseEvent *event )
651651
}
652652

653653
//update cursor position in status bar
654-
displayPos = mTransform.inverted().map( event->posF() );
654+
displayPos = mTransform.inverted().map( event->pos() );
655655
switch ( mOrientation )
656656
{
657657
case Qt::Horizontal:

0 commit comments

Comments
 (0)