Merge remote-tracking branch 'origin/5.13' into dev

Change-Id: I14eaabe98845445a9ea5266872cc1797786cfe04
This commit is contained in:
Qt Forward Merge Bot 2019-02-27 01:00:44 +01:00
commit c6fc2bc3e2
40 changed files with 69 additions and 49 deletions

View File

@ -94,7 +94,7 @@ load(qt_common)
} }
load(resolve_target) load(resolve_target)
TARGETPATHBASE = $$replace(TARGETPATH, \\.\\d+\$, ) isEmpty(IMPORT_NAME): IMPORT_NAME = $$replace(TARGETPATH, \\.\\d+\$, )
!qml1_target { !qml1_target {
isEmpty(QMAKE_PLUGINDUMP_DEPENDENCIES_FILE):exists($$_PRO_FILE_PWD_/dependencies.json): \ isEmpty(QMAKE_PLUGINDUMP_DEPENDENCIES_FILE):exists($$_PRO_FILE_PWD_/dependencies.json): \
@ -104,7 +104,7 @@ load(qt_common)
} }
qmltypes.target = qmltypes qmltypes.target = qmltypes
qmltypes.commands = $$QMLPLUGINDUMP -nonrelocatable $$QMAKE_QMLPLUGINDUMP_FLAGS $$replace(TARGETPATHBASE, /, .) $$IMPORT_VERSION > $$QMLTYPEFILE qmltypes.commands = $$QMLPLUGINDUMP -nonrelocatable $$QMAKE_QMLPLUGINDUMP_FLAGS $$replace(IMPORT_NAME, /, .) $$IMPORT_VERSION > $$QMLTYPEFILE
qmltypes.depends = $$QMAKE_RESOLVED_TARGET qmltypes.depends = $$QMAKE_RESOLVED_TARGET
} else { } else {
qmltypes.CONFIG += recursive qmltypes.CONFIG += recursive

View File

@ -3525,7 +3525,7 @@ bool ValidateGetBufferPointervBase(Context *context,
if (context->getGLState().getTargetBuffer(target) == nullptr) if (context->getGLState().getTargetBuffer(target) == nullptr)
{ {
context->handleError(InvalidOperation() context->handleError(InvalidOperation()
<< "Can not get pointer for reserved buffer name zero."); << "Cannot get pointer for reserved buffer name zero.");
return false; return false;
} }

View File

@ -8,7 +8,7 @@
"Description": "The PCRE library is a set of functions that implement regular expression pattern matching using the same syntax and semantics as Perl 5.", "Description": "The PCRE library is a set of functions that implement regular expression pattern matching using the same syntax and semantics as Perl 5.",
"Homepage": "http://www.pcre.org/", "Homepage": "http://www.pcre.org/",
"Version": "10.32", "Version": "10.32",
"DownloadLocation": "https://ftp.pcre.org/pub/pcre/pcre2-10.31.tar.bz2", "DownloadLocation": "https://ftp.pcre.org/pub/pcre/pcre2-10.32.tar.bz2",
"License": "BSD 3-clause \"New\" or \"Revised\" License", "License": "BSD 3-clause \"New\" or \"Revised\" License",
"LicenseId": "BSD-3-Clause", "LicenseId": "BSD-3-Clause",
"LicenseFile": "LICENCE", "LicenseFile": "LICENCE",
@ -27,7 +27,7 @@ Copyright (c) 2013-2013 Tilera Corporation (jiwang@tilera.com)"
"Description": "The PCRE library is a set of functions that implement regular expression pattern matching using the same syntax and semantics as Perl 5.", "Description": "The PCRE library is a set of functions that implement regular expression pattern matching using the same syntax and semantics as Perl 5.",
"Homepage": "http://www.pcre.org/", "Homepage": "http://www.pcre.org/",
"Version": "10.32", "Version": "10.32",
"DownloadLocation": "https://ftp.pcre.org/pub/pcre/pcre2-10.31.tar.bz2", "DownloadLocation": "https://ftp.pcre.org/pub/pcre/pcre2-10.32.tar.bz2",
"License": "BSD 2-clause \"Simplified\" License", "License": "BSD 2-clause \"Simplified\" License",
"LicenseId": "BSD-2-Clause", "LicenseId": "BSD-2-Clause",
"LicenseFile": "LICENCE-SLJIT", "LicenseFile": "LICENCE-SLJIT",

View File

@ -370,7 +370,7 @@ if (NOT CMAKE_VERSION VERSION_LESS 2.8.9)
if (NOT Qt5${_module}_FOUND) if (NOT Qt5${_module}_FOUND)
find_package(Qt5${_module} PATHS "${_Qt5_COMPONENT_PATH}" NO_DEFAULT_PATH) find_package(Qt5${_module} PATHS "${_Qt5_COMPONENT_PATH}" NO_DEFAULT_PATH)
if (NOT Qt5${_module}_FOUND) if (NOT Qt5${_module}_FOUND)
message(FATAL_ERROR "Can not use \"${_module}\" module which has not yet been found.") message(FATAL_ERROR "Cannot use \"${_module}\" module which has not yet been found.")
endif() endif()
endif() endif()
target_link_libraries(${_target} ${_qt5_link_type} ${Qt5${_module}_LIBRARIES}) target_link_libraries(${_target} ${_qt5_link_type} ${Qt5${_module}_LIBRARIES})

View File

@ -131,7 +131,7 @@ qtPrepareTool(QMAKE_QFLOAT16_TABLES, qfloat16-tables)
qfloat16_tables.commands = $$QMAKE_QFLOAT16_TABLES ${QMAKE_FILE_OUT} qfloat16_tables.commands = $$QMAKE_QFLOAT16_TABLES ${QMAKE_FILE_OUT}
qfloat16_tables.output = global/qfloat16tables.cpp qfloat16_tables.output = global/qfloat16tables.cpp
qfloat16_tables.depends = $$QMAKE_QFLOAT16_TABLES qfloat16_tables.depends = $$QMAKE_QFLOAT16_TABLES_EXE
qfloat16_tables.input = QMAKE_QFLOAT16_TABLES_GENERATE qfloat16_tables.input = QMAKE_QFLOAT16_TABLES_GENERATE
qfloat16_tables.variable_out = SOURCES qfloat16_tables.variable_out = SOURCES
QMAKE_EXTRA_COMPILERS += qfloat16_tables QMAKE_EXTRA_COMPILERS += qfloat16_tables

View File

@ -239,7 +239,7 @@ static bool systemHasStderr()
\note Qt Creator does not implement a pseudo TTY, nor does it launch apps with \note Qt Creator does not implement a pseudo TTY, nor does it launch apps with
the override environment variable set, but it will read stderr and print it to the override environment variable set, but it will read stderr and print it to
the user, so in effect this function can not be used to conclude that stderr the user, so in effect this function cannot be used to conclude that stderr
output will _not_ be visible to the user, as even if this function returns false, output will _not_ be visible to the user, as even if this function returns false,
the output might still end up visible to the user. For this reason, we don't guard the output might still end up visible to the user. For this reason, we don't guard
the stderr output in the default message handler with stderrHasConsoleAttached(). the stderr output in the default message handler with stderrHasConsoleAttached().

View File

@ -194,7 +194,7 @@ QIODevicePrivate::~QIODevicePrivate()
QIODevice provides both a common implementation and an abstract QIODevice provides both a common implementation and an abstract
interface for devices that support reading and writing of blocks interface for devices that support reading and writing of blocks
of data, such as QFile, QBuffer and QTcpSocket. QIODevice is of data, such as QFile, QBuffer and QTcpSocket. QIODevice is
abstract and can not be instantiated, but it is common to use the abstract and cannot be instantiated, but it is common to use the
interface it defines to provide device-independent I/O features. interface it defines to provide device-independent I/O features.
For example, Qt's XML classes operate on a QIODevice pointer, For example, Qt's XML classes operate on a QIODevice pointer,
allowing them to be used with various devices (such as files and allowing them to be used with various devices (such as files and

View File

@ -2329,7 +2329,7 @@ QModelIndex QAbstractItemModel::buddy(const QModelIndex &index) const
The way the search is performed is defined by the \a flags given. The list The way the search is performed is defined by the \a flags given. The list
that is returned may be empty. Note also that the order of results in the that is returned may be empty. Note also that the order of results in the
list may not correspond to the order in the model, if for example a proxy list may not correspond to the order in the model, if for example a proxy
model is used. The order of the results can not be relied upon. model is used. The order of the results cannot be relied upon.
The search begins from the \a start index, and continues until the number The search begins from the \a start index, and continues until the number
of matching data items equals \a hits, the search reaches the last row, or of matching data items equals \a hits, the search reaches the last row, or
@ -2903,7 +2903,7 @@ bool QAbstractItemModelPrivate::allowMove(const QModelIndex &srcParent, int star
Note that other rows may be displaced accordingly. Note also that when moving Note that other rows may be displaced accordingly. Note also that when moving
items within the same parent you should not attempt invalid or no-op moves. In items within the same parent you should not attempt invalid or no-op moves. In
the above example, item 2 is at row 2 before the move, so it can not be moved the above example, item 2 is at row 2 before the move, so it cannot be moved
to row 2 (where it is already) or row 3 (no-op as row 3 means above row 3, where to row 2 (where it is already) or row 3 (no-op as row 3 means above row 3, where
it is already) it is already)

View File

@ -95,7 +95,7 @@ class QIdentityProxyModelPrivate : public QAbstractProxyModelPrivate
need to implement all data handling in the same class that creates the structure of the model, and can also be used to create need to implement all data handling in the same class that creates the structure of the model, and can also be used to create
re-usable components. re-usable components.
This also provides a way to change the data in the case where a source model is supplied by a third party which can not be modified. This also provides a way to change the data in the case where a source model is supplied by a third party which cannot be modified.
\snippet code/src_gui_itemviews_qidentityproxymodel.cpp 0 \snippet code/src_gui_itemviews_qidentityproxymodel.cpp 0

View File

@ -501,7 +501,7 @@ void qt_apple_check_os_version()
if (!applicationName) if (!applicationName)
applicationName = NSProcessInfo.processInfo.processName; applicationName = NSProcessInfo.processInfo.processName;
fprintf(stderr, "Sorry, \"%s\" can not be run on this version of %s. " fprintf(stderr, "Sorry, \"%s\" cannot be run on this version of %s. "
"Qt requires %s %ld.%ld.%ld or later, you have %s %ld.%ld.%ld.\n", "Qt requires %s %ld.%ld.%ld or later, you have %s %ld.%ld.%ld.\n",
applicationName.UTF8String, os, applicationName.UTF8String, os,
os, long(required.majorVersion), long(required.minorVersion), long(required.patchVersion), os, long(required.majorVersion), long(required.minorVersion), long(required.patchVersion),

View File

@ -225,7 +225,7 @@ int QThreadPipe::check(const pollfd &pfd)
QEventDispatcherUNIXPrivate::QEventDispatcherUNIXPrivate() QEventDispatcherUNIXPrivate::QEventDispatcherUNIXPrivate()
{ {
if (Q_UNLIKELY(threadPipe.init() == false)) if (Q_UNLIKELY(threadPipe.init() == false))
qFatal("QEventDispatcherUNIXPrivate(): Can not continue without a thread pipe"); qFatal("QEventDispatcherUNIXPrivate(): Cannot continue without a thread pipe");
} }
QEventDispatcherUNIXPrivate::~QEventDispatcherUNIXPrivate() QEventDispatcherUNIXPrivate::~QEventDispatcherUNIXPrivate()

View File

@ -2106,7 +2106,7 @@ void QObject::removeEventFilter(QObject *obj)
This signal is emitted immediately before the object \a obj is This signal is emitted immediately before the object \a obj is
destroyed, after any instances of QPointer have been notified, destroyed, after any instances of QPointer have been notified,
and can not be blocked. and cannot be blocked.
All the objects's children are destroyed immediately after this All the objects's children are destroyed immediately after this
signal is emitted. signal is emitted.

View File

@ -163,7 +163,7 @@ void QArrayData::deallocate(QArrayData *data, size_t objectSize,
#endif #endif
Q_ASSERT_X(data == 0 || !data->ref.isStatic(), "QArrayData::deallocate", Q_ASSERT_X(data == 0 || !data->ref.isStatic(), "QArrayData::deallocate",
"Static data can not be deleted"); "Static data cannot be deleted");
::free(data); ::free(data);
} }

View File

@ -379,7 +379,7 @@
You can inherit this class when you need to create a QSharedPointer You can inherit this class when you need to create a QSharedPointer
from any instance of a class; for instance, from within the from any instance of a class; for instance, from within the
object itself. The key point is that the technique of object itself. The key point is that the technique of
just returning QSharedPointer<T>(this) can not be used, because just returning QSharedPointer<T>(this) cannot be used, because
this winds up creating multiple distinct QSharedPointer objects this winds up creating multiple distinct QSharedPointer objects
with separate reference counts. For this reason you must never with separate reference counts. For this reason you must never
create more than one QSharedPointer from the same raw pointer. create more than one QSharedPointer from the same raw pointer.

View File

@ -1047,6 +1047,7 @@ static int ucstrncmp(const QChar *a, const uchar *c, size_t l)
__m128i nullmask = _mm_setzero_si128(); __m128i nullmask = _mm_setzero_si128();
qptrdiff offset = 0; qptrdiff offset = 0;
# if !defined(__OPTIMIZE_SIZE__)
// Using the PMOVMSKB instruction, we get two bits for each character // Using the PMOVMSKB instruction, we get two bits for each character
// we compare. // we compare.
int retval; int retval;
@ -1059,6 +1060,7 @@ static int ucstrncmp(const QChar *a, const uchar *c, size_t l)
retval = uc[offset + idx / 2] - c[offset + idx / 2]; retval = uc[offset + idx / 2] - c[offset + idx / 2];
return true; return true;
}; };
# endif
// we're going to read uc[offset..offset+15] (32 bytes) // we're going to read uc[offset..offset+15] (32 bytes)
// and c[offset..offset+15] (16 bytes) // and c[offset..offset+15] (16 bytes)

View File

@ -158,6 +158,7 @@ QT_END_NAMESPACE
Q_DECLARE_METATYPE(QDBusArgument) Q_DECLARE_METATYPE(QDBusArgument)
QT_BEGIN_NAMESPACE QT_BEGIN_NAMESPACE
// ### Qt6: remove the defaulted T * = nullptr from these two (MSVC6 work-around):
template<typename T> inline T qdbus_cast(const QDBusArgument &arg, T * = nullptr) template<typename T> inline T qdbus_cast(const QDBusArgument &arg, T * = nullptr)
{ {
T item; T item;

View File

@ -184,7 +184,7 @@ void QPlatformGraphicsBuffer::unlock()
\fn QPlatformGraphicsBuffer::doLock(AccessTypes access, const QRect &rect = QRect()) \fn QPlatformGraphicsBuffer::doLock(AccessTypes access, const QRect &rect = QRect())
This function should be reimplemented by subclasses. If one of the \a This function should be reimplemented by subclasses. If one of the \a
access types specified can not be locked, then all should fail and this access types specified cannot be locked, then all should fail and this
function should return false. function should return false.
\a rect is the subrect which is desired to be locked. This \a rect is the subrect which is desired to be locked. This

View File

@ -166,7 +166,7 @@ QWindow::QWindow(QScreen *targetScreen)
static QWindow *nonDesktopParent(QWindow *parent) static QWindow *nonDesktopParent(QWindow *parent)
{ {
if (parent && parent->type() == Qt::Desktop) { if (parent && parent->type() == Qt::Desktop) {
qWarning("QWindows can not be reparented into desktop windows"); qWarning("QWindows cannot be reparented into desktop windows");
return nullptr; return nullptr;
} }
@ -1351,7 +1351,7 @@ void QWindow::setTransientParent(QWindow *parent)
return; return;
} }
if (parent == this) { if (parent == this) {
qWarning() << "transient parent" << parent << "can not be same as window"; qWarning() << "transient parent" << parent << "cannot be same as window";
return; return;
} }

View File

@ -249,7 +249,7 @@ QOpenGLFramebufferObjectFormat::~QOpenGLFramebufferObjectFormat()
If the desired amount of samples per pixel is not supported by the hardware If the desired amount of samples per pixel is not supported by the hardware
then the maximum number of samples per pixel will be used. Note that then the maximum number of samples per pixel will be used. Note that
multisample framebuffer objects can not be bound as textures. Also, the multisample framebuffer objects cannot be bound as textures. Also, the
\c{GL_EXT_framebuffer_multisample} extension is required to create a \c{GL_EXT_framebuffer_multisample} extension is required to create a
framebuffer with more than one sample per pixel. framebuffer with more than one sample per pixel.

View File

@ -755,11 +755,9 @@ static inline int qSafeFloatToQ16Dot16(qreal x)
void QRasterizer::rasterizeLine(const QPointF &a, const QPointF &b, qreal width, bool squareCap) void QRasterizer::rasterizeLine(const QPointF &a, const QPointF &b, qreal width, bool squareCap)
{ {
if (a == b || width == 0 || d->clipRect.isEmpty()) if (a == b || !(width > 0.0) || d->clipRect.isEmpty())
return; return;
Q_ASSERT(width > 0.0);
QPointF pa = a; QPointF pa = a;
QPointF pb = b; QPointF pb = b;

View File

@ -270,7 +270,7 @@ bool QTextDocumentWriter::write(const QTextDocument *document)
#ifndef QT_NO_TEXTHTMLPARSER #ifndef QT_NO_TEXTHTMLPARSER
if (format == "html" || format == "htm") { if (format == "html" || format == "htm") {
if (!d->device->isWritable() && ! d->device->open(QIODevice::WriteOnly)) { if (!d->device->isWritable() && ! d->device->open(QIODevice::WriteOnly)) {
qWarning("QTextDocumentWriter::write: the device can not be opened for writing"); qWarning("QTextDocumentWriter::write: the device cannot be opened for writing");
return false; return false;
} }
QTextStream ts(d->device); QTextStream ts(d->device);
@ -284,7 +284,7 @@ bool QTextDocumentWriter::write(const QTextDocument *document)
#endif #endif
if (format == "txt" || format == "plaintext") { if (format == "txt" || format == "plaintext") {
if (!d->device->isWritable() && ! d->device->open(QIODevice::WriteOnly)) { if (!d->device->isWritable() && ! d->device->open(QIODevice::WriteOnly)) {
qWarning("QTextDocumentWriter::write: the device can not be opened for writing"); qWarning("QTextDocumentWriter::write: the device cannot be opened for writing");
return false; return false;
} }
QTextStream ts(d->device); QTextStream ts(d->device);

View File

@ -963,7 +963,7 @@ bool QTextOdfWriter::writeAll()
m_strategy = new QXmlStreamStrategy(m_device); m_strategy = new QXmlStreamStrategy(m_device);
if (!m_device->isWritable() && ! m_device->open(QIODevice::WriteOnly)) { if (!m_device->isWritable() && ! m_device->open(QIODevice::WriteOnly)) {
qWarning("QTextOdfWriter::writeAll: the device can not be opened for writing"); qWarning("QTextOdfWriter::writeAll: the device cannot be opened for writing");
return false; return false;
} }
QXmlStreamWriter writer(m_strategy->contentStream); QXmlStreamWriter writer(m_strategy->contentStream);

View File

@ -1562,7 +1562,7 @@ bool QNetworkReplyHttpImplPrivate::sendCacheContents(const QNetworkCacheMetaData
QIODevice *contents = nc->data(url); QIODevice *contents = nc->data(url);
if (!contents) { if (!contents) {
#if defined(QNETWORKACCESSHTTPBACKEND_DEBUG) #if defined(QNETWORKACCESSHTTPBACKEND_DEBUG)
qDebug() << "Can not send cache, the contents are 0" << url; qDebug() << "Cannot send cache, the contents are 0" << url;
#endif #endif
return false; return false;
} }

View File

@ -518,7 +518,7 @@ QNetworkConfiguration::BearerType QNetworkConfiguration::bearerTypeFamily() cons
/*! /*!
Returns the type of bearer used by this network configuration as a string. Returns the type of bearer used by this network configuration as a string.
The string is not translated and therefore can not be shown to the user. The subsequent table The string is not translated and therefore cannot be shown to the user. The subsequent table
shows the fixed mappings between BearerType and the bearer type name for known types. If the shows the fixed mappings between BearerType and the bearer type name for known types. If the
BearerType is unknown this function may return additional information if it is available; BearerType is unknown this function may return additional information if it is available;
otherwise an empty string will be returned. otherwise an empty string will be returned.

View File

@ -372,7 +372,7 @@ QSocks5BindData *QSocks5BindStore::retrieve(qintptr socketDescriptor)
store.erase(it); store.erase(it);
if (bindData) { if (bindData) {
if (bindData->controlSocket->thread() != QThread::currentThread()) { if (bindData->controlSocket->thread() != QThread::currentThread()) {
qWarning("Can not access socks5 bind data from different thread"); qWarning("Cannot access socks5 bind data from different thread");
return 0; return 0;
} }
} else { } else {

View File

@ -615,8 +615,8 @@ bool QSslSocketBackendPrivate::acquireCredentialsHandle()
nullptr); nullptr);
if (!chainContext) { if (!chainContext) {
const QString message = isClient const QString message = isClient
? QSslSocket::tr("The certificate provided can not be used for a client.") ? QSslSocket::tr("The certificate provided cannot be used for a client.")
: QSslSocket::tr("The certificate provided can not be used for a server."); : QSslSocket::tr("The certificate provided cannot be used for a server.");
setErrorAndEmit(QAbstractSocket::SocketError::SslInvalidUserDataError, message); setErrorAndEmit(QAbstractSocket::SocketError::SslInvalidUserDataError, message);
return false; return false;
} }

View File

@ -211,7 +211,7 @@ QGLFramebufferObjectFormat::~QGLFramebufferObjectFormat()
If the desired amount of samples per pixel is not supported by the hardware If the desired amount of samples per pixel is not supported by the hardware
then the maximum number of samples per pixel will be used. Note that then the maximum number of samples per pixel will be used. Note that
multisample framebuffer objects can not be bound as textures. Also, the multisample framebuffer objects cannot be bound as textures. Also, the
\c{GL_EXT_framebuffer_multisample} extension is required to create a \c{GL_EXT_framebuffer_multisample} extension is required to create a
framebuffer with more than one sample per pixel. framebuffer with more than one sample per pixel.

View File

@ -557,7 +557,7 @@ bool QEvdevKeyboardHandler::loadKeymap(const QString &file)
delete [] qmap_keymap; delete [] qmap_keymap;
delete [] qmap_keycompose; delete [] qmap_keycompose;
qWarning("Keymap file '%s' can not be loaded.", qPrintable(file)); qWarning("Keymap file '%s' cannot be loaded.", qPrintable(file));
return false; return false;
} }

View File

@ -86,7 +86,7 @@ QCocoaGLContext::QCocoaGLContext(QOpenGLContext *context)
} }
m_context = nativeHandle.value<QCocoaNativeContext>().context(); m_context = nativeHandle.value<QCocoaNativeContext>().context();
if (!m_context) { if (!m_context) {
qCWarning(lcQpaOpenGLContext, "QCocoaNativeContext's NSOpenGLContext can not be null"); qCWarning(lcQpaOpenGLContext, "QCocoaNativeContext's NSOpenGLContext cannot be null");
return; return;
} }

View File

@ -619,7 +619,7 @@ void QCocoaWindow::applyWindowState(Qt::WindowStates requestedState)
if (nsWindow.styleMask & NSWindowStyleMaskUtilityWindow if (nsWindow.styleMask & NSWindowStyleMaskUtilityWindow
&& newState & (Qt::WindowMinimized | Qt::WindowFullScreen)) { && newState & (Qt::WindowMinimized | Qt::WindowFullScreen)) {
qWarning() << window()->type() << "windows can not be made" << newState; qWarning() << window()->type() << "windows cannot be made" << newState;
handleWindowStateChanged(HandleUnconditionally); handleWindowStateChanged(HandleUnconditionally);
return; return;
} }

View File

@ -106,7 +106,7 @@
"_q_mac_wantsLayer", "QT_MAC_WANTS_LAYER"); "_q_mac_wantsLayer", "QT_MAC_WANTS_LAYER");
if (wantsLayer != -1 && [self layerEnabledByMacOS]) { if (wantsLayer != -1 && [self layerEnabledByMacOS]) {
qCWarning(lcQpaDrawing) << "Layer-backing can not be explicitly controlled on 10.14 when built against the 10.14 SDK"; qCWarning(lcQpaDrawing) << "Layer-backing cannot be explicitly controlled on 10.14 when built against the 10.14 SDK";
return true; return true;
} }

View File

@ -49,6 +49,7 @@
#include "qwindowswindow.h" #include "qwindowswindow.h"
#include "qwindowsmousehandler.h" #include "qwindowsmousehandler.h"
#include "qwindowscursor.h" #include "qwindowscursor.h"
#include "qwindowskeymapper.h"
#include <QtGui/qevent.h> #include <QtGui/qevent.h>
#include <QtGui/qpixmap.h> #include <QtGui/qpixmap.h>
@ -205,6 +206,9 @@ static inline Qt::MouseButtons toQtMouseButtons(DWORD keyState)
return buttons; return buttons;
} }
static Qt::KeyboardModifiers lastModifiers = Qt::NoModifier;
static Qt::MouseButtons lastButtons = Qt::NoButton;
/*! /*!
\class QWindowsOleDropSource \class QWindowsOleDropSource
\brief Implementation of IDropSource \brief Implementation of IDropSource
@ -403,7 +407,7 @@ QWindowsOleDropSource::QueryContinueDrag(BOOL fEscapePressed, DWORD grfKeyState)
case DRAGDROP_S_DROP: case DRAGDROP_S_DROP:
case DRAGDROP_S_CANCEL: case DRAGDROP_S_CANCEL:
if (!m_windowUnderMouse.isNull() && m_mode != TouchDrag && fEscapePressed == FALSE if (!m_windowUnderMouse.isNull() && m_mode != TouchDrag && fEscapePressed == FALSE
&& buttons != QGuiApplicationPrivate::mouse_buttons) { && buttons != lastButtons) {
// QTBUG 66447: Synthesize a mouse release to the window under mouse at // QTBUG 66447: Synthesize a mouse release to the window under mouse at
// start of the DnD operation as Windows does not send any. // start of the DnD operation as Windows does not send any.
const QPoint globalPos = QWindowsCursor::mousePosition(); const QPoint globalPos = QWindowsCursor::mousePosition();
@ -503,13 +507,14 @@ void QWindowsOleDropTarget::handleDrag(QWindow *window, DWORD grfKeyState,
QWindowsDrag *windowsDrag = QWindowsDrag::instance(); QWindowsDrag *windowsDrag = QWindowsDrag::instance();
const Qt::DropActions actions = translateToQDragDropActions(*pdwEffect); const Qt::DropActions actions = translateToQDragDropActions(*pdwEffect);
const Qt::KeyboardModifiers keyboardModifiers = toQtKeyboardModifiers(grfKeyState);
const Qt::MouseButtons mouseButtons = toQtMouseButtons(grfKeyState); lastModifiers = toQtKeyboardModifiers(grfKeyState);
lastButtons = toQtMouseButtons(grfKeyState);
const QPlatformDragQtResponse response = const QPlatformDragQtResponse response =
QWindowSystemInterface::handleDrag(window, windowsDrag->dropData(), QWindowSystemInterface::handleDrag(window, windowsDrag->dropData(),
m_lastPoint, actions, m_lastPoint, actions,
mouseButtons, keyboardModifiers); lastButtons, lastModifiers);
m_answerRect = response.answerRect(); m_answerRect = response.answerRect();
const Qt::DropAction action = response.acceptedAction(); const Qt::DropAction action = response.acceptedAction();
@ -521,7 +526,7 @@ void QWindowsOleDropTarget::handleDrag(QWindow *window, DWORD grfKeyState,
*pdwEffect = m_chosenEffect; *pdwEffect = m_chosenEffect;
qCDebug(lcQpaMime) << __FUNCTION__ << m_window qCDebug(lcQpaMime) << __FUNCTION__ << m_window
<< windowsDrag->dropData() << " supported actions=" << actions << windowsDrag->dropData() << " supported actions=" << actions
<< " mods=" << keyboardModifiers << " mouse=" << mouseButtons << " mods=" << lastModifiers << " mouse=" << lastButtons
<< " accepted: " << response.isAccepted() << action << " accepted: " << response.isAccepted() << action
<< m_answerRect << " effect" << *pdwEffect; << m_answerRect << " effect" << *pdwEffect;
} }
@ -572,6 +577,9 @@ QWindowsOleDropTarget::DragLeave()
qCDebug(lcQpaMime) << __FUNCTION__ << ' ' << m_window; qCDebug(lcQpaMime) << __FUNCTION__ << ' ' << m_window;
lastModifiers = QWindowsKeyMapper::queryKeyboardModifiers();
lastButtons = QWindowsMouseHandler::queryMouseButtons();
QWindowSystemInterface::handleDrag(m_window, nullptr, QPoint(), Qt::IgnoreAction, QWindowSystemInterface::handleDrag(m_window, nullptr, QPoint(), Qt::IgnoreAction,
Qt::NoButton, Qt::NoModifier); Qt::NoButton, Qt::NoModifier);
@ -598,12 +606,15 @@ QWindowsOleDropTarget::Drop(LPDATAOBJECT pDataObj, DWORD grfKeyState,
QWindowsDrag *windowsDrag = QWindowsDrag::instance(); QWindowsDrag *windowsDrag = QWindowsDrag::instance();
lastModifiers = toQtKeyboardModifiers(grfKeyState);
lastButtons = toQtMouseButtons(grfKeyState);
const QPlatformDropQtResponse response = const QPlatformDropQtResponse response =
QWindowSystemInterface::handleDrop(m_window, windowsDrag->dropData(), QWindowSystemInterface::handleDrop(m_window, windowsDrag->dropData(),
m_lastPoint, m_lastPoint,
translateToQDragDropActions(*pdwEffect), translateToQDragDropActions(*pdwEffect),
toQtMouseButtons(grfKeyState), lastButtons,
toQtKeyboardModifiers(grfKeyState)); lastModifiers);
m_lastKeyState = grfKeyState; m_lastKeyState = grfKeyState;

View File

@ -185,11 +185,13 @@ QIconEngine * QXdgDesktopPortalTheme::createIconEngine(const QString &iconName)
return d->baseTheme->createIconEngine(iconName); return d->baseTheme->createIconEngine(iconName);
} }
#if QT_CONFIG(shortcut)
QList<QKeySequence> QXdgDesktopPortalTheme::keyBindings(QKeySequence::StandardKey key) const QList<QKeySequence> QXdgDesktopPortalTheme::keyBindings(QKeySequence::StandardKey key) const
{ {
Q_D(const QXdgDesktopPortalTheme); Q_D(const QXdgDesktopPortalTheme);
return d->baseTheme->keyBindings(key); return d->baseTheme->keyBindings(key);
} }
#endif
QString QXdgDesktopPortalTheme::standardButtonText(int button) const QString QXdgDesktopPortalTheme::standardButtonText(int button) const
{ {

View File

@ -76,7 +76,9 @@ public:
QIconEngine *createIconEngine(const QString &iconName) const override; QIconEngine *createIconEngine(const QString &iconName) const override;
#if QT_CONFIG(shortcut)
QList<QKeySequence> keyBindings(QKeySequence::StandardKey key) const override; QList<QKeySequence> keyBindings(QKeySequence::StandardKey key) const override;
#endif
QString standardButtonText(int button) const override; QString standardButtonText(int button) const override;

View File

@ -2311,7 +2311,7 @@ void QTest::addColumnInternal(int id, const char *name)
*/ */
QTestData &QTest::newRow(const char *dataTag) QTestData &QTest::newRow(const char *dataTag)
{ {
QTEST_ASSERT_X(dataTag, "QTest::newRow()", "Data tag can not be null"); QTEST_ASSERT_X(dataTag, "QTest::newRow()", "Data tag cannot be null");
QTestTable *tbl = QTestTable::currentTestTable(); QTestTable *tbl = QTestTable::currentTestTable();
QTEST_ASSERT_X(tbl, "QTest::newRow()", "Cannot add testdata outside of a _data slot."); QTEST_ASSERT_X(tbl, "QTest::newRow()", "Cannot add testdata outside of a _data slot.");
QTEST_ASSERT_X(tbl->elementCount(), "QTest::newRow()", "Must add columns before attempting to add rows."); QTEST_ASSERT_X(tbl->elementCount(), "QTest::newRow()", "Must add columns before attempting to add rows.");

View File

@ -166,6 +166,7 @@ namespace QTest
Q_DECL_UNUSED inline static void keyPress(QWindow *window, Qt::Key key, Qt::KeyboardModifiers modifier = Qt::NoModifier, int delay=-1) Q_DECL_UNUSED inline static void keyPress(QWindow *window, Qt::Key key, Qt::KeyboardModifiers modifier = Qt::NoModifier, int delay=-1)
{ keyEvent(Press, window, key, modifier, delay); } { keyEvent(Press, window, key, modifier, delay); }
#if QT_CONFIG(shortcut)
Q_DECL_UNUSED inline static void keySequence(QWindow *window, const QKeySequence &keySequence) Q_DECL_UNUSED inline static void keySequence(QWindow *window, const QKeySequence &keySequence)
{ {
for (int i = 0; i < keySequence.count(); ++i) { for (int i = 0; i < keySequence.count(); ++i) {
@ -174,6 +175,7 @@ namespace QTest
keyClick(window, key, modifiers); keyClick(window, key, modifiers);
} }
} }
#endif
#ifdef QT_WIDGETS_LIB #ifdef QT_WIDGETS_LIB
static void simulateEvent(QWidget *widget, bool press, int code, static void simulateEvent(QWidget *widget, bool press, int code,
@ -305,6 +307,7 @@ namespace QTest
inline static void keyClick(QWidget *widget, Qt::Key key, Qt::KeyboardModifiers modifier = Qt::NoModifier, int delay=-1) inline static void keyClick(QWidget *widget, Qt::Key key, Qt::KeyboardModifiers modifier = Qt::NoModifier, int delay=-1)
{ keyEvent(Click, widget, key, modifier, delay); } { keyEvent(Click, widget, key, modifier, delay); }
#if QT_CONFIG(shortcut)
inline static void keySequence(QWidget *widget, const QKeySequence &keySequence) inline static void keySequence(QWidget *widget, const QKeySequence &keySequence)
{ {
for (int i = 0; i < keySequence.count(); ++i) { for (int i = 0; i < keySequence.count(); ++i) {
@ -313,6 +316,7 @@ namespace QTest
keyClick(widget, key, modifiers); keyClick(widget, key, modifiers);
} }
} }
#endif
#endif // QT_WIDGETS_LIB #endif // QT_WIDGETS_LIB

View File

@ -1923,7 +1923,7 @@ void QGraphicsScene::setBspTreeDepth(int depth)
QGraphicsSceneBspTreeIndex *bspTree = qobject_cast<QGraphicsSceneBspTreeIndex *>(d->index); QGraphicsSceneBspTreeIndex *bspTree = qobject_cast<QGraphicsSceneBspTreeIndex *>(d->index);
if (!bspTree) { if (!bspTree) {
qWarning("QGraphicsScene::setBspTreeDepth: can not apply if indexing method is not BSP"); qWarning("QGraphicsScene::setBspTreeDepth: cannot apply if indexing method is not BSP");
return; return;
} }
bspTree->setBspTreeDepth(depth); bspTree->setBspTreeDepth(depth);

View File

@ -688,7 +688,7 @@ QLineEdit *QAbstractSpinBox::lineEdit() const
\fn void QAbstractSpinBox::setLineEdit(QLineEdit *lineEdit) \fn void QAbstractSpinBox::setLineEdit(QLineEdit *lineEdit)
Sets the line edit of the spinbox to be \a lineEdit instead of the Sets the line edit of the spinbox to be \a lineEdit instead of the
current line edit widget. \a lineEdit can not be 0. current line edit widget. \a lineEdit cannot be 0.
QAbstractSpinBox takes ownership of the new lineEdit QAbstractSpinBox takes ownership of the new lineEdit

View File

@ -5183,7 +5183,7 @@ QDomNodePrivate* QDomTextPrivate::cloneNode(bool deep)
QDomTextPrivate* QDomTextPrivate::splitText(int offset) QDomTextPrivate* QDomTextPrivate::splitText(int offset)
{ {
if (!parent()) { if (!parent()) {
qWarning("QDomText::splitText The node has no parent. So I can not split"); qWarning("QDomText::splitText The node has no parent. So I cannot split");
return 0; return 0;
} }

View File

@ -257,7 +257,7 @@ def findEntry(base, path, draft=None, attribute=None):
if result: if result:
return result return result
if not aliaspath: if not aliaspath:
raise Error("findEntry: fatal error: %s: can not find key %s" % (filename, path)) raise Error("findEntry: fatal error: %s: cannot find key %s" % (filename, path))
path = aliaspath path = aliaspath
return result return result