Merge "Merge remote-tracking branch 'origin/5.12' into 5.13"

This commit is contained in:
Qt Forward Merge Bot 2019-06-29 01:00:33 +02:00
commit f2a10ea094
5 changed files with 47 additions and 11 deletions

View File

@ -0,0 +1,6 @@
load(spec_post)
# Work around idiosyncracy in Android NDK's make executable
# which tries to call the shell-builtin "move" as direct process
equals(QMAKE_HOST.os, Windows):equals(QMAKE_MOVE, move): \
QMAKE_MOVE = cmd /c move

View File

@ -36,7 +36,7 @@ android {
compileSdkVersion androidCompileSdkVersion.toInteger()
buildToolsVersion androidBuildToolsVersion
buildToolsVersion '28.0.3'
sourceSets {
main {

View File

@ -310,11 +310,15 @@ void QBasicDrag::updateCursor(Qt::DropAction action)
m_dndHasSetOverrideCursor = true;
} else {
QCursor *cursor = QGuiApplication::overrideCursor();
if (!pixmap.isNull()) {
if (cursor->pixmap().cacheKey() != pixmap.cacheKey())
QGuiApplication::changeOverrideCursor(QCursor(pixmap));
} else if (cursorShape != cursor->shape()) {
QGuiApplication::changeOverrideCursor(QCursor(cursorShape));
if (!cursor) {
QGuiApplication::changeOverrideCursor(pixmap.isNull() ? QCursor(cursorShape) : QCursor(pixmap));
} else {
if (!pixmap.isNull()) {
if (cursor->pixmap().cacheKey() != pixmap.cacheKey())
QGuiApplication::changeOverrideCursor(QCursor(pixmap));
} else if (cursorShape != cursor->shape()) {
QGuiApplication::changeOverrideCursor(QCursor(cursorShape));
}
}
}
#endif

View File

@ -1611,8 +1611,10 @@ qint64 QSocks5SocketEngine::readDatagram(char *data, qint64 maxlen, QIpPacketHea
QSocks5RevivedDatagram datagram = d->udpData->pendingDatagrams.dequeue();
int copyLen = qMin<int>(maxlen, datagram.data.size());
memcpy(data, datagram.data.constData(), copyLen);
header->senderAddress = datagram.address;
header->senderPort = datagram.port;
if (header) {
header->senderAddress = datagram.address;
header->senderPort = datagram.port;
}
return copyLen;
#else
Q_UNUSED(data)

View File

@ -558,6 +558,7 @@ static inline int getBlockPosition(const QSharedPointer<QInputMethodQueryEvent>
void QAndroidInputContext::reset()
{
focusObjectStopComposing();
clear();
m_batchEditNestingLevel = 0;
m_handleMode = Hidden;
@ -792,7 +793,25 @@ void QAndroidInputContext::touchDown(int x, int y)
m_handleMode = ShowCursor;
// The VK will appear in a moment, stop the timer
m_hideCursorHandleTimer.stop();
focusObjectStopComposing();
if (focusObjectIsComposing()) {
const double pixelDensity =
QGuiApplication::focusWindow()
? QHighDpiScaling::factor(QGuiApplication::focusWindow())
: QHighDpiScaling::factor(QtAndroid::androidPlatformIntegration()->screen());
const QPointF touchPointLocal =
QGuiApplication::inputMethod()->inputItemTransform().inverted().map(
QPointF(x / pixelDensity, y / pixelDensity));
const int curBlockPos = getBlockPosition(
focusObjectInputMethodQuery(Qt::ImCursorPosition | Qt::ImAbsolutePosition));
const int touchPosition = curBlockPos
+ QInputMethod::queryFocusObject(Qt::ImCursorPosition, touchPointLocal).toInt();
if (touchPosition != m_composingCursor)
focusObjectStopComposing();
}
updateSelectionHandles();
}
}
@ -1200,13 +1219,18 @@ jint QAndroidInputContext::getCursorCapsMode(jint /*reqModes*/)
const uint qtInputMethodHints = query->value(Qt::ImHints).toUInt();
const int localPos = query->value(Qt::ImCursorPosition).toInt();
bool atWordBoundary = (localPos == 0);
bool atWordBoundary =
localPos == 0
&& (!focusObjectIsComposing() || m_composingCursor == m_composingTextStart);
if (!atWordBoundary) {
QString surroundingText = query->value(Qt::ImSurroundingText).toString();
surroundingText.truncate(localPos);
if (focusObjectIsComposing())
surroundingText += m_composingText.leftRef(m_composingCursor - m_composingTextStart);
// Add a character to see if it is at the end of the sentence or not
QTextBoundaryFinder finder(QTextBoundaryFinder::Sentence, surroundingText + QLatin1Char('A'));
finder.setPosition(localPos);
finder.setPosition(surroundingText.length());
if (finder.isAtBoundary())
atWordBoundary = finder.isAtBoundary();
}