summaryrefslogtreecommitdiffstats
path: root/src/corelib/global
diff options
context:
space:
mode:
Diffstat (limited to 'src/corelib/global')
-rw-r--r--src/corelib/global/qcompilerdetection.h4
-rw-r--r--src/corelib/global/qglobal.cpp14
-rw-r--r--src/corelib/global/qnamespace.h6
-rw-r--r--src/corelib/global/qnamespace.qdoc81
-rw-r--r--src/corelib/global/qsysinfo.h29
-rw-r--r--src/corelib/global/qsystemdetection.h11
6 files changed, 102 insertions, 43 deletions
diff --git a/src/corelib/global/qcompilerdetection.h b/src/corelib/global/qcompilerdetection.h
index 33a24a3866..f8a8a436be 100644
--- a/src/corelib/global/qcompilerdetection.h
+++ b/src/corelib/global/qcompilerdetection.h
@@ -921,7 +921,7 @@
# endif // Q_OS_QNX
# if (defined(Q_CC_CLANG) || defined(Q_CC_INTEL)) && defined(Q_OS_MAC) && defined(__GNUC_LIBSTD__) \
&& ((__GNUC_LIBSTD__-0) * 100 + __GNUC_LIBSTD_MINOR__-0 <= 402)
-// Mac OS X: Apple has not updated libstdc++ since 2007, which means it does not have
+// Apple has not updated libstdc++ since 2007, which means it does not have
// <initializer_list> or std::move. Let's disable these features
# undef Q_COMPILER_INITIALIZER_LISTS
# undef Q_COMPILER_RVALUE_REFS
@@ -937,7 +937,7 @@
# endif
# endif
# if defined(Q_COMPILER_THREADSAFE_STATICS) && defined(Q_OS_MAC)
-// Mac OS X: Apple's low-level implementation of the C++ support library
+// Apple's low-level implementation of the C++ support library
// (libc++abi.dylib, shared between libstdc++ and libc++) has deadlocks. The
// C++11 standard requires the deadlocks to be removed, so this will eventually
// be fixed; for now, let's disable this.
diff --git a/src/corelib/global/qglobal.cpp b/src/corelib/global/qglobal.cpp
index d462595804..2176a148b0 100644
--- a/src/corelib/global/qglobal.cpp
+++ b/src/corelib/global/qglobal.cpp
@@ -42,6 +42,7 @@
#include <private/qlocale_tools_p.h>
#include <private/qsystemlibrary_p.h>
+#include <qmutex.h>
#ifndef QT_NO_QOBJECT
#include <private/qthread_p.h>
@@ -1151,6 +1152,9 @@ bool qSharedBuild() Q_DECL_NOTHROW
\value MV_IOS_7_0 iOS 7.0
\value MV_IOS_7_1 iOS 7.1
\value MV_IOS_8_0 iOS 8.0
+ \value MV_IOS_8_1 iOS 8.1
+ \value MV_IOS_8_2 iOS 8.2
+ \value MV_IOS_8_3 iOS 8.3
\value MV_None Not a Darwin operating system
@@ -3029,6 +3033,10 @@ QString qt_error_string(int errorCode)
return ret.trimmed();
}
+// In the C runtime on all platforms access to the environment is not thread-safe. We
+// add thread-safety for the Qt wrappers.
+static QBasicMutex environmentMutex;
+
// getenv is declared as deprecated in VS2005. This function
// makes use of the new secure getenv function.
/*!
@@ -3046,6 +3054,7 @@ QString qt_error_string(int errorCode)
*/
QByteArray qgetenv(const char *varName)
{
+ QMutexLocker locker(&environmentMutex);
#if defined(_MSC_VER) && _MSC_VER >= 1400
size_t requiredSize = 0;
QByteArray buffer;
@@ -3079,6 +3088,7 @@ QByteArray qgetenv(const char *varName)
*/
bool qEnvironmentVariableIsEmpty(const char *varName) Q_DECL_NOEXCEPT
{
+ QMutexLocker locker(&environmentMutex);
#if defined(_MSC_VER) && _MSC_VER >= 1400
// we provide a buffer that can only hold the empty string, so
// when the env.var isn't empty, we'll get an ERANGE error (buffer
@@ -3110,6 +3120,7 @@ bool qEnvironmentVariableIsEmpty(const char *varName) Q_DECL_NOEXCEPT
*/
int qEnvironmentVariableIntValue(const char *varName, bool *ok) Q_DECL_NOEXCEPT
{
+ QMutexLocker locker(&environmentMutex);
#if defined(_MSC_VER) && _MSC_VER >= 1400
// we provide a buffer that can hold any int value:
static const int NumBinaryDigitsPerOctalDigit = 3;
@@ -3158,6 +3169,7 @@ int qEnvironmentVariableIntValue(const char *varName, bool *ok) Q_DECL_NOEXCEPT
*/
bool qEnvironmentVariableIsSet(const char *varName) Q_DECL_NOEXCEPT
{
+ QMutexLocker locker(&environmentMutex);
#if defined(_MSC_VER) && _MSC_VER >= 1400
size_t requiredSize = 0;
(void)getenv_s(&requiredSize, 0, 0, varName);
@@ -3187,6 +3199,7 @@ bool qEnvironmentVariableIsSet(const char *varName) Q_DECL_NOEXCEPT
*/
bool qputenv(const char *varName, const QByteArray& value)
{
+ QMutexLocker locker(&environmentMutex);
#if defined(_MSC_VER) && _MSC_VER >= 1400
return _putenv_s(varName, value.constData()) == 0;
#elif (defined(_POSIX_VERSION) && (_POSIX_VERSION-0) >= 200112L) || defined(Q_OS_HAIKU)
@@ -3217,6 +3230,7 @@ bool qputenv(const char *varName, const QByteArray& value)
*/
bool qunsetenv(const char *varName)
{
+ QMutexLocker locker(&environmentMutex);
#if defined(_MSC_VER) && _MSC_VER >= 1400
return _putenv_s(varName, "") == 0;
#elif (defined(_POSIX_VERSION) && (_POSIX_VERSION-0) >= 200112L) || defined(Q_OS_BSD4) || defined(Q_OS_HAIKU)
diff --git a/src/corelib/global/qnamespace.h b/src/corelib/global/qnamespace.h
index c766b4d1c3..123e2edf0e 100644
--- a/src/corelib/global/qnamespace.h
+++ b/src/corelib/global/qnamespace.h
@@ -492,6 +492,7 @@ public:
AA_UseOpenGLES = 16,
AA_UseSoftwareOpenGL = 17,
AA_ShareOpenGLContexts = 18,
+ AA_SetPalette = 19,
// Add new attributes before this line
AA_AttributeCount
@@ -1457,7 +1458,10 @@ public:
ItemIsDropEnabled = 8,
ItemIsUserCheckable = 16,
ItemIsEnabled = 32,
- ItemIsTristate = 64,
+ ItemIsAutoTristate = 64,
+#if QT_DEPRECATED_SINCE(5, 6)
+ ItemIsTristate = ItemIsAutoTristate,
+#endif
ItemNeverHasChildren = 128,
ItemIsUserTristate = 256
};
diff --git a/src/corelib/global/qnamespace.qdoc b/src/corelib/global/qnamespace.qdoc
index daf55cfd3a..d4d7b631ad 100644
--- a/src/corelib/global/qnamespace.qdoc
+++ b/src/corelib/global/qnamespace.qdoc
@@ -111,7 +111,7 @@
shown in any menus unless specifically set by the
QAction::iconVisibleInMenu property.
Menus that are currently open or menus already created in the native
- Mac OS X menubar \e{may not} pick up a change in this attribute. Changes
+ OS X menubar \e{may not} pick up a change in this attribute. Changes
in the QAction::iconVisibleInMenu property will always be picked up.
\value AA_NativeWindows Ensures that widgets have native windows.
@@ -129,9 +129,9 @@
\value AA_DontUseNativeMenuBar All menubars created while this attribute is
set to true won't be used as a native menubar (e.g, the menubar at
- the top of the main screen on Mac OS X or at the bottom in Windows CE).
+ the top of the main screen on OS X or at the bottom in Windows CE).
- \value AA_MacDontSwapCtrlAndMeta On Mac OS X by default, Qt swaps the
+ \value AA_MacDontSwapCtrlAndMeta On OS X by default, Qt swaps the
Control and Meta (Command) keys (i.e., whenever Control is pressed, Qt
sends Meta, and whenever Meta is pressed Control is sent). When this
attribute is true, Qt will not do the flip. \l QKeySequence::StandardKey
@@ -194,6 +194,9 @@
instances that belong to different top-level windows. This value has
been added in Qt 5.4.
+ \value AA_SetPalette Indicates whether a palette was explicitly set on the
+ QApplication/QGuiApplication. This value has been added in Qt 5.5.
+
The following values are obsolete:
\value AA_ImmediateWidgetCreation This attribute is no longer fully
@@ -294,7 +297,7 @@
\omitvalue KeyboardModifierMask
- \note On Mac OS X, the \c ControlModifier value corresponds to
+ \note On OS X, the \c ControlModifier value corresponds to
the Command keys on the Macintosh keyboard, and the \c MetaModifier value
corresponds to the Control keys. The \c KeypadModifier value will also be set
when an arrow key is pressed as the arrow keys are considered part of the
@@ -312,7 +315,7 @@
This enum provides shorter names for the keyboard modifier keys
supported by Qt.
- \note On Mac OS X, the \c CTRL value corresponds to
+ \note On OS X, the \c CTRL value corresponds to
the Command keys on the Macintosh keyboard, and the \c META value
corresponds to the Control keys.
@@ -913,34 +916,34 @@
\value WA_MacOpaqueSizeGrip Indicates that the native Carbon size grip
should be opaque instead of transparent (the default). This attribute
- is only applicable to Mac OS X and is set by the widget's author.
+ is only applicable to OS X and is set by the widget's author.
\value WA_MacShowFocusRect Indicates that this widget should get a
QFocusFrame around it. Some widgets draw their own focus halo
regardless of this attribute. Not that the QWidget::focusPolicy
also plays the main role in whether something is given focus or
not, this only controls whether or not this gets the focus
- frame. This attribute is only applicable to Mac OS X.
+ frame. This attribute is only applicable to OS X.
\value WA_MacNormalSize Indicates the widget should have the
- normal size for widgets in Mac OS X. This attribute is only
- applicable to Mac OS X.
+ normal size for widgets in OS X. This attribute is only
+ applicable to OS X.
\value WA_MacSmallSize Indicates the widget should have the small
- size for widgets in Mac OS X. This attribute is only applicable to
- Mac OS X.
+ size for widgets in OS X. This attribute is only applicable to
+ OS X.
\value WA_MacMiniSize Indicates the widget should have the mini
- size for widgets in Mac OS X. This attribute is only applicable to
- Mac OS X.
+ size for widgets in OS X. This attribute is only applicable to
+ OS X.
\value WA_MacVariableSize Indicates the widget can choose between
alternative sizes for widgets to avoid clipping.
- This attribute is only applicable to Mac OS X.
+ This attribute is only applicable to OS X.
\value WA_MacBrushedMetal Indicates the widget should be drawn in
the brushed metal style as supported by the windowing system. This
- attribute is only applicable to Mac OS X.
+ attribute is only applicable to OS X.
\omitvalue WA_MacMetalStyle
@@ -1090,14 +1093,14 @@
\b Warning: This flag must \e never be set or cleared by the widget's author.
\value WA_WindowModified Indicates that the window is marked as modified.
- On some platforms this flag will do nothing, on others (including Mac OS X
+ On some platforms this flag will do nothing, on others (including OS X
and Windows) the window will take a modified appearance. This flag is set
or cleared by QWidget::setWindowModified().
\value WA_WindowPropagation Makes a toplevel window inherit font and
palette from its parent.
- \value WA_MacAlwaysShowToolWindow On Mac OS X, show the tool window even
+ \value WA_MacAlwaysShowToolWindow On OS X, show the tool window even
when the application is not active. By default, all tool windows are
hidden when the application is inactive.
@@ -1280,8 +1283,8 @@
\value Key_PageUp
\value Key_PageDown
\value Key_Shift
- \value Key_Control On Mac OS X, this corresponds to the Command keys.
- \value Key_Meta On Mac OS X, this corresponds to the Control keys.
+ \value Key_Control On OS X, this corresponds to the Command keys.
+ \value Key_Meta On OS X, this corresponds to the Control keys.
On Windows keyboards, this key is mapped to the
Windows key.
\value Key_Alt
@@ -1667,6 +1670,16 @@
\value Key_Blue
\value Key_ChannelUp
\value Key_ChannelDown
+ \value Key_Guide
+ \value Key_Info
+ \value Key_Settings
+ \value Key_MicVolumeUp
+ \value Key_MicVolumeDown
+ \value Key_New
+ \value Key_Open
+ \value Key_Find
+ \value Key_Undo
+ \value Key_Redo
\value Key_MediaLast
\value Key_unknown
@@ -1691,6 +1704,7 @@
\value Key_Play
\value Key_Sleep
\value Key_Zoom
+ \value Key_Exit
\value Key_Cancel
\sa QKeyEvent::key()
@@ -1919,7 +1933,7 @@
\value TabFocus the widget accepts focus by tabbing.
\value ClickFocus the widget accepts focus by clicking.
\value StrongFocus the widget accepts focus by both tabbing
- and clicking. On Mac OS X this will also
+ and clicking. On OS X this will also
be indicate that the widget accepts tab focus
when in 'Text/List focus mode'.
\value WheelFocus like Qt::StrongFocus plus the widget accepts
@@ -2025,7 +2039,7 @@
system supports it, a tool window can be decorated
with a somewhat lighter frame. It can also be
combined with Qt::FramelessWindowHint.
- On Mac OS X, tool windows correspond to the
+ On OS X, tool windows correspond to the
\l{http://developer.apple.com/documentation/Carbon/Conceptual/HandlingWindowsControls/hitb-wind_cont_concept/chapter_2_section_2.html}{Floating}
class of windows. This means that the window lives on a
level above normal windows; it impossible to put a normal
@@ -2114,10 +2128,10 @@
\value WindowContextHelpButtonHint Adds a context help button to dialogs.
On some platforms this implies Qt::WindowSystemMenuHint for it to work.
- \value MacWindowToolBarButtonHint On Mac OS X adds a tool bar button (i.e.,
+ \value MacWindowToolBarButtonHint On OS X adds a tool bar button (i.e.,
the oblong button that is on the top right of windows that have toolbars).
- \value WindowFullscreenButtonHint On Mac OS X adds a fullscreen button.
+ \value WindowFullscreenButtonHint On OS X adds a fullscreen button.
\value BypassGraphicsProxyWidget Prevents the window and its children from
automatically embedding themselves into a QGraphicsProxyWidget if the
@@ -2141,7 +2155,7 @@
that support _NET_WM_STATE_BELOW atom. If a window always
on the bottom has a parent, the parent will also be left on
the bottom. This window hint is currently not implemented
- for Mac OS X.
+ for OS X.
\value WindowOkButtonHint Adds an OK button to the window decoration of a dialog.
Only supported for Windows CE.
@@ -2628,10 +2642,12 @@
\value ItemIsDropEnabled It can be used as a drop target.
\value ItemIsUserCheckable It can be checked or unchecked by the user.
\value ItemIsEnabled The user can interact with the item.
- \value ItemIsTristate The item can show three separate states.
+ \value ItemIsAutoTristate The item's state depends on the state of its children.
This enables automatic management of the state of parent items in QTreeWidget
(checked if all children are checked, unchecked if all children are unchecked,
or partially checked if only some children are checked).
+ \value ItemIsTristate \e{This enum value is deprecated.} Use Qt::ItemIsAutoTristate
+ instead.
\value ItemNeverHasChildren The item never has child items.
\value ItemIsUserTristate The user can cycle through three separate states.
This value has been added in Qt 5.5.
@@ -2936,6 +2952,19 @@
*/
/*!
+ \enum Qt::NativeGestureType
+ \since 5.2
+
+ \value BeginNativeGesture
+ \value EndNativeGesture
+ \value PanNativeGesture
+ \value ZoomNativeGesture
+ \value SmartZoomNativeGesture
+ \value RotateNativeGesture
+ \value SwipeNativeGesture
+
+*/
+/*!
\enum Qt::NavigationMode
\since 4.6
@@ -2985,7 +3014,7 @@
\value CoarseTimer Coarse timers try to keep accuracy within 5% of the desired interval
\value VeryCoarseTimer Very coarse timers only keep full second accuracy
- On UNIX (including Linux and Mac OS X), Qt will keep millisecond accuracy
+ On UNIX (including Linux, OS X, and iOS), Qt will keep millisecond accuracy
for Qt::PreciseTimer. For Qt::CoarseTimer, the interval will be adjusted up
to 5% to align the timer with other timers that are expected to fire at or
around the same time. The objective is to make most timers wake up at the
diff --git a/src/corelib/global/qsysinfo.h b/src/corelib/global/qsysinfo.h
index a571e43568..72acdd8c70 100644
--- a/src/corelib/global/qsysinfo.h
+++ b/src/corelib/global/qsysinfo.h
@@ -125,18 +125,18 @@ public:
MV_Unknown = 0x0000,
/* version */
- MV_9 = 0x0001,
- MV_10_0 = 0x0002,
- MV_10_1 = 0x0003,
- MV_10_2 = 0x0004,
- MV_10_3 = 0x0005,
- MV_10_4 = 0x0006,
- MV_10_5 = 0x0007,
- MV_10_6 = 0x0008,
- MV_10_7 = 0x0009,
- MV_10_8 = 0x000A,
- MV_10_9 = 0x000B,
- MV_10_10 = 0x000C,
+ MV_9 = Q_MV_OSX(9, 0),
+ MV_10_0 = Q_MV_OSX(10, 0),
+ MV_10_1 = Q_MV_OSX(10, 1),
+ MV_10_2 = Q_MV_OSX(10, 2),
+ MV_10_3 = Q_MV_OSX(10, 3),
+ MV_10_4 = Q_MV_OSX(10, 4),
+ MV_10_5 = Q_MV_OSX(10, 5),
+ MV_10_6 = Q_MV_OSX(10, 6),
+ MV_10_7 = Q_MV_OSX(10, 7),
+ MV_10_8 = Q_MV_OSX(10, 8),
+ MV_10_9 = Q_MV_OSX(10, 9),
+ MV_10_10 = Q_MV_OSX(10, 10),
/* codenames */
MV_CHEETAH = MV_10_0,
@@ -160,7 +160,10 @@ public:
MV_IOS_6_1 = Q_MV_IOS(6, 1),
MV_IOS_7_0 = Q_MV_IOS(7, 0),
MV_IOS_7_1 = Q_MV_IOS(7, 1),
- MV_IOS_8_0 = Q_MV_IOS(8, 0)
+ MV_IOS_8_0 = Q_MV_IOS(8, 0),
+ MV_IOS_8_1 = Q_MV_IOS(8, 1),
+ MV_IOS_8_2 = Q_MV_IOS(8, 2),
+ MV_IOS_8_3 = Q_MV_IOS(8, 3)
};
#if defined(Q_OS_MAC)
static const MacVersion MacintoshVersion;
diff --git a/src/corelib/global/qsystemdetection.h b/src/corelib/global/qsystemdetection.h
index eb9c4ff04f..cb662c7db1 100644
--- a/src/corelib/global/qsystemdetection.h
+++ b/src/corelib/global/qsystemdetection.h
@@ -106,7 +106,7 @@
# if defined(WINCE) || defined(_WIN32_WCE)
# define Q_OS_WINCE
# elif defined(WINAPI_FAMILY)
-# if WINAPI_FAMILY==WINAPI_FAMILY_PHONE_APP
+# if defined(WINAPI_FAMILY_PHONE_APP) && WINAPI_FAMILY==WINAPI_FAMILY_PHONE_APP
# define Q_OS_WINPHONE
# define Q_OS_WINRT
# elif WINAPI_FAMILY==WINAPI_FAMILY_APP
@@ -270,6 +270,15 @@
# if !defined(__IPHONE_8_0)
# define __IPHONE_8_0 80000
# endif
+# if !defined(__IPHONE_8_1)
+# define __IPHONE_8_1 80100
+# endif
+# if !defined(__IPHONE_8_2)
+# define __IPHONE_8_2 80200
+# endif
+# if !defined(__IPHONE_8_3)
+# define __IPHONE_8_3 80300
+# endif
#endif
#ifdef __LSB_VERSION__