diff options
author | Jędrzej Nowacki <jedrzej.nowacki@digia.com> | 2013-01-07 16:57:32 +0100 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2013-01-07 18:07:29 +0100 |
commit | ae2359d49e171c61450b17b1eb0e0dd7a20c7ca4 (patch) | |
tree | fbf5ef281002a47659d80405ae38f48b57e19c22 /src/gui | |
parent | 998899cf3a2501d3bf30ad06ce47a2cf81e1d60b (diff) | |
parent | cdf13ce286b14273e1e29c5bb02cbc880f31b786 (diff) |
Merge "Merge branch 'stable' into dev" into refs/staging/dev
Diffstat (limited to 'src/gui')
-rw-r--r-- | src/gui/accessible/qaccessible.cpp | 14 | ||||
-rw-r--r-- | src/gui/accessible/qaccessible.h | 3 | ||||
-rw-r--r-- | src/gui/kernel/qguiapplication.cpp | 7 | ||||
-rw-r--r-- | src/gui/kernel/qwindow.cpp | 18 | ||||
-rw-r--r-- | src/gui/kernel/qwindowsysteminterface_p.h | 5 | ||||
-rw-r--r-- | src/gui/opengl/qtriangulator.cpp | 39 | ||||
-rw-r--r-- | src/gui/text/qtextengine.cpp | 4 |
7 files changed, 29 insertions, 61 deletions
diff --git a/src/gui/accessible/qaccessible.cpp b/src/gui/accessible/qaccessible.cpp index a32f771bd0..28a3afbbf0 100644 --- a/src/gui/accessible/qaccessible.cpp +++ b/src/gui/accessible/qaccessible.cpp @@ -56,8 +56,6 @@ QT_BEGIN_NAMESPACE -#ifndef QT_NO_ACCESSIBILITY - /*! \class QAccessible \brief The QAccessible class provides enums and static functions @@ -442,19 +440,23 @@ QAccessible::RootObjectHandler QAccessible::rootObjectHandler = 0; static bool accessibility_active = false; static bool cleanupAdded = false; +#ifndef QT_NO_ACCESSIBILITY static QPlatformAccessibility *platformAccessibility() { QPlatformIntegration *pfIntegration = QGuiApplicationPrivate::platformIntegration(); return pfIntegration ? pfIntegration->accessibility() : 0; } +#endif /*! \internal */ void QAccessible::cleanup() { +#ifndef QT_NO_ACCESSIBILITY if (QPlatformAccessibility *pfAccessibility = platformAccessibility()) pfAccessibility->cleanup(); +#endif } static void qAccessibleCleanup() @@ -615,8 +617,10 @@ QAccessibleInterface *QAccessible::queryAccessibleInterface(QObject *object) mo = mo->superClass(); } +#ifndef QT_NO_ACCESSIBILITY if (object == qApp) return new QAccessibleApplication; +#endif return 0; } @@ -656,8 +660,10 @@ void QAccessible::setRootObject(QObject *object) return; } +#ifndef QT_NO_ACCESSIBILITY if (QPlatformAccessibility *pfAccessibility = platformAccessibility()) pfAccessibility->setRootObject(object); +#endif } /*! @@ -689,8 +695,10 @@ void QAccessible::updateAccessibility(QAccessibleEvent *event) if (!isActive()) return; +#ifndef QT_NO_ACCESSIBILITY if (QPlatformAccessibility *pfAccessibility = platformAccessibility()) pfAccessibility->notifyAccessibilityUpdate(event); +#endif } #if QT_DEPRECATED_SINCE(5, 0) @@ -1544,7 +1552,5 @@ QDebug operator<<(QDebug d, const QAccessibleEvent &ev) #endif -#endif // QT_NO_ACCESSIBILITY - QT_END_NAMESPACE diff --git a/src/gui/accessible/qaccessible.h b/src/gui/accessible/qaccessible.h index 5bcf9e7d0d..5f61634ba2 100644 --- a/src/gui/accessible/qaccessible.h +++ b/src/gui/accessible/qaccessible.h @@ -57,7 +57,6 @@ QT_BEGIN_HEADER QT_BEGIN_NAMESPACE -#ifndef QT_NO_ACCESSIBILITY class QAccessibleInterface; class QAccessibleEvent; @@ -677,8 +676,6 @@ inline void QAccessible::updateAccessibility(QObject *object, int child, Event r } #endif -#endif // QT_NO_ACCESSIBILITY - QT_END_NAMESPACE QT_END_HEADER diff --git a/src/gui/kernel/qguiapplication.cpp b/src/gui/kernel/qguiapplication.cpp index 72e95c996c..190d52776a 100644 --- a/src/gui/kernel/qguiapplication.cpp +++ b/src/gui/kernel/qguiapplication.cpp @@ -1392,7 +1392,7 @@ void QGuiApplicationPrivate::processMouseEvent(QWindowSystemInterfacePrivate::Mo // Ignore mouse events that don't change the current state. return; } - buttons = e->buttons; + mouse_buttons = buttons = e->buttons; if (button & e->buttons) { ulong doubleClickInterval = static_cast<ulong>(qApp->styleHints()->mouseDoubleClickInterval()); doubleClick = e->timestamp - mousePressTime < doubleClickInterval && button == mousePressButton; @@ -1688,7 +1688,10 @@ void QGuiApplicationPrivate::processTabletEvent(QWindowSystemInterfacePrivate::T type = e->down ? QEvent::TabletPress : QEvent::TabletRelease; tabletState = e->down; } + QWindow *window = e->window.data(); + modifier_buttons = e->modifiers; + bool localValid = true; // If window is null, pick one based on the global position and make sure all // subsequent events up to the release are delivered to that same window. @@ -1719,7 +1722,7 @@ void QGuiApplicationPrivate::processTabletEvent(QWindowSystemInterfacePrivate::T QTabletEvent ev(type, local, e->global, e->device, e->pointerType, e->pressure, e->xTilt, e->yTilt, e->tangentialPressure, e->rotation, e->z, - e->mods, e->uid); + e->modifiers, e->uid); ev.setTimestamp(e->timestamp); QGuiApplication::sendSpontaneousEvent(window, &ev); #else diff --git a/src/gui/kernel/qwindow.cpp b/src/gui/kernel/qwindow.cpp index b6d592e050..22ad748fb5 100644 --- a/src/gui/kernel/qwindow.cpp +++ b/src/gui/kernel/qwindow.cpp @@ -1105,16 +1105,16 @@ void QWindow::setGeometry(const QRect &rect) d->platformWindow->setGeometry(rect); } else { d->geometry = rect; - } - if (rect.x() != oldRect.x()) - emit xChanged(rect.x()); - if (rect.y() != oldRect.y()) - emit yChanged(rect.y()); - if (rect.width() != oldRect.width()) - emit widthChanged(rect.width()); - if (rect.height() != oldRect.height()) - emit heightChanged(rect.height()); + if (rect.x() != oldRect.x()) + emit xChanged(rect.x()); + if (rect.y() != oldRect.y()) + emit yChanged(rect.y()); + if (rect.width() != oldRect.width()) + emit widthChanged(rect.width()); + if (rect.height() != oldRect.height()) + emit heightChanged(rect.height()); + } } /*! diff --git a/src/gui/kernel/qwindowsysteminterface_p.h b/src/gui/kernel/qwindowsysteminterface_p.h index e8d2a85dd9..dfdf7e9e93 100644 --- a/src/gui/kernel/qwindowsysteminterface_p.h +++ b/src/gui/kernel/qwindowsysteminterface_p.h @@ -302,10 +302,10 @@ public: TabletEvent(QWindow *w, ulong time, bool down, const QPointF &local, const QPointF &global, int device, int pointerType, qreal pressure, int xTilt, int yTilt, qreal tpressure, qreal rotation, int z, qint64 uid, Qt::KeyboardModifiers mods) - : InputEvent(w, time, Tablet, Qt::NoModifier), + : InputEvent(w, time, Tablet, mods), down(down), local(local), global(global), device(device), pointerType(pointerType), pressure(pressure), xTilt(xTilt), yTilt(yTilt), tangentialPressure(tpressure), - rotation(rotation), z(z), uid(uid), mods(mods) { } + rotation(rotation), z(z), uid(uid) { } bool down; QPointF local; QPointF global; @@ -318,7 +318,6 @@ public: qreal rotation; int z; qint64 uid; - Qt::KeyboardModifiers mods; }; class TabletEnterProximityEvent : public InputEvent { diff --git a/src/gui/opengl/qtriangulator.cpp b/src/gui/opengl/qtriangulator.cpp index b506ffdc6a..d31c260f3d 100644 --- a/src/gui/opengl/qtriangulator.cpp +++ b/src/gui/opengl/qtriangulator.cpp @@ -220,23 +220,6 @@ static inline bool qPointIsLeftOfLine(const QPodPoint &p, const QPodPoint &v1, c return QT_PREPEND_NAMESPACE(qPointDistanceFromLine)(p, v1, v2) < 0; } -// Return: -// -1 if u < v -// 0 if u == v -// 1 if u > v -static int comparePoints(const QPodPoint &u, const QPodPoint &v) -{ - if (u.y < v.y) - return -1; - if (u.y > v.y) - return 1; - if (u.x < v.x) - return -1; - if (u.x > v.x) - return 1; - return 0; -} - //============================================================================// // QIntersectionPoint // //============================================================================// @@ -632,16 +615,6 @@ public: bool pointingUp, originallyPointingUp; }; - friend class CompareEdges; - class CompareEdges - { - public: - inline CompareEdges(ComplexToSimple *parent) : m_parent(parent) { } - bool operator () (int i, int j) const; - private: - ComplexToSimple *m_parent; - }; - struct Intersection { bool operator < (const Intersection &other) const {return other.intersectionPoint < intersectionPoint;} @@ -1654,18 +1627,6 @@ void QTriangulator<T>::ComplexToSimple::removeUnusedPoints() { } template <typename T> -bool QTriangulator<T>::ComplexToSimple::CompareEdges::operator () (int i, int j) const -{ - int cmp = comparePoints(m_parent->m_parent->m_vertices.at(m_parent->m_edges.at(i).from), - m_parent->m_parent->m_vertices.at(m_parent->m_edges.at(j).from)); - if (cmp == 0) { - cmp = comparePoints(m_parent->m_parent->m_vertices.at(m_parent->m_edges.at(i).to), - m_parent->m_parent->m_vertices.at(m_parent->m_edges.at(j).to)); - } - return cmp > 0; -} - -template <typename T> inline bool QTriangulator<T>::ComplexToSimple::Event::operator < (const Event &other) const { if (point == other.point) diff --git a/src/gui/text/qtextengine.cpp b/src/gui/text/qtextengine.cpp index 6a749cfe84..bf83b8f862 100644 --- a/src/gui/text/qtextengine.cpp +++ b/src/gui/text/qtextengine.cpp @@ -1853,7 +1853,7 @@ void QTextEngine::justify(const QScriptLine &line) itemize(); if (!forceJustification) { - int end = line.from + (int)line.length; + int end = line.from + (int)line.length + line.trailingSpaces; if (end == layoutData->string.length()) return; // no justification at end of paragraph if (end && layoutData->items[findItem(end-1)].analysis.flags == QScriptAnalysis::LineOrParagraphSeparator) @@ -1908,6 +1908,8 @@ void QTextEngine::justify(const QScriptLine &line) int gs = log_clusters[start]; int ge = (end == length(firstItem+i) ? si.num_glyphs : log_clusters[end]); + Q_ASSERT(ge <= si.num_glyphs); + const QGlyphLayout g = shapedGlyphs(&si); for (int i = gs; i < ge; ++i) { |