summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorFrederik Gladhorn <frederik.gladhorn@digia.com>2013-11-29 15:59:32 +0100
committerFrederik Gladhorn <frederik.gladhorn@digia.com>2013-11-29 15:59:34 +0100
commit777cdb00e704b987ad19bf842088a754cf7e6525 (patch)
treeb8f2356d68e293c591c9be86113ed46478867e0b /src
parentdc9e32caeda0278658befb8bb6e944986c021620 (diff)
parentaf1dbfd2239c7834187f3a702fb2029dc78d4526 (diff)
Merge remote-tracking branch 'origin/stable' into dev
Diffstat (limited to 'src')
-rw-r--r--src/android/jar/src/org/qtproject/qt5/android/QtActivityDelegate.java4
-rw-r--r--src/corelib/global/qfeatures.txt2
-rw-r--r--src/corelib/kernel/qsystemsemaphore.cpp3
-rw-r--r--src/corelib/kernel/qsystemsemaphore_p.h5
-rw-r--r--src/corelib/kernel/qsystemsemaphore_unix.cpp1
-rw-r--r--src/corelib/kernel/qsystemsemaphore_win.cpp1
-rw-r--r--src/corelib/tools/qlocale_p.h4
-rw-r--r--src/gui/kernel/qoffscreensurface.cpp2
-rw-r--r--src/gui/text/qfontdatabase.cpp34
-rw-r--r--src/gui/text/qfontdatabase_qpa.cpp31
-rw-r--r--src/gui/text/qfontengine.cpp3
-rw-r--r--src/gui/text/qfontengine_p.h2
-rw-r--r--src/network/kernel/qnetworkinterface_unix.cpp12
-rw-r--r--src/plugins/bearer/corewlan/qcorewlanengine.mm5
-rw-r--r--src/plugins/bearer/corewlan/qcorewlanengine_10_6.mm5
-rw-r--r--src/plugins/platforms/cocoa/qcocoadrag.h1
-rw-r--r--src/plugins/platforms/cocoa/qcocoadrag.mm8
-rw-r--r--src/plugins/platforms/cocoa/qcocoafiledialoghelper.h1
-rw-r--r--src/plugins/platforms/cocoa/qcocoafiledialoghelper.mm6
-rw-r--r--src/plugins/platforms/cocoa/qcocoawindow.mm24
-rw-r--r--src/plugins/platforms/qnx/qqnxnativeinterface.cpp6
-rw-r--r--src/plugins/platforms/windows/qwindowsfontenginedirectwrite.cpp2
-rw-r--r--src/plugins/platforms/windows/qwindowsglcontext.cpp2
-rw-r--r--src/plugins/platforms/xcb/qxcbnativeinterface.cpp4
-rw-r--r--src/plugins/platforms/xcb/qxcbnativeinterface.h2
-rw-r--r--src/plugins/platforms/xcb/xcb-plugin.pro18
-rw-r--r--src/printsupport/kernel/qprinter.cpp8
-rw-r--r--src/sql/drivers/mysql/qsql_mysql.cpp2
-rw-r--r--src/sql/drivers/sqlite/qsql_sqlite.cpp15
-rw-r--r--src/widgets/doc/snippets/code/src_gui_widgets_qlabel.cpp16
-rw-r--r--src/widgets/graphicsview/qgraphicsitem.cpp5
-rw-r--r--src/widgets/kernel/qwidget.cpp5
32 files changed, 138 insertions, 101 deletions
diff --git a/src/android/jar/src/org/qtproject/qt5/android/QtActivityDelegate.java b/src/android/jar/src/org/qtproject/qt5/android/QtActivityDelegate.java
index 3dcffeb07d..3bcd6eaea3 100644
--- a/src/android/jar/src/org/qtproject/qt5/android/QtActivityDelegate.java
+++ b/src/android/jar/src/org/qtproject/qt5/android/QtActivityDelegate.java
@@ -858,10 +858,8 @@ public class QtActivityDelegate
public void onContextMenuClosed(Menu menu)
{
- if (!m_contextMenuVisible) {
- Log.e(QtNative.QtTAG, "invalid onContextMenuClosed call");
+ if (!m_contextMenuVisible)
return;
- }
m_contextMenuVisible = false;
QtNative.onContextMenuClosed(menu);
}
diff --git a/src/corelib/global/qfeatures.txt b/src/corelib/global/qfeatures.txt
index 84c9379bbc..fb6e56ec7d 100644
--- a/src/corelib/global/qfeatures.txt
+++ b/src/corelib/global/qfeatures.txt
@@ -748,7 +748,7 @@ Name: QPdf
Feature: PRINTER
Description: Supports printing
Section: Painting
-Requires: PICTURE TEMPORARYFILE
+Requires: PICTURE TEMPORARYFILE PDF
Name: QPrinter
Feature: CUPS
diff --git a/src/corelib/kernel/qsystemsemaphore.cpp b/src/corelib/kernel/qsystemsemaphore.cpp
index 6f0e5ee011..82e14e6f3f 100644
--- a/src/corelib/kernel/qsystemsemaphore.cpp
+++ b/src/corelib/kernel/qsystemsemaphore.cpp
@@ -229,8 +229,7 @@ void QSystemSemaphore::setKey(const QString &key, int initialValue, AccessMode m
{
if (key == d->key && mode == Open)
return;
- d->error = NoError;
- d->errorString = QString();
+ d->clearError();
#if !defined(Q_OS_WIN)
// optimization to not destroy/create the file & semaphore
if (key == d->key && mode == Create && d->createdSemaphore && d->createdFile) {
diff --git a/src/corelib/kernel/qsystemsemaphore_p.h b/src/corelib/kernel/qsystemsemaphore_p.h
index c809ba58c1..b34ec1b9a7 100644
--- a/src/corelib/kernel/qsystemsemaphore_p.h
+++ b/src/corelib/kernel/qsystemsemaphore_p.h
@@ -75,6 +75,11 @@ public:
return QSharedMemoryPrivate::makePlatformSafeKey(key, QLatin1String("qipc_systemsem_"));
}
+ inline void setError(QSystemSemaphore::SystemSemaphoreError e, const QString &message)
+ { error = e; errorString = message; }
+ inline void clearError()
+ { setError(QSystemSemaphore::NoError, QString()); }
+
#ifdef Q_OS_WIN
Qt::HANDLE handle(QSystemSemaphore::AccessMode mode = QSystemSemaphore::Open);
void setErrorString(const QString &function);
diff --git a/src/corelib/kernel/qsystemsemaphore_unix.cpp b/src/corelib/kernel/qsystemsemaphore_unix.cpp
index 073bd020ba..8f439c94a0 100644
--- a/src/corelib/kernel/qsystemsemaphore_unix.cpp
+++ b/src/corelib/kernel/qsystemsemaphore_unix.cpp
@@ -229,6 +229,7 @@ bool QSystemSemaphorePrivate::modifySemaphore(int count)
return false;
}
+ clearError();
return true;
}
diff --git a/src/corelib/kernel/qsystemsemaphore_win.cpp b/src/corelib/kernel/qsystemsemaphore_win.cpp
index 55df20b24e..edf90a31ac 100644
--- a/src/corelib/kernel/qsystemsemaphore_win.cpp
+++ b/src/corelib/kernel/qsystemsemaphore_win.cpp
@@ -136,6 +136,7 @@ bool QSystemSemaphorePrivate::modifySemaphore(int count)
}
}
+ clearError();
return true;
}
diff --git a/src/corelib/tools/qlocale_p.h b/src/corelib/tools/qlocale_p.h
index 4b4606ffab..581a12e0c7 100644
--- a/src/corelib/tools/qlocale_p.h
+++ b/src/corelib/tools/qlocale_p.h
@@ -360,10 +360,10 @@ inline char QLocalePrivate::digitToCLocale(QChar in) const
if (in.unicode() >= '0' && in.unicode() <= '9')
return in.toLatin1();
- if (in == plus())
+ if (in == plus() || in == QLatin1Char('+'))
return '+';
- if (in == minus())
+ if (in == minus() || in == QLatin1Char('-') || in == QChar(0x2212))
return '-';
if (in == decimal())
diff --git a/src/gui/kernel/qoffscreensurface.cpp b/src/gui/kernel/qoffscreensurface.cpp
index e2306050dd..ce913a98af 100644
--- a/src/gui/kernel/qoffscreensurface.cpp
+++ b/src/gui/kernel/qoffscreensurface.cpp
@@ -160,6 +160,8 @@ void QOffscreenSurface::create()
d->platformOffscreenSurface = QGuiApplicationPrivate::platformIntegration()->createPlatformOffscreenSurface(this);
// No platform offscreen surface, fallback to an invisible window
if (!d->platformOffscreenSurface) {
+ if (QThread::currentThread() != qGuiApp->thread())
+ qWarning("Attempting to create QWindow-based QOffscreenSurface outside the gui thread. Expect failures.");
d->offscreenWindow = new QWindow(d->screen);
d->offscreenWindow->setSurfaceType(QWindow::OpenGLSurface);
d->offscreenWindow->setFormat(d->requestedFormat);
diff --git a/src/gui/text/qfontdatabase.cpp b/src/gui/text/qfontdatabase.cpp
index ff050d1758..61c93dc2ac 100644
--- a/src/gui/text/qfontdatabase.cpp
+++ b/src/gui/text/qfontdatabase.cpp
@@ -499,6 +499,8 @@ static const int scriptForWritingSystem[] = {
QChar::Script_Nko // Nko
};
+Q_STATIC_ASSERT(sizeof(scriptForWritingSystem) / sizeof(scriptForWritingSystem[0]) == QFontDatabase::WritingSystemsCount);
+
int qt_script_for_writing_system(QFontDatabase::WritingSystem writingSystem)
{
return scriptForWritingSystem[writingSystem];
@@ -562,9 +564,9 @@ struct QtFontDesc
int familyIndex;
};
-static void match(int script, const QFontDef &request,
- const QString &family_name, const QString &foundry_name, int force_encoding_id,
- QtFontDesc *desc, const QList<int> &blacklistedFamilies = QList<int>());
+static int match(int script, const QFontDef &request,
+ const QString &family_name, const QString &foundry_name, int force_encoding_id,
+ QtFontDesc *desc, const QList<int> &blacklisted);
static void initFontDef(const QtFontDesc &desc, const QFontDef &request, QFontDef *fontDef, bool multi)
{
@@ -846,11 +848,12 @@ static bool matchFamilyName(const QString &familyName, QtFontFamily *f)
Tries to find the best match for a given request and family/foundry
*/
-static void match(int script, const QFontDef &request,
- const QString &family_name, const QString &foundry_name, int force_encoding_id,
- QtFontDesc *desc, const QList<int> &blacklistedFamilies)
+static int match(int script, const QFontDef &request,
+ const QString &family_name, const QString &foundry_name, int force_encoding_id,
+ QtFontDesc *desc, const QList<int> &blacklistedFamilies)
{
Q_UNUSED(force_encoding_id);
+ int result = -1;
QtFontStyle::Key styleKey;
styleKey.style = request.style;
@@ -881,6 +884,8 @@ static void match(int script, const QFontDef &request,
load(family_name, script);
+ const size_t writingSystem = std::find(scriptForWritingSystem, scriptForWritingSystem + QFontDatabase::WritingSystemsCount, script) - scriptForWritingSystem;
+
QFontDatabasePrivate *db = privateDb();
for (int x = 0; x < db->count; ++x) {
if (blacklistedFamilies.contains(x))
@@ -895,19 +900,9 @@ static void match(int script, const QFontDef &request,
if (family_name.isEmpty())
load(test.family->name, script);
- uint score_adjust = 0;
-
- bool supported = (script == QChar::Script_Common);
- for (int ws = 1; !supported && ws < QFontDatabase::WritingSystemsCount; ++ws) {
- if (scriptForWritingSystem[ws] != script)
- continue;
- if (test.family->writingSystems[ws] & QtFontFamily::Supported)
- supported = true;
- }
- if (!supported) {
- // family not supported in the script we want
+ // Check if family is supported in the script we want
+ if (script != QChar::Script_Common && !(test.family->writingSystems[writingSystem] & QtFontFamily::Supported))
continue;
- }
// as we know the script is supported, we can be sure
// to find a matching font here.
@@ -922,15 +917,16 @@ static void match(int script, const QFontDef &request,
QString(), styleKey, request.pixelSize,
pitch, &test, force_encoding_id);
}
- newscore += score_adjust;
if (newscore < score) {
+ result = x;
score = newscore;
*desc = test;
}
if (newscore < 10) // xlfd instead of FT... just accept it
break;
}
+ return result;
}
static QString styleStringHelper(int weight, QFont::Style style)
diff --git a/src/gui/text/qfontdatabase_qpa.cpp b/src/gui/text/qfontdatabase_qpa.cpp
index fddbb11122..6f4971e267 100644
--- a/src/gui/text/qfontdatabase_qpa.cpp
+++ b/src/gui/text/qfontdatabase_qpa.cpp
@@ -184,7 +184,6 @@ QFontEngine *loadSingleEngine(int script,
if (!engine) {
engine = pfdb->fontEngine(def, QChar::Script(script), size->handle);
if (engine) {
- engine->smoothScalable = style->smoothScalable;
QFontCache::Key key(def,script);
QFontCache::instance()->instance()->insertEngine(key,engine);
}
@@ -306,9 +305,12 @@ QFontDatabase::findFont(int script, const QFontPrivate *fp,
}
QtFontDesc desc;
- match(script, request, family_name, foundry_name, force_encoding_id, &desc);
- if (desc.family != 0 && desc.foundry != 0 && desc.style != 0) {
+ QList<int> blackListed;
+ int index = match(script, request, family_name, foundry_name, force_encoding_id, &desc, blackListed);
+ if (index >= 0) {
engine = loadEngine(script, request, desc.family, desc.foundry, desc.style, desc.size);
+ if (!engine)
+ blackListed.append(index);
} else {
FM_DEBUG(" NO MATCH FOUND\n");
}
@@ -332,6 +334,8 @@ QFontDatabase::findFont(int script, const QFontPrivate *fp,
QFont::Style(request.style),
QFont::StyleHint(request.styleHint),
QChar::Script(script));
+ if (script > QChar::Script_Common)
+ fallbacks += QString(); // Find the first font matching the specified script.
for (int i = 0; !engine && i < fallbacks.size(); i++) {
QFontDef def = request;
@@ -340,14 +344,19 @@ QFontDatabase::findFont(int script, const QFontPrivate *fp,
engine = QFontCache::instance()->findEngine(key);
if (!engine) {
QtFontDesc desc;
- match(script, def, def.family, QLatin1String(""), 0, &desc);
- if (desc.family == 0 && desc.foundry == 0 && desc.style == 0) {
- continue;
- }
- engine = loadEngine(script, def, desc.family, desc.foundry, desc.style, desc.size);
- if (engine) {
- initFontDef(desc, def, &engine->fontDef, engine->type() == QFontEngine::Multi);
- }
+ do {
+ index = match(script, def, def.family, QLatin1String(""), 0, &desc, blackListed);
+ if (index >= 0) {
+ QFontDef loadDef = def;
+ if (loadDef.family.isEmpty())
+ loadDef.family = desc.family->name;
+ engine = loadEngine(script, loadDef, desc.family, desc.foundry, desc.style, desc.size);
+ if (engine)
+ initFontDef(desc, loadDef, &engine->fontDef, engine->type() == QFontEngine::Multi);
+ else
+ blackListed.append(index);
+ }
+ } while (index >= 0 && !engine);
}
}
}
diff --git a/src/gui/text/qfontengine.cpp b/src/gui/text/qfontengine.cpp
index 7d1afbbfb6..303c85ce75 100644
--- a/src/gui/text/qfontengine.cpp
+++ b/src/gui/text/qfontengine.cpp
@@ -208,8 +208,7 @@ Q_AUTOTEST_EXPORT QList<QFontEngine *> QFontEngine_stopCollectingEngines()
QFontEngine::QFontEngine()
: ref(0),
font_(0), font_destroy_func(0),
- face_(0), face_destroy_func(0),
- smoothScalable(false)
+ face_(0), face_destroy_func(0)
{
cache_cost = 0;
fsType = 0;
diff --git a/src/gui/text/qfontengine_p.h b/src/gui/text/qfontengine_p.h
index 07be498764..c181d61d73 100644
--- a/src/gui/text/qfontengine_p.h
+++ b/src/gui/text/qfontengine_p.h
@@ -302,8 +302,6 @@ public:
inline QVariant userData() const { return m_userData; }
- bool smoothScalable;
-
protected:
QFixed lastRightBearing(const QGlyphLayout &glyphs, bool round = false);
diff --git a/src/network/kernel/qnetworkinterface_unix.cpp b/src/network/kernel/qnetworkinterface_unix.cpp
index 01c082059f..d3c830a66f 100644
--- a/src/network/kernel/qnetworkinterface_unix.cpp
+++ b/src/network/kernel/qnetworkinterface_unix.cpp
@@ -277,18 +277,18 @@ static QList<QNetworkInterfacePrivate *> interfaceListing()
}
}
- // Get the interface netmask
- if (qt_safe_ioctl(socket, SIOCGIFNETMASK, &req) >= 0) {
- sockaddr *sa = &req.ifr_addr;
- entry.setNetmask(addressFromSockaddr(sa));
- }
-
// Get the address of the interface
if (qt_safe_ioctl(socket, SIOCGIFADDR, &req) >= 0) {
sockaddr *sa = &req.ifr_addr;
entry.setIp(addressFromSockaddr(sa));
}
+ // Get the interface netmask
+ if (qt_safe_ioctl(socket, SIOCGIFNETMASK, &req) >= 0) {
+ sockaddr *sa = &req.ifr_addr;
+ entry.setNetmask(addressFromSockaddr(sa));
+ }
+
iface->addressEntries << entry;
}
diff --git a/src/plugins/bearer/corewlan/qcorewlanengine.mm b/src/plugins/bearer/corewlan/qcorewlanengine.mm
index b0ed4076da..dc2920360d 100644
--- a/src/plugins/bearer/corewlan/qcorewlanengine.mm
+++ b/src/plugins/bearer/corewlan/qcorewlanengine.mm
@@ -71,7 +71,7 @@ extern "C" { // Otherwise it won't find CWKeychain* symbols at link time
QCoreWlanEngine *engine;
NSLock *locker;
}
-- (void)notificationHandler;//:(NSNotification *)notification;
+- (void)notificationHandler:(NSNotification *)notification;
- (void)remove;
- (void)setEngine:(QCoreWlanEngine *)coreEngine;
- (QCoreWlanEngine *)engine;
@@ -120,8 +120,9 @@ extern "C" { // Otherwise it won't find CWKeychain* symbols at link time
[locker unlock];
}
-- (void)notificationHandler//:(NSNotification *)notification
+- (void)notificationHandler:(NSNotification *)notification
{
+ Q_UNUSED(notification);
engine->requestUpdate();
}
@end
diff --git a/src/plugins/bearer/corewlan/qcorewlanengine_10_6.mm b/src/plugins/bearer/corewlan/qcorewlanengine_10_6.mm
index 1b95ae29ad..7044e9696b 100644
--- a/src/plugins/bearer/corewlan/qcorewlanengine_10_6.mm
+++ b/src/plugins/bearer/corewlan/qcorewlanengine_10_6.mm
@@ -48,7 +48,7 @@
QCoreWlanEngine *engine;
NSLock *locker;
}
-- (void)notificationHandler;//:(NSNotification *)notification;
+- (void)notificationHandler:(NSNotification *)notification;
- (void)remove;
- (void)setEngine:(QCoreWlanEngine *)coreEngine;
- (QCoreWlanEngine *)engine;
@@ -97,8 +97,9 @@
[locker unlock];
}
-- (void)notificationHandler//:(NSNotification *)notification
+- (void)notificationHandler:(NSNotification *)notification
{
+ Q_UNUSED(notification);
engine->requestUpdate();
}
@end
diff --git a/src/plugins/platforms/cocoa/qcocoadrag.h b/src/plugins/platforms/cocoa/qcocoadrag.h
index 80259df600..6810a21944 100644
--- a/src/plugins/platforms/cocoa/qcocoadrag.h
+++ b/src/plugins/platforms/cocoa/qcocoadrag.h
@@ -55,6 +55,7 @@ class QCocoaDrag : public QPlatformDrag
{
public:
QCocoaDrag();
+ virtual ~QCocoaDrag();
virtual QMimeData *platformDropData();
virtual Qt::DropAction drag(QDrag *m_drag);
diff --git a/src/plugins/platforms/cocoa/qcocoadrag.mm b/src/plugins/platforms/cocoa/qcocoadrag.mm
index a37552d844..a22830f64e 100644
--- a/src/plugins/platforms/cocoa/qcocoadrag.mm
+++ b/src/plugins/platforms/cocoa/qcocoadrag.mm
@@ -53,9 +53,15 @@ QCocoaDrag::QCocoaDrag() :
m_lastView = 0;
}
+QCocoaDrag::~QCocoaDrag()
+{
+ [m_lastEvent release];
+}
+
void QCocoaDrag::setLastMouseEvent(NSEvent *event, NSView *view)
{
- m_lastEvent = event;
+ [m_lastEvent release];
+ m_lastEvent = [event copy];
m_lastView = view;
}
diff --git a/src/plugins/platforms/cocoa/qcocoafiledialoghelper.h b/src/plugins/platforms/cocoa/qcocoafiledialoghelper.h
index 8a8b1d946c..16d1ffbe85 100644
--- a/src/plugins/platforms/cocoa/qcocoafiledialoghelper.h
+++ b/src/plugins/platforms/cocoa/qcocoafiledialoghelper.h
@@ -82,6 +82,7 @@ public:
private:
void *mDelegate;
+ QUrl mDir;
};
QT_END_NAMESPACE
diff --git a/src/plugins/platforms/cocoa/qcocoafiledialoghelper.mm b/src/plugins/platforms/cocoa/qcocoafiledialoghelper.mm
index 1ad833ee44..08505d91a2 100644
--- a/src/plugins/platforms/cocoa/qcocoafiledialoghelper.mm
+++ b/src/plugins/platforms/cocoa/qcocoafiledialoghelper.mm
@@ -610,6 +610,8 @@ void QCocoaFileDialogHelper::setDirectory(const QUrl &directory)
QNSOpenSavePanelDelegate *delegate = static_cast<QNSOpenSavePanelDelegate *>(mDelegate);
if (delegate)
[delegate->mSavePanel setDirectoryURL:[NSURL fileURLWithPath:QCFString::toNSString(directory.toLocalFile())]];
+ else
+ mDir = directory;
}
QUrl QCocoaFileDialogHelper::directory() const
@@ -619,7 +621,7 @@ QUrl QCocoaFileDialogHelper::directory() const
QString path = QCFString::toQString([[delegate->mSavePanel directoryURL] path]).normalized(QString::NormalizationForm_C);
return QUrl::fromLocalFile(path);
}
- return QUrl();
+ return mDir;
}
void QCocoaFileDialogHelper::selectFile(const QUrl &filename)
@@ -707,7 +709,7 @@ void QCocoaFileDialogHelper::createNSOpenSavePanelDelegate()
QCocoaAutoReleasePool pool;
const SharedPointerFileDialogOptions &opts = options();
const QList<QUrl> selectedFiles = opts->initiallySelectedFiles();
- const QUrl directory = opts->initialDirectory();
+ const QUrl directory = mDir.isEmpty() ? opts->initialDirectory() : mDir;
const bool selectDir = selectedFiles.isEmpty();
QString selection(selectDir ? directory.toLocalFile() : selectedFiles.front().toLocalFile());
QNSOpenSavePanelDelegate *delegate = [[QNSOpenSavePanelDelegate alloc]
diff --git a/src/plugins/platforms/cocoa/qcocoawindow.mm b/src/plugins/platforms/cocoa/qcocoawindow.mm
index 4da47f4f1f..b5b9cec2be 100644
--- a/src/plugins/platforms/cocoa/qcocoawindow.mm
+++ b/src/plugins/platforms/cocoa/qcocoawindow.mm
@@ -522,6 +522,20 @@ void QCocoaWindow::setWindowFlags(Qt::WindowFlags flags)
if (!(styleMask & NSBorderlessWindowMask)) {
setWindowTitle(window()->title());
}
+
+#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_7
+ if (QSysInfo::QSysInfo::MacintoshVersion >= QSysInfo::MV_10_7) {
+ Qt::WindowType type = window()->type();
+ if ((type & Qt::Popup) != Qt::Popup && (type & Qt::Dialog) != Qt::Dialog) {
+ NSWindowCollectionBehavior behavior = [m_nsWindow collectionBehavior];
+ if (flags & Qt::WindowFullscreenButtonHint)
+ behavior |= NSWindowCollectionBehaviorFullScreenPrimary;
+ else
+ behavior &= ~NSWindowCollectionBehaviorFullScreenPrimary;
+ [m_nsWindow setCollectionBehavior:behavior];
+ }
+ }
+#endif
}
m_windowFlags = flags;
@@ -871,8 +885,6 @@ NSWindow * QCocoaWindow::createNSWindow()
// before the window is shown and needs a proper window.).
if ((type & Qt::Popup) == Qt::Popup)
[window setHasShadow:YES];
- else
- setWindowShadow(flags);
[window setHidesOnDeactivate: NO];
#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_7
@@ -894,14 +906,6 @@ NSWindow * QCocoaWindow::createNSWindow()
defer:NO]; // Deferring window creation breaks OpenGL (the GL context is set up
// before the window is shown and needs a proper window.).
window->m_cocoaPlatformWindow = this;
- setWindowShadow(flags);
-
-#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_7
- if (QSysInfo::QSysInfo::MacintoshVersion >= QSysInfo::MV_10_7) {
- if (flags & Qt::WindowFullscreenButtonHint)
- [window setCollectionBehavior:NSWindowCollectionBehaviorFullScreenPrimary];
- }
-#endif
createdWindow = window;
}
diff --git a/src/plugins/platforms/qnx/qqnxnativeinterface.cpp b/src/plugins/platforms/qnx/qqnxnativeinterface.cpp
index 6e7fc35a82..e468b051cd 100644
--- a/src/plugins/platforms/qnx/qqnxnativeinterface.cpp
+++ b/src/plugins/platforms/qnx/qqnxnativeinterface.cpp
@@ -54,11 +54,13 @@ QT_BEGIN_NAMESPACE
void *QQnxNativeInterface::nativeResourceForWindow(const QByteArray &resource, QWindow *window)
{
if (resource == "windowGroup" && window && window->screen()) {
- const QQnxScreen * const screen = static_cast<QQnxScreen *>(window->screen()->handle());
+ QQnxScreen * const screen = static_cast<QQnxScreen *>(window->screen()->handle());
if (screen) {
+ screen_window_t screenWindow = reinterpret_cast<screen_window_t>(window->winId());
+ QQnxWindow *qnxWindow = screen->findWindow(screenWindow);
// We can't just call data() instead of constData() here, since that would detach
// and the lifetime of the char * would not be long enough. Therefore the const_cast.
- return const_cast<char *>(screen->rootWindow()->groupName().constData());
+ return qnxWindow ? const_cast<char *>(qnxWindow->groupName().constData()) : 0;
}
}
diff --git a/src/plugins/platforms/windows/qwindowsfontenginedirectwrite.cpp b/src/plugins/platforms/windows/qwindowsfontenginedirectwrite.cpp
index 7407d88f8b..d81848fcc7 100644
--- a/src/plugins/platforms/windows/qwindowsfontenginedirectwrite.cpp
+++ b/src/plugins/platforms/windows/qwindowsfontenginedirectwrite.cpp
@@ -276,7 +276,7 @@ bool QWindowsFontEngineDirectWrite::getSfntTableData(uint tag, uchar *buffer, ui
UINT32 tableSize;
void *tableContext = 0;
BOOL exists;
- HRESULT hr = m_directWriteFontFace->TryGetFontTable(qbswap<quint32>(tag)
+ HRESULT hr = m_directWriteFontFace->TryGetFontTable(qbswap<quint32>(tag),
&tableData, &tableSize,
&tableContext, &exists);
if (SUCCEEDED(hr)) {
diff --git a/src/plugins/platforms/windows/qwindowsglcontext.cpp b/src/plugins/platforms/windows/qwindowsglcontext.cpp
index 93f2b53672..d63149e4ce 100644
--- a/src/plugins/platforms/windows/qwindowsglcontext.cpp
+++ b/src/plugins/platforms/windows/qwindowsglcontext.cpp
@@ -589,7 +589,7 @@ static HGLRC createContext(const QOpenGLStaticContext &staticContext,
if (requestedVersion >= 0x0300) {
attributes[attribIndex++] = WGL_CONTEXT_FLAGS_ARB;
attributes[attribIndex] = 0;
- if (format.testOption(QSurfaceFormat::DeprecatedFunctions))
+ if (!format.testOption(QSurfaceFormat::DeprecatedFunctions))
attributes[attribIndex] |= WGL_CONTEXT_FORWARD_COMPATIBLE_BIT_ARB;
if (format.testOption(QSurfaceFormat::DebugContext))
attributes[attribIndex] |= WGL_CONTEXT_DEBUG_BIT_ARB;
diff --git a/src/plugins/platforms/xcb/qxcbnativeinterface.cpp b/src/plugins/platforms/xcb/qxcbnativeinterface.cpp
index aeda1e11d1..7d69564c57 100644
--- a/src/plugins/platforms/xcb/qxcbnativeinterface.cpp
+++ b/src/plugins/platforms/xcb/qxcbnativeinterface.cpp
@@ -76,7 +76,7 @@ static int resourceType(const QByteArray &key)
static const QByteArray names[] = { // match QXcbNativeInterface::ResourceType
QByteArrayLiteral("display"), QByteArrayLiteral("egldisplay"),
QByteArrayLiteral("connection"), QByteArrayLiteral("screen"),
- QByteArrayLiteral("graphicsdevice"), QByteArrayLiteral("eglcontext"),
+ QByteArrayLiteral("eglcontext"),
QByteArrayLiteral("glxcontext"), QByteArrayLiteral("apptime"),
QByteArrayLiteral("appusertime"), QByteArrayLiteral("hintstyle"),
QByteArrayLiteral("startupid"), QByteArrayLiteral("traywindow"),
@@ -212,7 +212,7 @@ void *QXcbNativeInterface::nativeResourceForWindow(const QByteArray &resourceStr
result = connectionForWindow(window);
break;
case Screen:
- result = qPlatformScreenForWindow(window);
+ result = screenForWindow(window);
break;
default:
break;
diff --git a/src/plugins/platforms/xcb/qxcbnativeinterface.h b/src/plugins/platforms/xcb/qxcbnativeinterface.h
index aec78087f5..9c4fa44d3b 100644
--- a/src/plugins/platforms/xcb/qxcbnativeinterface.h
+++ b/src/plugins/platforms/xcb/qxcbnativeinterface.h
@@ -62,7 +62,6 @@ public:
EglDisplay,
Connection,
Screen,
- GraphicsDevice,
EglContext,
GLXContext,
AppTime,
@@ -90,7 +89,6 @@ public:
void *eglDisplayForWindow(QWindow *window);
void *connectionForWindow(QWindow *window);
void *screenForWindow(QWindow *window);
- void *graphicsDeviceForWindow(QWindow *window);
void *appTime(const QXcbScreen *screen);
void *appUserTime(const QXcbScreen *screen);
void *getTimestamp(const QXcbScreen *screen);
diff --git a/src/plugins/platforms/xcb/xcb-plugin.pro b/src/plugins/platforms/xcb/xcb-plugin.pro
index 4f69ca8aab..49a1c1b320 100644
--- a/src/plugins/platforms/xcb/xcb-plugin.pro
+++ b/src/plugins/platforms/xcb/xcb-plugin.pro
@@ -81,15 +81,7 @@ contains(QT_CONFIG, xcb-sm) {
}
contains(QT_CONFIG, opengl) {
- contains(QT_CONFIG, opengles2) {
- DEFINES += XCB_USE_EGL
- CONFIG += egl
- HEADERS += qxcbeglsurface.h
-
- # EGL on MeeGo 1.2 Harmattan needs this macro to map EGLNativeDisplayType
- # and other types to the correct X11 types
- DEFINES += SUPPORT_X11
- } else:contains(QT_CONFIG, xcb-xlib) {
+ contains(QT_CONFIG, xcb-xlib):contains(QT_CONFIG, glx) {
DEFINES += XCB_USE_GLX
HEADERS += qglxintegration.h
SOURCES += qglxintegration.cpp
@@ -98,6 +90,14 @@ contains(QT_CONFIG, opengl) {
DEFINES += XCB_HAS_XCB_GLX
LIBS += -lxcb-glx
}
+ } else:contains(QT_CONFIG, egl) {
+ DEFINES += XCB_USE_EGL
+ CONFIG += egl
+ HEADERS += qxcbeglsurface.h
+
+ # EGL on MeeGo 1.2 Harmattan needs this macro to map EGLNativeDisplayType
+ # and other types to the correct X11 types
+ DEFINES += SUPPORT_X11
}
}
diff --git a/src/printsupport/kernel/qprinter.cpp b/src/printsupport/kernel/qprinter.cpp
index 0905cbb59f..819f9343f7 100644
--- a/src/printsupport/kernel/qprinter.cpp
+++ b/src/printsupport/kernel/qprinter.cpp
@@ -55,10 +55,7 @@
#include <private/qpagedpaintdevice_p.h>
-
-#ifndef QT_NO_PDF
#include "qprintengine_pdf_p.h"
-#endif
#include <qpicture.h>
#include <private/qpaintengine_preview_p.h>
@@ -618,8 +615,6 @@ QPrinter::~QPrinter()
*/
void QPrinter::setOutputFormat(OutputFormat format)
{
-
-#ifndef QT_NO_PDF
Q_D(QPrinter);
if (d->validPrinter && d->outputFormat == format)
return;
@@ -651,9 +646,6 @@ void QPrinter::setOutputFormat(OutputFormat format)
if (d->outputFormat == QPrinter::PdfFormat)
d->validPrinter = true;
-#else
- Q_UNUSED(format);
-#endif
}
/*!
diff --git a/src/sql/drivers/mysql/qsql_mysql.cpp b/src/sql/drivers/mysql/qsql_mysql.cpp
index 0e20cf539e..1b1cb2ac91 100644
--- a/src/sql/drivers/mysql/qsql_mysql.cpp
+++ b/src/sql/drivers/mysql/qsql_mysql.cpp
@@ -857,7 +857,7 @@ static MYSQL_TIME *toMySqlDate(QDate date, QTime time, QVariant::Type type)
myTime->hour = time.hour();
myTime->minute = time.minute();
myTime->second = time.second();
- myTime->second_part = time.msec();
+ myTime->second_part = time.msec() * 1000;
}
if (type == QVariant::Date || type == QVariant::DateTime) {
myTime->year = date.year();
diff --git a/src/sql/drivers/sqlite/qsql_sqlite.cpp b/src/sql/drivers/sqlite/qsql_sqlite.cpp
index 0a8b71aa8a..27bc80e63f 100644
--- a/src/sql/drivers/sqlite/qsql_sqlite.cpp
+++ b/src/sql/drivers/sqlite/qsql_sqlite.cpp
@@ -42,6 +42,7 @@
#include "qsql_sqlite_p.h"
#include <qcoreapplication.h>
+#include <qdatetime.h>
#include <qvariant.h>
#include <qsqlerror.h>
#include <qsqlfield.h>
@@ -447,6 +448,20 @@ bool QSQLiteResult::exec()
case QVariant::LongLong:
res = sqlite3_bind_int64(d->stmt, i + 1, value.toLongLong());
break;
+ case QVariant::DateTime: {
+ const QDateTime dateTime = value.toDateTime();
+ const QString str = dateTime.toString(QStringLiteral("yyyy-MM-ddThh:mm:ss.zzz"));
+ res = sqlite3_bind_text16(d->stmt, i + 1, str.utf16(),
+ str.size() * sizeof(ushort), SQLITE_TRANSIENT);
+ break;
+ }
+ case QVariant::Time: {
+ const QTime time = value.toTime();
+ const QString str = time.toString(QStringLiteral("hh:mm:ss.zzz"));
+ res = sqlite3_bind_text16(d->stmt, i + 1, str.utf16(),
+ str.size() * sizeof(ushort), SQLITE_TRANSIENT);
+ break;
+ }
case QVariant::String: {
// lifetime of string == lifetime of its qvariant
const QString *str = static_cast<const QString*>(value.constData());
diff --git a/src/widgets/doc/snippets/code/src_gui_widgets_qlabel.cpp b/src/widgets/doc/snippets/code/src_gui_widgets_qlabel.cpp
index 7263a72302..c7dd00407d 100644
--- a/src/widgets/doc/snippets/code/src_gui_widgets_qlabel.cpp
+++ b/src/widgets/doc/snippets/code/src_gui_widgets_qlabel.cpp
@@ -47,18 +47,18 @@ label->setAlignment(Qt::AlignBottom | Qt::AlignRight);
//! [1]
-QLineEdit* phoneEdit = new QLineEdit(this);
-QLabel* phoneLabel = new QLabel("&Phone:", this);
+QLineEdit *phoneEdit = new QLineEdit(this);
+QLabel *phoneLabel = new QLabel("&Phone:", this);
phoneLabel->setBuddy(phoneEdit);
//! [1]
//! [2]
-QLineEdit *nameEd = new QLineEdit(this);
-QLabel *nameLb = new QLabel("&Name:", this);
-nameLb->setBuddy(nameEd);
-QLineEdit *phoneEd = new QLineEdit(this);
-QLabel *phoneLb = new QLabel("&Phone:", this);
-phoneLb->setBuddy(phoneEd);
+QLineEdit *nameEdit = new QLineEdit(this);
+QLabel *nameLabel = new QLabel("&Name:", this);
+nameLabel->setBuddy(nameEdit);
+QLineEdit *phoneEdit = new QLineEdit(this);
+QLabel *phoneLabel = new QLabel("&Phone:", this);
+phoneLabel->setBuddy(phoneEdit);
// (layout setup not shown)
//! [2]
diff --git a/src/widgets/graphicsview/qgraphicsitem.cpp b/src/widgets/graphicsview/qgraphicsitem.cpp
index a4adb3d20b..04047d8d0a 100644
--- a/src/widgets/graphicsview/qgraphicsitem.cpp
+++ b/src/widgets/graphicsview/qgraphicsitem.cpp
@@ -1414,7 +1414,10 @@ QGraphicsItem::~QGraphicsItem()
QObjectPrivate *p = QObjectPrivate::get(o);
p->wasDeleted = true;
if (p->declarativeData) {
- QAbstractDeclarativeData::destroyed(p->declarativeData, o);
+ if (QAbstractDeclarativeData::destroyed)
+ QAbstractDeclarativeData::destroyed(p->declarativeData, o);
+ if (QAbstractDeclarativeData::destroyed_qml1)
+ QAbstractDeclarativeData::destroyed_qml1(p->declarativeData, o);
p->declarativeData = 0;
}
}
diff --git a/src/widgets/kernel/qwidget.cpp b/src/widgets/kernel/qwidget.cpp
index 0d8e20ca0c..a395785650 100644
--- a/src/widgets/kernel/qwidget.cpp
+++ b/src/widgets/kernel/qwidget.cpp
@@ -1464,7 +1464,10 @@ QWidget::~QWidget()
}
if (d->declarativeData) {
- QAbstractDeclarativeData::destroyed(d->declarativeData, this);
+ if (QAbstractDeclarativeData::destroyed)
+ QAbstractDeclarativeData::destroyed(d->declarativeData, this);
+ if (QAbstractDeclarativeData::destroyed_qml1)
+ QAbstractDeclarativeData::destroyed_qml1(d->declarativeData, this);
d->declarativeData = 0; // don't activate again in ~QObject
}