From d6ebb3db16a11eb7c266419f0a7e19b9ceb0f7d9 Mon Sep 17 00:00:00 2001 From: Morten Johan Sorvig Date: Fri, 2 Mar 2012 12:04:02 +0100 Subject: Fix the compat handleWheelEvent function. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Only set the angleDelta QPoint when the platform sends a delta/orientation pair. Change-Id: I0440dca8b290bce10830c04ba42c5c955cd8e001 Reviewed-by: Luis Gabriel Lima Reviewed-by: Morten Johan Sørvig --- src/gui/kernel/qwindowsysteminterface_qpa.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/gui') diff --git a/src/gui/kernel/qwindowsysteminterface_qpa.cpp b/src/gui/kernel/qwindowsysteminterface_qpa.cpp index 9ab91d65d5..1953ce47bb 100644 --- a/src/gui/kernel/qwindowsysteminterface_qpa.cpp +++ b/src/gui/kernel/qwindowsysteminterface_qpa.cpp @@ -225,7 +225,7 @@ void QWindowSystemInterface::handleWheelEvent(QWindow *w, const QPointF & local, void QWindowSystemInterface::handleWheelEvent(QWindow *tlw, ulong timestamp, const QPointF & local, const QPointF & global, int d, Qt::Orientation o, Qt::KeyboardModifiers mods) { QPoint point = (o == Qt::Vertical) ? QPoint(0, d) : QPoint(d, 0); - handleWheelEvent(tlw, timestamp, local, global, point, point, mods); + handleWheelEvent(tlw, timestamp, local, global, QPoint(), point, mods); } void QWindowSystemInterface::handleWheelEvent(QWindow *w, const QPointF & local, const QPointF & global, QPoint pixelDelta, QPoint angleDelta, Qt::KeyboardModifiers mods) -- cgit v1.2.3 From 477c43260eea8461dff1e0e8acb4b61a1600518a Mon Sep 17 00:00:00 2001 From: Frederik Gladhorn Date: Mon, 30 Jan 2012 18:52:46 +0100 Subject: Accessibility: add text update events MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: Iece9d100b3f5a379d7d8e29dea67a10d0c918c06 Reviewed-by: Jan-Arve Sæther --- src/gui/accessible/qaccessible.cpp | 14 ++-- src/gui/accessible/qaccessible.h | 147 ++++++++++++++++++++++++++++++++++++- 2 files changed, 150 insertions(+), 11 deletions(-) (limited to 'src/gui') diff --git a/src/gui/accessible/qaccessible.cpp b/src/gui/accessible/qaccessible.cpp index 59794a5a06..561aa83142 100644 --- a/src/gui/accessible/qaccessible.cpp +++ b/src/gui/accessible/qaccessible.cpp @@ -268,16 +268,16 @@ QT_BEGIN_NAMESPACE row's header, has been changed. \value TableRowHeaderChanged A table row header has been changed. \value TableSummaryChanged The summary of a table has been changed. - \value TextAttributeChanged - \value TextCaretMoved The caret has moved in an editable widget. + \omitvalue TextAttributeChanged + \omitvalue TextCaretMoved The caret has moved in an editable widget. The caret represents the cursor position in an editable widget with the input focus. \value TextColumnChanged A text column has been changed. - \value TextInserted Text has been inserted into an editable widget. - \value TextRemoved Text has been removed from an editable widget. - \value TextSelectionChanged The selected text has changed in an editable widget. - \value TextUpdated The text has been update in an editable widget. - \value ValueChanged The QAccessible::Value of an object has changed. + \omitvalue TextInserted Text has been inserted into an editable widget. + \omitvalue TextRemoved Text has been removed from an editable widget. + \omitvalue TextSelectionChanged The selected text has changed in an editable widget. + \omitvalue TextUpdated The text has been update in an editable widget. + \omitvalue ValueChanged The QAccessible::Value of an object has changed. \value VisibleDataChanged The values for this enum are defined to be the same as those defined in the diff --git a/src/gui/accessible/qaccessible.h b/src/gui/accessible/qaccessible.h index 4d79fe78ee..a5ec8071b8 100644 --- a/src/gui/accessible/qaccessible.h +++ b/src/gui/accessible/qaccessible.h @@ -145,7 +145,9 @@ public: ParentChanged = 0x800F, HelpChanged = 0x80A0, DefaultActionChanged = 0x80B0, - AcceleratorChanged = 0x80C0 + AcceleratorChanged = 0x80C0, + + InvalidEvent }; // 64 bit enums seem hard on some platforms (windows...) @@ -436,6 +438,15 @@ public: : m_type(typ), m_object(obj), m_child(chld) { Q_ASSERT(obj); + // All events below have a subclass of QAccessibleEvent. + // Use the subclass, since it's expected that it's possible to cast to that. + Q_ASSERT(m_type != QAccessible::ValueChanged); + Q_ASSERT(m_type != QAccessible::StateChanged); + Q_ASSERT(m_type != QAccessible::TextCaretMoved); + Q_ASSERT(m_type != QAccessible::TextSelectionChanged); + Q_ASSERT(m_type != QAccessible::TextInserted); + Q_ASSERT(m_type != QAccessible::TextRemoved); + Q_ASSERT(m_type != QAccessible::TextUpdated); } virtual ~QAccessibleEvent() @@ -448,7 +459,6 @@ public: QAccessibleInterface *accessibleInterface() const; protected: - QAccessible::Event m_type; QObject *m_object; int m_child; @@ -458,8 +468,10 @@ class Q_GUI_EXPORT QAccessibleStateChangeEvent :public QAccessibleEvent { public: inline QAccessibleStateChangeEvent(QAccessible::State state, QObject *obj, int chld = -1) - : QAccessibleEvent(QAccessible::StateChanged, obj, chld), m_changedStates(state) - {} + : QAccessibleEvent(QAccessible::InvalidEvent, obj, chld), m_changedStates(state) + { + m_type = QAccessible::StateChanged; + } QAccessible::State changedStates() const { return m_changedStates; @@ -469,6 +481,133 @@ protected: QAccessible::State m_changedStates; }; +// Update the cursor and optionally the selection. +class Q_GUI_EXPORT QAccessibleTextCursorEvent : public QAccessibleEvent +{ +public: + inline QAccessibleTextCursorEvent(int cursorPos, QObject *obj, int chld = -1) + : QAccessibleEvent(QAccessible::InvalidEvent, obj, chld) + , m_cursorPosition(cursorPos) + { + m_type = QAccessible::TextCaretMoved; + } + + void setCursorPosition(int position) { m_cursorPosition = position; } + int cursorPosition() const { return m_cursorPosition; } + +protected: + int m_cursorPosition; +}; + +// Updates the cursor position simultaneously. By default the cursor is set to the end of the selection. +class Q_GUI_EXPORT QAccessibleTextSelectionEvent : public QAccessibleTextCursorEvent +{ +public: + inline QAccessibleTextSelectionEvent(int start, int end, QObject *obj, int chld = -1) + : QAccessibleTextCursorEvent((start == -1) ? 0 : end, obj, chld) + , m_selectionStart(start), m_selectionEnd(end) + { + m_type = QAccessible::TextSelectionChanged; + } + + void setSelection(int start, int end) { + m_selectionStart = start; + m_selectionEnd = end; + } + + int selectionStart() const { return m_selectionStart; } + int selectionEnd() const { return m_selectionEnd; } + +protected: + int m_selectionStart; + int m_selectionEnd; +}; + +class Q_GUI_EXPORT QAccessibleTextInsertEvent : public QAccessibleTextCursorEvent +{ +public: + inline QAccessibleTextInsertEvent(int position, const QString &text, QObject *obj, int chld = -1) + : QAccessibleTextCursorEvent(position + text.length(), obj, chld) + , m_position(position), m_text(text) + { + m_type = QAccessible::TextInserted; + } + + QString textInserted() const { + return m_text; + } + int changePosition() const { + return m_position; + } + +protected: + int m_position; + QString m_text; +}; + +class Q_GUI_EXPORT QAccessibleTextRemoveEvent : public QAccessibleTextCursorEvent +{ +public: + inline QAccessibleTextRemoveEvent(int position, const QString &text, QObject *obj, int chld = -1) + : QAccessibleTextCursorEvent(position, obj, chld) + , m_position(position), m_text(text) + { + m_type = QAccessible::TextRemoved; + } + + QString textRemoved() const { + return m_text; + } + int changePosition() const { + return m_position; + } + +protected: + int m_position; + QString m_text; +}; + +class Q_GUI_EXPORT QAccessibleTextUpdateEvent : public QAccessibleTextCursorEvent +{ +public: + inline QAccessibleTextUpdateEvent(int position, const QString &oldText, const QString &text, QObject *obj, int chld = -1) + : QAccessibleTextCursorEvent(position + text.length(), obj, chld) + , m_position(position), m_oldText(oldText), m_text(text) + { + m_type = QAccessible::TextUpdated; + } + QString textRemoved() const { + return m_oldText; + } + QString textInserted() const { + return m_text; + } + int changePosition() const { + return m_position; + } + +protected: + int m_position; + QString m_oldText; + QString m_text; +}; + +class Q_GUI_EXPORT QAccessibleValueChangeEvent : public QAccessibleEvent +{ +public: + inline QAccessibleValueChangeEvent(const QVariant &val, QObject *obj, int chld = -1) + : QAccessibleEvent(QAccessible::InvalidEvent, obj, chld) + , m_value(val) + { + m_type = QAccessible::ValueChanged; + } + + void setValue(const QVariant & val) { m_value= val; } + QVariant value() const { return m_value; } + +protected: + QVariant m_value; +}; #define QAccessibleInterface_iid "org.qt-project.Qt.QAccessibleInterface" Q_DECLARE_INTERFACE(QAccessibleInterface, QAccessibleInterface_iid) -- cgit v1.2.3 From c2e8db58413207315474232697f12ddceb8310e7 Mon Sep 17 00:00:00 2001 From: Frederik Gladhorn Date: Mon, 12 Mar 2012 19:43:03 +0100 Subject: Remove QAccessibleEvent child parameter. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This makes the api cleaner and generally the child should not be there. It is only sometimes more convenient not to create a QAccessibleInterface instance, so the functionallity is kept. Change-Id: I26018a6d3e0549f4d79856775b4167c5660e229d Reviewed-by: Jan-Arve Sæther --- src/gui/accessible/qaccessible.cpp | 3 ++- src/gui/accessible/qaccessible.h | 34 ++++++++++++++++++---------------- 2 files changed, 20 insertions(+), 17 deletions(-) (limited to 'src/gui') diff --git a/src/gui/accessible/qaccessible.cpp b/src/gui/accessible/qaccessible.cpp index 561aa83142..7b1da21095 100644 --- a/src/gui/accessible/qaccessible.cpp +++ b/src/gui/accessible/qaccessible.cpp @@ -648,7 +648,8 @@ void QAccessible::setRootObject(QObject *object) void QAccessible::updateAccessibility(QObject *object, int child, Event reason) { Q_ASSERT(object); - QAccessibleEvent ev(reason, object, child); + + QAccessibleEvent ev(object, reason); updateAccessibility(&ev); } diff --git a/src/gui/accessible/qaccessible.h b/src/gui/accessible/qaccessible.h index a5ec8071b8..91726f194b 100644 --- a/src/gui/accessible/qaccessible.h +++ b/src/gui/accessible/qaccessible.h @@ -434,8 +434,8 @@ class Q_GUI_EXPORT QAccessibleEvent { Q_DISABLE_COPY(QAccessibleEvent) public: - inline QAccessibleEvent(QAccessible::Event typ, QObject *obj, int chld = -1) - : m_type(typ), m_object(obj), m_child(chld) + inline QAccessibleEvent(QObject *obj, QAccessible::Event typ) + : m_type(typ), m_object(obj), m_child(-1) { Q_ASSERT(obj); // All events below have a subclass of QAccessibleEvent. @@ -454,6 +454,8 @@ public: QAccessible::Event type() const { return m_type; } QObject *object() const { return m_object; } + + void setChild(int chld) { m_child = chld; } int child() const { return m_child; } QAccessibleInterface *accessibleInterface() const; @@ -467,8 +469,8 @@ protected: class Q_GUI_EXPORT QAccessibleStateChangeEvent :public QAccessibleEvent { public: - inline QAccessibleStateChangeEvent(QAccessible::State state, QObject *obj, int chld = -1) - : QAccessibleEvent(QAccessible::InvalidEvent, obj, chld), m_changedStates(state) + inline QAccessibleStateChangeEvent(QObject *obj, QAccessible::State state) + : QAccessibleEvent(obj, QAccessible::InvalidEvent), m_changedStates(state) { m_type = QAccessible::StateChanged; } @@ -485,8 +487,8 @@ protected: class Q_GUI_EXPORT QAccessibleTextCursorEvent : public QAccessibleEvent { public: - inline QAccessibleTextCursorEvent(int cursorPos, QObject *obj, int chld = -1) - : QAccessibleEvent(QAccessible::InvalidEvent, obj, chld) + inline QAccessibleTextCursorEvent(QObject *obj, int cursorPos) + : QAccessibleEvent(obj, QAccessible::InvalidEvent) , m_cursorPosition(cursorPos) { m_type = QAccessible::TextCaretMoved; @@ -503,8 +505,8 @@ protected: class Q_GUI_EXPORT QAccessibleTextSelectionEvent : public QAccessibleTextCursorEvent { public: - inline QAccessibleTextSelectionEvent(int start, int end, QObject *obj, int chld = -1) - : QAccessibleTextCursorEvent((start == -1) ? 0 : end, obj, chld) + inline QAccessibleTextSelectionEvent(QObject *obj, int start, int end) + : QAccessibleTextCursorEvent(obj, (start == -1) ? 0 : end) , m_selectionStart(start), m_selectionEnd(end) { m_type = QAccessible::TextSelectionChanged; @@ -526,8 +528,8 @@ protected: class Q_GUI_EXPORT QAccessibleTextInsertEvent : public QAccessibleTextCursorEvent { public: - inline QAccessibleTextInsertEvent(int position, const QString &text, QObject *obj, int chld = -1) - : QAccessibleTextCursorEvent(position + text.length(), obj, chld) + inline QAccessibleTextInsertEvent(QObject *obj, int position, const QString &text) + : QAccessibleTextCursorEvent(obj, position + text.length()) , m_position(position), m_text(text) { m_type = QAccessible::TextInserted; @@ -548,8 +550,8 @@ protected: class Q_GUI_EXPORT QAccessibleTextRemoveEvent : public QAccessibleTextCursorEvent { public: - inline QAccessibleTextRemoveEvent(int position, const QString &text, QObject *obj, int chld = -1) - : QAccessibleTextCursorEvent(position, obj, chld) + inline QAccessibleTextRemoveEvent(QObject *obj, int position, const QString &text) + : QAccessibleTextCursorEvent(obj, position) , m_position(position), m_text(text) { m_type = QAccessible::TextRemoved; @@ -570,8 +572,8 @@ protected: class Q_GUI_EXPORT QAccessibleTextUpdateEvent : public QAccessibleTextCursorEvent { public: - inline QAccessibleTextUpdateEvent(int position, const QString &oldText, const QString &text, QObject *obj, int chld = -1) - : QAccessibleTextCursorEvent(position + text.length(), obj, chld) + inline QAccessibleTextUpdateEvent(QObject *obj, int position, const QString &oldText, const QString &text) + : QAccessibleTextCursorEvent(obj, position + text.length()) , m_position(position), m_oldText(oldText), m_text(text) { m_type = QAccessible::TextUpdated; @@ -595,8 +597,8 @@ protected: class Q_GUI_EXPORT QAccessibleValueChangeEvent : public QAccessibleEvent { public: - inline QAccessibleValueChangeEvent(const QVariant &val, QObject *obj, int chld = -1) - : QAccessibleEvent(QAccessible::InvalidEvent, obj, chld) + inline QAccessibleValueChangeEvent(QObject *obj, const QVariant &val) + : QAccessibleEvent(obj, QAccessible::InvalidEvent) , m_value(val) { m_type = QAccessible::ValueChanged; -- cgit v1.2.3 From c4ac14fae1765cae9d5ab94c8af486e2d14dede7 Mon Sep 17 00:00:00 2001 From: Olivier Goffart Date: Sat, 17 Mar 2012 19:46:33 +0100 Subject: Fix KDE palette. In QKdeTheme We want to load every color. Else, only the first color is loaded, and the rest of the palette is just black making the applications basicaly not usable. But KDE only put in its config files the colors that are different from the default colors. This is the reason why we need to resolve against the style's default palette. We need to make sure the resolve_mask is 0 for an empty palette, even before the application palette is set. This was not required in Qt4 because the system palette was initialized differently. I realize this will only work with QApplication (and not with a single QGuiApplication) but it was not working before either. Change-Id: Ifb3c2c1358ef6d83a1ca5aa8fac3d2d4ea712b94 Reviewed-by: Friedemann Kleint --- src/gui/kernel/qpalette.cpp | 1 + 1 file changed, 1 insertion(+) (limited to 'src/gui') diff --git a/src/gui/kernel/qpalette.cpp b/src/gui/kernel/qpalette.cpp index 9a2eb12e3f..ab62ec0992 100644 --- a/src/gui/kernel/qpalette.cpp +++ b/src/gui/kernel/qpalette.cpp @@ -524,6 +524,7 @@ QPalette::QPalette() } else { init(); qt_palette_from_color(*this, Qt::black); + resolve_mask = 0; } } -- cgit v1.2.3 From 7165e6803306ec66a41db3f5db53a8134a41559a Mon Sep 17 00:00:00 2001 From: Sean Harmer Date: Tue, 20 Mar 2012 14:07:39 +0000 Subject: Set the default QPA plugin for QNX builds to "qnx" Change-Id: I630c3631d480929c1e3a618d0f0b084fd2cc6ad0 Reviewed-by: Kevin Krammer Reviewed-by: Friedemann Kleint --- src/gui/kernel/qguiapplication.cpp | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/gui') diff --git a/src/gui/kernel/qguiapplication.cpp b/src/gui/kernel/qguiapplication.cpp index d72647091d..df3371b236 100644 --- a/src/gui/kernel/qguiapplication.cpp +++ b/src/gui/kernel/qguiapplication.cpp @@ -506,6 +506,8 @@ static void init_platform(const QString &pluginArgument, const QString &platform const QString defaultPlatform = QLatin1String("cocoa"); #elif defined (Q_OS_WIN) const QString defaultPlatform = QLatin1String("windows"); +#elif defined (Q_OS_QNX) + const QString defaultPlatform = QLatin1String("qnx"); #elif !defined (QT_NO_XCB) const QString defaultPlatform = QLatin1String("xcb"); #elif !defined (QT_NO_WAYLAND) -- cgit v1.2.3 From b936b959650128bb8befaaa069477629105c680d Mon Sep 17 00:00:00 2001 From: Donald Carr Date: Wed, 7 Mar 2012 14:07:07 +0000 Subject: EGLFS: Integrate building into configure. With the move to the QPA architecture EGL is now only required by individual platform plugins and the configure script has been adjusted to reflect this. Change-Id: Ieadacef0b970f29752d9e3e36a007e5cbb005b0d Reviewed-by: Oswald Buddenhagen Reviewed-by: Girish Ramakrishnan --- src/gui/kernel/qguiapplication.cpp | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/gui') diff --git a/src/gui/kernel/qguiapplication.cpp b/src/gui/kernel/qguiapplication.cpp index df3371b236..fe1c93ea29 100644 --- a/src/gui/kernel/qguiapplication.cpp +++ b/src/gui/kernel/qguiapplication.cpp @@ -512,6 +512,8 @@ static void init_platform(const QString &pluginArgument, const QString &platform const QString defaultPlatform = QLatin1String("xcb"); #elif !defined (QT_NO_WAYLAND) const QString defaultPlatform = QLatin1String("wayland"); +#elif !defined (QT_NO_EGLFS) + const QString defaultPlatform = QLatin1String("eglfs"); #else const QString defaultPlatform = QLatin1String("minimal"); #endif -- cgit v1.2.3 From 2cc5442b0263a449f4f5eb0cbf99e419ee0d0d38 Mon Sep 17 00:00:00 2001 From: Jiang Jiang Date: Tue, 20 Mar 2012 11:57:35 +0100 Subject: Remove hardcoded font names in QFont::defaultFamily() QFont::defaultFamily() should not use any hardcoded font names like "Helvetica" or "Times" as they might not be present in certain systems, it should rather use abstract names like "sans-serif", "serif" and "monospace" then let the platform plugin to decide which font map to them. Change-Id: I5aafb103a5238c17b10773711ad504806c6fc3ce Reviewed-by: Eskil Abrahamsen Blomfeldt --- src/gui/text/qfont_qpa.cpp | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) (limited to 'src/gui') diff --git a/src/gui/text/qfont_qpa.cpp b/src/gui/text/qfont_qpa.cpp index 29ba7767bc..6576f237c4 100644 --- a/src/gui/text/qfont_qpa.cpp +++ b/src/gui/text/qfont_qpa.cpp @@ -77,28 +77,29 @@ QString QFont::defaultFamily() const { QString familyName; switch(d->request.styleHint) { - case QFont::Times: - familyName = QString::fromLatin1("Times"); + case QFont::SansSerif: + familyName = QString::fromLatin1("sans-serif"); break; - case QFont::Courier: - familyName = QString::fromLatin1("Courier"); + case QFont::Serif: + familyName = QString::fromLatin1("serif"); break; + case QFont::TypeWriter: case QFont::Monospace: - familyName = QString::fromLatin1("Courier New"); + familyName = QString::fromLatin1("monospace"); break; case QFont::Cursive: - familyName = QString::fromLatin1("Comic Sans MS"); + familyName = QString::fromLatin1("cursive"); break; case QFont::Fantasy: - familyName = QString::fromLatin1("Impact"); + familyName = QString::fromLatin1("fantasy"); break; case QFont::Decorative: - familyName = QString::fromLatin1("Old English"); + familyName = QString::fromLatin1("decorative"); break; - case QFont::Helvetica: case QFont::System: default: - familyName = QString::fromLatin1("Helvetica"); + familyName = QString(); + break; } return QGuiApplicationPrivate::platformIntegration()->fontDatabase()->resolveFontFamilyAlias(familyName); -- cgit v1.2.3 From 5ec17700fa0935ab9a2732c47fbf88fea3be825b Mon Sep 17 00:00:00 2001 From: Debao Zhang Date: Wed, 21 Mar 2012 21:57:26 -0700 Subject: Remove redundant \since 5.0 \since 5.0 has been add to the class section, so member functions and properties donot need this any more. see SHA: 5728c8a8e7c994b931d340315c241350d646f62a Change-Id: I4e67461373dda99ee1fbfdeb6477fde1dcfec116 Reviewed-by: Casper van Donderen --- src/gui/kernel/qguiapplication.cpp | 6 ------ src/gui/kernel/qscreen.cpp | 1 - src/gui/kernel/qwindow.cpp | 7 ------- 3 files changed, 14 deletions(-) (limited to 'src/gui') diff --git a/src/gui/kernel/qguiapplication.cpp b/src/gui/kernel/qguiapplication.cpp index fe1c93ea29..5611296385 100644 --- a/src/gui/kernel/qguiapplication.cpp +++ b/src/gui/kernel/qguiapplication.cpp @@ -478,7 +478,6 @@ QWindow *QGuiApplication::topLevelAt(const QPoint &pos) /*! \property QGuiApplication::platformName \brief The name of the underlying platform plugin. - \since 5.0 */ QString QGuiApplication::platformName() @@ -1959,8 +1958,6 @@ void QGuiApplication::restoreOverrideCursor() #endif// QT_NO_CURSOR /*! - \since 5.0 - Returns the application's style hints. The style hints encapsulate a set of platform dependent properties @@ -2014,8 +2011,6 @@ QInputMethod *QGuiApplication::inputMethod() const } /*! - \since 5.0 - returns the input panel. The input panel returns properties about the state and position of @@ -2030,7 +2025,6 @@ QInputPanel *QGuiApplication::inputPanel() const } /*! - \since 4.5 \fn void QGuiApplication::fontDatabaseChanged() This signal is emitted when application fonts are loaded or removed. diff --git a/src/gui/kernel/qscreen.cpp b/src/gui/kernel/qscreen.cpp index 5d7ffdbc2b..ce26b9dd93 100644 --- a/src/gui/kernel/qscreen.cpp +++ b/src/gui/kernel/qscreen.cpp @@ -578,7 +578,6 @@ void QScreenPrivate::updatePrimaryOrientation() \warning In general, grabbing an area outside the screen is not safe. This depends on the underlying window system. - \since 5.0 */ QPixmap QScreen::grabWindow(WId window, int x, int y, int w, int h) const diff --git a/src/gui/kernel/qwindow.cpp b/src/gui/kernel/qwindow.cpp index 78b6f6f722..18fd72cfa2 100644 --- a/src/gui/kernel/qwindow.cpp +++ b/src/gui/kernel/qwindow.cpp @@ -212,7 +212,6 @@ QWindow::SurfaceType QWindow::surfaceType() const /*! \property QWindow::visible \brief whether the window is visible or not - \since 5.0 This property controls the visibility of the window in the windowing system. @@ -484,7 +483,6 @@ Qt::WindowType QWindow::windowType() const /*! \property QWindow::windowTitle \brief the window's title in the windowing system - \since 5.0 The window title might appear in the title area of the window decorations, depending on the windowing system and the window flags. It might also @@ -615,7 +613,6 @@ bool QWindow::isActive() const /*! \property QWindow::contentOrientation - \since 5.0 \brief the orientation of the window's contents This is a hint to the window manager in case it needs to display @@ -935,25 +932,21 @@ void QWindow::setGeometry(const QRect &rect) /*! \property QWindow::x - \since 5.0 \brief the x position of the window's geometry */ /*! \property QWindow::y - \since 5.0 \brief the y position of the window's geometry */ /*! \property QWindow::width - \since 5.0 \brief the width of the window's geometry */ /*! \property QWindow::height - \since 5.0 \brief the height of the window's geometry */ -- cgit v1.2.3 From 7e90df7bf5aafd09ea5ed8bcc370db6a8912d173 Mon Sep 17 00:00:00 2001 From: Pekka Vuorela Date: Thu, 1 Mar 2012 16:54:50 +0200 Subject: FocusAboutToChange event to be send before focus changes Focus change happen as: FocusAboutToChange event -> focus change -> FocusOut event -> FocusIn event. Input method need to have focus when calling commit(). Notification on focus about to be lost allows QWindow implementations to commit in time. Also changes QWidget documentation to match code reality. Change-Id: I17a8a374a33dd700909f79e370b42348869261a6 Reviewed-by: Gunnar Sletta --- src/gui/kernel/qguiapplication.cpp | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'src/gui') diff --git a/src/gui/kernel/qguiapplication.cpp b/src/gui/kernel/qguiapplication.cpp index 5611296385..e12183869a 100644 --- a/src/gui/kernel/qguiapplication.cpp +++ b/src/gui/kernel/qguiapplication.cpp @@ -1155,13 +1155,20 @@ void QGuiApplicationPrivate::processLeaveEvent(QWindowSystemInterfacePrivate::Le void QGuiApplicationPrivate::processActivatedEvent(QWindowSystemInterfacePrivate::ActivatedWindowEvent *e) { QWindow *previous = QGuiApplicationPrivate::focus_window; - QGuiApplicationPrivate::focus_window = e->activated.data(); + QWindow *newFocus = e->activated.data(); - if (previous == QGuiApplicationPrivate::focus_window) + if (previous == newFocus) return; QObject *previousFocusObject = previous ? previous->focusObject() : 0; + if (previous) { + QFocusEvent focusAboutToChange(QEvent::FocusAboutToChange); + QCoreApplication::sendSpontaneousEvent(previous, &focusAboutToChange); + } + + QGuiApplicationPrivate::focus_window = newFocus; + if (previous) { QFocusEvent focusOut(QEvent::FocusOut); QCoreApplication::sendSpontaneousEvent(previous, &focusOut); -- cgit v1.2.3 From 787da35eb84a19f9c2b8d59b7ab93e78dd5e7cfd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Samuel=20R=C3=B8dal?= Date: Mon, 19 Mar 2012 14:05:41 +0100 Subject: Fixed QInputMethod API to use isVisible() instead of visible(). Deprecate the old API for now as not to break existing usages. Change-Id: I7abbbbe8a34951282537a9d74cded03743f44df7 Reviewed-by: Pekka Vuorela Reviewed-by: Lars Knoll --- src/gui/kernel/qinputmethod.cpp | 2 +- src/gui/kernel/qinputmethod.h | 8 ++++++-- 2 files changed, 7 insertions(+), 3 deletions(-) (limited to 'src/gui') diff --git a/src/gui/kernel/qinputmethod.cpp b/src/gui/kernel/qinputmethod.cpp index 9e724446ff..23ab8535a0 100644 --- a/src/gui/kernel/qinputmethod.cpp +++ b/src/gui/kernel/qinputmethod.cpp @@ -215,7 +215,7 @@ void QInputMethod::hide() \sa show(), hide() */ -bool QInputMethod::visible() const +bool QInputMethod::isVisible() const { Q_D(const QInputMethod); QPlatformInputContext *ic = d->platformInputContext(); diff --git a/src/gui/kernel/qinputmethod.h b/src/gui/kernel/qinputmethod.h index 0acddc05e2..92ae016b97 100644 --- a/src/gui/kernel/qinputmethod.h +++ b/src/gui/kernel/qinputmethod.h @@ -62,7 +62,7 @@ class Q_GUI_EXPORT QInputMethod : public QObject Q_PROPERTY(QObject *inputItem READ inputItem WRITE setInputItem NOTIFY inputItemChanged) Q_PROPERTY(QRectF cursorRectangle READ cursorRectangle NOTIFY cursorRectangleChanged) Q_PROPERTY(QRectF keyboardRectangle READ keyboardRectangle NOTIFY keyboardRectangleChanged) - Q_PROPERTY(bool visible READ visible NOTIFY visibleChanged) + Q_PROPERTY(bool visible READ isVisible NOTIFY visibleChanged) Q_PROPERTY(bool animating READ isAnimating NOTIFY animatingChanged) Q_PROPERTY(QLocale locale READ locale NOTIFY localeChanged) Q_PROPERTY(Qt::LayoutDirection inputDirection READ inputDirection NOTIFY inputDirectionChanged) @@ -89,7 +89,11 @@ public: ContextMenu }; - bool visible() const; +#if QT_DEPRECATED_SINCE(5,0) + QT_DEPRECATED bool visible() const { return isVisible(); } +#endif + + bool isVisible() const; void setVisible(bool visible); bool isAnimating() const; -- cgit v1.2.3 From fa8e18c3860d8c43795152da1d4c38dc1471f320 Mon Sep 17 00:00:00 2001 From: Damir Tatalovic Date: Fri, 2 Mar 2012 17:43:52 +0100 Subject: MIPS DSP configure detection and initial blend optimizations. Adds new MIPS configure test and -no-mips_dsp and -no-mips_dspr2 configure options. List of optimized implementations: - comp_func_SourceOver - comp_func_Source - qt_memfill32 - qt_destFetchARGB32 - qt_destStoreARGB32 - blend [RGB32][RGB32] - blend [ARGB32_Pre][RGB32] - blend [RGB32][ARGB32_Pre] - blend [ARGB32_Pre][ARGB32_Pre] Change-Id: I35411858295b7b3f4895eb56e3b93397528903cc Reviewed-by: Thiago Macieira --- src/gui/gui.pro | 22 +- src/gui/painting/painting.pri | 5 + src/gui/painting/qdrawhelper.cpp | 19 ++ src/gui/painting/qdrawhelper_mips_dsp.cpp | 176 +++++++++++ src/gui/painting/qdrawhelper_mips_dsp_asm.S | 424 ++++++++++++++++++++++++++ src/gui/painting/qdrawhelper_mips_dsp_p.h | 78 +++++ src/gui/painting/qdrawhelper_mips_dspr2_asm.S | 95 ++++++ src/gui/painting/qt_mips_asm_dsp.h | 113 +++++++ 8 files changed, 931 insertions(+), 1 deletion(-) create mode 100644 src/gui/painting/qdrawhelper_mips_dsp.cpp create mode 100644 src/gui/painting/qdrawhelper_mips_dsp_asm.S create mode 100644 src/gui/painting/qdrawhelper_mips_dsp_p.h create mode 100644 src/gui/painting/qdrawhelper_mips_dspr2_asm.S create mode 100644 src/gui/painting/qt_mips_asm_dsp.h (limited to 'src/gui') diff --git a/src/gui/gui.pro b/src/gui/gui.pro index e6a820b5c4..1fb3790254 100644 --- a/src/gui/gui.pro +++ b/src/gui/gui.pro @@ -151,4 +151,24 @@ win32:!contains(QT_CONFIG, directwrite) { sse2: SOURCES += $$SSE2_SOURCES ssse3: SOURCES += $$SSSE3_SOURCES iwmmxt: SOURCES += $$IWMMXT_SOURCES - } \ No newline at end of file + } + +mips_dsp:*-g++* { + DEFINES += QT_HAVE_MIPS_DSP + HEADERS += $$MIPS_DSP_HEADERS + + DRAWHELPER_MIPS_DSP_ASM_FILES = $$MIPS_DSP_ASM + mips_dspr2 { + DEFINES += QT_HAVE_MIPS_DSPR2 + DRAWHELPER_MIPS_DSP_ASM_FILES += $$MIPS_DSPR2_ASM + } + mips_dsp_compiler.commands = $$QMAKE_CXX -c + mips_dsp_compiler.commands += $(CXXFLAGS) $(INCPATH) ${QMAKE_FILE_IN} -o ${QMAKE_FILE_OUT} + mips_dsp_compiler.dependency_type = TYPE_C + mips_dsp_compiler.output = ${QMAKE_VAR_OBJECTS_DIR}${QMAKE_FILE_BASE}$${first(QMAKE_EXT_OBJ)} + mips_dsp_compiler.input = DRAWHELPER_MIPS_DSP_ASM_FILES MIPS_DSP_SOURCES + mips_dsp_compiler.variable_out = OBJECTS + mips_dsp_compiler.name = compiling[mips_dsp] ${QMAKE_FILE_IN} + silent:mips_dsp_compiler.commands = @echo compiling[mips_dsp] ${QMAKE_FILE_IN} && $$mips_dsp_compiler.commands + QMAKE_EXTRA_COMPILERS += mips_dsp_compiler +} diff --git a/src/gui/painting/painting.pri b/src/gui/painting/painting.pri index 4cd2351b23..3ce2e5b258 100644 --- a/src/gui/painting/painting.pri +++ b/src/gui/painting/painting.pri @@ -109,4 +109,9 @@ NEON_SOURCES += painting/qdrawhelper_neon.cpp NEON_HEADERS += painting/qdrawhelper_neon_p.h NEON_ASM += ../3rdparty/pixman/pixman-arm-neon-asm.S painting/qdrawhelper_neon_asm.S +MIPS_DSP_SOURCES += painting/qdrawhelper_mips_dsp.cpp +MIPS_DSP_HEADERS += painting/qdrawhelper_mips_dsp_p.h painting/qt_mips_asm_dsp.h +MIPS_DSP_ASM += painting/qdrawhelper_mips_dsp_asm.S +MIPS_DSPR2_ASM += painting/qdrawhelper_mips_dspr2_asm.S + include($$PWD/../../3rdparty/zlib_dependency.pri) diff --git a/src/gui/painting/qdrawhelper.cpp b/src/gui/painting/qdrawhelper.cpp index 0491a3deaf..9877dc6b9e 100644 --- a/src/gui/painting/qdrawhelper.cpp +++ b/src/gui/painting/qdrawhelper.cpp @@ -47,6 +47,9 @@ #include #endif #include +#ifdef QT_HAVE_MIPS_DSP +#include +#endif #include #include @@ -6057,6 +6060,22 @@ void qInitDrawhelperAsm() } #endif +#if defined(QT_HAVE_MIPS_DSP) + functionForMode_C[QPainter::CompositionMode_SourceOver] = comp_func_SourceOver_asm_mips_dsp; + functionForMode_C[QPainter::CompositionMode_Source] = comp_func_Source_mips_dsp; + + qt_memfill32 = qt_memfill32_asm_mips_dsp; + + qBlendFunctions[QImage::Format_RGB32][QImage::Format_RGB32] = qt_blend_rgb32_on_rgb32_mips_dsp; + qBlendFunctions[QImage::Format_ARGB32_Premultiplied][QImage::Format_RGB32] = qt_blend_rgb32_on_rgb32_mips_dsp; + qBlendFunctions[QImage::Format_RGB32][QImage::Format_ARGB32_Premultiplied] = qt_blend_argb32_on_argb32_mips_dsp; + qBlendFunctions[QImage::Format_ARGB32_Premultiplied][QImage::Format_ARGB32_Premultiplied] = qt_blend_argb32_on_argb32_mips_dsp; + + destFetchProc[QImage::Format_ARGB32] = qt_destFetchARGB32_mips_dsp; + + destStoreProc[QImage::Format_ARGB32] = qt_destStoreARGB32_mips_dsp; + +#endif // QT_HAVE_MIPS_DSP if (functionForModeSolidAsm) { const int destinationMode = QPainter::CompositionMode_Destination; functionForModeSolidAsm[destinationMode] = functionForModeSolid_C[destinationMode]; diff --git a/src/gui/painting/qdrawhelper_mips_dsp.cpp b/src/gui/painting/qdrawhelper_mips_dsp.cpp new file mode 100644 index 0000000000..9b104eb5c9 --- /dev/null +++ b/src/gui/painting/qdrawhelper_mips_dsp.cpp @@ -0,0 +1,176 @@ +/**************************************************************************** +** +** Copyright (C) 2012 MIPS Technologies, www.mips.com, author Damir Tatalovic +** Contact: http://www.qt-project.org/ +** +** This file is part of the QtGui module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** GNU Lesser General Public License Usage +** This file may be used under the terms of the GNU Lesser General Public +** License version 2.1 as published by the Free Software Foundation and +** appearing in the file LICENSE.LGPL included in the packaging of this +** file. Please review the following information to ensure the GNU Lesser +** General Public License version 2.1 requirements will be met: +** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU General +** Public License version 3.0 as published by the Free Software Foundation +** and appearing in the file LICENSE.GPL included in the packaging of this +** file. Please review the following information to ensure the GNU General +** Public License version 3.0 requirements will be met: +** http://www.gnu.org/copyleft/gpl.html. +** +** Other Usage +** Alternatively, this file may be used in accordance with the terms and +** conditions contained in a signed written agreement between you and Nokia. +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include +#include +#include + +QT_BEGIN_NAMESPACE + +#if defined(QT_HAVE_MIPS_DSP) + +extern "C" uint INTERPOLATE_PIXEL_255_asm_mips_dsp(uint x, uint a, uint y, uint b); + +extern "C" uint BYTE_MUL_asm_mips_dsp(uint x, uint a); + +extern "C" uint * destfetchARGB32_asm_mips_dsp(uint *buffer, const uint *data, int length); + +extern "C" uint * qt_destStoreARGB32_asm_mips_dsp(uint *buffer, const uint *data, int length); + +#if defined(QT_HAVE_MIPS_DSPR2) + +extern "C" uint INTERPOLATE_PIXEL_255_asm_mips_dspr2(uint x, uint a, uint y, uint b); + +extern "C" uint BYTE_MUL_asm_mips_dspr2(uint x, uint a); + +#endif // QT_HAVE_MIPS_DSPR2 + +void qt_blend_argb32_on_argb32_mips_dsp(uchar *destPixels, int dbpl, + const uchar *srcPixels, int sbpl, + int w, int h, + int const_alpha) + +{ +#ifdef QT_DEBUG_DRAW + fprintf(stdout, + "qt_blend_argb32_on_argb32: dst=(%p, %d), src=(%p, %d), dim=(%d, %d) alpha=%d\n", + destPixels, dbpl, srcPixels, sbpl, w, h, const_alpha); + fflush(stdout); +#endif + + const uint *src = (const uint *) srcPixels; + uint *dst = (uint *) destPixels; + if (const_alpha == 256) { + for (int y=0; y= 0xff000000) + dst[x] = s; + else if (s != 0) +#if !defined(QT_HAVE_MIPS_DSPR2) + dst[x] = s + BYTE_MUL_asm_mips_dsp(dst[x], qAlpha(~s)); +#else + dst[x] = s + BYTE_MUL_asm_mips_dspr2(dst[x], qAlpha(~s)); +#endif + } + dst = (quint32 *)(((uchar *) dst) + dbpl); + src = (const quint32 *)(((const uchar *) src) + sbpl); + } + } else if (const_alpha != 0) { + const_alpha = (const_alpha * 255) >> 8; + for (int y=0; yscanLine(y) + x; + buffer = destfetchARGB32_asm_mips_dsp(buffer, data, length); + return buffer; +} + +void QT_FASTCALL qt_destStoreARGB32_mips_dsp(QRasterBuffer *rasterBuffer, int x, int y, + const uint *buffer, int length) +{ + uint *data = (uint *)rasterBuffer->scanLine(y) + x; + qt_destStoreARGB32_asm_mips_dsp(data, buffer, length); +} + +#endif // QT_HAVE_MIPS_DSP + +QT_END_NAMESPACE diff --git a/src/gui/painting/qdrawhelper_mips_dsp_asm.S b/src/gui/painting/qdrawhelper_mips_dsp_asm.S new file mode 100644 index 0000000000..f426905aad --- /dev/null +++ b/src/gui/painting/qdrawhelper_mips_dsp_asm.S @@ -0,0 +1,424 @@ +/**************************************************************************** +** +** Copyright (C) 2012 MIPS Technologies, www.mips.com, author Damir Tatalovic +** Contact: http://www.qt-project.org/ +** +** This file is part of the QtGui module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** GNU Lesser General Public License Usage +** This file may be used under the terms of the GNU Lesser General Public +** License version 2.1 as published by the Free Software Foundation and +** appearing in the file LICENSE.LGPL included in the packaging of this +** file. Please review the following information to ensure the GNU Lesser +** General Public License version 2.1 requirements will be met: +** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU General +** Public License version 3.0 as published by the Free Software Foundation +** and appearing in the file LICENSE.GPL included in the packaging of this +** file. Please review the following information to ensure the GNU General +** Public License version 3.0 requirements will be met: +** http://www.gnu.org/copyleft/gpl.html. +** +** Other Usage +** Alternatively, this file may be used in accordance with the terms and +** conditions contained in a signed written agreement between you and Nokia. +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include "qt_mips_asm_dsp.h" + +LEAF_MIPS_DSP(INTERPOLATE_PIXEL_255_asm_mips_dsp) +/* + * a0 - uint x (First value to multiply) + * a1 - uint a (Multiplicator byte for first value) + * a2 - uint y (Second value to multiply) + * a3 - uint b (Multiplicator byte for second value) + */ + + .set reorder + li t4, 8388736 + preceu.ph.qbra t0, a0 /* (x & 0xff00ff) */ + mul t0, t0, a1 /* (x & 0xff00ff) * a */ + preceu.ph.qbra t1, a2 /* (y & 0xff00ff) */ + mul t1, t1, a3 /* (y & 0xff00ff) * b */ + addu t0, t0, t1 /* (x & 0xff00ff) * a + + * (y & 0xff00ff) * b + */ + preceu.ph.qbla t1, t0 /* (t >> 8) & 0xff00ff */ + addu t0, t0, t1 /* t + ((t >> 8) & 0xff00ff */ + addu t0, t0, t4 /* t + ((t >> 8) & 0xff00ff) + 0x800080 */ + preceu.ph.qbla t0, t0 /* t >> 8 and t&=0xff00ff */ + preceu.ph.qbla t2, a0 /* (x>>8) & 0xff00ff */ + mul t2, t2, a1 /* ((x>>8) & 0xff00ff) * a */ + preceu.ph.qbla t3, a2 /* ((y>>8) & 0xff00ff) */ + mul t3, t3, a3 /* ((y>>8) & 0xff00ff) * b */ + addu t2, t2, t3 /* ((x>>8) & 0xff00ff) * a + + * ((y >> 8) & 0xff00ff) * b + */ + preceu.ph.qbla t3, t2 /* (x>>8) & 0xff00ff */ + addu t2, t2, t3 /* (x>>8) & 0xff00ff) + 0x800080 */ + addu t2, t2, t4 /* x + ((x>>8) & 0xff00ff) + 0x800080 */ + and t2, t2, 0xff00ff00 + or t1, t0, t2 + move v0, t1 + j ra + +END(INTERPOLATE_PIXEL_255_asm_mips_dsp) + +LEAF_MIPS_DSP(BYTE_MUL_asm_mips_dsp) +/* + * a0 - uint x (Value to multiply) + * a1 - uint a (Multiplicator byte) + */ + + .set reorder + replv.ph a1, a1 /* a1 = 0x00a00a */ + li t4, 8388736 /* t4 = 0x800080 */ + muleu_s.ph.qbl t0, a0, a1 + muleu_s.ph.qbr t2, a0, a1 + preceu.ph.qbla t1, t0 + addu t0, t0, t1 + addu t0, t0, t4 + preceu.ph.qbla t3, t2 + addu t2, t2, t3 + addu t2, t2, t4 + precrq.qb.ph t4, t0, t2 + move v0, t4 + j ra + +END(BYTE_MUL_asm_mips_dsp) + +LEAF_MIPS_DSP(destfetchARGB32_asm_mips_dsp) +/* + * a0 - buffer address (dst) + * a1 - data address (src) + * a2 - length + */ + + beqz a2, 2f + move v0, a0 /* just return the address of buffer + * for storing returning values */ + move v0, a0 + andi t1, a2, 0x1 + li t7, 8388736 /* t7 = 0x800080 */ + beqz t1, 1f + nop + lw t8, 0(a1) + addiu a2, a2, -1 + srl t6, t8, 24 /* t6 = alpha */ + + preceu.ph.qbra t0, t8 + mul t1, t0, t6 + preceu.ph.qbla t4, t8 + mul t5, t4, t6 + + preceu.ph.qbla t2, t1 + addq.ph t3, t1, t2 + addq.ph t3, t3, t7 + preceu.ph.qbla t1, t3 /* t1 holds R & B blended with alpha + * | 0 | dRab | 0 | dBab | */ + preceu.ph.qbla t2, t5 + addq.ph t3, t2, t5 + addq.ph t4, t3, t7 + preceu.ph.qbla t2, t4 /* t2 holds A & G blended with alpha + * | 0 | dAab | 0 | dGab | */ + andi t2, t2, 255 /* t2 = 0xff */ + + sll t0, t6, 24 + sll t3, t2, 8 + or t4, t0, t3 + or t0, t1, t4 + sw t0, 0(a0) + addiu a0, a0, 4 + addiu a1, a1, 4 + beqz a2, 2f /* there was only one member */ + nop +1: + lw t0, 0(a1) /* t0 = src1 */ + lw t1, 4(a1) /* t1 = src2 */ + precrq.qb.ph t4, t0, t1 /* t4 = a1 G1 a2 G2 */ + preceu.ph.qbra t3, t4 /* t3 = 0 G1 0 G2 */ + preceu.ph.qbla t2, t4 /* t2 = | 0 | a1 | 0 | a2 | */ + srl t5, t2, 8 + or t8, t2, t5 /* t8 = 0 a1 a1 a2 */ + muleu_s.ph.qbr t5, t8, t3 + + addiu a2, a2, -2 + addiu a1, a1, 8 + precrq.ph.w t9, t0, t1 + preceu.ph.qbra t9, t9 + + preceu.ph.qbla t6, t5 + addq.ph t5, t5, t6 + addq.ph t2, t5, t7 + muleu_s.ph.qbr t6, t8, t9 + sll t3, t1, 16 + packrl.ph t3, t0, t3 + preceu.ph.qbra t3, t3 + muleu_s.ph.qbr t8, t8, t3 + preceu.ph.qbla t3, t6 + addq.ph t3, t6, t3 + addq.ph t3, t3, t7 + preceu.ph.qbla t5, t8 + addq.ph t5, t8, t5 + addq.ph t5, t5, t7 + + precrq.ph.w t0, t4, t3 /* t0 = | 0 | a1 | 0 | dR1 | */ + precrq.ph.w t1, t2, t5 /* t1 = | 0 | dG1 | 0 | dB1 | */ + precrq.qb.ph t6, t0, t1 /* t6 = | a1 | dR1 | dG1 | dB1 | */ + sll t3, t3, 16 + sll t5, t5, 16 + packrl.ph t0, t4, t3 + packrl.ph t1, t2, t5 + precrq.qb.ph t8, t0, t1 /* t8 = | a2 | dR2 | dG2 | dB2 | */ + sw t6, 0(a0) + sw t8, 4(a0) + bnez a2, 1b + addiu a0, a0, 8 +2: + j ra + nop + +END(destfetchARGB32_asm_mips_dsp) + +LEAF_MIPS_DSP(qt_memfill32_asm_mips_dsp) +/* + * a0 - destination address (dst) + * a1 - value + * a2 - count + */ + + beqz a2, 5f + nop + li t8, 8 + andi t0, a2, 0x7 /* t0 holds how many counts exceeds 8 */ + beqzl t0, 2f /* count is multiple of 8 (8, 16, 24, ....) */ + addiu a2, a2, -8 + subu a2, a2, t0 +1: + sw a1, 0(a0) + addiu t0, t0, -1 + bnez t0, 1b + addiu a0, a0, 4 + bgeu a2, t8, 2f + addiu a2, a2, -8 + b 5f + nop +2: + beqz a2, 4f + nop +3: + pref 30, 32(a0) + addiu a2, a2, -8 + sw a1, 0( a0) + sw a1, 4(a0) + sw a1, 8(a0) + sw a1, 12(a0) + addiu a0, a0, 32 + sw a1, -16(a0) + sw a1, -12(a0) + sw a1, -8(a0) + bnez a2, 3b + sw a1, -4(a0) +4: + sw a1, 0(a0) + sw a1, 4(a0) + sw a1, 8(a0) + sw a1, 12(a0) + addiu a0, a0, 32 + sw a1, -16(a0) + sw a1, -12(a0) + sw a1, -8(a0) + sw a1, -4(a0) +5: + jr ra + nop + +END(qt_memfill32_asm_mips_dsp) + +LEAF_MIPS_DSP(comp_func_SourceOver_asm_mips_dsp) +/* + * a0 - uint *dest + * a1 - const uint *src + * a2 - int length + * a3 - uint const_alpha + */ + + beqz a2, 5f + nop + li t8, 0xff + li t7, 8388736 /* t7 = 0x800080 */ + bne a3, t8, 4f + nop + +/* part where const_alpha = 255 */ + b 2f + nop +1: + addiu a0, a0, 4 + addiu a2, a2, -1 + beqz a2, 5f + nop +2: + lw t0, 0(a1) /* t0 = s = src[i] */ + addiu a1, a1, 4 + nor t1, t0, zero + srl t1, t1, 24 /* t1 = ~qAlpha(s) */ + bnez t1, 3f + nop + sw t0, 0(a0) /* dst[i] = src[i] */ + addiu a2, a2, -1 + bnez a2, 2b + addiu a0, a0, 4 + b 5f + nop +3: + beqz t0, 1b + nop + + lw t4, 0(a0) + replv.ph t6, t1 + muleu_s.ph.qbl t2, t4, t6 + muleu_s.ph.qbr t3, t4, t6 + addiu a2, a2, -1 + preceu.ph.qbla t4, t2 + addq.ph t4, t2, t4 + addq.ph t4, t4, t7 + preceu.ph.qbla t5, t3 + addq.ph t5, t5, t3 + addq.ph t5, t5, t7 + precrq.qb.ph t8, t4, t5 /* t8 = | dsA | dsR | dsG | dsB | */ + addu t8, t0, t8 /* dst[i] = + * s + BYTE_MUL(dst[i],~qAlpha(s)) */ + sw t8, 0(a0) + bnez a2, 2b + addiu a0, a0, 4 + b 5f + nop +4: + lw t0, 0(a0) /* t0 - dst[i] "1" */ + lw t1, 0(a1) /* t1 - src[i] "2" */ + addiu a1, a1, 4 + addiu a2, a2, -1 + replv.ph t6, a3 /* a1 = 0x00a00a */ + muleu_s.ph.qbl t2, t1, t6 + muleu_s.ph.qbr t3, t1, t6 + preceu.ph.qbla t4, t2 + addq.ph t4, t2, t4 + addq.ph t4, t4, t7 + preceu.ph.qbla t5, t3 + addq.ph t5, t5, t3 + addq.ph t5, t5, t7 + precrq.qb.ph t8, t4, t5 /* t8 = | dsA | dsR | dsG | dsB | */ + + nor t6, t8, zero + srl t6, t6, 24 + replv.ph t6, t6 + + muleu_s.ph.qbl t2, t0, t6 + muleu_s.ph.qbr t3, t0, t6 + preceu.ph.qbla t4, t2 + addq.ph t4, t2, t4 + addq.ph t4, t4, t7 + preceu.ph.qbla t5, t3 + addq.ph t5, t5, t3 + addq.ph t5, t5, t7 + precrq.qb.ph t6, t4, t5 /* t6 = | ddA | ddR | ddG | ddB | */ + + addu t0, t8, t6 + sw t0, 0(a0) + bnez a2, 4b + addiu a0, a0, 4 +5: + jr ra + nop + +END(comp_func_SourceOver_asm_mips_dsp) + +LEAF_MIPS_DSP(qt_destStoreARGB32_asm_mips_dsp) +/* + * a0 - uint * data + * a1 - const uint *buffer + * a2 - int length + */ + + blez a2, 6f + move v1, zero + li t0, 255 + lui a3, 0xff + j 2f + lui t2, 0xff00 +1: + addiu v1, v1, 1 + sw zero, 0(a0) + addiu a1, a1, 4 + beq v1, a2, 6f + addiu a0, a0, 4 +2: + lw v0, 0(a1) + srl t3, v0, 0x18 + beql t3, t0, 5f + addiu v1, v1, 1 + beqz t3, 1b + + srl t1, v0, 0x8 + andi t1, t1, 0xff + + teq t3, zero, 0x7 + div zero, a3, t3 + move t8, t3 + andi t6, v0, 0xff + + srl t3,v0,0x10 + andi t3,t3,0xff + + and t5, v0, t2 + mflo t4 + + mult $ac0, t4, t6 + mult $ac1, t1, t4 + mul t4, t3, t4 + + sltiu t8, t8, 2 + beqz t8, 3f + nop + mflo t6, $ac0 + mflo t1, $ac1 + sra t6, t6, 0x10 + sra t1, t1, 0x8 + b 4f + nop +3: + extr.w t6, $ac0, 0x10 + extr.w t1, $ac1, 0x8 +4: + and v0, t4, a3 + or v0, v0, t6 + or v0, v0, t5 + andi t1, t1, 0xff00 + or v0, v0, t1 + addiu v1, v1, 1 +5: + sw v0, 0(a0) + addiu a1, a1, 4 + bne v1, a2, 2b + addiu a0, a0, 4 +6: + jr ra + nop + +END(qt_destStoreARGB32_asm_mips_dsp) diff --git a/src/gui/painting/qdrawhelper_mips_dsp_p.h b/src/gui/painting/qdrawhelper_mips_dsp_p.h new file mode 100644 index 0000000000..c68a3fff9b --- /dev/null +++ b/src/gui/painting/qdrawhelper_mips_dsp_p.h @@ -0,0 +1,78 @@ +/**************************************************************************** +** +** Copyright (C) 2012 MIPS Technologies, www.mips.com, author Damir Tatalovic +** Contact: http://www.qt-project.org/ +** +** This file is part of the QtGui module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** GNU Lesser General Public License Usage +** This file may be used under the terms of the GNU Lesser General Public +** License version 2.1 as published by the Free Software Foundation and +** appearing in the file LICENSE.LGPL included in the packaging of this +** file. Please review the following information to ensure the GNU Lesser +** General Public License version 2.1 requirements will be met: +** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU General +** Public License version 3.0 as published by the Free Software Foundation +** and appearing in the file LICENSE.GPL included in the packaging of this +** file. Please review the following information to ensure the GNU General +** Public License version 3.0 requirements will be met: +** http://www.gnu.org/copyleft/gpl.html. +** +** Other Usage +** Alternatively, this file may be used in accordance with the terms and +** conditions contained in a signed written agreement between you and Nokia. +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef QDRAWHELPER_MIPS_P_H +#define QDRAWHELPER_MIPS_P_H + +#include + +QT_BEGIN_NAMESPACE + +#if defined(QT_HAVE_MIPS_DSP) + +extern "C" void qt_memfill32_asm_mips_dsp(quint32 *dest, quint32 value, int count); + +extern "C" void comp_func_SourceOver_asm_mips_dsp(uint *dest, const uint *src, int length, uint const_alpha); + +void qt_blend_argb32_on_argb32_mips_dsp(uchar *destPixels, int dbpl, + const uchar *srcPixels, int sbpl, + int w, int h, + int const_alpha); + +void qt_blend_rgb32_on_rgb32_mips_dsp(uchar *destPixels, int dbpl, + const uchar *srcPixels, int sbpl, + int w, int h, + int const_alpha); + +void comp_func_Source_mips_dsp(uint *dest, const uint *src, int length, uint const_alpha); + +uint * QT_FASTCALL qt_destFetchARGB32_mips_dsp(uint *buffer, + QRasterBuffer *rasterBuffer, + int x, int y, int length); + +void QT_FASTCALL qt_destStoreARGB32_mips_dsp(QRasterBuffer *rasterBuffer, int x, int y, + const uint *buffer, int length); + +#endif // QT_HAVE_MIPS_DSP + +QT_END_NAMESPACE + +#endif // QDRAWHELPER_MIPS_P_H diff --git a/src/gui/painting/qdrawhelper_mips_dspr2_asm.S b/src/gui/painting/qdrawhelper_mips_dspr2_asm.S new file mode 100644 index 0000000000..688d16b552 --- /dev/null +++ b/src/gui/painting/qdrawhelper_mips_dspr2_asm.S @@ -0,0 +1,95 @@ +/**************************************************************************** +** +** Copyright (C) 2012 MIPS Technologies, www.mips.com, author Damir Tatalovic +** Contact: http://www.qt-project.org/ +** +** This file is part of the QtGui module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** GNU Lesser General Public License Usage +** This file may be used under the terms of the GNU Lesser General Public +** License version 2.1 as published by the Free Software Foundation and +** appearing in the file LICENSE.LGPL included in the packaging of this +** file. Please review the following information to ensure the GNU Lesser +** General Public License version 2.1 requirements will be met: +** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU General +** Public License version 3.0 as published by the Free Software Foundation +** and appearing in the file LICENSE.GPL included in the packaging of this +** file. Please review the following information to ensure the GNU General +** Public License version 3.0 requirements will be met: +** http://www.gnu.org/copyleft/gpl.html. +** +** Other Usage +** Alternatively, this file may be used in accordance with the terms and +** conditions contained in a signed written agreement between you and Nokia. +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include "qt_mips_asm_dsp.h" + +LEAF_MIPS_DSPR2(INTERPOLATE_PIXEL_255_asm_mips_dspr2) +/* + * a0 - uint x (First value to multiply) + * a1 - uint a (Multiplicator byte for first value) + * a2 - uint y (Second value to multiply) + * a3 - uint b (Multiplicator byte for second value) + */ + + .set reorder + replv.ph a1, a1 + replv.ph a3, a3 + li t8, 8388736 + muleu_s.ph.qbl t0, a0, a1 + muleu_s.ph.qbl t1, a2, a3 + muleu_s.ph.qbr t2, a0, a1 + muleu_s.ph.qbr t3, a2, a3 + addu.ph t4, t0, t1 + addu.ph t5, t2, t3 + preceu.ph.qbla t0, t4 + addu t1, t0, t8 + addu t1, t4, t1 + preceu.ph.qbla t6, t5 + addu t7, t6, t8 + addu t7, t5, t7 + precrq.qb.ph t2, t1, t7 + move v0, t2 + j ra + +END(INTERPOLATE_PIXEL_255_asm_mips_dspr2) + +LEAF_MIPS_DSPR2(BYTE_MUL_asm_mips_dspr2) +/* + * a0 - uint x (Value to multiply) + * a1 - uint a (Multiplicator byte) + */ + + .set reorder + replv.ph a1, a1 /* a1 = 0x00a00a */ + li t4, 8388736 /* t4 = 0x800080 */ + muleu_s.ph.qbl t0, a0, a1 + muleu_s.ph.qbr t2, a0, a1 + preceu.ph.qbla t1, t0 + addu t0, t0, t1 + addu t0, t0, t4 + preceu.ph.qbla t3, t2 + addu t2, t2, t3 + addu t2, t2, t4 + precrq.qb.ph t4, t0, t2 + move v0, t4 + j ra + +END(BYTE_MUL_asm_mips_dspr2) diff --git a/src/gui/painting/qt_mips_asm_dsp.h b/src/gui/painting/qt_mips_asm_dsp.h new file mode 100644 index 0000000000..bcde7068a2 --- /dev/null +++ b/src/gui/painting/qt_mips_asm_dsp.h @@ -0,0 +1,113 @@ +/**************************************************************************** +** +** Copyright (C) 2012 MIPS Technologies, www.mips.com, author Damir Tatalovic +** Contact: http://www.qt-project.org/ +** +** This file is part of the QtGui module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** GNU Lesser General Public License Usage +** This file may be used under the terms of the GNU Lesser General Public +** License version 2.1 as published by the Free Software Foundation and +** appearing in the file LICENSE.LGPL included in the packaging of this +** file. Please review the following information to ensure the GNU Lesser +** General Public License version 2.1 requirements will be met: +** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU General +** Public License version 3.0 as published by the Free Software Foundation +** and appearing in the file LICENSE.GPL included in the packaging of this +** file. Please review the following information to ensure the GNU General +** Public License version 3.0 requirements will be met: +** http://www.gnu.org/copyleft/gpl.html. +** +** Other Usage +** Alternatively, this file may be used in accordance with the terms and +** conditions contained in a signed written agreement between you and Nokia. +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef QT_MIPS_DSP_H__ +#define QT_MIPS_DSP_H__ + +#define zero $0 +#define AT $1 +#define v0 $2 +#define v1 $3 +#define a0 $4 +#define a1 $5 +#define a2 $6 +#define a3 $7 +#define t0 $8 +#define t1 $9 +#define t2 $10 +#define t3 $11 +#define t4 $12 +#define t5 $13 +#define t6 $14 +#define t7 $15 +#define s0 $16 +#define s1 $17 +#define s2 $18 +#define s3 $19 +#define s4 $20 +#define s5 $21 +#define s6 $22 +#define s7 $23 +#define t8 $24 +#define t9 $25 +#define k0 $26 +#define k1 $27 +#define gp $28 +#define sp $29 +#define fp $30 +#define s8 $30 +#define ra $31 + +/* + * LEAF_MIPS32R2 - declare leaf_mips32r2 routine + */ +#define LEAF_MIPS32R2(symbol) \ + .globl symbol; \ + .align 2; \ + .type symbol,@function; \ + .ent symbol,0; \ +symbol: .frame sp, 0, ra; \ + .set arch=mips32r2; \ + .set noreorder; + +/* + * LEAF_MIPS_DSP - declare leaf_mips_dsp routine + */ +#define LEAF_MIPS_DSP(symbol) \ +LEAF_MIPS32R2(symbol) \ + .set dsp; + +/* + * LEAF_MIPS_DSPR2 - declare leaf_mips_dspr2 routine + */ +#define LEAF_MIPS_DSPR2(symbol) \ +LEAF_MIPS32R2(symbol) \ + .set dspr2; + +/* + * END - mark end of function + */ +#define END(function) \ + .set reorder; \ + .end function; \ + .size function,.-function + +#endif //QT_MIPS_DSP_H__ -- cgit v1.2.3 From 14068bcf9fe175d7827c2160a61f48e344b636cb Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Thu, 29 Dec 2011 20:11:56 -0200 Subject: Add a non-implicit virtual destructor for QDashStroker MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The base class has a virtual destructor, so the destructor is already virtual. Make it non-implicit so that the virtual table and other virtual inline methods don't get emitted everywhere. Change-Id: I15296c1114086ff0b1da701ccd51525bec99d76b Reviewed-by: Samuel Rødal --- src/gui/painting/qstroker.cpp | 4 ++++ src/gui/painting/qstroker_p.h | 1 + 2 files changed, 5 insertions(+) (limited to 'src/gui') diff --git a/src/gui/painting/qstroker.cpp b/src/gui/painting/qstroker.cpp index 1201a481b6..c135adc63f 100644 --- a/src/gui/painting/qstroker.cpp +++ b/src/gui/painting/qstroker.cpp @@ -1028,6 +1028,10 @@ QDashStroker::QDashStroker(QStroker *stroker) } } +QDashStroker::~QDashStroker() +{ +} + QVector QDashStroker::patternForStyle(Qt::PenStyle style) { const qfixed space = 2; diff --git a/src/gui/painting/qstroker_p.h b/src/gui/painting/qstroker_p.h index 30953d304b..29d497e90b 100644 --- a/src/gui/painting/qstroker_p.h +++ b/src/gui/painting/qstroker_p.h @@ -254,6 +254,7 @@ class Q_GUI_EXPORT QDashStroker : public QStrokerOps { public: QDashStroker(QStroker *stroker); + ~QDashStroker(); QStroker *stroker() const { return m_stroker; } -- cgit v1.2.3 From e2a8ad145ec0b31ce78508774935f22026ceba63 Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Fri, 6 Jan 2012 14:55:55 -0200 Subject: Fix the build of -qt-freetype MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The symbol must be exported from QtGui for the plugins to be able to see it. Also, fix the build in namespaced case: cannot use extern in QtPlatformSupport because it's not compiled into the Qt namespace. Change-Id: I029533f3524e3cbf6c87aed79c1f2e7b55aebb9b Reviewed-by: Samuel Rødal --- src/gui/text/qfontengine_ft_p.h | 1 + 1 file changed, 1 insertion(+) (limited to 'src/gui') diff --git a/src/gui/text/qfontengine_ft_p.h b/src/gui/text/qfontengine_ft_p.h index 83b51685c0..2add894c19 100644 --- a/src/gui/text/qfontengine_ft_p.h +++ b/src/gui/text/qfontengine_ft_p.h @@ -364,6 +364,7 @@ inline QFontEngineFT::Glyph *QFontEngineFT::QGlyphSet::getGlyph(glyph_t index, Q return glyph_data.value(GlyphAndSubPixelPosition(index, subPixelPosition)); } +extern Q_GUI_EXPORT FT_Library qt_getFreetype(); QT_END_NAMESPACE -- cgit v1.2.3 From 31f9df520527be3f7a0f45092dbb5bc9ed1700ff Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Thu, 29 Dec 2011 17:59:01 -0200 Subject: Fix compilation on ARM with C++11: narrowing conversion MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cannot have double-to-float conversions inside { } in C++11. Change-Id: I13c27307efd703420b6667d919bb42c2ee82e6cc Reviewed-by: Samuel Rødal --- src/gui/painting/qpaintengineex.cpp | 2 +- src/gui/painting/qpainterpath.cpp | 2 +- src/gui/painting/qpainterpath_p.h | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) (limited to 'src/gui') diff --git a/src/gui/painting/qpaintengineex.cpp b/src/gui/painting/qpaintengineex.cpp index 36414f4774..7f9f82d00a 100644 --- a/src/gui/painting/qpaintengineex.cpp +++ b/src/gui/painting/qpaintengineex.cpp @@ -870,7 +870,7 @@ void QPaintEngineEx::drawPoints(const QPointF *points, int pointCount) } } else { for (int i=0; i>(QDataStream &s, QPainterPath &p) #endif continue; } - QPainterPath::Element elm = { x, y, QPainterPath::ElementType(type) }; + QPainterPath::Element elm = { qreal(x), qreal(y), QPainterPath::ElementType(type) }; p.d_func()->elements.append(elm); } s >> p.d_func()->cStart; diff --git a/src/gui/painting/qpainterpath_p.h b/src/gui/painting/qpainterpath_p.h index 23e8332f19..a9068f3855 100644 --- a/src/gui/painting/qpainterpath_p.h +++ b/src/gui/painting/qpainterpath_p.h @@ -268,7 +268,7 @@ inline void QPainterPathData::maybeMoveTo() } } -#define KAPPA 0.5522847498 +#define KAPPA qreal(0.5522847498) QT_END_NAMESPACE -- cgit v1.2.3 From 6cdbfc6f9443d9818792b1a396cf3c13dad5e2f3 Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Thu, 29 Dec 2011 12:41:44 -0200 Subject: Remove the workaround for GCC 3.3 on IRIX GCC 3.3 is no longer supported. IRIX is no longer supported. Change-Id: I1656a6fdcf2b244f0f6c812e71b0e793d37fb98b Reviewed-by: Robin Burchell --- src/gui/painting/qdrawhelper.cpp | 12 ------------ 1 file changed, 12 deletions(-) (limited to 'src/gui') diff --git a/src/gui/painting/qdrawhelper.cpp b/src/gui/painting/qdrawhelper.cpp index 9877dc6b9e..035f56b35e 100644 --- a/src/gui/painting/qdrawhelper.cpp +++ b/src/gui/painting/qdrawhelper.cpp @@ -58,18 +58,6 @@ QT_BEGIN_NAMESPACE #define MASK(src, a) src = BYTE_MUL(src, a) -#if defined(Q_OS_IRIX) && defined(Q_CC_GNU) && __GNUC__ == 3 && __GNUC__ < 4 && QT_POINTER_SIZE == 8 -#define Q_IRIX_GCC3_3_WORKAROUND -// -// work around http://gcc.gnu.org/bugzilla/show_bug.cgi?id=14484 -// -static uint gccBug(uint value) __attribute__((noinline)); -static uint gccBug(uint value) -{ - return value; -} -#endif - /* constants and structures */ -- cgit v1.2.3 From 76bc2663dd926b987be6fb880ae95ff964014e0f Mon Sep 17 00:00:00 2001 From: Pekka Vuorela Date: Tue, 28 Feb 2012 14:23:36 +0200 Subject: Deprecate QInputMethodEvent::setTentativeCommitString() Free form tentative commit proved to require too much fiddling on rendered text vs. logical content. Needs simpler mechanism. Change-Id: Ia4e341abf342d25675fd1129efb11094dde410b2 Reviewed-by: Joona Petrell --- src/gui/kernel/qevent.cpp | 2 ++ src/gui/kernel/qevent.h | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) (limited to 'src/gui') diff --git a/src/gui/kernel/qevent.cpp b/src/gui/kernel/qevent.cpp index e8ed5c0765..436ed56ea0 100644 --- a/src/gui/kernel/qevent.cpp +++ b/src/gui/kernel/qevent.cpp @@ -1698,6 +1698,7 @@ void QInputMethodEvent::setCommitString(const QString &commitString, int replace The tentative commit string is what the preedit string is expected to be committed as. The string can be used within the editor to trigger code that reacts on text changes such as validators. + \deprecated */ void QInputMethodEvent::setTentativeCommitString(const QString &tentativeCommitString) { @@ -1758,6 +1759,7 @@ void QInputMethodEvent::setTentativeCommitString(const QString &tentativeCommitS Returns the text as which preedit string is expected to be committed as. The string can be used within the editor to trigger code that reacts on text changes such as validators. + \deprecated \sa setTentativeCommitString() */ diff --git a/src/gui/kernel/qevent.h b/src/gui/kernel/qevent.h index d70f6be201..a042922f61 100644 --- a/src/gui/kernel/qevent.h +++ b/src/gui/kernel/qevent.h @@ -444,7 +444,7 @@ public: QInputMethodEvent(); QInputMethodEvent(const QString &preeditText, const QList &attributes); void setCommitString(const QString &commitString, int replaceFrom = 0, int replaceLength = 0); - void setTentativeCommitString(const QString &tentativeCommitString); + QT_DEPRECATED void setTentativeCommitString(const QString &tentativeCommitString); inline const QList &attributes() const { return attrs; } inline const QString &preeditString() const { return preedit; } @@ -452,7 +452,7 @@ public: inline const QString &commitString() const { return commit; } inline int replacementStart() const { return replace_from; } inline int replacementLength() const { return replace_length; } - inline const QString &tentativeCommitString() const { return tentativeCommit; } + QT_DEPRECATED inline const QString &tentativeCommitString() const { return tentativeCommit; } QInputMethodEvent(const QInputMethodEvent &other); -- cgit v1.2.3