Misc.: Fix some narrowing integral conversion warnings
Drive-by change: use QByteArrayView instead of allocating a QByteArray. Change-Id: Iaf7acbbdb4efbb101b73b30061ce38dd1fa99ca3 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
This commit is contained in:
parent
d8a688adf0
commit
4538bbf4a6
@ -341,13 +341,7 @@ QList<QUrl> QMimeData::urls() const
|
|||||||
void QMimeData::setUrls(const QList<QUrl> &urls)
|
void QMimeData::setUrls(const QList<QUrl> &urls)
|
||||||
{
|
{
|
||||||
Q_D(QMimeData);
|
Q_D(QMimeData);
|
||||||
QList<QVariant> list;
|
d->setData(textUriListLiteral(), QList<QVariant>(urls.cbegin(), urls.cend()));
|
||||||
const int numUrls = urls.size();
|
|
||||||
list.reserve(numUrls);
|
|
||||||
for (int i = 0; i < numUrls; ++i)
|
|
||||||
list.append(urls.at(i));
|
|
||||||
|
|
||||||
d->setData(textUriListLiteral(), list);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
|
@ -199,7 +199,7 @@ bool QLibraryPrivate::load_sys()
|
|||||||
continue;
|
continue;
|
||||||
if (loadHints & QLibrary::LoadArchiveMemberHint) {
|
if (loadHints & QLibrary::LoadArchiveMemberHint) {
|
||||||
attempt = name;
|
attempt = name;
|
||||||
int lparen = attempt.indexOf(u'(');
|
qsizetype lparen = attempt.indexOf(u'(');
|
||||||
if (lparen == -1)
|
if (lparen == -1)
|
||||||
lparen = attempt.size();
|
lparen = attempt.size();
|
||||||
attempt = path + prefixes.at(prefix) + attempt.insert(lparen, suffixes.at(suffix));
|
attempt = path + prefixes.at(prefix) + attempt.insert(lparen, suffixes.at(suffix));
|
||||||
|
@ -235,7 +235,7 @@ static QString locatePlugin(const QString& fileName)
|
|||||||
suffixes.prepend(QString());
|
suffixes.prepend(QString());
|
||||||
|
|
||||||
// Split up "subdir/filename"
|
// Split up "subdir/filename"
|
||||||
const int slash = fileName.lastIndexOf(u'/');
|
const qsizetype slash = fileName.lastIndexOf(u'/');
|
||||||
const auto baseName = QStringView{fileName}.mid(slash + 1);
|
const auto baseName = QStringView{fileName}.mid(slash + 1);
|
||||||
const auto basePath = isAbsolute ? QStringView() : QStringView{fileName}.left(slash + 1); // keep the '/'
|
const auto basePath = isAbsolute ? QStringView() : QStringView{fileName}.left(slash + 1); // keep the '/'
|
||||||
|
|
||||||
|
@ -973,7 +973,7 @@ QCborContainerPrivate *QCborContainerPrivate::grow(QCborContainerPrivate *d, qsi
|
|||||||
Q_ASSERT(index >= 0);
|
Q_ASSERT(index >= 0);
|
||||||
d = detach(d, index + 1);
|
d = detach(d, index + 1);
|
||||||
Q_ASSERT(d);
|
Q_ASSERT(d);
|
||||||
int j = d->elements.size();
|
qsizetype j = d->elements.size();
|
||||||
while (j++ < index)
|
while (j++ < index)
|
||||||
d->append(Undefined());
|
d->append(Undefined());
|
||||||
return d;
|
return d;
|
||||||
|
@ -839,7 +839,7 @@ static inline bool scanUtf8Char(const char *&json, const char *end, char32_t *re
|
|||||||
const auto *usrc = reinterpret_cast<const uchar *>(json);
|
const auto *usrc = reinterpret_cast<const uchar *>(json);
|
||||||
const auto *uend = reinterpret_cast<const uchar *>(end);
|
const auto *uend = reinterpret_cast<const uchar *>(end);
|
||||||
const uchar b = *usrc++;
|
const uchar b = *usrc++;
|
||||||
int res = QUtf8Functions::fromUtf8<QUtf8BaseTraits>(b, result, usrc, uend);
|
qsizetype res = QUtf8Functions::fromUtf8<QUtf8BaseTraits>(b, result, usrc, uend);
|
||||||
if (res < 0)
|
if (res < 0)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
|
@ -35,7 +35,7 @@ static QByteArray escapedString(const QString &s)
|
|||||||
while (src != end) {
|
while (src != end) {
|
||||||
if (cursor >= ba_end - 6) {
|
if (cursor >= ba_end - 6) {
|
||||||
// ensure we have enough space
|
// ensure we have enough space
|
||||||
int pos = cursor - (const uchar *)ba.constData();
|
qptrdiff pos = cursor - (const uchar *)ba.constData();
|
||||||
ba.resize(ba.size()*2);
|
ba.resize(ba.size()*2);
|
||||||
cursor = (uchar *)ba.data() + pos;
|
cursor = (uchar *)ba.data() + pos;
|
||||||
ba_end = (const uchar *)ba.constData() + ba.size();
|
ba_end = (const uchar *)ba.constData() + ba.size();
|
||||||
|
@ -3384,7 +3384,9 @@ QString QCalendarBackend::dateTimeToString(QStringView format, const QDateTime &
|
|||||||
}
|
}
|
||||||
|
|
||||||
const QChar c = format.at(i);
|
const QChar c = format.at(i);
|
||||||
qsizetype repeat = qt_repeatCount(format.mid(i));
|
qsizetype rep = qt_repeatCount(format.mid(i));
|
||||||
|
Q_ASSERT(rep < std::numeric_limits<int>::max());
|
||||||
|
int repeat = int(rep);
|
||||||
bool used = false;
|
bool used = false;
|
||||||
if (formatDate) {
|
if (formatDate) {
|
||||||
switch (c.unicode()) {
|
switch (c.unicode()) {
|
||||||
|
@ -800,7 +800,7 @@ void QFutureInterfaceBasePrivate::connectOutputInterface(QFutureCallOutInterface
|
|||||||
void QFutureInterfaceBasePrivate::disconnectOutputInterface(QFutureCallOutInterface *interface)
|
void QFutureInterfaceBasePrivate::disconnectOutputInterface(QFutureCallOutInterface *interface)
|
||||||
{
|
{
|
||||||
QMutexLocker lock(&m_mutex);
|
QMutexLocker lock(&m_mutex);
|
||||||
const int index = outputConnections.indexOf(interface);
|
const qsizetype index = outputConnections.indexOf(interface);
|
||||||
if (index == -1)
|
if (index == -1)
|
||||||
return;
|
return;
|
||||||
outputConnections.removeAt(index);
|
outputConnections.removeAt(index);
|
||||||
|
@ -259,7 +259,7 @@ struct QWindowGeometrySpecification
|
|||||||
static inline int nextGeometryToken(const QByteArray &a, int &pos, char *op)
|
static inline int nextGeometryToken(const QByteArray &a, int &pos, char *op)
|
||||||
{
|
{
|
||||||
*op = 0;
|
*op = 0;
|
||||||
const int size = a.size();
|
const qsizetype size = a.size();
|
||||||
if (pos >= size)
|
if (pos >= size)
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
@ -1311,7 +1311,7 @@ static void init_platform(const QString &pluginNamesWithArguments, const QString
|
|||||||
if (!platformArguments.isEmpty()) {
|
if (!platformArguments.isEmpty()) {
|
||||||
if (QObject *nativeInterface = QGuiApplicationPrivate::platform_integration->nativeInterface()) {
|
if (QObject *nativeInterface = QGuiApplicationPrivate::platform_integration->nativeInterface()) {
|
||||||
for (const QString &argument : std::as_const(platformArguments)) {
|
for (const QString &argument : std::as_const(platformArguments)) {
|
||||||
const int equalsPos = argument.indexOf(u'=');
|
const qsizetype equalsPos = argument.indexOf(u'=');
|
||||||
const QByteArray name =
|
const QByteArray name =
|
||||||
equalsPos != -1 ? argument.left(equalsPos).toUtf8() : argument.toUtf8();
|
equalsPos != -1 ? argument.left(equalsPos).toUtf8() : argument.toUtf8();
|
||||||
const QVariant value =
|
const QVariant value =
|
||||||
@ -1331,7 +1331,7 @@ static void init_plugins(const QList<QByteArray> &pluginList)
|
|||||||
{
|
{
|
||||||
for (int i = 0; i < pluginList.size(); ++i) {
|
for (int i = 0; i < pluginList.size(); ++i) {
|
||||||
QByteArray pluginSpec = pluginList.at(i);
|
QByteArray pluginSpec = pluginList.at(i);
|
||||||
int colonPos = pluginSpec.indexOf(':');
|
qsizetype colonPos = pluginSpec.indexOf(':');
|
||||||
QObject *plugin;
|
QObject *plugin;
|
||||||
if (colonPos < 0)
|
if (colonPos < 0)
|
||||||
plugin = QGenericPluginFactory::create(QLatin1StringView(pluginSpec), QString());
|
plugin = QGenericPluginFactory::create(QLatin1StringView(pluginSpec), QString());
|
||||||
@ -1598,7 +1598,7 @@ void Q_TRACE_INSTRUMENT(qtgui) QGuiApplicationPrivate::init()
|
|||||||
++i;
|
++i;
|
||||||
if (argv[i] && *argv[i]) {
|
if (argv[i] && *argv[i]) {
|
||||||
session_id = QString::fromLatin1(argv[i]);
|
session_id = QString::fromLatin1(argv[i]);
|
||||||
int p = session_id.indexOf(u'_');
|
qsizetype p = session_id.indexOf(u'_');
|
||||||
if (p >= 0) {
|
if (p >= 0) {
|
||||||
session_key = session_id.mid(p +1);
|
session_key = session_id.mid(p +1);
|
||||||
session_id = session_id.left(p);
|
session_id = session_id.left(p);
|
||||||
|
@ -699,7 +699,7 @@ QVector<QHighDpiScaling::ScreenFactor> QHighDpiScaling::parseScreenScaleFactorsS
|
|||||||
// - a semicolon-separated name=factor list: "foo=1.5;bar=2;baz=3"
|
// - a semicolon-separated name=factor list: "foo=1.5;bar=2;baz=3"
|
||||||
const auto specs = screenScaleFactors.split(u';');
|
const auto specs = screenScaleFactors.split(u';');
|
||||||
for (const auto &spec : specs) {
|
for (const auto &spec : specs) {
|
||||||
const int equalsPos = spec.lastIndexOf(u'=');
|
const qsizetype equalsPos = spec.lastIndexOf(u'=');
|
||||||
if (equalsPos == -1) {
|
if (equalsPos == -1) {
|
||||||
// screens in order
|
// screens in order
|
||||||
bool ok;
|
bool ok;
|
||||||
|
@ -20,7 +20,7 @@ static QStringList imageMimeFormats(const QList<QByteArray> &imageFormats)
|
|||||||
formats.append("image/"_L1 + QLatin1StringView(format.toLower()));
|
formats.append("image/"_L1 + QLatin1StringView(format.toLower()));
|
||||||
|
|
||||||
//put png at the front because it is best
|
//put png at the front because it is best
|
||||||
int pngIndex = formats.indexOf("image/png"_L1);
|
const qsizetype pngIndex = formats.indexOf("image/png"_L1);
|
||||||
if (pngIndex != -1 && pngIndex != 0)
|
if (pngIndex != -1 && pngIndex != 0)
|
||||||
formats.move(pngIndex, 0);
|
formats.move(pngIndex, 0);
|
||||||
|
|
||||||
|
@ -940,7 +940,7 @@ QKeySequence QKeySequence::mnemonic(const QString &text)
|
|||||||
return ret;
|
return ret;
|
||||||
|
|
||||||
bool found = false;
|
bool found = false;
|
||||||
int p = 0;
|
qsizetype p = 0;
|
||||||
while (p >= 0) {
|
while (p >= 0) {
|
||||||
p = text.indexOf(u'&', p) + 1;
|
p = text.indexOf(u'&', p) + 1;
|
||||||
if (p <= 0 || p >= (int)text.size())
|
if (p <= 0 || p >= (int)text.size())
|
||||||
@ -993,7 +993,7 @@ int QKeySequence::assign(const QString &ks, QKeySequence::SequenceFormat format)
|
|||||||
{
|
{
|
||||||
QString keyseq = ks;
|
QString keyseq = ks;
|
||||||
int n = 0;
|
int n = 0;
|
||||||
int p = 0, diff = 0;
|
qsizetype p = 0, diff = 0;
|
||||||
|
|
||||||
// Run through the whole string, but stop
|
// Run through the whole string, but stop
|
||||||
// if we have MaxKeyCount keys before the end.
|
// if we have MaxKeyCount keys before the end.
|
||||||
@ -1111,8 +1111,8 @@ int QKeySequencePrivate::decodeString(QString accel, QKeySequence::SequenceForma
|
|||||||
return Qt::Key_unknown;
|
return Qt::Key_unknown;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
int i = 0;
|
qsizetype i = 0;
|
||||||
int lastI = 0;
|
qsizetype lastI = 0;
|
||||||
while ((i = sl.indexOf(u'+', i + 1)) != -1) {
|
while ((i = sl.indexOf(u'+', i + 1)) != -1) {
|
||||||
const QStringView sub = QStringView{sl}.mid(lastI, i - lastI + 1);
|
const QStringView sub = QStringView{sl}.mid(lastI, i - lastI + 1);
|
||||||
// If we get here the shortcuts contains at least one '+'. We break up
|
// If we get here the shortcuts contains at least one '+'. We break up
|
||||||
@ -1146,7 +1146,7 @@ int QKeySequencePrivate::decodeString(QString accel, QKeySequence::SequenceForma
|
|||||||
lastI = i + 1;
|
lastI = i + 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
int p = accel.lastIndexOf(u'+', accel.size() - 2); // -2 so that Ctrl++ works
|
qsizetype p = accel.lastIndexOf(u'+', accel.size() - 2); // -2 so that Ctrl++ works
|
||||||
QStringView accelRef(accel);
|
QStringView accelRef(accel);
|
||||||
if (p > 0)
|
if (p > 0)
|
||||||
accelRef = accelRef.mid(p + 1);
|
accelRef = accelRef.mid(p + 1);
|
||||||
|
@ -564,7 +564,7 @@ bool QPointingDevicePrivate::addPassiveGrabber(const QPointerEvent *event, const
|
|||||||
|
|
||||||
bool QPointingDevicePrivate::setPassiveGrabberContext(QPointingDevicePrivate::EventPointData *epd, QObject *grabber, QObject *context)
|
bool QPointingDevicePrivate::setPassiveGrabberContext(QPointingDevicePrivate::EventPointData *epd, QObject *grabber, QObject *context)
|
||||||
{
|
{
|
||||||
int i = epd->passiveGrabbers.indexOf(grabber);
|
qsizetype i = epd->passiveGrabbers.indexOf(grabber);
|
||||||
if (i < 0)
|
if (i < 0)
|
||||||
return false;
|
return false;
|
||||||
if (epd->passiveGrabbersContext.size() <= i)
|
if (epd->passiveGrabbersContext.size() <= i)
|
||||||
@ -581,7 +581,7 @@ bool QPointingDevicePrivate::removePassiveGrabber(const QPointerEvent *event, co
|
|||||||
qWarning() << "point is not in activePoints" << point;
|
qWarning() << "point is not in activePoints" << point;
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
int i = persistentPoint->passiveGrabbers.indexOf(grabber);
|
qsizetype i = persistentPoint->passiveGrabbers.indexOf(grabber);
|
||||||
if (i >= 0) {
|
if (i >= 0) {
|
||||||
if (Q_UNLIKELY(lcPointerGrab().isDebugEnabled())) {
|
if (Q_UNLIKELY(lcPointerGrab().isDebugEnabled())) {
|
||||||
qCDebug(lcPointerGrab) << name << "point" << point.id() << point.state()
|
qCDebug(lcPointerGrab) << name << "point" << point.id() << point.state()
|
||||||
@ -644,7 +644,7 @@ void QPointingDevicePrivate::removeGrabber(QObject *grabber, bool cancel)
|
|||||||
cancel ? QPointingDevice::CancelGrabExclusive : QPointingDevice::UngrabExclusive,
|
cancel ? QPointingDevice::CancelGrabExclusive : QPointingDevice::UngrabExclusive,
|
||||||
nullptr, epd.eventPoint);
|
nullptr, epd.eventPoint);
|
||||||
}
|
}
|
||||||
int pi = epd.passiveGrabbers.indexOf(grabber);
|
qsizetype pi = epd.passiveGrabbers.indexOf(grabber);
|
||||||
if (pi >= 0) {
|
if (pi >= 0) {
|
||||||
qCDebug(lcPointerGrab) << name << "point" << epd.eventPoint.id() << epd.eventPoint.state()
|
qCDebug(lcPointerGrab) << name << "point" << epd.eventPoint.id() << epd.eventPoint.state()
|
||||||
<< ": removing passive grabber" << grabber;
|
<< ": removing passive grabber" << grabber;
|
||||||
|
@ -431,14 +431,14 @@ void QWindowPrivate::updateSiblingPosition(SiblingPosition position)
|
|||||||
|
|
||||||
QObjectList &siblings = q->parent()->d_ptr->children;
|
QObjectList &siblings = q->parent()->d_ptr->children;
|
||||||
|
|
||||||
const int siblingCount = siblings.size() - 1;
|
const qsizetype siblingCount = siblings.size() - 1;
|
||||||
if (siblingCount == 0)
|
if (siblingCount == 0)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
const int currentPosition = siblings.indexOf(q);
|
const qsizetype currentPosition = siblings.indexOf(q);
|
||||||
Q_ASSERT(currentPosition >= 0);
|
Q_ASSERT(currentPosition >= 0);
|
||||||
|
|
||||||
const int targetPosition = position == PositionTop ? siblingCount : 0;
|
const qsizetype targetPosition = position == PositionTop ? siblingCount : 0;
|
||||||
|
|
||||||
if (currentPosition == targetPosition)
|
if (currentPosition == targetPosition)
|
||||||
return;
|
return;
|
||||||
|
@ -138,7 +138,7 @@ static bool handleWindowSystemEvent(Args ...args)
|
|||||||
return QWindowSystemHelper<Delivery>::template handleEvent<EventType>(args...);
|
return QWindowSystemHelper<Delivery>::template handleEvent<EventType>(args...);
|
||||||
}
|
}
|
||||||
|
|
||||||
int QWindowSystemInterfacePrivate::windowSystemEventsQueued()
|
qsizetype QWindowSystemInterfacePrivate::windowSystemEventsQueued()
|
||||||
{
|
{
|
||||||
return windowSystemEventQueue.count();
|
return windowSystemEventQueue.count();
|
||||||
}
|
}
|
||||||
@ -791,7 +791,7 @@ void QWindowSystemInterface::handleScreenRemoved(QPlatformScreen *platformScreen
|
|||||||
void QWindowSystemInterface::handlePrimaryScreenChanged(QPlatformScreen *newPrimary)
|
void QWindowSystemInterface::handlePrimaryScreenChanged(QPlatformScreen *newPrimary)
|
||||||
{
|
{
|
||||||
QScreen *newPrimaryScreen = newPrimary->screen();
|
QScreen *newPrimaryScreen = newPrimary->screen();
|
||||||
int indexOfScreen = QGuiApplicationPrivate::screen_list.indexOf(newPrimaryScreen);
|
qsizetype indexOfScreen = QGuiApplicationPrivate::screen_list.indexOf(newPrimaryScreen);
|
||||||
Q_ASSERT(indexOfScreen >= 0);
|
Q_ASSERT(indexOfScreen >= 0);
|
||||||
if (indexOfScreen == 0)
|
if (indexOfScreen == 0)
|
||||||
return;
|
return;
|
||||||
@ -1058,7 +1058,7 @@ Q_GUI_EXPORT QDebug operator<<(QDebug dbg, const QWindowSystemInterface::TouchPo
|
|||||||
*/
|
*/
|
||||||
bool QWindowSystemInterface::flushWindowSystemEvents(QEventLoop::ProcessEventsFlags flags)
|
bool QWindowSystemInterface::flushWindowSystemEvents(QEventLoop::ProcessEventsFlags flags)
|
||||||
{
|
{
|
||||||
const int count = QWindowSystemInterfacePrivate::windowSystemEventQueue.count();
|
const qsizetype count = QWindowSystemInterfacePrivate::windowSystemEventQueue.count();
|
||||||
if (!count)
|
if (!count)
|
||||||
return false;
|
return false;
|
||||||
if (!QGuiApplication::instance()) {
|
if (!QGuiApplication::instance()) {
|
||||||
|
@ -473,7 +473,7 @@ public:
|
|||||||
}
|
}
|
||||||
void append(WindowSystemEvent *e)
|
void append(WindowSystemEvent *e)
|
||||||
{ const QMutexLocker locker(&mutex); impl.append(e); }
|
{ const QMutexLocker locker(&mutex); impl.append(e); }
|
||||||
int count() const
|
qsizetype count() const
|
||||||
{ const QMutexLocker locker(&mutex); return impl.size(); }
|
{ const QMutexLocker locker(&mutex); return impl.size(); }
|
||||||
WindowSystemEvent *peekAtFirstOfType(EventType t) const
|
WindowSystemEvent *peekAtFirstOfType(EventType t) const
|
||||||
{
|
{
|
||||||
@ -500,7 +500,7 @@ public:
|
|||||||
|
|
||||||
static WindowSystemEventList windowSystemEventQueue;
|
static WindowSystemEventList windowSystemEventQueue;
|
||||||
|
|
||||||
static int windowSystemEventsQueued();
|
static qsizetype windowSystemEventsQueued();
|
||||||
static bool nonUserInputEventsQueued();
|
static bool nonUserInputEventsQueued();
|
||||||
static WindowSystemEvent *getWindowSystemEvent();
|
static WindowSystemEvent *getWindowSystemEvent();
|
||||||
static WindowSystemEvent *getNonUserInputWindowSystemEvent();
|
static WindowSystemEvent *getNonUserInputWindowSystemEvent();
|
||||||
|
@ -88,13 +88,12 @@ QList<EGLint> q_createConfigAttributesFromFormat(const QSurfaceFormat &format)
|
|||||||
|
|
||||||
bool q_reduceConfigAttributes(QList<EGLint> *configAttributes)
|
bool q_reduceConfigAttributes(QList<EGLint> *configAttributes)
|
||||||
{
|
{
|
||||||
int i = -1;
|
|
||||||
// Reduce the complexity of a configuration request to ask for less
|
// Reduce the complexity of a configuration request to ask for less
|
||||||
// because the previous request did not result in success. Returns
|
// because the previous request did not result in success. Returns
|
||||||
// true if the complexity was reduced, or false if no further
|
// true if the complexity was reduced, or false if no further
|
||||||
// reductions in complexity are possible.
|
// reductions in complexity are possible.
|
||||||
|
|
||||||
i = configAttributes->indexOf(EGL_SWAP_BEHAVIOR);
|
qsizetype i = configAttributes->indexOf(EGL_SWAP_BEHAVIOR);
|
||||||
if (i >= 0) {
|
if (i >= 0) {
|
||||||
configAttributes->remove(i,2);
|
configAttributes->remove(i,2);
|
||||||
}
|
}
|
||||||
@ -258,7 +257,7 @@ EGLConfig QEglConfigChooser::chooseConfig()
|
|||||||
|
|
||||||
// Fetch all of the matching configurations and find the
|
// Fetch all of the matching configurations and find the
|
||||||
// first that matches the pixel format we wanted.
|
// first that matches the pixel format we wanted.
|
||||||
int i = configureAttributes.indexOf(EGL_RED_SIZE);
|
qsizetype i = configureAttributes.indexOf(EGL_RED_SIZE);
|
||||||
m_confAttrRed = configureAttributes.at(i+1);
|
m_confAttrRed = configureAttributes.at(i+1);
|
||||||
i = configureAttributes.indexOf(EGL_GREEN_SIZE);
|
i = configureAttributes.indexOf(EGL_GREEN_SIZE);
|
||||||
m_confAttrGreen = configureAttributes.at(i+1);
|
m_confAttrGreen = configureAttributes.at(i+1);
|
||||||
@ -268,7 +267,8 @@ EGLConfig QEglConfigChooser::chooseConfig()
|
|||||||
m_confAttrAlpha = i == -1 ? 0 : configureAttributes.at(i+1);
|
m_confAttrAlpha = i == -1 ? 0 : configureAttributes.at(i+1);
|
||||||
|
|
||||||
QList<EGLConfig> configs(matching);
|
QList<EGLConfig> configs(matching);
|
||||||
eglChooseConfig(display(), configureAttributes.constData(), configs.data(), configs.size(), &matching);
|
eglChooseConfig(display(), configureAttributes.constData(), configs.data(),
|
||||||
|
EGLint(configs.size()), &matching);
|
||||||
if (!cfg && matching > 0)
|
if (!cfg && matching > 0)
|
||||||
cfg = configs.first();
|
cfg = configs.first();
|
||||||
|
|
||||||
|
@ -385,7 +385,8 @@ static bool readGpuFeatures(const QOpenGLConfig::Gpu &gpu,
|
|||||||
QJsonParseError error;
|
QJsonParseError error;
|
||||||
const QJsonDocument document = QJsonDocument::fromJson(jsonAsciiData, &error);
|
const QJsonDocument document = QJsonDocument::fromJson(jsonAsciiData, &error);
|
||||||
if (document.isNull()) {
|
if (document.isNull()) {
|
||||||
const int lineNumber = 1 + jsonAsciiData.left(error.offset).count('\n');
|
const qsizetype lineNumber =
|
||||||
|
QByteArrayView(jsonAsciiData).left(error.offset).count('\n') + 1;
|
||||||
QTextStream str(errorMessage);
|
QTextStream str(errorMessage);
|
||||||
str << "Failed to parse data: \"" << error.errorString()
|
str << "Failed to parse data: \"" << error.errorString()
|
||||||
<< "\" at line " << lineNumber << " (offset: "
|
<< "\" at line " << lineNumber << " (offset: "
|
||||||
|
Loading…
x
Reference in New Issue
Block a user