summaryrefslogtreecommitdiffstats
path: root/src/widgets/kernel
diff options
context:
space:
mode:
Diffstat (limited to 'src/widgets/kernel')
-rw-r--r--src/widgets/kernel/kernel.pri2
-rw-r--r--src/widgets/kernel/qapplication.cpp6
-rw-r--r--src/widgets/kernel/qdesktopwidget.qdoc2
-rw-r--r--src/widgets/kernel/qlayoutitem.cpp5
-rw-r--r--src/widgets/kernel/qlayoutitem.h2
-rw-r--r--src/widgets/kernel/qopenglwidget.cpp2
-rw-r--r--src/widgets/kernel/qstandardgestures.cpp26
-rw-r--r--src/widgets/kernel/qwidget.cpp58
-rw-r--r--src/widgets/kernel/qwidgetaction.cpp4
-rw-r--r--src/widgets/kernel/qwidgetsfunctions_wince.cpp6
-rw-r--r--src/widgets/kernel/win.pri2
11 files changed, 57 insertions, 58 deletions
diff --git a/src/widgets/kernel/kernel.pri b/src/widgets/kernel/kernel.pri
index 21a982f349..0060ad2d31 100644
--- a/src/widgets/kernel/kernel.pri
+++ b/src/widgets/kernel/kernel.pri
@@ -69,7 +69,7 @@ macx: {
SOURCES += kernel/qmacgesturerecognizer.cpp
}
-wince*: {
+wince {
HEADERS += \
../corelib/kernel/qfunctions_wince.h \
kernel/qwidgetsfunctions_wince.h
diff --git a/src/widgets/kernel/qapplication.cpp b/src/widgets/kernel/qapplication.cpp
index f457993168..504932dc53 100644
--- a/src/widgets/kernel/qapplication.cpp
+++ b/src/widgets/kernel/qapplication.cpp
@@ -1530,7 +1530,7 @@ void QApplicationPrivate::setPalette_helper(const QPalette &palette, const char*
\note Some styles do not use the palette for all drawing, for instance, if
they make use of native theme engines. This is the case for the Windows XP,
- Windows Vista, and Mac OS X styles.
+ Windows Vista, and OS X styles.
\sa QWidget::setPalette(), palette(), QStyle::polish()
*/
@@ -3229,7 +3229,7 @@ bool QApplication::notify(QObject *receiver, QEvent *e)
QApplicationPrivate::giveFocusAccordingToFocusPolicy(w, e, relpos);
// ### Qt 5 These dynamic tool tips should be an OPT-IN feature. Some platforms
- // like Mac OS X (probably others too), can optimize their views by not
+ // like OS X (probably others too), can optimize their views by not
// dispatching mouse move events. We have attributes to control hover,
// and mouse tracking, but as long as we are deciding to implement this
// feature without choice of opting-in or out, you ALWAYS have to have
@@ -3933,7 +3933,7 @@ bool QApplication::keypadNavigationEnabled()
Currently this function does nothing on Qt for Embedded Linux.
- On Mac OS X, this works more at the application level and will cause the
+ On OS X, this works more at the application level and will cause the
application icon to bounce in the dock.
On Windows, this causes the window's taskbar entry to flash for a time. If
diff --git a/src/widgets/kernel/qdesktopwidget.qdoc b/src/widgets/kernel/qdesktopwidget.qdoc
index 6ce312dc2f..31a99f1acb 100644
--- a/src/widgets/kernel/qdesktopwidget.qdoc
+++ b/src/widgets/kernel/qdesktopwidget.qdoc
@@ -149,7 +149,7 @@
Returns the available geometry of the screen with index \a screen. What
is available will be subrect of screenGeometry() based on what the
platform decides is available (for example excludes the dock and menu bar
- on Mac OS X, or the task bar on Windows). The default screen is used if
+ on OS X, or the task bar on Windows). The default screen is used if
\a screen is -1.
\sa screenNumber(), screenGeometry()
diff --git a/src/widgets/kernel/qlayoutitem.cpp b/src/widgets/kernel/qlayoutitem.cpp
index 21f4c9a221..3d444136e3 100644
--- a/src/widgets/kernel/qlayoutitem.cpp
+++ b/src/widgets/kernel/qlayoutitem.cpp
@@ -332,14 +332,11 @@ QSpacerItem * QSpacerItem::spacerItem()
}
/*!
+ \fn QSizePolicy QSpacerItem::sizePolicy() const
\since 5.5
Returns the size policy of this item.
*/
-QSizePolicy QSpacerItem::sizePolicy() const
-{
- return sizeP;
-}
/*!
If this item is a QWidget, it is returned as a QWidget; otherwise
diff --git a/src/widgets/kernel/qlayoutitem.h b/src/widgets/kernel/qlayoutitem.h
index eaa129a85b..650e114c76 100644
--- a/src/widgets/kernel/qlayoutitem.h
+++ b/src/widgets/kernel/qlayoutitem.h
@@ -102,7 +102,7 @@ public:
void setGeometry(const QRect&);
QRect geometry() const;
QSpacerItem *spacerItem();
- QSizePolicy sizePolicy() const;
+ QSizePolicy sizePolicy() const { return sizeP; }
private:
int width;
diff --git a/src/widgets/kernel/qopenglwidget.cpp b/src/widgets/kernel/qopenglwidget.cpp
index 9bfdc62e60..1ee28f2e9a 100644
--- a/src/widgets/kernel/qopenglwidget.cpp
+++ b/src/widgets/kernel/qopenglwidget.cpp
@@ -639,7 +639,7 @@ GLuint QOpenGLWidgetPrivate::textureId() const
Q_Q(const QOpenGLWidget);
if (!q->isWindow() && q->internalWinId()) {
qWarning() << "QOpenGLWidget cannot be used as a native child widget."
- << "Consider setting Qt::AA_DontCreateNativeWidgetAncestors and Siblings.";
+ << "Consider setting Qt::WA_DontCreateNativeAncestors and Qt::AA_DontCreateNativeWidgetSiblings.";
return 0;
}
return resolvedFbo ? resolvedFbo->texture() : (fbo ? fbo->texture() : 0);
diff --git a/src/widgets/kernel/qstandardgestures.cpp b/src/widgets/kernel/qstandardgestures.cpp
index d19e473d18..d7589cc594 100644
--- a/src/widgets/kernel/qstandardgestures.cpp
+++ b/src/widgets/kernel/qstandardgestures.cpp
@@ -53,7 +53,7 @@ QGesture *QPanGestureRecognizer::create(QObject *target)
{
if (target && target->isWidgetType()) {
#if (defined(Q_OS_MACX) || defined(Q_OS_WIN)) && !defined(QT_NO_NATIVE_GESTURES)
- // for scroll areas on Windows and Mac OS X we want to use native gestures instead
+ // for scroll areas on Windows and OS X we want to use native gestures instead
if (!qobject_cast<QAbstractScrollArea *>(target->parent()))
static_cast<QWidget *>(target)->setAttribute(Qt::WA_AcceptTouchEvents);
#else
@@ -334,23 +334,27 @@ QGestureRecognizer::Result QSwipeGestureRecognizer::recognize(QGesture *state,
d->swipeAngle = QLineF(p1.startScreenPos(), p1.screenPos()).angle();
static const int MoveThreshold = 50;
+ static const int directionChangeThreshold = MoveThreshold / 8;
if (qAbs(xDistance) > MoveThreshold || qAbs(yDistance) > MoveThreshold) {
// measure the distance to check if the direction changed
d->lastPositions[0] = p1.screenPos().toPoint();
d->lastPositions[1] = p2.screenPos().toPoint();
d->lastPositions[2] = p3.screenPos().toPoint();
- QSwipeGesture::SwipeDirection horizontal =
- xDistance > 0 ? QSwipeGesture::Right : QSwipeGesture::Left;
- QSwipeGesture::SwipeDirection vertical =
- yDistance > 0 ? QSwipeGesture::Down : QSwipeGesture::Up;
- if (d->verticalDirection == QSwipeGesture::NoDirection)
+ result = QGestureRecognizer::TriggerGesture;
+ // QTBUG-46195, small changes in direction should not cause the gesture to be canceled.
+ if (d->verticalDirection == QSwipeGesture::NoDirection || qAbs(yDistance) > directionChangeThreshold) {
+ const QSwipeGesture::SwipeDirection vertical = yDistance > 0
+ ? QSwipeGesture::Down : QSwipeGesture::Up;
+ if (d->verticalDirection != QSwipeGesture::NoDirection && d->verticalDirection != vertical)
+ result = QGestureRecognizer::CancelGesture;
d->verticalDirection = vertical;
- if (d->horizontalDirection == QSwipeGesture::NoDirection)
+ }
+ if (d->horizontalDirection == QSwipeGesture::NoDirection || qAbs(xDistance) > directionChangeThreshold) {
+ const QSwipeGesture::SwipeDirection horizontal = xDistance > 0
+ ? QSwipeGesture::Right : QSwipeGesture::Left;
+ if (d->horizontalDirection != QSwipeGesture::NoDirection && d->horizontalDirection != horizontal)
+ result = QGestureRecognizer::CancelGesture;
d->horizontalDirection = horizontal;
- if (d->verticalDirection != vertical || d->horizontalDirection != horizontal) {
- result = QGestureRecognizer::CancelGesture;
- } else {
- result = QGestureRecognizer::TriggerGesture;
}
} else {
if (q->state() != Qt::NoGesture)
diff --git a/src/widgets/kernel/qwidget.cpp b/src/widgets/kernel/qwidget.cpp
index f57d180e3b..9ea5fd6018 100644
--- a/src/widgets/kernel/qwidget.cpp
+++ b/src/widgets/kernel/qwidget.cpp
@@ -2454,7 +2454,7 @@ QWidget *QWidget::find(WId id)
If a widget is non-native (alien) and winId() is invoked on it, that widget
will be provided a native handle.
- On Mac OS X, the type returned depends on which framework Qt was linked
+ On OS X, the type returned depends on which framework Qt was linked
against. If Qt is using Carbon, the {WId} is actually an HIViewRef. If Qt
is using Cocoa, {WId} is a pointer to an NSView.
@@ -2590,7 +2590,7 @@ QWindow *QWidget::windowHandle() const
The style sheet contains a textual description of customizations to the
widget's style, as described in the \l{Qt Style Sheets} document.
- Since Qt 4.5, Qt style sheets fully supports Mac OS X.
+ Since Qt 4.5, Qt style sheets fully supports OS X.
\warning Qt style sheets are currently not supported for custom QStyle
subclasses. We plan to address this in some future release.
@@ -5065,7 +5065,7 @@ void QWidget::render(QPaintDevice *target, const QPoint &targetOffset,
Transformations and settings applied to the \a painter will be used
when rendering.
- \note The \a painter must be active. On Mac OS X the widget will be
+ \note The \a painter must be active. On OS X the widget will be
rendered into a QPixmap and then drawn by the \a painter.
\sa QPainter::device()
@@ -6200,7 +6200,7 @@ QString QWidget::windowIconText() const
If the window title is set at any point, then the window title takes precedence and
will be shown instead of the file path string.
- Additionally, on Mac OS X, this has an added benefit that it sets the
+ Additionally, on OS X, this has an added benefit that it sets the
\l{http://developer.apple.com/documentation/UserExperience/Conceptual/OSXHIGuidelines/XHIGWindows/chapter_17_section_3.html}{proxy icon}
for the window, assuming that the file path exists.
@@ -11225,7 +11225,7 @@ bool QWidget::testAttribute_helper(Qt::WidgetAttribute attribute) const
By default the value of this property is 1.0.
- This feature is available on Embedded Linux, Mac OS X, Windows,
+ This feature is available on Embedded Linux, OS X, Windows,
and X11 platforms that support the Composite extension.
This feature is not available on Windows CE.
@@ -11288,7 +11288,7 @@ void QWidgetPrivate::setWindowOpacity_sys(qreal level)
A modified window is a window whose content has changed but has
not been saved to disk. This flag will have different effects
- varied by the platform. On Mac OS X the close button will have a
+ varied by the platform. On OS X the close button will have a
modified look; on other platforms, the window title will have an
'*' (asterisk).
@@ -12285,20 +12285,21 @@ QPaintEngine *QWidget::paintEngine() const
*/
QPoint QWidget::mapToGlobal(const QPoint &pos) const
{
-#ifndef QT_NO_GRAPHICSVIEW
- Q_D(const QWidget);
- if (d->extra && d->extra->proxyWidget && d->extra->proxyWidget->scene()) {
- const QList <QGraphicsView *> views = d->extra->proxyWidget->scene()->views();
- if (!views.isEmpty()) {
- const QPointF scenePos = d->extra->proxyWidget->mapToScene(pos);
- const QPoint viewPortPos = views.first()->mapFromScene(scenePos);
- return views.first()->viewport()->mapToGlobal(viewPortPos);
- }
- }
-#endif // !QT_NO_GRAPHICSVIEW
int x = pos.x(), y = pos.y();
const QWidget *w = this;
while (w) {
+#ifndef QT_NO_GRAPHICSVIEW
+ const QWidgetPrivate *d = w->d_func();
+ if (d->extra && d->extra->proxyWidget && d->extra->proxyWidget->scene()) {
+ const QList <QGraphicsView *> views = d->extra->proxyWidget->scene()->views();
+ if (!views.isEmpty()) {
+ const QPointF scenePos = d->extra->proxyWidget->mapToScene(QPoint(x, y));
+ const QPoint viewPortPos = views.first()->mapFromScene(scenePos);
+ return views.first()->viewport()->mapToGlobal(viewPortPos);
+ }
+ }
+#endif // !QT_NO_GRAPHICSVIEW
+
QWindow *window = w->windowHandle();
if (window && window->handle())
return window->mapToGlobal(QPoint(x, y));
@@ -12320,20 +12321,21 @@ QPoint QWidget::mapToGlobal(const QPoint &pos) const
*/
QPoint QWidget::mapFromGlobal(const QPoint &pos) const
{
-#ifndef QT_NO_GRAPHICSVIEW
- Q_D(const QWidget);
- if (d->extra && d->extra->proxyWidget && d->extra->proxyWidget->scene()) {
- const QList <QGraphicsView *> views = d->extra->proxyWidget->scene()->views();
- if (!views.isEmpty()) {
- const QPoint viewPortPos = views.first()->viewport()->mapFromGlobal(pos);
- const QPointF scenePos = views.first()->mapToScene(viewPortPos);
- return d->extra->proxyWidget->mapFromScene(scenePos).toPoint();
- }
- }
-#endif // !QT_NO_GRAPHICSVIEW
int x = pos.x(), y = pos.y();
const QWidget *w = this;
while (w) {
+#ifndef QT_NO_GRAPHICSVIEW
+ const QWidgetPrivate *d = w->d_func();
+ if (d->extra && d->extra->proxyWidget && d->extra->proxyWidget->scene()) {
+ const QList <QGraphicsView *> views = d->extra->proxyWidget->scene()->views();
+ if (!views.isEmpty()) {
+ const QPoint viewPortPos = views.first()->viewport()->mapFromGlobal(QPoint(x, y));
+ const QPointF scenePos = views.first()->mapToScene(viewPortPos);
+ return d->extra->proxyWidget->mapFromScene(scenePos).toPoint();
+ }
+ }
+#endif // !QT_NO_GRAPHICSVIEW
+
QWindow *window = w->windowHandle();
if (window && window->handle())
return window->mapFromGlobal(QPoint(x, y));
diff --git a/src/widgets/kernel/qwidgetaction.cpp b/src/widgets/kernel/qwidgetaction.cpp
index 27d4a650b4..3c0c203fd6 100644
--- a/src/widgets/kernel/qwidgetaction.cpp
+++ b/src/widgets/kernel/qwidgetaction.cpp
@@ -79,8 +79,8 @@ QT_BEGIN_NAMESPACE
Note that it is up to the widget to activate the action, for example by
reimplementing mouse event handlers and calling QAction::trigger().
- \b {Mac OS X}: If you add a widget to a menu in the application's menu
- bar on Mac OS X, the widget will be added and it will function but with some
+ \b {OS X}: If you add a widget to a menu in the application's menu
+ bar on OS X, the widget will be added and it will function but with some
limitations:
\list 1
\li The widget is reparented away from the QMenu to the native menu
diff --git a/src/widgets/kernel/qwidgetsfunctions_wince.cpp b/src/widgets/kernel/qwidgetsfunctions_wince.cpp
index f06514dbe4..d42e4ebc21 100644
--- a/src/widgets/kernel/qwidgetsfunctions_wince.cpp
+++ b/src/widgets/kernel/qwidgetsfunctions_wince.cpp
@@ -51,14 +51,10 @@ HINSTANCE qt_wince_ShellExecute(HWND hwnd, LPCWSTR, LPCWSTR file, LPCWSTR params
}
#endif
-#ifndef SPI_GETPLATFORMTYPE
-#define SPI_GETPLATFORMTYPE 257
-#endif
-
// Internal Qt -----------------------------------------------------
bool qt_wince_is_platform(const QString &platformString) {
wchar_t tszPlatform[64];
- if (SystemParametersInfo(SPI_GETPLATFORMTYPE, sizeof(tszPlatform) / sizeof(wchar_t), tszPlatform, 0))
+ if (SystemParametersInfo(SPI_GETPLATFORMNAME, sizeof(tszPlatform) / sizeof(wchar_t), tszPlatform, 0))
if (0 == _tcsicmp(reinterpret_cast<const wchar_t *> (platformString.utf16()), tszPlatform))
return true;
return false;
diff --git a/src/widgets/kernel/win.pri b/src/widgets/kernel/win.pri
index 76bb709e2b..e2d5afdeec 100644
--- a/src/widgets/kernel/win.pri
+++ b/src/widgets/kernel/win.pri
@@ -2,6 +2,6 @@
# --------------------------------------------------------------------
INCLUDEPATH += ../3rdparty/wintab
-!wince*:!winrt {
+!wince:!winrt {
LIBS_PRIVATE *= -lshell32
}