From 5f7ea1a41aa9e299130f335b0023b9026de841c5 Mon Sep 17 00:00:00 2001 From: Bernd Weimer Date: Fri, 6 Jun 2014 13:29:03 +0200 Subject: Fix QFileInfoGatherer threading issue QFileInfoGatherer has a QFileSystemWatcher member that lives in the same thread as the QFileInfoGatherer object. If only the poller engine is available for the file system watcher, the engine will only be created when addPaths() is called. However the latter was called from anohter thread (the QFileInfoGatherer thread). Hence the QPollingFileSystemWatcherEngine had its parent in a different thread and worse, this thread didn't have an event loop needed for the QTimer used in the poller engine. This fixes tst_qfilesystemmodel on platforms that only support the polling file system watcher engine. Task-Number: QTBUG-29366 Change-Id: I83b58b4237e3438a27e5cdde4b1e4126e4740a94 Reviewed-by: Fabian Bumberger Reviewed-by: Thiago Macieira --- src/widgets/dialogs/qfileinfogatherer.cpp | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) (limited to 'src/widgets') diff --git a/src/widgets/dialogs/qfileinfogatherer.cpp b/src/widgets/dialogs/qfileinfogatherer.cpp index b08cc798e5..41b0b30eeb 100644 --- a/src/widgets/dialogs/qfileinfogatherer.cpp +++ b/src/widgets/dialogs/qfileinfogatherer.cpp @@ -146,6 +146,15 @@ void QFileInfoGatherer::fetchExtendedInformation(const QString &path, const QStr this->path.push(path); this->files.push(files); condition.wakeAll(); + +#ifndef QT_NO_FILESYSTEMWATCHER + if (files.isEmpty() + && !path.isEmpty() + && !path.startsWith(QLatin1String("//")) /*don't watch UNC path*/) { + if (!watcher->directories().contains(path)) + watcher->addPath(path); + } +#endif } /*! @@ -269,16 +278,6 @@ static QString translateDriveName(const QFileInfo &drive) */ void QFileInfoGatherer::getFileInfos(const QString &path, const QStringList &files) { -#ifndef QT_NO_FILESYSTEMWATCHER - if (files.isEmpty() - && !path.isEmpty() - && !path.startsWith(QLatin1String("//")) /*don't watch UNC path*/) { - QMutexLocker locker(&mutex); - if (!watcher->directories().contains(path)) - watcher->addPath(path); - } -#endif - // List drives if (path.isEmpty()) { #ifdef QT_BUILD_INTERNAL -- cgit v1.2.3 From 47a66d5eac0df9481cff1dc23caed4335d49b515 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Morten=20Johan=20S=C3=B8rvig?= Date: Tue, 13 May 2014 14:28:18 +0200 Subject: Mac: Don't register for Pan Gestures. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This will enable touch events for the viewport widget, which has undesired side effects (see task). Fixes a regression from Qt 4. Task-number: QTBUG-38815 Change-Id: I7b9c0d1de985d1c82f946140fecf460fcfc5e686 Reviewed-by: Morten Johan Sørvig --- src/widgets/widgets/qabstractscrollarea.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/widgets') diff --git a/src/widgets/widgets/qabstractscrollarea.cpp b/src/widgets/widgets/qabstractscrollarea.cpp index e1e933cdd8..98e715fc62 100644 --- a/src/widgets/widgets/qabstractscrollarea.cpp +++ b/src/widgets/widgets/qabstractscrollarea.cpp @@ -309,7 +309,7 @@ void QAbstractScrollAreaPrivate::init() q->setFrameStyle(QFrame::StyledPanel | QFrame::Sunken); q->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding); layoutChildren(); -#ifndef Q_WS_MAC +#ifndef Q_OS_OSX # ifndef QT_NO_GESTURES viewport->grabGesture(Qt::PanGesture); # endif -- cgit v1.2.3 From 35f6b003341f31172b3a0a7fab8902350b9ba6c0 Mon Sep 17 00:00:00 2001 From: Michael Zanetti Date: Wed, 25 Sep 2013 16:11:58 +0200 Subject: move loading of testability driver from QApplication to QGuiApplication This is useful without QWidget too. Change-Id: Ic7857e52e4a8f57c1205615a1f30323b486814af Reviewed-by: Richard J. Moore Reviewed-by: Friedemann Kleint Reviewed-by: Alberto Mardegan Reviewed-by: Shawn Rutledge --- src/widgets/kernel/qapplication.cpp | 23 ----------------------- src/widgets/kernel/qapplication_p.h | 1 - 2 files changed, 24 deletions(-) (limited to 'src/widgets') diff --git a/src/widgets/kernel/qapplication.cpp b/src/widgets/kernel/qapplication.cpp index 0b983e7a9d..4bd306ed32 100644 --- a/src/widgets/kernel/qapplication.cpp +++ b/src/widgets/kernel/qapplication.cpp @@ -92,9 +92,6 @@ #include "qgesture.h" #include "private/qgesturemanager_p.h" #include -#ifndef QT_NO_LIBRARY -#include "qlibrary.h" -#endif #include "qdatetime.h" @@ -415,7 +412,6 @@ int qt_antialiasing_threshold = -1; QSize QApplicationPrivate::app_strut = QSize(0,0); // no default application strut int QApplicationPrivate::enabledAnimations = QPlatformTheme::GeneralUiEffect; bool QApplicationPrivate::widgetCount = false; -bool QApplicationPrivate::load_testability = false; #ifdef QT_KEYPAD_NAVIGATION Qt::NavigationMode QApplicationPrivate::navigationMode = Qt::NavigationModeKeypadTabOrder; QWidget *QApplicationPrivate::oldEditFocus = 0; @@ -490,8 +486,6 @@ void QApplicationPrivate::process_cmdline() #endif } else if (qstrcmp(arg, "-widgetcount") == 0) { widgetCount = true; - } else if (qstrcmp(arg, "-testability") == 0) { - load_testability = true; } else { argv[j++] = argv[i]; } @@ -582,23 +576,6 @@ void QApplicationPrivate::construct() extern void qt_gui_eval_init(QCoreApplicationPrivate::Type); qt_gui_eval_init(application_type); #endif - -#ifndef QT_NO_LIBRARY - if(load_testability) { - QLibrary testLib(QLatin1String("qttestability")); - if (testLib.load()) { - typedef void (*TasInitialize)(void); - TasInitialize initFunction = (TasInitialize)testLib.resolve("qt_testability_init"); - if (initFunction) { - initFunction(); - } else { - qCritical("Library qttestability resolve failed!"); - } - } else { - qCritical("Library qttestability load failed!"); - } - } -#endif } #ifndef QT_NO_STATEMACHINE diff --git a/src/widgets/kernel/qapplication_p.h b/src/widgets/kernel/qapplication_p.h index d5efb62dda..29142470a7 100644 --- a/src/widgets/kernel/qapplication_p.h +++ b/src/widgets/kernel/qapplication_p.h @@ -214,7 +214,6 @@ public: static int enabledAnimations; // Combination of QPlatformTheme::UiEffect static bool widgetCount; // Coupled with -widgetcount switch - static bool load_testability; // Coupled with -testability switch static void setSystemPalette(const QPalette &pal); static void setPalette_helper(const QPalette &palette, const char* className, bool clearWidgetPaletteHash); -- cgit v1.2.3 From 3fed060b94ff04131de603d4d668ae7853e50a53 Mon Sep 17 00:00:00 2001 From: Joni Poikelin Date: Mon, 9 Jun 2014 16:27:36 +0300 Subject: Fix warning message when re-setting text on tooltip Fix warning message that gets printed when changing tooltip message without rect and widget parameters for already shown tooltip widget. Task-number: QTBUG-39550 Change-Id: I69ed8747e5e77ca618525d74479c72e02b7ab897 Reviewed-by: Andy Shaw Reviewed-by: Friedemann Kleint --- src/widgets/kernel/qtooltip.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/widgets') diff --git a/src/widgets/kernel/qtooltip.cpp b/src/widgets/kernel/qtooltip.cpp index 2b43fd7f6d..16fb41e1fc 100644 --- a/src/widgets/kernel/qtooltip.cpp +++ b/src/widgets/kernel/qtooltip.cpp @@ -273,7 +273,7 @@ void QTipLabel::hideTipImmediately() void QTipLabel::setTipRect(QWidget *w, const QRect &r) { - if (!rect.isNull() && !w) + if (!r.isNull() && !w) qWarning("QToolTip::setTipRect: Cannot pass null widget if rect is set"); else{ widget = w; -- cgit v1.2.3