diff options
-rw-r--r-- | doc/global/manifest-meta.qdocconf | 20 | ||||
-rw-r--r-- | src/corelib/configure.json | 15 | ||||
-rw-r--r-- | src/corelib/global/minimum-linux_p.h | 2 | ||||
-rw-r--r-- | src/corelib/global/qconfig-bootstrapped.h | 5 | ||||
-rw-r--r-- | src/corelib/io/qtemporaryfile_p.h | 2 | ||||
-rw-r--r-- | src/corelib/tools/qdatetime.h | 2 | ||||
-rw-r--r-- | src/corelib/tools/qdatetimeparser.cpp | 7 | ||||
-rw-r--r-- | src/gui/kernel/qhighdpiscaling.cpp | 18 | ||||
-rw-r--r-- | src/gui/util/qshadergraphloader.cpp | 3 | ||||
-rw-r--r-- | src/gui/util/qshaderlanguage.cpp | 14 | ||||
-rw-r--r-- | src/plugins/platforms/cocoa/qcocoaglcontext.mm | 25 | ||||
-rw-r--r-- | src/sql/kernel/qsqlfield.cpp | 13 | ||||
-rw-r--r-- | src/sql/kernel/qsqlfield.h | 5 | ||||
-rw-r--r-- | tests/auto/corelib/tools/qdatetime/tst_qdatetime.cpp | 4 |
14 files changed, 96 insertions, 39 deletions
diff --git a/doc/global/manifest-meta.qdocconf b/doc/global/manifest-meta.qdocconf index 3b67049182..3db67a3131 100644 --- a/doc/global/manifest-meta.qdocconf +++ b/doc/global/manifest-meta.qdocconf @@ -30,26 +30,6 @@ manifestmeta.filters = highlighted android thumbnail ios -manifestmeta.highlighted.names = "QtQuick/Qt Quick Demo - Same Game" \ - "QtQuick/Qt Quick Demo - Photo Surface" \ - "QtQuick/Qt Quick Demo - Tweet Search" \ - "QtQuick/Qt Quick Demo - Calqlatr" \ - "QtQuick/Qt Quick Demo - StocQt" \ - "QtQuick/Qt Quick Demo - Clocks" \ - "QtQuick/Qt Quick Examples - Shader Effects" \ - "QtQuickExtras/Qt Quick Extras - Dashboard" \ - "QtQuickExtras/Qt Quick Extras - Flat" \ - "QtQuickExtras/Qt Quick Extras - Gallery" \ - "QtQuickDialogs/Qt Quick System Dialog Examples" \ - "QtWinExtras/Quick Player" \ - "QtMultimedia/QML Video Shader Effects Example" \ - "QtCanvas3D/Interactive Mobile Phone Example" \ - "QtLocation/Map Viewer (QML)" \ - "QtBluetooth/Bluetooth Low Energy Heart Rate Game" \ - "QtCharts/Chart Themes Example" \ - "QtDataVisualization/Bars Example" \ - "QtDataVisualization/Surface Example" - manifestmeta.highlighted.attributes = isHighlighted:true manifestmeta.android.names = "QtQuick/Qt Quick Demo - Calqlatr" \ diff --git a/src/corelib/configure.json b/src/corelib/configure.json index 8067ca70f1..bf44f2649d 100644 --- a/src/corelib/configure.json +++ b/src/corelib/configure.json @@ -349,6 +349,15 @@ "qmake": "linux: LIBS += -lpthread -lrt" } }, + "linkat": { + "label": "linkat()", + "type": "compile", + "test": { + "head": "#define _ATFILE_SOURCE 1", + "include": [ "fcntl.h", "unistd.h" ], + "main": "linkat(AT_FDCWD, \"foo\", AT_FDCWD, \"bar\", AT_SYMLINK_FOLLOW);" + } + }, "ppoll": { "label": "ppoll()", "type": "compile", @@ -540,6 +549,12 @@ "condition": "libs.journald", "output": [ "privateFeature" ] }, + "linkat": { + "label": "linkat()", + "autoDetect": "config.linux", + "condition": "tests.linkat", + "output": [ "privateFeature" ] + }, "std-atomic64": { "label": "64 bit atomic operations", "condition": "libs.libatomic", diff --git a/src/corelib/global/minimum-linux_p.h b/src/corelib/global/minimum-linux_p.h index 324744b856..bad2488b4d 100644 --- a/src/corelib/global/minimum-linux_p.h +++ b/src/corelib/global/minimum-linux_p.h @@ -67,7 +67,7 @@ QT_BEGIN_NAMESPACE * - inotify_init1 before 2.6.12-rc12 * - futex(2) before 2.6.12-rc12 * - FUTEX_WAKE_OP 2.6.14 FUTEX_OP - * - linkat(2) 2.6.17 O_TMPFILE + * - linkat(2) 2.6.17 O_TMPFILE && QT_CONFIG(linkat) * - FUTEX_PRIVATE_FLAG 2.6.22 * - O_CLOEXEC 2.6.23 * - eventfd 2.6.23 diff --git a/src/corelib/global/qconfig-bootstrapped.h b/src/corelib/global/qconfig-bootstrapped.h index 2164d7f21f..dabb715607 100644 --- a/src/corelib/global/qconfig-bootstrapped.h +++ b/src/corelib/global/qconfig-bootstrapped.h @@ -87,6 +87,11 @@ #define QT_FEATURE_futimens -1 #define QT_FEATURE_futimes -1 #define QT_FEATURE_library -1 +#ifdef __linux__ +# define QT_FEATURE_linkat 1 +#else +# define QT_FEATURE_linkat -1 +#endif #define QT_NO_QOBJECT #define QT_FEATURE_process -1 #define QT_FEATURE_renameat2 -1 diff --git a/src/corelib/io/qtemporaryfile_p.h b/src/corelib/io/qtemporaryfile_p.h index 46a0d7aba3..f74e5680b9 100644 --- a/src/corelib/io/qtemporaryfile_p.h +++ b/src/corelib/io/qtemporaryfile_p.h @@ -58,7 +58,7 @@ #include "private/qfile_p.h" #include "qtemporaryfile.h" -#ifdef Q_OS_LINUX +#if defined(Q_OS_LINUX) && QT_CONFIG(linkat) # include <fcntl.h> # ifdef O_TMPFILE // some early libc support had the wrong values for O_TMPFILE diff --git a/src/corelib/tools/qdatetime.h b/src/corelib/tools/qdatetime.h index adab47fc1f..3b741553d5 100644 --- a/src/corelib/tools/qdatetime.h +++ b/src/corelib/tools/qdatetime.h @@ -81,7 +81,7 @@ public: int daysInYear() const; int weekNumber(int *yearNum = Q_NULLPTR) const; -#if QT_DEPRECATED_SINCE(5, 11) && !defined QT_NO_TEXTDATE +#if QT_DEPRECATED_SINCE(5, 10) && !defined QT_NO_TEXTDATE QT_DEPRECATED_X("Use QLocale::monthName or QLocale::standaloneMonthName") static QString shortMonthName(int month, MonthNameType type = DateFormat); QT_DEPRECATED_X("Use QLocale::dayName or QLocale::standaloneDayName") diff --git a/src/corelib/tools/qdatetimeparser.cpp b/src/corelib/tools/qdatetimeparser.cpp index dd277f7753..4b3777407c 100644 --- a/src/corelib/tools/qdatetimeparser.cpp +++ b/src/corelib/tools/qdatetimeparser.cpp @@ -1155,7 +1155,8 @@ QDateTimeParser::scanString(const QDateTime &defaultValue, // Synchronize with what findTimeZone() found: QStringRef zoneName = input->midRef(pos, sect.used); Q_ASSERT(!zoneName.isEmpty()); // sect.used > 0 - const QByteArray latinZone(zoneName.toLatin1()); + const QByteArray latinZone(zoneName == QLatin1String("Z") + ? QByteArray("UTC") : zoneName.toLatin1()); timeZone = QTimeZone(latinZone); tspec = timeZone.isValid() ? (QTimeZone::isTimeZoneIdAvailable(latinZone) @@ -1595,6 +1596,10 @@ QDateTimeParser::findTimeZone(QStringRef str, const QDateTime &when, while (index > 0) { str.truncate(index); + if (str == QLatin1String("Z")) { + offset = 0; // "Zulu" time - a.k.a. UTC + break; + } QTimeZone zone(str.toLatin1()); if (zone.isValid()) { offset = zone.offsetFromUtc(when); diff --git a/src/gui/kernel/qhighdpiscaling.cpp b/src/gui/kernel/qhighdpiscaling.cpp index 085652879c..078f185d08 100644 --- a/src/gui/kernel/qhighdpiscaling.cpp +++ b/src/gui/kernel/qhighdpiscaling.cpp @@ -376,8 +376,22 @@ qreal QHighDpiScaling::screenSubfactor(const QPlatformScreen *screen) { qreal factor = qreal(1.0); if (screen) { - if (m_usePixelDensity) - factor *= screen->pixelDensity(); + if (m_usePixelDensity) { + qreal pixelDensity = screen->pixelDensity(); + + // Pixel density reported by the screen is sometimes not precise enough, + // so recalculate it: divide px (physical pixels) by dp (device-independent pixels) + // for both width and height, and then use the average if it is different from + // the one initially reported by the screen + QRect screenGeometry = screen->geometry(); + qreal wFactor = qreal(screenGeometry.width()) / qRound(screenGeometry.width() / pixelDensity); + qreal hFactor = qreal(screenGeometry.height()) / qRound(screenGeometry.height() / pixelDensity); + qreal averageDensity = (wFactor + hFactor) / 2; + if (!qFuzzyCompare(pixelDensity, averageDensity)) + pixelDensity = averageDensity; + + factor *= pixelDensity; + } if (m_screenFactorSet) { QVariant screenFactor = screen->screen()->property(scaleFactorProperty); if (screenFactor.isValid()) diff --git a/src/gui/util/qshadergraphloader.cpp b/src/gui/util/qshadergraphloader.cpp index c7560d9105..8d92c73a5a 100644 --- a/src/gui/util/qshadergraphloader.cpp +++ b/src/gui/util/qshadergraphloader.cpp @@ -48,10 +48,13 @@ QT_BEGIN_NAMESPACE +void qt_register_ShaderLanguage_enums(); + QShaderGraphLoader::QShaderGraphLoader() Q_DECL_NOTHROW : m_status(Null), m_device(nullptr) { + qt_register_ShaderLanguage_enums(); } QShaderGraphLoader::Status QShaderGraphLoader::status() const Q_DECL_NOTHROW diff --git a/src/gui/util/qshaderlanguage.cpp b/src/gui/util/qshaderlanguage.cpp index 4a0da5bfb5..f9192f5ff3 100644 --- a/src/gui/util/qshaderlanguage.cpp +++ b/src/gui/util/qshaderlanguage.cpp @@ -43,14 +43,12 @@ QT_BEGIN_NAMESPACE -namespace { - void registerEnums() - { - qRegisterMetaType<QShaderLanguage::StorageQualifier>(); - qRegisterMetaType<QShaderLanguage::VariableType>(); - } +// Note: to be invoked explicitly. Relying for example on +// Q_COREAPP_STARTUP_FUNCTION would not be acceptable in static builds. +void qt_register_ShaderLanguage_enums() +{ + qRegisterMetaType<QShaderLanguage::StorageQualifier>(); + qRegisterMetaType<QShaderLanguage::VariableType>(); } -Q_COREAPP_STARTUP_FUNCTION(registerEnums) - QT_END_NAMESPACE diff --git a/src/plugins/platforms/cocoa/qcocoaglcontext.mm b/src/plugins/platforms/cocoa/qcocoaglcontext.mm index 5ed81a7f1b..be5029b7e0 100644 --- a/src/plugins/platforms/cocoa/qcocoaglcontext.mm +++ b/src/plugins/platforms/cocoa/qcocoaglcontext.mm @@ -152,9 +152,32 @@ QCocoaGLContext::QCocoaGLContext(const QSurfaceFormat &format, QPlatformOpenGLCo QMacAutoReleasePool pool; // For the SG Canvas render thread + m_shareContext = share ? static_cast<QCocoaGLContext *>(share)->nsOpenGLContext() : nil; + + if (m_shareContext) { + // Allow sharing between 3.2 Core and 4.1 Core profile versions in + // cases where NSOpenGLContext creates a 4.1 context where a 3.2 + // context was requested. Due to the semantics of QSurfaceFormat + // this 4.1 version can find its way onto the format for the new + // context, even though it was at no point requested by the user. + GLint shareContextRequestedProfile; + [m_shareContext.pixelFormat getValues:&shareContextRequestedProfile + forAttribute:NSOpenGLPFAOpenGLProfile forVirtualScreen:0]; + auto shareContextActualProfile = share->format().version(); + + if (shareContextRequestedProfile == NSOpenGLProfileVersion3_2Core && + shareContextActualProfile >= qMakePair(4, 1)) { + + // There is a mismatch, downgrade requested format to make the + // NSOpenGLPFAOpenGLProfile attributes match. (NSOpenGLContext will + // fail to create a new context if there is a mismatch). + if (m_format.version() >= qMakePair(4, 1)) + m_format.setVersion(3, 2); + } + } + // create native context for the requested pixel format and share NSOpenGLPixelFormat *pixelFormat = createNSOpenGLPixelFormat(m_format); - m_shareContext = share ? static_cast<QCocoaGLContext *>(share)->nsOpenGLContext() : nil; m_context = [[NSOpenGLContext alloc] initWithFormat:pixelFormat shareContext:m_shareContext]; // retry without sharing on context creation failure. diff --git a/src/sql/kernel/qsqlfield.cpp b/src/sql/kernel/qsqlfield.cpp index 59b992e803..a258d44df7 100644 --- a/src/sql/kernel/qsqlfield.cpp +++ b/src/sql/kernel/qsqlfield.cpp @@ -155,6 +155,19 @@ public: */ /*! + Constructs an empty field called \a fieldName of variant type \a type. + + \sa setRequiredStatus(), setLength(), setPrecision(), setDefaultValue(), + setGenerated(), setReadOnly() +*/ +QSqlField::QSqlField(const QString &fieldName, QVariant::Type type) +{ + d = new QSqlFieldPrivate(fieldName, type, QString()); + val = QVariant(type); +} + +/*! + \overload Constructs an empty field called \a fieldName of variant type \a type in \a table. diff --git a/src/sql/kernel/qsqlfield.h b/src/sql/kernel/qsqlfield.h index 30474735f4..8650ba8715 100644 --- a/src/sql/kernel/qsqlfield.h +++ b/src/sql/kernel/qsqlfield.h @@ -55,8 +55,9 @@ public: enum RequiredStatus { Unknown = -1, Optional = 0, Required = 1 }; explicit QSqlField(const QString& fieldName = QString(), - QVariant::Type type = QVariant::Invalid, - const QString &tableName = QString()); + QVariant::Type type = QVariant::Invalid); + QSqlField(const QString &fieldName, QVariant::Type type, + const QString &tableName); QSqlField(const QSqlField& other); QSqlField& operator=(const QSqlField& other); diff --git a/tests/auto/corelib/tools/qdatetime/tst_qdatetime.cpp b/tests/auto/corelib/tools/qdatetime/tst_qdatetime.cpp index c0ed88e154..7a047c67de 100644 --- a/tests/auto/corelib/tools/qdatetime/tst_qdatetime.cpp +++ b/tests/auto/corelib/tools/qdatetime/tst_qdatetime.cpp @@ -2396,8 +2396,8 @@ void tst_QDateTime::fromStringStringFormat_data() QTest::newRow("data14") << QString("32.01.2004") << QString("dd.MM.yyyy") << invalidDateTime(); QTest::newRow("data15") << QString("Thu January 2004") << QString("ddd MMMM yyyy") << QDateTime(QDate(2004, 1, 1), QTime()); QTest::newRow("data16") << QString("2005-06-28T07:57:30.001Z") - << QString("yyyy-MM-ddThh:mm:ss.zZ") - << QDateTime(QDate(2005, 06, 28), QTime(07, 57, 30, 1)); + << QString("yyyy-MM-ddThh:mm:ss.zt") + << QDateTime(QDate(2005, 06, 28), QTime(07, 57, 30, 1), Qt::UTC); } void tst_QDateTime::fromStringStringFormat() |