mirror of https://github.com/qt/qtbase.git
Merge remote-tracking branch 'origin/5.9' into 5.10
Conflicts: src/plugins/platforms/ios/quiview.mm Change-Id: I88384c70047391c75d9ff166c8d9881ff6751dbf
This commit is contained in:
commit
53b141dceb
|
@ -1,10 +1,14 @@
|
|||
#
|
||||
# qmake configuration for Microsoft Visual Studio C/C++ Compiler
|
||||
# This mkspec is used by the win32-msvc and win32-clang-msvc specs
|
||||
# This file is used as a basis for the following compilers:
|
||||
#
|
||||
|
||||
# - Microsoft C/C++ Optimizing Compiler (all desktop versions)
|
||||
# - Intel C++ Compiler on Windows
|
||||
# - Clang-cl
|
||||
#
|
||||
# Baseline:
|
||||
#
|
||||
# - Visual Studio 2005 (8.0), VC++ 14.0
|
||||
#
|
||||
# Baseline: Visual Studio 2005 (8.0), VC++ 14.0
|
||||
# Version-specific settings go in msvc-version.conf (loaded by default_pre)
|
||||
#
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
#
|
||||
# qmake configuration for win32-g++
|
||||
#
|
||||
# Written for MinGW / gcc 4.6 or higher
|
||||
# Written for MinGW-w64 / gcc 5.3 or higher
|
||||
#
|
||||
# Cross compile example for i686-w64-mingw32-g++:
|
||||
# configure -xplatform win32-g++ -device-option CROSS_COMPILE=i686-w64-mingw32-
|
||||
|
|
|
@ -1,16 +1,17 @@
|
|||
#
|
||||
# qmake configuration for win32-icc
|
||||
#
|
||||
# Written for Intel C++
|
||||
# Written for Intel C++ Compiler on Windows / icl 16.0 or higher
|
||||
#
|
||||
|
||||
# Use the Visual Studio configuration
|
||||
# Use the Microsoft (R) C/C++ Optimizing Compiler configuration,
|
||||
# since ICC on Windows pretends to be MSVC
|
||||
|
||||
include(../common/msvc-desktop.conf)
|
||||
|
||||
# Now override with the Intel compiler settings
|
||||
# modifications to msvc-desktop.conf
|
||||
|
||||
QMAKE_COMPILER += intel_icl # icl pretends to be msvc
|
||||
QMAKE_COMPILER += intel_icl
|
||||
|
||||
QMAKE_CC = icl
|
||||
QMAKE_CFLAGS = -nologo -Zm200 /Qprec /Qwd1744,1738,809,3373
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
#
|
||||
# qmake configuration for win32-msvc
|
||||
#
|
||||
# Written for Microsoft Visual C++ (all desktop versions)
|
||||
# Written for Microsoft C/C++ Optimizing Compiler (all desktop versions)
|
||||
#
|
||||
|
||||
include(../common/msvc-desktop.conf)
|
||||
|
|
|
@ -2645,7 +2645,7 @@ bool Renderer11::getShareHandleSupport() const
|
|||
|
||||
if (deviceType == d3d11::ANGLE_D3D11_DEVICE_TYPE_WARP)
|
||||
{
|
||||
#if !defined(ANGLE_ENABLE_WINDOWS_STORE) && !defined(__GNUC__)
|
||||
#ifndef ANGLE_ENABLE_WINDOWS_STORE
|
||||
if (!IsWindows8OrGreater())
|
||||
{
|
||||
// WARP on Windows 7 doesn't support shared handles
|
||||
|
|
|
@ -500,15 +500,16 @@ public class QtNative
|
|||
}
|
||||
}
|
||||
|
||||
static public void sendGenericMotionEvent(MotionEvent event, int id)
|
||||
static public boolean sendGenericMotionEvent(MotionEvent event, int id)
|
||||
{
|
||||
if (event.getActionMasked() != MotionEvent.ACTION_SCROLL
|
||||
|| (event.getSource() & InputDevice.SOURCE_CLASS_POINTER) != InputDevice.SOURCE_CLASS_POINTER) {
|
||||
return;
|
||||
return false;
|
||||
}
|
||||
|
||||
mouseWheel(id, (int) event.getX(), (int) event.getY(),
|
||||
event.getAxisValue(MotionEvent.AXIS_HSCROLL), event.getAxisValue(MotionEvent.AXIS_VSCROLL));
|
||||
return true;
|
||||
}
|
||||
|
||||
public static Context getContext() {
|
||||
|
|
|
@ -116,7 +116,6 @@ public class QtSurface extends SurfaceView implements SurfaceHolder.Callback
|
|||
@Override
|
||||
public boolean onGenericMotionEvent(MotionEvent event)
|
||||
{
|
||||
QtNative.sendGenericMotionEvent(event, getId());
|
||||
return true;
|
||||
return QtNative.sendGenericMotionEvent(event, getId());
|
||||
}
|
||||
}
|
||||
|
|
|
@ -405,15 +405,6 @@ index ea84783..62badcc 100644
|
|||
|
||||
if (mD3d11Module)
|
||||
{
|
||||
@@ -2618,7 +2642,7 @@ bool Renderer11::getShareHandleSupport() const
|
||||
|
||||
if (deviceType == d3d11::ANGLE_D3D11_DEVICE_TYPE_WARP)
|
||||
{
|
||||
-#ifndef ANGLE_ENABLE_WINDOWS_STORE
|
||||
+#if !defined(ANGLE_ENABLE_WINDOWS_STORE) && !defined(__GNUC__)
|
||||
if (!IsWindows8OrGreater())
|
||||
{
|
||||
// WARP on Windows 7 doesn't support shared handles
|
||||
diff --git a/src/3rdparty/angle/src/libANGLE/renderer/d3d/d3d11/Renderer11.h b/src/3rdparty/angle/src/libANGLE/renderer/d3d/d3d11/Renderer11.h
|
||||
index 62e9816..b4e7761 100644
|
||||
--- a/src/3rdparty/angle/src/libANGLE/renderer/d3d/d3d11/Renderer11.h
|
||||
|
|
|
@ -810,6 +810,18 @@ void Widget::splitCaseSensitiveFunction()
|
|||
QStringList list2 = str.split(',', QString::SkipEmptyParts);
|
||||
// list2: [ "a", "b", "c" ]
|
||||
//! [62]
|
||||
|
||||
//! [62-empty]
|
||||
QString str = "abc";
|
||||
auto parts = str.split("");
|
||||
// parts: {"", "a", "b", "c", ""}
|
||||
//! [62-empty]
|
||||
|
||||
//! [62-slashes]
|
||||
QString str = "/a/b/c/";
|
||||
auto parts = str.split('/');
|
||||
// parts: {"", "a", "b", "c", ""}
|
||||
//! [62-slashes]
|
||||
}
|
||||
|
||||
void Widget::sprintfFunction()
|
||||
|
|
|
@ -7246,6 +7246,16 @@ static ResultList splitString(const StringSource &source, const QChar *sep,
|
|||
|
||||
\snippet qstring/main.cpp 62
|
||||
|
||||
If \a sep is empty, split() returns an empty string, followed
|
||||
by each of the string's characters, followed by another empty string:
|
||||
|
||||
\snippet qstring/main.cpp 62-empty
|
||||
|
||||
To understand this behavior, recall that the empty string matches
|
||||
everywhere, so the above is qualitatively the same as:
|
||||
|
||||
\snippet qstring/main.cpp 62-slashes
|
||||
|
||||
\sa QStringList::join(), section()
|
||||
*/
|
||||
QStringList QString::split(const QString &sep, SplitBehavior behavior, Qt::CaseSensitivity cs) const
|
||||
|
@ -7255,15 +7265,10 @@ QStringList QString::split(const QString &sep, SplitBehavior behavior, Qt::CaseS
|
|||
|
||||
/*!
|
||||
Splits the string into substring references wherever \a sep occurs, and
|
||||
returns the list of those strings. If \a sep does not match
|
||||
anywhere in the string, splitRef() returns a single-element vector
|
||||
containing this string reference.
|
||||
returns the list of those strings.
|
||||
|
||||
\a cs specifies whether \a sep should be matched case
|
||||
sensitively or case insensitively.
|
||||
|
||||
If \a behavior is QString::SkipEmptyParts, empty entries don't
|
||||
appear in the result. By default, empty entries are kept.
|
||||
See QString::split() for how \a sep, \a behavior and \a cs interact to form
|
||||
the result.
|
||||
|
||||
\note All references are valid as long this string is alive. Destroying this
|
||||
string will cause all references be dangling pointers.
|
||||
|
@ -7294,15 +7299,10 @@ QVector<QStringRef> QString::splitRef(QChar sep, SplitBehavior behavior, Qt::Cas
|
|||
|
||||
/*!
|
||||
Splits the string into substrings references wherever \a sep occurs, and
|
||||
returns the list of those strings. If \a sep does not match
|
||||
anywhere in the string, split() returns a single-element vector
|
||||
containing this string reference.
|
||||
returns the list of those strings.
|
||||
|
||||
\a cs specifies whether \a sep should be matched case
|
||||
sensitively or case insensitively.
|
||||
|
||||
If \a behavior is QString::SkipEmptyParts, empty entries don't
|
||||
appear in the result. By default, empty entries are kept.
|
||||
See QString::split() for how \a sep, \a behavior and \a cs interact to form
|
||||
the result.
|
||||
|
||||
\note All references are valid as long this string is alive. Destroying this
|
||||
string will cause all references be dangling pointers.
|
||||
|
|
|
@ -164,9 +164,10 @@ public:
|
|||
const const_iterator ce = this->cend(), cit = std::find(this->cbegin(), ce, t);
|
||||
if (cit == ce)
|
||||
return 0;
|
||||
// next operation detaches, so ce, cit may become invalidated:
|
||||
// next operation detaches, so ce, cit, t may become invalidated:
|
||||
const T tCopy = t;
|
||||
const int firstFoundIdx = std::distance(this->cbegin(), cit);
|
||||
const iterator e = end(), it = std::remove(begin() + firstFoundIdx, e, t);
|
||||
const iterator e = end(), it = std::remove(begin() + firstFoundIdx, e, tCopy);
|
||||
const int result = std::distance(it, e);
|
||||
erase(it, e);
|
||||
return result;
|
||||
|
|
|
@ -1193,6 +1193,7 @@
|
|||
"label": "XCB",
|
||||
"section": "Platform plugins",
|
||||
"autoDetect": "!config.darwin",
|
||||
"enable": "input.xcb == 'system' || input.xcb == 'qt'",
|
||||
"condition": "libs.xcb",
|
||||
"output": [ "privateFeature" ]
|
||||
},
|
||||
|
|
|
@ -177,8 +177,8 @@ void drawTriangle(qint32 *bits, int width, int height, const QPoint *center,
|
|||
const int y2 = clip == Clip ? qBound(0, v2->y() >> 8, height) : v2->y() >> 8;
|
||||
const int yC = clip == Clip ? qBound(0, center->y() >> 8, height) : center->y() >> 8;
|
||||
|
||||
const int v1Frac = clip == Clip ? (y1 << 8) + 0xff - v1->y() : ~v2->y() & 0xff;
|
||||
const int v2Frac = clip == Clip ? (y2 << 8) + 0xff - v2->y() : ~v1->y() & 0xff;
|
||||
const int v1Frac = clip == Clip ? (y1 << 8) + 0xff - v1->y() : ~v1->y() & 0xff;
|
||||
const int v2Frac = clip == Clip ? (y2 << 8) + 0xff - v2->y() : ~v2->y() & 0xff;
|
||||
const int centerFrac = clip == Clip ? (yC << 8) + 0xff - center->y() : ~center->y() & 0xff;
|
||||
|
||||
int dx1 = 0, x1 = 0, dx2 = 0, x2 = 0;
|
||||
|
|
|
@ -75,7 +75,7 @@ static void handleApplicationStateChanged(UIApplicationState uiApplicationState)
|
|||
{
|
||||
Qt::ApplicationState state = qtApplicationState(uiApplicationState);
|
||||
qCDebug(lcQpaApplication) << "moved to" << state;
|
||||
QWindowSystemInterface::handleApplicationStateChanged<QWindowSystemInterface::SynchronousDelivery>(state);
|
||||
QWindowSystemInterface::handleApplicationStateChanged(state);
|
||||
}
|
||||
|
||||
QT_BEGIN_NAMESPACE
|
||||
|
|
|
@ -294,7 +294,7 @@ static bool rootLevelRunLoopIntegration()
|
|||
{
|
||||
[[NSNotificationCenter defaultCenter]
|
||||
addObserver:self
|
||||
selector:@selector(applicationDidFinishLaunching)
|
||||
selector:@selector(applicationDidFinishLaunching:)
|
||||
name:UIApplicationDidFinishLaunchingNotification
|
||||
object:nil];
|
||||
|
||||
|
@ -320,8 +320,10 @@ static bool rootLevelRunLoopIntegration()
|
|||
# error "Unknown processor family"
|
||||
#endif
|
||||
|
||||
+ (void)applicationDidFinishLaunching
|
||||
+ (void)applicationDidFinishLaunching:(NSNotification *)notification
|
||||
{
|
||||
qCDebug(lcQpaApplication) << "Application launched with options" << notification.userInfo;
|
||||
|
||||
if (!isQtApplication())
|
||||
return;
|
||||
|
||||
|
@ -329,7 +331,7 @@ static bool rootLevelRunLoopIntegration()
|
|||
// We schedule the main-redirection for the next run-loop pass, so that we
|
||||
// can return from this function and let UIApplicationMain finish its job.
|
||||
// This results in running Qt's application eventloop as a nested runloop.
|
||||
qEventDispatcherDebug() << "Scheduling main() on next run-loop pass";
|
||||
qCDebug(lcQpaApplication) << "Scheduling main() on next run-loop pass";
|
||||
CFRunLoopTimerRef userMainTimer = CFRunLoopTimerCreateWithHandler(kCFAllocatorDefault,
|
||||
CFAbsoluteTimeGetCurrent(), 0, 0, 0, ^(CFRunLoopTimerRef) { user_main_trampoline(); });
|
||||
CFRunLoopAddTimer(CFRunLoopGetMain(), userMainTimer, kCFRunLoopCommonModes);
|
||||
|
@ -339,7 +341,7 @@ static bool rootLevelRunLoopIntegration()
|
|||
|
||||
switch (setjmp(processEventEnterJumpPoint)) {
|
||||
case kJumpPointSetSuccessfully:
|
||||
qEventDispatcherDebug() << "Running main() on separate stack"; qIndent();
|
||||
qCDebug(lcQpaApplication) << "Running main() on separate stack"; qIndent();
|
||||
|
||||
// Redirect the stack pointer to the start of the reserved stack. This ensures
|
||||
// that when we longjmp out of the event dispatcher and continue execution, the
|
||||
|
@ -358,7 +360,7 @@ static bool rootLevelRunLoopIntegration()
|
|||
case kJumpedFromEventDispatcherProcessEvents:
|
||||
// We've returned from the longjmp in the event dispatcher,
|
||||
// and the stack has been restored to its old self.
|
||||
qUnIndent(); qEventDispatcherDebug() << "Returned from processEvents";
|
||||
qUnIndent(); qCDebug(lcQpaApplication) << "Returned from processEvents";
|
||||
|
||||
if (Q_UNLIKELY(debugStackUsage))
|
||||
userMainStack.printUsage();
|
||||
|
@ -422,6 +424,8 @@ QIOSEventDispatcher::QIOSEventDispatcher(QObject *parent)
|
|||
, m_processEventLevel(0)
|
||||
, m_runLoopExitObserver(this, &QIOSEventDispatcher::handleRunLoopExit, kCFRunLoopExit)
|
||||
{
|
||||
// We want all delivery of events from the system to be handled synchronously
|
||||
QWindowSystemInterface::setSynchronousWindowSystemEvents(true);
|
||||
}
|
||||
|
||||
bool __attribute__((returns_twice)) QIOSEventDispatcher::processEvents(QEventLoop::ProcessEventsFlags flags)
|
||||
|
|
|
@ -180,12 +180,12 @@ QT_BEGIN_NAMESPACE
|
|||
|
||||
/*!
|
||||
Returns the model identifier of the device.
|
||||
|
||||
When running under the simulator, the identifier will not
|
||||
match the simulated device, but will be x86_64 or i386.
|
||||
*/
|
||||
static QString deviceModelIdentifier()
|
||||
{
|
||||
#if TARGET_OS_SIMULATOR
|
||||
return QString::fromLocal8Bit(qgetenv("SIMULATOR_MODEL_IDENTIFIER"));
|
||||
#else
|
||||
static const char key[] = "hw.machine";
|
||||
|
||||
size_t size;
|
||||
|
@ -195,6 +195,7 @@ static QString deviceModelIdentifier()
|
|||
sysctlbyname(key, &value, &size, NULL, 0);
|
||||
|
||||
return QString::fromLatin1(value);
|
||||
#endif
|
||||
}
|
||||
|
||||
QIOSScreen::QIOSScreen(UIScreen *screen)
|
||||
|
@ -203,25 +204,30 @@ QIOSScreen::QIOSScreen(UIScreen *screen)
|
|||
, m_uiWindow(0)
|
||||
, m_orientationListener(0)
|
||||
{
|
||||
if (screen == [UIScreen mainScreen]) {
|
||||
QString deviceIdentifier = deviceModelIdentifier();
|
||||
QString deviceIdentifier = deviceModelIdentifier();
|
||||
|
||||
if (screen == [UIScreen mainScreen] && !deviceIdentifier.startsWith("AppleTV")) {
|
||||
// Based on https://en.wikipedia.org/wiki/List_of_iOS_devices#Display
|
||||
|
||||
// iPhone (1st gen), 3G, 3GS, and iPod Touch (1st–3rd gen) are 18-bit devices
|
||||
if (deviceIdentifier.contains(QRegularExpression("^(iPhone1,[12]|iPhone2,1|iPod[1-3],1)$")))
|
||||
m_depth = 18;
|
||||
else
|
||||
m_depth = 24;
|
||||
static QRegularExpression lowBitDepthDevices("^(iPhone1,[12]|iPhone2,1|iPod[1-3],1)$");
|
||||
m_depth = deviceIdentifier.contains(lowBitDepthDevices) ? 18 : 24;
|
||||
|
||||
if (deviceIdentifier.contains(QRegularExpression("^iPhone(7,1|8,2|9,2|9,4)$"))) {
|
||||
// iPhone Plus models
|
||||
static QRegularExpression iPhoneXModels("^iPhone(10,[36])$");
|
||||
static QRegularExpression iPhonePlusModels("^iPhone(7,1|8,2|9,[24]|10,[25])$");
|
||||
static QRegularExpression iPadMiniModels("^iPad(2,[567]|4,[4-9]|5,[12])$");
|
||||
|
||||
if (deviceIdentifier.contains(iPhoneXModels)) {
|
||||
m_physicalDpi = 458;
|
||||
} else if (deviceIdentifier.contains(iPhonePlusModels)) {
|
||||
m_physicalDpi = 401;
|
||||
} else if (deviceIdentifier.contains(QRegularExpression("^iPad(1,1|2,[1-4]|3,[1-6]|4,[1-3]|5,[3-4]|6,[7-8])$"))) {
|
||||
// All iPads except the iPad Mini series
|
||||
m_physicalDpi = 132 * devicePixelRatio();
|
||||
} else if (deviceIdentifier.startsWith("iPad")) {
|
||||
if (deviceIdentifier.contains(iPadMiniModels))
|
||||
m_physicalDpi = 163 * devicePixelRatio();
|
||||
else
|
||||
m_physicalDpi = 132 * devicePixelRatio();
|
||||
} else {
|
||||
// All non-Plus iPhones, and iPad Minis
|
||||
// All normal iPhones, and iPods
|
||||
m_physicalDpi = 163 * devicePixelRatio();
|
||||
}
|
||||
} else {
|
||||
|
|
|
@ -377,7 +377,6 @@
|
|||
QScopedValueRollback<BOOL> rollback(m_inSendEventToFocusObject, true);
|
||||
QWindowSystemInterface::handleKeyEvent(qApp->focusWindow(), QEvent::KeyPress, key, modifiers);
|
||||
QWindowSystemInterface::handleKeyEvent(qApp->focusWindow(), QEvent::KeyRelease, key, modifiers);
|
||||
QWindowSystemInterface::flushWindowSystemEvents();
|
||||
}
|
||||
|
||||
#ifndef QT_NO_SHORTCUT
|
||||
|
|
|
@ -161,7 +161,7 @@
|
|||
QRect lastReportedGeometry = qt_window_private(window)->geometry;
|
||||
QRect currentGeometry = QRectF::fromCGRect(self.frame).toRect();
|
||||
qCDebug(lcQpaWindow) << m_qioswindow->window() << "new geometry is" << currentGeometry;
|
||||
QWindowSystemInterface::handleGeometryChange<QWindowSystemInterface::SynchronousDelivery>(window, currentGeometry);
|
||||
QWindowSystemInterface::handleGeometryChange(window, currentGeometry);
|
||||
|
||||
if (currentGeometry.size() != lastReportedGeometry.size()) {
|
||||
// Trigger expose event on resize
|
||||
|
@ -194,7 +194,7 @@
|
|||
}
|
||||
|
||||
qCDebug(lcQpaWindow) << m_qioswindow->window() << region << "isExposed" << m_qioswindow->isExposed();
|
||||
QWindowSystemInterface::handleExposeEvent<QWindowSystemInterface::SynchronousDelivery>(m_qioswindow->window(), region);
|
||||
QWindowSystemInterface::handleExposeEvent(m_qioswindow->window(), region);
|
||||
}
|
||||
|
||||
// -------------------------------------------------------------------------
|
||||
|
@ -225,7 +225,7 @@
|
|||
}
|
||||
|
||||
if (qGuiApp->focusWindow() != m_qioswindow->window())
|
||||
QWindowSystemInterface::handleWindowActivated<QWindowSystemInterface::SynchronousDelivery>(m_qioswindow->window());
|
||||
QWindowSystemInterface::handleWindowActivated(m_qioswindow->window());
|
||||
else
|
||||
qImDebug() << m_qioswindow->window() << "already active, not sending window activation";
|
||||
|
||||
|
@ -263,7 +263,7 @@
|
|||
|
||||
UIResponder *newResponder = FirstResponderCandidate::currentCandidate();
|
||||
if ([self responderShouldTriggerWindowDeactivation:newResponder])
|
||||
QWindowSystemInterface::handleWindowActivated<QWindowSystemInterface::SynchronousDelivery>(0);
|
||||
QWindowSystemInterface::handleWindowActivated(0);
|
||||
|
||||
return YES;
|
||||
}
|
||||
|
@ -354,7 +354,7 @@
|
|||
- (void)sendTouchEventWithTimestamp:(ulong)timeStamp
|
||||
{
|
||||
QIOSIntegration *iosIntegration = QIOSIntegration::instance();
|
||||
QWindowSystemInterface::handleTouchEvent<QWindowSystemInterface::SynchronousDelivery>(m_qioswindow->window(), timeStamp, iosIntegration->touchDevice(), m_activeTouches.values());
|
||||
QWindowSystemInterface::handleTouchEvent(m_qioswindow->window(), timeStamp, iosIntegration->touchDevice(), m_activeTouches.values());
|
||||
}
|
||||
|
||||
- (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event
|
||||
|
@ -433,7 +433,7 @@
|
|||
NSTimeInterval timestamp = event ? event.timestamp : [[NSProcessInfo processInfo] systemUptime];
|
||||
|
||||
QIOSIntegration *iosIntegration = static_cast<QIOSIntegration *>(QGuiApplicationPrivate::platformIntegration());
|
||||
QWindowSystemInterface::handleTouchCancelEvent<QWindowSystemInterface::SynchronousDelivery>(m_qioswindow->window(), ulong(timestamp * 1000), iosIntegration->touchDevice());
|
||||
QWindowSystemInterface::handleTouchCancelEvent(m_qioswindow->window(), ulong(timestamp * 1000), iosIntegration->touchDevice());
|
||||
}
|
||||
|
||||
- (int)mapPressTypeToKey:(UIPress*)press
|
||||
|
@ -461,7 +461,7 @@
|
|||
int key = [self mapPressTypeToKey:press];
|
||||
if (key == Qt::Key_unknown)
|
||||
continue;
|
||||
if (QWindowSystemInterface::handleKeyEvent<QWindowSystemInterface::SynchronousDelivery>(m_qioswindow->window(), type, key, Qt::NoModifier))
|
||||
if (QWindowSystemInterface::handleKeyEvent(m_qioswindow->window(), type, key, Qt::NoModifier))
|
||||
handled = true;
|
||||
}
|
||||
|
||||
|
|
|
@ -165,6 +165,9 @@ void QXcbDrag::init()
|
|||
|
||||
QXcbCursor::queryPointer(connection(), ¤t_virtual_desktop, 0);
|
||||
drag_types.clear();
|
||||
|
||||
dropped = false;
|
||||
canceled = false;
|
||||
}
|
||||
|
||||
bool QXcbDrag::eventFilter(QObject *o, QEvent *e)
|
||||
|
@ -215,6 +218,10 @@ void QXcbDrag::startDrag()
|
|||
void QXcbDrag::endDrag()
|
||||
{
|
||||
QBasicDrag::endDrag();
|
||||
if (!dropped && !canceled && canDrop()) {
|
||||
// Set executed drop action when dropping outside application.
|
||||
setExecutedDropAction(accepted_drop_action);
|
||||
}
|
||||
initiatorWindow.clear();
|
||||
}
|
||||
|
||||
|
@ -989,6 +996,8 @@ void QXcbDrag::handleDrop(QPlatformWindow *, const xcb_client_message_event_t *e
|
|||
|
||||
// reset
|
||||
target_time = XCB_CURRENT_TIME;
|
||||
|
||||
dropped = true;
|
||||
}
|
||||
|
||||
|
||||
|
@ -1087,6 +1096,8 @@ void QXcbDrag::cancel()
|
|||
|
||||
// remove canceled object
|
||||
currentDrag()->deleteLater();
|
||||
|
||||
canceled = true;
|
||||
}
|
||||
|
||||
// find an ancestor with XdndAware on it
|
||||
|
|
|
@ -135,6 +135,10 @@ private:
|
|||
QRect source_sameanswer;
|
||||
bool waiting_for_status;
|
||||
|
||||
// helpers for setting executed drop action outside application
|
||||
bool dropped;
|
||||
bool canceled;
|
||||
|
||||
// top-level window we sent position to last.
|
||||
xcb_window_t current_target;
|
||||
// window to send events to (always valid if current_target)
|
||||
|
|
|
@ -7,5 +7,7 @@ QMAKE_USE += db2
|
|||
|
||||
OTHER_FILES += db2.json
|
||||
|
||||
equals(QT_ARCH, x86_64): DEFINES += ODBC64
|
||||
|
||||
PLUGIN_CLASS_NAME = QDB2DriverPlugin
|
||||
include(../qsqldriverbase.pri)
|
||||
|
|
|
@ -272,7 +272,7 @@ static QSqlField qMakeFieldInfo(const QDB2ResultPrivate* d, int i)
|
|||
{
|
||||
SQLSMALLINT colNameLen;
|
||||
SQLSMALLINT colType;
|
||||
SQLUINTEGER colSize;
|
||||
SQLULEN colSize;
|
||||
SQLSMALLINT colScale;
|
||||
SQLSMALLINT nullable;
|
||||
SQLRETURN r = SQL_ERROR;
|
||||
|
@ -314,7 +314,7 @@ static int qGetIntData(SQLHANDLE hStmt, int column, bool& isNull)
|
|||
{
|
||||
SQLINTEGER intbuf;
|
||||
isNull = false;
|
||||
SQLINTEGER lengthIndicator = 0;
|
||||
SQLLEN lengthIndicator = 0;
|
||||
SQLRETURN r = SQLGetData(hStmt,
|
||||
column + 1,
|
||||
SQL_C_SLONG,
|
||||
|
@ -332,7 +332,7 @@ static double qGetDoubleData(SQLHANDLE hStmt, int column, bool& isNull)
|
|||
{
|
||||
SQLDOUBLE dblbuf;
|
||||
isNull = false;
|
||||
SQLINTEGER lengthIndicator = 0;
|
||||
SQLLEN lengthIndicator = 0;
|
||||
SQLRETURN r = SQLGetData(hStmt,
|
||||
column+1,
|
||||
SQL_C_DOUBLE,
|
||||
|
@ -351,7 +351,7 @@ static SQLBIGINT qGetBigIntData(SQLHANDLE hStmt, int column, bool& isNull)
|
|||
{
|
||||
SQLBIGINT lngbuf = Q_INT64_C(0);
|
||||
isNull = false;
|
||||
SQLINTEGER lengthIndicator = 0;
|
||||
SQLLEN lengthIndicator = 0;
|
||||
SQLRETURN r = SQLGetData(hStmt,
|
||||
column+1,
|
||||
SQL_C_SBIGINT,
|
||||
|
@ -368,7 +368,7 @@ static QString qGetStringData(SQLHANDLE hStmt, int column, int colSize, bool& is
|
|||
{
|
||||
QString fieldVal;
|
||||
SQLRETURN r = SQL_ERROR;
|
||||
SQLINTEGER lengthIndicator = 0;
|
||||
SQLLEN lengthIndicator = 0;
|
||||
|
||||
if (colSize <= 0)
|
||||
colSize = 255;
|
||||
|
@ -404,12 +404,12 @@ static QString qGetStringData(SQLHANDLE hStmt, int column, int colSize, bool& is
|
|||
return fieldVal;
|
||||
}
|
||||
|
||||
static QByteArray qGetBinaryData(SQLHANDLE hStmt, int column, SQLINTEGER& lengthIndicator, bool& isNull)
|
||||
static QByteArray qGetBinaryData(SQLHANDLE hStmt, int column, SQLLEN& lengthIndicator, bool& isNull)
|
||||
{
|
||||
QByteArray fieldVal;
|
||||
SQLSMALLINT colNameLen;
|
||||
SQLSMALLINT colType;
|
||||
SQLUINTEGER colSize;
|
||||
SQLULEN colSize;
|
||||
SQLSMALLINT colScale;
|
||||
SQLSMALLINT nullable;
|
||||
SQLRETURN r = SQL_ERROR;
|
||||
|
@ -643,9 +643,9 @@ bool QDB2Result::exec()
|
|||
{
|
||||
Q_D(QDB2Result);
|
||||
QList<QByteArray> tmpStorage; // holds temporary ptrs
|
||||
QVarLengthArray<SQLINTEGER, 32> indicators(boundValues().count());
|
||||
QVarLengthArray<SQLLEN, 32> indicators(boundValues().count());
|
||||
|
||||
memset(indicators.data(), 0, indicators.size() * sizeof(SQLINTEGER));
|
||||
memset(indicators.data(), 0, indicators.size() * sizeof(SQLLEN));
|
||||
setActive(false);
|
||||
setAt(QSql::BeforeFirstRow);
|
||||
SQLRETURN r;
|
||||
|
@ -661,7 +661,7 @@ bool QDB2Result::exec()
|
|||
int i;
|
||||
for (i = 0; i < values.count(); ++i) {
|
||||
// bind parameters - only positional binding allowed
|
||||
SQLINTEGER *ind = &indicators[i];
|
||||
SQLLEN *ind = &indicators[i];
|
||||
if (values.at(i).isNull())
|
||||
*ind = SQL_NULL_DATA;
|
||||
if (bindValueType(i) & QSql::Out)
|
||||
|
@ -1006,7 +1006,7 @@ QVariant QDB2Result::data(int field)
|
|||
return QVariant();
|
||||
}
|
||||
SQLRETURN r = 0;
|
||||
SQLINTEGER lengthIndicator = 0;
|
||||
SQLLEN lengthIndicator = 0;
|
||||
bool isNull = false;
|
||||
const QSqlField info = d->recInf.field(field);
|
||||
|
||||
|
@ -1119,7 +1119,7 @@ bool QDB2Result::isNull(int i)
|
|||
int QDB2Result::numRowsAffected()
|
||||
{
|
||||
Q_D(const QDB2Result);
|
||||
SQLINTEGER affectedRowCount = 0;
|
||||
SQLLEN affectedRowCount = 0;
|
||||
SQLRETURN r = SQLRowCount(d->hStmt, &affectedRowCount);
|
||||
if (r == SQL_SUCCESS || r == SQL_SUCCESS_WITH_INFO)
|
||||
return affectedRowCount;
|
||||
|
@ -1248,7 +1248,7 @@ bool QDB2Driver::open(const QString& db, const QString& user, const QString& pas
|
|||
const QString opt(tmp.left(idx));
|
||||
const QString val(tmp.mid(idx + 1).simplified());
|
||||
|
||||
SQLUINTEGER v = 0;
|
||||
SQLULEN v = 0;
|
||||
r = SQL_SUCCESS;
|
||||
if (opt == QLatin1String("SQL_ATTR_ACCESS_MODE")) {
|
||||
if (val == QLatin1String("SQL_MODE_READ_ONLY")) {
|
||||
|
@ -1634,7 +1634,7 @@ bool QDB2Driver::rollbackTransaction()
|
|||
bool QDB2Driver::setAutoCommit(bool autoCommit)
|
||||
{
|
||||
Q_D(QDB2Driver);
|
||||
SQLUINTEGER ac = autoCommit ? SQL_AUTOCOMMIT_ON : SQL_AUTOCOMMIT_OFF;
|
||||
SQLULEN ac = autoCommit ? SQL_AUTOCOMMIT_ON : SQL_AUTOCOMMIT_OFF;
|
||||
SQLRETURN r = SQLSetConnectAttr(d->hDbc,
|
||||
SQL_ATTR_AUTOCOMMIT,
|
||||
reinterpret_cast<SQLPOINTER>(ac),
|
||||
|
|
|
@ -229,7 +229,7 @@ class QPSQLResultPrivate : public QSqlResultPrivate
|
|||
{
|
||||
Q_DECLARE_PUBLIC(QPSQLResult)
|
||||
public:
|
||||
Q_DECLARE_SQLDRIVER_PRIVATE(QPSQLDriver);
|
||||
Q_DECLARE_SQLDRIVER_PRIVATE(QPSQLDriver)
|
||||
QPSQLResultPrivate(QPSQLResult *q, const QPSQLDriver *drv)
|
||||
: QSqlResultPrivate(q, drv),
|
||||
result(0),
|
||||
|
|
|
@ -673,7 +673,9 @@ QUnixPrintWidgetPrivate::QUnixPrintWidgetPrivate(QUnixPrintWidget *p, QPrinter *
|
|||
|
||||
widget.printers->addItems(printers);
|
||||
|
||||
const int idx = printers.indexOf(defaultPrinter);
|
||||
const QString selectedPrinter = prn && !prn->printerName().isEmpty() ? prn->printerName() : defaultPrinter;
|
||||
const int idx = printers.indexOf(selectedPrinter);
|
||||
|
||||
if (idx >= 0)
|
||||
currentPrinterIndex = idx;
|
||||
}
|
||||
|
|
|
@ -649,11 +649,10 @@ bool QSqlQuery::next()
|
|||
{
|
||||
if (!isSelect() || !isActive())
|
||||
return false;
|
||||
bool b = false;
|
||||
|
||||
switch (at()) {
|
||||
case QSql::BeforeFirstRow:
|
||||
b = d->sqlResult->fetchFirst();
|
||||
return b;
|
||||
return d->sqlResult->fetchFirst();
|
||||
case QSql::AfterLastRow:
|
||||
return false;
|
||||
default:
|
||||
|
@ -703,13 +702,11 @@ bool QSqlQuery::previous()
|
|||
return false;
|
||||
}
|
||||
|
||||
bool b = false;
|
||||
switch (at()) {
|
||||
case QSql::BeforeFirstRow:
|
||||
return false;
|
||||
case QSql::AfterLastRow:
|
||||
b = d->sqlResult->fetchLast();
|
||||
return b;
|
||||
return d->sqlResult->fetchLast();
|
||||
default:
|
||||
if (!d->sqlResult->fetchPrevious()) {
|
||||
d->sqlResult->setAt(QSql::BeforeFirstRow);
|
||||
|
@ -737,9 +734,7 @@ bool QSqlQuery::first()
|
|||
qWarning("QSqlQuery::seek: cannot seek backwards in a forward only query");
|
||||
return false;
|
||||
}
|
||||
bool b = false;
|
||||
b = d->sqlResult->fetchFirst();
|
||||
return b;
|
||||
return d->sqlResult->fetchFirst();
|
||||
}
|
||||
|
||||
/*!
|
||||
|
@ -758,9 +753,7 @@ bool QSqlQuery::last()
|
|||
{
|
||||
if (!isSelect() || !isActive())
|
||||
return false;
|
||||
bool b = false;
|
||||
b = d->sqlResult->fetchLast();
|
||||
return b;
|
||||
return d->sqlResult->fetchLast();
|
||||
}
|
||||
|
||||
/*!
|
||||
|
|
|
@ -902,8 +902,7 @@ void QMenuPrivate::adjustMenuScreen(const QPoint &p)
|
|||
// The windowHandle must point to the screen where the menu will be shown.
|
||||
// The (item) size calculations depend on the menu screen,
|
||||
// so a wrong screen would often cause wrong sizes (on high DPI)
|
||||
const QScreen *primaryScreen = QApplication::primaryScreen();
|
||||
const QScreen *currentScreen = q->windowHandle() ? q->windowHandle()->screen() : primaryScreen;
|
||||
const QScreen *currentScreen = q->windowHandle() ? q->windowHandle()->screen() : nullptr;
|
||||
const int screenNumberForPoint = QApplication::desktop()->screenNumber(p);
|
||||
QScreen *actualScreen = QGuiApplication::screens().at(screenNumberForPoint);
|
||||
if (actualScreen && currentScreen != actualScreen) {
|
||||
|
|
|
@ -245,6 +245,7 @@ private slots:
|
|||
void qhashInt() const { qhash<int>(); }
|
||||
void qhashMovable() const { qhash<Movable>(); }
|
||||
void qhashCustom() const { qhash<Custom>(); }
|
||||
void removeAllWithAlias() const;
|
||||
void removeInt() const;
|
||||
void removeMovable() const;
|
||||
void removeCustom() const;
|
||||
|
@ -1722,6 +1723,13 @@ void tst_QVector::prependCustom() const
|
|||
QCOMPARE(instancesCount, Custom::counter.loadAcquire());
|
||||
}
|
||||
|
||||
void tst_QVector::removeAllWithAlias() const
|
||||
{
|
||||
QVector<QString> strings;
|
||||
strings << "One" << "Two" << "Three" << "One" /* must be distinct, but equal */;
|
||||
QCOMPARE(strings.removeAll(strings.front()), 2); // will trigger asan/ubsan
|
||||
}
|
||||
|
||||
template<typename T>
|
||||
void tst_QVector::remove() const
|
||||
{
|
||||
|
|
|
@ -32,6 +32,8 @@ linux
|
|||
windows
|
||||
[putToFtp]
|
||||
windows ci
|
||||
[putToFtpWithInvalidCredentials]
|
||||
windows ci
|
||||
[putWithServerClosingConnectionImmediately]
|
||||
windows
|
||||
[qtbug28035browserDoesNotLoadQtProjectOrgCorrectly]
|
||||
|
|
Loading…
Reference in New Issue