diff --git a/src/Gui/CommandView.cpp b/src/Gui/CommandView.cpp index 554f76add6..ce7c33896c 100644 --- a/src/Gui/CommandView.cpp +++ b/src/Gui/CommandView.cpp @@ -1814,7 +1814,7 @@ void StdViewScreenShot::activated(int iMsg) if (fd.exec() == QDialog::Accepted) { selFilter = fd.selectedNameFilter(); - QString fn = fd.selectedFiles().front(); + QString fn = fd.selectedFiles().constFirst(); // We must convert '\' path separators to '/' before otherwise // Python would interpret them as escape sequences. fn.replace(QLatin1Char('\\'), QLatin1Char('/')); diff --git a/src/Gui/Quarter/DragDropHandler.cpp b/src/Gui/Quarter/DragDropHandler.cpp index d72d8379b4..b75c57f2b0 100644 --- a/src/Gui/Quarter/DragDropHandler.cpp +++ b/src/Gui/Quarter/DragDropHandler.cpp @@ -119,7 +119,7 @@ DragDropHandlerP::dragEnterEvent(QDragEnterEvent * event) return; if (mimedata->hasUrls()) { - QFileInfo fileinfo(mimedata->urls().takeFirst().path()); + QFileInfo fileinfo(mimedata->urls().constFirst().path()); QString suffix = fileinfo.suffix().toLower(); if (!this->suffixes.contains(suffix)) { return; @@ -139,7 +139,7 @@ DragDropHandlerP::dropEvent(QDropEvent * event) QByteArray bytes; if (mimedata->hasUrls()) { - QUrl url = mimedata->urls().takeFirst(); + QUrl url = mimedata->urls().constFirst(); if (url.scheme().isEmpty() || url.scheme().toLower() == QString("file") ) { // attempt to open file if (!in.openFile(url.toLocalFile().toLatin1().constData()))