diff options
Diffstat (limited to 'src')
28 files changed, 160 insertions, 78 deletions
diff --git a/src/corelib/Qt5CoreMacros.cmake b/src/corelib/Qt5CoreMacros.cmake index 489bc75511..8b65db95cb 100644 --- a/src/corelib/Qt5CoreMacros.cmake +++ b/src/corelib/Qt5CoreMacros.cmake @@ -137,6 +137,9 @@ function(QT5_CREATE_MOC_COMMAND infile outfile moc_flags moc_options moc_target DEPENDS ${infile} ${moc_depends} ${_moc_working_dir} VERBATIM) + set_source_files_properties(${infile} PROPERTIES SKIP_AUTOMOC ON) + set_source_files_properties(${outfile} PROPERTIES SKIP_AUTOMOC ON) + set_source_files_properties(${outfile} PROPERTIES SKIP_AUTOUIC ON) endfunction() @@ -155,7 +158,6 @@ function(QT5_GENERATE_MOC infile outfile ) set(moc_target ${ARGV3}) endif() qt5_create_moc_command(${abs_infile} ${_outfile} "${moc_flags}" "" "${moc_target}" "") - set_source_files_properties(${outfile} PROPERTIES SKIP_AUTOMOC TRUE) # dont run automoc on this file endfunction() @@ -246,6 +248,7 @@ function(QT5_ADD_BINARY_RESOURCES target ) get_filename_component(infile ${it} ABSOLUTE) _QT5_PARSE_QRC_FILE(${infile} _out_depends _rc_depends) + set_source_files_properties(${infile} PROPERTIES SKIP_AUTORCC ON) set(infiles ${infiles} ${infile}) set(out_depends ${out_depends} ${_out_depends}) set(rc_depends ${rc_depends} ${_rc_depends}) @@ -255,7 +258,6 @@ function(QT5_ADD_BINARY_RESOURCES target ) COMMAND ${Qt5Core_RCC_EXECUTABLE} ARGS ${rcc_options} --binary --name ${target} --output ${rcc_destination} ${infiles} DEPENDS ${rc_depends} ${out_depends} VERBATIM) - add_custom_target(${target} ALL DEPENDS ${rcc_destination}) endfunction() @@ -283,12 +285,15 @@ function(QT5_ADD_RESOURCES outfiles ) set(outfile ${CMAKE_CURRENT_BINARY_DIR}/qrc_${outfilename}.cpp) _QT5_PARSE_QRC_FILE(${infile} _out_depends _rc_depends) + set_source_files_properties(${infile} PROPERTIES SKIP_AUTORCC ON) add_custom_command(OUTPUT ${outfile} COMMAND ${Qt5Core_RCC_EXECUTABLE} ARGS ${rcc_options} --name ${outfilename} --output ${outfile} ${infile} MAIN_DEPENDENCY ${infile} DEPENDS ${_rc_depends} "${out_depends}" VERBATIM) + set_source_files_properties(${outfile} PROPERTIES SKIP_AUTOMOC ON) + set_source_files_properties(${outfile} PROPERTIES SKIP_AUTOUIC ON) list(APPEND ${outfiles} ${outfile}) endforeach() set(${outfiles} ${${outfiles}} PARENT_SCOPE) diff --git a/src/corelib/global/qfloat16.h b/src/corelib/global/qfloat16.h index 89a62a93db..a0aa9496b4 100644 --- a/src/corelib/global/qfloat16.h +++ b/src/corelib/global/qfloat16.h @@ -44,7 +44,16 @@ #include <QtCore/qmetatype.h> #include <string.h> -#if defined __F16C__ +#if defined(QT_COMPILER_SUPPORTS_F16C) && defined(__AVX2__) && !defined(__F16C__) +// All processors that support AVX2 do support F16C too. That doesn't mean +// we're allowed to use the intrinsics directly, so we'll do it only for +// the Intel and Microsoft's compilers. +# if defined(Q_CC_INTEL) || defined(Q_CC_MSVC) +# define __F16C__ 1 +# endif +#endif + +#if defined(QT_COMPILER_SUPPORTS_F16C) && defined(__F16C__) #include <immintrin.h> #endif @@ -116,7 +125,7 @@ QT_WARNING_DISABLE_CLANG("-Wc99-extensions") QT_WARNING_DISABLE_GCC("-Wold-style-cast") inline qfloat16::qfloat16(float f) Q_DECL_NOTHROW { -#if defined(QT_COMPILER_SUPPORTS_F16C) && (defined(__F16C__) || defined(__AVX2__)) +#if defined(QT_COMPILER_SUPPORTS_F16C) && defined(__F16C__) __m128 packsingle = _mm_set_ss(f); __m128i packhalf = _mm_cvtps_ph(packsingle, 0); b16 = _mm_extract_epi16(packhalf, 0); @@ -134,7 +143,7 @@ QT_WARNING_POP inline qfloat16::operator float() const Q_DECL_NOTHROW { -#if defined(QT_COMPILER_SUPPORTS_F16C) && (defined(__F16C__) || defined(__AVX2__)) +#if defined(QT_COMPILER_SUPPORTS_F16C) && defined(__F16C__) __m128i packhalf = _mm_cvtsi32_si128(b16); __m128 packsingle = _mm_cvtph_ps(packhalf); return _mm_cvtss_f32(packsingle); diff --git a/src/corelib/io/qstandardpaths_win.cpp b/src/corelib/io/qstandardpaths_win.cpp index a64bde6fb4..a06b204da7 100644 --- a/src/corelib/io/qstandardpaths_win.cpp +++ b/src/corelib/io/qstandardpaths_win.cpp @@ -201,6 +201,10 @@ QString QStandardPaths::writableLocation(StandardLocation type) return result; } +#ifndef QT_BOOTSTRAPPED +extern QString qAppFileName(); +#endif + QStringList QStandardPaths::standardLocations(StandardLocation type) { QStringList dirs; @@ -217,8 +221,13 @@ QStringList QStandardPaths::standardLocations(StandardLocation type) dirs.append(programData); } #ifndef QT_BOOTSTRAPPED - dirs.append(QCoreApplication::applicationDirPath()); - dirs.append(QCoreApplication::applicationDirPath() + QLatin1String("/data")); + // Note: QCoreApplication::applicationDirPath(), while static, requires + // an application instance. But we might need to resolve the standard + // locations earlier than that, so we fall back to qAppFileName(). + QString applicationDirPath = qApp ? QCoreApplication::applicationDirPath() + : QFileInfo(qAppFileName()).path(); + dirs.append(applicationDirPath); + dirs.append(applicationDirPath + QLatin1String("/data")); #endif // !QT_BOOTSTRAPPED } // isConfigLocation() diff --git a/src/corelib/tools/qversionnumber.cpp b/src/corelib/tools/qversionnumber.cpp index 97e5da8b3c..d2667ddea9 100644 --- a/src/corelib/tools/qversionnumber.cpp +++ b/src/corelib/tools/qversionnumber.cpp @@ -388,7 +388,7 @@ QVersionNumber QVersionNumber::commonPrefix(const QVersionNumber &v1, /*! \fn QString QVersionNumber::toString() const - Returns a string with all of the segments delimited by a '.'. + Returns a string with all of the segments delimited by a period (\c{.}). \sa majorVersion(), minorVersion(), microVersion(), segments() */ @@ -411,7 +411,7 @@ QString QVersionNumber::toString() const int *suffixIndex) Constructs a QVersionNumber from a specially formatted \a string of - non-negative decimal numbers delimited by '.'. + non-negative decimal numbers delimited by a period (\c{.}). Once the numerical segments have been parsed, the remainder of the string is considered to be the suffix string. The start index of that string will be diff --git a/src/gui/image/qplatformpixmap.cpp b/src/gui/image/qplatformpixmap.cpp index 00c21a5f54..b3b9f79fb1 100644 --- a/src/gui/image/qplatformpixmap.cpp +++ b/src/gui/image/qplatformpixmap.cpp @@ -58,6 +58,9 @@ QT_BEGIN_NAMESPACE */ QPlatformPixmap *QPlatformPixmap::create(int w, int h, PixelType type) { + if (Q_UNLIKELY(!QGuiApplicationPrivate::platformIntegration())) + qFatal("QPlatformPixmap: QGuiApplication required"); + QPlatformPixmap *data = QGuiApplicationPrivate::platformIntegration()->createPlatformPixmap(static_cast<QPlatformPixmap::PixelType>(type)); data->resize(w, h); return data; diff --git a/src/gui/kernel/qhighdpiscaling_p.h b/src/gui/kernel/qhighdpiscaling_p.h index 0a060a2d2c..83fc9452c5 100644 --- a/src/gui/kernel/qhighdpiscaling_p.h +++ b/src/gui/kernel/qhighdpiscaling_p.h @@ -402,7 +402,8 @@ inline QRegion fromNativeLocalExposedRegion(const QRegion &pixelRegion, const QW const QPointF topLeftP = rect.topLeft() / scaleFactor; const QSizeF sizeP = rect.size() / scaleFactor; pointRegion += QRect(QPoint(qFloor(topLeftP.x()), qFloor(topLeftP.y())), - QSize(qCeil(sizeP.width()), qCeil(sizeP.height()))); + QPoint(qCeil(topLeftP.x() + sizeP.width() - 1.0), + qCeil(topLeftP.y() + sizeP.height() - 1.0))); } return pointRegion; } diff --git a/src/gui/kernel/qwindowsysteminterface.cpp b/src/gui/kernel/qwindowsysteminterface.cpp index 34519cd91b..3f27094845 100644 --- a/src/gui/kernel/qwindowsysteminterface.cpp +++ b/src/gui/kernel/qwindowsysteminterface.cpp @@ -265,12 +265,12 @@ void QWindowSystemInterface::handleWindowScreenChanged(QWindow *window, QScreen QWindowSystemInterfacePrivate::handleWindowSystemEvent(e); } -void QWindowSystemInterface::handleApplicationStateChanged(Qt::ApplicationState newState, bool forcePropagate) +QT_DEFINE_QPA_EVENT_HANDLER(void, handleApplicationStateChanged, Qt::ApplicationState newState, bool forcePropagate) { Q_ASSERT(QGuiApplicationPrivate::platformIntegration()->hasCapability(QPlatformIntegration::ApplicationState)); QWindowSystemInterfacePrivate::ApplicationStateChangedEvent *e = new QWindowSystemInterfacePrivate::ApplicationStateChangedEvent(newState, forcePropagate); - QWindowSystemInterfacePrivate::handleWindowSystemEvent(e); + QWindowSystemInterfacePrivate::handleWindowSystemEvent<Delivery>(e); } /*! diff --git a/src/gui/kernel/qwindowsysteminterface.h b/src/gui/kernel/qwindowsysteminterface.h index e582787dd9..e91c79749d 100644 --- a/src/gui/kernel/qwindowsysteminterface.h +++ b/src/gui/kernel/qwindowsysteminterface.h @@ -179,6 +179,7 @@ public: static void handleWindowStateChanged(QWindow *window, Qt::WindowState newState, int oldState = -1); static void handleWindowScreenChanged(QWindow *window, QScreen *newScreen); + template<typename Delivery = QWindowSystemInterface::DefaultDelivery> static void handleApplicationStateChanged(Qt::ApplicationState newState, bool forcePropagate = false); #ifndef QT_NO_DRAGANDDROP diff --git a/src/gui/text/qfont.cpp b/src/gui/text/qfont.cpp index 7f3ed3adaa..806ede88e2 100644 --- a/src/gui/text/qfont.cpp +++ b/src/gui/text/qfont.cpp @@ -727,11 +727,9 @@ void QFont::setFamily(const QString &family) /*! \since 4.8 - Returns the requested font style name, it will be used to match the + Returns the requested font style name. This can be used to match the font with irregular styles (that can't be normalized in other style - properties). It depends on system font support, thus only works for - \macos and X11 so far. On Windows irregular styles will be added - as separate font families so there is no need for this. + properties). \sa setFamily(), setStyle() */ @@ -744,7 +742,12 @@ QString QFont::styleName() const \since 4.8 Sets the style name of the font to \a styleName. When set, other style properties - like \l style() and \l weight() will be ignored for font matching. + like \l style() and \l weight() will be ignored for font matching, though they may be + simulated afterwards if supported by the platform's font engine. + + Due to the lower quality of artificially simulated styles, and the lack of full cross + platform support, it is not recommended to use matching by style name together with + matching by style properties \sa styleName() */ @@ -985,6 +988,10 @@ int QFont::pixelSize() const Sets the style() of the font to QFont::StyleItalic if \a enable is true; otherwise the style is set to QFont::StyleNormal. + \note If styleName() is set, this value may be ignored, or if supported + on the platform, the font may be rendered tilted instead of picking a + designed italic font-variant. + \sa italic(), QFontInfo */ @@ -1050,6 +1057,8 @@ int QFont::weight() const Sets the weight of the font to \a weight, using the scale defined by \l QFont::Weight enumeration. + \note If styleName() is set, this value may be ignored for font selection. + \sa weight(), QFontInfo */ void QFont::setWeight(int weight) @@ -1083,6 +1092,9 @@ void QFont::setWeight(int weight) For finer boldness control use setWeight(). + \note If styleName() is set, this value may be ignored, or if supported + on the platform, the font artificially embolded. + \sa bold(), setWeight() */ diff --git a/src/network/access/qhttp2protocolhandler.cpp b/src/network/access/qhttp2protocolhandler.cpp index 114feb91b7..9dfcec8311 100644 --- a/src/network/access/qhttp2protocolhandler.cpp +++ b/src/network/access/qhttp2protocolhandler.cpp @@ -1069,7 +1069,7 @@ void QHttp2ProtocolHandler::updateStream(Stream &stream, const HPack::HttpHeader QByteArray binder(", "); if (name == "set-cookie") binder = "\n"; - httpReply->setHeaderField(name, value.replace('\0', binder)); + httpReplyPrivate->fields.append(qMakePair(name, value.replace('\0', binder))); } } diff --git a/src/network/access/qnetworkaccessmanager.cpp b/src/network/access/qnetworkaccessmanager.cpp index 848761c4a7..fba5755b77 100644 --- a/src/network/access/qnetworkaccessmanager.cpp +++ b/src/network/access/qnetworkaccessmanager.cpp @@ -985,8 +985,7 @@ QNetworkConfiguration QNetworkAccessManager::configuration() const if (session) { return session->configuration(); } else { - QNetworkConfigurationManager manager; - return manager.defaultConfiguration(); + return d->networkConfigurationManager.defaultConfiguration(); } } @@ -1010,12 +1009,11 @@ QNetworkConfiguration QNetworkAccessManager::activeConfiguration() const Q_D(const QNetworkAccessManager); QSharedPointer<QNetworkSession> networkSession(d->getNetworkSession()); - QNetworkConfigurationManager manager; if (networkSession) { - return manager.configurationFromIdentifier( + return d->networkConfigurationManager.configurationFromIdentifier( networkSession->sessionProperty(QLatin1String("ActiveConfiguration")).toString()); } else { - return manager.defaultConfiguration(); + return d->networkConfigurationManager.defaultConfiguration(); } } @@ -1342,17 +1340,16 @@ QNetworkReply *QNetworkAccessManager::createRequest(QNetworkAccessManager::Opera } if (!d->networkSessionStrongRef && (d->initializeSession || !d->networkConfiguration.identifier().isEmpty())) { - QNetworkConfigurationManager manager; if (!d->networkConfiguration.identifier().isEmpty()) { if ((d->networkConfiguration.state() & QNetworkConfiguration::Defined) - && d->networkConfiguration != manager.defaultConfiguration()) - d->createSession(manager.defaultConfiguration()); + && d->networkConfiguration != d->networkConfigurationManager.defaultConfiguration()) + d->createSession(d->networkConfigurationManager.defaultConfiguration()); else d->createSession(d->networkConfiguration); } else { - if (manager.capabilities() & QNetworkConfigurationManager::NetworkSessionRequired) - d->createSession(manager.defaultConfiguration()); + if (d->networkSessionRequired) + d->createSession(d->networkConfigurationManager.defaultConfiguration()); else d->initializeSession = false; } @@ -1884,8 +1881,8 @@ void QNetworkAccessManagerPrivate::_q_onlineStateChanged(bool isOnline) online = (networkConfiguration.state() & QNetworkConfiguration::Active); } else { if (online != isOnline) { - _q_networkSessionClosed(); - createSession(q->configuration()); + _q_networkSessionClosed(); + createSession(q->configuration()); online = isOnline; } } @@ -1909,13 +1906,13 @@ void QNetworkAccessManagerPrivate::_q_configurationChanged(const QNetworkConfigu const QString id = configuration.identifier(); if (configuration.state().testFlag(QNetworkConfiguration::Active)) { if (!onlineConfigurations.contains(id)) { - QSharedPointer<QNetworkSession> session(getNetworkSession()); if (session) { if (online && session->configuration().identifier() != networkConfigurationManager.defaultConfiguration().identifier()) { onlineConfigurations.insert(id); + // CHECK: If it's having Active flag - why would it be disconnected ??? //this one disconnected but another one is online, // close and create new session _q_networkSessionClosed(); @@ -1926,6 +1923,7 @@ void QNetworkAccessManagerPrivate::_q_configurationChanged(const QNetworkConfigu } else if (onlineConfigurations.contains(id)) { //this one is disconnecting + // CHECK: If it disconnected while we create a session over a down configuration ??? onlineConfigurations.remove(id); if (!onlineConfigurations.isEmpty()) { _q_networkSessionClosed(); diff --git a/src/network/ssl/qsslsocket_mac.cpp b/src/network/ssl/qsslsocket_mac.cpp index 0aef6a2a99..2ba988fb70 100644 --- a/src/network/ssl/qsslsocket_mac.cpp +++ b/src/network/ssl/qsslsocket_mac.cpp @@ -1108,6 +1108,12 @@ bool QSslSocketBackendPrivate::verifySessionProtocol() const protocolOk = (sessionProtocol() >= QSsl::SslV3); else if (configuration.protocol == QSsl::SecureProtocols) protocolOk = (sessionProtocol() >= QSsl::TlsV1_0); + else if (configuration.protocol == QSsl::TlsV1_0OrLater) + protocolOk = (sessionProtocol() >= QSsl::TlsV1_0); + else if (configuration.protocol == QSsl::TlsV1_1OrLater) + protocolOk = (sessionProtocol() >= QSsl::TlsV1_1); + else if (configuration.protocol == QSsl::TlsV1_2OrLater) + protocolOk = (sessionProtocol() >= QSsl::TlsV1_2); else protocolOk = (sessionProtocol() == configuration.protocol); diff --git a/src/platformsupport/themes/genericunix/qgenericunixthemes.cpp b/src/platformsupport/themes/genericunix/qgenericunixthemes.cpp index 323e8fd13b..4e7421e98f 100644 --- a/src/platformsupport/themes/genericunix/qgenericunixthemes.cpp +++ b/src/platformsupport/themes/genericunix/qgenericunixthemes.cpp @@ -120,9 +120,11 @@ static bool isDBusTrayAvailable() { #ifndef QT_NO_DBUS static bool checkDBusGlobalMenuAvailable() { - QDBusConnection connection = QDBusConnection::sessionBus(); - QString registrarService = QStringLiteral("com.canonical.AppMenu.Registrar"); - return connection.interface()->isServiceRegistered(registrarService); + const QDBusConnection connection = QDBusConnection::sessionBus(); + static const QString registrarService = QStringLiteral("com.canonical.AppMenu.Registrar"); + if (const auto iface = connection.interface()) + return iface->isServiceRegistered(registrarService); + return false; } static bool isDBusGlobalMenuAvailable() diff --git a/src/plugins/platforms/cocoa/qnsview.mm b/src/plugins/platforms/cocoa/qnsview.mm index ec9d25fff9..2e64204fb7 100644 --- a/src/plugins/platforms/cocoa/qnsview.mm +++ b/src/plugins/platforms/cocoa/qnsview.mm @@ -2068,6 +2068,7 @@ static QPoint mapWindowCoordinates(QWindow *source, QWindow *target, QPoint poin } else { NSImage *nsimage = qt_mac_create_nsimage(pixmapCursor); + nsimage.size = NSSizeFromCGSize((pixmapCursor.size() / pixmapCursor.devicePixelRatioF()).toCGSize()); nativeCursor = [[NSCursor alloc] initWithImage:nsimage hotSpot:NSZeroPoint]; [nsimage release]; } diff --git a/src/plugins/platforms/ios/qiosapplicationstate.mm b/src/plugins/platforms/ios/qiosapplicationstate.mm index 7b923e4692..13e7e1150f 100644 --- a/src/plugins/platforms/ios/qiosapplicationstate.mm +++ b/src/plugins/platforms/ios/qiosapplicationstate.mm @@ -39,6 +39,8 @@ #include "qiosapplicationstate.h" +#include "qiosglobal.h" + #include <qpa/qwindowsysteminterface.h> #include <QtCore/qcoreapplication.h> @@ -72,8 +74,8 @@ static Qt::ApplicationState qtApplicationState(UIApplicationState uiApplicationS static void handleApplicationStateChanged(UIApplicationState uiApplicationState) { Qt::ApplicationState state = qtApplicationState(uiApplicationState); - QWindowSystemInterface::handleApplicationStateChanged(state); - QWindowSystemInterface::flushWindowSystemEvents(); + qCDebug(lcQpaApplication) << "moved to" << state; + QWindowSystemInterface::handleApplicationStateChanged<QWindowSystemInterface::SynchronousDelivery>(state); } QT_BEGIN_NAMESPACE diff --git a/src/plugins/platforms/ios/qioscontext.mm b/src/plugins/platforms/ios/qioscontext.mm index 2d5286e971..6a6cbb4324 100644 --- a/src/plugins/platforms/ios/qioscontext.mm +++ b/src/plugins/platforms/ios/qioscontext.mm @@ -165,8 +165,6 @@ bool QIOSContext::makeCurrent(QPlatformSurface *surface) glFramebufferRenderbuffer(GL_FRAMEBUFFER, GL_STENCIL_ATTACHMENT, GL_RENDERBUFFER, framebufferObject.depthRenderbuffer); } - - connect(static_cast<QIOSWindow *>(surface), SIGNAL(destroyed(QObject*)), this, SLOT(windowDestroyed(QObject*))); } else { glBindFramebuffer(GL_FRAMEBUFFER, framebufferObject.handle); } @@ -249,8 +247,13 @@ QIOSContext::FramebufferObject &QIOSContext::backingFramebufferObjectFor(QPlatfo // should probably use QOpenGLMultiGroupSharedResource to track the shared default-FBOs. if (m_sharedContext) return m_sharedContext->backingFramebufferObjectFor(surface); - else - return m_framebufferObjects[surface]; + + if (!m_framebufferObjects.contains(surface)) { + // We're about to create a new FBO, make sure it's cleaned up as well + connect(static_cast<QIOSWindow *>(surface), SIGNAL(destroyed(QObject*)), this, SLOT(windowDestroyed(QObject*))); + } + + return m_framebufferObjects[surface]; } GLuint QIOSContext::defaultFramebufferObject(QPlatformSurface *surface) const diff --git a/src/plugins/platforms/ios/qiosglobal.h b/src/plugins/platforms/ios/qiosglobal.h index f74e3004cc..8b39aded06 100644 --- a/src/plugins/platforms/ios/qiosglobal.h +++ b/src/plugins/platforms/ios/qiosglobal.h @@ -47,7 +47,9 @@ QT_BEGIN_NAMESPACE +Q_DECLARE_LOGGING_CATEGORY(lcQpaApplication); Q_DECLARE_LOGGING_CATEGORY(lcQpaInputMethods); +Q_DECLARE_LOGGING_CATEGORY(lcQpaWindow); #if !defined(QT_NO_DEBUG) #define qImDebug \ diff --git a/src/plugins/platforms/ios/qiosglobal.mm b/src/plugins/platforms/ios/qiosglobal.mm index 1482ffc7af..f27b2242df 100644 --- a/src/plugins/platforms/ios/qiosglobal.mm +++ b/src/plugins/platforms/ios/qiosglobal.mm @@ -44,7 +44,9 @@ QT_BEGIN_NAMESPACE +Q_LOGGING_CATEGORY(lcQpaApplication, "qt.qpa.application"); Q_LOGGING_CATEGORY(lcQpaInputMethods, "qt.qpa.input.methods"); +Q_LOGGING_CATEGORY(lcQpaWindow, "qt.qpa.window"); bool isQtApplication() { diff --git a/src/plugins/platforms/ios/qioswindow.mm b/src/plugins/platforms/ios/qioswindow.mm index 8ff0dfbd5f..fb161febda 100644 --- a/src/plugins/platforms/ios/qioswindow.mm +++ b/src/plugins/platforms/ios/qioswindow.mm @@ -244,12 +244,25 @@ void QIOSWindow::setWindowState(Qt::WindowState state) applyGeometry(m_normalGeometry); break; case Qt::WindowMaximized: - applyGeometry(window()->flags() & Qt::MaximizeUsingFullscreenGeometryHint ? - screen()->geometry() : screen()->availableGeometry()); - break; - case Qt::WindowFullScreen: - applyGeometry(screen()->geometry()); + case Qt::WindowFullScreen: { + // When an application is in split-view mode, the UIScreen still has the + // same geometry, but the UIWindow is resized to the area reserved for the + // application. We use this to constrain the geometry used when applying the + // fullscreen or maximized window states. Note that we do not do this + // in applyGeometry(), as we don't want to artificially limit window + // placement "outside" of the screen bounds if that's what the user wants. + + QRect uiWindowBounds = QRectF::fromCGRect(m_view.window.bounds).toRect(); + QRect fullscreenGeometry = screen()->geometry().intersected(uiWindowBounds); + QRect maximizedGeometry = window()->flags() & Qt::MaximizeUsingFullscreenGeometryHint ? + fullscreenGeometry : screen()->availableGeometry().intersected(uiWindowBounds); + + if (state & Qt::WindowFullScreen) + applyGeometry(fullscreenGeometry); + else + applyGeometry(maximizedGeometry); break; + } case Qt::WindowMinimized: applyGeometry(QRect()); break; diff --git a/src/plugins/platforms/ios/quiview.mm b/src/plugins/platforms/ios/quiview.mm index 9966bd50a3..bf26feac9f 100644 --- a/src/plugins/platforms/ios/quiview.mm +++ b/src/plugins/platforms/ios/quiview.mm @@ -165,6 +165,7 @@ requestedGeometry : qt_window_private(m_qioswindow->window())->geometry; QWindow *window = m_qioswindow->window(); + qCDebug(lcQpaWindow) << m_qioswindow->window() << "new geometry is" << actualGeometry; QWindowSystemInterface::handleGeometryChange<QWindowSystemInterface::SynchronousDelivery>(window, actualGeometry, previousGeometry); if (actualGeometry.size() != previousGeometry.size()) { @@ -197,6 +198,7 @@ region = QRect(QPoint(), bounds); } + qCDebug(lcQpaWindow) << m_qioswindow->window() << region << "isExposed" << m_qioswindow->isExposed(); QWindowSystemInterface::handleExposeEvent<QWindowSystemInterface::SynchronousDelivery>(m_qioswindow->window(), region); } diff --git a/src/plugins/sqldrivers/oci/qsql_oci.cpp b/src/plugins/sqldrivers/oci/qsql_oci.cpp index a4793351de..9ce2fc1b55 100644 --- a/src/plugins/sqldrivers/oci/qsql_oci.cpp +++ b/src/plugins/sqldrivers/oci/qsql_oci.cpp @@ -2603,7 +2603,7 @@ QSqlIndex QOCIDriver::primaryIndex(const QString& tablename) const QString stmt(QLatin1String("select b.column_name, b.index_name, a.table_name, a.owner " "from all_constraints a, all_ind_columns b " "where a.constraint_type='P' " - "and b.index_name = a.constraint_name " + "and b.index_name = a.index_name " "and b.index_owner = a.owner")); bool buildIndex = false; diff --git a/src/widgets/Qt5WidgetsMacros.cmake b/src/widgets/Qt5WidgetsMacros.cmake index f5e7b7f050..737371a5ad 100644 --- a/src/widgets/Qt5WidgetsMacros.cmake +++ b/src/widgets/Qt5WidgetsMacros.cmake @@ -59,6 +59,9 @@ function(QT5_WRAP_UI outfiles ) COMMAND ${Qt5Widgets_UIC_EXECUTABLE} ARGS ${ui_options} -o ${outfile} ${infile} MAIN_DEPENDENCY ${infile} VERBATIM) + set_source_files_properties(${infile} PROPERTIES SKIP_AUTOUIC ON) + set_source_files_properties(${outfile} PROPERTIES SKIP_AUTOMOC ON) + set_source_files_properties(${outfile} PROPERTIES SKIP_AUTOUIC ON) list(APPEND ${outfiles} ${outfile}) endforeach() set(${outfiles} ${${outfiles}} PARENT_SCOPE) diff --git a/src/widgets/itemviews/qheaderview.cpp b/src/widgets/itemviews/qheaderview.cpp index 298270a785..4e4c9572a3 100644 --- a/src/widgets/itemviews/qheaderview.cpp +++ b/src/widgets/itemviews/qheaderview.cpp @@ -2086,40 +2086,26 @@ void QHeaderViewPrivate::_q_layoutChanged() { Q_Q(QHeaderView); viewport->update(); - if (persistentHiddenSections.isEmpty() || modelIsEmpty()) { - if (modelSectionCount() != sectionCount()) - q->initializeSections(); - persistentHiddenSections.clear(); + + const auto hiddenSections = persistentHiddenSections; + persistentHiddenSections.clear(); + + clear(); + q->initializeSections(); + invalidateCachedSizeHint(); + + if (modelIsEmpty()) { return; } - QBitArray oldSectionHidden = sectionsHiddenToBitVector(); - oldSectionHidden.resize(sectionItems.size()); - bool sectionCountChanged = false; - - for (int i = 0; i < persistentHiddenSections.count(); ++i) { - QModelIndex index = persistentHiddenSections.at(i); + for (const auto &index : hiddenSections) { if (index.isValid()) { const int logical = (orientation == Qt::Horizontal ? index.column() : index.row()); q->setSectionHidden(logical, true); - oldSectionHidden.setBit(logical, false); - } else if (!sectionCountChanged && (modelSectionCount() != sectionCount())) { - sectionCountChanged = true; - break; } } - persistentHiddenSections.clear(); - - for (int i = 0; i < oldSectionHidden.count(); ++i) { - if (oldSectionHidden.testBit(i)) - q->setSectionHidden(i, false); - } - - // the number of sections changed; we need to reread the state of the model - if (sectionCountChanged) - q->initializeSections(); } /*! diff --git a/src/widgets/itemviews/qtableview.cpp b/src/widgets/itemviews/qtableview.cpp index 2d5813198c..8ab811e9f7 100644 --- a/src/widgets/itemviews/qtableview.cpp +++ b/src/widgets/itemviews/qtableview.cpp @@ -1397,6 +1397,9 @@ void QTableView::paintEvent(QPaintEvent *event) } else { dirtyArea.setRight(qMin(dirtyArea.right(), int(x))); } + // dirtyArea may be invalid when the horizontal header is not stretched + if (!dirtyArea.isValid()) + continue; // get the horizontal start and end visual sections int left = horizontalHeader->visualIndexAt(dirtyArea.left()); diff --git a/src/widgets/itemviews/qtreeview.cpp b/src/widgets/itemviews/qtreeview.cpp index 2abb1a9c14..bbbadecff8 100644 --- a/src/widgets/itemviews/qtreeview.cpp +++ b/src/widgets/itemviews/qtreeview.cpp @@ -736,7 +736,10 @@ void QTreeView::dataChanged(const QModelIndex &topLeft, const QModelIndex &botto void QTreeView::hideColumn(int column) { Q_D(QTreeView); + if (d->header->isSectionHidden(column)) + return; d->header->hideSection(column); + doItemsLayout(); } /*! @@ -747,7 +750,10 @@ void QTreeView::hideColumn(int column) void QTreeView::showColumn(int column) { Q_D(QTreeView); + if (!d->header->isSectionHidden(column)) + return; d->header->showSection(column); + doItemsLayout(); } /*! @@ -1008,11 +1014,16 @@ void QTreeView::keyboardSearch(const QString &search) if (!d->model->rowCount(d->root) || !d->model->columnCount(d->root)) return; + // Do a relayout nows, so that we can utilize viewItems + d->executePostedLayout(); + if (d->viewItems.isEmpty()) + return; + QModelIndex start; if (currentIndex().isValid()) start = currentIndex(); else - start = d->model->index(0, 0, d->root); + start = d->viewItems.at(0).index; bool skipRow = false; bool keyboardTimeWasValid = d->keyboardInputTime.isValid(); @@ -1040,13 +1051,16 @@ void QTreeView::keyboardSearch(const QString &search) // skip if we are searching for the same key or a new search started if (skipRow) { - if (indexBelow(start).isValid()) + if (indexBelow(start).isValid()) { start = indexBelow(start); - else - start = d->model->index(0, start.column(), d->root); + } else { + const int origCol = start.column(); + start = d->viewItems.at(0).index; + if (origCol != start.column()) + start = start.sibling(start.row(), origCol); + } } - d->executePostedLayout(); int startIndex = d->viewIndex(start); if (startIndex <= -1) return; diff --git a/src/widgets/styles/qfusionstyle.cpp b/src/widgets/styles/qfusionstyle.cpp index 016a5e2ad7..774eca1018 100644 --- a/src/widgets/styles/qfusionstyle.cpp +++ b/src/widgets/styles/qfusionstyle.cpp @@ -472,8 +472,10 @@ void QFusionStyle::drawPrimitive(PrimitiveElement elem, break; if (option->state & State_Open) drawPrimitive(PE_IndicatorArrowDown, option, painter, widget); - else - drawPrimitive(PE_IndicatorArrowRight, option, painter, widget); + else { + const bool reverse = (option->direction == Qt::RightToLeft); + drawPrimitive(reverse ? PE_IndicatorArrowLeft : PE_IndicatorArrowRight, option, painter, widget); + } break; } #if QT_CONFIG(tabbar) diff --git a/src/widgets/widgets/qabstractbutton.cpp b/src/widgets/widgets/qabstractbutton.cpp index dbd94e890d..5854472ff0 100644 --- a/src/widgets/widgets/qabstractbutton.cpp +++ b/src/widgets/widgets/qabstractbutton.cpp @@ -991,13 +991,14 @@ void QAbstractButton::mousePressEvent(QMouseEvent *e) void QAbstractButton::mouseReleaseEvent(QMouseEvent *e) { Q_D(QAbstractButton); - d->pressed = false; if (e->button() != Qt::LeftButton) { e->ignore(); return; } + d->pressed = false; + if (!d->down) { // refresh is required by QMacStyle to resume the default button animation d->refresh(); diff --git a/src/widgets/widgets/qtoolbar.cpp b/src/widgets/widgets/qtoolbar.cpp index 663e8214c0..243fb6d555 100644 --- a/src/widgets/widgets/qtoolbar.cpp +++ b/src/widgets/widgets/qtoolbar.cpp @@ -1120,6 +1120,8 @@ static bool waitForPopup(QToolBar *tb, QWidget *popup) static void enableMacToolBar(QToolBar *toolbar, bool enable) { QPlatformNativeInterface *nativeInterface = QApplication::platformNativeInterface(); + if (!nativeInterface) + return; QPlatformNativeInterface::NativeResourceForIntegrationFunction function = nativeInterface->nativeResourceFunctionForIntegration("setContentBorderAreaEnabled"); if (!function) |