From 85011b82f08e0be09012d0e766f5550e262ec594 Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Thu, 3 Jul 2014 10:46:23 +0200 Subject: fix paths in installed qtmain.prl simply make use of the infrastructure used for "proper" modules. Task-number: QTBUG-40026 Change-Id: Iffab72f7fb7a128549da2839a7497cff2f48b777 Reviewed-by: Joerg Bornemann --- src/winmain/winmain.pro | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) (limited to 'src') diff --git a/src/winmain/winmain.pro b/src/winmain/winmain.pro index 998200cb1e..5e658fa7e1 100644 --- a/src/winmain/winmain.pro +++ b/src/winmain/winmain.pro @@ -27,10 +27,7 @@ load(qt_installs) TARGET = $$qtLibraryTarget($$TARGET$$QT_LIBINFIX) #do this towards the end load(qt_targets) +load(qt_build_paths) +load(qt_common) wince*:QMAKE_POST_LINK = - -lib_replace.match = $$[QT_INSTALL_LIBS/get] -lib_replace.replace = $$[QT_INSTALL_LIBS/raw] -lib_replace.CONFIG = path -QMAKE_PRL_INSTALL_REPLACE += lib_replace -- cgit v1.2.3 From 3a347a4e70e5a10ee92dd2578316c926a399e894 Mon Sep 17 00:00:00 2001 From: David Fries Date: Thu, 17 Jul 2014 15:23:26 -0500 Subject: OpenGL: destroy QGLContext allocated by QGLContext::fromOpenGLContext QGLContext already uses ownContext to identify when it "owns" QOpenGLContext and will delete QOpenGLContext when needed. In the other way QGLContext::fromOpenGLContext creates a QGLContext for QOpenGLContext, and is now using qGLContextDeleteFunction to identify if QOpenGLContext "owns" QGLContext by QGLContext only passing a delete function when QOpenGLContext should delete QGLContext, and by QOpenGLContext calling deleteQGLContext() from destory() to do the destruction avoiding the previous leak and sometimes crash on exit. Change-Id: I65e791776e99b456e4d0c70fc5b5cdb33c975893 Task-number: QTBUG-40286 Reviewed-by: Laszlo Agocs --- src/gui/kernel/qopenglcontext.cpp | 4 ++++ src/opengl/qgl_p.h | 1 + src/opengl/qgl_qpa.cpp | 4 ++-- 3 files changed, 7 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/gui/kernel/qopenglcontext.cpp b/src/gui/kernel/qopenglcontext.cpp index be592153d2..406c784c5c 100644 --- a/src/gui/kernel/qopenglcontext.cpp +++ b/src/gui/kernel/qopenglcontext.cpp @@ -538,6 +538,7 @@ bool QOpenGLContext::create() */ void QOpenGLContext::destroy() { + deleteQGLContext(); Q_D(QOpenGLContext); if (d->platformGLContext) emit aboutToBeDestroyed(); @@ -984,6 +985,9 @@ void *QOpenGLContext::qGLContextHandle() const } /*! + internal: If the delete function is specified QOpenGLContext "owns" + the passed context handle and will use the delete function to destroy it. + \internal */ void QOpenGLContext::setQGLContextHandle(void *handle,void (*qGLContextDeleteFunction)(void *)) diff --git a/src/opengl/qgl_p.h b/src/opengl/qgl_p.h index 22fc3f4ad0..ac4b6d2acc 100644 --- a/src/opengl/qgl_p.h +++ b/src/opengl/qgl_p.h @@ -242,6 +242,7 @@ public: void swapRegion(const QRegion ®ion); QOpenGLContext *guiGlContext; + // true if QGLContext owns the QOpenGLContext (for who deletes who) bool ownContext; void setupSharing(); diff --git a/src/opengl/qgl_qpa.cpp b/src/opengl/qgl_qpa.cpp index 90ba0e7f5a..6194f82922 100644 --- a/src/opengl/qgl_qpa.cpp +++ b/src/opengl/qgl_qpa.cpp @@ -135,7 +135,7 @@ bool QGLFormat::hasOpenGL() ->hasCapability(QPlatformIntegration::OpenGL); } -void qDeleteQGLContext(void *handle) +static void qDeleteQGLContext(void *handle) { QGLContext *context = static_cast(handle); delete context; @@ -177,7 +177,7 @@ bool QGLContext::chooseContext(const QGLContext* shareContext) d->valid = d->guiGlContext->create(); if (d->valid) - d->guiGlContext->setQGLContextHandle(this,qDeleteQGLContext); + d->guiGlContext->setQGLContextHandle(this, 0); d->glFormat = QGLFormat::fromSurfaceFormat(d->guiGlContext->format()); d->setupSharing(); -- cgit v1.2.3 From bde755558cbe4587ed0756524ce1b97caf675d0d Mon Sep 17 00:00:00 2001 From: Laszlo Agocs Date: Sat, 28 Jun 2014 12:44:36 +0200 Subject: Do not add QOffscreenSurface windows to the global list QOffscreenSurface has to stay usable even after returning from app.exec(). Hence close()ing the underlying hidden window, that is used on platforms that do not provide real offscreen surfaces, is wrong. Normally all QWindows are closed (and thus destroy()'ed) when quitting the application, meaning the the offscreen surface cannot be made current anymore after returning from exec(). This is an unnecessary limitation and makes certain cleanup operations impossible. Backport of ba79f36cb1319a279068adb6d02a8993cbc62613 from dev. This is necessary for the 5.3 series too to avoid issues on exit in QQickWidget apps, on OS X in particular. Task-number: QTBUG-40505 Task-number: QTBUG-39908 Change-Id: Iea1489378a18f29ff84ba8f13a6dad2d66d2b315 Reviewed-by: Gunnar Sletta --- src/gui/kernel/qoffscreensurface.cpp | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src') diff --git a/src/gui/kernel/qoffscreensurface.cpp b/src/gui/kernel/qoffscreensurface.cpp index 1625909843..003e3a0cc9 100644 --- a/src/gui/kernel/qoffscreensurface.cpp +++ b/src/gui/kernel/qoffscreensurface.cpp @@ -171,6 +171,9 @@ void QOffscreenSurface::create() if (QThread::currentThread() != qGuiApp->thread()) qWarning("Attempting to create QWindow-based QOffscreenSurface outside the gui thread. Expect failures."); d->offscreenWindow = new QWindow(d->screen); + // Remove this window from the global list since we do not want it to be destroyed when closing the app. + // The QOffscreenSurface has to be usable even after exiting the event loop. + QGuiApplicationPrivate::window_list.removeOne(d->offscreenWindow); d->offscreenWindow->setSurfaceType(QWindow::OpenGLSurface); d->offscreenWindow->setFormat(d->requestedFormat); d->offscreenWindow->setGeometry(0, 0, d->size.width(), d->size.height()); -- cgit v1.2.3 From 4124cd159e58cf806cfae7ecdadd4359eb0293de Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Peter=20K=C3=BCmmel?= Date: Mon, 14 Jul 2014 12:42:02 +0200 Subject: Undo: Fix state entry bug for parallel state groups This commit reverts c4cef6fae9f2a55f21fc9517855dfcf659c89081. The above fix for QTBUG-25958 (cloned in QTBUG-40219) is not complete and introduces the regression QTBUG-30049. Task-number: QTBUG-30049, QTBUG-25958, QTBUG-40219 Change-Id: I3c4b774dce06c13cb4e089f8413a7747cedfd212 Reviewed-by: Thiago Macieira --- src/corelib/statemachine/qstatemachine.cpp | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) (limited to 'src') diff --git a/src/corelib/statemachine/qstatemachine.cpp b/src/corelib/statemachine/qstatemachine.cpp index d2e2368ca9..a79f9d30d2 100644 --- a/src/corelib/statemachine/qstatemachine.cpp +++ b/src/corelib/statemachine/qstatemachine.cpp @@ -519,10 +519,6 @@ QList QStateMachinePrivate::computeStatesToEnter(const QList lcac = QStatePrivate::get(lca)->childStates(); foreach (QAbstractState* child,lcac) { @@ -720,6 +716,7 @@ void QStateMachinePrivate::addStatesToEnter(QAbstractState *s, QState *root, return; } } + addAncestorStatesToEnter(s, root, statesToEnter, statesForDefaultEntry); } } @@ -1088,7 +1085,6 @@ void QStateMachinePrivate::setError(QStateMachine::Error errorCode, QAbstractSta if (currentErrorState != 0) { QState *lca = findLCA(QList() << currentErrorState << currentContext); addStatesToEnter(currentErrorState, lca, pendingErrorStates, pendingErrorStatesForDefaultEntry); - addAncestorStatesToEnter(currentErrorState, lca, pendingErrorStates, pendingErrorStatesForDefaultEntry); } else { qWarning("Unrecoverable error detected in running state machine: %s", qPrintable(errorString)); -- cgit v1.2.3 From 77b40ab79bdeeff64a34970497003eba3598017a Mon Sep 17 00:00:00 2001 From: Jerome Pasion Date: Tue, 5 Aug 2014 11:53:22 +0200 Subject: Doc: Placed Qt OpenGL class convention in code block. -QDoc tried to autolink where it should not. -The syntax looks much better in a code block than in a paragraph. Change-Id: I21d08cbb1537186d09b52898d7b70a5c0794256c Task-number: QTBUG-35019 Reviewed-by: Gunnar Sletta --- src/gui/opengl/qopenglversionfunctions.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/gui/opengl/qopenglversionfunctions.cpp b/src/gui/opengl/qopenglversionfunctions.cpp index 5949eb6391..fe709eba8d 100644 --- a/src/gui/opengl/qopenglversionfunctions.cpp +++ b/src/gui/opengl/qopenglversionfunctions.cpp @@ -98,8 +98,10 @@ void QAbstractOpenGLFunctionsPrivate::removeFunctionsBackend(QOpenGLContext *con Qt now provides a family of classes which all inherit from QAbstractOpenGLFunctions which expose every core OpenGL function by way of a corresponding member function. There is a class for every valid combination - of OpenGL version and profile. Each class follows the naming convention - QOpenGLFunctions__[_PROFILE]. + of OpenGL version and profile. Each class follows the naming convention: + \badcode + QOpenGLFunctions__[_PROFILE] + \endcode For OpenGL versions 1.0 through to 3.0 there are no profiles, leading to the classes: -- cgit v1.2.3 From 276036179a112abf45bb433ef3b918ed68b807ff Mon Sep 17 00:00:00 2001 From: Shawn Rutledge Date: Tue, 5 Aug 2014 11:33:48 +0200 Subject: QFileDialog docs: remove misleading sentence about static functions Native dialogs are used whenever possible, not just when the dialog is instantiated via the static function. Task-number: QTBUG-36657 Change-Id: Ibad67114e67f8e2f9956037f8469542c72bfd8ea Reviewed-by: Jerome Pasion --- src/widgets/dialogs/qfiledialog.cpp | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'src') diff --git a/src/widgets/dialogs/qfiledialog.cpp b/src/widgets/dialogs/qfiledialog.cpp index 6349bdc301..9219757dbf 100644 --- a/src/widgets/dialogs/qfiledialog.cpp +++ b/src/widgets/dialogs/qfiledialog.cpp @@ -89,9 +89,7 @@ Q_GLOBAL_STATIC(QString, lastVisitedDir) The QFileDialog class enables a user to traverse the file system in order to select one or many files or a directory. - The easiest way to create a QFileDialog is to use the static - functions. On Windows, Mac OS X, KDE and GNOME, these static functions will - call the native file dialog when possible. + The easiest way to create a QFileDialog is to use the static functions. \snippet code/src_gui_dialogs_qfiledialog.cpp 0 -- cgit v1.2.3 From 2ad9e69a9f9231b5f65a53036ae60bb0abc93609 Mon Sep 17 00:00:00 2001 From: Shawn Rutledge Date: Tue, 5 Aug 2014 12:58:47 +0200 Subject: GTK file dialog: pre-fill the filename if given to a Save dialog The docs for gtk_file_chooser_set_filename explain that if a file is new, we should call gtk_file_chooser_set_current_name instead. (But in that case it is necessary to set the directory separately.) Qt doesn't make a distinction between a save dialog for saving a new file vs. a dialog for re-saving an existing file, so it seems this is the better way to do it all the time, since a save dialog would most often be used for saving a new file. Task-number: QTBUG-40573 Change-Id: I285e898fafc54ae39f09d564ca431a279a8f8919 Reviewed-by: J-P Nurmi --- src/plugins/platformthemes/gtk2/qgtk2dialoghelpers.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/plugins/platformthemes/gtk2/qgtk2dialoghelpers.cpp b/src/plugins/platformthemes/gtk2/qgtk2dialoghelpers.cpp index f85fe0839f..506c29c9cf 100644 --- a/src/plugins/platformthemes/gtk2/qgtk2dialoghelpers.cpp +++ b/src/plugins/platformthemes/gtk2/qgtk2dialoghelpers.cpp @@ -308,7 +308,13 @@ QUrl QGtk2FileDialogHelper::directory() const void QGtk2FileDialogHelper::selectFile(const QUrl &filename) { GtkDialog *gtkDialog = d->gtkDialog(); - gtk_file_chooser_select_filename(GTK_FILE_CHOOSER(gtkDialog), filename.toLocalFile().toUtf8()); + if (options()->acceptMode() == QFileDialogOptions::AcceptSave) { + QFileInfo fi(filename.toLocalFile()); + gtk_file_chooser_set_current_folder(GTK_FILE_CHOOSER(gtkDialog), fi.path().toUtf8()); + gtk_file_chooser_set_current_name(GTK_FILE_CHOOSER(gtkDialog), fi.fileName().toUtf8()); + } else { + gtk_file_chooser_select_filename(GTK_FILE_CHOOSER(gtkDialog), filename.toLocalFile().toUtf8()); + } } QList QGtk2FileDialogHelper::selectedFiles() const -- cgit v1.2.3 From 682976def705a094c30a181e129b11c613c8a451 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christian=20Str=C3=B8mme?= Date: Tue, 5 Aug 2014 19:28:21 +0200 Subject: Android: Fix recursion bug in callStaticMethod() calling callStaticMethod() with template type jlong, jdouble or jboolean would cause the call to loop indefinitely. Change-Id: I99caa576e761fdef623ece04e0779e4cf2535592 Reviewed-by: Eskil Abrahamsen Blomfeldt --- src/corelib/kernel/qjni.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/corelib/kernel/qjni.cpp b/src/corelib/kernel/qjni.cpp index aa9b196e62..4581b70ca7 100644 --- a/src/corelib/kernel/qjni.cpp +++ b/src/corelib/kernel/qjni.cpp @@ -721,7 +721,7 @@ jboolean QJNIObjectPrivate::callStaticMethod(jclass clazz, { va_list args; va_start(args, sig); - jboolean res = callStaticMethod(clazz, methodName, sig); + jboolean res = callStaticMethod(clazz, methodName, sig, args); va_end(args); return res; } @@ -1026,7 +1026,7 @@ jlong QJNIObjectPrivate::callStaticMethod(jclass clazz, { va_list args; va_start(args, sig); - jlong res = callStaticMethod(clazz, methodName, sig); + jlong res = callStaticMethod(clazz, methodName, sig, args); va_end(args); return res; } @@ -1119,7 +1119,7 @@ jdouble QJNIObjectPrivate::callStaticMethod(const char *className, { va_list args; va_start(args, sig); - jdouble res = callStaticMethod(className, methodName, sig); + jdouble res = callStaticMethod(className, methodName, sig, args); va_end(args); return res; } -- cgit v1.2.3 From 4946ed049608251cf750a6250b4c94cda1c2e707 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christian=20Str=C3=B8mme?= Date: Tue, 5 Aug 2014 19:37:47 +0200 Subject: Android: Fix QAndroidPlatformServices::openUrl(). Return true only if an activity was found for the intent. Task-number: QTBUG-34716 Change-Id: I764caf1e8afa3b17b2d71f52873c17e5d834a956 Reviewed-by: Eskil Abrahamsen Blomfeldt --- src/android/jar/src/org/qtproject/qt5/android/QtNative.java | 7 ++++++- src/plugins/platforms/android/qandroidplatformservices.cpp | 9 ++++----- 2 files changed, 10 insertions(+), 6 deletions(-) (limited to 'src') diff --git a/src/android/jar/src/org/qtproject/qt5/android/QtNative.java b/src/android/jar/src/org/qtproject/qt5/android/QtNative.java index 02bb1ae485..0107cff23a 100644 --- a/src/android/jar/src/org/qtproject/qt5/android/QtNative.java +++ b/src/android/jar/src/org/qtproject/qt5/android/QtNative.java @@ -108,15 +108,20 @@ public class QtNative } } - public static void openURL(String url) + public static boolean openURL(String url) { + boolean ok = true; + try { Uri uri = Uri.parse(url); Intent intent = new Intent(Intent.ACTION_VIEW, uri); activity().startActivity(intent); } catch (Exception e) { e.printStackTrace(); + ok = false; } + + return ok; } // this method loads full path libs diff --git a/src/plugins/platforms/android/qandroidplatformservices.cpp b/src/plugins/platforms/android/qandroidplatformservices.cpp index 9c21abe39b..1f2f58f838 100644 --- a/src/plugins/platforms/android/qandroidplatformservices.cpp +++ b/src/plugins/platforms/android/qandroidplatformservices.cpp @@ -54,11 +54,10 @@ QAndroidPlatformServices::QAndroidPlatformServices() bool QAndroidPlatformServices::openUrl(const QUrl &url) { QJNIObjectPrivate urlString = QJNIObjectPrivate::fromString(url.toString()); - QJNIObjectPrivate::callStaticMethod(QtAndroid::applicationClass(), - "openURL", - "(Ljava/lang/String;)V", - urlString.object()); - return true; + return QJNIObjectPrivate::callStaticMethod(QtAndroid::applicationClass(), + "openURL", + "(Ljava/lang/String;)Z", + urlString.object()); } bool QAndroidPlatformServices::openDocument(const QUrl &url) -- cgit v1.2.3 From 1671dacb521e92986ff2d274d009e3e60a026045 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christian=20Str=C3=B8mme?= Date: Tue, 5 Aug 2014 19:43:23 +0200 Subject: Android: Remove native views when their window is destroyd. destroySurface() was not removing the native view as they are not in the m_surfaces map. Task-number: QTBUG-40159 Change-Id: Ib5457e0bd34141654fa47883f5e125d894b0bd05 Reviewed-by: Eskil Abrahamsen Blomfeldt --- src/plugins/platforms/android/androidjnimain.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/plugins/platforms/android/androidjnimain.cpp b/src/plugins/platforms/android/androidjnimain.cpp index 3e3e169df9..e7e0375adf 100644 --- a/src/plugins/platforms/android/androidjnimain.cpp +++ b/src/plugins/platforms/android/androidjnimain.cpp @@ -413,10 +413,9 @@ namespace QtAndroid { QMutexLocker lock(&m_surfacesMutex); const auto &it = m_surfaces.find(surfaceId); - if (it == m_surfaces.end()) - return; + if (it != m_surfaces.end()) + m_surfaces.remove(surfaceId); - m_surfaces.remove(surfaceId); QJNIEnvironmentPrivate env; if (!env) return; -- cgit v1.2.3 From 8306dee38f4e315399a465b028819b0777746c55 Mon Sep 17 00:00:00 2001 From: Eskil Abrahamsen Blomfeldt Date: Wed, 6 Aug 2014 13:40:46 +0200 Subject: Windows: Fix stored family name of fallback fonts When we create fallback fonts, we copy the fontdef of the main font, but we need to update the family name to match reality, otherwise a QRawFont created with the font engine will have the wrong family name. This is already done in the default implementation of loadEngine(), but was missing from the Windows implementation. One large consequence of this was that when the distance field renderer cloned the font engine (to change its size), it would clone it with the wrong family name. When it later painted its glyph indexes, they would of course refer to the wrong font (the fallback) so random characters would appear. [ChangeLog][Windows] Fixed using QRawFont with fallback fonts, e.g. in the case of text rendering in Qt Quick. Task-number: QTBUG-39172 Change-Id: Ic8fcd9dfc20ec7aadf0b47d4a80417f401f355fd Reviewed-by: Konstantin Ritt --- src/plugins/platforms/windows/qwindowsfontengine.cpp | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src') diff --git a/src/plugins/platforms/windows/qwindowsfontengine.cpp b/src/plugins/platforms/windows/qwindowsfontengine.cpp index 6f97c8584b..4efedb7bc7 100644 --- a/src/plugins/platforms/windows/qwindowsfontengine.cpp +++ b/src/plugins/platforms/windows/qwindowsfontengine.cpp @@ -1350,6 +1350,7 @@ void QWindowsMultiFontEngine::loadEngine(int at) fontEngine->fontDef.pixelSize, data); fedw->fontDef = fontDef; + fedw->fontDef.family = fam; fedw->ref.ref(); engines[at] = fedw; @@ -1375,6 +1376,7 @@ void QWindowsMultiFontEngine::loadEngine(int at) engines[at] = new QWindowsFontEngine(fam, hfont, stockFont, lf, data); engines[at]->ref.ref(); engines[at]->fontDef = fontDef; + engines[at]->fontDef.family = fam; qCDebug(lcQpaFonts) << __FUNCTION__ << at << fam; // TODO: increase cost in QFontCache for the font engine loaded here -- cgit v1.2.3 From 51ff0449344cfb110f316288f44d6300340787dd Mon Sep 17 00:00:00 2001 From: Andy Shaw Date: Tue, 22 Jul 2014 15:59:45 +0200 Subject: Check if Start/EndPage returns non-positive value when error checking StartPage and EndPage are documented to return a non-positive value (0 or less) when they fail, therefore it is not enough to check if !StartPage. Checking if is 0 or less is more accurate. Change-Id: Ia0ff43da4e4309ba0a5983e91a0ad583aad0a955 Reviewed-by: Friedemann Kleint --- src/printsupport/kernel/qprintengine_win.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/printsupport/kernel/qprintengine_win.cpp b/src/printsupport/kernel/qprintengine_win.cpp index b97dc6d2c2..98a0844baa 100644 --- a/src/printsupport/kernel/qprintengine_win.cpp +++ b/src/printsupport/kernel/qprintengine_win.cpp @@ -203,7 +203,7 @@ bool QWin32PrintEngine::newPage() bool transparent = GetBkMode(d->hdc) == TRANSPARENT; - if (!EndPage(d->hdc)) { + if (EndPage(d->hdc) <= 0) { qErrnoWarning("QWin32PrintEngine::newPage: EndPage failed"); return false; } @@ -216,7 +216,7 @@ bool QWin32PrintEngine::newPage() d->reinit = false; } - if (!StartPage(d->hdc)) { + if (StartPage(d->hdc) <= 0) { qErrnoWarning("Win32PrintEngine::newPage: StartPage failed"); return false; } @@ -235,7 +235,7 @@ bool QWin32PrintEngine::newPage() bool success = false; if (d->hdc && d->state == QPrinter::Active) { - if (EndPage(d->hdc) != SP_ERROR) { + if (EndPage(d->hdc) > 0) { // reinitialize the DC before StartPage if needed, // because resetdc is disabled between calls to the StartPage and EndPage functions // (see StartPage documentation in the Platform SDK:Windows GDI) @@ -248,7 +248,7 @@ bool QWin32PrintEngine::newPage() qErrnoWarning("QWin32PrintEngine::newPage(), ResetDC failed (2)"); d->reinit = false; } - success = (StartPage(d->hdc) != SP_ERROR); + success = (StartPage(d->hdc) > 0); } if (!success) { d->state = QPrinter::Aborted; -- cgit v1.2.3 From 50c418b61d5cf79226db7ea7a5e27efa8973a112 Mon Sep 17 00:00:00 2001 From: Gunnar Sletta Date: Thu, 7 Aug 2014 07:41:37 +0200 Subject: Both HiQualAA and normal AA should mean antialiasing in rasterengine. Change-Id: I1970c96e7681e4059984d837e12f044f138e6d7e Reviewed-by: Laszlo Agocs --- src/gui/painting/qpaintengine_raster.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/gui/painting/qpaintengine_raster.cpp b/src/gui/painting/qpaintengine_raster.cpp index a004428fab..6f669bd333 100644 --- a/src/gui/painting/qpaintengine_raster.cpp +++ b/src/gui/painting/qpaintengine_raster.cpp @@ -917,7 +917,7 @@ void QRasterPaintEngine::renderHintsChanged() bool was_aa = s->flags.antialiased; bool was_bilinear = s->flags.bilinear; - s->flags.antialiased = bool(s->renderHints & QPainter::Antialiasing); + s->flags.antialiased = bool(s->renderHints & (QPainter::Antialiasing | QPainter::HighQualityAntialiasing)); s->flags.bilinear = bool(s->renderHints & QPainter::SmoothPixmapTransform); s->flags.legacy_rounding = !bool(s->renderHints & QPainter::Antialiasing) && bool(s->renderHints & QPainter::Qt4CompatiblePainting); -- cgit v1.2.3 From e8150576cdae1f4e83aa66053dc80f44a0ccaee7 Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Tue, 5 Aug 2014 19:48:20 -0300 Subject: Document missing QLatin1String methods Most of them were added before 5.0, but it's ok to just list as 5.0. Change-Id: I6e83a210a0165659f710d47ed595e9e89d5dbac9 Reviewed-by: Martin Smith --- src/corelib/tools/qstring.cpp | 88 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 88 insertions(+) (limited to 'src') diff --git a/src/corelib/tools/qstring.cpp b/src/corelib/tools/qstring.cpp index 83f1bac2ef..6c8db11212 100644 --- a/src/corelib/tools/qstring.cpp +++ b/src/corelib/tools/qstring.cpp @@ -7888,6 +7888,11 @@ QString &QString::setRawData(const QChar *unicode, int size) Returns the Latin-1 string stored in this object. */ +/*! \fn const char *QLatin1String::data() const + + Returns the Latin-1 string stored in this object. +*/ + /*! \fn int QLatin1String::size() const Returns the size of the Latin-1 string stored in this object. @@ -7918,6 +7923,20 @@ QString &QString::setRawData(const QChar *unicode, int size) go through QObject::tr(), for example. */ +/*! + \fn bool QLatin1String::operator==(const QByteArray &other) const + \since 5.0 + \overload + + The \a other byte array is converted to a QString using + the QString::fromUtf8() function. + + You can disable this operator by defining \c + QT_NO_CAST_FROM_ASCII when you compile your applications. This + can be useful if you want to ensure that all user-visible strings + go through QObject::tr(), for example. +*/ + /*! \fn bool QLatin1String::operator!=(const QString &other) const Returns \c true if this string is not equal to string \a other; @@ -7943,6 +7962,20 @@ QString &QString::setRawData(const QChar *unicode, int size) go through QObject::tr(), for example. */ +/*! + \fn bool QLatin1String::operator!=(const QByteArray &other) const + \since 5.0 + \overload operator!=() + + The \a other byte array is converted to a QString using + the QString::fromUtf8() function. + + You can disable this operator by defining \c + QT_NO_CAST_FROM_ASCII when you compile your applications. This + can be useful if you want to ensure that all user-visible strings + go through QObject::tr(), for example. +*/ + /*! \fn bool QLatin1String::operator>(const QString &other) const @@ -7969,6 +8002,20 @@ QString &QString::setRawData(const QChar *unicode, int size) for example. */ +/*! + \fn bool QLatin1String::operator>(const QByteArray &other) const + \since 5.0 + \overload + + The \a other const char pointer is converted to a QString using + the QString::fromUtf8() function. + + You can disable this operator by defining \c QT_NO_CAST_FROM_ASCII + when you compile your applications. This can be useful if you want + to ensure that all user-visible strings go through QObject::tr(), + for example. +*/ + /*! \fn bool QLatin1String::operator<(const QString &other) const @@ -7995,6 +8042,20 @@ QString &QString::setRawData(const QChar *unicode, int size) go through QObject::tr(), for example. */ +/*! + \fn bool QLatin1String::operator<(const QByteArray &other) const + \since 5.0 + \overload + + The \a other const char pointer is converted to a QString using + the QString::fromUtf8() function. + + You can disable this operator by defining \c + QT_NO_CAST_FROM_ASCII when you compile your applications. This + can be useful if you want to ensure that all user-visible strings + go through QObject::tr(), for example. +*/ + /*! \fn bool QLatin1String::operator>=(const QString &other) const @@ -8021,6 +8082,20 @@ QString &QString::setRawData(const QChar *unicode, int size) go through QObject::tr(), for example. */ +/*! + \fn bool QLatin1String::operator>=(const QByteArray &other) const + \since 5.0 + \overload + + The \a other array is converted to a QString using + the QString::fromUtf8() function. + + You can disable this operator by defining \c + QT_NO_CAST_FROM_ASCII when you compile your applications. This + can be useful if you want to ensure that all user-visible strings + go through QObject::tr(), for example. +*/ + /*! \fn bool QLatin1String::operator<=(const QString &other) const Returns \c true if this string is lexically less than or equal @@ -8046,6 +8121,19 @@ QString &QString::setRawData(const QChar *unicode, int size) go through QObject::tr(), for example. */ +/*! + \fn bool QLatin1String::operator<=(const QByteArray &other) const + \since 5.0 + \overload + + The \a other array is converted to a QString using + the QString::fromUtf8() function. + + You can disable this operator by defining \c + QT_NO_CAST_FROM_ASCII when you compile your applications. This + can be useful if you want to ensure that all user-visible strings + go through QObject::tr(), for example. +*/ /*! \fn bool operator==(QLatin1String s1, QLatin1String s2) -- cgit v1.2.3 From 88bd28f91ebc16093d886b5992eebe11c97cab2c Mon Sep 17 00:00:00 2001 From: Gunnar Sletta Date: Fri, 8 Aug 2014 08:33:37 +0200 Subject: Initialize member. Change-Id: I9ed8d5a7aeb40886bafbd9eb2003e88e5d796cc9 Reviewed-by: Laszlo Agocs --- src/gui/kernel/qopenglcontext_p.h | 1 + 1 file changed, 1 insertion(+) (limited to 'src') diff --git a/src/gui/kernel/qopenglcontext_p.h b/src/gui/kernel/qopenglcontext_p.h index 711a3b1b2f..e9907480f2 100644 --- a/src/gui/kernel/qopenglcontext_p.h +++ b/src/gui/kernel/qopenglcontext_p.h @@ -198,6 +198,7 @@ class Q_GUI_EXPORT QOpenGLContextPrivate : public QObjectPrivate public: QOpenGLContextPrivate() : qGLContextHandle(0) + , qGLContextDeleteFunction(0) , platformGLContext(0) , shareContext(0) , shareGroup(0) -- cgit v1.2.3 From 00ca4997873354d6792eb9e5eee3d9a0e3c00c68 Mon Sep 17 00:00:00 2001 From: Giuseppe D'Angelo Date: Fri, 8 Aug 2014 23:36:45 +0200 Subject: Apply upstream patch r1495 to our PCRE copy It's actually a subset of the patch (tests, docs, other whitespace fixes were dropped). Fixes a stack overflow issue on pathological regexps reported upstream: http://bugs.exim.org/show_bug.cgi?id=1503 Change-Id: If080e4c1e7a86c86459bbbc631c8d8bb3cd7b99f Reviewed-by: Richard J. Moore --- src/3rdparty/pcre/patches/pcre-r1495.patch | 23 +++++++++++++++++++++++ src/3rdparty/pcre/pcre_compile.c | 6 +++++- 2 files changed, 28 insertions(+), 1 deletion(-) create mode 100644 src/3rdparty/pcre/patches/pcre-r1495.patch (limited to 'src') diff --git a/src/3rdparty/pcre/patches/pcre-r1495.patch b/src/3rdparty/pcre/patches/pcre-r1495.patch new file mode 100644 index 0000000000..d8b4ce097a --- /dev/null +++ b/src/3rdparty/pcre/patches/pcre-r1495.patch @@ -0,0 +1,23 @@ +Index: pcre_compile.c +=================================================================== +--- pcre_compile.c (revision 1494) ++++ pcre_compile.c (revision 1495) +@@ -8267,12 +8267,16 @@ + + /* If it was a capturing subpattern, check to see if it contained any + recursive back references. If so, we must wrap it in atomic brackets. +- In any event, remove the block from the chain. */ ++ Because we are moving code along, we must ensure that any pending recursive ++ references are updated. In any event, remove the block from the chain. */ + + if (capnumber > 0) + { + if (cd->open_caps->flag) + { ++ *code = OP_END; ++ adjust_recurse(start_bracket, 1 + LINK_SIZE, ++ (options & PCRE_UTF8) != 0, cd, cd->hwm); + memmove(start_bracket + 1 + LINK_SIZE, start_bracket, + IN_UCHARS(code - start_bracket)); + *start_bracket = OP_ONCE; + diff --git a/src/3rdparty/pcre/pcre_compile.c b/src/3rdparty/pcre/pcre_compile.c index 9708b93923..e3dd83b4cb 100644 --- a/src/3rdparty/pcre/pcre_compile.c +++ b/src/3rdparty/pcre/pcre_compile.c @@ -8193,12 +8193,16 @@ for (;;) /* If it was a capturing subpattern, check to see if it contained any recursive back references. If so, we must wrap it in atomic brackets. - In any event, remove the block from the chain. */ + Because we are moving code along, we must ensure that any pending recursive + references are updated. In any event, remove the block from the chain. */ if (capnumber > 0) { if (cd->open_caps->flag) { + *code = OP_END; + adjust_recurse(start_bracket, 1 + LINK_SIZE, + (options & PCRE_UTF8) != 0, cd, cd->hwm); memmove(start_bracket + 1 + LINK_SIZE, start_bracket, IN_UCHARS(code - start_bracket)); *start_bracket = OP_ONCE; -- cgit v1.2.3 From 3924805d595f18820f127ab33486d076102afec6 Mon Sep 17 00:00:00 2001 From: Giuseppe D'Angelo Date: Fri, 8 Aug 2014 23:36:45 +0200 Subject: Apply upstream patch r1498 to our PCRE copy It's actually a subset of the patch (tests, docs, other whitespace fixes were dropped). Fixes a stack overflow issue on pathological regexps reported upstream: http://bugs.exim.org/show_bug.cgi?id=1515 Change-Id: Ie36536e820d79ff842d90efa6bec22b701423793 Reviewed-by: Richard J. Moore --- src/3rdparty/pcre/patches/pcre-r1498.patch | 45 ++++++++++++++++++++++++++++++ src/3rdparty/pcre/pcre_compile.c | 21 ++++++-------- 2 files changed, 54 insertions(+), 12 deletions(-) create mode 100644 src/3rdparty/pcre/patches/pcre-r1498.patch (limited to 'src') diff --git a/src/3rdparty/pcre/patches/pcre-r1498.patch b/src/3rdparty/pcre/patches/pcre-r1498.patch new file mode 100644 index 0000000000..8ae48a4336 --- /dev/null +++ b/src/3rdparty/pcre/patches/pcre-r1498.patch @@ -0,0 +1,45 @@ +Index: pcre_compile.c +=================================================================== +--- pcre_compile.c (revision 1497) ++++ pcre_compile.c (revision 1498) +@@ -2374,6 +2374,7 @@ + if (c == OP_RECURSE) + { + const pcre_uchar *scode = cd->start_code + GET(code, 1); ++ const pcre_uchar *endgroup = scode; + BOOL empty_branch; + + /* Test for forward reference or uncompleted reference. This is disabled +@@ -2388,24 +2389,20 @@ + if (GET(scode, 1) == 0) return TRUE; /* Unclosed */ + } + +- /* If we are scanning a completed pattern, there are no forward references +- and all groups are complete. We need to detect whether this is a recursive +- call, as otherwise there will be an infinite loop. If it is a recursion, +- just skip over it. Simple recursions are easily detected. For mutual +- recursions we keep a chain on the stack. */ ++ /* If the reference is to a completed group, we need to detect whether this ++ is a recursive call, as otherwise there will be an infinite loop. If it is ++ a recursion, just skip over it. Simple recursions are easily detected. For ++ mutual recursions we keep a chain on the stack. */ + ++ do endgroup += GET(endgroup, 1); while (*endgroup == OP_ALT); ++ if (code >= scode && code <= endgroup) continue; /* Simple recursion */ + else +- { ++ { + recurse_check *r = recurses; +- const pcre_uchar *endgroup = scode; +- +- do endgroup += GET(endgroup, 1); while (*endgroup == OP_ALT); +- if (code >= scode && code <= endgroup) continue; /* Simple recursion */ +- + for (r = recurses; r != NULL; r = r->prev) + if (r->group == scode) break; + if (r != NULL) continue; /* Mutual recursion */ +- } ++ } + + /* Completed reference; scan the referenced group, remembering it on the + stack chain to detect mutual recursions. */ diff --git a/src/3rdparty/pcre/pcre_compile.c b/src/3rdparty/pcre/pcre_compile.c index e3dd83b4cb..ed1681e5dd 100644 --- a/src/3rdparty/pcre/pcre_compile.c +++ b/src/3rdparty/pcre/pcre_compile.c @@ -2368,6 +2368,7 @@ for (code = first_significant_code(code + PRIV(OP_lengths)[*code], TRUE); if (c == OP_RECURSE) { const pcre_uchar *scode = cd->start_code + GET(code, 1); + const pcre_uchar *endgroup = scode; BOOL empty_branch; /* Test for forward reference or uncompleted reference. This is disabled @@ -2382,24 +2383,20 @@ for (code = first_significant_code(code + PRIV(OP_lengths)[*code], TRUE); if (GET(scode, 1) == 0) return TRUE; /* Unclosed */ } - /* If we are scanning a completed pattern, there are no forward references - and all groups are complete. We need to detect whether this is a recursive - call, as otherwise there will be an infinite loop. If it is a recursion, - just skip over it. Simple recursions are easily detected. For mutual - recursions we keep a chain on the stack. */ + /* If the reference is to a completed group, we need to detect whether this + is a recursive call, as otherwise there will be an infinite loop. If it is + a recursion, just skip over it. Simple recursions are easily detected. For + mutual recursions we keep a chain on the stack. */ + do endgroup += GET(endgroup, 1); while (*endgroup == OP_ALT); + if (code >= scode && code <= endgroup) continue; /* Simple recursion */ else - { + { recurse_check *r = recurses; - const pcre_uchar *endgroup = scode; - - do endgroup += GET(endgroup, 1); while (*endgroup == OP_ALT); - if (code >= scode && code <= endgroup) continue; /* Simple recursion */ - for (r = recurses; r != NULL; r = r->prev) if (r->group == scode) break; if (r != NULL) continue; /* Mutual recursion */ - } + } /* Completed reference; scan the referenced group, remembering it on the stack chain to detect mutual recursions. */ -- cgit v1.2.3 From 909d3f5c733dde02074a737a5f1dbe3e51dbef32 Mon Sep 17 00:00:00 2001 From: Gabriel de Dietrich Date: Wed, 2 Jul 2014 13:18:50 +0200 Subject: Font Database: Add support for private, system UI font families MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit We introduce QPlatformFontDatabase::isPrivateFontFamily() to allow testing for private, system UI font families. Both QFontComboBox and QFontDialog need to filter out those private font families which, by definition, should be hidden from the end user. (The textedit example had to be updated to fix the issue where the default font would be private. In 5.4, we will be adding an equivalent, public API in QFontDatabase, and a better solution for the textedit example and QTexEdit in general). In particular, on OS X and iOS, private fonts are used for the system UI font. Those have their font family name prefixed by a dot. QCoreTextFontDatabase knows about this, and makes sure those are tested positive as private font families. In order to have a cleaner layer separation, we moved the QPA theme font resolution from the platform theme classes into QCoreTextFontDatabase for both Cocoa and iOS QPA plugins. In both cases, we use CoreText's CTFontCreateUIFontForLanguage(), that nicely maps to the HITheme API we were using so far on Mac. That means one HITheme dependency less. We also cache the font descriptors we get for these font for each time QCTFD::populateFamilies() gets called. (While not common, this currently happens in auto-tests, like tst_QFontDatabase, and could happen in actual applications -- specially when adding and removing application fonts.) Change-Id: Ic6f0b60f9f597afee1a43596a669742dc546b97f Reviewed-by: Morten Johan Sørvig --- src/gui/text/qplatformfontdatabase.cpp | 10 ++ src/gui/text/qplatformfontdatabase.h | 1 + .../fontdatabases/mac/qcoretextfontdatabase.mm | 183 ++++++++++++++++++--- .../fontdatabases/mac/qcoretextfontdatabase_p.h | 11 ++ src/plugins/platforms/cocoa/qcocoasystemsettings.h | 1 - .../platforms/cocoa/qcocoasystemsettings.mm | 44 ----- src/plugins/platforms/cocoa/qcocoatheme.mm | 7 + src/plugins/platforms/ios/qiostheme.mm | 19 +-- src/widgets/dialogs/qfontdialog.cpp | 9 + src/widgets/widgets/qfontcombobox.cpp | 9 + 10 files changed, 212 insertions(+), 82 deletions(-) (limited to 'src') diff --git a/src/gui/text/qplatformfontdatabase.cpp b/src/gui/text/qplatformfontdatabase.cpp index 33301005c6..2c3a1d7f70 100644 --- a/src/gui/text/qplatformfontdatabase.cpp +++ b/src/gui/text/qplatformfontdatabase.cpp @@ -401,6 +401,16 @@ QString QPlatformFontDatabase::fontDir() const return fontpath; } +/*! + Returns true if the font family is private. For any given family name, + the result is platform dependent. +*/ +bool QPlatformFontDatabase::isPrivateFontFamily(const QString &family) const +{ + Q_UNUSED(family); + return false; +} + /*! Returns the default system font. diff --git a/src/gui/text/qplatformfontdatabase.h b/src/gui/text/qplatformfontdatabase.h index b200cf0e58..46ef5c0f46 100644 --- a/src/gui/text/qplatformfontdatabase.h +++ b/src/gui/text/qplatformfontdatabase.h @@ -110,6 +110,7 @@ public: virtual QString fontDir() const; virtual QFont defaultFont() const; + virtual bool isPrivateFontFamily(const QString &family) const; virtual QString resolveFontFamilyAlias(const QString &family) const; virtual bool fontsAlwaysScalable() const; diff --git a/src/platformsupport/fontdatabases/mac/qcoretextfontdatabase.mm b/src/platformsupport/fontdatabases/mac/qcoretextfontdatabase.mm index 4aa4253773..cff90f420b 100644 --- a/src/platformsupport/fontdatabases/mac/qcoretextfontdatabase.mm +++ b/src/platformsupport/fontdatabases/mac/qcoretextfontdatabase.mm @@ -211,6 +211,13 @@ void QCoreTextFontDatabase::populateFontDatabase() QPlatformFontDatabase::registerAliasToFontFamily(familyName, localizedFamilyName); #endif } + + // Force creating the theme fonts to get the descriptors in m_systemFontDescriptors + if (m_themeFonts.isEmpty()) + (void)themeFonts(); + + Q_FOREACH (CTFontDescriptorRef fontDesc, m_systemFontDescriptors) + populateFromDescriptor(fontDesc); } void QCoreTextFontDatabase::populateFamily(const QString &familyName) @@ -231,16 +238,29 @@ void QCoreTextFontDatabase::populateFamily(const QString &familyName) populateFromDescriptor(CTFontDescriptorRef(CFArrayGetValueAtIndex(matchingFonts, i))); } -void QCoreTextFontDatabase::populateFromDescriptor(CTFontDescriptorRef font) +struct FontDescription { + QCFString familyName; + QCFString styleName; + QString foundryName; + QFont::Weight weight; + QFont::Style style; + QFont::Stretch stretch; + int pixelSize; + bool fixedPitch; + QSupportedWritingSystems writingSystems; +}; + +static void getFontDescription(CTFontDescriptorRef font, FontDescription *fd) { - QString foundryName = QStringLiteral("CoreText"); - QCFString familyName = (CFStringRef) CTFontDescriptorCopyAttribute(font, kCTFontFamilyNameAttribute); - QCFString styleName = (CFStringRef)CTFontDescriptorCopyAttribute(font, kCTFontStyleNameAttribute); QCFType styles = (CFDictionaryRef) CTFontDescriptorCopyAttribute(font, kCTFontTraitsAttribute); - QFont::Weight weight = QFont::Normal; - QFont::Style style = QFont::StyleNormal; - QFont::Stretch stretch = QFont::Unstretched; - bool fixedPitch = false; + + fd->foundryName = QStringLiteral("CoreText"); + fd->familyName = (CFStringRef) CTFontDescriptorCopyAttribute(font, kCTFontFamilyNameAttribute); + fd->styleName = (CFStringRef)CTFontDescriptorCopyAttribute(font, kCTFontStyleNameAttribute); + fd->weight = QFont::Normal; + fd->style = QFont::StyleNormal; + fd->stretch = QFont::Unstretched; + fd->fixedPitch = false; if (styles) { if (CFNumberRef weightValue = (CFNumberRef) CFDictionaryGetValue(styles, kCTFontWeightTrait)) { @@ -248,15 +268,15 @@ void QCoreTextFontDatabase::populateFromDescriptor(CTFontDescriptorRef font) double normalizedWeight; if (CFNumberGetValue(weightValue, kCFNumberDoubleType, &normalizedWeight)) { if (normalizedWeight >= 0.62) - weight = QFont::Black; + fd->weight = QFont::Black; else if (normalizedWeight >= 0.4) - weight = QFont::Bold; + fd->weight = QFont::Bold; else if (normalizedWeight >= 0.3) - weight = QFont::DemiBold; + fd->weight = QFont::DemiBold; else if (normalizedWeight == 0.0) - weight = QFont::Normal; + fd->weight = QFont::Normal; else if (normalizedWeight <= -0.4) - weight = QFont::Light; + fd->weight = QFont::Light; } } if (CFNumberRef italic = (CFNumberRef) CFDictionaryGetValue(styles, kCTFontSlantTrait)) { @@ -264,34 +284,32 @@ void QCoreTextFontDatabase::populateFromDescriptor(CTFontDescriptorRef font) double d; if (CFNumberGetValue(italic, kCFNumberDoubleType, &d)) { if (d > 0.0) - style = QFont::StyleItalic; + fd->style = QFont::StyleItalic; } } if (CFNumberRef symbolic = (CFNumberRef) CFDictionaryGetValue(styles, kCTFontSymbolicTrait)) { int d; if (CFNumberGetValue(symbolic, kCFNumberSInt32Type, &d)) { if (d & kCTFontMonoSpaceTrait) - fixedPitch = true; + fd->fixedPitch = true; if (d & kCTFontExpandedTrait) - stretch = QFont::Expanded; + fd->stretch = QFont::Expanded; else if (d & kCTFontCondensedTrait) - stretch = QFont::Condensed; + fd->stretch = QFont::Condensed; } } } - int pixelSize = 0; if (QCFType size = (CFNumberRef) CTFontDescriptorCopyAttribute(font, kCTFontSizeAttribute)) { if (CFNumberIsFloatType(size)) { double d; CFNumberGetValue(size, kCFNumberDoubleType, &d); - pixelSize = d; + fd->pixelSize = d; } else { - CFNumberGetValue(size, kCFNumberIntType, &pixelSize); + CFNumberGetValue(size, kCFNumberIntType, &fd->pixelSize); } } - QSupportedWritingSystems writingSystems; if (QCFType languages = (CFArrayRef) CTFontDescriptorCopyAttribute(font, kCTFontLanguagesAttribute)) { CFIndex length = CFArrayGetCount(languages); for (int i = 1; i < LanguageCount; ++i) { @@ -299,14 +317,24 @@ void QCoreTextFontDatabase::populateFromDescriptor(CTFontDescriptorRef font) continue; QCFString lang = CFStringCreateWithCString(NULL, languageForWritingSystem[i], kCFStringEncodingASCII); if (CFArrayContainsValue(languages, CFRangeMake(0, length), lang)) - writingSystems.setSupported(QFontDatabase::WritingSystem(i)); + fd->writingSystems.setSupported(QFontDatabase::WritingSystem(i)); } } +} +void QCoreTextFontDatabase::populateFromDescriptor(CTFontDescriptorRef font) +{ + FontDescription fd; + getFontDescription(font, &fd); + populateFromFontDescription(font, fd); +} + +void QCoreTextFontDatabase::populateFromFontDescription(CTFontDescriptorRef font, const FontDescription &fd) +{ CFRetain(font); - QPlatformFontDatabase::registerFont(familyName, styleName, foundryName, weight, style, stretch, + QPlatformFontDatabase::registerFont(fd.familyName, fd.styleName, fd.foundryName, fd.weight, fd.style, fd.stretch, true /* antialiased */, true /* scalable */, - pixelSize, fixedPitch, writingSystems, (void *) font); + fd.pixelSize, fd.fixedPitch, fd.writingSystems, (void *) font); } void QCoreTextFontDatabase::releaseHandle(void *handle) @@ -612,6 +640,113 @@ QStringList QCoreTextFontDatabase::addApplicationFont(const QByteArray &fontData return families; } +bool QCoreTextFontDatabase::isPrivateFontFamily(const QString &family) const +{ + if (family.startsWith(QLatin1Char('.'))) + return true; + + return QPlatformFontDatabase::isPrivateFontFamily(family); +} + +static CTFontUIFontType fontTypeFromTheme(QPlatformTheme::Font f) +{ + switch (f) { + case QPlatformTheme::SystemFont: + return kCTFontSystemFontType; + + case QPlatformTheme::MenuFont: + case QPlatformTheme::MenuBarFont: + case QPlatformTheme::MenuItemFont: + return kCTFontMenuItemFontType; + + case QPlatformTheme::MessageBoxFont: + return kCTFontEmphasizedSystemFontType; + + case QPlatformTheme::LabelFont: + return kCTFontSystemFontType; + + case QPlatformTheme::TipLabelFont: + return kCTFontToolTipFontType; + + case QPlatformTheme::StatusBarFont: + return kCTFontSystemFontType; + + case QPlatformTheme::TitleBarFont: + return kCTFontWindowTitleFontType; + + case QPlatformTheme::MdiSubWindowTitleFont: + case QPlatformTheme::DockWidgetTitleFont: + return kCTFontSystemFontType; + + case QPlatformTheme::PushButtonFont: + return kCTFontPushButtonFontType; + + case QPlatformTheme::CheckBoxFont: + case QPlatformTheme::RadioButtonFont: + return kCTFontSystemFontType; + + case QPlatformTheme::ToolButtonFont: + return kCTFontSmallToolbarFontType; + + case QPlatformTheme::ItemViewFont: + return kCTFontSystemFontType; + + case QPlatformTheme::ListViewFont: + return kCTFontViewsFontType; + + case QPlatformTheme::HeaderViewFont: + return kCTFontSmallSystemFontType; + + case QPlatformTheme::ListBoxFont: + return kCTFontViewsFontType; + + case QPlatformTheme::ComboMenuItemFont: + return kCTFontSystemFontType; + + case QPlatformTheme::ComboLineEditFont: + return kCTFontViewsFontType; + + case QPlatformTheme::SmallFont: + return kCTFontSmallSystemFontType; + + case QPlatformTheme::MiniFont: + return kCTFontMiniSystemFontType; + + case QPlatformTheme::FixedFont: + return kCTFontUserFixedPitchFontType; + + default: + return kCTFontSystemFontType; + } +} + +const QHash &QCoreTextFontDatabase::themeFonts() const +{ + if (m_themeFonts.isEmpty()) { + for (long f = QPlatformTheme::SystemFont; f < QPlatformTheme::NFonts; f++) { + QPlatformTheme::Font ft = static_cast(f); + m_themeFonts.insert(ft, themeFont(ft)); + } + } + + return m_themeFonts; +} + +QFont *QCoreTextFontDatabase::themeFont(QPlatformTheme::Font f) const +{ + CTFontUIFontType fontType = fontTypeFromTheme(f); + + QCFType ctFont = CTFontCreateUIFontForLanguage(fontType, 0.0, NULL); + CTFontDescriptorRef fontDesc = CTFontCopyFontDescriptor(ctFont); + + FontDescription fd; + getFontDescription(fontDesc, &fd); + m_systemFontDescriptors.insert(fontDesc); + + QFont *font = new QFont(fd.familyName, fd.pixelSize, fd.weight, fd.style == QFont::StyleItalic); + return font; +} + QFont QCoreTextFontDatabase::defaultFont() const { if (defaultFontName.isEmpty()) { diff --git a/src/platformsupport/fontdatabases/mac/qcoretextfontdatabase_p.h b/src/platformsupport/fontdatabases/mac/qcoretextfontdatabase_p.h index c73f4a32ca..a3da27b28d 100644 --- a/src/platformsupport/fontdatabases/mac/qcoretextfontdatabase_p.h +++ b/src/platformsupport/fontdatabases/mac/qcoretextfontdatabase_p.h @@ -47,6 +47,7 @@ #define HAVE_ATS QT_MAC_PLATFORM_SDK_EQUAL_OR_ABOVE(__MAC_10_5, __IPHONE_NA) #include +#include #include #ifndef Q_OS_IOS @@ -66,6 +67,8 @@ Q_DECLARE_METATYPE(ATSFontContainerRef); QT_BEGIN_NAMESPACE +struct FontDescription; + class QCoreTextFontDatabase : public QPlatformFontDatabase { public: @@ -79,17 +82,25 @@ public: QStringList fallbacksForFamily(const QString &family, QFont::Style style, QFont::StyleHint styleHint, QChar::Script script) const; QStringList addApplicationFont(const QByteArray &fontData, const QString &fileName); void releaseHandle(void *handle); + bool isPrivateFontFamily(const QString &family) const; QFont defaultFont() const; QList standardSizes() const; + // For iOS and OS X platform themes + QFont *themeFont(QPlatformTheme::Font) const; + const QHash &themeFonts() const; + private: void populateFromDescriptor(CTFontDescriptorRef font); + void populateFromFontDescription(CTFontDescriptorRef font, const FontDescription &fd); mutable QString defaultFontName; void removeApplicationFonts(); QVector m_applicationFonts; + mutable QSet m_systemFontDescriptors; + mutable QHash m_themeFonts; }; QT_END_NAMESPACE diff --git a/src/plugins/platforms/cocoa/qcocoasystemsettings.h b/src/plugins/platforms/cocoa/qcocoasystemsettings.h index 9ce301f7e7..3861da6230 100644 --- a/src/plugins/platforms/cocoa/qcocoasystemsettings.h +++ b/src/plugins/platforms/cocoa/qcocoasystemsettings.h @@ -50,7 +50,6 @@ QT_BEGIN_NAMESPACE QPalette * qt_mac_createSystemPalette(); QHash qt_mac_createRolePalettes(); -QHash qt_mac_createRoleFonts(); QT_END_NAMESPACE diff --git a/src/plugins/platforms/cocoa/qcocoasystemsettings.mm b/src/plugins/platforms/cocoa/qcocoasystemsettings.mm index f18be8b69c..67fa66ad63 100644 --- a/src/plugins/platforms/cocoa/qcocoasystemsettings.mm +++ b/src/plugins/platforms/cocoa/qcocoasystemsettings.mm @@ -230,48 +230,4 @@ QHash qt_mac_createRolePalettes() return palettes; } -QFont *qt_mac_qfontForThemeFont(ThemeFontID themeID) -{ - CTFontUIFontType ctID = HIThemeGetUIFontType(themeID); - QCFType ctfont = CTFontCreateUIFontForLanguage(ctID, 0, 0); - QString familyName = QCFString(CTFontCopyFamilyName(ctfont)); - QCFType dict = CTFontCopyTraits(ctfont); - CFNumberRef num = static_cast(CFDictionaryGetValue(dict, kCTFontWeightTrait)); - float fW; - CFNumberGetValue(num, kCFNumberFloat32Type, &fW); - QFont::Weight wght = fW > 0. ? QFont::Bold : QFont::Normal; - num = static_cast(CFDictionaryGetValue(dict, kCTFontSlantTrait)); - CFNumberGetValue(num, kCFNumberFloatType, &fW); - bool italic = (fW != 0.0); - return new QFont(familyName, CTFontGetSize(ctfont), wght, italic); -} - -QHash qt_mac_createRoleFonts() -{ - QHash fonts; - - fonts.insert(QPlatformTheme::SystemFont, qt_mac_qfontForThemeFont(kThemeApplicationFont)); - fonts.insert(QPlatformTheme::PushButtonFont, qt_mac_qfontForThemeFont(kThemePushButtonFont)); - fonts.insert(QPlatformTheme::ListViewFont, qt_mac_qfontForThemeFont(kThemeViewsFont)); - fonts.insert(QPlatformTheme::ListBoxFont, qt_mac_qfontForThemeFont(kThemeViewsFont)); - fonts.insert(QPlatformTheme::TitleBarFont, qt_mac_qfontForThemeFont(kThemeWindowTitleFont)); - fonts.insert(QPlatformTheme::MenuFont, qt_mac_qfontForThemeFont(kThemeMenuItemFont)); - fonts.insert(QPlatformTheme::MenuBarFont, qt_mac_qfontForThemeFont(kThemeMenuItemFont)); - fonts.insert(QPlatformTheme::ComboMenuItemFont, qt_mac_qfontForThemeFont(kThemeSystemFont)); - fonts.insert(QPlatformTheme::HeaderViewFont, qt_mac_qfontForThemeFont(kThemeSmallSystemFont)); - fonts.insert(QPlatformTheme::TipLabelFont, qt_mac_qfontForThemeFont(kThemeSmallSystemFont)); - fonts.insert(QPlatformTheme::LabelFont, qt_mac_qfontForThemeFont(kThemeSystemFont)); - fonts.insert(QPlatformTheme::ToolButtonFont, qt_mac_qfontForThemeFont(kThemeSmallSystemFont)); - fonts.insert(QPlatformTheme::MenuItemFont, qt_mac_qfontForThemeFont(kThemeMenuItemFont)); - fonts.insert(QPlatformTheme::ComboLineEditFont, qt_mac_qfontForThemeFont(kThemeViewsFont)); - fonts.insert(QPlatformTheme::SmallFont, qt_mac_qfontForThemeFont(kThemeSmallSystemFont)); - fonts.insert(QPlatformTheme::MiniFont, qt_mac_qfontForThemeFont(kThemeMiniSystemFont)); - - QFont* fixedFont = new QFont(QStringLiteral("Monaco"), fonts[QPlatformTheme::SystemFont]->pointSize()); - fixedFont->setStyleHint(QFont::TypeWriter); - fonts.insert(QPlatformTheme::FixedFont, fixedFont); - - return fonts; -} - QT_END_NAMESPACE diff --git a/src/plugins/platforms/cocoa/qcocoatheme.mm b/src/plugins/platforms/cocoa/qcocoatheme.mm index dce1671800..ae42fee82c 100644 --- a/src/plugins/platforms/cocoa/qcocoatheme.mm +++ b/src/plugins/platforms/cocoa/qcocoatheme.mm @@ -60,6 +60,7 @@ #include #include #include +#include #include #include @@ -134,6 +135,12 @@ const QPalette *QCocoaTheme::palette(Palette type) const return 0; } +QHash qt_mac_createRoleFonts() +{ + QCoreTextFontDatabase *ctfd = static_cast(QGuiApplicationPrivate::platformIntegration()->fontDatabase()); + return ctfd->themeFonts(); +} + const QFont *QCocoaTheme::font(Font type) const { if (m_fonts.isEmpty()) { diff --git a/src/plugins/platforms/ios/qiostheme.mm b/src/plugins/platforms/ios/qiostheme.mm index e7093185aa..e51e97bd5a 100644 --- a/src/plugins/platforms/ios/qiostheme.mm +++ b/src/plugins/platforms/ios/qiostheme.mm @@ -46,6 +46,10 @@ #include +#include +#include +#include + #include #include @@ -75,19 +79,8 @@ QVariant QIOSTheme::themeHint(ThemeHint hint) const const QFont *QIOSTheme::font(Font type) const { if (m_fonts.isEmpty()) { - // The real system font on iOS is '.Helvetica Neue UI', as returned by both [UIFont systemFontOfSize] - // and CTFontCreateUIFontForLanguage(kCTFontSystemFontType, ...), but this font is not included when - // populating the available fonts in QCoreTextFontDatabase::populateFontDatabase(), since the font - // is internal to iOS and not supposed to be used by applications. We could potentially add this - // font to the font-database, but it would then show up when enumerating user fonts from Qt - // applications since we don't have a flag in Qt to mark a font as a private system font. - // For now we hard-code the font to Helvetica, which should be very close to the actual - // system font. - QLatin1String systemFontFamilyName("Helvetica"); - m_fonts.insert(QPlatformTheme::SystemFont, new QFont(systemFontFamilyName, [UIFont systemFontSize])); - m_fonts.insert(QPlatformTheme::SmallFont, new QFont(systemFontFamilyName, [UIFont smallSystemFontSize])); - m_fonts.insert(QPlatformTheme::LabelFont, new QFont(systemFontFamilyName, [UIFont labelFontSize])); - m_fonts.insert(QPlatformTheme::PushButtonFont, new QFont(systemFontFamilyName, [UIFont buttonFontSize])); + QCoreTextFontDatabase *ctfd = static_cast(QGuiApplicationPrivate::platformIntegration()->fontDatabase()); + m_fonts = ctfd->themeFonts(); } return m_fonts.value(type, 0); diff --git a/src/widgets/dialogs/qfontdialog.cpp b/src/widgets/dialogs/qfontdialog.cpp index 5a68bfbc66..fc9f36f0c2 100644 --- a/src/widgets/dialogs/qfontdialog.cpp +++ b/src/widgets/dialogs/qfontdialog.cpp @@ -65,6 +65,10 @@ #include #include +#include +#include +#include + QT_BEGIN_NAMESPACE class QFontListView : public QListView @@ -485,8 +489,13 @@ void QFontDialogPrivate::updateFamilies() const QFontDialog::FontDialogOptions spacingMask = (QFontDialog::ProportionalFonts | QFontDialog::MonospacedFonts); const QFontDialog::FontDialogOptions options = q->options(); + QPlatformFontDatabase *pfdb = QGuiApplicationPrivate::platformIntegration()->fontDatabase(); + QStringList familyNames; foreach (const QString &family, fdb.families(writingSystem)) { + if (pfdb->isPrivateFontFamily(family)) + continue; + if ((options & scalableMask) && (options & scalableMask) != scalableMask) { if (bool(options & QFontDialog::ScalableFonts) != fdb.isSmoothlyScalable(family)) continue; diff --git a/src/widgets/widgets/qfontcombobox.cpp b/src/widgets/widgets/qfontcombobox.cpp index db01543629..bdf5092d9e 100644 --- a/src/widgets/widgets/qfontcombobox.cpp +++ b/src/widgets/widgets/qfontcombobox.cpp @@ -53,6 +53,10 @@ #include #include +#include +#include +#include + QT_BEGIN_NAMESPACE static QFontDatabase::WritingSystem writingSystemFromScript(QLocale::Script script) @@ -328,7 +332,12 @@ void QFontComboBoxPrivate::_q_updateModel() int offset = 0; QFontInfo fi(currentFont); + QPlatformFontDatabase *pfdb = QGuiApplicationPrivate::platformIntegration()->fontDatabase(); + for (int i = 0; i < list.size(); ++i) { + if (pfdb->isPrivateFontFamily(list.at(i))) + continue; + if ((filters & scalableMask) && (filters & scalableMask) != scalableMask) { if (bool(filters & QFontComboBox::ScalableFonts) != fdb.isSmoothlyScalable(list.at(i))) continue; -- cgit v1.2.3 From 96d8c61f0dfb4169d4cd6c7f41612e20dec5278f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9rgio=20Martins?= Date: Mon, 11 Aug 2014 01:21:32 +0100 Subject: Fix build with QT_NO_DRAGANDDROP viewportSizeHint() should be defined outside the QT_NO_DRAGANDDROP ifndef Change-Id: I7c23c820ea58b3614eb030dc5b0f290ad891ccb1 Reviewed-by: Marc Mutz --- src/widgets/itemviews/qabstractitemview.cpp | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'src') diff --git a/src/widgets/itemviews/qabstractitemview.cpp b/src/widgets/itemviews/qabstractitemview.cpp index b2dc614b2b..a77448cbc4 100644 --- a/src/widgets/itemviews/qabstractitemview.cpp +++ b/src/widgets/itemviews/qabstractitemview.cpp @@ -1370,6 +1370,15 @@ bool QAbstractItemView::tabKeyNavigation() const return d->tabKeyNavigation; } +/*! + \since 5.2 + \reimp +*/ +QSize QAbstractItemView::viewportSizeHint() const +{ + return QAbstractScrollArea::viewportSizeHint(); +} + #ifndef QT_NO_DRAGANDDROP /*! \property QAbstractItemView::showDropIndicator @@ -1390,15 +1399,6 @@ bool QAbstractItemView::showDropIndicator() const return d->showDropIndicator; } -/*! - \since 5.2 - \reimp -*/ -QSize QAbstractItemView::viewportSizeHint() const -{ - return QAbstractScrollArea::viewportSizeHint(); -} - /*! \property QAbstractItemView::dragEnabled \brief whether the view supports dragging of its own items -- cgit v1.2.3 From 7fcb3aad40998188a3dd053c4dcd8b54c95fc974 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9rgio=20Martins?= Date: Mon, 11 Aug 2014 09:39:20 +0100 Subject: Fix build due to missing include when using a minimal config. QStyle is used, so include it explicitly instead of relying on indirect inclusions. Build was broken when using a bunch of QT_NO_ defines, not sure which one triggers the failure though. Change-Id: Ib07218521648448576f1b55d2d91d1711c048f09 Reviewed-by: Marc Mutz --- src/widgets/widgets/qwidgetanimator.cpp | 1 + 1 file changed, 1 insertion(+) (limited to 'src') diff --git a/src/widgets/widgets/qwidgetanimator.cpp b/src/widgets/widgets/qwidgetanimator.cpp index 1209ade536..a2d950c12b 100644 --- a/src/widgets/widgets/qwidgetanimator.cpp +++ b/src/widgets/widgets/qwidgetanimator.cpp @@ -41,6 +41,7 @@ #include #include +#include #include #include "qwidgetanimator_p.h" -- cgit v1.2.3 From f126f7cc2703f13e08a9c0a68c19068dde0b161d Mon Sep 17 00:00:00 2001 From: Simon Sasburg Date: Sun, 10 Aug 2014 13:56:34 +0100 Subject: Fix rendering alpha-blended text which needs to be clipped at the top. Task-number: QTBUG-34148 Change-Id: I9c0694e67cc9883db318c1a1558bdf6e08088db4 Reviewed-by: Gunnar Sletta --- src/gui/painting/qpaintengine_raster.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/gui/painting/qpaintengine_raster.cpp b/src/gui/painting/qpaintengine_raster.cpp index 6f669bd333..2f7e32285f 100644 --- a/src/gui/painting/qpaintengine_raster.cpp +++ b/src/gui/painting/qpaintengine_raster.cpp @@ -2720,7 +2720,7 @@ void QRasterPaintEngine::alphaPenBlt(const void* src, int bpl, int depth, int rx scanline += bpl; } } else { // 32-bit alpha... - uint *sl = (uint *) src; + uint *sl = (uint *) scanline; for (int y = y0; y < y1; ++y) { for (int x = x0; x < x1; ) { // Skip those with 0 coverage -- cgit v1.2.3 From 5a882d035977a6b512f0ae033df48494209ac1b1 Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Mon, 11 Aug 2014 10:59:41 -0300 Subject: Doc: document that we have unfixed bugs with waitForXxx on Windows We have to document because we don't know how to fix the bug and don't know when they will be fixed. We should also disable the unit tests related to those functions, as they probably cause CI instability. Task-number: QTBUG-24451 Change-Id: I0e60682ec4af7570258b13735339051ba8f4a6e4 Reviewed-by: David Faure Reviewed-by: Richard J. Moore --- src/network/socket/qabstractsocket.cpp | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) (limited to 'src') diff --git a/src/network/socket/qabstractsocket.cpp b/src/network/socket/qabstractsocket.cpp index bead45ab83..e572745d51 100644 --- a/src/network/socket/qabstractsocket.cpp +++ b/src/network/socket/qabstractsocket.cpp @@ -2008,6 +2008,9 @@ static int qt_timeout_value(int msecs, int elapsed) \note Multiple calls to this functions do not accumulate the time. If the function times out, the connecting process will be aborted. + \note This function may fail randomly on Windows. Consider using the event + loop and the connected() signal if your software will run on Windows. + \sa connectToHost(), connected() */ bool QAbstractSocket::waitForConnected(int msecs) @@ -2107,6 +2110,9 @@ bool QAbstractSocket::waitForConnected(int msecs) there is new data available for reading; otherwise it returns \c false (if an error occurred or the operation timed out). + \note This function may fail randomly on Windows. Consider using the event + loop and the readyRead() signal if your software will run on Windows. + \sa waitForBytesWritten() */ bool QAbstractSocket::waitForReadyRead(int msecs) @@ -2166,6 +2172,20 @@ bool QAbstractSocket::waitForReadyRead(int msecs) } /*! \reimp + + This function blocks until at least one byte has been written on the socket + and the \l{QIODevice::}{bytesWritten()} signal has been emitted. The + function will timeout after \a msecs milliseconds; the default timeout is + 30000 milliseconds. + + The function returns \c true if the bytesWritten() signal is emitted; + otherwise it returns \c false (if an error occurred or the operation timed + out). + + \note This function may fail randomly on Windows. Consider using the event + loop and the bytesWritten() signal if your software will run on Windows. + + \sa waitForReadyRead() */ bool QAbstractSocket::waitForBytesWritten(int msecs) { @@ -2247,6 +2267,9 @@ bool QAbstractSocket::waitForBytesWritten(int msecs) If msecs is -1, this function will not time out. + \note This function may fail randomly on Windows. Consider using the event + loop and the disconnected() signal if your software will run on Windows. + \sa disconnectFromHost(), close() */ bool QAbstractSocket::waitForDisconnected(int msecs) -- cgit v1.2.3 From c2badc7423b63824902d1f44a4b804de3335c20b Mon Sep 17 00:00:00 2001 From: Olivier Goffart Date: Fri, 8 Aug 2014 10:26:03 +0200 Subject: Fix disconnect()ing from signals declared in a base class Fix disconnection from pointer to member signal that belongs to the base class, but whose type is a pointer to a member of the derived class. Commit 9cc106d9d7d951fcf30f4b0f8606afa6b50892ec fixed connect, so apply the same fix in disconnect [ChangeLog][QtCore][QObject] Fixed disconnecting from pointer to member signal that belongs in the base class but whose type is explicitly given as a pointer to a member in the derived class Task-number: QTBUG-40638 Change-Id: Ia546fc8f36e1ea0dd0645bdd820aea47f43677ac Reviewed-by: Thiago Macieira --- src/corelib/kernel/qobject.cpp | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/corelib/kernel/qobject.cpp b/src/corelib/kernel/qobject.cpp index 5e8a97cdc0..e714168e16 100644 --- a/src/corelib/kernel/qobject.cpp +++ b/src/corelib/kernel/qobject.cpp @@ -4711,10 +4711,14 @@ bool QObject::disconnectImpl(const QObject *sender, void **signal, const QObject int signal_index = -1; if (signal) { void *args[] = { &signal_index, signal }; - senderMetaObject->static_metacall(QMetaObject::IndexOfMethod, 0, args); - if (signal_index < 0 || signal_index >= QMetaObjectPrivate::get(senderMetaObject)->signalCount) { - qWarning("QObject::disconnect: signal not found in %s", senderMetaObject->className()); - return false; + for (; senderMetaObject && signal_index < 0; senderMetaObject = senderMetaObject->superClass()) { + senderMetaObject->static_metacall(QMetaObject::IndexOfMethod, 0, args); + if (signal_index >= 0 && signal_index < QMetaObjectPrivate::get(senderMetaObject)->signalCount) + break; + } + if (!senderMetaObject) { + qWarning("QObject::disconnect: signal not found in %s", sender->metaObject()->className()); + return QMetaObject::Connection(0); } signal_index += QMetaObjectPrivate::signalOffset(senderMetaObject); } -- cgit v1.2.3