summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorSimon Hausmann <simon.hausmann@digia.com>2013-11-29 11:37:30 +0100
committerSimon Hausmann <simon.hausmann@digia.com>2013-11-29 11:38:28 +0100
commit8e04691543ae3906e011f47d446ac7a94034259e (patch)
tree9cf166dcef514bbc965d570121d0b3022aad27da /src
parentad684ff2a7d91a948ad9d2f3765dd08c78d81020 (diff)
parent7d5448d9e2ae4d2d10c0cff867cf34b315336feb (diff)
Merge remote-tracking branch 'origin/release' into stable
Diffstat (limited to 'src')
-rw-r--r--src/corelib/kernel/qobject.cpp2
-rw-r--r--src/corelib/tools/qalgorithms.qdoc8
-rw-r--r--src/gui/kernel/qevent.cpp15
-rw-r--r--src/plugins/platforms/ios/qiosapplicationdelegate.mm20
-rw-r--r--src/plugins/platforms/ios/qiosscreen.mm19
-rw-r--r--src/plugins/platforms/ios/qiosservices.h7
-rw-r--r--src/plugins/platforms/ios/qiosservices.mm19
7 files changed, 80 insertions, 10 deletions
diff --git a/src/corelib/kernel/qobject.cpp b/src/corelib/kernel/qobject.cpp
index e02026ca4c..7d2410a18a 100644
--- a/src/corelib/kernel/qobject.cpp
+++ b/src/corelib/kernel/qobject.cpp
@@ -1876,7 +1876,7 @@ void QObjectPrivate::setParent_helper(QObject *o)
}
}
}
- if (!isDeletingChildren && declarativeData && QAbstractDeclarativeData::parentChanged)
+ if (!wasDeleted && !isDeletingChildren && declarativeData && QAbstractDeclarativeData::parentChanged)
QAbstractDeclarativeData::parentChanged(declarativeData, q, o);
}
diff --git a/src/corelib/tools/qalgorithms.qdoc b/src/corelib/tools/qalgorithms.qdoc
index cd389470a4..412b9cf3b2 100644
--- a/src/corelib/tools/qalgorithms.qdoc
+++ b/src/corelib/tools/qalgorithms.qdoc
@@ -49,9 +49,9 @@
iterators they accept. For example, qFill() accepts two
\l {forward iterators}. The iterator types required are specified
for each algorithm. If an iterator of the wrong type is passed (for
- example, if QList::ConstIterator is passed as an \l {output
- iterator}), you will always get a compiler error, although not
- necessarily a very informative one.
+ example, if QList::ConstIterator is passed as an
+ \l {Output Iterators}{output iterator}), you will always get a
+ compiler error, although not necessarily a very informative one.
Some algorithms have special requirements on the value type
stored in the containers. For example,
@@ -99,7 +99,7 @@
\section2 Output Iterators
- An \e{output iterator} is an iterator that can be used for
+ An output iterator is an iterator that can be used for
writing data sequentially to a container or to some output
stream. It must provide the following operators: unary \c{*} for
writing a value (i.e., \c{*it = val}) and prefix \c{++} for
diff --git a/src/gui/kernel/qevent.cpp b/src/gui/kernel/qevent.cpp
index 28666085a7..88f132b877 100644
--- a/src/gui/kernel/qevent.cpp
+++ b/src/gui/kernel/qevent.cpp
@@ -709,6 +709,12 @@ QWheelEvent::QWheelEvent(const QPointF &pos, const QPointF& globalPos,
Example:
\snippet code/src_gui_kernel_qevent.cpp 0
+
+ \note On platforms that support scrolling \l{phase()}{phases}, the delta may be null when:
+ \list
+ \li scrolling is about to begin, but the distance did not yet change (Qt::ScrollBegin),
+ \li or scrolling has ended and the distance did not change anymore (Qt::ScrollEnd).
+ \endlist
*/
/*!
@@ -731,6 +737,12 @@ QWheelEvent::QWheelEvent(const QPointF &pos, const QPointF& globalPos,
Example:
\snippet code/src_gui_kernel_qevent.cpp 0
+
+ \note On platforms that support scrolling \l{phase()}{phases}, the delta may be null when:
+ \list
+ \li scrolling is about to begin, but the distance did not yet change (Qt::ScrollBegin),
+ \li or scrolling has ended and the distance did not change anymore (Qt::ScrollEnd).
+ \endlist
*/
/*!
@@ -830,6 +842,9 @@ QWheelEvent::QWheelEvent(const QPointF &pos, const QPointF& globalPos,
\since 5.2
Returns the scrolling phase of this wheel event.
+
+ \note The Qt::ScrollBegin and Qt::ScrollEnd phases are currently
+ supported only on Mac OS X.
*/
diff --git a/src/plugins/platforms/ios/qiosapplicationdelegate.mm b/src/plugins/platforms/ios/qiosapplicationdelegate.mm
index cf702c82af..9cf1047a6b 100644
--- a/src/plugins/platforms/ios/qiosapplicationdelegate.mm
+++ b/src/plugins/platforms/ios/qiosapplicationdelegate.mm
@@ -41,9 +41,14 @@
#include "qiosapplicationdelegate.h"
+#include "qiosintegration.h"
+#include "qiosservices.h"
#include "qiosviewcontroller.h"
#include "qioswindow.h"
+#include <QtGui/private/qguiapplication_p.h>
+#include <qpa/qplatformintegration.h>
+
#include <QtCore/QtCore>
@implementation QIOSApplicationDelegate
@@ -82,6 +87,21 @@
return YES;
}
+- (BOOL)application:(UIApplication *)application openURL:(NSURL *)url sourceApplication:(NSString *)sourceApplication annotation:(id)annotation
+{
+ Q_UNUSED(application);
+ Q_UNUSED(sourceApplication);
+ Q_UNUSED(annotation);
+
+ if (!QGuiApplication::instance())
+ return NO;
+
+ QIOSIntegration *iosIntegration = static_cast<QIOSIntegration *>(QGuiApplicationPrivate::platformIntegration());
+ QIOSServices *iosServices = static_cast<QIOSServices *>(iosIntegration->services());
+
+ return iosServices->handleUrl(QUrl::fromNSURL(url));
+}
+
- (void)dealloc
{
[window release];
diff --git a/src/plugins/platforms/ios/qiosscreen.mm b/src/plugins/platforms/ios/qiosscreen.mm
index 57522cb1a3..96410952f9 100644
--- a/src/plugins/platforms/ios/qiosscreen.mm
+++ b/src/plugins/platforms/ios/qiosscreen.mm
@@ -189,6 +189,9 @@ void QIOSScreen::updateProperties()
void QIOSScreen::updateStatusBarVisibility()
{
+ if (!isQtApplication())
+ return;
+
QWindow *focusWindow = QGuiApplication::focusWindow();
// If we don't have a focus window we leave the status
@@ -199,20 +202,26 @@ void QIOSScreen::updateStatusBarVisibility()
return;
UIView *view = reinterpret_cast<UIView *>(focusWindow->handle()->winId());
+ QIOSViewController *viewController = static_cast<QIOSViewController *>(view.viewController);
+
+ bool currentStatusBarVisibility = [UIApplication sharedApplication].statusBarHidden;
+ if (viewController.prefersStatusBarHidden == currentStatusBarVisibility)
+ return;
+
#if QT_IOS_PLATFORM_SDK_EQUAL_OR_ABOVE(__IPHONE_7_0)
if (QSysInfo::MacintoshVersion >= QSysInfo::MV_IOS_7_0) {
- [view.viewController setNeedsStatusBarAppearanceUpdate];
+ [viewController setNeedsStatusBarAppearanceUpdate];
+ dispatch_async(dispatch_get_main_queue(), ^{
+ updateProperties();
+ });
} else
#endif
{
- bool wasHidden = [UIApplication sharedApplication].statusBarHidden;
- QIOSViewController *viewController = static_cast<QIOSViewController *>(view.viewController);
[[UIApplication sharedApplication]
setStatusBarHidden:[viewController prefersStatusBarHidden]
withAnimation:UIStatusBarAnimationNone];
- if ([UIApplication sharedApplication].statusBarHidden != wasHidden)
- updateProperties();
+ updateProperties();
}
}
diff --git a/src/plugins/platforms/ios/qiosservices.h b/src/plugins/platforms/ios/qiosservices.h
index 692b3a0b99..aa39fbbed4 100644
--- a/src/plugins/platforms/ios/qiosservices.h
+++ b/src/plugins/platforms/ios/qiosservices.h
@@ -41,6 +41,8 @@
#ifndef QIOSSERVICES_H
#define QIOSSERVICES_H
+
+#include <qurl.h>
#include <qpa/qplatformservices.h>
QT_BEGIN_NAMESPACE
@@ -50,6 +52,11 @@ class QIOSServices : public QPlatformServices
public:
bool openUrl(const QUrl &url);
bool openDocument(const QUrl &url);
+
+ bool handleUrl(const QUrl &url);
+
+private:
+ QUrl m_handlingUrl;
};
QT_END_NAMESPACE
diff --git a/src/plugins/platforms/ios/qiosservices.mm b/src/plugins/platforms/ios/qiosservices.mm
index 32203aeb71..0ac6c590ca 100644
--- a/src/plugins/platforms/ios/qiosservices.mm
+++ b/src/plugins/platforms/ios/qiosservices.mm
@@ -42,6 +42,7 @@
#include "qiosservices.h"
#include <QtCore/qurl.h>
+#include <QtGui/qdesktopservices.h>
#import <UIKit/UIApplication.h>
@@ -49,6 +50,9 @@ QT_BEGIN_NAMESPACE
bool QIOSServices::openUrl(const QUrl &url)
{
+ if (url == m_handlingUrl)
+ return false;
+
if (url.scheme().isEmpty())
return openDocument(url);
@@ -66,4 +70,19 @@ bool QIOSServices::openDocument(const QUrl &url)
return QPlatformServices::openDocument(url);
}
+/* Callback from iOS that the application should handle a URL */
+bool QIOSServices::handleUrl(const QUrl &url)
+{
+ QUrl previouslyHandling = m_handlingUrl;
+ m_handlingUrl = url;
+
+ // FIXME: Add platform services callback from QDesktopServices::setUrlHandler
+ // so that we can warn the user if calling setUrlHandler without also setting
+ // up the matching keys in the Info.plist file (CFBundleURLTypes and friends).
+ bool couldHandle = QDesktopServices::openUrl(url);
+
+ m_handlingUrl = previouslyHandling;
+ return couldHandle;
+}
+
QT_END_NAMESPACE