summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/corelib/doc/snippets/code/src_corelib_tools_qbytearray.cpp2
-rw-r--r--src/corelib/kernel/qtimer.h4
-rw-r--r--src/corelib/kernel/qvariant.cpp3
-rw-r--r--src/corelib/serialization/qcborarray.cpp9
-rw-r--r--src/corelib/serialization/qcbormap.cpp16
-rw-r--r--src/corelib/tools/qalgorithms.qdoc1
-rw-r--r--src/corelib/tools/qstring.cpp2
-rw-r--r--src/gui/painting/qplatformbackingstore.cpp9
-rw-r--r--src/gui/painting/qplatformbackingstore.h2
-rw-r--r--src/network/access/qnetworkaccessdebugpipebackend.cpp4
-rw-r--r--src/network/access/qnetworkaccessdebugpipebackend_p.h1
-rw-r--r--src/network/access/qnetworkaccessfilebackend.cpp6
-rw-r--r--src/network/access/qnetworkaccessfilebackend_p.h2
-rw-r--r--src/network/socket/qlocalsocket.cpp2
-rw-r--r--src/network/ssl/qsslsocket_mac.cpp45
-rw-r--r--src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp3
-rw-r--r--src/opengl/qglpaintdevice.cpp1
-rw-r--r--src/platformsupport/eventdispatchers/qunixeventdispatcher_qpa_p.h3
-rw-r--r--src/plugins/platforms/cocoa/qcocoabackingstore.mm2
-rw-r--r--src/plugins/platforms/cocoa/qcocoaintegration.mm3
-rw-r--r--src/plugins/platforms/windows/qwindowscontext.cpp1
-rw-r--r--src/plugins/platforms/windows/qwindowscontext.h1
-rw-r--r--src/plugins/platforms/winrt/qwinrtbackingstore.cpp17
-rw-r--r--src/plugins/platforms/winrt/qwinrtbackingstore.h3
-rw-r--r--src/tools/androiddeployqt/main.cpp51
25 files changed, 108 insertions, 85 deletions
diff --git a/src/corelib/doc/snippets/code/src_corelib_tools_qbytearray.cpp b/src/corelib/doc/snippets/code/src_corelib_tools_qbytearray.cpp
index 3394358003..bd7cdaa681 100644
--- a/src/corelib/doc/snippets/code/src_corelib_tools_qbytearray.cpp
+++ b/src/corelib/doc/snippets/code/src_corelib_tools_qbytearray.cpp
@@ -363,7 +363,7 @@ a = str.toDouble(&ok); // a == 0, ok == false
//! [38float]
QByteArray string("1234.56");
bool ok;
-double a = string.toFloat(&ok); // a == 1234.56, ok == true
+float a = string.toFloat(&ok); // a == 1234.56, ok == true
string = "1234.56 Volt";
a = str.toFloat(&ok); // a == 0, ok == false
diff --git a/src/corelib/kernel/qtimer.h b/src/corelib/kernel/qtimer.h
index 7825bb0798..f5c04c7f70 100644
--- a/src/corelib/kernel/qtimer.h
+++ b/src/corelib/kernel/qtimer.h
@@ -141,14 +141,14 @@ public:
template <typename Duration, typename Func1>
static inline typename std::enable_if<!QtPrivate::FunctionPointer<Func1>::IsPointerToMemberFunction &&
!std::is_same<const char*, Func1>::value, void>::type
- singleShot(Duration interval, QObject *context, Func1 slot)
+ singleShot(Duration interval, const QObject *context, Func1 slot)
{
singleShot(interval, defaultTypeFor(interval), context, std::move(slot));
}
template <typename Duration, typename Func1>
static inline typename std::enable_if<!QtPrivate::FunctionPointer<Func1>::IsPointerToMemberFunction &&
!std::is_same<const char*, Func1>::value, void>::type
- singleShot(Duration interval, Qt::TimerType timerType, QObject *context, Func1 slot)
+ singleShot(Duration interval, Qt::TimerType timerType, const QObject *context, Func1 slot)
{
//compilation error if the slot has arguments.
typedef QtPrivate::FunctionPointer<Func1> SlotType;
diff --git a/src/corelib/kernel/qvariant.cpp b/src/corelib/kernel/qvariant.cpp
index c2faca4220..4d1aa911f7 100644
--- a/src/corelib/kernel/qvariant.cpp
+++ b/src/corelib/kernel/qvariant.cpp
@@ -1479,7 +1479,8 @@ static void customClear(QVariant::Private *d)
QMetaType::destruct(d->type, &d->data.ptr);
} else {
QMetaType::destruct(d->type, d->data.shared->ptr);
- delete d->data.shared;
+ d->data.shared->~PrivateShared();
+ operator delete(d->data.shared);
}
}
diff --git a/src/corelib/serialization/qcborarray.cpp b/src/corelib/serialization/qcborarray.cpp
index 0280aab8d3..28ee941a15 100644
--- a/src/corelib/serialization/qcborarray.cpp
+++ b/src/corelib/serialization/qcborarray.cpp
@@ -790,7 +790,7 @@ void QCborArray::detach(qsizetype reserved)
*/
/*!
- \fn QCborValueRef QCborArray::Iterator::operator[](qsizetype j) const
+ \fn QCborValueRef QCborArray::Iterator::operator[](qsizetype j)
Returns a modifiable reference to the item at a position \a j steps forward
from the item pointed to by this iterator.
@@ -1036,7 +1036,7 @@ void QCborArray::detach(qsizetype reserved)
*/
/*!
- \fn QCborValue QCborArray::ConstIterator::operator[](qsizetype j) const
+ \fn const QCborValueRef QCborArray::ConstIterator::operator[](qsizetype j)
Returns the item at a position \a j steps forward from the item pointed to
by this iterator.
@@ -1057,9 +1057,10 @@ void QCborArray::detach(qsizetype reserved)
*/
/*!
- \fn bool QCborArray::ConstIterator::operator!=(const ConstIterator &other) const
+ \fn bool QCborArray::ConstIterator::operator!=(const Iterator &o) const
+ \fn bool QCborArray::ConstIterator::operator!=(const ConstIterator &o) const
- Returns \c true if \a other points to a different entry in the array than
+ Returns \c true if \a o points to a different entry in the array than
this iterator; otherwise returns \c false.
\sa operator==()
diff --git a/src/corelib/serialization/qcbormap.cpp b/src/corelib/serialization/qcbormap.cpp
index f6760050bb..b7067f4afd 100644
--- a/src/corelib/serialization/qcbormap.cpp
+++ b/src/corelib/serialization/qcbormap.cpp
@@ -344,7 +344,7 @@ QVector<QCborValue> QCborMap::keys() const
*/
/*!
- \fn QCborValue QCborArray::take(qint64 key)
+ \fn QCborValue QCborMap::take(qint64 key)
Removes the key \a key and the corresponding value from the map and returns
the value, if it is found. If the map contains no such key, this function does nothing.
@@ -376,7 +376,7 @@ QVector<QCborValue> QCborMap::keys() const
*/
/*!
- \fn bool QCborMap::contains(qint64 key)
+ \fn bool QCborMap::contains(qint64 key) const
Returns true if this map contains a key-value pair identified by key \a
key. CBOR recommends using integer keys, since they occupy less space and
@@ -469,7 +469,7 @@ QCborValueRef QCborMap::operator[](qint64 key)
*/
/*!
- \fn QCborValue QCborArray::take(QLatin1String key)
+ \fn QCborValue QCborMap::take(QLatin1String key)
Removes the key \a key and the corresponding value from the map and returns
the value, if it is found. If the map contains no such key, this function does nothing.
@@ -502,7 +502,7 @@ QCborValueRef QCborMap::operator[](qint64 key)
*/
/*!
- \fn bool QCborMap::contains(QLatin1String key)
+ \fn bool QCborMap::contains(QLatin1String key) const
\overload
Returns true if this map contains a key-value pair identified by key \a
@@ -596,7 +596,7 @@ QCborValueRef QCborMap::operator[](QLatin1String key)
*/
/*!
- \fn QCborValue QCborArray::take(const QString &key)
+ \fn QCborValue QCborMap::take(const QString &key)
Removes the key \a key and the corresponding value from the map and returns
the value, if it is found. If the map contains no such key, this function does nothing.
@@ -630,7 +630,7 @@ QCborValueRef QCborMap::operator[](QLatin1String key)
*/
/*!
- \fn bool QCborMap::contains(const QString &key)
+ \fn bool QCborMap::contains(const QString &key) const
\overload
Returns true if this map contains a key-value pair identified by key \a
@@ -723,7 +723,7 @@ QCborValueRef QCborMap::operator[](const QString & key)
*/
/*!
- \fn QCborValue QCborArray::take(const QCborValue &key)
+ \fn QCborValue QCborMap::take(const QCborValue &key)
Removes the key \a key and the corresponding value from the map and returns
the value, if it is found. If the map contains no such key, this function does nothing.
@@ -756,7 +756,7 @@ QCborValueRef QCborMap::operator[](const QString & key)
*/
/*!
- \fn bool QCborMap::contains(const QCborValue &key)
+ \fn bool QCborMap::contains(const QCborValue &key) const
Returns true if this map contains a key-value pair identified by key \a
key.
diff --git a/src/corelib/tools/qalgorithms.qdoc b/src/corelib/tools/qalgorithms.qdoc
index f0ac2701e7..a73ec1e22a 100644
--- a/src/corelib/tools/qalgorithms.qdoc
+++ b/src/corelib/tools/qalgorithms.qdoc
@@ -29,6 +29,7 @@
\headerfile <QtAlgorithms>
\title Generic Algorithms
\ingroup funclists
+ \keyword generic algorithms
\brief The <QtAlgorithms> header includes the generic, template-based algorithms.
diff --git a/src/corelib/tools/qstring.cpp b/src/corelib/tools/qstring.cpp
index 1c8e47267d..6030d7058c 100644
--- a/src/corelib/tools/qstring.cpp
+++ b/src/corelib/tools/qstring.cpp
@@ -7996,7 +7996,7 @@ QString QString::repeated(int times) const
void qt_string_normalize(QString *data, QString::NormalizationForm mode, QChar::UnicodeVersion version, int from)
{
const QChar *p = data->constData() + from;
- if (isAscii(p, p + data->length()))
+ if (isAscii(p, p + data->length() - from))
return;
if (p > data->constData() + from)
from = p - data->constData() - 1; // need one before the non-ASCII to perform NFC
diff --git a/src/gui/painting/qplatformbackingstore.cpp b/src/gui/painting/qplatformbackingstore.cpp
index cc8d850689..373722cdb4 100644
--- a/src/gui/painting/qplatformbackingstore.cpp
+++ b/src/gui/painting/qplatformbackingstore.cpp
@@ -80,6 +80,8 @@
QT_BEGIN_NAMESPACE
+Q_LOGGING_CATEGORY(lcQpaBackingStore, "qt.qpa.backingstore", QtWarningMsg);
+
class QPlatformBackingStorePrivate
{
public:
@@ -331,16 +333,19 @@ void QPlatformBackingStore::composeAndFlush(QWindow *window, const QRegion &regi
d_ptr->context->setScreen(d_ptr->window->screen());
d_ptr->context->setShareContext(qt_window_private(d_ptr->window)->shareContext());
if (!d_ptr->context->create()) {
- qWarning("composeAndFlush: QOpenGLContext creation failed");
+ qCWarning(lcQpaBackingStore, "composeAndFlush: QOpenGLContext creation failed");
return;
}
}
if (!d_ptr->context->makeCurrent(window)) {
- qWarning("composeAndFlush: makeCurrent() failed");
+ qCWarning(lcQpaBackingStore, "composeAndFlush: makeCurrent() failed");
return;
}
+ qCDebug(lcQpaBackingStore) << "Composing and flushing" << region << "of" << window
+ << "at offset" << offset << "with" << textures->count() << "texture(s) in" << textures;
+
QWindowPrivate::get(window)->lastComposeTime.start();
QOpenGLFunctions *funcs = d_ptr->context->functions();
diff --git a/src/gui/painting/qplatformbackingstore.h b/src/gui/painting/qplatformbackingstore.h
index 381c564079..de5ba964dc 100644
--- a/src/gui/painting/qplatformbackingstore.h
+++ b/src/gui/painting/qplatformbackingstore.h
@@ -50,6 +50,7 @@
//
#include <QtGui/qtguiglobal.h>
+#include <QtCore/qloggingcategory.h>
#include <QtCore/qrect.h>
#include <QtCore/qobject.h>
@@ -59,6 +60,7 @@
QT_BEGIN_NAMESPACE
+Q_GUI_EXPORT Q_DECLARE_LOGGING_CATEGORY(lcQpaBackingStore)
class QRegion;
class QRect;
diff --git a/src/network/access/qnetworkaccessdebugpipebackend.cpp b/src/network/access/qnetworkaccessdebugpipebackend.cpp
index d7914e4143..67a856506c 100644
--- a/src/network/access/qnetworkaccessdebugpipebackend.cpp
+++ b/src/network/access/qnetworkaccessdebugpipebackend.cpp
@@ -107,8 +107,8 @@ void QNetworkAccessDebugPipeBackend::open()
bareProtocol = QUrlQuery(url()).queryItemValue(QLatin1String("bare")) == QLatin1String("1");
if (operation() == QNetworkAccessManager::PutOperation) {
- uploadByteDevice = createUploadByteDevice();
- QObject::connect(uploadByteDevice, SIGNAL(readyRead()), this, SLOT(uploadReadyReadSlot()));
+ createUploadByteDevice();
+ QObject::connect(uploadByteDevice.data(), SIGNAL(readyRead()), this, SLOT(uploadReadyReadSlot()));
QMetaObject::invokeMethod(this, "uploadReadyReadSlot", Qt::QueuedConnection);
}
}
diff --git a/src/network/access/qnetworkaccessdebugpipebackend_p.h b/src/network/access/qnetworkaccessdebugpipebackend_p.h
index d9a7aabdad..761c7055b8 100644
--- a/src/network/access/qnetworkaccessdebugpipebackend_p.h
+++ b/src/network/access/qnetworkaccessdebugpipebackend_p.h
@@ -77,7 +77,6 @@ protected:
void pushFromSocketToDownstream();
void pushFromUpstreamToSocket();
void possiblyFinish();
- QNonContiguousByteDevice *uploadByteDevice;
private slots:
void uploadReadyReadSlot();
diff --git a/src/network/access/qnetworkaccessfilebackend.cpp b/src/network/access/qnetworkaccessfilebackend.cpp
index d4ca9c22fc..60353cb03e 100644
--- a/src/network/access/qnetworkaccessfilebackend.cpp
+++ b/src/network/access/qnetworkaccessfilebackend.cpp
@@ -99,7 +99,7 @@ QNetworkAccessFileBackendFactory::create(QNetworkAccessManager::Operation op,
}
QNetworkAccessFileBackend::QNetworkAccessFileBackend()
- : uploadByteDevice(0), totalBytes(0), hasUploadFinished(false)
+ : totalBytes(0), hasUploadFinished(false)
{
}
@@ -154,8 +154,8 @@ void QNetworkAccessFileBackend::open()
break;
case QNetworkAccessManager::PutOperation:
mode = QIODevice::WriteOnly | QIODevice::Truncate;
- uploadByteDevice = createUploadByteDevice();
- QObject::connect(uploadByteDevice, SIGNAL(readyRead()), this, SLOT(uploadReadyReadSlot()));
+ createUploadByteDevice();
+ QObject::connect(uploadByteDevice.data(), SIGNAL(readyRead()), this, SLOT(uploadReadyReadSlot()));
QMetaObject::invokeMethod(this, "uploadReadyReadSlot", Qt::QueuedConnection);
break;
default:
diff --git a/src/network/access/qnetworkaccessfilebackend_p.h b/src/network/access/qnetworkaccessfilebackend_p.h
index 2c01fb1121..2204958ee0 100644
--- a/src/network/access/qnetworkaccessfilebackend_p.h
+++ b/src/network/access/qnetworkaccessfilebackend_p.h
@@ -73,8 +73,6 @@ public:
public slots:
void uploadReadyReadSlot();
-protected:
- QNonContiguousByteDevice *uploadByteDevice;
private:
QFile file;
qint64 totalBytes;
diff --git a/src/network/socket/qlocalsocket.cpp b/src/network/socket/qlocalsocket.cpp
index 6fec2fdbd2..1c34cd13ee 100644
--- a/src/network/socket/qlocalsocket.cpp
+++ b/src/network/socket/qlocalsocket.cpp
@@ -368,7 +368,7 @@ QLocalSocket::QLocalSocket(QObject * parent)
*/
QLocalSocket::~QLocalSocket()
{
- close();
+ QLocalSocket::close();
#if !defined(Q_OS_WIN) && !defined(QT_LOCALSOCKET_TCP)
Q_D(QLocalSocket);
d->unixSocket.setParent(0);
diff --git a/src/network/ssl/qsslsocket_mac.cpp b/src/network/ssl/qsslsocket_mac.cpp
index ff0df1c406..08ff4a9336 100644
--- a/src/network/ssl/qsslsocket_mac.cpp
+++ b/src/network/ssl/qsslsocket_mac.cpp
@@ -1250,29 +1250,30 @@ bool QSslSocketBackendPrivate::verifyPeerTrust()
QList<QSslError> errors;
// store certificates
const int certCount = SecTrustGetCertificateCount(trust);
- // TODO: why this test depends on configuration.peerCertificateChain not being empty????
- if (configuration.peerCertificateChain.isEmpty()) {
- // Apple's docs say SetTrustEvaluate must be called before
- // SecTrustGetCertificateAtIndex, but this results
- // in 'kSecTrustResultRecoverableTrustFailure', so
- // here we just ignore 'res' (later we'll use SetAnchor etc.
- // and evaluate again).
- SecTrustResultType res = kSecTrustResultInvalid;
- err = SecTrustEvaluate(trust, &res);
- if (err != errSecSuccess) {
- // We can not ignore this, it's not even about trust verification
- // probably ...
- setErrorAndEmit(QAbstractSocket::SslHandshakeFailedError,
- QStringLiteral("SecTrustEvaluate failed: %1").arg(err));
- plainSocket->disconnectFromHost();
- return false;
- }
- for (int i = 0; i < certCount; ++i) {
- SecCertificateRef cert = SecTrustGetCertificateAtIndex(trust, i);
- QCFType<CFDataRef> derData = SecCertificateCopyData(cert);
- configuration.peerCertificateChain << QSslCertificate(QByteArray::fromCFData(derData), QSsl::Der);
- }
+ // Apple's docs say SetTrustEvaluate must be called before
+ // SecTrustGetCertificateAtIndex, but this results
+ // in 'kSecTrustResultRecoverableTrustFailure', so
+ // here we just ignore 'res' (later we'll use SetAnchor etc.
+ // and evaluate again).
+ SecTrustResultType res = kSecTrustResultInvalid;
+ err = SecTrustEvaluate(trust, &res);
+ if (err != errSecSuccess) {
+ // We can not ignore this, it's not even about trust verification
+ // probably ...
+ setErrorAndEmit(QAbstractSocket::SslHandshakeFailedError,
+ QStringLiteral("SecTrustEvaluate failed: %1").arg(err));
+ plainSocket->disconnectFromHost();
+ return false;
+ }
+
+ configuration.peerCertificate.clear();
+ configuration.peerCertificateChain.clear();
+
+ for (int i = 0; i < certCount; ++i) {
+ SecCertificateRef cert = SecTrustGetCertificateAtIndex(trust, i);
+ QCFType<CFDataRef> derData = SecCertificateCopyData(cert);
+ configuration.peerCertificateChain << QSslCertificate(QByteArray::fromCFData(derData), QSsl::Der);
}
if (certCount > 0) {
diff --git a/src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp b/src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp
index 6365a7421b..cc97bed3f7 100644
--- a/src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp
+++ b/src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp
@@ -2099,9 +2099,8 @@ bool QGL2PaintEngineEx::end()
d->device->endPaint();
ctx->d_ptr->active_engine = 0;
-
+ ctx->makeCurrent();
d->resetOpenGLContextActiveEngine();
-
d->resetGLState();
delete d->shaderManager;
diff --git a/src/opengl/qglpaintdevice.cpp b/src/opengl/qglpaintdevice.cpp
index b29f71ad2e..c5151f66bb 100644
--- a/src/opengl/qglpaintdevice.cpp
+++ b/src/opengl/qglpaintdevice.cpp
@@ -126,6 +126,7 @@ void QGLPaintDevice::endPaint()
{
// Make sure the FBO bound at beginPaint is re-bound again here:
QGLContext *ctx = context();
+ ctx->makeCurrent();
ctx->d_func()->refreshCurrentFbo();
diff --git a/src/platformsupport/eventdispatchers/qunixeventdispatcher_qpa_p.h b/src/platformsupport/eventdispatchers/qunixeventdispatcher_qpa_p.h
index 23be081ba3..7f775b73ee 100644
--- a/src/platformsupport/eventdispatchers/qunixeventdispatcher_qpa_p.h
+++ b/src/platformsupport/eventdispatchers/qunixeventdispatcher_qpa_p.h
@@ -56,12 +56,9 @@
QT_BEGIN_NAMESPACE
-class QUnixEventDispatcherQPAPrivate;
-
class QUnixEventDispatcherQPA : public QEventDispatcherUNIX
{
Q_OBJECT
- Q_DECLARE_PRIVATE(QUnixEventDispatcherQPA)
public:
explicit QUnixEventDispatcherQPA(QObject *parent = 0);
diff --git a/src/plugins/platforms/cocoa/qcocoabackingstore.mm b/src/plugins/platforms/cocoa/qcocoabackingstore.mm
index 23a9edfa49..332683f63e 100644
--- a/src/plugins/platforms/cocoa/qcocoabackingstore.mm
+++ b/src/plugins/platforms/cocoa/qcocoabackingstore.mm
@@ -44,8 +44,6 @@
QT_BEGIN_NAMESPACE
-Q_LOGGING_CATEGORY(lcQpaBackingStore, "qt.qpa.backingstore");
-
QCocoaBackingStore::QCocoaBackingStore(QWindow *window)
: QRasterBackingStore(window)
{
diff --git a/src/plugins/platforms/cocoa/qcocoaintegration.mm b/src/plugins/platforms/cocoa/qcocoaintegration.mm
index d842bed91e..612290c9bd 100644
--- a/src/plugins/platforms/cocoa/qcocoaintegration.mm
+++ b/src/plugins/platforms/cocoa/qcocoaintegration.mm
@@ -255,7 +255,7 @@ void QCocoaIntegration::updateScreens()
continue;
}
QCocoaScreen* screen = nullptr;
- foreach (QCocoaScreen* existingScr, mScreens)
+ foreach (QCocoaScreen* existingScr, mScreens) {
// NSScreen documentation says do not cache the array returned from [NSScreen screens].
// However in practice, we can identify a screen by its pointer: if resolution changes,
// the NSScreen object will be the same instance, just with different values.
@@ -263,6 +263,7 @@ void QCocoaIntegration::updateScreens()
screen = existingScr;
break;
}
+ }
if (screen) {
remainingScreens.remove(screen);
screen->updateProperties();
diff --git a/src/plugins/platforms/windows/qwindowscontext.cpp b/src/plugins/platforms/windows/qwindowscontext.cpp
index 8d6a81036b..bba7d044f7 100644
--- a/src/plugins/platforms/windows/qwindowscontext.cpp
+++ b/src/plugins/platforms/windows/qwindowscontext.cpp
@@ -89,7 +89,6 @@
QT_BEGIN_NAMESPACE
Q_LOGGING_CATEGORY(lcQpaWindows, "qt.qpa.windows")
-Q_LOGGING_CATEGORY(lcQpaBackingStore, "qt.qpa.backingstore")
Q_LOGGING_CATEGORY(lcQpaEvents, "qt.qpa.events")
Q_LOGGING_CATEGORY(lcQpaGl, "qt.qpa.gl")
Q_LOGGING_CATEGORY(lcQpaMime, "qt.qpa.mime")
diff --git a/src/plugins/platforms/windows/qwindowscontext.h b/src/plugins/platforms/windows/qwindowscontext.h
index 2c2313c30a..fe83c83934 100644
--- a/src/plugins/platforms/windows/qwindowscontext.h
+++ b/src/plugins/platforms/windows/qwindowscontext.h
@@ -57,7 +57,6 @@ struct _SHSTOCKICONINFO;
QT_BEGIN_NAMESPACE
Q_DECLARE_LOGGING_CATEGORY(lcQpaWindows)
-Q_DECLARE_LOGGING_CATEGORY(lcQpaBackingStore)
Q_DECLARE_LOGGING_CATEGORY(lcQpaEvents)
Q_DECLARE_LOGGING_CATEGORY(lcQpaGl)
Q_DECLARE_LOGGING_CATEGORY(lcQpaMime)
diff --git a/src/plugins/platforms/winrt/qwinrtbackingstore.cpp b/src/plugins/platforms/winrt/qwinrtbackingstore.cpp
index 113886f9b4..b3bf52f09b 100644
--- a/src/plugins/platforms/winrt/qwinrtbackingstore.cpp
+++ b/src/plugins/platforms/winrt/qwinrtbackingstore.cpp
@@ -50,9 +50,6 @@
QT_BEGIN_NAMESPACE
-Q_LOGGING_CATEGORY(lcQpaBackingStore, "qt.qpa.backingstore")
-Q_LOGGING_CATEGORY(lcQpaBackingStoreVerbose, "qt.qpa.backingstore.verbose")
-
class QWinRTBackingStorePrivate
{
public:
@@ -68,7 +65,7 @@ QWinRTBackingStore::QWinRTBackingStore(QWindow *window)
: QPlatformBackingStore(window), d_ptr(new QWinRTBackingStorePrivate)
{
Q_D(QWinRTBackingStore);
- qCDebug(lcQpaBackingStore) << __FUNCTION__ << this << window;
+ qCInfo(lcQpaBackingStore) << __FUNCTION__ << this << window;
d->initialized = false;
d->screen = static_cast<QWinRTScreen*>(window->screen()->handle());
@@ -80,7 +77,7 @@ QWinRTBackingStore::QWinRTBackingStore(QWindow *window)
bool QWinRTBackingStore::initialize()
{
Q_D(QWinRTBackingStore);
- qCDebug(lcQpaBackingStoreVerbose) << __FUNCTION__ << d->initialized;
+ qCDebug(lcQpaBackingStore) << __FUNCTION__ << d->initialized;
if (d->initialized)
return true;
@@ -102,7 +99,7 @@ bool QWinRTBackingStore::initialize()
QWinRTBackingStore::~QWinRTBackingStore()
{
- qCDebug(lcQpaBackingStore) << __FUNCTION__ << this;
+ qCInfo(lcQpaBackingStore) << __FUNCTION__ << this;
}
QPaintDevice *QWinRTBackingStore::paintDevice()
@@ -116,7 +113,7 @@ void QWinRTBackingStore::flush(QWindow *window, const QRegion &region, const QPo
Q_D(QWinRTBackingStore);
Q_UNUSED(offset)
- qCDebug(lcQpaBackingStoreVerbose) << __FUNCTION__ << this << window << region;
+ qCDebug(lcQpaBackingStore) << __FUNCTION__ << this << window << region;
if (d->size.isEmpty())
return;
@@ -151,7 +148,7 @@ void QWinRTBackingStore::resize(const QSize &size, const QRegion &staticContents
Q_D(QWinRTBackingStore);
Q_UNUSED(staticContents)
- qCDebug(lcQpaBackingStoreVerbose) << __FUNCTION__ << this << size;
+ qCDebug(lcQpaBackingStore) << __FUNCTION__ << this << size;
if (!initialize())
return;
@@ -182,14 +179,14 @@ QImage QWinRTBackingStore::toImage() const
void QWinRTBackingStore::beginPaint(const QRegion &region)
{
- qCDebug(lcQpaBackingStoreVerbose) << __FUNCTION__ << this << region;
+ qCDebug(lcQpaBackingStore) << __FUNCTION__ << this << region;
resize(window()->size(), region);
}
void QWinRTBackingStore::endPaint()
{
- qCDebug(lcQpaBackingStoreVerbose) << __FUNCTION__ << this;
+ qCDebug(lcQpaBackingStore) << __FUNCTION__ << this;
}
QT_END_NAMESPACE
diff --git a/src/plugins/platforms/winrt/qwinrtbackingstore.h b/src/plugins/platforms/winrt/qwinrtbackingstore.h
index cd05faa63e..51fa13845e 100644
--- a/src/plugins/platforms/winrt/qwinrtbackingstore.h
+++ b/src/plugins/platforms/winrt/qwinrtbackingstore.h
@@ -47,9 +47,6 @@
QT_BEGIN_NAMESPACE
-Q_DECLARE_LOGGING_CATEGORY(lcQpaBackingStore)
-Q_DECLARE_LOGGING_CATEGORY(lcQpaBackingStoreVerbose)
-
class QWinRTScreen;
class QWinRTBackingStorePrivate;
diff --git a/src/tools/androiddeployqt/main.cpp b/src/tools/androiddeployqt/main.cpp
index ebd9480808..29681bf5ce 100644
--- a/src/tools/androiddeployqt/main.cpp
+++ b/src/tools/androiddeployqt/main.cpp
@@ -137,6 +137,7 @@ struct Options
// Build paths
QString qtInstallDirectory;
+ std::vector<QString> extraPrefixDirs;
QString androidSourceDirectory;
QString outputDirectory;
QString inputFileName;
@@ -730,6 +731,14 @@ bool readInputFile(Options *options)
}
{
+ const auto extraPrefixDirs = jsonObject.value(QLatin1String("extraPrefixDirs")).toArray();
+ options->extraPrefixDirs.reserve(extraPrefixDirs.size());
+ for (const auto &prefix : extraPrefixDirs) {
+ options->extraPrefixDirs.push_back(prefix.toString());
+ }
+ }
+
+ {
const QJsonValue androidSourcesDirectory = jsonObject.value(QStringLiteral("android-package-source-directory"));
if (!androidSourcesDirectory.isUndefined())
options->androidSourceDirectory = androidSourcesDirectory.toString();
@@ -1383,6 +1392,16 @@ bool updateAndroidFiles(Options &options)
return true;
}
+static QString absoluteFilePath(const Options *options, const QString &relativeFileName)
+{
+ for (const auto &prefix : options->extraPrefixDirs) {
+ const QString path = prefix + QLatin1Char('/') + relativeFileName;
+ if (QFile::exists(path))
+ return path;
+ }
+ return options->qtInstallDirectory + QLatin1Char('/') + relativeFileName;
+}
+
QList<QtDependency> findFilesRecursively(const Options &options, const QFileInfo &info, const QString &rootPath)
{
if (!info.exists())
@@ -1407,6 +1426,11 @@ QList<QtDependency> findFilesRecursively(const Options &options, const QFileInfo
QList<QtDependency> findFilesRecursively(const Options &options, const QString &fileName)
{
+ for (const auto &prefix : options.extraPrefixDirs) {
+ QFileInfo info(prefix + QLatin1Char('/') + fileName);
+ if (info.exists())
+ return findFilesRecursively(options, info, prefix + QLatin1Char('/'));
+ }
QFileInfo info(options.qtInstallDirectory + QLatin1Char('/') + fileName);
return findFilesRecursively(options, info, options.qtInstallDirectory + QLatin1Char('/'));
}
@@ -1416,7 +1440,7 @@ bool readAndroidDependencyXml(Options *options,
QSet<QString> *usedDependencies,
QSet<QString> *remainingDependencies)
{
- QString androidDependencyName = options->qtInstallDirectory + QString::fromLatin1("/lib/%1-android-dependencies.xml").arg(moduleName);
+ QString androidDependencyName = absoluteFilePath(options, QString::fromLatin1("/lib/%1-android-dependencies.xml").arg(moduleName));
QFile androidDependencyFile(androidDependencyName);
if (androidDependencyFile.exists()) {
@@ -1461,7 +1485,7 @@ bool readAndroidDependencyXml(Options *options,
int bundling = reader.attributes().value(QLatin1String("bundling")).toInt();
QString fileName = reader.attributes().value(QLatin1String("file")).toString();
if (bundling == (options->deploymentMechanism == Options::Bundled)) {
- QtDependency dependency(fileName, options->qtInstallDirectory + QLatin1Char('/') + fileName);
+ QtDependency dependency(fileName, absoluteFilePath(options, fileName));
if (!usedDependencies->contains(dependency.absolutePath)) {
options->qtDependencies.append(dependency);
usedDependencies->insert(dependency.absolutePath);
@@ -1548,7 +1572,7 @@ QStringList getQtLibsFromElf(const Options &options, const QString &fileName)
if (line.contains("(NEEDED)") && line.contains("Shared library:") ) {
const int pos = line.lastIndexOf('[') + 1;
QString libraryName = QLatin1String("lib/") + QString::fromLatin1(line.mid(pos, line.length() - pos - 2));
- if (QFile::exists(options.qtInstallDirectory + QLatin1Char('/') + libraryName)) {
+ if (QFile::exists(absoluteFilePath(&options, libraryName))) {
ret += libraryName;
}
@@ -1579,7 +1603,7 @@ bool readDependenciesFromElf(Options *options,
if (usedDependencies->contains(dependency))
continue;
- QString absoluteDependencyPath(options->qtInstallDirectory + QLatin1Char('/') + dependency);
+ QString absoluteDependencyPath = absoluteFilePath(options, dependency);
usedDependencies->insert(dependency);
if (!readDependenciesFromElf(options,
absoluteDependencyPath,
@@ -1766,11 +1790,9 @@ bool readDependencies(Options *options)
if (!readDependenciesFromElf(options, options->qtInstallDirectory + QLatin1String("/plugins/platforms/android/libqtforandroid.so"), &usedDependencies, &remainingDependencies))
return false;
- QString qtDir = options->qtInstallDirectory + QLatin1Char('/');
-
while (!remainingDependencies.isEmpty()) {
QSet<QString>::iterator start = remainingDependencies.begin();
- QString fileName = qtDir + *start;
+ QString fileName = absoluteFilePath(options, *start);
remainingDependencies.erase(start);
QStringList unmetDependencies;
@@ -1788,7 +1810,7 @@ bool readDependencies(Options *options)
QStringList::iterator it = options->localLibs.begin();
while (it != options->localLibs.end()) {
QStringList unmetDependencies;
- if (!goodToCopy(options, qtDir + *it, &unmetDependencies)) {
+ if (!goodToCopy(options, absoluteFilePath(options, *it), &unmetDependencies)) {
fprintf(stdout, "Skipping %s due to unmet dependencies: %s\n",
qPrintable(*it),
qPrintable(unmetDependencies.join(QLatin1Char(','))));
@@ -1925,7 +1947,7 @@ bool goodToCopy(const Options *options, const QString &file, QStringList *unmetD
bool ret = true;
const auto libs = getQtLibsFromElf(*options, file);
for (const QString &lib : libs) {
- if (!options->qtDependencies.contains(QtDependency(lib, options->qtInstallDirectory + QLatin1Char('/') + lib))) {
+ if (!options->qtDependencies.contains(QtDependency(lib, absoluteFilePath(options, lib)))) {
ret = false;
unmetDependencies->append(lib);
}
@@ -2331,10 +2353,15 @@ enum PackageType {
QString apkPath(const Options &options, PackageType pt)
{
QString path(options.outputDirectory);
- if (options.gradle)
- path += QLatin1String("/build/outputs/apk/") + QDir(options.outputDirectory).dirName() + QLatin1Char('-');
- else
+ if (options.gradle) {
+ path += QLatin1String("/build/outputs/apk/");
+ QString buildType(options.releasePackage ? QLatin1String("release/") : QLatin1String("debug/"));
+ if (QDir(path + buildType).exists())
+ path += buildType;
+ path += QDir(options.outputDirectory).dirName() + QLatin1Char('-');
+ } else {
path += QLatin1String("/bin/QtApp-");
+ }
if (options.releasePackage) {
path += QLatin1String("release-");
if (pt == UnsignedAPK)