summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorFrederik Gladhorn <frederik.gladhorn@digia.com>2014-08-04 09:47:52 +0200
committerFrederik Gladhorn <frederik.gladhorn@digia.com>2014-08-04 09:51:36 +0200
commit0936bc54f907066644503c7d4c390968711c73a7 (patch)
tree6eb8c614e7083eae6ca619435f901dcb1380108f /src
parent83080e8a7cb7aaa794a9659eeaf34690afe71ddb (diff)
parentffd44acd0de4fc7079e76f1fe4689b655f9dc763 (diff)
Merge remote-tracking branch 'origin/5.3' into dev
Conflicts: config.tests/arch/arch.cpp src/opengl/qgl_qpa.cpp src/widgets/kernel/qapplication.cpp Change-Id: I80b442a4c2c9632743a5b5c7319ff201ec5bc4fd
Diffstat (limited to 'src')
-rw-r--r--src/corelib/arch/qatomic_mips.h10
-rw-r--r--src/corelib/global/archdetect.cpp2
-rw-r--r--src/corelib/global/qglobalstatic.h11
-rw-r--r--src/corelib/global/qprocessordetection.h15
-rw-r--r--src/gui/kernel/qguiapplication.cpp25
-rw-r--r--src/gui/painting/qblendfunctions_p.h4
-rw-r--r--src/opengl/qgl.cpp2
-rw-r--r--src/platformsupport/fontdatabases/mac/qcoretextfontdatabase.mm16
-rw-r--r--src/platformsupport/input/evdevkeyboard/qevdevkeyboard_defaultmap_p.h1
-rw-r--r--src/plugins/platforms/xcb/qxcbcursor.cpp2
-rw-r--r--src/widgets/dialogs/qfileinfogatherer.cpp19
-rw-r--r--src/widgets/kernel/qapplication.cpp23
-rw-r--r--src/widgets/kernel/qapplication_p.h1
-rw-r--r--src/widgets/kernel/qtooltip.cpp2
-rw-r--r--src/widgets/widgets/qabstractscrollarea.cpp2
15 files changed, 83 insertions, 52 deletions
diff --git a/src/corelib/arch/qatomic_mips.h b/src/corelib/arch/qatomic_mips.h
index 463612212b..7bfe16a450 100644
--- a/src/corelib/arch/qatomic_mips.h
+++ b/src/corelib/arch/qatomic_mips.h
@@ -110,13 +110,19 @@ template <typename T> struct QAtomicOps : QBasicAtomicOps<sizeof(T)>
template <int size> template <typename T> inline
void QBasicAtomicOps<size>::acquireMemoryFence(const T &) Q_DECL_NOTHROW
{
- asm volatile ("sync 0x11" ::: "memory");
+ asm volatile (".set push\n"
+ ".set mips32\n"
+ "sync 0x11\n"
+ ".set pop\n" ::: "memory");
}
template <int size> template <typename T> inline
void QBasicAtomicOps<size>::releaseMemoryFence(const T &) Q_DECL_NOTHROW
{
- asm volatile ("sync 0x12" ::: "memory");
+ asm volatile (".set push\n"
+ ".set mips32\n"
+ "sync 0x11\n"
+ ".set pop\n" ::: "memory");
}
template <int size> template <typename T> inline
diff --git a/src/corelib/global/archdetect.cpp b/src/corelib/global/archdetect.cpp
index 9540e391ba..e35595e727 100644
--- a/src/corelib/global/archdetect.cpp
+++ b/src/corelib/global/archdetect.cpp
@@ -73,6 +73,8 @@
# define ARCH_PROCESSOR "s390"
#elif defined(Q_PROCESSOR_SH)
# define ARCH_PROCESSOR "sh"
+#elif defined(Q_PROCESSORS_SPARC_64)
+# define ARCH_PROCESSOR "sparc64"
#elif defined(Q_PROCESSOR_SPARC_V9)
# define ARCH_PROCESSOR "sparcv9"
#elif defined(Q_PROCESSOR_SPARC)
diff --git a/src/corelib/global/qglobalstatic.h b/src/corelib/global/qglobalstatic.h
index e9330a4b9e..31e2e634a8 100644
--- a/src/corelib/global/qglobalstatic.h
+++ b/src/corelib/global/qglobalstatic.h
@@ -68,8 +68,17 @@ enum GuardValues {
// until the constructor returns ...
// We better avoid these kind of problems by using our own locked implementation.
+#if defined(Q_OS_UNIX) && defined(Q_CC_INTEL)
+// Work around Intel issue ID 6000058488:
+// local statics inside an inline function inside an anonymous namespace are global
+// symbols (this affects the IA-64 C++ ABI, so OS X and Linux only)
+# define Q_GLOBAL_STATIC_INTERNAL_DECORATION Q_DECL_HIDDEN
+#else
+# define Q_GLOBAL_STATIC_INTERNAL_DECORATION Q_DECL_HIDDEN inline
+#endif
+
#define Q_GLOBAL_STATIC_INTERNAL(ARGS) \
- Q_DECL_HIDDEN inline Type *innerFunction() \
+ Q_GLOBAL_STATIC_INTERNAL_DECORATION Type *innerFunction() \
{ \
struct HolderBase { \
~HolderBase() Q_DECL_NOTHROW \
diff --git a/src/corelib/global/qprocessordetection.h b/src/corelib/global/qprocessordetection.h
index 384df8fd54..c9fb728593 100644
--- a/src/corelib/global/qprocessordetection.h
+++ b/src/corelib/global/qprocessordetection.h
@@ -294,12 +294,15 @@
SPARC is big-endian only prior to V9, while V9 is bi-endian with big-endian
as the default byte order. Assume all SPARC systems are big-endian.
*/
-// #elif defined(__sparc__)
-// # define Q_PROCESSOR_SPARC
-// # if defined(__sparc_v9__)
-// # define Q_PROCESSOR_SPARC_V9
-// # endif
-// # define Q_BYTE_ORDER Q_BIG_ENDIAN
+#elif defined(__sparc__)
+# define Q_PROCESSOR_SPARC
+# if defined(__sparc_v9__)
+# define Q_PROCESSOR_SPARC_V9
+# endif
+# if defined(__sparc64__)
+# define Q_PROCESSOR_SPARC_64
+# endif
+# define Q_BYTE_ORDER Q_BIG_ENDIAN
#endif
diff --git a/src/gui/kernel/qguiapplication.cpp b/src/gui/kernel/qguiapplication.cpp
index 68e87a024f..831ebd19c0 100644
--- a/src/gui/kernel/qguiapplication.cpp
+++ b/src/gui/kernel/qguiapplication.cpp
@@ -96,6 +96,10 @@
#include <QtGui/QClipboard>
#endif
+#ifndef QT_NO_LIBRARY
+#include <QtCore/QLibrary>
+#endif
+
#if defined(Q_OS_MAC)
# include "private/qcore_mac_p.h"
#elif defined(Q_OS_WIN) && !defined(Q_OS_WINCE)
@@ -1209,6 +1213,7 @@ void QGuiApplicationPrivate::init()
QCoreApplicationPrivate::is_app_running = false; // Starting up.
bool doGrabUnderDebugger = false;
+ bool loadTestability = false;
QList<QByteArray> pluginList;
// Get command line params
#ifndef QT_NO_SESSIONMANAGER
@@ -1259,6 +1264,8 @@ void QGuiApplicationPrivate::init()
is_session_restored = true;
}
#endif
+ } else if (arg == "-testability") {
+ loadTestability = true;
} else {
argv[j++] = argv[i];
}
@@ -1319,6 +1326,22 @@ void QGuiApplicationPrivate::init()
session_manager = new QSessionManager(q, session_id, session_key);
#endif
+#ifndef QT_NO_LIBRARY
+ if (loadTestability) {
+ QLibrary testLib(QStringLiteral("qttestability"));
+ if (testLib.load()) {
+ typedef void (*TasInitialize)(void);
+ TasInitialize initFunction = (TasInitialize)testLib.resolve("qt_testability_init");
+ if (initFunction) {
+ initFunction();
+ } else {
+ qCritical() << "Library qttestability resolve failed!";
+ }
+ } else {
+ qCritical() << "Library qttestability load failed:" << testLib.errorString();
+ }
+ }
+#endif // QT_NO_LIBRARY
}
extern void qt_cleanupFontDatabase();
@@ -1792,7 +1815,7 @@ void QGuiApplicationPrivate::processMouseEvent(QWindowSystemInterfacePrivate::Mo
}
if (doubleClick) {
mousePressButton = Qt::NoButton;
- if (!e->window.isNull()) { // QTBUG-36364, check if window closed in response to press
+ if (!e->window.isNull() || e->nullWindow) { // QTBUG-36364, check if window closed in response to press
const QEvent::Type doubleClickType = frameStrut ? QEvent::NonClientAreaMouseButtonDblClick : QEvent::MouseButtonDblClick;
QMouseEvent dblClickEvent(doubleClickType, localPoint, localPoint, globalPoint,
button, buttons, e->modifiers);
diff --git a/src/gui/painting/qblendfunctions_p.h b/src/gui/painting/qblendfunctions_p.h
index 98e9e10bd8..e08c74ab88 100644
--- a/src/gui/painting/qblendfunctions_p.h
+++ b/src/gui/painting/qblendfunctions_p.h
@@ -147,7 +147,7 @@ void qt_scale_image_16bit(uchar *destPixels, int dbpl,
while (h--) {
const SRC *src = (const SRC *) (srcPixels + (srcy >> 16) * sbpl);
- int srcx = basex;
+ quint32 srcx = basex;
int x = 0;
for (; x<w-7; x+=8) {
blender.write(&dst[x], src[srcx >> 16]); srcx += ix;
@@ -258,7 +258,7 @@ template <typename T> void qt_scale_image_32bit(uchar *destPixels, int dbpl,
while (h--) {
const uint *src = (const quint32 *) (srcPixels + (srcy >> 16) * sbpl);
- int srcx = basex;
+ quint32 srcx = basex;
int x = 0;
for (; x<w; ++x) {
blender.write(&dst[x], src[srcx >> 16]);
diff --git a/src/opengl/qgl.cpp b/src/opengl/qgl.cpp
index 30e55592c5..1ca9f83501 100644
--- a/src/opengl/qgl.cpp
+++ b/src/opengl/qgl.cpp
@@ -467,6 +467,7 @@ QGLFormat QGLFormat::fromSurfaceFormat(const QSurfaceFormat &format)
retFormat.setStencil(true);
retFormat.setStencilBufferSize(format.stencilBufferSize());
}
+ retFormat.setSwapInterval(format.swapInterval());
retFormat.setDoubleBuffer(format.swapBehavior() != QSurfaceFormat::SingleBuffer);
retFormat.setStereo(format.stereo());
retFormat.setVersion(format.majorVersion(), format.minorVersion());
@@ -495,6 +496,7 @@ QSurfaceFormat QGLFormat::toSurfaceFormat(const QGLFormat &format)
retFormat.setSamples(format.samples() == -1 ? 4 : format.samples());
if (format.stencil())
retFormat.setStencilBufferSize(format.stencilBufferSize() == -1 ? 1 : format.stencilBufferSize());
+ retFormat.setSwapInterval(format.swapInterval());
retFormat.setStereo(format.stereo());
retFormat.setMajorVersion(format.majorVersion());
retFormat.setMinorVersion(format.minorVersion());
diff --git a/src/platformsupport/fontdatabases/mac/qcoretextfontdatabase.mm b/src/platformsupport/fontdatabases/mac/qcoretextfontdatabase.mm
index c0643444e2..7ae72cc446 100644
--- a/src/platformsupport/fontdatabases/mac/qcoretextfontdatabase.mm
+++ b/src/platformsupport/fontdatabases/mac/qcoretextfontdatabase.mm
@@ -245,9 +245,19 @@ void QCoreTextFontDatabase::populateFromDescriptor(CTFontDescriptorRef font)
if (styles) {
if (CFNumberRef weightValue = (CFNumberRef) CFDictionaryGetValue(styles, kCTFontWeightTrait)) {
Q_ASSERT(CFNumberIsFloatType(weightValue));
- double d;
- if (CFNumberGetValue(weightValue, kCFNumberDoubleType, &d))
- weight = (d > 0.0) ? QFont::Bold : QFont::Normal;
+ double normalizedWeight;
+ if (CFNumberGetValue(weightValue, kCFNumberDoubleType, &normalizedWeight)) {
+ if (normalizedWeight >= 0.62)
+ weight = QFont::Black;
+ else if (normalizedWeight >= 0.4)
+ weight = QFont::Bold;
+ else if (normalizedWeight >= 0.3)
+ weight = QFont::DemiBold;
+ else if (normalizedWeight == 0.0)
+ weight = QFont::Normal;
+ else if (normalizedWeight <= -0.4)
+ weight = QFont::Light;
+ }
}
if (CFNumberRef italic = (CFNumberRef) CFDictionaryGetValue(styles, kCTFontSlantTrait)) {
Q_ASSERT(CFNumberIsFloatType(italic));
diff --git a/src/platformsupport/input/evdevkeyboard/qevdevkeyboard_defaultmap_p.h b/src/platformsupport/input/evdevkeyboard/qevdevkeyboard_defaultmap_p.h
index 3f656668aa..5e919ebeb7 100644
--- a/src/platformsupport/input/evdevkeyboard/qevdevkeyboard_defaultmap_p.h
+++ b/src/platformsupport/input/evdevkeyboard/qevdevkeyboard_defaultmap_p.h
@@ -639,6 +639,7 @@ const QEvdevKeyboardMap::Mapping QEvdevKeyboardHandler::s_keymap_default[] = {
{ KEY_MUTE, 0xffff, Qt::Key_VolumeMute, 0x00, 0x00, 0x0000 },
{ KEY_VOLUMEDOWN, 0xffff, Qt::Key_VolumeDown, 0x00, 0x00, 0x0000 },
{ KEY_VOLUMEUP, 0xffff, Qt::Key_VolumeUp, 0x00, 0x00, 0x0000 },
+ { KEY_POWER, 0xffff, Qt::Key_PowerOff, 0x00, 0x00, 0x0000 },
{ KEY_PAUSE, 0xffff, Qt::Key_Pause, 0x00, 0x00, 0x0000 },
{ KEY_STOP, 0xffff, Qt::Key_Stop, 0x00, 0x00, 0x0000 },
{ KEY_SETUP, 0xffff, Qt::Key_Settings, 0x00, 0x00, 0x0000 },
diff --git a/src/plugins/platforms/xcb/qxcbcursor.cpp b/src/plugins/platforms/xcb/qxcbcursor.cpp
index ce9e445ba2..6dbac90e0c 100644
--- a/src/plugins/platforms/xcb/qxcbcursor.cpp
+++ b/src/plugins/platforms/xcb/qxcbcursor.cpp
@@ -545,7 +545,7 @@ xcb_cursor_t QXcbCursor::createFontCursor(int cshape)
// Try Xcursor first
#ifdef XCB_USE_XLIB
- if (cshape >= 0 && cshape < Qt::LastCursor) {
+ if (cshape >= 0 && cshape <= Qt::LastCursor) {
void *dpy = connection()->xlib_display();
// special case for non-standard dnd-* cursors
cursor = loadCursor(dpy, cshape);
diff --git a/src/widgets/dialogs/qfileinfogatherer.cpp b/src/widgets/dialogs/qfileinfogatherer.cpp
index b08cc798e5..41b0b30eeb 100644
--- a/src/widgets/dialogs/qfileinfogatherer.cpp
+++ b/src/widgets/dialogs/qfileinfogatherer.cpp
@@ -146,6 +146,15 @@ void QFileInfoGatherer::fetchExtendedInformation(const QString &path, const QStr
this->path.push(path);
this->files.push(files);
condition.wakeAll();
+
+#ifndef QT_NO_FILESYSTEMWATCHER
+ if (files.isEmpty()
+ && !path.isEmpty()
+ && !path.startsWith(QLatin1String("//")) /*don't watch UNC path*/) {
+ if (!watcher->directories().contains(path))
+ watcher->addPath(path);
+ }
+#endif
}
/*!
@@ -269,16 +278,6 @@ static QString translateDriveName(const QFileInfo &drive)
*/
void QFileInfoGatherer::getFileInfos(const QString &path, const QStringList &files)
{
-#ifndef QT_NO_FILESYSTEMWATCHER
- if (files.isEmpty()
- && !path.isEmpty()
- && !path.startsWith(QLatin1String("//")) /*don't watch UNC path*/) {
- QMutexLocker locker(&mutex);
- if (!watcher->directories().contains(path))
- watcher->addPath(path);
- }
-#endif
-
// List drives
if (path.isEmpty()) {
#ifdef QT_BUILD_INTERNAL
diff --git a/src/widgets/kernel/qapplication.cpp b/src/widgets/kernel/qapplication.cpp
index 9913b225fc..2b90971398 100644
--- a/src/widgets/kernel/qapplication.cpp
+++ b/src/widgets/kernel/qapplication.cpp
@@ -94,9 +94,6 @@
#include "qgesture.h"
#include "private/qgesturemanager_p.h"
#include <qpa/qplatformfontdatabase.h>
-#ifndef QT_NO_LIBRARY
-#include "qlibrary.h"
-#endif
#ifdef Q_OS_WIN
#include <QtCore/qt_windows.h> // for qt_win_display_dc()
@@ -428,7 +425,6 @@ int qt_antialiasing_threshold = -1;
QSize QApplicationPrivate::app_strut = QSize(0,0); // no default application strut
int QApplicationPrivate::enabledAnimations = QPlatformTheme::GeneralUiEffect;
bool QApplicationPrivate::widgetCount = false;
-bool QApplicationPrivate::load_testability = false;
#ifdef QT_KEYPAD_NAVIGATION
Qt::NavigationMode QApplicationPrivate::navigationMode = Qt::NavigationModeKeypadTabOrder;
QWidget *QApplicationPrivate::oldEditFocus = 0;
@@ -503,8 +499,6 @@ void QApplicationPrivate::process_cmdline()
#endif
} else if (qstrcmp(arg, "-widgetcount") == 0) {
widgetCount = true;
- } else if (qstrcmp(arg, "-testability") == 0) {
- load_testability = true;
} else {
argv[j++] = argv[i];
}
@@ -595,28 +589,11 @@ void QApplicationPrivate::construct()
extern void qt_gui_eval_init(QCoreApplicationPrivate::Type);
qt_gui_eval_init(application_type);
#endif
-
#ifndef QT_NO_ACCESSIBILITY
// factory for accessible interfaces for widgets shipped with Qt
QAccessible::installFactory(&qAccessibleFactory);
#endif
-#ifndef QT_NO_LIBRARY
- if(load_testability) {
- QLibrary testLib(QLatin1String("qttestability"));
- if (testLib.load()) {
- typedef void (*TasInitialize)(void);
- TasInitialize initFunction = (TasInitialize)testLib.resolve("qt_testability_init");
- if (initFunction) {
- initFunction();
- } else {
- qCritical("Library qttestability resolve failed!");
- }
- } else {
- qCritical("Library qttestability load failed!");
- }
- }
-#endif
}
void qt_init(QApplicationPrivate *priv, int type)
diff --git a/src/widgets/kernel/qapplication_p.h b/src/widgets/kernel/qapplication_p.h
index d5efb62dda..29142470a7 100644
--- a/src/widgets/kernel/qapplication_p.h
+++ b/src/widgets/kernel/qapplication_p.h
@@ -214,7 +214,6 @@ public:
static int enabledAnimations; // Combination of QPlatformTheme::UiEffect
static bool widgetCount; // Coupled with -widgetcount switch
- static bool load_testability; // Coupled with -testability switch
static void setSystemPalette(const QPalette &pal);
static void setPalette_helper(const QPalette &palette, const char* className, bool clearWidgetPaletteHash);
diff --git a/src/widgets/kernel/qtooltip.cpp b/src/widgets/kernel/qtooltip.cpp
index 2b43fd7f6d..16fb41e1fc 100644
--- a/src/widgets/kernel/qtooltip.cpp
+++ b/src/widgets/kernel/qtooltip.cpp
@@ -273,7 +273,7 @@ void QTipLabel::hideTipImmediately()
void QTipLabel::setTipRect(QWidget *w, const QRect &r)
{
- if (!rect.isNull() && !w)
+ if (!r.isNull() && !w)
qWarning("QToolTip::setTipRect: Cannot pass null widget if rect is set");
else{
widget = w;
diff --git a/src/widgets/widgets/qabstractscrollarea.cpp b/src/widgets/widgets/qabstractscrollarea.cpp
index e830ac3c76..1b48441993 100644
--- a/src/widgets/widgets/qabstractscrollarea.cpp
+++ b/src/widgets/widgets/qabstractscrollarea.cpp
@@ -309,7 +309,7 @@ void QAbstractScrollAreaPrivate::init()
q->setFrameStyle(QFrame::StyledPanel | QFrame::Sunken);
q->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);
layoutChildren();
-#ifndef Q_WS_MAC
+#ifndef Q_OS_OSX
# ifndef QT_NO_GESTURES
viewport->grabGesture(Qt::PanGesture);
# endif