summaryrefslogtreecommitdiffstats
path: root/src/corelib/global
diff options
context:
space:
mode:
authorRohan McGovern <rohan.mcgovern@nokia.com>2012-02-29 09:18:59 +1000
committerRohan McGovern <rohan.mcgovern@nokia.com>2012-02-29 09:23:14 +1000
commit98dd1781d9256f68025d2a2db408f4f5947f3214 (patch)
treedbe1424abd90014edb5546c920ca585ed62b46e3 /src/corelib/global
parent6c1bdc1854a7700c2b3a345b95f6a2fdca84037d (diff)
parentfa1b9070af66edb81b2a3735c1951f78b22bd666 (diff)
Merge master -> api_changes
Includes fixes for tst_qfiledialog2, tst_qtextedit autotests on mac. Change-Id: I49cac26894d31291a8339ccc1eb80b6a940f0827
Diffstat (limited to 'src/corelib/global')
-rw-r--r--src/corelib/global/qcompilerdetection.h77
-rw-r--r--src/corelib/global/qglobal.h45
-rw-r--r--src/corelib/global/qlibraryinfo.cpp67
-rw-r--r--src/corelib/global/qnamespace.h1
-rw-r--r--src/corelib/global/qnamespace.qdoc3
5 files changed, 31 insertions, 162 deletions
diff --git a/src/corelib/global/qcompilerdetection.h b/src/corelib/global/qcompilerdetection.h
index 5ab79092d2..b3787261be 100644
--- a/src/corelib/global/qcompilerdetection.h
+++ b/src/corelib/global/qcompilerdetection.h
@@ -76,14 +76,13 @@
# define Q_CC_SYM
/* "explicit" semantics implemented in 8.1e but keyword recognized since 7.5 */
# if defined(__SC__) && __SC__ < 0x750
-# define Q_NO_EXPLICIT_KEYWORD
+# error "Compiler not supported"
# endif
# define Q_NO_USING_KEYWORD
#elif defined(_MSC_VER)
# define Q_CC_MSVC
# define Q_CC_MSVC_NET
-# define Q_CANNOT_DELETE_CONSTANT
# define Q_OUTOFLINE_TEMPLATE inline
# define Q_NO_TEMPLATE_FRIENDS
# define Q_ALIGNOF(type) __alignof(type)
@@ -114,8 +113,7 @@
# define Q_CC_BOR
# define Q_INLINE_TEMPLATE
# if __BORLANDC__ < 0x502
-# define Q_NO_BOOL_TYPE
-# define Q_NO_EXPLICIT_KEYWORD
+# error "Compiler not supported"
# endif
# define Q_NO_USING_KEYWORD
@@ -140,45 +138,19 @@
# define Q_CC_MINGW
# endif
# if defined(__INTEL_COMPILER)
-/* Intel C++ also masquerades as GCC 3.2.0 */
+/* Intel C++ also masquerades as GCC */
# define Q_CC_INTEL
# endif
# if defined(__clang__)
-/* Clang also masquerades as GCC 4.2.1 */
+/* Clang also masquerades as GCC */
# define Q_CC_CLANG
# endif
-# ifdef __APPLE__
-# define Q_NO_DEPRECATED_CONSTRUCTORS
-# endif
-# if __GNUC__ == 2 && __GNUC_MINOR__ <= 7
-# define Q_FULL_TEMPLATE_INSTANTIATION
-# endif
-/* GCC 2.95 knows "using" but does not support it correctly */
-# if __GNUC__ == 2 && __GNUC_MINOR__ <= 95
-# define Q_NO_USING_KEYWORD
-# endif
-# if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 95)
-# define Q_ALIGNOF(type) __alignof__(type)
-# define Q_TYPEOF(expr) __typeof__(expr)
-# define Q_DECL_ALIGN(n) __attribute__((__aligned__(n)))
-# endif
-# if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 96)
-# define Q_LIKELY(expr) __builtin_expect(!!(expr), true)
-# define Q_UNLIKELY(expr) __builtin_expect(!!(expr), false)
-# endif
-/* GCC 3.1 and GCC 3.2 wrongly define _SB_CTYPE_MACROS on HP-UX */
-# if defined(Q_OS_HPUX) && __GNUC__ == 3 && __GNUC_MINOR__ >= 1
-# define Q_WRONG_SB_CTYPE_MACROS
-# endif
-/* GCC <= 3.3 cannot handle template friends */
-# if __GNUC__ < 3 || (__GNUC__ == 3 && __GNUC_MINOR__ <= 3)
-# define Q_NO_TEMPLATE_FRIENDS
-# endif
-/* Apple's GCC 3.1 chokes on our streaming qDebug() */
-# if defined(Q_OS_DARWIN) && __GNUC__ == 3 && (__GNUC_MINOR__ >= 1 && __GNUC_MINOR__ < 3)
-# define Q_BROKEN_DEBUG_STREAM
-# endif
-# if (defined(Q_CC_GNU) || defined(Q_CC_INTEL)) && !defined(QT_MOC_CPP)
+# define Q_ALIGNOF(type) __alignof__(type)
+# define Q_TYPEOF(expr) __typeof__(expr)
+# define Q_DECL_ALIGN(n) __attribute__((__aligned__(n)))
+# define Q_LIKELY(expr) __builtin_expect(!!(expr), true)
+# define Q_UNLIKELY(expr) __builtin_expect(!!(expr), false)
+# if !defined(QT_MOC_CPP)
# define Q_PACKED __attribute__ ((__packed__))
# define Q_NO_PACKED_REFERENCE
# ifndef __ARM_EABI__
@@ -251,12 +223,7 @@
# define Q_CC_XLC
# define Q_FULL_TEMPLATE_INSTANTIATION
# if __xlC__ < 0x400
-# define Q_NO_BOOL_TYPE
-# define Q_NO_EXPLICIT_KEYWORD
-# define Q_NO_USING_KEYWORD
-# define Q_OUTOFLINE_TEMPLATE inline
-# define Q_BROKEN_TEMPLATE_SPECIALIZATION
-# define Q_CANNOT_DELETE_CONSTANT
+# error "Compiler not supported"
# elif __xlC__ >= 0x0600
# define Q_ALIGNOF(type) __alignof__(type)
# define Q_TYPEOF(expr) __typeof__(expr)
@@ -280,7 +247,7 @@
- observed on Compaq C++ V6.3-002.
In any case versions prior to Compaq C++ V6.0-005 do not have bool. */
# if !defined(_BOOL_EXISTS)
-# define Q_NO_BOOL_TYPE
+# error "Compiler not supported"
# endif
/* Spurious (?) error messages observed on Compaq C++ V6.5-014. */
# define Q_NO_USING_KEYWORD
@@ -288,7 +255,6 @@
DEC C++ V5.5-004. */
# if __DECCXX_VER < 60060000
# define Q_BROKEN_TEMPLATE_SPECIALIZATION
-# define Q_CANNOT_DELETE_CONSTANT
# endif
/* avoid undefined symbol problems with out-of-line template members */
# define Q_OUTOFLINE_TEMPLATE inline
@@ -315,7 +281,7 @@
__BOOL_DEFINED
Defined in Microsoft C++ mode when bool is a keyword. */
# if !defined(_BOOL) && !defined(__BOOL_DEFINED)
-# define Q_NO_BOOL_TYPE
+# error "Compiler not supported"
# endif
/* The Comeau compiler is based on EDG and does define __EDG__ */
@@ -341,9 +307,8 @@
# elif defined(__DCC__)
# define Q_CC_DIAB
-# undef Q_NO_BOOL_TYPE
# if !defined(__bool)
-# define Q_NO_BOOL_TYPE
+# error "Compiler not supported"
# endif
/* The UnixWare 7 UDK compiler is based on EDG and does define __EDG__ */
@@ -407,7 +372,7 @@
# define Q_NO_TEMPLATE_FRIENDS
# endif
# if !defined(_BOOL)
-# define Q_NO_BOOL_TYPE
+# error "Compiler not supported"
# endif
# if defined(__SUNPRO_CC_COMPAT) && (__SUNPRO_CC_COMPAT <= 4)
# define Q_NO_USING_KEYWORD
@@ -415,9 +380,7 @@
# define Q_C_CALLBACKS
/* 4.2 compiler or older */
# else
-# define Q_NO_BOOL_TYPE
-# define Q_NO_EXPLICIT_KEYWORD
-# define Q_NO_USING_KEYWORD
+# error "Compiler not supported"
# endif
/* CDS++ does not seem to define __EDG__ or __EDG according to Reliant
@@ -426,7 +389,7 @@
# define Q_CC_EDG
# define Q_CC_CDS
# if !defined(_BOOL)
-# define Q_NO_BOOL_TYPE
+# error "Compiler not supported"
# endif
# define Q_BROKEN_TEMPLATE_SPECIALIZATION
@@ -449,11 +412,7 @@
# define Q_DECL_IMPORT Q_DECL_EXPORT
# endif
# else
-# define Q_CC_HP
-# define Q_NO_BOOL_TYPE
-# define Q_FULL_TEMPLATE_INSTANTIATION
-# define Q_BROKEN_TEMPLATE_SPECIALIZATION
-# define Q_NO_EXPLICIT_KEYWORD
+# error "Compiler not supported"
# endif
# define Q_NO_USING_KEYWORD /* ### check "using" status */
diff --git a/src/corelib/global/qglobal.h b/src/corelib/global/qglobal.h
index fb6eaeb452..99328d52ac 100644
--- a/src/corelib/global/qglobal.h
+++ b/src/corelib/global/qglobal.h
@@ -191,7 +191,7 @@ namespace QT_NAMESPACE {}
#endif
#ifndef Q_REQUIRED_RESULT
-# if defined(Q_CC_GNU) && !defined(Q_CC_INTEL) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 1))
+# if defined(Q_CC_GNU)
# define Q_REQUIRED_RESULT __attribute__ ((warn_unused_result))
# else
# define Q_REQUIRED_RESULT
@@ -275,11 +275,6 @@ typedef unsigned int uint;
typedef unsigned long ulong;
QT_END_INCLUDE_NAMESPACE
-#if defined(Q_NO_BOOL_TYPE)
-#error "Compiler doesn't support the bool type"
-#endif
-
-
/*
Constant bool values
*/
@@ -315,9 +310,7 @@ QT_END_INCLUDE_NAMESPACE
/*
Warnings and errors when using deprecated methods
*/
-#if defined(Q_MOC_RUN)
-# define Q_DECL_DEPRECATED Q_DECL_DEPRECATED
-#elif (defined(Q_CC_GNU) && !defined(Q_CC_INTEL) && (__GNUC__ - 0 > 3 || (__GNUC__ - 0 == 3 && __GNUC_MINOR__ - 0 >= 2))) || defined(Q_CC_RVCT)
+#if defined(Q_CC_GNU) || defined(Q_CC_RVCT)
# define Q_DECL_DEPRECATED __attribute__ ((__deprecated__))
#elif defined(Q_CC_MSVC)
# define Q_DECL_DEPRECATED __declspec(deprecated)
@@ -331,15 +324,6 @@ QT_END_INCLUDE_NAMESPACE
#ifndef Q_DECL_VARIABLE_DEPRECATED
# define Q_DECL_VARIABLE_DEPRECATED Q_DECL_DEPRECATED
#endif
-#ifndef Q_DECL_CONSTRUCTOR_DEPRECATED
-# if defined(Q_MOC_RUN)
-# define Q_DECL_CONSTRUCTOR_DEPRECATED Q_DECL_CONSTRUCTOR_DEPRECATED
-# elif defined(Q_NO_DEPRECATED_CONSTRUCTORS)
-# define Q_DECL_CONSTRUCTOR_DEPRECATED
-# else
-# define Q_DECL_CONSTRUCTOR_DEPRECATED Q_DECL_DEPRECATED
-# endif
-#endif
#if defined(QT_NO_DEPRECATED)
# undef QT_DEPRECATED
@@ -394,24 +378,13 @@ QT_END_INCLUDE_NAMESPACE
#ifdef QT_ASCII_CAST_WARNINGS
# define QT_ASCII_CAST_WARN Q_DECL_DEPRECATED
-# if defined(Q_CC_GNU) && __GNUC__ < 4
- /* gcc < 4 doesn't like Q_DECL_DEPRECATED in front of constructors */
-# define QT_ASCII_CAST_WARN_CONSTRUCTOR
-# else
-# define QT_ASCII_CAST_WARN_CONSTRUCTOR Q_DECL_CONSTRUCTOR_DEPRECATED
-# endif
#else
# define QT_ASCII_CAST_WARN
-# define QT_ASCII_CAST_WARN_CONSTRUCTOR
#endif
#if defined(__i386__) || defined(_WIN32) || defined(_WIN32_WCE)
# if defined(Q_CC_GNU)
-#if !defined(Q_CC_INTEL) && ((100*(__GNUC__ - 0) + 10*(__GNUC_MINOR__ - 0) + __GNUC_PATCHLEVEL__) >= 332)
# define QT_FASTCALL __attribute__((regparm(3)))
-#else
-# define QT_FASTCALL
-#endif
# elif defined(Q_CC_MSVC)
# define QT_FASTCALL __fastcall
# else
@@ -512,17 +485,12 @@ Q_DECL_CONSTEXPR inline const T &qBound(const T &min, const T &val, const T &max
class QDataStream;
-#if !defined(QT_NO_COP)
-# define QT_NO_COP
-#endif
-
#if defined(Q_OS_VXWORKS)
# define QT_NO_CRASHHANDLER // no popen
# define QT_NO_PROCESS // no exec*, no fork
# define QT_NO_LPR
# define QT_NO_SHAREDMEMORY // only POSIX, no SysV and in the end...
# define QT_NO_SYSTEMSEMAPHORE // not needed at all in a flat address space
-# define QT_NO_QWS_MULTIPROCESS // no processes
#endif
# include <QtCore/qfeatures.h>
@@ -1237,12 +1205,15 @@ class QFlags
int i;
public:
typedef Enum enum_type;
- Q_DECL_CONSTEXPR inline QFlags(const QFlags &f) : i(f.i) {}
+ // compiler-generated copy/move ctor/assignment operators are fine!
+#ifdef qdoc
+ inline QFlags(const QFlags &other);
+ inline QFlags &operator=(const QFlags &other);
+#endif
Q_DECL_CONSTEXPR inline QFlags(Enum f) : i(f) {}
Q_DECL_CONSTEXPR inline QFlags(Zero = 0) : i(0) {}
inline QFlags(QFlag f) : i(f) {}
- inline QFlags &operator=(const QFlags &f) { i = f.i; return *this; }
inline QFlags &operator&=(int mask) { i &= mask; return *this; }
inline QFlags &operator&=(uint mask) { i &= mask; return *this; }
inline QFlags &operator|=(QFlags f) { i |= f.i; return *this; }
@@ -1463,8 +1434,6 @@ Q_CORE_EXPORT int qrand();
#ifdef Q_OS_QNX
// QNX doesn't have SYSV style shared memory. Multiprocess QWS apps,
// shared fonts and QSystemSemaphore + QSharedMemory are not available
-# define QT_NO_QWS_MULTIPROCESS
-# define QT_NO_QWS_SHARE_FONTS
# define QT_NO_SYSTEMSEMAPHORE
# define QT_NO_SHAREDMEMORY
#endif
diff --git a/src/corelib/global/qlibraryinfo.cpp b/src/corelib/global/qlibraryinfo.cpp
index 61c750acaf..c871675334 100644
--- a/src/corelib/global/qlibraryinfo.cpp
+++ b/src/corelib/global/qlibraryinfo.cpp
@@ -348,71 +348,8 @@ QLibraryInfo::location(LibraryLocation loc)
QSettings *config = QLibraryInfoPrivate::configuration();
config->beginGroup(QLatin1String("Paths"));
- QString subKey;
- {
- /*
- find the child group whose version number is closest
- to the library version. for example and we have the
- following groups:
-
- Paths
- Paths/4.0
- Paths/4.1.2
- Paths/4.2.5
- Paths/5
-
- if QT_VERSION is 4.0.1, then we use 'Paths/4.0'
- if QT_VERSION is 4.1.5, then we use 'Paths/4.1.2'
- if QT_VERSION is 4.6.3, then we use 'Paths/4.2.5'
- if QT_VERSION is 6.0.2, then we use 'Paths/5'
-
- note: any of the trailing version numbers may be
- omitted (in which case, they default to zero),
- i.e. 4 == 4.0.0, 4.1 == 4.1.0, and so on
- */
- enum {
- QT_MAJOR = ((QT_VERSION >> 16) & 0xFF),
- QT_MINOR = ((QT_VERSION >> 8) & 0xFF),
- QT_PATCH = (QT_VERSION & 0xFF)
- };
- int maj = 0, min = 0, pat = 0;
- QStringList children = config->childGroups();
- for(int child = 0; child < children.size(); ++child) {
- QString cver = children.at(child);
- QStringList cver_list = cver.split(QLatin1Char('.'));
- if(cver_list.size() > 0 && cver_list.size() < 4) {
- bool ok;
- int cmaj = -1, cmin = -1, cpat = -1;
- cmaj = cver_list[0].toInt(&ok);
- if(!ok || cmaj < 0)
- continue;
- if(cver_list.size() >= 2) {
- cmin = cver_list[1].toInt(&ok);
- if(!ok)
- continue;
- if(cmin < 0)
- cmin = -1;
- }
- if(cver_list.size() >= 3) {
- cpat = cver_list[2].toInt(&ok);
- if(!ok)
- continue;
- if(cpat < 0)
- cpat = -1;
- }
- if((cmaj >= maj && cmaj <= QT_MAJOR) &&
- (cmin == -1 || (cmin >= min && cmin <= QT_MINOR)) &&
- (cpat == -1 || (cpat >= pat && cpat <= QT_PATCH)) &&
- config->contains(cver + QLatin1Char('/') + key)) {
- subKey = cver + QLatin1Char('/');
- maj = cmaj;
- min = cmin;
- pat = cpat;
- }
- }
- }
- }
- ret = config->value(subKey + key, defaultValue).toString();
+ ret = config->value(key, defaultValue).toString();
+
// expand environment variables in the form $(ENVVAR)
int rep;
QRegExp reg_var(QLatin1String("\\$\\(.*\\)"));
diff --git a/src/corelib/global/qnamespace.h b/src/corelib/global/qnamespace.h
index 2087d763de..4ea62c77a6 100644
--- a/src/corelib/global/qnamespace.h
+++ b/src/corelib/global/qnamespace.h
@@ -293,6 +293,7 @@ public:
WindowStaysOnTopHint = 0x00040000,
WindowTransparentForInput = 0x00080000,
WindowOverridesSystemGestures = 0x00100000,
+ WindowDoesNotAcceptFocus = 0x00200000,
CustomizeWindowHint = 0x02000000,
WindowStaysOnBottomHint = 0x04000000,
diff --git a/src/corelib/global/qnamespace.qdoc b/src/corelib/global/qnamespace.qdoc
index d50960f68b..895feb7f53 100644
--- a/src/corelib/global/qnamespace.qdoc
+++ b/src/corelib/global/qnamespace.qdoc
@@ -2112,6 +2112,9 @@
implements its own set of gestures and that system level gestures, like for
instance three-finger desktop switching, should be disabled.
+ \value WindowDoesNotAcceptFocus Informs the window system that this window should
+ not receive the input focus.
+
\value WindowType_Mask A mask for extracting the window type
part of the window flags.