Merge "Merge remote-tracking branch 'origin/5.12' into 5.13"
This commit is contained in:
commit
f2a10ea094
6
mkspecs/features/android/spec_post.prf
Normal file
6
mkspecs/features/android/spec_post.prf
Normal 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
|
@ -36,7 +36,7 @@ android {
|
||||
|
||||
compileSdkVersion androidCompileSdkVersion.toInteger()
|
||||
|
||||
buildToolsVersion androidBuildToolsVersion
|
||||
buildToolsVersion '28.0.3'
|
||||
|
||||
sourceSets {
|
||||
main {
|
||||
|
@ -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
|
||||
|
@ -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)
|
||||
|
@ -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();
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user