diff options
author | Lars Knoll <lars.knoll@nokia.com> | 2012-03-12 21:03:49 +0100 |
---|---|---|
committer | Lars Knoll <lars.knoll@nokia.com> | 2012-03-12 21:03:49 +0100 |
commit | d5098f2802255da10b749b93705084ad1fdfc6a5 (patch) | |
tree | 6462008a4ab7d13435d93490fed96c62c516cbdf /src/gui/accessible | |
parent | d5a85940f785459d7b982d5fdf59a9fd18825092 (diff) | |
parent | b5b41c18345719612e5411cc482466d2dbafdaf7 (diff) |
Merge remote-tracking branch 'origin/master' into api_changes
Conflicts:
tests/auto/corelib/kernel/qmetatype/tst_qmetatype.cpp
Change-Id: I884afc3b6d65c6411733a897a1949e19393573a7
Diffstat (limited to 'src/gui/accessible')
-rw-r--r-- | src/gui/accessible/qaccessible.cpp | 28 | ||||
-rw-r--r-- | src/gui/accessible/qaccessible.h | 19 | ||||
-rw-r--r-- | src/gui/accessible/qaccessible2.h | 29 |
3 files changed, 46 insertions, 30 deletions
diff --git a/src/gui/accessible/qaccessible.cpp b/src/gui/accessible/qaccessible.cpp index e5b290ae1f..cb89fccc2d 100644 --- a/src/gui/accessible/qaccessible.cpp +++ b/src/gui/accessible/qaccessible.cpp @@ -257,7 +257,8 @@ QT_BEGIN_NAMESPACE \value SelectionWithin Several changes to a selection has occurred in an item view. \value SoundPlayed A sound has been played by an object - \value StateChanged The QAccessible::State of an object has changed. + \omitvalue StateChanged The QAccessible::State of an object has changed. + This value is used internally for the QAccessibleStateChangeEvent. \value TableCaptionChanged A table caption has been changed. \value TableColumnDescriptionChanged The description of a table column, typically found in the column's header, has been changed. @@ -308,6 +309,7 @@ QT_BEGIN_NAMESPACE \value ColumnHeader A header for a column of data. \value ComboBox A list of choices that the user can select from. \value Cursor An object that represents the mouse cursor. + \value Desktop The object represents the desktop or workspace. \value Dial An object that represents a dial or knob. \value Dialog A dialog box. \value Document A document window, usually in an MDI environment. @@ -345,6 +347,7 @@ QT_BEGIN_NAMESPACE \value StaticText Static text, such as labels for other widgets. \value StatusBar A status bar. \value Table A table representing data in a grid of rows and columns. + \value Terminal A terminal or command line interface. \value TitleBar The title bar caption of a window. \value ToolBar A tool bar, which groups widgets that the user accesses frequently. \value ToolTip A tool tip which provides information about other objects. @@ -694,9 +697,32 @@ void QAccessible::updateAccessibility(const QAccessibleEvent &event) This class should be created on the stack and used as parameter for \l QAccessible::updateAccessibility(). + \sa QAccessibleStateChangedEvent */ /*! + \class QAccessibleStateChangedEvent + \brief This subclass of QAccessibleEvent is used to inform about state changes. + \internal + + \ingroup accessibility + \inmodule QtGui + + This class should be created on the stack and used as parameter for + \l QAccessible::updateAccessibility(). + In addition to the regular \l QAccessibleEvent it contains details about which states + changed. + \sa QAccessibleEvent +*/ + +/*! + \fn QAccessibleStateChangeEvent::changedStates() const + All states that have changed are set to true. This does not reflect the state of the object, + but indicates which states are changed. + Use the \l QAccessibleInterface::state() function to get the current state. + */ + +/*! Returns the QAccessibleInterface associated with the event. The caller of this function takes ownership of the returned interface. diff --git a/src/gui/accessible/qaccessible.h b/src/gui/accessible/qaccessible.h index 6ad1bb9da9..e8a5cf8bad 100644 --- a/src/gui/accessible/qaccessible.h +++ b/src/gui/accessible/qaccessible.h @@ -292,6 +292,7 @@ public: // Additional Qt roles where enum value does not map directly to MSAA: LayeredPane = 0x0000003F, Terminal = 0x00000040, + Desktop = 0x00000041, UserRole = 0x0000ffff }; @@ -436,6 +437,9 @@ public: Q_ASSERT(obj); } + virtual ~QAccessibleEvent() + {} + QAccessible::Event type() const { return m_type; } QObject *object() const { return m_object; } int child() const { return m_child; } @@ -448,6 +452,21 @@ private: int m_child; }; +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) + {} + + QAccessible::State changedStates() const { + return m_changedStates; + } + +private: + QAccessible::State m_changedStates; +}; + #define QAccessibleInterface_iid "org.qt-project.Qt.QAccessibleInterface" Q_DECLARE_INTERFACE(QAccessibleInterface, QAccessibleInterface_iid) diff --git a/src/gui/accessible/qaccessible2.h b/src/gui/accessible/qaccessible2.h index b84c484f74..61e46ebf04 100644 --- a/src/gui/accessible/qaccessible2.h +++ b/src/gui/accessible/qaccessible2.h @@ -70,24 +70,6 @@ namespace QAccessible2 LineBoundary, NoBoundary }; - - enum TableModelChangeType { - TableModelChangeInsert, - TableModelChangeDelete, - TableModelChangeUpdate - }; - - struct TableModelChange { - int firstColumn; - int firstRow; - int lastColumn; - int lastRow; - TableModelChangeType type; - - TableModelChange() - : firstColumn(0), firstRow(0), lastColumn(0), lastRow(0), type(TableModelChangeUpdate) - {} - }; } class Q_GUI_EXPORT QAccessibleTextInterface @@ -230,19 +212,8 @@ public: virtual bool unselectRow(int row) = 0; // Unselects one column, leaving other selected columns selected (if any). virtual bool unselectColumn(int column) = 0; - // Returns the type and extents describing how a table changed. - virtual QAccessible2::TableModelChange modelChange() const = 0; protected: - // These functions are called when the model changes. - virtual void modelReset() = 0; - virtual void rowsInserted(const QModelIndex &parent, int first, int last) = 0; - virtual void rowsRemoved(const QModelIndex &parent, int first, int last) = 0; - virtual void columnsInserted(const QModelIndex &parent, int first, int last) = 0; - virtual void columnsRemoved(const QModelIndex &parent, int first, int last) = 0; - virtual void rowsMoved( const QModelIndex &parent, int start, int end, const QModelIndex &destination, int row) = 0; - virtual void columnsMoved( const QModelIndex &parent, int start, int end, const QModelIndex &destination, int column) = 0; - friend class QAbstractItemView; friend class QAbstractItemViewPrivate; }; |