From 2e5cfa1ad46ecfcfe7aea8950434bedfbbb6f43b Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Mon, 20 Apr 2015 12:27:33 +0200 Subject: Bump version Change-Id: I9435dd001b6067464d7c04fbdf92b5b3ad546bac --- src/corelib/global/qglobal.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/corelib/global') diff --git a/src/corelib/global/qglobal.h b/src/corelib/global/qglobal.h index 455582e310..6d7874ecb6 100644 --- a/src/corelib/global/qglobal.h +++ b/src/corelib/global/qglobal.h @@ -37,11 +37,11 @@ #include -#define QT_VERSION_STR "5.4.2" +#define QT_VERSION_STR "5.4.3" /* QT_VERSION is (major << 16) + (minor << 8) + patch. */ -#define QT_VERSION 0x050402 +#define QT_VERSION 0x050403 /* can be used like #if (QT_VERSION >= QT_VERSION_CHECK(4, 4, 0)) */ -- cgit v1.2.3 From fe1fb593ae52fa3e4069826f123cc9fe6705e92d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tor=20Arne=20Vestb=C3=B8?= Date: Thu, 19 Mar 2015 13:09:00 +0100 Subject: Make it explicit that a few Qt::WindowFlags are overlapping Change-Id: Ia161fb9b7196d139e22fe7b3b576c5c72ee8a2f1 Reviewed-by: Oswald Buddenhagen Reviewed-by: Simon Hausmann --- src/corelib/global/qnamespace.h | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'src/corelib/global') diff --git a/src/corelib/global/qnamespace.h b/src/corelib/global/qnamespace.h index 79ddf81b38..82b383e69c 100644 --- a/src/corelib/global/qnamespace.h +++ b/src/corelib/global/qnamespace.h @@ -294,10 +294,13 @@ public: WindowCloseButtonHint = 0x08000000, MacWindowToolBarButtonHint = 0x10000000, BypassGraphicsProxyWidget = 0x20000000, - WindowOkButtonHint = 0x00080000, - WindowCancelButtonHint = 0x00100000, NoDropShadowWindowHint = 0x40000000, - WindowFullscreenButtonHint = 0x80000000 + WindowFullscreenButtonHint = 0x80000000, + + // The following enums have overlapping values with other enums. + // This was not intentional, but it's too late to change now. + WindowOkButtonHint = 0x00080000, // WindowTransparentForInput + WindowCancelButtonHint = 0x00100000 // WindowOverridesSystemGestures }; Q_DECLARE_FLAGS(WindowFlags, WindowType) -- cgit v1.2.3 From 36d6eb721e7d5997ade75e289d4088dc48678d0d Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Tue, 5 May 2015 08:43:42 -0700 Subject: Require -fPIC instead of just -fPIE for -reduce-relocations GCC 5 combined with a recent binutils have a new optimization that allows them to generate copy relocations even in -fPIE code. Clang has the same functionality when compiling an executable with -flto. We need to let the compilers know that they cannot use copy relocations, so they need to use really position-independent code. Position independent code throughout is not really required. We just need the compilers to use position-independent access to symbols coming from the Qt libraries, but there's currently no other way of doing that. Task-number: QTBUG-45755 Change-Id: I0d4913955e3745b69672ffff13db5df7377398c5 Reviewed-by: Simon Hausmann Reviewed-by: Oswald Buddenhagen --- src/corelib/global/qglobal.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/corelib/global') diff --git a/src/corelib/global/qglobal.h b/src/corelib/global/qglobal.h index 455582e310..ef84662036 100644 --- a/src/corelib/global/qglobal.h +++ b/src/corelib/global/qglobal.h @@ -1047,9 +1047,9 @@ Q_CORE_EXPORT int qrand(); # define QT_NO_SHAREDMEMORY #endif -#if !defined(QT_BOOTSTRAPPED) && defined(QT_REDUCE_RELOCATIONS) && defined(__ELF__) && !defined(__PIC__) && !defined(__PIE__) +#if !defined(QT_BOOTSTRAPPED) && defined(QT_REDUCE_RELOCATIONS) && defined(__ELF__) && !defined(__PIC__) # error "You must build your code with position independent code if Qt was built with -reduce-relocations. "\ - "Compile your code with -fPIC or -fPIE." + "Compile your code with -fPIC." #endif namespace QtPrivate { -- cgit v1.2.3 From 3eca75de67b3fd2c890715b30c7899cebc096fe9 Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Mon, 11 May 2015 18:30:00 +0900 Subject: Make qglobal.h complain if you use -fPIE Prior to Qt 5.4.2 (commit 36d6eb721e7d5997ade75e289d4088dc48678d0d), we allowed it, but now we need to enforce that it is not used. Note that -fPIE does define __PIC__, so we need this to catch the use of -fPIE. [ChangeLog][Important Behavior Changes] On x86 and x86-64 systems with ELF binaries (especially Linux), due to a new optimization in GCC 5.x in combination with a recent version of GNU binutils, compiling Qt applications with -fPIE is no longer enough. Applications now need to be compiled with the -fPIC option if Qt's option "reduce relocations" is active. Note that Clang is known to generate incompatible code even with -fPIC if the -flto option is active. Task-number: QTBUG-45755 Change-Id: I66a35ce5f88941f29aa6ffff13dd210e0aa2728f Reviewed-by: Dmitry Shachnev Reviewed-by: Simon Hausmann --- src/corelib/global/qglobal.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/corelib/global') diff --git a/src/corelib/global/qglobal.h b/src/corelib/global/qglobal.h index ef84662036..4547877da6 100644 --- a/src/corelib/global/qglobal.h +++ b/src/corelib/global/qglobal.h @@ -1047,9 +1047,9 @@ Q_CORE_EXPORT int qrand(); # define QT_NO_SHAREDMEMORY #endif -#if !defined(QT_BOOTSTRAPPED) && defined(QT_REDUCE_RELOCATIONS) && defined(__ELF__) && !defined(__PIC__) +#if !defined(QT_BOOTSTRAPPED) && defined(QT_REDUCE_RELOCATIONS) && defined(__ELF__) && (!defined(__PIC__) || defined(__PIE__)) # error "You must build your code with position independent code if Qt was built with -reduce-relocations. "\ - "Compile your code with -fPIC." + "Compile your code with -fPIC (-fPIE is not enough)." #endif namespace QtPrivate { -- cgit v1.2.3 From 6c20a01cb9032a6abc0b82549a4242e2441894f7 Mon Sep 17 00:00:00 2001 From: Caroline Chao Date: Wed, 15 Apr 2015 13:26:55 +0200 Subject: QSysInfo: Expand Linux distribution detection Expand Linux distribution detection to /etc/redhat-release and /etc/debian_version to follow what /usr/bin/lsb_release script does. If /usr/bin/lsb_release fails to extract the distribution information from /etc/lsb-release, it then checks /etc/redhat-release and, as a last fallback, /etc/debian_version. Some Red Hat distributions have a /etc/lsb-release file that does not provide the values we are looking for (DISTRIB_ID, DISTRIB_RELEASE and DISTRIB_DESCRIPTION). If both productType or productVersion are empty after reading /etc/lsb-release, readEtcLsbRelease() will return false, allowing further parsing of /etc/redhat-release. This scenario mimics what the /usr/bin/lsb_release script does if /etc/lsb-release does not contains enough information. The productType and productVersion returned by QSysInfo after reading /etc/redhat-release match the distributor id and release information returned by the /usr/bin/lsb_release script. For Debian Linux distributions where /etc/os-release, /etc/lsb-release and /etc/redhat-release are not available nor usable, the /usr/bin/lsb_release script also checks for the /etc/debian_version file. In this case, we also enable parsing of /etc/debian_version to retrieve a fallback productVersion, the productType being set to Debian. Change-Id: Ia20d513d78be8a8ee8c0410d0aaa052fde81a41d Reviewed-by: Oswald Buddenhagen --- src/corelib/global/qglobal.cpp | 86 +++++++++++++++++++++++++++++++++++++----- 1 file changed, 76 insertions(+), 10 deletions(-) (limited to 'src/corelib/global') diff --git a/src/corelib/global/qglobal.cpp b/src/corelib/global/qglobal.cpp index eb8dd73727..d6f5162648 100644 --- a/src/corelib/global/qglobal.cpp +++ b/src/corelib/global/qglobal.cpp @@ -2120,9 +2120,9 @@ const QSysInfo::WinVersion QSysInfo::WindowsVersion = QSysInfo::windowsVersion() # define USE_ETC_OS_RELEASE struct QUnixOSVersion { - // from /etc/os-release older /etc/lsb-release - QString productType; // $ID $DISTRIB_ID - QString productVersion; // $VERSION_ID $DISTRIB_RELEASE + // from /etc/os-release older /etc/lsb-release // redhat /etc/redhat-release // debian /etc/debian_version + QString productType; // $ID $DISTRIB_ID // single line file containing: // Debian + QString productVersion; // $VERSION_ID $DISTRIB_RELEASE // // single line file QString prettyName; // $PRETTY_NAME $DISTRIB_DESCRIPTION }; @@ -2134,24 +2134,32 @@ static QString unquote(const char *begin, const char *end) } return QString::fromLatin1(begin, end - begin); } - -static bool readEtcFile(QUnixOSVersion &v, const char *filename, - const QByteArray &idKey, const QByteArray &versionKey, const QByteArray &prettyNameKey) +static QByteArray getEtcFileContent(const char *filename) { // we're avoiding QFile here int fd = qt_safe_open(filename, O_RDONLY); if (fd == -1) - return false; + return QByteArray(); QT_STATBUF sbuf; if (QT_FSTAT(fd, &sbuf) == -1) { qt_safe_close(fd); - return false; + return QByteArray(); } QByteArray buffer(sbuf.st_size, Qt::Uninitialized); buffer.resize(qt_safe_read(fd, buffer.data(), sbuf.st_size)); qt_safe_close(fd); + return buffer; +} + +static bool readEtcFile(QUnixOSVersion &v, const char *filename, + const QByteArray &idKey, const QByteArray &versionKey, const QByteArray &prettyNameKey) +{ + + QByteArray buffer = getEtcFileContent(filename); + if (buffer.isEmpty()) + return false; const char *ptr = buffer.constData(); const char *end = buffer.constEnd(); @@ -2215,14 +2223,72 @@ static bool readEtcLsbRelease(QUnixOSVersion &v) } } - return ok; + // some distributions have a /etc/lsb-release file that does not provide the values + // we are looking for, i.e. DISTRIB_ID, DISTRIB_RELEASE and DISTRIB_DESCRIPTION. + // Assuming that neither DISTRIB_ID nor DISTRIB_RELEASE were found, or contained valid values, + // returning false for readEtcLsbRelease will allow further /etc/-release parsing. + return ok && !(v.productType.isEmpty() && v.productVersion.isEmpty()); } +#if defined(Q_OS_LINUX) +static QByteArray getEtcFileFirstLine(const char *fileName) +{ + QByteArray buffer = getEtcFileContent(fileName); + if (buffer.isEmpty()) + return QByteArray(); + + const char *ptr = buffer.constData(); + int eol = buffer.indexOf("\n"); + return QByteArray(ptr, eol).trimmed(); +} + +static bool readEtcRedHatRelease(QUnixOSVersion &v) +{ + // /etc/redhat-release analysed should be a one line file + // the format of its content is + // i.e. "Red Hat Enterprise Linux Workstation release 6.5 (Santiago)" + QByteArray line = getEtcFileFirstLine("/etc/redhat-release"); + if (line.isEmpty()) + return false; + + v.prettyName = QString::fromLatin1(line); + + const char keyword[] = "release "; + int releaseIndex = line.indexOf(keyword); + v.productType = QString::fromLatin1(line.mid(0, releaseIndex)).remove(QLatin1Char(' ')); + int spaceIndex = line.indexOf(' ', releaseIndex + strlen(keyword)); + v.productVersion = QString::fromLatin1(line.mid(releaseIndex + strlen(keyword), spaceIndex > -1 ? spaceIndex - releaseIndex - strlen(keyword) : -1)); + return true; +} + +static bool readEtcDebianVersion(QUnixOSVersion &v) +{ + // /etc/debian_version analysed should be a one line file + // the format of its content is + // i.e. "jessie/sid" + QByteArray line = getEtcFileFirstLine("/etc/debian_version"); + if (line.isEmpty()) + return false; + + v.productType = QStringLiteral("Debian"); + v.productVersion = QString::fromLatin1(line); + return true; +} +#endif + static bool findUnixOsVersion(QUnixOSVersion &v) { if (readEtcOsRelease(v)) return true; - return readEtcLsbRelease(v); + if (readEtcLsbRelease(v)) + return true; +#if defined(Q_OS_LINUX) + if (readEtcRedHatRelease(v)) + return true; + if (readEtcDebianVersion(v)) + return true; +#endif + return false; } # endif // USE_ETC_OS_RELEASE #endif // Q_OS_UNIX -- cgit v1.2.3 From 7d1ec1ae9e263df1a655e13f8feea7b5a5c7d9ed Mon Sep 17 00:00:00 2001 From: Volker Krause Date: Mon, 11 May 2015 10:45:38 +0200 Subject: Reorder member variables to avoid padding. Saves 8 byte in each case on 64bit systems, no change on 32bit systems. Change-Id: I2a2e8786fc7914ee9ae369ba05bedfc9e5e0ca5c Reviewed-by: Marc Mutz --- src/corelib/global/qlogging.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/corelib/global') diff --git a/src/corelib/global/qlogging.cpp b/src/corelib/global/qlogging.cpp index d9d21c535c..447a875655 100644 --- a/src/corelib/global/qlogging.cpp +++ b/src/corelib/global/qlogging.cpp @@ -972,8 +972,8 @@ struct QMessagePattern { QElapsedTimer timer; #endif #ifdef QLOGGING_HAVE_BACKTRACE - int backtraceDepth; QString backtraceSeparator; + int backtraceDepth; #endif bool fromEnvironment; @@ -986,8 +986,8 @@ QMessagePattern::QMessagePattern() : literals(0) , tokens(0) #ifdef QLOGGING_HAVE_BACKTRACE - , backtraceDepth(5) , backtraceSeparator(QLatin1Char('|')) + , backtraceDepth(5) #endif , fromEnvironment(false) { -- cgit v1.2.3 From c056e529c808f52e4d9e77b6112e805bdc7d660e Mon Sep 17 00:00:00 2001 From: Nico Vertriest Date: Thu, 7 May 2015 10:33:39 +0200 Subject: Doc: added doc to undocumented functions MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Task-number: QTBUG-36985 Change-Id: Ia98654f88cf5da77245b3fcd903b860d12862fc2 Reviewed-by: Martin Smith Reviewed-by: Topi Reiniƶ --- src/corelib/global/qnamespace.qdoc | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'src/corelib/global') diff --git a/src/corelib/global/qnamespace.qdoc b/src/corelib/global/qnamespace.qdoc index f9d968d47b..38ee8edb49 100644 --- a/src/corelib/global/qnamespace.qdoc +++ b/src/corelib/global/qnamespace.qdoc @@ -2907,6 +2907,23 @@ \sa QWidget::grabGesture(), QGraphicsObject::grabGesture() */ +/*! + \enum Qt::NativeGestureType + \since 5.2 + + This enum returns the gesture type. + + \value BeginNativeGesture Sent before gesture event stream. + \value EndNativeGesture Sent after gesture event stream. + \value PanNativeGesture Sent after a panning gesture. + Similar to a click-and-drag mouse movement. + \value ZoomNativeGesture Specifies the magnification delta in percent. + \value SmartZoomNativeGesture Boolean magnification state. + \value RotateNativeGesture Rotation delta in degrees. + \value SwipeNativeGesture Sent after a swipe movements. + +*/ + /*! \enum Qt::NavigationMode \since 4.6 -- cgit v1.2.3 From 02f6b21bbc4f1f7afc30a87227c3a0787a5d2225 Mon Sep 17 00:00:00 2001 From: Olivier Goffart Date: Thu, 23 Apr 2015 12:02:40 +0200 Subject: QMetaType: Fix compilation with non default constructible Q_GADGET Do not try to automatically register the meta type for Q_GADGET that are not default constructible. This fixes a source incompatibility in the function pointer syntax of QObject::connect when such types are used as an argument of a signal. Task-number: QTBUG-45721 Change-Id: I3065f6d57bc1f37e16988d2dee99118de250ca56 Reviewed-by: Thiago Macieira --- src/corelib/global/qtypetraits.h | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) (limited to 'src/corelib/global') diff --git a/src/corelib/global/qtypetraits.h b/src/corelib/global/qtypetraits.h index 3a305713e6..488e257e0f 100644 --- a/src/corelib/global/qtypetraits.h +++ b/src/corelib/global/qtypetraits.h @@ -506,6 +506,27 @@ Q_STATIC_ASSERT((!is_unsigned::value)); Q_STATIC_ASSERT((!is_signed::value)); Q_STATIC_ASSERT(( is_signed::value)); +template struct is_default_constructible; + +template<> struct is_default_constructible +{ +protected: + template struct test { typedef char type; }; +public: + static bool const value = false; +}; +template<> struct is_default_constructible<>::test { typedef double type; }; + +template struct is_default_constructible : is_default_constructible<> +{ +private: + template static typename test::type sfinae(U*); + template static char sfinae(...); +public: + static bool const value = sizeof(sfinae(0)) > 1; +}; + + } // namespace QtPrivate QT_END_NAMESPACE -- cgit v1.2.3 From 73d3f1b116a584b97ec0defc9df68bc3507d5cc7 Mon Sep 17 00:00:00 2001 From: Tasuku Suzuki Date: Tue, 26 May 2015 17:05:35 +0900 Subject: Doc fix typo in QT_MESSAGE_PATTERN Change-Id: I1850c3eb07b06a4174c0e6819074040c4d62c423 Reviewed-by: Kai Koehne --- src/corelib/global/qlogging.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/corelib/global') diff --git a/src/corelib/global/qlogging.cpp b/src/corelib/global/qlogging.cpp index 447a875655..88882bbe8f 100644 --- a/src/corelib/global/qlogging.cpp +++ b/src/corelib/global/qlogging.cpp @@ -1737,7 +1737,7 @@ void qErrnoWarning(int code, const char *msg, ...) Example: \code - QT_MESSAGE_PATTERN="[%{time yyyyMMdd h:mm:ss.zzz t} %{if-debug}D{%endif}%{if-info}I%{endif}%{if-warning}W%{endif}%{if-critical}C%{endif}%{if-fatal}F%{endif}] %{file}:%{line} - %{message}" + QT_MESSAGE_PATTERN="[%{time yyyyMMdd h:mm:ss.zzz t} %{if-debug}D%{endif}%{if-info}I%{endif}%{if-warning}W%{endif}%{if-critical}C%{endif}%{if-fatal}F%{endif}] %{file}:%{line} - %{message}" \endcode The default \a pattern is "%{if-category}%{category}: %{endif}%{message}". -- cgit v1.2.3 From 547141352242f7f4eebc6814af7a5ea0f3dff5f8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tor=20Arne=20Vestb=C3=B8?= Date: Fri, 22 May 2015 14:01:59 +0200 Subject: Add shared implementation of a NSAutoreleasePool wrapper to qglobal We have at least 5 different (but equal) implementations of a wrapper in Qt, and some code uses explicit NSAutoreleasePools. Having a shared implementation lets us clean up things a bit and makes it easier to reason about which pools are actually needed. Change-Id: I2fd8eefc3ae7308595ef9899b7820206268362a5 Reviewed-by: Tim Blechmann Reviewed-by: Simon Hausmann --- src/corelib/global/qglobal.h | 64 +++++++++++++++++++++++++++----------------- 1 file changed, 39 insertions(+), 25 deletions(-) (limited to 'src/corelib/global') diff --git a/src/corelib/global/qglobal.h b/src/corelib/global/qglobal.h index c4e2f7609c..55aa34223e 100644 --- a/src/corelib/global/qglobal.h +++ b/src/corelib/global/qglobal.h @@ -321,6 +321,15 @@ typedef double qreal; # define Q_NETWORK_EXPORT #endif +/* + Some classes do not permit copies to be made of an object. These + classes contains a private copy constructor and assignment + operator to disable copying (the compiler gives an error message). +*/ +#define Q_DISABLE_COPY(Class) \ + Class(const Class &) Q_DECL_EQ_DELETE;\ + Class &operator=(const Class &) Q_DECL_EQ_DELETE; + /* No, this is not an evil backdoor. QT_BUILD_INTERNAL just exports more symbols for Qt's internal unit tests. If you want slower loading times and more @@ -543,7 +552,21 @@ template Q_DECL_CONSTEXPR inline const T &qBound(const T &min, const T &val, const T &max) { return qMax(min, qMin(max, val)); } -#ifdef Q_OS_DARWIN +#ifndef Q_FORWARD_DECLARE_OBJC_CLASS +# ifdef __OBJC__ +# define Q_FORWARD_DECLARE_OBJC_CLASS(classname) @class classname +# else +# define Q_FORWARD_DECLARE_OBJC_CLASS(classname) typedef struct objc_object classname +# endif +#endif +#ifndef Q_FORWARD_DECLARE_CF_TYPE +# define Q_FORWARD_DECLARE_CF_TYPE(type) typedef const struct __ ## type * type ## Ref +#endif +#ifndef Q_FORWARD_DECLARE_MUTABLE_CF_TYPE +# define Q_FORWARD_DECLARE_MUTABLE_CF_TYPE(type) typedef struct __ ## type * type ## Ref +#endif + +#ifdef Q_OS_MAC # define QT_MAC_PLATFORM_SDK_EQUAL_OR_ABOVE(osx, ios) \ ((defined(__MAC_OS_X_VERSION_MAX_ALLOWED) && osx != __MAC_NA && __MAC_OS_X_VERSION_MAX_ALLOWED >= osx) || \ (defined(__IPHONE_OS_VERSION_MAX_ALLOWED) && ios != __IPHONE_NA && __IPHONE_OS_VERSION_MAX_ALLOWED >= ios)) @@ -561,7 +584,21 @@ Q_DECL_CONSTEXPR inline const T &qBound(const T &min, const T &val, const T &max QT_MAC_DEPLOYMENT_TARGET_BELOW(__MAC_NA, ios) # define QT_OSX_DEPLOYMENT_TARGET_BELOW(osx) \ QT_MAC_DEPLOYMENT_TARGET_BELOW(osx, __IPHONE_NA) -#endif + +Q_FORWARD_DECLARE_OBJC_CLASS(NSAutoreleasePool); + +// Implemented in qcore_mac_objc.mm +class Q_CORE_EXPORT QMacAutoReleasePool +{ +public: + QMacAutoReleasePool(); + ~QMacAutoReleasePool(); +private: + Q_DISABLE_COPY(QMacAutoReleasePool); + NSAutoreleasePool *pool; +}; + +#endif // Q_OS_MAC /* Data stream functions are provided by many classes (defined in qdatastream.h) @@ -1033,15 +1070,6 @@ Q_CORE_EXPORT QString qtTrId(const char *id, int n = -1); { return T::dynamic_cast_will_always_fail_because_rtti_is_disabled; } #endif -/* - Some classes do not permit copies to be made of an object. These - classes contains a private copy constructor and assignment - operator to disable copying (the compiler gives an error message). -*/ -#define Q_DISABLE_COPY(Class) \ - Class(const Class &) Q_DECL_EQ_DELETE;\ - Class &operator=(const Class &) Q_DECL_EQ_DELETE; - class QByteArray; Q_CORE_EXPORT QByteArray qgetenv(const char *varName); Q_CORE_EXPORT bool qputenv(const char *varName, const QByteArray& value); @@ -1076,20 +1104,6 @@ template struct QConditional { typedef T Type; template struct QConditional { typedef F Type; }; } -#ifndef Q_FORWARD_DECLARE_OBJC_CLASS -# ifdef __OBJC__ -# define Q_FORWARD_DECLARE_OBJC_CLASS(classname) @class classname -# else -# define Q_FORWARD_DECLARE_OBJC_CLASS(classname) typedef struct objc_object classname -# endif -#endif -#ifndef Q_FORWARD_DECLARE_CF_TYPE -# define Q_FORWARD_DECLARE_CF_TYPE(type) typedef const struct __ ## type * type ## Ref -#endif -#ifndef Q_FORWARD_DECLARE_MUTABLE_CF_TYPE -# define Q_FORWARD_DECLARE_MUTABLE_CF_TYPE(type) typedef struct __ ## type * type ## Ref -#endif - QT_END_NAMESPACE // We need to keep QTypeInfo, QSysInfo, QFlags, qDebug & family in qglobal.h for compatibility with Qt 4. -- cgit v1.2.3 From 95b6c4fed6521aa2212cab67cb8a6e5553e86117 Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Thu, 28 May 2015 11:21:35 -0700 Subject: Make qglobal.h only complain for GCC >= 5 about -fPIE Commit 3eca75de67b3fd2c890715b30c7899cebc096fe9 introduced the #error nagging about use of -fPIE, but it makes the transition quite difficult for people using other buildsystems. So let's give people a grace period and enforce only for GCC >= 5. Clang is affected, but differently. The problem only happens with -flto -- that is, it happens when the linker detects that it's creating a final executable. Maybe -Wl,-pie would fix it. Change-Id: If4d5ac8db0ed4a84a3eaffff13e275edc29a72b7 Reviewed-by: Simon Hausmann Reviewed-by: Dmitry Shachnev --- src/corelib/global/qglobal.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/corelib/global') diff --git a/src/corelib/global/qglobal.h b/src/corelib/global/qglobal.h index 4547877da6..d9742408a3 100644 --- a/src/corelib/global/qglobal.h +++ b/src/corelib/global/qglobal.h @@ -1047,7 +1047,8 @@ Q_CORE_EXPORT int qrand(); # define QT_NO_SHAREDMEMORY #endif -#if !defined(QT_BOOTSTRAPPED) && defined(QT_REDUCE_RELOCATIONS) && defined(__ELF__) && (!defined(__PIC__) || defined(__PIE__)) +#if !defined(QT_BOOTSTRAPPED) && defined(QT_REDUCE_RELOCATIONS) && defined(__ELF__) && \ + (!defined(__PIC__) || (defined(__PIE__) && defined(Q_CC_GNU) && Q_CC_GNU >= 500)) # error "You must build your code with position independent code if Qt was built with -reduce-relocations. "\ "Compile your code with -fPIC (-fPIE is not enough)." #endif -- cgit v1.2.3 From aff3f7f767617c9f569ed5101a12d677233be901 Mon Sep 17 00:00:00 2001 From: Simon Hausmann Date: Fri, 29 May 2015 12:29:55 +0200 Subject: Fix QIODevice::errorString() and other places where we expose errno Commit e486d69133178ccce7c75cf48201ab28efb20e44 changed the behavior of QString::fromLocal8Bit(const QByteArray &) to preserve embedded null characters. The embedded null character from qt_error_string()'s buffer is not something we want to preserve, it is merely a safe guard. Therefore let's strip it away. Change-Id: Iceac91551f51a1036a942ff30d246baea7a6fd7c Reviewed-by: Marc Mutz --- src/corelib/global/qglobal.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/corelib/global') diff --git a/src/corelib/global/qglobal.cpp b/src/corelib/global/qglobal.cpp index 2176a148b0..4f611bddbc 100644 --- a/src/corelib/global/qglobal.cpp +++ b/src/corelib/global/qglobal.cpp @@ -2955,7 +2955,7 @@ namespace { // depending on the return type static inline Q_DECL_UNUSED QString fromstrerror_helper(int, const QByteArray &buf) { - return QString::fromLocal8Bit(buf); + return QString::fromLocal8Bit(buf.constData()); } static inline Q_DECL_UNUSED QString fromstrerror_helper(const char *str, const QByteArray &) { -- cgit v1.2.3 From dd274a5455296fcfe8631c2c2c7271546e9547bc Mon Sep 17 00:00:00 2001 From: Kai Uwe Broulik Date: Mon, 1 Jun 2015 11:14:04 +0200 Subject: Rename ReturnKey to EnterKey This makes the terminology consistent with Sailfish OS and the QNX QPA. The kImePlatformDataReturnKeyType in the iOS QPA is not changed to not break compatibility. Also, improve documentation. Change-Id: I2780de5b1e9277185ae1d4d9bbc67e36682fbfba Reviewed-by: J-P Nurmi Reviewed-by: Richard Moe Gustavsen --- src/corelib/global/qnamespace.h | 22 +++++++++--------- src/corelib/global/qnamespace.qdoc | 47 +++++++++++++++++++------------------- 2 files changed, 35 insertions(+), 34 deletions(-) (limited to 'src/corelib/global') diff --git a/src/corelib/global/qnamespace.h b/src/corelib/global/qnamespace.h index 123e2edf0e..c6465ed087 100644 --- a/src/corelib/global/qnamespace.h +++ b/src/corelib/global/qnamespace.h @@ -1323,7 +1323,7 @@ public: ImAbsolutePosition = 0x400, ImTextBeforeCursor = 0x800, ImTextAfterCursor = 0x1000, - ImReturnKeyType = 0x2000, + ImEnterKeyType = 0x2000, ImPlatformData = 0x80000000, ImQueryInput = ImCursorRectangle | ImCursorPosition | ImSurroundingText | @@ -1363,15 +1363,15 @@ public: }; Q_DECLARE_FLAGS(InputMethodHints, InputMethodHint) - enum ReturnKeyType { - ReturnKeyDefault, - ReturnKeyEnter, - ReturnKeyDone, - ReturnKeyGo, - ReturnKeySend, - ReturnKeySearch, - ReturnKeyNext, - ReturnKeyPrevious + enum EnterKeyType { + EnterKeyDefault, + EnterKeyReturn, + EnterKeyDone, + EnterKeyGo, + EnterKeySend, + EnterKeySearch, + EnterKeyNext, + EnterKeyPrevious }; enum ToolButtonStyle { @@ -1697,7 +1697,7 @@ public: QT_Q_ENUM(InputMethodHint) QT_Q_ENUM(InputMethodQuery) QT_Q_FLAG(InputMethodHints) - QT_Q_ENUM(ReturnKeyType) + QT_Q_ENUM(EnterKeyType) QT_Q_FLAG(InputMethodQueries) QT_Q_FLAG(TouchPointStates) QT_Q_ENUM(ScreenOrientation) diff --git a/src/corelib/global/qnamespace.qdoc b/src/corelib/global/qnamespace.qdoc index d4d7b631ad..b981fed500 100644 --- a/src/corelib/global/qnamespace.qdoc +++ b/src/corelib/global/qnamespace.qdoc @@ -2527,7 +2527,7 @@ but \b{must} not return an empty string unless the cursor is at the start of the document. \value ImTextAfterCursor The plain text after the cursor. The widget can decide how much text to return, but \b{must} not return an empty string unless the cursor is at the end of the document. - \value ImReturnKeyType The return key type. + \value ImEnterKeyType The Enter key type. Masks: @@ -2538,31 +2538,32 @@ */ /*! - \enum Qt::ReturnKeyType + \enum Qt::EnterKeyType This can be used to alter the appearance of the Return key on an on screen keyboard. - Note that not all of these values are supported on all platforms. - - \value ReturnKeyDefault The default return key. - This can either be a button closing the keyboard, or a Return button - causing a new line in case of a multi-line input field. - \value ReturnKeyEnter Show a Return button that inserts a new line. - The keyboard will not close when this button is pressed. - \value ReturnKeyDone Show a "Done" button. - The keyboard will close when this button is pressed. - \value ReturnKeyGo Show a "Go" button. - Typically used in an address bar when entering an URL; the keyboard - will close when this button is pressed. - \value ReturnKeySend Show a "Send" button. - The keyboard will close when this button is pressed. - \value ReturnKeySearch Show a "Search" button. - The keyboard will close when this button is pressed. - \value ReturnKeyNext Show a "Next" button. - Typically used in a form to allow navigating to the next input field; - the keyboard will not close when this button is pressed. - \value ReturnKeyPrevious Show a "Previous" button. - The keyboard will not close when this button is pressed. + \note Not all of these values are supported on all platforms. + For unsuppoted values the default key will be used instead. + + \value EnterKeyDefault The default Enter key. + This can either be a button closing the keyboard, or a Return button + causing a new line in case of a multi-line input field. + \value EnterKeyReturn Show a Return button that inserts a new line. + The keyboard will not close when this button is pressed. + \value EnterKeyDone Show a "Done" button. + The keyboard will close when this button is pressed. + \value EnterKeyGo Show a "Go" button. + Typically used in an address bar when entering a URL; the keyboard + will close when this button is pressed. + \value EnterKeySend Show a "Send" button. + The keyboard will close when this button is pressed. + \value EnterKeySearch Show a "Search" button. + The keyboard will close when this button is pressed. + \value EnterKeyNext Show a "Next" button. + Typically used in a form to allow navigating to the next input field; + the keyboard will not close when this button is pressed. + \value EnterKeyPrevious Show a "Previous" button. + The keyboard will not close when this button is pressed. \since 5.6 */ -- cgit v1.2.3