Merge remote-tracking branch 'origin/5.15' into dev
Change-Id: If36d96c0fef3de5ab6503977501c55c62a2ecc97
This commit is contained in:
commit
63312fe2ec
@ -705,6 +705,7 @@ qt_feature("dlopen" PRIVATE
|
|||||||
)
|
)
|
||||||
qt_feature("relocatable" PRIVATE
|
qt_feature("relocatable" PRIVATE
|
||||||
LABEL "Relocatable"
|
LABEL "Relocatable"
|
||||||
|
PURPOSE "Enable the Qt installation to be relocated."
|
||||||
AUTODETECT QT_FEATURE_shared
|
AUTODETECT QT_FEATURE_shared
|
||||||
CONDITION QT_FEATURE_dlopen OR WIN32 OR NOT QT_FEATURE_shared
|
CONDITION QT_FEATURE_dlopen OR WIN32 OR NOT QT_FEATURE_shared
|
||||||
)
|
)
|
||||||
|
@ -61,7 +61,7 @@ Message::Message(const QString &body, const QStringList &headers)
|
|||||||
QDebug operator<<(QDebug dbg, const Message &message)
|
QDebug operator<<(QDebug dbg, const Message &message)
|
||||||
{
|
{
|
||||||
const QString body = message.body();
|
const QString body = message.body();
|
||||||
QVector<QStringRef> pieces = body.splitRef("\r\n", QString::SkipEmptyParts);
|
QVector<QStringRef> pieces = body.splitRef(QLatin1String("\r\n"), Qt::SkipEmptyParts);
|
||||||
if (pieces.isEmpty())
|
if (pieces.isEmpty())
|
||||||
dbg.nospace() << "Message()";
|
dbg.nospace() << "Message()";
|
||||||
else if (pieces.size() == 1)
|
else if (pieces.size() == 1)
|
||||||
|
@ -86,7 +86,7 @@ void Dialog::submit()
|
|||||||
int albumId = addNewAlbum(title, artistId);
|
int albumId = addNewAlbum(title, artistId);
|
||||||
|
|
||||||
QStringList tracks;
|
QStringList tracks;
|
||||||
tracks = tracksEditor->text().split(',', QString::SkipEmptyParts);
|
tracks = tracksEditor->text().split(QLatin1Char(','), Qt::SkipEmptyParts);
|
||||||
addTracks(albumId, tracks);
|
addTracks(albumId, tracks);
|
||||||
|
|
||||||
increaseAlbumCount(indexOfArtist(artist));
|
increaseAlbumCount(indexOfArtist(artist));
|
||||||
|
@ -113,7 +113,7 @@ void DragWidget::dropEvent(QDropEvent *event)
|
|||||||
if (event->mimeData()->hasText()) {
|
if (event->mimeData()->hasText()) {
|
||||||
const QMimeData *mime = event->mimeData();
|
const QMimeData *mime = event->mimeData();
|
||||||
QStringList pieces = mime->text().split(QRegularExpression(QStringLiteral("\\s+")),
|
QStringList pieces = mime->text().split(QRegularExpression(QStringLiteral("\\s+")),
|
||||||
QString::SkipEmptyParts);
|
Qt::SkipEmptyParts);
|
||||||
QPoint position = event->pos();
|
QPoint position = event->pos();
|
||||||
QPoint hotSpot;
|
QPoint hotSpot;
|
||||||
|
|
||||||
|
@ -163,8 +163,8 @@ void DragWidget::dropEvent(QDropEvent *event)
|
|||||||
}
|
}
|
||||||
//! [11] //! [12]
|
//! [11] //! [12]
|
||||||
} else if (event->mimeData()->hasText()) {
|
} else if (event->mimeData()->hasText()) {
|
||||||
QStringList pieces = event->mimeData()->text().split(QRegularExpression(QStringLiteral("\\s+")),
|
QStringList pieces = event->mimeData()->text().split(
|
||||||
QString::SkipEmptyParts);
|
QRegularExpression(QStringLiteral("\\s+")), Qt::SkipEmptyParts);
|
||||||
QPoint position = event->pos();
|
QPoint position = event->pos();
|
||||||
|
|
||||||
for (const QString &piece : pieces) {
|
for (const QString &piece : pieces) {
|
||||||
|
@ -59,7 +59,7 @@ Window::Window(QGraphicsItem *parent) : QGraphicsWidget(parent, Qt::Window)
|
|||||||
FlowLayout *lay = new FlowLayout;
|
FlowLayout *lay = new FlowLayout;
|
||||||
const QString sentence(QLatin1String("I am not bothered by the fact that I am unknown."
|
const QString sentence(QLatin1String("I am not bothered by the fact that I am unknown."
|
||||||
" I am bothered when I do not know others. (Confucius)"));
|
" I am bothered when I do not know others. (Confucius)"));
|
||||||
const QVector<QStringRef> words = sentence.splitRef(QLatin1Char(' '), QString::SkipEmptyParts);
|
const QVector<QStringRef> words = sentence.splitRef(QLatin1Char(' '), Qt::SkipEmptyParts);
|
||||||
for (const QStringRef &word : words) {
|
for (const QStringRef &word : words) {
|
||||||
QGraphicsProxyWidget *proxy = new QGraphicsProxyWidget(this);
|
QGraphicsProxyWidget *proxy = new QGraphicsProxyWidget(this);
|
||||||
QLabel *label = new QLabel(word.toString());
|
QLabel *label = new QLabel(word.toString());
|
||||||
|
@ -134,7 +134,7 @@ void MainWindow::loadFile(const QString &fileName)
|
|||||||
if (!line.isEmpty()) {
|
if (!line.isEmpty()) {
|
||||||
model->insertRows(row, 1, QModelIndex());
|
model->insertRows(row, 1, QModelIndex());
|
||||||
|
|
||||||
const QStringList pieces = line.split(',', QString::SkipEmptyParts);
|
const QStringList pieces = line.split(QLatin1Char(','), Qt::SkipEmptyParts);
|
||||||
if (pieces.size() < 3)
|
if (pieces.size() < 3)
|
||||||
continue;
|
continue;
|
||||||
model->setData(model->index(row, 0, QModelIndex()),
|
model->setData(model->index(row, 0, QModelIndex()),
|
||||||
|
@ -267,7 +267,8 @@ void TreeModel::setupModelData(const QStringList &lines, TreeItem *parent)
|
|||||||
|
|
||||||
if (!lineData.isEmpty()) {
|
if (!lineData.isEmpty()) {
|
||||||
// Read the column data from the rest of the line.
|
// Read the column data from the rest of the line.
|
||||||
const QStringList columnStrings = lineData.split('\t', QString::SkipEmptyParts);
|
const QStringList columnStrings =
|
||||||
|
lineData.split(QLatin1Char('\t'), Qt::SkipEmptyParts);
|
||||||
QVector<QVariant> columnData;
|
QVector<QVariant> columnData;
|
||||||
columnData.reserve(columnStrings.size());
|
columnData.reserve(columnStrings.size());
|
||||||
for (const QString &columnString : columnStrings)
|
for (const QString &columnString : columnStrings)
|
||||||
|
@ -194,7 +194,8 @@ void TreeModel::setupModelData(const QStringList &lines, TreeItem *parent)
|
|||||||
|
|
||||||
if (!lineData.isEmpty()) {
|
if (!lineData.isEmpty()) {
|
||||||
// Read the column data from the rest of the line.
|
// Read the column data from the rest of the line.
|
||||||
const QStringList columnStrings = lineData.split('\t', QString::SkipEmptyParts);
|
const QStringList columnStrings =
|
||||||
|
lineData.split(QLatin1Char('\t'), Qt::SkipEmptyParts);
|
||||||
QVector<QVariant> columnData;
|
QVector<QVariant> columnData;
|
||||||
columnData.reserve(columnStrings.count());
|
columnData.reserve(columnStrings.count());
|
||||||
for (const QString &columnString : columnStrings)
|
for (const QString &columnString : columnStrings)
|
||||||
|
@ -413,7 +413,7 @@ void AddressBook::exportAsVCard()
|
|||||||
int index = name.indexOf(" ");
|
int index = name.indexOf(" ");
|
||||||
|
|
||||||
if (index != -1) {
|
if (index != -1) {
|
||||||
nameList = name.split(QRegularExpression("\\s+"), QString::SkipEmptyParts);
|
nameList = name.split(QRegularExpression("\\s+"), Qt::SkipEmptyParts);
|
||||||
firstName = nameList.first();
|
firstName = nameList.first();
|
||||||
lastName = nameList.last();
|
lastName = nameList.last();
|
||||||
} else {
|
} else {
|
||||||
|
@ -1813,7 +1813,7 @@ static QStringList splitDeps(const QString &indeps, bool lineMode)
|
|||||||
{
|
{
|
||||||
if (!lineMode)
|
if (!lineMode)
|
||||||
return indeps.simplified().split(' ');
|
return indeps.simplified().split(' ');
|
||||||
QStringList deps = indeps.split('\n', QString::SkipEmptyParts);
|
QStringList deps = indeps.split('\n', Qt::SkipEmptyParts);
|
||||||
#ifdef Q_OS_WIN
|
#ifdef Q_OS_WIN
|
||||||
for (auto &dep : deps) {
|
for (auto &dep : deps) {
|
||||||
if (dep.endsWith(QLatin1Char('\r')))
|
if (dep.endsWith(QLatin1Char('\r')))
|
||||||
|
@ -312,7 +312,7 @@ void Win32MakefileGenerator::processRcFileVar()
|
|||||||
QByteArray rcString;
|
QByteArray rcString;
|
||||||
QTextStream ts(&rcString, QFile::WriteOnly);
|
QTextStream ts(&rcString, QFile::WriteOnly);
|
||||||
|
|
||||||
QStringList vers = project->first("VERSION").toQString().split(".", QString::SkipEmptyParts);
|
QStringList vers = project->first("VERSION").toQString().split(".", Qt::SkipEmptyParts);
|
||||||
for (int i = vers.size(); i < 4; i++)
|
for (int i = vers.size(); i < 4; i++)
|
||||||
vers += "0";
|
vers += "0";
|
||||||
QString versionString = vers.join('.');
|
QString versionString = vers.join('.');
|
||||||
|
@ -772,7 +772,7 @@ QMakeEvaluator::VisitReturn QMakeEvaluator::evaluateBuiltinExpand(
|
|||||||
const auto vars = values(map(args.at(0)));
|
const auto vars = values(map(args.at(0)));
|
||||||
for (const ProString &var : vars) {
|
for (const ProString &var : vars) {
|
||||||
// FIXME: this is inconsistent with the "there are no empty strings" dogma.
|
// FIXME: this is inconsistent with the "there are no empty strings" dogma.
|
||||||
const auto splits = var.toQStringRef().split(sep, QString::KeepEmptyParts);
|
const auto splits = var.toQStringRef().split(sep, Qt::KeepEmptyParts);
|
||||||
for (const auto &splt : splits)
|
for (const auto &splt : splits)
|
||||||
ret << ProString(splt).setSource(var);
|
ret << ProString(splt).setSource(var);
|
||||||
}
|
}
|
||||||
@ -1576,7 +1576,7 @@ QMakeEvaluator::VisitReturn QMakeEvaluator::evaluateBuiltinConditional(
|
|||||||
if (args.count() == 1)
|
if (args.count() == 1)
|
||||||
return returnBool(isActiveConfig(args.at(0).toQStringRef()));
|
return returnBool(isActiveConfig(args.at(0).toQStringRef()));
|
||||||
const auto mutuals = args.at(1).toQStringRef().split(QLatin1Char('|'),
|
const auto mutuals = args.at(1).toQStringRef().split(QLatin1Char('|'),
|
||||||
QString::SkipEmptyParts);
|
Qt::SkipEmptyParts);
|
||||||
const ProStringList &configs = values(statics.strCONFIG);
|
const ProStringList &configs = values(statics.strCONFIG);
|
||||||
|
|
||||||
for (int i = configs.size() - 1; i >= 0; i--) {
|
for (int i = configs.size() - 1; i >= 0; i--) {
|
||||||
@ -1610,7 +1610,7 @@ QMakeEvaluator::VisitReturn QMakeEvaluator::evaluateBuiltinConditional(
|
|||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
const auto mutuals = args.at(2).toQStringRef().split(QLatin1Char('|'),
|
const auto mutuals = args.at(2).toQStringRef().split(QLatin1Char('|'),
|
||||||
QString::SkipEmptyParts);
|
Qt::SkipEmptyParts);
|
||||||
for (int i = l.size() - 1; i >= 0; i--) {
|
for (int i = l.size() - 1; i >= 0; i--) {
|
||||||
const ProString &val = l[i];
|
const ProString &val = l[i];
|
||||||
for (int mut = 0; mut < mutuals.count(); mut++) {
|
for (int mut = 0; mut < mutuals.count(); mut++) {
|
||||||
|
@ -883,7 +883,7 @@ QMakeEvaluator::VisitReturn QMakeEvaluator::visitProVariable(
|
|||||||
return ReturnTrue;
|
return ReturnTrue;
|
||||||
}
|
}
|
||||||
QChar sep = val.at(1);
|
QChar sep = val.at(1);
|
||||||
auto func = val.split(sep, QString::KeepEmptyParts);
|
auto func = val.split(sep, Qt::KeepEmptyParts);
|
||||||
if (func.count() < 3 || func.count() > 4) {
|
if (func.count() < 3 || func.count() > 4) {
|
||||||
evalError(fL1S("The s/// function expects 3 or 4 arguments."));
|
evalError(fL1S("The s/// function expects 3 or 4 arguments."));
|
||||||
return ReturnTrue;
|
return ReturnTrue;
|
||||||
@ -1022,7 +1022,7 @@ static ProString msvcArchitecture(const QString &vcInstallDir, const QString &pa
|
|||||||
QString vcBinDir = vcInstallDir;
|
QString vcBinDir = vcInstallDir;
|
||||||
if (vcBinDir.endsWith(QLatin1Char('\\')))
|
if (vcBinDir.endsWith(QLatin1Char('\\')))
|
||||||
vcBinDir.chop(1);
|
vcBinDir.chop(1);
|
||||||
const auto dirs = pathVar.split(QLatin1Char(';'), QString::SkipEmptyParts);
|
const auto dirs = pathVar.split(QLatin1Char(';'), Qt::SkipEmptyParts);
|
||||||
for (const QString &dir : dirs) {
|
for (const QString &dir : dirs) {
|
||||||
if (!dir.startsWith(vcBinDir, Qt::CaseInsensitive))
|
if (!dir.startsWith(vcBinDir, Qt::CaseInsensitive))
|
||||||
continue;
|
continue;
|
||||||
|
@ -260,7 +260,7 @@ QStringList QMakeGlobals::splitPathList(const QString &val) const
|
|||||||
QStringList ret;
|
QStringList ret;
|
||||||
if (!val.isEmpty()) {
|
if (!val.isEmpty()) {
|
||||||
QString cwd(QDir::currentPath());
|
QString cwd(QDir::currentPath());
|
||||||
const QStringList vals = val.split(dirlist_sep, QString::SkipEmptyParts);
|
const QStringList vals = val.split(dirlist_sep, Qt::SkipEmptyParts);
|
||||||
ret.reserve(vals.length());
|
ret.reserve(vals.length());
|
||||||
for (const QString &it : vals)
|
for (const QString &it : vals)
|
||||||
ret << IoUtils::resolvePath(cwd, it);
|
ret << IoUtils::resolvePath(cwd, it);
|
||||||
|
@ -44,6 +44,7 @@ import java.io.File;
|
|||||||
import java.io.FileNotFoundException;
|
import java.io.FileNotFoundException;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.concurrent.Semaphore;
|
import java.util.concurrent.Semaphore;
|
||||||
|
import java.io.IOException;
|
||||||
|
|
||||||
import android.app.Activity;
|
import android.app.Activity;
|
||||||
import android.app.Service;
|
import android.app.Service;
|
||||||
@ -70,6 +71,7 @@ import android.view.Menu;
|
|||||||
import android.view.MotionEvent;
|
import android.view.MotionEvent;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
import android.view.InputDevice;
|
import android.view.InputDevice;
|
||||||
|
import android.database.Cursor;
|
||||||
|
|
||||||
import java.lang.reflect.Method;
|
import java.lang.reflect.Method;
|
||||||
import java.security.KeyStore;
|
import java.security.KeyStore;
|
||||||
@ -231,6 +233,61 @@ public class QtNative
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static long getSize(Context context, String contentUrl)
|
||||||
|
{
|
||||||
|
Uri uri = getUriWithValidPermission(context, contentUrl, "r");
|
||||||
|
long size = -1;
|
||||||
|
|
||||||
|
if (uri == null) {
|
||||||
|
Log.e(QtTAG, "getSize(): No permissions to open Uri");
|
||||||
|
return size;
|
||||||
|
}
|
||||||
|
|
||||||
|
try {
|
||||||
|
ContentResolver resolver = context.getContentResolver();
|
||||||
|
Cursor cur = resolver.query(uri, null, null, null, null);
|
||||||
|
if (cur != null) {
|
||||||
|
if (cur.moveToFirst())
|
||||||
|
size = cur.getLong(5); // size column
|
||||||
|
cur.close();
|
||||||
|
}
|
||||||
|
return size;
|
||||||
|
} catch (IllegalArgumentException e) {
|
||||||
|
Log.e(QtTAG, "getSize(): Invalid Uri");
|
||||||
|
return size;
|
||||||
|
} catch (UnsupportedOperationException e) {
|
||||||
|
Log.e(QtTAG, "getSize(): Unsupported operation for given Uri");
|
||||||
|
return size;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public static boolean checkFileExists(Context context, String contentUrl)
|
||||||
|
{
|
||||||
|
Uri uri = getUriWithValidPermission(context, contentUrl, "r");
|
||||||
|
boolean exists = false;
|
||||||
|
|
||||||
|
if (uri == null) {
|
||||||
|
Log.e(QtTAG, "checkFileExists(): No permissions to open Uri");
|
||||||
|
return exists;
|
||||||
|
}
|
||||||
|
|
||||||
|
try {
|
||||||
|
ContentResolver resolver = context.getContentResolver();
|
||||||
|
Cursor cur = resolver.query(uri, null, null, null, null);
|
||||||
|
if (cur != null) {
|
||||||
|
exists = true;
|
||||||
|
cur.close();
|
||||||
|
}
|
||||||
|
return exists;
|
||||||
|
} catch (IllegalArgumentException e) {
|
||||||
|
Log.e(QtTAG, "checkFileExists(): Invalid Uri");
|
||||||
|
return exists;
|
||||||
|
} catch (UnsupportedOperationException e) {
|
||||||
|
Log.e(QtTAG, "checkFileExists(): Unsupported operation for given Uri");
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// this method loads full path libs
|
// this method loads full path libs
|
||||||
public static void loadQtLibraries(final ArrayList<String> libraries)
|
public static void loadQtLibraries(final ArrayList<String> libraries)
|
||||||
{
|
{
|
||||||
|
@ -762,7 +762,7 @@ void Widget::splitFunction()
|
|||||||
|
|
||||||
//! [60]
|
//! [60]
|
||||||
str = "This time, a normal English sentence.";
|
str = "This time, a normal English sentence.";
|
||||||
list = str.split(QRegExp("\\W+"), QString::SkipEmptyParts);
|
list = str.split(QRegExp("\\W+"), Qt::SkipEmptyParts);
|
||||||
// list: [ "This", "time", "a", "normal", "English", "sentence" ]
|
// list: [ "This", "time", "a", "normal", "English", "sentence" ]
|
||||||
//! [60]
|
//! [60]
|
||||||
|
|
||||||
@ -783,7 +783,7 @@ void Widget::splitFunction()
|
|||||||
|
|
||||||
//! [91]
|
//! [91]
|
||||||
str = "This time, a normal English sentence.";
|
str = "This time, a normal English sentence.";
|
||||||
list = str.split(QRegularExpression("\\W+"), QString::SkipEmptyParts);
|
list = str.split(QRegularExpression("\\W+"), Qt::SkipEmptyParts);
|
||||||
// list: [ "This", "time", "a", "normal", "English", "sentence" ]
|
// list: [ "This", "time", "a", "normal", "English", "sentence" ]
|
||||||
//! [91]
|
//! [91]
|
||||||
|
|
||||||
@ -797,24 +797,24 @@ void Widget::splitFunction()
|
|||||||
void Widget::splitCaseSensitiveFunction()
|
void Widget::splitCaseSensitiveFunction()
|
||||||
{
|
{
|
||||||
//! [62]
|
//! [62]
|
||||||
QString str = "a,,b,c";
|
QString str = QStringLiteral("a,,b,c");
|
||||||
|
|
||||||
QStringList list1 = str.split(',');
|
QStringList list1 = str.split(QLatin1Char(','));
|
||||||
// list1: [ "a", "", "b", "c" ]
|
// list1: [ "a", "", "b", "c" ]
|
||||||
|
|
||||||
QStringList list2 = str.split(',', QString::SkipEmptyParts);
|
QStringList list2 = str.split(QLatin1Char(','), Qt::SkipEmptyParts);
|
||||||
// list2: [ "a", "b", "c" ]
|
// list2: [ "a", "b", "c" ]
|
||||||
//! [62]
|
//! [62]
|
||||||
|
|
||||||
//! [62-empty]
|
//! [62-empty]
|
||||||
QString str = "abc";
|
QString str = "abc";
|
||||||
auto parts = str.split("");
|
auto parts = str.split(QString());
|
||||||
// parts: {"", "a", "b", "c", ""}
|
// parts: {"", "a", "b", "c", ""}
|
||||||
//! [62-empty]
|
//! [62-empty]
|
||||||
|
|
||||||
//! [62-slashes]
|
//! [62-slashes]
|
||||||
QString str = "/a/b/c/";
|
QString str = "/a/b/c/";
|
||||||
auto parts = str.split('/');
|
auto parts = str.split(QLatin1Char('/'));
|
||||||
// parts: {"", "a", "b", "c", ""}
|
// parts: {"", "a", "b", "c", ""}
|
||||||
//! [62-slashes]
|
//! [62-slashes]
|
||||||
}
|
}
|
||||||
|
@ -867,8 +867,8 @@ QString QDir::relativeFilePath(const QString &fileName) const
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
QString result;
|
QString result;
|
||||||
QVector<QStringRef> dirElts = dir.splitRef(QLatin1Char('/'), QString::SkipEmptyParts);
|
QVector<QStringRef> dirElts = dir.splitRef(QLatin1Char('/'), Qt::SkipEmptyParts);
|
||||||
QVector<QStringRef> fileElts = file.splitRef(QLatin1Char('/'), QString::SkipEmptyParts);
|
QVector<QStringRef> fileElts = file.splitRef(QLatin1Char('/'), Qt::SkipEmptyParts);
|
||||||
|
|
||||||
int i = 0;
|
int i = 0;
|
||||||
while (i < dirElts.size() && i < fileElts.size() &&
|
while (i < dirElts.size() && i < fileElts.size() &&
|
||||||
|
@ -324,7 +324,7 @@ void QFileSelectorPrivate::updateSelectors()
|
|||||||
|
|
||||||
QLatin1Char pathSep(',');
|
QLatin1Char pathSep(',');
|
||||||
QStringList envSelectors = QString::fromLatin1(qgetenv("QT_FILE_SELECTORS"))
|
QStringList envSelectors = QString::fromLatin1(qgetenv("QT_FILE_SELECTORS"))
|
||||||
.split(pathSep, QString::SkipEmptyParts);
|
.split(pathSep, Qt::SkipEmptyParts);
|
||||||
if (envSelectors.count())
|
if (envSelectors.count())
|
||||||
sharedData->staticSelectors << envSelectors;
|
sharedData->staticSelectors << envSelectors;
|
||||||
|
|
||||||
|
@ -394,7 +394,7 @@ static QString readLink(const QFileSystemEntry &link)
|
|||||||
static bool uncShareExists(const QString &server)
|
static bool uncShareExists(const QString &server)
|
||||||
{
|
{
|
||||||
// This code assumes the UNC path is always like \\?\UNC\server...
|
// This code assumes the UNC path is always like \\?\UNC\server...
|
||||||
const QVector<QStringRef> parts = server.splitRef(QLatin1Char('\\'), QString::SkipEmptyParts);
|
const QVector<QStringRef> parts = server.splitRef(QLatin1Char('\\'), Qt::SkipEmptyParts);
|
||||||
if (parts.count() >= 3) {
|
if (parts.count() >= 3) {
|
||||||
QStringList shares;
|
QStringList shares;
|
||||||
if (QFileSystemEngine::uncListSharesOnServer(QLatin1String("\\\\") + parts.at(2), &shares))
|
if (QFileSystemEngine::uncListSharesOnServer(QLatin1String("\\\\") + parts.at(2), &shares))
|
||||||
|
@ -101,7 +101,7 @@ bool QFileSystemIterator::advance(QFileSystemEntry &fileEntry, QFileSystemMetaDa
|
|||||||
FINDEX_SEARCH_OPS(searchOps), 0, dwAdditionalFlags);
|
FINDEX_SEARCH_OPS(searchOps), 0, dwAdditionalFlags);
|
||||||
if (findFileHandle == INVALID_HANDLE_VALUE) {
|
if (findFileHandle == INVALID_HANDLE_VALUE) {
|
||||||
if (nativePath.startsWith(QLatin1String("\\\\?\\UNC\\"))) {
|
if (nativePath.startsWith(QLatin1String("\\\\?\\UNC\\"))) {
|
||||||
const QVector<QStringRef> parts = nativePath.splitRef(QLatin1Char('\\'), QString::SkipEmptyParts);
|
const QVector<QStringRef> parts = nativePath.splitRef(QLatin1Char('\\'), Qt::SkipEmptyParts);
|
||||||
if (parts.count() == 4 && QFileSystemEngine::uncListSharesOnServer(
|
if (parts.count() == 4 && QFileSystemEngine::uncListSharesOnServer(
|
||||||
QLatin1String("\\\\") + parts.at(2), &uncShares)) {
|
QLatin1String("\\\\") + parts.at(2), &uncShares)) {
|
||||||
if (uncShares.isEmpty())
|
if (uncShares.isEmpty())
|
||||||
|
@ -2239,7 +2239,7 @@ void QProcessPrivate::start(QIODevice::OpenMode mode)
|
|||||||
Tokens with spaces can be surrounded by double quotes; three
|
Tokens with spaces can be surrounded by double quotes; three
|
||||||
consecutive double quotes represent the quote character itself.
|
consecutive double quotes represent the quote character itself.
|
||||||
*/
|
*/
|
||||||
QStringList QProcess::splitCommand(const QString &command)
|
QStringList QProcess::splitCommand(QStringView command)
|
||||||
{
|
{
|
||||||
QStringList args;
|
QStringList args;
|
||||||
QString tmp;
|
QString tmp;
|
||||||
|
@ -282,7 +282,7 @@ public:
|
|||||||
|
|
||||||
static QString nullDevice();
|
static QString nullDevice();
|
||||||
|
|
||||||
static QStringList splitCommand(const QString &command);
|
static QStringList splitCommand(QStringView command);
|
||||||
|
|
||||||
public Q_SLOTS:
|
public Q_SLOTS:
|
||||||
void terminate();
|
void terminate();
|
||||||
|
@ -646,7 +646,7 @@ IApplicationDataContainer *QWinRTSettingsPrivate::getContainer(IApplicationDataC
|
|||||||
IApplicationDataContainer *current = parent;
|
IApplicationDataContainer *current = parent;
|
||||||
if (group.isEmpty())
|
if (group.isEmpty())
|
||||||
return current;
|
return current;
|
||||||
const QStringList groupPath = group.split(QLatin1Char('/'), QString::SkipEmptyParts);
|
const QStringList groupPath = group.split(QLatin1Char('/'), Qt::SkipEmptyParts);
|
||||||
|
|
||||||
for (const QString &subGroup : groupPath) {
|
for (const QString &subGroup : groupPath) {
|
||||||
ComPtr<IApplicationDataContainer> sub = subContainer(current, subGroup);
|
ComPtr<IApplicationDataContainer> sub = subContainer(current, subGroup);
|
||||||
|
@ -512,7 +512,8 @@ QString QStandardPaths::findExecutable(const QString &executableName, const QStr
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Remove trailing slashes, which occur on Windows.
|
// Remove trailing slashes, which occur on Windows.
|
||||||
const QStringList rawPaths = QString::fromLocal8Bit(pEnv.constData()).split(QDir::listSeparator(), QString::SkipEmptyParts);
|
const QStringList rawPaths = QString::fromLocal8Bit(pEnv.constData()).split(
|
||||||
|
QDir::listSeparator(), Qt::SkipEmptyParts);
|
||||||
searchPaths.reserve(rawPaths.size());
|
searchPaths.reserve(rawPaths.size());
|
||||||
for (const QString &rawPath : rawPaths) {
|
for (const QString &rawPath : rawPaths) {
|
||||||
QString cleanPath = QDir::cleanPath(rawPath);
|
QString cleanPath = QDir::cleanPath(rawPath);
|
||||||
|
@ -283,7 +283,7 @@ static QStringList xdgDataDirs()
|
|||||||
dirs.append(QString::fromLatin1("/usr/local/share"));
|
dirs.append(QString::fromLatin1("/usr/local/share"));
|
||||||
dirs.append(QString::fromLatin1("/usr/share"));
|
dirs.append(QString::fromLatin1("/usr/share"));
|
||||||
} else {
|
} else {
|
||||||
const auto parts = xdgDataDirsEnv.splitRef(QLatin1Char(':'), QString::SkipEmptyParts);
|
const auto parts = xdgDataDirsEnv.splitRef(QLatin1Char(':'), Qt::SkipEmptyParts);
|
||||||
|
|
||||||
// Normalize paths, skip relative paths
|
// Normalize paths, skip relative paths
|
||||||
for (const QStringRef &dir : parts) {
|
for (const QStringRef &dir : parts) {
|
||||||
|
@ -2693,7 +2693,7 @@ QStringList QCoreApplication::libraryPathsLocked()
|
|||||||
|
|
||||||
auto setPathsFromEnv = [&](QString libPathEnv) {
|
auto setPathsFromEnv = [&](QString libPathEnv) {
|
||||||
if (!libPathEnv.isEmpty()) {
|
if (!libPathEnv.isEmpty()) {
|
||||||
QStringList paths = libPathEnv.split(QDir::listSeparator(), QString::SkipEmptyParts);
|
QStringList paths = libPathEnv.split(QDir::listSeparator(), Qt::SkipEmptyParts);
|
||||||
for (QStringList::const_iterator it = paths.constBegin(); it != paths.constEnd(); ++it) {
|
for (QStringList::const_iterator it = paths.constBegin(); it != paths.constEnd(); ++it) {
|
||||||
QString canonicalPath = QDir(*it).canonicalPath();
|
QString canonicalPath = QDir(*it).canonicalPath();
|
||||||
if (!canonicalPath.isEmpty()
|
if (!canonicalPath.isEmpty()
|
||||||
|
@ -718,7 +718,7 @@ QMetaType &QMetaType::operator=(const QMetaType &other)
|
|||||||
\relates QMetaType
|
\relates QMetaType
|
||||||
\overload
|
\overload
|
||||||
|
|
||||||
Returns \c true if the QMetaType \a a represents a difference type
|
Returns \c true if the QMetaType \a a represents a different type
|
||||||
than the QMetaType \a b, otherwise returns \c false.
|
than the QMetaType \a b, otherwise returns \c false.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
@ -1750,7 +1750,7 @@ static QtPrivate::QMetaTypeInterface *interfaceForType(int typeId)
|
|||||||
|
|
||||||
Constructs a QMetaType object that contains all information about type \a typeId.
|
Constructs a QMetaType object that contains all information about type \a typeId.
|
||||||
|
|
||||||
\note: The default parameter was added in Qt 5.15
|
\note The default parameter was added in Qt 5.15.
|
||||||
*/
|
*/
|
||||||
QMetaType::QMetaType(int typeId) : QMetaType(interfaceForType(typeId)) {}
|
QMetaType::QMetaType(int typeId) : QMetaType(interfaceForType(typeId)) {}
|
||||||
|
|
||||||
|
@ -109,7 +109,7 @@ HINSTANCE QSystemLibrary::load(const wchar_t *libraryName, bool onlySystemDirect
|
|||||||
|
|
||||||
if (!onlySystemDirectory) {
|
if (!onlySystemDirectory) {
|
||||||
const QString PATH(QLatin1String(qgetenv("PATH").constData()));
|
const QString PATH(QLatin1String(qgetenv("PATH").constData()));
|
||||||
searchOrder << PATH.split(QLatin1Char(';'), QString::SkipEmptyParts);
|
searchOrder << PATH.split(QLatin1Char(';'), Qt::SkipEmptyParts);
|
||||||
}
|
}
|
||||||
QString fileName = QString::fromWCharArray(libraryName);
|
QString fileName = QString::fromWCharArray(libraryName);
|
||||||
fileName.append(QLatin1String(".dll"));
|
fileName.append(QLatin1String(".dll"));
|
||||||
|
@ -239,6 +239,8 @@ QJsonDocument &QJsonDocument::operator =(const QJsonDocument &other)
|
|||||||
|
|
||||||
#if QT_CONFIG(binaryjson) && QT_DEPRECATED_SINCE(5, 15)
|
#if QT_CONFIG(binaryjson) && QT_DEPRECATED_SINCE(5, 15)
|
||||||
/*!
|
/*!
|
||||||
|
\deprecated
|
||||||
|
|
||||||
Creates a QJsonDocument that uses the first \a size bytes from
|
Creates a QJsonDocument that uses the first \a size bytes from
|
||||||
\a data. It assumes \a data contains a binary encoded JSON document.
|
\a data. It assumes \a data contains a binary encoded JSON document.
|
||||||
The created document does not take ownership of \a data. The data is
|
The created document does not take ownership of \a data. The data is
|
||||||
@ -253,7 +255,7 @@ QJsonDocument &QJsonDocument::operator =(const QJsonDocument &other)
|
|||||||
|
|
||||||
Returns a QJsonDocument representing the data.
|
Returns a QJsonDocument representing the data.
|
||||||
|
|
||||||
\deprecated in Qt 5.15. The binary JSON encoding is only retained for backwards
|
\note Deprecated in Qt 5.15. The binary JSON encoding is only retained for backwards
|
||||||
compatibility. It is undocumented and restrictive in the maximum size of JSON
|
compatibility. It is undocumented and restrictive in the maximum size of JSON
|
||||||
documents that can be encoded. Qt JSON types can be converted to Qt CBOR types,
|
documents that can be encoded. Qt JSON types can be converted to Qt CBOR types,
|
||||||
which can in turn be serialized into the CBOR binary format and vice versa. The
|
which can in turn be serialized into the CBOR binary format and vice versa. The
|
||||||
@ -285,13 +287,15 @@ QJsonDocument QJsonDocument::fromRawData(const char *data, int size, DataValidat
|
|||||||
}
|
}
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
|
\deprecated
|
||||||
|
|
||||||
Returns the raw binary representation of the data
|
Returns the raw binary representation of the data
|
||||||
\a size will contain the size of the returned data.
|
\a size will contain the size of the returned data.
|
||||||
|
|
||||||
This method is useful to e.g. stream the JSON document
|
This method is useful to e.g. stream the JSON document
|
||||||
in its binary form to a file.
|
in its binary form to a file.
|
||||||
|
|
||||||
\deprecated in Qt 5.15. The binary JSON encoding is only retained for backwards
|
\note Deprecated in Qt 5.15. The binary JSON encoding is only retained for backwards
|
||||||
compatibility. It is undocumented and restrictive in the maximum size of JSON
|
compatibility. It is undocumented and restrictive in the maximum size of JSON
|
||||||
documents that can be encoded. Qt JSON types can be converted to Qt CBOR types,
|
documents that can be encoded. Qt JSON types can be converted to Qt CBOR types,
|
||||||
which can in turn be serialized into the CBOR binary format and vice versa. The
|
which can in turn be serialized into the CBOR binary format and vice versa. The
|
||||||
@ -325,13 +329,14 @@ const char *QJsonDocument::rawData(int *size) const
|
|||||||
}
|
}
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
|
\deprecated
|
||||||
Creates a QJsonDocument from \a data.
|
Creates a QJsonDocument from \a data.
|
||||||
|
|
||||||
\a validation decides whether the data is checked for validity before being used.
|
\a validation decides whether the data is checked for validity before being used.
|
||||||
By default the data is validated. If the \a data is not valid, the method returns
|
By default the data is validated. If the \a data is not valid, the method returns
|
||||||
a null document.
|
a null document.
|
||||||
|
|
||||||
\deprecated in Qt 5.15. The binary JSON encoding is only retained for backwards
|
\note Deprecated in Qt 5.15. The binary JSON encoding is only retained for backwards
|
||||||
compatibility. It is undocumented and restrictive in the maximum size of JSON
|
compatibility. It is undocumented and restrictive in the maximum size of JSON
|
||||||
documents that can be encoded. Qt JSON types can be converted to Qt CBOR types,
|
documents that can be encoded. Qt JSON types can be converted to Qt CBOR types,
|
||||||
which can in turn be serialized into the CBOR binary format and vice versa. The
|
which can in turn be serialized into the CBOR binary format and vice versa. The
|
||||||
@ -364,6 +369,7 @@ QJsonDocument QJsonDocument::fromBinaryData(const QByteArray &data, DataValidati
|
|||||||
}
|
}
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
|
\deprecated
|
||||||
Returns a binary representation of the document.
|
Returns a binary representation of the document.
|
||||||
|
|
||||||
The binary representation is also the native format used internally in Qt,
|
The binary representation is also the native format used internally in Qt,
|
||||||
@ -373,7 +379,7 @@ QJsonDocument QJsonDocument::fromBinaryData(const QByteArray &data, DataValidati
|
|||||||
or computers. fromBinaryData() can be used to convert it back into a
|
or computers. fromBinaryData() can be used to convert it back into a
|
||||||
JSON document.
|
JSON document.
|
||||||
|
|
||||||
\deprecated in Qt 5.15. The binary JSON encoding is only retained for backwards
|
\note Deprecated in Qt 5.15. The binary JSON encoding is only retained for backwards
|
||||||
compatibility. It is undocumented and restrictive in the maximum size of JSON
|
compatibility. It is undocumented and restrictive in the maximum size of JSON
|
||||||
documents that can be encoded. Qt JSON types can be converted to Qt CBOR types,
|
documents that can be encoded. Qt JSON types can be converted to Qt CBOR types,
|
||||||
which can in turn be serialized into the CBOR binary format and vice versa. The
|
which can in turn be serialized into the CBOR binary format and vice versa. The
|
||||||
|
@ -4969,7 +4969,7 @@ QByteArray QByteArray::toPercentEncoding(const QByteArray &exclude, const QByteA
|
|||||||
|
|
||||||
\snippet code/src_corelib_tools_qbytearray.cpp 44ter
|
\snippet code/src_corelib_tools_qbytearray.cpp 44ter
|
||||||
|
|
||||||
In alternative, it is possible to access the conversion status
|
Alternatively, it is possible to access the conversion status
|
||||||
and the decoded data directly:
|
and the decoded data directly:
|
||||||
|
|
||||||
\snippet code/src_corelib_tools_qbytearray.cpp 44quater
|
\snippet code/src_corelib_tools_qbytearray.cpp 44quater
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
**
|
**
|
||||||
** Copyright (C) 2016 The Qt Company Ltd.
|
** Copyright (C) 2020 The Qt Company Ltd.
|
||||||
** Copyright (C) 2018 Intel Corporation.
|
** Copyright (C) 2018 Intel Corporation.
|
||||||
** Copyright (C) 2019 Mail.ru Group.
|
** Copyright (C) 2019 Mail.ru Group.
|
||||||
** Contact: https://www.qt.io/licensing/
|
** Contact: https://www.qt.io/licensing/
|
||||||
@ -1757,6 +1757,9 @@ const QString::Null QString::null = { };
|
|||||||
/*!
|
/*!
|
||||||
\enum QString::SplitBehavior
|
\enum QString::SplitBehavior
|
||||||
|
|
||||||
|
\obsolete
|
||||||
|
Use Qt::SplitBehavior instead.
|
||||||
|
|
||||||
This enum specifies how the split() function should behave with
|
This enum specifies how the split() function should behave with
|
||||||
respect to empty strings.
|
respect to empty strings.
|
||||||
|
|
||||||
@ -4612,7 +4615,7 @@ int QString::count(const QRegularExpression &re) const
|
|||||||
|
|
||||||
QString QString::section(const QString &sep, int start, int end, SectionFlags flags) const
|
QString QString::section(const QString &sep, int start, int end, SectionFlags flags) const
|
||||||
{
|
{
|
||||||
const QVector<QStringRef> sections = splitRef(sep, KeepEmptyParts,
|
const QVector<QStringRef> sections = splitRef(sep, Qt::KeepEmptyParts,
|
||||||
(flags & SectionCaseInsensitiveSeps) ? Qt::CaseInsensitive : Qt::CaseSensitive);
|
(flags & SectionCaseInsensitiveSeps) ? Qt::CaseInsensitive : Qt::CaseSensitive);
|
||||||
const int sectionsSize = sections.size();
|
const int sectionsSize = sections.size();
|
||||||
if (!(flags & SectionSkipEmpty)) {
|
if (!(flags & SectionSkipEmpty)) {
|
||||||
@ -7603,23 +7606,30 @@ QString QString::number(double n, char f, int prec)
|
|||||||
namespace {
|
namespace {
|
||||||
template<class ResultList, class StringSource>
|
template<class ResultList, class StringSource>
|
||||||
static ResultList splitString(const StringSource &source, const QChar *sep,
|
static ResultList splitString(const StringSource &source, const QChar *sep,
|
||||||
QString::SplitBehavior behavior, Qt::CaseSensitivity cs, const int separatorSize)
|
Qt::SplitBehavior behavior, Qt::CaseSensitivity cs, const int separatorSize)
|
||||||
{
|
{
|
||||||
ResultList list;
|
ResultList list;
|
||||||
typename StringSource::size_type start = 0;
|
typename StringSource::size_type start = 0;
|
||||||
typename StringSource::size_type end;
|
typename StringSource::size_type end;
|
||||||
typename StringSource::size_type extra = 0;
|
typename StringSource::size_type extra = 0;
|
||||||
while ((end = QtPrivate::findString(QStringView(source.constData(), source.size()), start + extra, QStringView(sep, separatorSize), cs)) != -1) {
|
while ((end = QtPrivate::findString(QStringView(source.constData(), source.size()), start + extra, QStringView(sep, separatorSize), cs)) != -1) {
|
||||||
if (start != end || behavior == QString::KeepEmptyParts)
|
if (start != end || behavior == Qt::KeepEmptyParts)
|
||||||
list.append(source.mid(start, end - start));
|
list.append(source.mid(start, end - start));
|
||||||
start = end + separatorSize;
|
start = end + separatorSize;
|
||||||
extra = (separatorSize == 0 ? 1 : 0);
|
extra = (separatorSize == 0 ? 1 : 0);
|
||||||
}
|
}
|
||||||
if (start != source.size() || behavior == QString::KeepEmptyParts)
|
if (start != source.size() || behavior == Qt::KeepEmptyParts)
|
||||||
list.append(source.mid(start, -1));
|
list.append(source.mid(start, -1));
|
||||||
return list;
|
return list;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if QT_DEPRECATED_SINCE(5, 15)
|
||||||
|
Qt::SplitBehavior mapSplitBehavior(QString::SplitBehavior sb)
|
||||||
|
{
|
||||||
|
return sb & QString::SkipEmptyParts ? Qt::SkipEmptyParts : Qt::KeepEmptyParts;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
} // namespace
|
} // namespace
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
@ -7649,12 +7659,25 @@ static ResultList splitString(const StringSource &source, const QChar *sep,
|
|||||||
\snippet qstring/main.cpp 62-slashes
|
\snippet qstring/main.cpp 62-slashes
|
||||||
|
|
||||||
\sa QStringList::join(), section()
|
\sa QStringList::join(), section()
|
||||||
|
|
||||||
|
\since 5.14
|
||||||
*/
|
*/
|
||||||
QStringList QString::split(const QString &sep, SplitBehavior behavior, Qt::CaseSensitivity cs) const
|
QStringList QString::split(const QString &sep, Qt::SplitBehavior behavior, Qt::CaseSensitivity cs) const
|
||||||
{
|
{
|
||||||
return splitString<QStringList>(*this, sep.constData(), behavior, cs, sep.size());
|
return splitString<QStringList>(*this, sep.constData(), behavior, cs, sep.size());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if QT_DEPRECATED_SINCE(5, 15)
|
||||||
|
/*!
|
||||||
|
\overload
|
||||||
|
\obsolete
|
||||||
|
*/
|
||||||
|
QStringList QString::split(const QString &sep, SplitBehavior behavior, Qt::CaseSensitivity cs) const
|
||||||
|
{
|
||||||
|
return split(sep, mapSplitBehavior(behavior), cs);
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
Splits the string into substring references wherever \a sep occurs, and
|
Splits the string into substring references wherever \a sep occurs, and
|
||||||
returns the list of those strings.
|
returns the list of those strings.
|
||||||
@ -7665,29 +7688,68 @@ QStringList QString::split(const QString &sep, SplitBehavior behavior, Qt::CaseS
|
|||||||
\note All references are valid as long this string is alive. Destroying this
|
\note All references are valid as long this string is alive. Destroying this
|
||||||
string will cause all references to be dangling pointers.
|
string will cause all references to be dangling pointers.
|
||||||
|
|
||||||
\since 5.4
|
\since 5.14
|
||||||
\sa QStringRef split()
|
\sa QStringRef split()
|
||||||
*/
|
*/
|
||||||
|
QVector<QStringRef> QString::splitRef(const QString &sep, Qt::SplitBehavior behavior,
|
||||||
|
Qt::CaseSensitivity cs) const
|
||||||
|
{
|
||||||
|
return splitString<QVector<QStringRef>>(QStringRef(this), sep.constData(), behavior,
|
||||||
|
cs, sep.size());
|
||||||
|
}
|
||||||
|
|
||||||
|
#if QT_DEPRECATED_SINCE(5, 15)
|
||||||
|
/*!
|
||||||
|
\overload
|
||||||
|
\obsolete
|
||||||
|
\since 5.4
|
||||||
|
*/
|
||||||
QVector<QStringRef> QString::splitRef(const QString &sep, SplitBehavior behavior, Qt::CaseSensitivity cs) const
|
QVector<QStringRef> QString::splitRef(const QString &sep, SplitBehavior behavior, Qt::CaseSensitivity cs) const
|
||||||
{
|
{
|
||||||
return splitString<QVector<QStringRef> >(QStringRef(this), sep.constData(), behavior, cs, sep.size());
|
return splitRef(sep, mapSplitBehavior(behavior), cs);
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\overload
|
\overload
|
||||||
|
\since 5.14
|
||||||
*/
|
*/
|
||||||
QStringList QString::split(QChar sep, SplitBehavior behavior, Qt::CaseSensitivity cs) const
|
QStringList QString::split(QChar sep, Qt::SplitBehavior behavior, Qt::CaseSensitivity cs) const
|
||||||
{
|
{
|
||||||
return splitString<QStringList>(*this, &sep, behavior, cs, 1);
|
return splitString<QStringList>(*this, &sep, behavior, cs, 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if QT_DEPRECATED_SINCE(5, 15)
|
||||||
|
/*!
|
||||||
|
\overload
|
||||||
|
\obsolete
|
||||||
|
*/
|
||||||
|
QStringList QString::split(QChar sep, SplitBehavior behavior, Qt::CaseSensitivity cs) const
|
||||||
|
{
|
||||||
|
return split(sep, mapSplitBehavior(behavior), cs);
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/*!
|
||||||
|
\overload
|
||||||
|
\since 5.14
|
||||||
|
*/
|
||||||
|
QVector<QStringRef> QString::splitRef(QChar sep, Qt::SplitBehavior behavior,
|
||||||
|
Qt::CaseSensitivity cs) const
|
||||||
|
{
|
||||||
|
return splitString<QVector<QStringRef> >(QStringRef(this), &sep, behavior, cs, 1);
|
||||||
|
}
|
||||||
|
|
||||||
|
#if QT_DEPRECATED_SINCE(5, 15)
|
||||||
/*!
|
/*!
|
||||||
\overload
|
\overload
|
||||||
\since 5.4
|
\since 5.4
|
||||||
*/
|
*/
|
||||||
QVector<QStringRef> QString::splitRef(QChar sep, SplitBehavior behavior, Qt::CaseSensitivity cs) const
|
QVector<QStringRef> QString::splitRef(QChar sep, SplitBehavior behavior, Qt::CaseSensitivity cs) const
|
||||||
{
|
{
|
||||||
return splitString<QVector<QStringRef> >(QStringRef(this), &sep, behavior, cs, 1);
|
return splitRef(sep, mapSplitBehavior(behavior), cs);
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
Splits the string into substrings references wherever \a sep occurs, and
|
Splits the string into substrings references wherever \a sep occurs, and
|
||||||
@ -7699,26 +7761,50 @@ QVector<QStringRef> QString::splitRef(QChar sep, SplitBehavior behavior, Qt::Cas
|
|||||||
\note All references are valid as long this string is alive. Destroying this
|
\note All references are valid as long this string is alive. Destroying this
|
||||||
string will cause all references to be dangling pointers.
|
string will cause all references to be dangling pointers.
|
||||||
|
|
||||||
\since 5.4
|
\since 5.14
|
||||||
*/
|
*/
|
||||||
QVector<QStringRef> QStringRef::split(const QString &sep, QString::SplitBehavior behavior, Qt::CaseSensitivity cs) const
|
QVector<QStringRef> QStringRef::split(const QString &sep, Qt::SplitBehavior behavior, Qt::CaseSensitivity cs) const
|
||||||
{
|
{
|
||||||
return splitString<QVector<QStringRef> >(*this, sep.constData(), behavior, cs, sep.size());
|
return splitString<QVector<QStringRef> >(*this, sep.constData(), behavior, cs, sep.size());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if QT_DEPRECATED_SINCE(5, 15)
|
||||||
/*!
|
/*!
|
||||||
\overload
|
\overload
|
||||||
\since 5.4
|
\since 5.4
|
||||||
|
\obsolete
|
||||||
*/
|
*/
|
||||||
QVector<QStringRef> QStringRef::split(QChar sep, QString::SplitBehavior behavior, Qt::CaseSensitivity cs) const
|
QVector<QStringRef> QStringRef::split(const QString &sep, QString::SplitBehavior behavior, Qt::CaseSensitivity cs) const
|
||||||
|
{
|
||||||
|
return split(sep, mapSplitBehavior(behavior), cs);
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/*!
|
||||||
|
\overload
|
||||||
|
\since 5.14
|
||||||
|
*/
|
||||||
|
QVector<QStringRef> QStringRef::split(QChar sep, Qt::SplitBehavior behavior, Qt::CaseSensitivity cs) const
|
||||||
{
|
{
|
||||||
return splitString<QVector<QStringRef> >(*this, &sep, behavior, cs, 1);
|
return splitString<QVector<QStringRef> >(*this, &sep, behavior, cs, 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if QT_DEPRECATED_SINCE(5, 15)
|
||||||
|
/*!
|
||||||
|
\overload
|
||||||
|
\since 5.4
|
||||||
|
\obsolete
|
||||||
|
*/
|
||||||
|
QVector<QStringRef> QStringRef::split(QChar sep, QString::SplitBehavior behavior, Qt::CaseSensitivity cs) const
|
||||||
|
{
|
||||||
|
return split(sep, mapSplitBehavior(behavior), cs);
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifndef QT_NO_REGEXP
|
#ifndef QT_NO_REGEXP
|
||||||
namespace {
|
namespace {
|
||||||
template<class ResultList, typename MidMethod>
|
template<class ResultList, typename MidMethod>
|
||||||
static ResultList splitString(const QString &source, MidMethod mid, const QRegExp &rx, QString::SplitBehavior behavior)
|
static ResultList splitString(const QString &source, MidMethod mid, const QRegExp &rx, Qt::SplitBehavior behavior)
|
||||||
{
|
{
|
||||||
QRegExp rx2(rx);
|
QRegExp rx2(rx);
|
||||||
ResultList list;
|
ResultList list;
|
||||||
@ -7727,12 +7813,12 @@ static ResultList splitString(const QString &source, MidMethod mid, const QRegEx
|
|||||||
int end;
|
int end;
|
||||||
while ((end = rx2.indexIn(source, start + extra)) != -1) {
|
while ((end = rx2.indexIn(source, start + extra)) != -1) {
|
||||||
int matchedLen = rx2.matchedLength();
|
int matchedLen = rx2.matchedLength();
|
||||||
if (start != end || behavior == QString::KeepEmptyParts)
|
if (start != end || behavior == Qt::KeepEmptyParts)
|
||||||
list.append((source.*mid)(start, end - start));
|
list.append((source.*mid)(start, end - start));
|
||||||
start = end + matchedLen;
|
start = end + matchedLen;
|
||||||
extra = (matchedLen == 0) ? 1 : 0;
|
extra = (matchedLen == 0) ? 1 : 0;
|
||||||
}
|
}
|
||||||
if (start != source.size() || behavior == QString::KeepEmptyParts)
|
if (start != source.size() || behavior == Qt::KeepEmptyParts)
|
||||||
list.append((source.*mid)(start, -1));
|
list.append((source.*mid)(start, -1));
|
||||||
return list;
|
return list;
|
||||||
}
|
}
|
||||||
@ -7740,6 +7826,7 @@ static ResultList splitString(const QString &source, MidMethod mid, const QRegEx
|
|||||||
|
|
||||||
/*!
|
/*!
|
||||||
\overload
|
\overload
|
||||||
|
\since 5.14
|
||||||
|
|
||||||
Splits the string into substrings wherever the regular expression
|
Splits the string into substrings wherever the regular expression
|
||||||
\a rx matches, and returns the list of those strings. If \a rx
|
\a rx matches, and returns the list of those strings. If \a rx
|
||||||
@ -7764,14 +7851,25 @@ static ResultList splitString(const QString &source, MidMethod mid, const QRegEx
|
|||||||
|
|
||||||
\sa QStringList::join(), section()
|
\sa QStringList::join(), section()
|
||||||
*/
|
*/
|
||||||
QStringList QString::split(const QRegExp &rx, SplitBehavior behavior) const
|
QStringList QString::split(const QRegExp &rx, Qt::SplitBehavior behavior) const
|
||||||
{
|
{
|
||||||
return splitString<QStringList>(*this, &QString::mid, rx, behavior);
|
return splitString<QStringList>(*this, &QString::mid, rx, behavior);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# if QT_DEPRECATED_SINCE(5, 15)
|
||||||
/*!
|
/*!
|
||||||
\overload
|
\overload
|
||||||
\since 5.4
|
\obsolete
|
||||||
|
*/
|
||||||
|
QStringList QString::split(const QRegExp &rx, SplitBehavior behavior) const
|
||||||
|
{
|
||||||
|
return split(rx, mapSplitBehavior(behavior));
|
||||||
|
}
|
||||||
|
# endif
|
||||||
|
|
||||||
|
/*!
|
||||||
|
\overload
|
||||||
|
\since 5.14
|
||||||
|
|
||||||
Splits the string into substring references wherever the regular expression
|
Splits the string into substring references wherever the regular expression
|
||||||
\a rx matches, and returns the list of those strings. If \a rx
|
\a rx matches, and returns the list of those strings. If \a rx
|
||||||
@ -7783,17 +7881,29 @@ QStringList QString::split(const QRegExp &rx, SplitBehavior behavior) const
|
|||||||
|
|
||||||
\sa QStringRef split()
|
\sa QStringRef split()
|
||||||
*/
|
*/
|
||||||
QVector<QStringRef> QString::splitRef(const QRegExp &rx, SplitBehavior behavior) const
|
QVector<QStringRef> QString::splitRef(const QRegExp &rx, Qt::SplitBehavior behavior) const
|
||||||
{
|
{
|
||||||
return splitString<QVector<QStringRef> >(*this, &QString::midRef, rx, behavior);
|
return splitString<QVector<QStringRef> >(*this, &QString::midRef, rx, behavior);
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
# if QT_DEPRECATED_SINCE(5, 15)
|
||||||
|
/*!
|
||||||
|
\overload
|
||||||
|
\since 5.4
|
||||||
|
\obsolete
|
||||||
|
*/
|
||||||
|
QVector<QStringRef> QString::splitRef(const QRegExp &rx, SplitBehavior behavior) const
|
||||||
|
{
|
||||||
|
return splitRef(rx, mapSplitBehavior(behavior));
|
||||||
|
}
|
||||||
|
# endif
|
||||||
|
#endif // QT_NO_REGEXP
|
||||||
|
|
||||||
#if QT_CONFIG(regularexpression)
|
#if QT_CONFIG(regularexpression)
|
||||||
namespace {
|
namespace {
|
||||||
template<class ResultList, typename MidMethod>
|
template<class ResultList, typename MidMethod>
|
||||||
static ResultList splitString(const QString &source, MidMethod mid, const QRegularExpression &re,
|
static ResultList splitString(const QString &source, MidMethod mid, const QRegularExpression &re,
|
||||||
QString::SplitBehavior behavior)
|
Qt::SplitBehavior behavior)
|
||||||
{
|
{
|
||||||
ResultList list;
|
ResultList list;
|
||||||
if (!re.isValid()) {
|
if (!re.isValid()) {
|
||||||
@ -7807,12 +7917,12 @@ static ResultList splitString(const QString &source, MidMethod mid, const QRegul
|
|||||||
while (iterator.hasNext()) {
|
while (iterator.hasNext()) {
|
||||||
QRegularExpressionMatch match = iterator.next();
|
QRegularExpressionMatch match = iterator.next();
|
||||||
end = match.capturedStart();
|
end = match.capturedStart();
|
||||||
if (start != end || behavior == QString::KeepEmptyParts)
|
if (start != end || behavior == Qt::KeepEmptyParts)
|
||||||
list.append((source.*mid)(start, end - start));
|
list.append((source.*mid)(start, end - start));
|
||||||
start = match.capturedEnd();
|
start = match.capturedEnd();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (start != source.size() || behavior == QString::KeepEmptyParts)
|
if (start != source.size() || behavior == Qt::KeepEmptyParts)
|
||||||
list.append((source.*mid)(start, -1));
|
list.append((source.*mid)(start, -1));
|
||||||
|
|
||||||
return list;
|
return list;
|
||||||
@ -7821,7 +7931,7 @@ static ResultList splitString(const QString &source, MidMethod mid, const QRegul
|
|||||||
|
|
||||||
/*!
|
/*!
|
||||||
\overload
|
\overload
|
||||||
\since 5.0
|
\since 5.14
|
||||||
|
|
||||||
Splits the string into substrings wherever the regular expression
|
Splits the string into substrings wherever the regular expression
|
||||||
\a re matches, and returns the list of those strings. If \a re
|
\a re matches, and returns the list of those strings. If \a re
|
||||||
@ -7846,14 +7956,26 @@ static ResultList splitString(const QString &source, MidMethod mid, const QRegul
|
|||||||
|
|
||||||
\sa QStringList::join(), section()
|
\sa QStringList::join(), section()
|
||||||
*/
|
*/
|
||||||
QStringList QString::split(const QRegularExpression &re, SplitBehavior behavior) const
|
QStringList QString::split(const QRegularExpression &re, Qt::SplitBehavior behavior) const
|
||||||
{
|
{
|
||||||
return splitString<QStringList>(*this, &QString::mid, re, behavior);
|
return splitString<QStringList>(*this, &QString::mid, re, behavior);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# if QT_DEPRECATED_SINCE(5, 15)
|
||||||
/*!
|
/*!
|
||||||
\overload
|
\overload
|
||||||
\since 5.4
|
\since 5.0
|
||||||
|
\obsolete
|
||||||
|
*/
|
||||||
|
QStringList QString::split(const QRegularExpression &re, SplitBehavior behavior) const
|
||||||
|
{
|
||||||
|
return split(re, mapSplitBehavior(behavior));
|
||||||
|
}
|
||||||
|
# endif
|
||||||
|
|
||||||
|
/*!
|
||||||
|
\overload
|
||||||
|
\since 5.14
|
||||||
|
|
||||||
Splits the string into substring references wherever the regular expression
|
Splits the string into substring references wherever the regular expression
|
||||||
\a re matches, and returns the list of those strings. If \a re
|
\a re matches, and returns the list of those strings. If \a re
|
||||||
@ -7865,10 +7987,22 @@ QStringList QString::split(const QRegularExpression &re, SplitBehavior behavior)
|
|||||||
|
|
||||||
\sa split() QStringRef
|
\sa split() QStringRef
|
||||||
*/
|
*/
|
||||||
QVector<QStringRef> QString::splitRef(const QRegularExpression &re, SplitBehavior behavior) const
|
QVector<QStringRef> QString::splitRef(const QRegularExpression &re, Qt::SplitBehavior behavior) const
|
||||||
{
|
{
|
||||||
return splitString<QVector<QStringRef> >(*this, &QString::midRef, re, behavior);
|
return splitString<QVector<QStringRef> >(*this, &QString::midRef, re, behavior);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# if QT_DEPRECATED_SINCE(5, 15)
|
||||||
|
/*!
|
||||||
|
\overload
|
||||||
|
\since 5.4
|
||||||
|
\obsolete
|
||||||
|
*/
|
||||||
|
QVector<QStringRef> QString::splitRef(const QRegularExpression &re, SplitBehavior behavior) const
|
||||||
|
{
|
||||||
|
return splitRef(re, mapSplitBehavior(behavior));
|
||||||
|
}
|
||||||
|
# endif
|
||||||
#endif // QT_CONFIG(regularexpression)
|
#endif // QT_CONFIG(regularexpression)
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
|
@ -580,45 +580,68 @@ public:
|
|||||||
{ return replace(re, QString()); }
|
{ return replace(re, QString()); }
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
enum SplitBehavior { KeepEmptyParts, SkipEmptyParts };
|
#if QT_DEPRECATED_SINCE(5, 15)
|
||||||
|
enum SplitBehavior // ### Qt 6: replace with Qt:: version
|
||||||
|
{
|
||||||
|
KeepEmptyParts Q_DECL_ENUMERATOR_DEPRECATED,
|
||||||
|
SkipEmptyParts Q_DECL_ENUMERATOR_DEPRECATED
|
||||||
|
};
|
||||||
|
|
||||||
Q_REQUIRED_RESULT QStringList split(const QString &sep, SplitBehavior behavior = KeepEmptyParts,
|
Q_REQUIRED_RESULT QT_DEPRECATED_VERSION_X_5_15("Use Qt::SplitBehavior variant instead")
|
||||||
|
QStringList split(const QString &sep, SplitBehavior behavior,
|
||||||
Qt::CaseSensitivity cs = Qt::CaseSensitive) const;
|
Qt::CaseSensitivity cs = Qt::CaseSensitive) const;
|
||||||
Q_REQUIRED_RESULT QVector<QStringRef> splitRef(const QString &sep, SplitBehavior behavior = KeepEmptyParts,
|
Q_REQUIRED_RESULT QT_DEPRECATED_VERSION_X_5_15("Use Qt::SplitBehavior variant instead")
|
||||||
|
QVector<QStringRef> splitRef(const QString &sep, SplitBehavior behavior,
|
||||||
Qt::CaseSensitivity cs = Qt::CaseSensitive) const;
|
Qt::CaseSensitivity cs = Qt::CaseSensitive) const;
|
||||||
Q_REQUIRED_RESULT QStringList split(QChar sep, SplitBehavior behavior = KeepEmptyParts,
|
Q_REQUIRED_RESULT QT_DEPRECATED_VERSION_X_5_15("Use Qt::SplitBehavior variant instead")
|
||||||
|
QStringList split(QChar sep, SplitBehavior behavior,
|
||||||
Qt::CaseSensitivity cs = Qt::CaseSensitive) const;
|
Qt::CaseSensitivity cs = Qt::CaseSensitive) const;
|
||||||
Q_REQUIRED_RESULT QVector<QStringRef> splitRef(QChar sep, SplitBehavior behavior = KeepEmptyParts,
|
Q_REQUIRED_RESULT QT_DEPRECATED_VERSION_X_5_15("Use Qt::SplitBehavior variant instead")
|
||||||
|
QVector<QStringRef> splitRef(QChar sep, SplitBehavior behavior,
|
||||||
Qt::CaseSensitivity cs = Qt::CaseSensitive) const;
|
Qt::CaseSensitivity cs = Qt::CaseSensitive) const;
|
||||||
#ifndef QT_NO_REGEXP
|
#ifndef QT_NO_REGEXP
|
||||||
Q_REQUIRED_RESULT QStringList split(const QRegExp &sep, SplitBehavior behavior = KeepEmptyParts) const;
|
Q_REQUIRED_RESULT QT_DEPRECATED_VERSION_X_5_15("Use Qt::SplitBehavior variant instead")
|
||||||
Q_REQUIRED_RESULT QVector<QStringRef> splitRef(const QRegExp &sep, SplitBehavior behavior = KeepEmptyParts) const;
|
QStringList split(const QRegExp &sep, SplitBehavior behavior) const;
|
||||||
|
Q_REQUIRED_RESULT QT_DEPRECATED_VERSION_X_5_15("Use Qt::SplitBehavior variant instead")
|
||||||
|
QVector<QStringRef> splitRef(const QRegExp &sep, SplitBehavior behavior) const;
|
||||||
#endif
|
#endif
|
||||||
#if QT_CONFIG(regularexpression)
|
#if QT_CONFIG(regularexpression)
|
||||||
Q_REQUIRED_RESULT QStringList split(const QRegularExpression &sep, SplitBehavior behavior = KeepEmptyParts) const;
|
Q_REQUIRED_RESULT QT_DEPRECATED_VERSION_X_5_15("Use Qt::SplitBehavior variant instead")
|
||||||
Q_REQUIRED_RESULT QVector<QStringRef> splitRef(const QRegularExpression &sep, SplitBehavior behavior = KeepEmptyParts) const;
|
QStringList split(const QRegularExpression &sep, SplitBehavior behavior) const;
|
||||||
|
Q_REQUIRED_RESULT QT_DEPRECATED_VERSION_X_5_15("Use Qt::SplitBehavior variant instead")
|
||||||
|
QVector<QStringRef> splitRef(const QRegularExpression &sep, SplitBehavior behavior) const;
|
||||||
#endif
|
#endif
|
||||||
|
#endif // 5.15 deprecations
|
||||||
|
|
||||||
private:
|
|
||||||
static Q_DECL_CONSTEXPR SplitBehavior _sb(Qt::SplitBehavior sb) Q_DECL_NOTHROW
|
|
||||||
{ return sb & Qt::SkipEmptyParts ? SkipEmptyParts : KeepEmptyParts; }
|
|
||||||
public:
|
public:
|
||||||
|
Q_REQUIRED_RESULT
|
||||||
Q_REQUIRED_RESULT inline QStringList split(const QString &sep, Qt::SplitBehavior behavior,
|
QStringList split(const QString &sep, Qt::SplitBehavior behavior = Qt::KeepEmptyParts,
|
||||||
Qt::CaseSensitivity cs = Qt::CaseSensitive) const;
|
Qt::CaseSensitivity cs = Qt::CaseSensitive) const;
|
||||||
Q_REQUIRED_RESULT inline QVector<QStringRef> splitRef(const QString &sep, Qt::SplitBehavior behavior,
|
Q_REQUIRED_RESULT
|
||||||
|
QVector<QStringRef> splitRef(const QString &sep,
|
||||||
|
Qt::SplitBehavior behavior = Qt::KeepEmptyParts,
|
||||||
Qt::CaseSensitivity cs = Qt::CaseSensitive) const;
|
Qt::CaseSensitivity cs = Qt::CaseSensitive) const;
|
||||||
Q_REQUIRED_RESULT inline QStringList split(QChar sep, Qt::SplitBehavior behavior,
|
Q_REQUIRED_RESULT
|
||||||
|
QStringList split(QChar sep, Qt::SplitBehavior behavior = Qt::KeepEmptyParts,
|
||||||
Qt::CaseSensitivity cs = Qt::CaseSensitive) const;
|
Qt::CaseSensitivity cs = Qt::CaseSensitive) const;
|
||||||
Q_REQUIRED_RESULT inline QVector<QStringRef> splitRef(QChar sep, Qt::SplitBehavior behavior,
|
Q_REQUIRED_RESULT
|
||||||
|
QVector<QStringRef> splitRef(QChar sep, Qt::SplitBehavior behavior = Qt::KeepEmptyParts,
|
||||||
Qt::CaseSensitivity cs = Qt::CaseSensitive) const;
|
Qt::CaseSensitivity cs = Qt::CaseSensitive) const;
|
||||||
#ifndef QT_NO_REGEXP
|
#ifndef QT_NO_REGEXP
|
||||||
Q_REQUIRED_RESULT inline QStringList split(const QRegExp &sep, Qt::SplitBehavior behavior) const;
|
Q_REQUIRED_RESULT
|
||||||
Q_REQUIRED_RESULT inline QVector<QStringRef> splitRef(const QRegExp &sep, Qt::SplitBehavior behavior) const;
|
QStringList split(const QRegExp &sep,
|
||||||
|
Qt::SplitBehavior behavior = Qt::KeepEmptyParts) const;
|
||||||
|
Q_REQUIRED_RESULT
|
||||||
|
QVector<QStringRef> splitRef(const QRegExp &sep,
|
||||||
|
Qt::SplitBehavior behavior = Qt::KeepEmptyParts) const;
|
||||||
#endif
|
#endif
|
||||||
#ifndef QT_NO_REGULAREXPRESSION
|
#ifndef QT_NO_REGULAREXPRESSION
|
||||||
Q_REQUIRED_RESULT inline QStringList split(const QRegularExpression &sep, Qt::SplitBehavior behavior) const;
|
Q_REQUIRED_RESULT
|
||||||
Q_REQUIRED_RESULT inline QVector<QStringRef> splitRef(const QRegularExpression &sep, Qt::SplitBehavior behavior) const;
|
QStringList split(const QRegularExpression &sep,
|
||||||
|
Qt::SplitBehavior behavior = Qt::KeepEmptyParts) const;
|
||||||
|
Q_REQUIRED_RESULT
|
||||||
|
QVector<QStringRef> splitRef(const QRegularExpression &sep,
|
||||||
|
Qt::SplitBehavior behavior = Qt::KeepEmptyParts) const;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
@ -1485,14 +1508,20 @@ public:
|
|||||||
int count(QChar c, Qt::CaseSensitivity cs = Qt::CaseSensitive) const;
|
int count(QChar c, Qt::CaseSensitivity cs = Qt::CaseSensitive) const;
|
||||||
int count(const QStringRef &s, Qt::CaseSensitivity cs = Qt::CaseSensitive) const;
|
int count(const QStringRef &s, Qt::CaseSensitivity cs = Qt::CaseSensitive) const;
|
||||||
|
|
||||||
Q_REQUIRED_RESULT QVector<QStringRef> split(const QString &sep, QString::SplitBehavior behavior = QString::KeepEmptyParts,
|
#if QT_DEPRECATED_SINCE(5, 15)
|
||||||
|
Q_REQUIRED_RESULT QT_DEPRECATED_VERSION_X_5_15("Use Qt::SplitBehavior variant instead")
|
||||||
|
QVector<QStringRef> split(const QString &sep, QString::SplitBehavior behavior,
|
||||||
Qt::CaseSensitivity cs = Qt::CaseSensitive) const;
|
Qt::CaseSensitivity cs = Qt::CaseSensitive) const;
|
||||||
Q_REQUIRED_RESULT QVector<QStringRef> split(QChar sep, QString::SplitBehavior behavior = QString::KeepEmptyParts,
|
Q_REQUIRED_RESULT QT_DEPRECATED_VERSION_X_5_15("Use Qt::SplitBehavior variant instead")
|
||||||
|
QVector<QStringRef> split(QChar sep, QString::SplitBehavior behavior,
|
||||||
Qt::CaseSensitivity cs = Qt::CaseSensitive) const;
|
Qt::CaseSensitivity cs = Qt::CaseSensitive) const;
|
||||||
|
#endif // 5.15 deprecations
|
||||||
|
|
||||||
Q_REQUIRED_RESULT inline QVector<QStringRef> split(const QString &sep, Qt::SplitBehavior behavior,
|
Q_REQUIRED_RESULT
|
||||||
|
QVector<QStringRef> split(const QString &sep, Qt::SplitBehavior behavior = Qt::KeepEmptyParts,
|
||||||
Qt::CaseSensitivity cs = Qt::CaseSensitive) const;
|
Qt::CaseSensitivity cs = Qt::CaseSensitive) const;
|
||||||
Q_REQUIRED_RESULT inline QVector<QStringRef> split(QChar sep, Qt::SplitBehavior behavior,
|
Q_REQUIRED_RESULT
|
||||||
|
QVector<QStringRef> split(QChar sep, Qt::SplitBehavior behavior = Qt::KeepEmptyParts,
|
||||||
Qt::CaseSensitivity cs = Qt::CaseSensitive) const;
|
Qt::CaseSensitivity cs = Qt::CaseSensitive) const;
|
||||||
|
|
||||||
Q_REQUIRED_RESULT QStringRef left(int n) const;
|
Q_REQUIRED_RESULT QStringRef left(int n) const;
|
||||||
|
@ -384,23 +384,6 @@ inline int QStringList::lastIndexOf(const QRegularExpression &rx, int from) cons
|
|||||||
#endif // QT_CONFIG(regularexpression)
|
#endif // QT_CONFIG(regularexpression)
|
||||||
#endif // Q_QDOC
|
#endif // Q_QDOC
|
||||||
|
|
||||||
//
|
|
||||||
// QString inline functions:
|
|
||||||
//
|
|
||||||
|
|
||||||
QStringList QString::split(const QString &sep, Qt::SplitBehavior behavior, Qt::CaseSensitivity cs) const
|
|
||||||
{ return split(sep, _sb(behavior), cs); }
|
|
||||||
QStringList QString::split(QChar sep, Qt::SplitBehavior behavior, Qt::CaseSensitivity cs) const
|
|
||||||
{ return split(sep, _sb(behavior), cs); }
|
|
||||||
#ifndef QT_NO_REGEXP
|
|
||||||
QStringList QString::split(const QRegExp &sep, Qt::SplitBehavior behavior) const
|
|
||||||
{ return split(sep, _sb(behavior)); }
|
|
||||||
#endif
|
|
||||||
#if QT_CONFIG(regularexpression)
|
|
||||||
QStringList QString::split(const QRegularExpression &sep, Qt::SplitBehavior behavior) const
|
|
||||||
{ return split(sep, _sb(behavior)); }
|
|
||||||
#endif
|
|
||||||
|
|
||||||
QT_END_NAMESPACE
|
QT_END_NAMESPACE
|
||||||
|
|
||||||
#endif // QSTRINGLIST_H
|
#endif // QSTRINGLIST_H
|
||||||
|
@ -173,7 +173,7 @@ static ParsedRfcDateTime rfcDateImpl(const QString &s)
|
|||||||
// or "ddd MMM dd[ hh:mm:ss] yyyy [±hhmm]" - permissive RFC 850, 1036 (read only)
|
// or "ddd MMM dd[ hh:mm:ss] yyyy [±hhmm]" - permissive RFC 850, 1036 (read only)
|
||||||
ParsedRfcDateTime result;
|
ParsedRfcDateTime result;
|
||||||
|
|
||||||
auto words = s.splitRef(QLatin1Char(' '), QString::SkipEmptyParts);
|
auto words = s.splitRef(QLatin1Char(' '), Qt::SkipEmptyParts);
|
||||||
if (words.size() < 3 || words.size() > 6)
|
if (words.size() < 3 || words.size() > 6)
|
||||||
return result;
|
return result;
|
||||||
const QChar colon(QLatin1Char(':'));
|
const QChar colon(QLatin1Char(':'));
|
||||||
@ -1784,7 +1784,7 @@ QT_WARNING_POP
|
|||||||
return rfcDateImpl(string).date;
|
return rfcDateImpl(string).date;
|
||||||
default:
|
default:
|
||||||
case Qt::TextDate: {
|
case Qt::TextDate: {
|
||||||
QVector<QStringRef> parts = string.splitRef(QLatin1Char(' '), QString::SkipEmptyParts);
|
QVector<QStringRef> parts = string.splitRef(QLatin1Char(' '), Qt::SkipEmptyParts);
|
||||||
|
|
||||||
if (parts.count() != 4)
|
if (parts.count() != 4)
|
||||||
return QDate();
|
return QDate();
|
||||||
@ -5417,7 +5417,7 @@ QT_WARNING_POP
|
|||||||
return QDateTime(date, time, spec, offset);
|
return QDateTime(date, time, spec, offset);
|
||||||
}
|
}
|
||||||
case Qt::TextDate: {
|
case Qt::TextDate: {
|
||||||
QVector<QStringRef> parts = string.splitRef(QLatin1Char(' '), QString::SkipEmptyParts);
|
QVector<QStringRef> parts = string.splitRef(QLatin1Char(' '), Qt::SkipEmptyParts);
|
||||||
|
|
||||||
if ((parts.count() < 5) || (parts.count() > 6))
|
if ((parts.count() < 5) || (parts.count() > 6))
|
||||||
return QDateTime();
|
return QDateTime();
|
||||||
|
@ -784,24 +784,6 @@ extern template class Q_CORE_EXPORT QVector<QPoint>;
|
|||||||
|
|
||||||
QVector<uint> QStringView::toUcs4() const { return QtPrivate::convertToUcs4(*this); }
|
QVector<uint> QStringView::toUcs4() const { return QtPrivate::convertToUcs4(*this); }
|
||||||
|
|
||||||
QVector<QStringRef> QString::splitRef(const QString &sep, Qt::SplitBehavior behavior, Qt::CaseSensitivity cs) const
|
|
||||||
{ return splitRef(sep, _sb(behavior), cs); }
|
|
||||||
QVector<QStringRef> QString::splitRef(QChar sep, Qt::SplitBehavior behavior, Qt::CaseSensitivity cs) const
|
|
||||||
{ return splitRef(sep, _sb(behavior), cs); }
|
|
||||||
#ifndef QT_NO_REGEXP
|
|
||||||
QVector<QStringRef> QString::splitRef(const QRegExp &sep, Qt::SplitBehavior behavior) const
|
|
||||||
{ return splitRef(sep, _sb(behavior)); }
|
|
||||||
#endif
|
|
||||||
#if QT_CONFIG(regularexpression)
|
|
||||||
QVector<QStringRef> QString::splitRef(const QRegularExpression &sep, Qt::SplitBehavior behavior) const
|
|
||||||
{ return splitRef(sep, _sb(behavior)); }
|
|
||||||
#endif
|
|
||||||
QVector<QStringRef> QStringRef::split(const QString &sep, Qt::SplitBehavior behavior, Qt::CaseSensitivity cs) const
|
|
||||||
{ return split(sep, QString::_sb(behavior), cs); }
|
|
||||||
QVector<QStringRef> QStringRef::split(QChar sep, Qt::SplitBehavior behavior, Qt::CaseSensitivity cs) const
|
|
||||||
{ return split(sep, QString::_sb(behavior), cs); }
|
|
||||||
|
|
||||||
|
|
||||||
QT_END_NAMESPACE
|
QT_END_NAMESPACE
|
||||||
|
|
||||||
#include <QtCore/qbytearraylist.h>
|
#include <QtCore/qbytearraylist.h>
|
||||||
|
@ -95,7 +95,7 @@ QString qDBusInterfaceFromMetaObject(const QMetaObject *mo)
|
|||||||
} else {
|
} else {
|
||||||
interface.prepend(QLatin1Char('.')).prepend(QCoreApplication::instance()->applicationName());
|
interface.prepend(QLatin1Char('.')).prepend(QCoreApplication::instance()->applicationName());
|
||||||
const QString organizationDomain = QCoreApplication::instance()->organizationDomain();
|
const QString organizationDomain = QCoreApplication::instance()->organizationDomain();
|
||||||
const auto domainName = organizationDomain.splitRef(QLatin1Char('.'), QString::SkipEmptyParts);
|
const auto domainName = organizationDomain.splitRef(QLatin1Char('.'), Qt::SkipEmptyParts);
|
||||||
if (domainName.isEmpty()) {
|
if (domainName.isEmpty()) {
|
||||||
interface.prepend(QLatin1String("local."));
|
interface.prepend(QLatin1String("local."));
|
||||||
} else {
|
} else {
|
||||||
|
@ -285,7 +285,7 @@ QString qDBusGenerateMetaObjectXml(QString interface, const QMetaObject *mo, con
|
|||||||
interface.prepend(QLatin1Char('.')).prepend(QCoreApplication::instance()->applicationName());
|
interface.prepend(QLatin1Char('.')).prepend(QCoreApplication::instance()->applicationName());
|
||||||
QStringList domainName =
|
QStringList domainName =
|
||||||
QCoreApplication::instance()->organizationDomain().split(QLatin1Char('.'),
|
QCoreApplication::instance()->organizationDomain().split(QLatin1Char('.'),
|
||||||
QString::SkipEmptyParts);
|
Qt::SkipEmptyParts);
|
||||||
if (domainName.isEmpty())
|
if (domainName.isEmpty())
|
||||||
interface.prepend(QLatin1String("local."));
|
interface.prepend(QLatin1String("local."));
|
||||||
else
|
else
|
||||||
|
@ -2118,7 +2118,7 @@ static QImage convertWithPalette(const QImage &src, QImage::Format format,
|
|||||||
dest.setColorTable(clut);
|
dest.setColorTable(clut);
|
||||||
|
|
||||||
QString textsKeys = src.text();
|
QString textsKeys = src.text();
|
||||||
const auto textKeyList = textsKeys.splitRef(QLatin1Char('\n'), QString::SkipEmptyParts);
|
const auto textKeyList = textsKeys.splitRef(QLatin1Char('\n'), Qt::SkipEmptyParts);
|
||||||
for (const auto &textKey : textKeyList) {
|
for (const auto &textKey : textKeyList) {
|
||||||
const auto textKeySplitted = textKey.split(QLatin1String(": "));
|
const auto textKeySplitted = textKey.split(QLatin1String(": "));
|
||||||
dest.setText(textKeySplitted[0].toString(), textKeySplitted[1].toString());
|
dest.setText(textKeySplitted[0].toString(), textKeySplitted[1].toString());
|
||||||
|
@ -3852,8 +3852,8 @@ static void formatTabletEvent(QDebug d, const QTabletEvent *e)
|
|||||||
|
|
||||||
d << eventClassName(type) << '(';
|
d << eventClassName(type) << '(';
|
||||||
QtDebugUtils::formatQEnum(d, type);
|
QtDebugUtils::formatQEnum(d, type);
|
||||||
d << ", device=";
|
d << ", deviceType=";
|
||||||
QtDebugUtils::formatQEnum(d, e->device());
|
QtDebugUtils::formatQEnum(d, e->deviceType());
|
||||||
d << ", pointerType=";
|
d << ", pointerType=";
|
||||||
QtDebugUtils::formatQEnum(d, e->pointerType());
|
QtDebugUtils::formatQEnum(d, e->pointerType());
|
||||||
d << ", uniqueId=" << e->uniqueId()
|
d << ", uniqueId=" << e->uniqueId()
|
||||||
@ -3865,9 +3865,9 @@ static void formatTabletEvent(QDebug d, const QTabletEvent *e)
|
|||||||
QtDebugUtils::formatQFlags(d, e->buttons());
|
QtDebugUtils::formatQFlags(d, e->buttons());
|
||||||
if (type == QEvent::TabletPress || type == QEvent::TabletMove)
|
if (type == QEvent::TabletPress || type == QEvent::TabletMove)
|
||||||
d << ", pressure=" << e->pressure();
|
d << ", pressure=" << e->pressure();
|
||||||
if (e->device() == QTabletEvent::RotationStylus || e->device() == QTabletEvent::FourDMouse)
|
if (e->deviceType() == QTabletEvent::RotationStylus || e->deviceType() == QTabletEvent::FourDMouse)
|
||||||
d << ", rotation=" << e->rotation();
|
d << ", rotation=" << e->rotation();
|
||||||
if (e->device() == QTabletEvent::Airbrush)
|
if (e->deviceType() == QTabletEvent::Airbrush)
|
||||||
d << ", tangentialPressure=" << e->tangentialPressure();
|
d << ", tangentialPressure=" << e->tangentialPressure();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1212,12 +1212,12 @@ Q_LOGGING_CATEGORY(lcQpaPluginLoading, "qt.qpa.plugin");
|
|||||||
|
|
||||||
static void init_platform(const QString &pluginNamesWithArguments, const QString &platformPluginPath, const QString &platformThemeName, int &argc, char **argv)
|
static void init_platform(const QString &pluginNamesWithArguments, const QString &platformPluginPath, const QString &platformThemeName, int &argc, char **argv)
|
||||||
{
|
{
|
||||||
QStringList plugins = pluginNamesWithArguments.split(QLatin1Char(';'), QString::SkipEmptyParts);
|
QStringList plugins = pluginNamesWithArguments.split(QLatin1Char(';'), Qt::SkipEmptyParts);
|
||||||
QStringList platformArguments;
|
QStringList platformArguments;
|
||||||
QStringList availablePlugins = QPlatformIntegrationFactory::keys(platformPluginPath);
|
QStringList availablePlugins = QPlatformIntegrationFactory::keys(platformPluginPath);
|
||||||
for (const auto &pluginArgument : plugins) {
|
for (const auto &pluginArgument : plugins) {
|
||||||
// Split into platform name and arguments
|
// Split into platform name and arguments
|
||||||
QStringList arguments = pluginArgument.split(QLatin1Char(':'), QString::SkipEmptyParts);
|
QStringList arguments = pluginArgument.split(QLatin1Char(':'), Qt::SkipEmptyParts);
|
||||||
if (arguments.isEmpty())
|
if (arguments.isEmpty())
|
||||||
continue;
|
continue;
|
||||||
const QString name = arguments.takeFirst().toLower();
|
const QString name = arguments.takeFirst().toLower();
|
||||||
|
@ -788,7 +788,7 @@ QStringList QPlatformFileDialogHelper::cleanFilterList(const QString &filter)
|
|||||||
filter.indexOf(regexp, 0, &match);
|
filter.indexOf(regexp, 0, &match);
|
||||||
if (match.hasMatch())
|
if (match.hasMatch())
|
||||||
f = match.captured(2);
|
f = match.captured(2);
|
||||||
return f.split(QLatin1Char(' '), QString::SkipEmptyParts);
|
return f.split(QLatin1Char(' '), Qt::SkipEmptyParts);
|
||||||
#else
|
#else
|
||||||
return QStringList();
|
return QStringList();
|
||||||
#endif
|
#endif
|
||||||
|
@ -300,7 +300,7 @@ QByteArray QPdfWriter::documentXmpMetadata() const
|
|||||||
/*!
|
/*!
|
||||||
\since 5.15
|
\since 5.15
|
||||||
|
|
||||||
Adds \a fileName attachment to the PDF with (optional) \a mimeType
|
Adds \a fileName attachment to the PDF with (optional) \a mimeType.
|
||||||
\a data contains the raw file data to embed into the PDF file.
|
\a data contains the raw file data to embed into the PDF file.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
@ -1584,7 +1584,7 @@ QRect Declaration::rectValue() const
|
|||||||
const QStringList func = v.variant.toStringList();
|
const QStringList func = v.variant.toStringList();
|
||||||
if (func.count() != 2 || func.at(0).compare(QLatin1String("rect")) != 0)
|
if (func.count() != 2 || func.at(0).compare(QLatin1String("rect")) != 0)
|
||||||
return QRect();
|
return QRect();
|
||||||
const auto args = func[1].splitRef(QLatin1Char(' '), QString::SkipEmptyParts);
|
const auto args = func[1].splitRef(QLatin1Char(' '), Qt::SkipEmptyParts);
|
||||||
if (args.count() != 4)
|
if (args.count() != 4)
|
||||||
return QRect();
|
return QRect();
|
||||||
QRect rect(args[0].toInt(), args[1].toInt(), args[2].toInt(), args[3].toInt());
|
QRect rect(args[0].toInt(), args[1].toInt(), args[2].toInt(), args[3].toInt());
|
||||||
|
@ -510,7 +510,7 @@ void QNetworkReplyWasmImplPrivate::headersReceived(const QString &bufferString)
|
|||||||
Q_Q(QNetworkReplyWasmImpl);
|
Q_Q(QNetworkReplyWasmImpl);
|
||||||
|
|
||||||
if (!bufferString.isEmpty()) {
|
if (!bufferString.isEmpty()) {
|
||||||
QStringList headers = bufferString.split(QString::fromUtf8("\r\n"), QString::SkipEmptyParts);
|
QStringList headers = bufferString.split(QString::fromUtf8("\r\n"), Qt::SkipEmptyParts);
|
||||||
|
|
||||||
for (int i = 0; i < headers.size(); i++) {
|
for (int i = 0; i < headers.size(); i++) {
|
||||||
QString headerName = headers.at(i).split(QString::fromUtf8(": ")).at(0);
|
QString headerName = headers.at(i).split(QString::fromUtf8(": ")).at(0);
|
||||||
|
@ -110,6 +110,7 @@ QNetworkConfigurationManagerPrivate *qNetworkConfigurationManagerPrivate()
|
|||||||
|
|
||||||
/*!
|
/*!
|
||||||
\class QNetworkConfigurationManager
|
\class QNetworkConfigurationManager
|
||||||
|
\obsolete
|
||||||
|
|
||||||
\brief The QNetworkConfigurationManager class manages the network configurations provided
|
\brief The QNetworkConfigurationManager class manages the network configurations provided
|
||||||
by the system.
|
by the system.
|
||||||
|
@ -40,16 +40,31 @@
|
|||||||
#ifndef QNETWORKCONFIGMANAGER_H
|
#ifndef QNETWORKCONFIGMANAGER_H
|
||||||
#define QNETWORKCONFIGMANAGER_H
|
#define QNETWORKCONFIGMANAGER_H
|
||||||
|
|
||||||
|
#if 0
|
||||||
|
#pragma qt_class(QNetworkConfigurationManager)
|
||||||
|
#endif
|
||||||
|
|
||||||
#include <QtNetwork/qtnetworkglobal.h>
|
#include <QtNetwork/qtnetworkglobal.h>
|
||||||
#include <QtCore/qobject.h>
|
#include <QtCore/qobject.h>
|
||||||
#include <QtNetwork/qnetworkconfiguration.h>
|
#include <QtNetwork/qnetworkconfiguration.h>
|
||||||
|
|
||||||
|
QT_WARNING_PUSH
|
||||||
|
QT_WARNING_DISABLE_DEPRECATED
|
||||||
|
|
||||||
#ifndef QT_NO_BEARERMANAGEMENT
|
#ifndef QT_NO_BEARERMANAGEMENT
|
||||||
|
|
||||||
QT_BEGIN_NAMESPACE
|
QT_BEGIN_NAMESPACE
|
||||||
|
|
||||||
class QNetworkConfigurationManagerPrivate;
|
class QNetworkConfigurationManagerPrivate;
|
||||||
class Q_NETWORK_EXPORT QNetworkConfigurationManager : public QObject
|
// We work around an issue in ICC where it errors out during compilation of Qt by not marking it
|
||||||
|
// deprecated if ICC is used
|
||||||
|
#ifdef Q_CC_INTEL
|
||||||
|
#define QT_DEPRECATED_VERSION_5_15_BUT_NOT_FOR_ICC
|
||||||
|
#else
|
||||||
|
#define QT_DEPRECATED_VERSION_5_15_BUT_NOT_FOR_ICC QT_DEPRECATED_VERSION_5_15
|
||||||
|
#endif
|
||||||
|
class QT_DEPRECATED_VERSION_5_15_BUT_NOT_FOR_ICC Q_NETWORK_EXPORT QNetworkConfigurationManager : public QObject
|
||||||
|
#undef QT_DEPRECATED_VERSION_5_15_BUT_NOT_FOR_ICC
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
@ -97,4 +112,6 @@ QT_END_NAMESPACE
|
|||||||
|
|
||||||
#endif // QT_NO_BEARERMANAGEMENT
|
#endif // QT_NO_BEARERMANAGEMENT
|
||||||
|
|
||||||
|
QT_WARNING_POP
|
||||||
|
|
||||||
#endif // QNETWORKCONFIGMANAGER_H
|
#endif // QNETWORKCONFIGMANAGER_H
|
||||||
|
@ -45,6 +45,7 @@ QT_BEGIN_NAMESPACE
|
|||||||
|
|
||||||
/*!
|
/*!
|
||||||
\class QNetworkConfiguration
|
\class QNetworkConfiguration
|
||||||
|
\obsolete
|
||||||
|
|
||||||
\brief The QNetworkConfiguration class provides an abstraction of one or more access point configurations.
|
\brief The QNetworkConfiguration class provides an abstraction of one or more access point configurations.
|
||||||
|
|
||||||
|
@ -40,6 +40,10 @@
|
|||||||
#ifndef QNETWORKCONFIGURATION_H
|
#ifndef QNETWORKCONFIGURATION_H
|
||||||
#define QNETWORKCONFIGURATION_H
|
#define QNETWORKCONFIGURATION_H
|
||||||
|
|
||||||
|
#if 0
|
||||||
|
#pragma qt_class(QNetworkConfiguration)
|
||||||
|
#endif
|
||||||
|
|
||||||
#include <QtNetwork/qtnetworkglobal.h>
|
#include <QtNetwork/qtnetworkglobal.h>
|
||||||
|
|
||||||
#include <QtCore/qshareddata.h>
|
#include <QtCore/qshareddata.h>
|
||||||
@ -47,10 +51,21 @@
|
|||||||
#include <QtCore/qlist.h>
|
#include <QtCore/qlist.h>
|
||||||
#include <QtCore/qmetatype.h>
|
#include <QtCore/qmetatype.h>
|
||||||
|
|
||||||
|
QT_WARNING_PUSH
|
||||||
|
QT_WARNING_DISABLE_DEPRECATED
|
||||||
|
|
||||||
QT_BEGIN_NAMESPACE
|
QT_BEGIN_NAMESPACE
|
||||||
|
|
||||||
class QNetworkConfigurationPrivate;
|
class QNetworkConfigurationPrivate;
|
||||||
class Q_NETWORK_EXPORT QNetworkConfiguration
|
// We work around an issue in ICC where it errors out during compilation of Qt by not marking it
|
||||||
|
// deprecated if ICC is used
|
||||||
|
#ifdef Q_CC_INTEL
|
||||||
|
#define QT_DEPRECATED_VERSION_5_15_BUT_NOT_FOR_ICC
|
||||||
|
#else
|
||||||
|
#define QT_DEPRECATED_VERSION_5_15_BUT_NOT_FOR_ICC QT_DEPRECATED_VERSION_5_15
|
||||||
|
#endif
|
||||||
|
class QT_DEPRECATED_VERSION_5_15_BUT_NOT_FOR_ICC Q_NETWORK_EXPORT QNetworkConfiguration
|
||||||
|
#undef QT_DEPRECATED_VERSION_5_15_BUT_NOT_FOR_ICC
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
QNetworkConfiguration();
|
QNetworkConfiguration();
|
||||||
@ -135,4 +150,6 @@ QT_END_NAMESPACE
|
|||||||
|
|
||||||
Q_DECLARE_METATYPE(QNetworkConfiguration)
|
Q_DECLARE_METATYPE(QNetworkConfiguration)
|
||||||
|
|
||||||
|
QT_WARNING_POP
|
||||||
|
|
||||||
#endif // QNETWORKCONFIGURATION_H
|
#endif // QNETWORKCONFIGURATION_H
|
||||||
|
@ -59,6 +59,7 @@ QT_BEGIN_NAMESPACE
|
|||||||
|
|
||||||
/*!
|
/*!
|
||||||
\class QNetworkSession
|
\class QNetworkSession
|
||||||
|
\obsolete
|
||||||
|
|
||||||
\brief The QNetworkSession class provides control over the system's access points
|
\brief The QNetworkSession class provides control over the system's access points
|
||||||
and enables session management for cases when multiple clients access the same access point.
|
and enables session management for cases when multiple clients access the same access point.
|
||||||
|
@ -40,6 +40,10 @@
|
|||||||
#ifndef QNETWORKSESSION_H
|
#ifndef QNETWORKSESSION_H
|
||||||
#define QNETWORKSESSION_H
|
#define QNETWORKSESSION_H
|
||||||
|
|
||||||
|
#if 0
|
||||||
|
#pragma qt_class(QNetworkSession)
|
||||||
|
#endif
|
||||||
|
|
||||||
#include <QtNetwork/qtnetworkglobal.h>
|
#include <QtNetwork/qtnetworkglobal.h>
|
||||||
#include <QtCore/qobject.h>
|
#include <QtCore/qobject.h>
|
||||||
#include <QtCore/qstring.h>
|
#include <QtCore/qstring.h>
|
||||||
@ -47,6 +51,9 @@
|
|||||||
#include <QtCore/qvariant.h>
|
#include <QtCore/qvariant.h>
|
||||||
#include <QtNetwork/qnetworkconfiguration.h>
|
#include <QtNetwork/qnetworkconfiguration.h>
|
||||||
|
|
||||||
|
QT_WARNING_PUSH
|
||||||
|
QT_WARNING_DISABLE_DEPRECATED
|
||||||
|
|
||||||
#ifndef QT_NO_BEARERMANAGEMENT
|
#ifndef QT_NO_BEARERMANAGEMENT
|
||||||
|
|
||||||
#if defined(Q_OS_WIN) && defined(interface)
|
#if defined(Q_OS_WIN) && defined(interface)
|
||||||
@ -57,7 +64,15 @@
|
|||||||
QT_BEGIN_NAMESPACE
|
QT_BEGIN_NAMESPACE
|
||||||
|
|
||||||
class QNetworkSessionPrivate;
|
class QNetworkSessionPrivate;
|
||||||
class Q_NETWORK_EXPORT QNetworkSession : public QObject
|
// We work around an issue in ICC where it errors out during compilation of Qt by not marking it
|
||||||
|
// deprecated if ICC is used
|
||||||
|
#ifdef Q_CC_INTEL
|
||||||
|
#define QT_DEPRECATED_VERSION_5_15_BUT_NOT_FOR_ICC
|
||||||
|
#else
|
||||||
|
#define QT_DEPRECATED_VERSION_5_15_BUT_NOT_FOR_ICC QT_DEPRECATED_VERSION_5_15
|
||||||
|
#endif
|
||||||
|
class QT_DEPRECATED_VERSION_5_15_BUT_NOT_FOR_ICC Q_NETWORK_EXPORT QNetworkSession : public QObject
|
||||||
|
#undef QT_DEPRECATED_VERSION_5_15_BUT_NOT_FOR_ICC
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
@ -147,4 +162,6 @@ Q_DECLARE_METATYPE(QNetworkSession::UsagePolicies)
|
|||||||
|
|
||||||
#endif // QT_NO_BEARERMANAGEMENT
|
#endif // QT_NO_BEARERMANAGEMENT
|
||||||
|
|
||||||
|
QT_WARNING_POP
|
||||||
|
|
||||||
#endif // QNETWORKSESSION_H
|
#endif // QNETWORKSESSION_H
|
||||||
|
@ -320,7 +320,7 @@ qt_feature("networkdiskcache" PUBLIC
|
|||||||
qt_feature_definition("networkdiskcache" "QT_NO_NETWORKDISKCACHE" NEGATE VALUE "1")
|
qt_feature_definition("networkdiskcache" "QT_NO_NETWORKDISKCACHE" NEGATE VALUE "1")
|
||||||
qt_feature("bearermanagement" PUBLIC
|
qt_feature("bearermanagement" PUBLIC
|
||||||
SECTION "Networking"
|
SECTION "Networking"
|
||||||
LABEL "Bearer management"
|
LABEL "Bearer management (deprecated)"
|
||||||
PURPOSE "Provides bearer management for the network stack."
|
PURPOSE "Provides bearer management for the network stack."
|
||||||
CONDITION QT_FEATURE_thread AND QT_FEATURE_library AND QT_FEATURE_networkinterface AND QT_FEATURE_properties
|
CONDITION QT_FEATURE_thread AND QT_FEATURE_library AND QT_FEATURE_networkinterface AND QT_FEATURE_properties
|
||||||
)
|
)
|
||||||
|
@ -388,7 +388,7 @@
|
|||||||
"output": [ "publicFeature", "feature" ]
|
"output": [ "publicFeature", "feature" ]
|
||||||
},
|
},
|
||||||
"bearermanagement": {
|
"bearermanagement": {
|
||||||
"label": "Bearer management",
|
"label": "Bearer management (deprecated)",
|
||||||
"purpose": "Provides bearer management for the network stack.",
|
"purpose": "Provides bearer management for the network stack.",
|
||||||
"section": "Networking",
|
"section": "Networking",
|
||||||
"condition": "features.thread && features.library && features.networkinterface && features.properties",
|
"condition": "features.thread && features.library && features.networkinterface && features.properties",
|
||||||
|
@ -76,6 +76,8 @@ public:
|
|||||||
explicit QNetworkProxyQuery(quint16 bindPort, const QString &protocolTag = QString(),
|
explicit QNetworkProxyQuery(quint16 bindPort, const QString &protocolTag = QString(),
|
||||||
QueryType queryType = TcpServer);
|
QueryType queryType = TcpServer);
|
||||||
#if !defined(QT_NO_BEARERMANAGEMENT) && QT_DEPRECATED_SINCE(5, 10)
|
#if !defined(QT_NO_BEARERMANAGEMENT) && QT_DEPRECATED_SINCE(5, 10)
|
||||||
|
QT_WARNING_PUSH
|
||||||
|
QT_WARNING_DISABLE_DEPRECATED
|
||||||
Q_DECL_DEPRECATED_X("QNetworkConfiguration support in QNetworkProxy is deprecated")
|
Q_DECL_DEPRECATED_X("QNetworkConfiguration support in QNetworkProxy is deprecated")
|
||||||
QNetworkProxyQuery(const QNetworkConfiguration &networkConfiguration,
|
QNetworkProxyQuery(const QNetworkConfiguration &networkConfiguration,
|
||||||
const QUrl &requestUrl, QueryType queryType = UrlRequest);
|
const QUrl &requestUrl, QueryType queryType = UrlRequest);
|
||||||
@ -87,6 +89,7 @@ public:
|
|||||||
QNetworkProxyQuery(const QNetworkConfiguration &networkConfiguration,
|
QNetworkProxyQuery(const QNetworkConfiguration &networkConfiguration,
|
||||||
quint16 bindPort, const QString &protocolTag = QString(),
|
quint16 bindPort, const QString &protocolTag = QString(),
|
||||||
QueryType queryType = TcpServer);
|
QueryType queryType = TcpServer);
|
||||||
|
QT_WARNING_POP
|
||||||
#endif
|
#endif
|
||||||
QNetworkProxyQuery(const QNetworkProxyQuery &other);
|
QNetworkProxyQuery(const QNetworkProxyQuery &other);
|
||||||
QNetworkProxyQuery &operator=(QNetworkProxyQuery &&other) noexcept { swap(other); return *this; }
|
QNetworkProxyQuery &operator=(QNetworkProxyQuery &&other) noexcept { swap(other); return *this; }
|
||||||
@ -118,10 +121,13 @@ public:
|
|||||||
void setUrl(const QUrl &url);
|
void setUrl(const QUrl &url);
|
||||||
|
|
||||||
#if !defined(QT_NO_BEARERMANAGEMENT) && QT_DEPRECATED_SINCE(5, 10)
|
#if !defined(QT_NO_BEARERMANAGEMENT) && QT_DEPRECATED_SINCE(5, 10)
|
||||||
|
QT_WARNING_PUSH
|
||||||
|
QT_WARNING_DISABLE_DEPRECATED
|
||||||
Q_DECL_DEPRECATED_X("QNetworkConfiguration support in QNetworkProxy is deprecated")
|
Q_DECL_DEPRECATED_X("QNetworkConfiguration support in QNetworkProxy is deprecated")
|
||||||
QNetworkConfiguration networkConfiguration() const;
|
QNetworkConfiguration networkConfiguration() const;
|
||||||
Q_DECL_DEPRECATED_X("QNetworkConfiguration support in QNetworkProxy is deprecated")
|
Q_DECL_DEPRECATED_X("QNetworkConfiguration support in QNetworkProxy is deprecated")
|
||||||
void setNetworkConfiguration(const QNetworkConfiguration &networkConfiguration);
|
void setNetworkConfiguration(const QNetworkConfiguration &networkConfiguration);
|
||||||
|
QT_WARNING_POP
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
@ -97,7 +97,7 @@ static bool containsTLDEntry(QStringView entry, TLDMatchType match)
|
|||||||
Q_NETWORK_EXPORT QString qTopLevelDomain(const QString &domain)
|
Q_NETWORK_EXPORT QString qTopLevelDomain(const QString &domain)
|
||||||
{
|
{
|
||||||
const QString domainLower = domain.toLower();
|
const QString domainLower = domain.toLower();
|
||||||
QVector<QStringRef> sections = domainLower.splitRef(QLatin1Char('.'), QString::SkipEmptyParts);
|
QVector<QStringRef> sections = domainLower.splitRef(QLatin1Char('.'), Qt::SkipEmptyParts);
|
||||||
if (sections.isEmpty())
|
if (sections.isEmpty())
|
||||||
return QString();
|
return QString();
|
||||||
|
|
||||||
|
@ -1456,7 +1456,7 @@ void QSslSocket::setCiphers(const QString &ciphers)
|
|||||||
{
|
{
|
||||||
Q_D(QSslSocket);
|
Q_D(QSslSocket);
|
||||||
d->configuration.ciphers.clear();
|
d->configuration.ciphers.clear();
|
||||||
const auto cipherNames = ciphers.split(QLatin1Char(':'), QString::SkipEmptyParts);
|
const auto cipherNames = ciphers.split(QLatin1Char(':'), Qt::SkipEmptyParts);
|
||||||
for (const QString &cipherName : cipherNames) {
|
for (const QString &cipherName : cipherNames) {
|
||||||
QSslCipher cipher(cipherName);
|
QSslCipher cipher(cipherName);
|
||||||
if (!cipher.isNull())
|
if (!cipher.isNull())
|
||||||
|
@ -374,7 +374,7 @@ QSslCipher QSslSocketBackendPrivate::QSslCipher_from_SSL_CIPHER(const SSL_CIPHER
|
|||||||
char buf [256];
|
char buf [256];
|
||||||
QString descriptionOneLine = QString::fromLatin1(q_SSL_CIPHER_description(cipher, buf, sizeof(buf)));
|
QString descriptionOneLine = QString::fromLatin1(q_SSL_CIPHER_description(cipher, buf, sizeof(buf)));
|
||||||
|
|
||||||
const auto descriptionList = descriptionOneLine.splitRef(QLatin1Char(' '), QString::SkipEmptyParts);
|
const auto descriptionList = descriptionOneLine.splitRef(QLatin1Char(' '), Qt::SkipEmptyParts);
|
||||||
if (descriptionList.size() > 5) {
|
if (descriptionList.size() > 5) {
|
||||||
// ### crude code.
|
// ### crude code.
|
||||||
ciph.d->isNull = false;
|
ciph.d->isNull = false;
|
||||||
|
@ -574,7 +574,7 @@ static QStringList libraryPathList()
|
|||||||
QStringList paths;
|
QStringList paths;
|
||||||
# ifdef Q_OS_DARWIN
|
# ifdef Q_OS_DARWIN
|
||||||
paths = QString::fromLatin1(qgetenv("DYLD_LIBRARY_PATH"))
|
paths = QString::fromLatin1(qgetenv("DYLD_LIBRARY_PATH"))
|
||||||
.split(QLatin1Char(':'), QString::SkipEmptyParts);
|
.split(QLatin1Char(':'), Qt::SkipEmptyParts);
|
||||||
|
|
||||||
// search in .app/Contents/Frameworks
|
// search in .app/Contents/Frameworks
|
||||||
UInt32 packageType;
|
UInt32 packageType;
|
||||||
@ -586,7 +586,7 @@ static QStringList libraryPathList()
|
|||||||
}
|
}
|
||||||
# else
|
# else
|
||||||
paths = QString::fromLatin1(qgetenv("LD_LIBRARY_PATH"))
|
paths = QString::fromLatin1(qgetenv("LD_LIBRARY_PATH"))
|
||||||
.split(QLatin1Char(':'), QString::SkipEmptyParts);
|
.split(QLatin1Char(':'), Qt::SkipEmptyParts);
|
||||||
# endif
|
# endif
|
||||||
paths << QLatin1String("/lib") << QLatin1String("/usr/lib") << QLatin1String("/usr/local/lib");
|
paths << QLatin1String("/lib") << QLatin1String("/usr/lib") << QLatin1String("/usr/local/lib");
|
||||||
paths << QLatin1String("/lib64") << QLatin1String("/usr/lib64") << QLatin1String("/usr/local/lib64");
|
paths << QLatin1String("/lib64") << QLatin1String("/usr/lib64") << QLatin1String("/usr/local/lib64");
|
||||||
|
@ -216,7 +216,7 @@ bool QDeviceDiscoveryUDev::checkDeviceType(udev_device *dev)
|
|||||||
|
|
||||||
if ((m_types & Device_Keyboard) && (qstrcmp(udev_device_get_property_value(dev, "ID_INPUT_KEYBOARD"), "1") == 0 )) {
|
if ((m_types & Device_Keyboard) && (qstrcmp(udev_device_get_property_value(dev, "ID_INPUT_KEYBOARD"), "1") == 0 )) {
|
||||||
const QString capabilities_key = QString::fromUtf8(udev_device_get_sysattr_value(dev, "capabilities/key"));
|
const QString capabilities_key = QString::fromUtf8(udev_device_get_sysattr_value(dev, "capabilities/key"));
|
||||||
const auto val = capabilities_key.splitRef(QLatin1Char(' '), QString::SkipEmptyParts);
|
const auto val = capabilities_key.splitRef(QLatin1Char(' '), Qt::SkipEmptyParts);
|
||||||
if (!val.isEmpty()) {
|
if (!val.isEmpty()) {
|
||||||
bool ok;
|
bool ok;
|
||||||
unsigned long long keys = val.last().toULongLong(&ok, 16);
|
unsigned long long keys = val.last().toULongLong(&ok, 16);
|
||||||
|
@ -2050,10 +2050,10 @@ QVariantList AtSpiAdaptor::getAttributes(QAccessibleInterface *interface, int of
|
|||||||
int endOffset;
|
int endOffset;
|
||||||
|
|
||||||
QString joined = interface->textInterface()->attributes(offset, &startOffset, &endOffset);
|
QString joined = interface->textInterface()->attributes(offset, &startOffset, &endOffset);
|
||||||
const QStringList attributes = joined.split (QLatin1Char(';'), QString::SkipEmptyParts, Qt::CaseSensitive);
|
const QStringList attributes = joined.split (QLatin1Char(';'), Qt::SkipEmptyParts, Qt::CaseSensitive);
|
||||||
for (const QString &attr : attributes) {
|
for (const QString &attr : attributes) {
|
||||||
QStringList items;
|
QStringList items;
|
||||||
items = attr.split(QLatin1Char(':'), QString::SkipEmptyParts, Qt::CaseSensitive);
|
items = attr.split(QLatin1Char(':'), Qt::SkipEmptyParts, Qt::CaseSensitive);
|
||||||
AtSpiAttribute attribute = atspiTextAttribute(items[0], items[1]);
|
AtSpiAttribute attribute = atspiTextAttribute(items[0], items[1]);
|
||||||
if (!attribute.isNull())
|
if (!attribute.isNull())
|
||||||
set[attribute.name] = attribute.value;
|
set[attribute.name] = attribute.value;
|
||||||
@ -2074,10 +2074,10 @@ QVariantList AtSpiAdaptor::getAttributeValue(QAccessibleInterface *interface, in
|
|||||||
int endOffset;
|
int endOffset;
|
||||||
|
|
||||||
joined = interface->textInterface()->attributes(offset, &startOffset, &endOffset);
|
joined = interface->textInterface()->attributes(offset, &startOffset, &endOffset);
|
||||||
const QStringList attributes = joined.split (QLatin1Char(';'), QString::SkipEmptyParts, Qt::CaseSensitive);
|
const QStringList attributes = joined.split (QLatin1Char(';'), Qt::SkipEmptyParts, Qt::CaseSensitive);
|
||||||
for (const QString& attr : attributes) {
|
for (const QString& attr : attributes) {
|
||||||
QStringList items;
|
QStringList items;
|
||||||
items = attr.split(QLatin1Char(':'), QString::SkipEmptyParts, Qt::CaseSensitive);
|
items = attr.split(QLatin1Char(':'), Qt::SkipEmptyParts, Qt::CaseSensitive);
|
||||||
AtSpiAttribute attribute = atspiTextAttribute(items[0], items[1]);
|
AtSpiAttribute attribute = atspiTextAttribute(items[0], items[1]);
|
||||||
if (!attribute.isNull())
|
if (!attribute.isNull())
|
||||||
map[attribute.name] = attribute.value;
|
map[attribute.name] = attribute.value;
|
||||||
|
@ -641,7 +641,7 @@ QPlatformTheme *QKdeTheme::createKdeTheme()
|
|||||||
|
|
||||||
const QString kdeDirsVar = QFile::decodeName(qgetenv("KDEDIRS"));
|
const QString kdeDirsVar = QFile::decodeName(qgetenv("KDEDIRS"));
|
||||||
if (!kdeDirsVar.isEmpty())
|
if (!kdeDirsVar.isEmpty())
|
||||||
kdeDirs += kdeDirsVar.split(QLatin1Char(':'), QString::SkipEmptyParts);
|
kdeDirs += kdeDirsVar.split(QLatin1Char(':'), Qt::SkipEmptyParts);
|
||||||
|
|
||||||
const QString kdeVersionHomePath = QDir::homePath() + QLatin1String("/.kde") + QLatin1String(kdeVersionBA);
|
const QString kdeVersionHomePath = QDir::homePath() + QLatin1String("/.kde") + QLatin1String(kdeVersionBA);
|
||||||
if (QFileInfo(kdeVersionHomePath).isDir())
|
if (QFileInfo(kdeVersionHomePath).isDir())
|
||||||
|
@ -44,9 +44,10 @@
|
|||||||
|
|
||||||
#include <QDebug>
|
#include <QDebug>
|
||||||
|
|
||||||
AndroidContentFileEngine::AndroidContentFileEngine(const QString &fileName)
|
AndroidContentFileEngine::AndroidContentFileEngine(const QString &f)
|
||||||
: QFSFileEngine(fileName)
|
: m_file(f)
|
||||||
{
|
{
|
||||||
|
setFileName(f);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool AndroidContentFileEngine::open(QIODevice::OpenMode openMode)
|
bool AndroidContentFileEngine::open(QIODevice::OpenMode openMode)
|
||||||
@ -78,6 +79,48 @@ bool AndroidContentFileEngine::open(QIODevice::OpenMode openMode)
|
|||||||
return QFSFileEngine::open(openMode, fd, QFile::AutoCloseHandle);
|
return QFSFileEngine::open(openMode, fd, QFile::AutoCloseHandle);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
qint64 AndroidContentFileEngine::size() const
|
||||||
|
{
|
||||||
|
const jlong size = QJNIObjectPrivate::callStaticMethod<jlong>(
|
||||||
|
"org/qtproject/qt5/android/QtNative", "getSize",
|
||||||
|
"(Landroid/content/Context;Ljava/lang/String;)J", QtAndroidPrivate::context(),
|
||||||
|
QJNIObjectPrivate::fromString(fileName(DefaultName)).object());
|
||||||
|
return (qint64)size;
|
||||||
|
}
|
||||||
|
|
||||||
|
AndroidContentFileEngine::FileFlags AndroidContentFileEngine::fileFlags(FileFlags type) const
|
||||||
|
{
|
||||||
|
FileFlags commonFlags(ReadOwnerPerm|ReadUserPerm|ReadGroupPerm|ReadOtherPerm|ExistsFlag);
|
||||||
|
FileFlags flags;
|
||||||
|
const bool exists = QJNIObjectPrivate::callStaticMethod<jboolean>(
|
||||||
|
"org/qtproject/qt5/android/QtNative", "checkFileExists",
|
||||||
|
"(Landroid/content/Context;Ljava/lang/String;)Z", QtAndroidPrivate::context(),
|
||||||
|
QJNIObjectPrivate::fromString(fileName(DefaultName)).object());
|
||||||
|
if (!exists)
|
||||||
|
return flags;
|
||||||
|
flags = FileType | commonFlags;
|
||||||
|
return type & flags;
|
||||||
|
}
|
||||||
|
|
||||||
|
QString AndroidContentFileEngine::fileName(FileName f) const
|
||||||
|
{
|
||||||
|
switch (f) {
|
||||||
|
case PathName:
|
||||||
|
case AbsolutePathName:
|
||||||
|
case CanonicalPathName:
|
||||||
|
case DefaultName:
|
||||||
|
case AbsoluteName:
|
||||||
|
case CanonicalName:
|
||||||
|
return m_file;
|
||||||
|
case BaseName:
|
||||||
|
{
|
||||||
|
const int pos = m_file.lastIndexOf(QChar(QLatin1Char('/')));
|
||||||
|
return m_file.mid(pos);
|
||||||
|
}
|
||||||
|
default:
|
||||||
|
return QString();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
AndroidContentFileEngineHandler::AndroidContentFileEngineHandler() = default;
|
AndroidContentFileEngineHandler::AndroidContentFileEngineHandler() = default;
|
||||||
AndroidContentFileEngineHandler::~AndroidContentFileEngineHandler() = default;
|
AndroidContentFileEngineHandler::~AndroidContentFileEngineHandler() = default;
|
||||||
|
@ -47,6 +47,12 @@ class AndroidContentFileEngine : public QFSFileEngine
|
|||||||
public:
|
public:
|
||||||
AndroidContentFileEngine(const QString &fileName);
|
AndroidContentFileEngine(const QString &fileName);
|
||||||
bool open(QIODevice::OpenMode openMode) override;
|
bool open(QIODevice::OpenMode openMode) override;
|
||||||
|
qint64 size() const override;
|
||||||
|
FileFlags fileFlags(FileFlags type = FileInfoAll) const override;
|
||||||
|
QString fileName(FileName file = DefaultName) const override;
|
||||||
|
private:
|
||||||
|
QString m_file;
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
class AndroidContentFileEngineHandler : public QAbstractFileEngineHandler
|
class AndroidContentFileEngineHandler : public QAbstractFileEngineHandler
|
||||||
|
@ -225,7 +225,7 @@ void QXdgDesktopPortalFileDialog::openPortal()
|
|||||||
QRegularExpressionMatch match = regexp.match(filter);
|
QRegularExpressionMatch match = regexp.match(filter);
|
||||||
if (match.hasMatch()) {
|
if (match.hasMatch()) {
|
||||||
QString userVisibleName = match.captured(1);
|
QString userVisibleName = match.captured(1);
|
||||||
QStringList filterStrings = match.captured(2).split(QLatin1Char(' '), QString::SkipEmptyParts);
|
QStringList filterStrings = match.captured(2).split(QLatin1Char(' '), Qt::SkipEmptyParts);
|
||||||
|
|
||||||
FilterConditionList filterConditions;
|
FilterConditionList filterConditions;
|
||||||
for (const QString &filterString : filterStrings) {
|
for (const QString &filterString : filterStrings) {
|
||||||
|
@ -1270,7 +1270,7 @@ bool QDB2Driver::open(const QString& db, const QString& user, const QString& pas
|
|||||||
|
|
||||||
QString protocol;
|
QString protocol;
|
||||||
// Set connection attributes
|
// Set connection attributes
|
||||||
const QStringList opts(connOpts.split(QLatin1Char(';'), QString::SkipEmptyParts));
|
const QStringList opts(connOpts.split(QLatin1Char(';'), Qt::SkipEmptyParts));
|
||||||
for (int i = 0; i < opts.count(); ++i) {
|
for (int i = 0; i < opts.count(); ++i) {
|
||||||
const QString tmp(opts.at(i));
|
const QString tmp(opts.at(i));
|
||||||
int idx;
|
int idx;
|
||||||
|
@ -1477,7 +1477,7 @@ bool QIBaseDriver::open(const QString & db,
|
|||||||
if (isOpen())
|
if (isOpen())
|
||||||
close();
|
close();
|
||||||
|
|
||||||
const QStringList opts(connOpts.split(QLatin1Char(';'), QString::SkipEmptyParts));
|
const QStringList opts(connOpts.split(QLatin1Char(';'), Qt::SkipEmptyParts));
|
||||||
|
|
||||||
QString encString;
|
QString encString;
|
||||||
QByteArray role;
|
QByteArray role;
|
||||||
|
@ -1239,7 +1239,7 @@ bool QMYSQLDriver::open(const QString& db,
|
|||||||
stored procedure call will fail.
|
stored procedure call will fail.
|
||||||
*/
|
*/
|
||||||
unsigned int optionFlags = CLIENT_MULTI_STATEMENTS;
|
unsigned int optionFlags = CLIENT_MULTI_STATEMENTS;
|
||||||
const QStringList opts(connOpts.split(QLatin1Char(';'), QString::SkipEmptyParts));
|
const QStringList opts(connOpts.split(QLatin1Char(';'), Qt::SkipEmptyParts));
|
||||||
QString unixSocket;
|
QString unixSocket;
|
||||||
QString sslCert;
|
QString sslCert;
|
||||||
QString sslCA;
|
QString sslCA;
|
||||||
|
@ -2230,7 +2230,7 @@ bool QOCIDriver::hasFeature(DriverFeature f) const
|
|||||||
|
|
||||||
static void qParseOpts(const QString &options, QOCIDriverPrivate *d)
|
static void qParseOpts(const QString &options, QOCIDriverPrivate *d)
|
||||||
{
|
{
|
||||||
const QStringList opts(options.split(QLatin1Char(';'), QString::SkipEmptyParts));
|
const QStringList opts(options.split(QLatin1Char(';'), Qt::SkipEmptyParts));
|
||||||
for (int i = 0; i < opts.count(); ++i) {
|
for (int i = 0; i < opts.count(); ++i) {
|
||||||
const QString tmp(opts.at(i));
|
const QString tmp(opts.at(i));
|
||||||
int idx;
|
int idx;
|
||||||
|
@ -767,7 +767,7 @@ QChar QODBCDriverPrivate::quoteChar()
|
|||||||
bool QODBCDriverPrivate::setConnectionOptions(const QString& connOpts)
|
bool QODBCDriverPrivate::setConnectionOptions(const QString& connOpts)
|
||||||
{
|
{
|
||||||
// Set any connection attributes
|
// Set any connection attributes
|
||||||
const QStringList opts(connOpts.split(QLatin1Char(';'), QString::SkipEmptyParts));
|
const QStringList opts(connOpts.split(QLatin1Char(';'), Qt::SkipEmptyParts));
|
||||||
SQLRETURN r = SQL_SUCCESS;
|
SQLRETURN r = SQL_SUCCESS;
|
||||||
for (int i = 0; i < opts.count(); ++i) {
|
for (int i = 0; i < opts.count(); ++i) {
|
||||||
const QString tmp(opts.at(i));
|
const QString tmp(opts.at(i));
|
||||||
|
@ -906,7 +906,7 @@ bool readInputFile(Options *options)
|
|||||||
{
|
{
|
||||||
const QJsonValue extraLibs = jsonObject.value(QLatin1String("android-extra-libs"));
|
const QJsonValue extraLibs = jsonObject.value(QLatin1String("android-extra-libs"));
|
||||||
if (!extraLibs.isUndefined())
|
if (!extraLibs.isUndefined())
|
||||||
options->extraLibs = extraLibs.toString().split(QLatin1Char(','), QString::SkipEmptyParts);
|
options->extraLibs = extraLibs.toString().split(QLatin1Char(','), Qt::SkipEmptyParts);
|
||||||
}
|
}
|
||||||
|
|
||||||
{
|
{
|
||||||
@ -996,7 +996,7 @@ bool readInputFile(Options *options)
|
|||||||
}
|
}
|
||||||
{
|
{
|
||||||
const QJsonValue qrcFiles = jsonObject.value(QLatin1String("qrcFiles"));
|
const QJsonValue qrcFiles = jsonObject.value(QLatin1String("qrcFiles"));
|
||||||
options->qrcFiles = qrcFiles.toString().split(QLatin1Char(','), QString::SkipEmptyParts);
|
options->qrcFiles = qrcFiles.toString().split(QLatin1Char(','), Qt::SkipEmptyParts);
|
||||||
}
|
}
|
||||||
options->packageName = packageNameFromAndroidManifest(options->androidSourceDirectory + QLatin1String("/AndroidManifest.xml"));
|
options->packageName = packageNameFromAndroidManifest(options->androidSourceDirectory + QLatin1String("/AndroidManifest.xml"));
|
||||||
if (options->packageName.isEmpty())
|
if (options->packageName.isEmpty())
|
||||||
|
@ -296,8 +296,7 @@ Provider parseProvider(const QString &filename)
|
|||||||
if (tracedef.exactMatch(line)) {
|
if (tracedef.exactMatch(line)) {
|
||||||
const QString name = tracedef.cap(1);
|
const QString name = tracedef.cap(1);
|
||||||
const QString argsString = tracedef.cap(2);
|
const QString argsString = tracedef.cap(2);
|
||||||
const QStringList args = argsString.split(QLatin1Char(','),
|
const QStringList args = argsString.split(QLatin1Char(','), Qt::SkipEmptyParts);
|
||||||
QString::SkipEmptyParts);
|
|
||||||
|
|
||||||
provider.tracepoints << parseTracepoint(name, args, filename, lineNumber);
|
provider.tracepoints << parseTracepoint(name, args, filename, lineNumber);
|
||||||
} else {
|
} else {
|
||||||
|
@ -4370,7 +4370,7 @@ QStringList QFSCompleter::splitPath(const QString &path) const
|
|||||||
QRegExp re(QLatin1Char('[') + QRegExp::escape(sep) + QLatin1Char(']'));
|
QRegExp re(QLatin1Char('[') + QRegExp::escape(sep) + QLatin1Char(']'));
|
||||||
|
|
||||||
#if defined(Q_OS_WIN)
|
#if defined(Q_OS_WIN)
|
||||||
QStringList parts = pathCopy.split(re, QString::SkipEmptyParts);
|
QStringList parts = pathCopy.split(re, Qt::SkipEmptyParts);
|
||||||
if (!doubleSlash.isEmpty() && !parts.isEmpty())
|
if (!doubleSlash.isEmpty() && !parts.isEmpty())
|
||||||
parts[0].prepend(doubleSlash);
|
parts[0].prepend(doubleSlash);
|
||||||
if (pathCopy.endsWith(sep))
|
if (pathCopy.endsWith(sep))
|
||||||
|
@ -376,7 +376,7 @@ QFileSystemModelPrivate::QFileSystemNode *QFileSystemModelPrivate::node(const QS
|
|||||||
absolutePath = QDir(longPath).absolutePath();
|
absolutePath = QDir(longPath).absolutePath();
|
||||||
|
|
||||||
// ### TODO can we use bool QAbstractFileEngine::caseSensitive() const?
|
// ### TODO can we use bool QAbstractFileEngine::caseSensitive() const?
|
||||||
QStringList pathElements = absolutePath.split(QLatin1Char('/'), QString::SkipEmptyParts);
|
QStringList pathElements = absolutePath.split(QLatin1Char('/'), Qt::SkipEmptyParts);
|
||||||
if ((pathElements.isEmpty())
|
if ((pathElements.isEmpty())
|
||||||
#if !defined(Q_OS_WIN)
|
#if !defined(Q_OS_WIN)
|
||||||
&& QDir::fromNativeSeparators(longPath) != QLatin1String("/")
|
&& QDir::fromNativeSeparators(longPath) != QLatin1String("/")
|
||||||
|
@ -189,7 +189,6 @@ public:
|
|||||||
int decimals = 1, bool *ok = nullptr, Qt::WindowFlags flags = Qt::WindowFlags(),
|
int decimals = 1, bool *ok = nullptr, Qt::WindowFlags flags = Qt::WindowFlags(),
|
||||||
double step = 1);
|
double step = 1);
|
||||||
#else
|
#else
|
||||||
// ### Qt 6: merge overloads
|
|
||||||
static double getDouble(QWidget *parent, const QString &title, const QString &label, double value,
|
static double getDouble(QWidget *parent, const QString &title, const QString &label, double value,
|
||||||
double minValue, double maxValue, int decimals, bool *ok, Qt::WindowFlags flags,
|
double minValue, double maxValue, int decimals, bool *ok, Qt::WindowFlags flags,
|
||||||
double step);
|
double step);
|
||||||
|
@ -79,7 +79,7 @@ void MainWindow::setupContents()
|
|||||||
|
|
||||||
do {
|
do {
|
||||||
QString line = titlesFile.readLine().trimmed();
|
QString line = titlesFile.readLine().trimmed();
|
||||||
QStringList parts = line.split("\t", QString::SkipEmptyParts);
|
QStringList parts = line.split(QLatin1Char('\t'), Qt::SkipEmptyParts);
|
||||||
if (parts.size() != 2)
|
if (parts.size() != 2)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
@ -873,7 +873,7 @@ QModelIndex QDirModel::index(const QString &path, int column) const
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
QStringList pathElements = absolutePath.split(QLatin1Char('/'), QString::SkipEmptyParts);
|
QStringList pathElements = absolutePath.split(QLatin1Char('/'), Qt::SkipEmptyParts);
|
||||||
if ((pathElements.isEmpty() || !QFileInfo::exists(path))
|
if ((pathElements.isEmpty() || !QFileInfo::exists(path))
|
||||||
#if !defined(Q_OS_WIN)
|
#if !defined(Q_OS_WIN)
|
||||||
&& path != QLatin1String("/")
|
&& path != QLatin1String("/")
|
||||||
|
@ -1073,7 +1073,7 @@ void QWidgetWindow::handleTabletEvent(QTabletEvent *event)
|
|||||||
if (widget) {
|
if (widget) {
|
||||||
QPointF delta = event->globalPosF() - event->globalPos();
|
QPointF delta = event->globalPosF() - event->globalPos();
|
||||||
QPointF mapped = widget->mapFromGlobal(event->globalPos()) + delta;
|
QPointF mapped = widget->mapFromGlobal(event->globalPos()) + delta;
|
||||||
QTabletEvent ev(event->type(), mapped, event->globalPosF(), event->device(), event->pointerType(),
|
QTabletEvent ev(event->type(), mapped, event->globalPosF(), event->deviceType(), event->pointerType(),
|
||||||
event->pressure(), event->xTilt(), event->yTilt(), event->tangentialPressure(),
|
event->pressure(), event->xTilt(), event->yTilt(), event->tangentialPressure(),
|
||||||
event->rotation(), event->z(), event->modifiers(), event->uniqueId(), event->button(), event->buttons());
|
event->rotation(), event->z(), event->modifiers(), event->uniqueId(), event->button(), event->buttons());
|
||||||
ev.setTimestamp(event->timestamp());
|
ev.setTimestamp(event->timestamp());
|
||||||
|
@ -103,10 +103,10 @@ public:
|
|||||||
void moveTab(int from, int to);
|
void moveTab(int from, int to);
|
||||||
|
|
||||||
bool isTabEnabled(int index) const;
|
bool isTabEnabled(int index) const;
|
||||||
void setTabEnabled(int index, bool);
|
void setTabEnabled(int index, bool enabled);
|
||||||
|
|
||||||
bool isTabVisible(int index) const;
|
bool isTabVisible(int index) const;
|
||||||
void setTabVisible(int index, bool);
|
void setTabVisible(int index, bool visible);
|
||||||
|
|
||||||
QString tabText(int index) const;
|
QString tabText(int index) const;
|
||||||
void setTabText(int index, const QString &text);
|
void setTabText(int index, const QString &text);
|
||||||
@ -118,7 +118,7 @@ public:
|
|||||||
void setTabIcon(int index, const QIcon &icon);
|
void setTabIcon(int index, const QIcon &icon);
|
||||||
|
|
||||||
Qt::TextElideMode elideMode() const;
|
Qt::TextElideMode elideMode() const;
|
||||||
void setElideMode(Qt::TextElideMode);
|
void setElideMode(Qt::TextElideMode mode);
|
||||||
|
|
||||||
#ifndef QT_NO_TOOLTIP
|
#ifndef QT_NO_TOOLTIP
|
||||||
void setTabToolTip(int index, const QString &tip);
|
void setTabToolTip(int index, const QString &tip);
|
||||||
|
@ -80,13 +80,13 @@ public:
|
|||||||
void removeTab(int index);
|
void removeTab(int index);
|
||||||
|
|
||||||
bool isTabEnabled(int index) const;
|
bool isTabEnabled(int index) const;
|
||||||
void setTabEnabled(int index, bool);
|
void setTabEnabled(int index, bool enabled);
|
||||||
|
|
||||||
bool isTabVisible(int index) const;
|
bool isTabVisible(int index) const;
|
||||||
void setTabVisible(int index, bool);
|
void setTabVisible(int index, bool visible);
|
||||||
|
|
||||||
QString tabText(int index) const;
|
QString tabText(int index) const;
|
||||||
void setTabText(int index, const QString &);
|
void setTabText(int index, const QString &text);
|
||||||
|
|
||||||
QIcon tabIcon(int index) const;
|
QIcon tabIcon(int index) const;
|
||||||
void setTabIcon(int index, const QIcon & icon);
|
void setTabIcon(int index, const QIcon & icon);
|
||||||
@ -110,7 +110,7 @@ public:
|
|||||||
enum TabPosition { North, South, West, East };
|
enum TabPosition { North, South, West, East };
|
||||||
Q_ENUM(TabPosition)
|
Q_ENUM(TabPosition)
|
||||||
TabPosition tabPosition() const;
|
TabPosition tabPosition() const;
|
||||||
void setTabPosition(TabPosition);
|
void setTabPosition(TabPosition position);
|
||||||
|
|
||||||
bool tabsClosable() const;
|
bool tabsClosable() const;
|
||||||
void setTabsClosable(bool closeable);
|
void setTabsClosable(bool closeable);
|
||||||
@ -132,7 +132,7 @@ public:
|
|||||||
QWidget * cornerWidget(Qt::Corner corner = Qt::TopRightCorner) const;
|
QWidget * cornerWidget(Qt::Corner corner = Qt::TopRightCorner) const;
|
||||||
|
|
||||||
Qt::TextElideMode elideMode() const;
|
Qt::TextElideMode elideMode() const;
|
||||||
void setElideMode(Qt::TextElideMode);
|
void setElideMode(Qt::TextElideMode mode);
|
||||||
|
|
||||||
QSize iconSize() const;
|
QSize iconSize() const;
|
||||||
void setIconSize(const QSize &size);
|
void setIconSize(const QSize &size);
|
||||||
|
@ -1786,9 +1786,9 @@ void tst_QDir::searchPaths()
|
|||||||
{
|
{
|
||||||
QFETCH(QString, filename);
|
QFETCH(QString, filename);
|
||||||
QFETCH(QString, searchPathPrefixes);
|
QFETCH(QString, searchPathPrefixes);
|
||||||
QStringList searchPathPrefixList = searchPathPrefixes.split(";", QString::SkipEmptyParts);
|
QStringList searchPathPrefixList = searchPathPrefixes.split(";", Qt::SkipEmptyParts);
|
||||||
QFETCH(QString, searchPaths);
|
QFETCH(QString, searchPaths);
|
||||||
QStringList searchPathsList = searchPaths.split(";", QString::SkipEmptyParts);
|
QStringList searchPathsList = searchPaths.split(";", Qt::SkipEmptyParts);
|
||||||
QFETCH(QString, expectedAbsolutePath);
|
QFETCH(QString, expectedAbsolutePath);
|
||||||
bool exists = !expectedAbsolutePath.isEmpty();
|
bool exists = !expectedAbsolutePath.isEmpty();
|
||||||
|
|
||||||
|
@ -2401,7 +2401,7 @@ void tst_QProcess::finishProcessBeforeReadingDone()
|
|||||||
QVERIFY(process.waitForStarted());
|
QVERIFY(process.waitForStarted());
|
||||||
loop.exec();
|
loop.exec();
|
||||||
QStringList lines = QString::fromLocal8Bit(process.readAllStandardOutput()).split(
|
QStringList lines = QString::fromLocal8Bit(process.readAllStandardOutput()).split(
|
||||||
QRegExp(QStringLiteral("[\r\n]")), QString::SkipEmptyParts);
|
QRegExp(QStringLiteral("[\r\n]")), Qt::SkipEmptyParts);
|
||||||
QVERIFY(!lines.isEmpty());
|
QVERIFY(!lines.isEmpty());
|
||||||
QCOMPARE(lines.last(), QStringLiteral("10239 -this is a number"));
|
QCOMPARE(lines.last(), QStringLiteral("10239 -this is a number"));
|
||||||
QCOMPARE(process.exitStatus(), QProcess::NormalExit);
|
QCOMPARE(process.exitStatus(), QProcess::NormalExit);
|
||||||
@ -2599,7 +2599,7 @@ void tst_QProcess::finishProcessBeforeReadingDone_deprecated()
|
|||||||
QVERIFY(process.waitForStarted());
|
QVERIFY(process.waitForStarted());
|
||||||
loop.exec();
|
loop.exec();
|
||||||
QStringList lines = QString::fromLocal8Bit(process.readAllStandardOutput()).split(
|
QStringList lines = QString::fromLocal8Bit(process.readAllStandardOutput()).split(
|
||||||
QRegExp(QStringLiteral("[\r\n]")), QString::SkipEmptyParts);
|
QRegExp(QStringLiteral("[\r\n]")), Qt::SkipEmptyParts);
|
||||||
QVERIFY(!lines.isEmpty());
|
QVERIFY(!lines.isEmpty());
|
||||||
QCOMPARE(lines.last(), QStringLiteral("10239 -this is a number"));
|
QCOMPARE(lines.last(), QStringLiteral("10239 -this is a number"));
|
||||||
QCOMPARE(process.exitStatus(), QProcess::NormalExit);
|
QCOMPARE(process.exitStatus(), QProcess::NormalExit);
|
||||||
|
@ -360,7 +360,7 @@ static inline QFileInfo findSh()
|
|||||||
QLatin1String sh("/sh");
|
QLatin1String sh("/sh");
|
||||||
QByteArray pEnv = qgetenv("PATH");
|
QByteArray pEnv = qgetenv("PATH");
|
||||||
const QLatin1Char pathSep(':');
|
const QLatin1Char pathSep(':');
|
||||||
const QStringList rawPaths = QString::fromLocal8Bit(pEnv.constData()).split(pathSep, QString::SkipEmptyParts);
|
const QStringList rawPaths = QString::fromLocal8Bit(pEnv.constData()).split(pathSep, Qt::SkipEmptyParts);
|
||||||
foreach (const QString &path, rawPaths) {
|
foreach (const QString &path, rawPaths) {
|
||||||
if (QFile::exists(path + sh))
|
if (QFile::exists(path + sh))
|
||||||
return path + sh;
|
return path + sh;
|
||||||
|
@ -427,7 +427,7 @@ void tst_QMimeDatabase::listAliases()
|
|||||||
QFETCH(QString, inputMime);
|
QFETCH(QString, inputMime);
|
||||||
QFETCH(QString, expectedAliases);
|
QFETCH(QString, expectedAliases);
|
||||||
QMimeDatabase db;
|
QMimeDatabase db;
|
||||||
QStringList expectedAliasesList = expectedAliases.split(',', QString::SkipEmptyParts);
|
QStringList expectedAliasesList = expectedAliases.split(',', Qt::SkipEmptyParts);
|
||||||
expectedAliasesList.sort();
|
expectedAliasesList.sort();
|
||||||
QMimeType mime = db.mimeTypeForName(inputMime);
|
QMimeType mime = db.mimeTypeForName(inputMime);
|
||||||
QVERIFY(mime.isValid());
|
QVERIFY(mime.isValid());
|
||||||
@ -715,7 +715,7 @@ void tst_QMimeDatabase::findByFileName_data()
|
|||||||
continue;
|
continue;
|
||||||
|
|
||||||
QString string = QString::fromLatin1(line.constData(), len - 1).trimmed();
|
QString string = QString::fromLatin1(line.constData(), len - 1).trimmed();
|
||||||
QStringList list = string.split(QLatin1Char(' '), QString::SkipEmptyParts);
|
QStringList list = string.split(QLatin1Char(' '), Qt::SkipEmptyParts);
|
||||||
QVERIFY(list.size() >= 2);
|
QVERIFY(list.size() >= 2);
|
||||||
|
|
||||||
QString filePath = list.at(0);
|
QString filePath = list.at(0);
|
||||||
|
@ -2162,18 +2162,18 @@ void tst_QStringRef::split()
|
|||||||
QVERIFY(list == result);
|
QVERIFY(list == result);
|
||||||
}
|
}
|
||||||
|
|
||||||
list = ref.split(sep, QString::KeepEmptyParts);
|
list = ref.split(sep, Qt::KeepEmptyParts);
|
||||||
QVERIFY(list == result);
|
QVERIFY(list == result);
|
||||||
if (sep.size() == 1) {
|
if (sep.size() == 1) {
|
||||||
list = ref.split(sep.at(0), QString::KeepEmptyParts);
|
list = ref.split(sep.at(0), Qt::KeepEmptyParts);
|
||||||
QVERIFY(list == result);
|
QVERIFY(list == result);
|
||||||
}
|
}
|
||||||
|
|
||||||
result.removeAll("");
|
result.removeAll("");
|
||||||
list = ref.split(sep, QString::SkipEmptyParts);
|
list = ref.split(sep, Qt::SkipEmptyParts);
|
||||||
QVERIFY(list == result);
|
QVERIFY(list == result);
|
||||||
if (sep.size() == 1) {
|
if (sep.size() == 1) {
|
||||||
list = ref.split(sep.at(0), QString::SkipEmptyParts);
|
list = ref.split(sep.at(0), Qt::SkipEmptyParts);
|
||||||
QVERIFY(list == result);
|
QVERIFY(list == result);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -124,7 +124,7 @@ static void generateDataFromFile(const QString &fname)
|
|||||||
|
|
||||||
QString testString;
|
QString testString;
|
||||||
QList<int> expectedBreakPositions;
|
QList<int> expectedBreakPositions;
|
||||||
foreach (const QString &part, test.simplified().split(QLatin1Char(' '), QString::SkipEmptyParts)) {
|
foreach (const QString &part, test.simplified().split(QLatin1Char(' '), Qt::SkipEmptyParts)) {
|
||||||
if (part.size() == 1) {
|
if (part.size() == 1) {
|
||||||
if (part.at(0).unicode() == 0xf7)
|
if (part.at(0).unicode() == 0xf7)
|
||||||
expectedBreakPositions.append(testString.size());
|
expectedBreakPositions.append(testString.size());
|
||||||
@ -146,7 +146,7 @@ static void generateDataFromFile(const QString &fname)
|
|||||||
QVERIFY(!expectedBreakPositions.isEmpty());
|
QVERIFY(!expectedBreakPositions.isEmpty());
|
||||||
|
|
||||||
if (!comments.isEmpty()) {
|
if (!comments.isEmpty()) {
|
||||||
const QStringList lst = comments.simplified().split(QLatin1Char(' '), QString::SkipEmptyParts);
|
const QStringList lst = comments.simplified().split(QLatin1Char(' '), Qt::SkipEmptyParts);
|
||||||
comments.clear();
|
comments.clear();
|
||||||
foreach (const QString &part, lst) {
|
foreach (const QString &part, lst) {
|
||||||
if (part.size() == 1) {
|
if (part.size() == 1) {
|
||||||
|
@ -890,7 +890,7 @@ void PaintCommands::command_import(QRegularExpressionMatch re)
|
|||||||
m_commands[m_currentCommandIndex] = QLatin1String("# import file (") + fileinfo.fileName()
|
m_commands[m_currentCommandIndex] = QLatin1String("# import file (") + fileinfo.fileName()
|
||||||
+ QLatin1String(") start");
|
+ QLatin1String(") start");
|
||||||
QString rawContent = QString::fromUtf8(file->readAll());
|
QString rawContent = QString::fromUtf8(file->readAll());
|
||||||
QStringList importedData = rawContent.split('\n', QString::SkipEmptyParts);
|
QStringList importedData = rawContent.split('\n', Qt::SkipEmptyParts);
|
||||||
importedData.append(QLatin1String("# import file (") + fileinfo.fileName() + QLatin1String(") end ---"));
|
importedData.append(QLatin1String("# import file (") + fileinfo.fileName() + QLatin1String(") end ---"));
|
||||||
insertAt(m_currentCommandIndex, importedData);
|
insertAt(m_currentCommandIndex, importedData);
|
||||||
|
|
||||||
@ -1146,7 +1146,7 @@ void PaintCommands::command_drawPolygon(QRegularExpressionMatch re)
|
|||||||
static QRegularExpression separators("\\s");
|
static QRegularExpression separators("\\s");
|
||||||
QStringList caps = re.capturedTexts();
|
QStringList caps = re.capturedTexts();
|
||||||
QString cap = caps.at(1);
|
QString cap = caps.at(1);
|
||||||
QStringList numbers = cap.split(separators, QString::SkipEmptyParts);
|
QStringList numbers = cap.split(separators, Qt::SkipEmptyParts);
|
||||||
|
|
||||||
QPolygonF array;
|
QPolygonF array;
|
||||||
for (int i=0; i + 1<numbers.size(); i+=2)
|
for (int i=0; i + 1<numbers.size(); i+=2)
|
||||||
@ -1162,7 +1162,7 @@ void PaintCommands::command_drawPolygon(QRegularExpressionMatch re)
|
|||||||
void PaintCommands::command_drawPolyline(QRegularExpressionMatch re)
|
void PaintCommands::command_drawPolyline(QRegularExpressionMatch re)
|
||||||
{
|
{
|
||||||
static QRegularExpression separators("\\s");
|
static QRegularExpression separators("\\s");
|
||||||
QStringList numbers = re.captured(1).split(separators, QString::SkipEmptyParts);
|
QStringList numbers = re.captured(1).split(separators, Qt::SkipEmptyParts);
|
||||||
|
|
||||||
QPolygonF array;
|
QPolygonF array;
|
||||||
for (int i=0; i + 1<numbers.size(); i+=2)
|
for (int i=0; i + 1<numbers.size(); i+=2)
|
||||||
@ -1455,7 +1455,7 @@ void PaintCommands::command_path_addPolygon(QRegularExpressionMatch re)
|
|||||||
QStringList caps = re.capturedTexts();
|
QStringList caps = re.capturedTexts();
|
||||||
QString name = caps.at(1);
|
QString name = caps.at(1);
|
||||||
QString cap = caps.at(2);
|
QString cap = caps.at(2);
|
||||||
QStringList numbers = cap.split(separators, QString::SkipEmptyParts);
|
QStringList numbers = cap.split(separators, Qt::SkipEmptyParts);
|
||||||
|
|
||||||
QPolygonF array;
|
QPolygonF array;
|
||||||
for (int i=0; i + 1<numbers.size(); i+=2)
|
for (int i=0; i + 1<numbers.size(); i+=2)
|
||||||
@ -2686,7 +2686,7 @@ void PaintCommands::command_pen_setDashPattern(QRegularExpressionMatch re)
|
|||||||
static QRegularExpression separators("\\s");
|
static QRegularExpression separators("\\s");
|
||||||
QStringList caps = re.capturedTexts();
|
QStringList caps = re.capturedTexts();
|
||||||
QString cap = caps.at(1);
|
QString cap = caps.at(1);
|
||||||
QStringList numbers = cap.split(separators, QString::SkipEmptyParts);
|
QStringList numbers = cap.split(separators, Qt::SkipEmptyParts);
|
||||||
|
|
||||||
QVector<qreal> pattern;
|
QVector<qreal> pattern;
|
||||||
for (int i=0; i<numbers.size(); ++i)
|
for (int i=0; i<numbers.size(); ++i)
|
||||||
@ -2722,7 +2722,7 @@ void PaintCommands::command_drawConvexPolygon(QRegularExpressionMatch re)
|
|||||||
static QRegularExpression separators("\\s");
|
static QRegularExpression separators("\\s");
|
||||||
QStringList caps = re.capturedTexts();
|
QStringList caps = re.capturedTexts();
|
||||||
QString cap = caps.at(1);
|
QString cap = caps.at(1);
|
||||||
QStringList numbers = cap.split(separators, QString::SkipEmptyParts);
|
QStringList numbers = cap.split(separators, Qt::SkipEmptyParts);
|
||||||
|
|
||||||
QPolygonF array;
|
QPolygonF array;
|
||||||
for (int i=0; i + 1<numbers.size(); i+=2)
|
for (int i=0; i + 1<numbers.size(); i+=2)
|
||||||
|
@ -129,7 +129,7 @@ void tst_Lancelot::initTestCase()
|
|||||||
QFile file(scriptsDir + fileName);
|
QFile file(scriptsDir + fileName);
|
||||||
file.open(QFile::ReadOnly);
|
file.open(QFile::ReadOnly);
|
||||||
QByteArray cont = file.readAll();
|
QByteArray cont = file.readAll();
|
||||||
scripts.insert(fileName, QString::fromUtf8(cont).split(QLatin1Char('\n'), QString::SkipEmptyParts));
|
scripts.insert(fileName, QString::fromUtf8(cont).split(QLatin1Char('\n'), Qt::SkipEmptyParts));
|
||||||
scriptChecksums.insert(fileName, qChecksum(cont.constData(), cont.size()));
|
scriptChecksums.insert(fileName, qChecksum(cont.constData(), cont.size()));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -766,7 +766,7 @@ void tst_QAccessibility::textAttributes()
|
|||||||
|
|
||||||
QCOMPARE(startOffset, startOffsetResult);
|
QCOMPARE(startOffset, startOffsetResult);
|
||||||
QCOMPARE(endOffset, endOffsetResult);
|
QCOMPARE(endOffset, endOffsetResult);
|
||||||
QStringList attrList = attributes.split(QChar(';'), QString::SkipEmptyParts);
|
QStringList attrList = attributes.split(QChar(';'), Qt::SkipEmptyParts);
|
||||||
attributeResult.sort();
|
attributeResult.sort();
|
||||||
attrList.sort();
|
attrList.sort();
|
||||||
QCOMPARE(attrList, attributeResult);
|
QCOMPARE(attrList, attributeResult);
|
||||||
|
@ -2859,7 +2859,7 @@ void tst_qmakelib::proEval()
|
|||||||
QString infile = m_indir + "/test.pro";
|
QString infile = m_indir + "/test.pro";
|
||||||
bool verified = true;
|
bool verified = true;
|
||||||
QMakeTestHandler handler;
|
QMakeTestHandler handler;
|
||||||
handler.setExpectedMessages(msgs.replace("##:", infile + ':').split('\n', QString::SkipEmptyParts));
|
handler.setExpectedMessages(msgs.replace("##:", infile + ':').split('\n', Qt::SkipEmptyParts));
|
||||||
QMakeVfs vfs;
|
QMakeVfs vfs;
|
||||||
ProFileCache cache;
|
ProFileCache cache;
|
||||||
QMakeParser parser(&cache, &vfs, &handler);
|
QMakeParser parser(&cache, &vfs, &handler);
|
||||||
|
@ -2028,7 +2028,7 @@ void tst_qmakelib::proParser()
|
|||||||
|
|
||||||
bool verified = true;
|
bool verified = true;
|
||||||
QMakeTestHandler handler;
|
QMakeTestHandler handler;
|
||||||
handler.setExpectedMessages(msgs.split('\n', QString::SkipEmptyParts));
|
handler.setExpectedMessages(msgs.split('\n', Qt::SkipEmptyParts));
|
||||||
QMakeVfs vfs;
|
QMakeVfs vfs;
|
||||||
QMakeParser parser(0, &vfs, &handler);
|
QMakeParser parser(0, &vfs, &handler);
|
||||||
ProFile *pro = parser.parsedProBlock(QStringRef(&in), 0, "in", 1, QMakeParser::FullGrammar);
|
ProFile *pro = parser.parsedProBlock(QStringRef(&in), 0, "in", 1, QMakeParser::FullGrammar);
|
||||||
|
@ -176,7 +176,7 @@ void tst_rcc::rcc_data()
|
|||||||
}
|
}
|
||||||
|
|
||||||
static QStringList readLinesFromFile(const QString &fileName,
|
static QStringList readLinesFromFile(const QString &fileName,
|
||||||
QString::SplitBehavior splitBehavior)
|
Qt::SplitBehavior splitBehavior)
|
||||||
{
|
{
|
||||||
QFile file(fileName);
|
QFile file(fileName);
|
||||||
|
|
||||||
@ -226,7 +226,7 @@ void tst_rcc::rcc()
|
|||||||
const QStringList actualLines = out.split(nl);
|
const QStringList actualLines = out.split(nl);
|
||||||
|
|
||||||
const QStringList expectedLines =
|
const QStringList expectedLines =
|
||||||
readLinesFromFile(directory + QLatin1Char('/') + expected, QString::KeepEmptyParts);
|
readLinesFromFile(directory + QLatin1Char('/') + expected, Qt::KeepEmptyParts);
|
||||||
QVERIFY(!expectedLines.isEmpty());
|
QVERIFY(!expectedLines.isEmpty());
|
||||||
|
|
||||||
const QString diff = doCompare(actualLines, expectedLines, directory);
|
const QString diff = doCompare(actualLines, expectedLines, directory);
|
||||||
@ -238,7 +238,7 @@ static QStringMap readExpectedFiles(const QString &fileName)
|
|||||||
{
|
{
|
||||||
QStringMap expectedFiles;
|
QStringMap expectedFiles;
|
||||||
|
|
||||||
QStringList lines = readLinesFromFile(fileName, QString::SkipEmptyParts);
|
QStringList lines = readLinesFromFile(fileName, Qt::SkipEmptyParts);
|
||||||
foreach (const QString &line, lines) {
|
foreach (const QString &line, lines) {
|
||||||
QString resourceFileName = line.section(QLatin1Char(' '), 0, 0, QString::SectionSkipEmpty);
|
QString resourceFileName = line.section(QLatin1Char(' '), 0, 0, QString::SectionSkipEmpty);
|
||||||
QString actualFileName = line.section(QLatin1Char(' '), 1, 1, QString::SectionSkipEmpty);
|
QString actualFileName = line.section(QLatin1Char(' '), 1, 1, QString::SectionSkipEmpty);
|
||||||
@ -304,7 +304,7 @@ void tst_rcc::binary_data()
|
|||||||
QString localeFileName = absoluteBaseName + QLatin1String(".locale");
|
QString localeFileName = absoluteBaseName + QLatin1String(".locale");
|
||||||
QFile localeFile(localeFileName);
|
QFile localeFile(localeFileName);
|
||||||
if (localeFile.exists()) {
|
if (localeFile.exists()) {
|
||||||
QStringList locales = readLinesFromFile(localeFileName, QString::SkipEmptyParts);
|
QStringList locales = readLinesFromFile(localeFileName, Qt::SkipEmptyParts);
|
||||||
foreach (const QString &locale, locales) {
|
foreach (const QString &locale, locales) {
|
||||||
QString expectedFileName = QString::fromLatin1("%1.%2.%3").arg(absoluteBaseName, locale, QLatin1String("expected"));
|
QString expectedFileName = QString::fromLatin1("%1.%2.%3").arg(absoluteBaseName, locale, QLatin1String("expected"));
|
||||||
QStringMap expectedFiles = readExpectedFiles(expectedFileName);
|
QStringMap expectedFiles = readExpectedFiles(expectedFileName);
|
||||||
@ -483,9 +483,9 @@ void tst_rcc::python()
|
|||||||
QVERIFY2(process.exitCode() == 0,
|
QVERIFY2(process.exitCode() == 0,
|
||||||
msgProcessFailed(process).constData());
|
msgProcessFailed(process).constData());
|
||||||
|
|
||||||
const auto actualLines = readLinesFromFile(actualFile, QString::KeepEmptyParts);
|
const auto actualLines = readLinesFromFile(actualFile, Qt::KeepEmptyParts);
|
||||||
QVERIFY(!actualLines.isEmpty());
|
QVERIFY(!actualLines.isEmpty());
|
||||||
const auto expectedLines = readLinesFromFile(expectedFile, QString::KeepEmptyParts);
|
const auto expectedLines = readLinesFromFile(expectedFile, Qt::KeepEmptyParts);
|
||||||
QVERIFY(!expectedLines.isEmpty());
|
QVERIFY(!expectedLines.isEmpty());
|
||||||
const QString diff = doCompare(actualLines, expectedLines, path);
|
const QString diff = doCompare(actualLines, expectedLines, path);
|
||||||
if (!diff.isEmpty())
|
if (!diff.isEmpty())
|
||||||
|
@ -11732,7 +11732,7 @@ public:
|
|||||||
QGraphicsLinearLayout *lay = new QGraphicsLinearLayout(Qt::Vertical);
|
QGraphicsLinearLayout *lay = new QGraphicsLinearLayout(Qt::Vertical);
|
||||||
QLatin1String wiseWords("AZ BUKI VEDI");
|
QLatin1String wiseWords("AZ BUKI VEDI");
|
||||||
QString sentence(wiseWords);
|
QString sentence(wiseWords);
|
||||||
QStringList words = sentence.split(QLatin1Char(' '), QString::SkipEmptyParts);
|
QStringList words = sentence.split(QLatin1Char(' '), Qt::SkipEmptyParts);
|
||||||
for (int i = 0; i < words.count(); ++i) {
|
for (int i = 0; i < words.count(); ++i) {
|
||||||
QGraphicsProxyWidget *proxy = new QGraphicsProxyWidget(this);
|
QGraphicsProxyWidget *proxy = new QGraphicsProxyWidget(this);
|
||||||
QLabel *label = new QLabel(words.at(i));
|
QLabel *label = new QLabel(words.at(i));
|
||||||
|
@ -110,7 +110,7 @@ void tst_LanceBench::initTestCase()
|
|||||||
QFile file(scriptsDir + fileName);
|
QFile file(scriptsDir + fileName);
|
||||||
file.open(QFile::ReadOnly);
|
file.open(QFile::ReadOnly);
|
||||||
QByteArray cont = file.readAll();
|
QByteArray cont = file.readAll();
|
||||||
scripts.insert(fileName, QString::fromUtf8(cont).split(QLatin1Char('\n'), QString::SkipEmptyParts));
|
scripts.insert(fileName, QString::fromUtf8(cont).split(QLatin1Char('\n'), Qt::SkipEmptyParts));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -123,7 +123,7 @@ void tst_QText::shaping_data()
|
|||||||
QVERIFY(file.open(QFile::ReadOnly));
|
QVERIFY(file.open(QFile::ReadOnly));
|
||||||
QByteArray data = file.readAll();
|
QByteArray data = file.readAll();
|
||||||
QVERIFY(data.count() > 1000);
|
QVERIFY(data.count() > 1000);
|
||||||
QStringList list = QString::fromUtf8(data.data()).split(QLatin1Char('\n'), QString::SkipEmptyParts);
|
QStringList list = QString::fromUtf8(data.data()).split(QLatin1Char('\n'), Qt::SkipEmptyParts);
|
||||||
QVERIFY(list.count() %2 == 0); // even amount as we have title and then content.
|
QVERIFY(list.count() %2 == 0); // even amount as we have title and then content.
|
||||||
for (int i=0; i < list.count(); i+=2) {
|
for (int i=0; i < list.count(); i+=2) {
|
||||||
QTest::newRow(list.at(i).toLatin1()) << list.at(i+1);
|
QTest::newRow(list.at(i).toLatin1()) << list.at(i+1);
|
||||||
|
@ -307,7 +307,7 @@ QFileDialog::Options FileDialogPanel::options() const
|
|||||||
|
|
||||||
QStringList FileDialogPanel::allowedSchemes() const
|
QStringList FileDialogPanel::allowedSchemes() const
|
||||||
{
|
{
|
||||||
return m_allowedSchemes->text().simplified().split(' ', QString::SkipEmptyParts);
|
return m_allowedSchemes->text().simplified().split(' ', Qt::SkipEmptyParts);
|
||||||
}
|
}
|
||||||
|
|
||||||
void FileDialogPanel::getOpenFileNames()
|
void FileDialogPanel::getOpenFileNames()
|
||||||
@ -468,7 +468,7 @@ void FileDialogPanel::applySettings(QFileDialog *d) const
|
|||||||
if (!file.isEmpty())
|
if (!file.isEmpty())
|
||||||
d->selectFile(file);
|
d->selectFile(file);
|
||||||
const QString filter = m_selectedNameFilter->text().trimmed();
|
const QString filter = m_selectedNameFilter->text().trimmed();
|
||||||
const QStringList filters = m_nameFilters->toPlainText().trimmed().split(QLatin1Char('\n'), QString::SkipEmptyParts);
|
const QStringList filters = m_nameFilters->toPlainText().trimmed().split(QLatin1Char('\n'), Qt::SkipEmptyParts);
|
||||||
if (!m_useMimeTypeFilters->isChecked()) {
|
if (!m_useMimeTypeFilters->isChecked()) {
|
||||||
d->setNameFilters(filters);
|
d->setNameFilters(filters);
|
||||||
if (!filter.isEmpty())
|
if (!filter.isEmpty())
|
||||||
|
@ -110,7 +110,7 @@ void DragWidget::dropEvent(QDropEvent *event)
|
|||||||
if (event->mimeData()->hasText()) {
|
if (event->mimeData()->hasText()) {
|
||||||
const QMimeData *mime = event->mimeData();
|
const QMimeData *mime = event->mimeData();
|
||||||
QStringList pieces = mime->text().split(QRegularExpression("\\s+"),
|
QStringList pieces = mime->text().split(QRegularExpression("\\s+"),
|
||||||
QString::SkipEmptyParts);
|
Qt::SkipEmptyParts);
|
||||||
QPoint position = event->pos();
|
QPoint position = event->pos();
|
||||||
QPoint hotSpot;
|
QPoint hotSpot;
|
||||||
|
|
||||||
|
@ -364,7 +364,7 @@ int main(int argc, char **argv)
|
|||||||
if (file.open(QIODevice::ReadOnly)) {
|
if (file.open(QIODevice::ReadOnly)) {
|
||||||
QTextStream textFile(&file);
|
QTextStream textFile(&file);
|
||||||
QString script = textFile.readAll();
|
QString script = textFile.readAll();
|
||||||
content = script.split("\n", QString::SkipEmptyParts);
|
content = script.split("\n", Qt::SkipEmptyParts);
|
||||||
} else {
|
} else {
|
||||||
printf("failed to read file: '%s'\n", qPrintable(fileinfo.absoluteFilePath()));
|
printf("failed to read file: '%s'\n", qPrintable(fileinfo.absoluteFilePath()));
|
||||||
continue;
|
continue;
|
||||||
|
@ -54,7 +54,7 @@ struct testDataSet
|
|||||||
QString charHexCsv2String(const QString &csv)
|
QString charHexCsv2String(const QString &csv)
|
||||||
{
|
{
|
||||||
QString result;
|
QString result;
|
||||||
foreach (const QString &charString, csv.split(QLatin1Char(','), QString::SkipEmptyParts)) {
|
foreach (const QString &charString, csv.split(QLatin1Char(','), Qt::SkipEmptyParts)) {
|
||||||
bool isOk;
|
bool isOk;
|
||||||
const uint charUInt = charString.toUInt(&isOk, 16);
|
const uint charUInt = charString.toUInt(&isOk, 16);
|
||||||
Q_ASSERT(isOk);
|
Q_ASSERT(isOk);
|
||||||
|
@ -405,7 +405,7 @@ void AccessibilitySceneManager::addGraphicsItems(AccessibilitySceneManager::Tree
|
|||||||
QString text;
|
QString text;
|
||||||
text += item.name + "\n";
|
text += item.name + "\n";
|
||||||
text += item.role + "\n";
|
text += item.role + "\n";
|
||||||
text += item.description.split(" ", QString::SkipEmptyParts).join("\n") + "\n";
|
text += item.description.split(QLatin1Char(' '), Qt::SkipEmptyParts).join("\n") + "\n";
|
||||||
text += "P:" + QString::number(item.rect.x()) + " " + QString::number(item.rect.y()) + " ";
|
text += "P:" + QString::number(item.rect.x()) + " " + QString::number(item.rect.y()) + " ";
|
||||||
text += "S:" + QString::number(item.rect.width()) + " " + QString::number(item.rect.height()) + "\n";
|
text += "S:" + QString::number(item.rect.width()) + " " + QString::number(item.rect.height()) + "\n";
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user