Remove QAccessible2::TableModelChange.
This was never a good idea since it has issues: It doesn't really work with more than one update without the client fetching the data. The same is unlikely to work reliable since it involves two ipc roundtrips. Instead we should have an extended QAccessibleEvent that contains the data so that the bridges can decide how to pass on the data if needed. Change-Id: Iaf6b74f49586f7155909a6fe1a17137b71b31175 Reviewed-by: Jan-Arve Sæther <jan-arve.saether@nokia.com>
This commit is contained in:
parent
4eeb07d886
commit
61692bfefe
@ -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;
|
||||
};
|
||||
|
@ -156,63 +156,6 @@ QHeaderView *QAccessibleTable::verticalHeader() const
|
||||
return header;
|
||||
}
|
||||
|
||||
void QAccessibleTable::modelReset()
|
||||
{}
|
||||
|
||||
void QAccessibleTable::rowsInserted(const QModelIndex &, int first, int last)
|
||||
{
|
||||
lastChange.firstRow = first;
|
||||
lastChange.lastRow = last;
|
||||
lastChange.firstColumn = 0;
|
||||
lastChange.lastColumn = 0;
|
||||
lastChange.type = QAccessible2::TableModelChangeInsert;
|
||||
}
|
||||
|
||||
void QAccessibleTable::rowsRemoved(const QModelIndex &, int first, int last)
|
||||
{
|
||||
lastChange.firstRow = first;
|
||||
lastChange.lastRow = last;
|
||||
lastChange.firstColumn = 0;
|
||||
lastChange.lastColumn = 0;
|
||||
lastChange.type = QAccessible2::TableModelChangeDelete;
|
||||
}
|
||||
|
||||
void QAccessibleTable::columnsInserted(const QModelIndex &, int first, int last)
|
||||
{
|
||||
lastChange.firstRow = 0;
|
||||
lastChange.lastRow = 0;
|
||||
lastChange.firstColumn = first;
|
||||
lastChange.lastColumn = last;
|
||||
lastChange.type = QAccessible2::TableModelChangeInsert;
|
||||
}
|
||||
|
||||
void QAccessibleTable::columnsRemoved(const QModelIndex &, int first, int last)
|
||||
{
|
||||
lastChange.firstRow = 0;
|
||||
lastChange.lastRow = 0;
|
||||
lastChange.firstColumn = first;
|
||||
lastChange.lastColumn = last;
|
||||
lastChange.type = QAccessible2::TableModelChangeDelete;
|
||||
}
|
||||
|
||||
void QAccessibleTable::rowsMoved( const QModelIndex &, int, int, const QModelIndex &, int)
|
||||
{
|
||||
lastChange.firstRow = 0;
|
||||
lastChange.lastRow = 0;
|
||||
lastChange.firstColumn = 0;
|
||||
lastChange.lastColumn = 0;
|
||||
lastChange.type = QAccessible2::TableModelChangeUpdate;
|
||||
}
|
||||
|
||||
void QAccessibleTable::columnsMoved( const QModelIndex &, int, int, const QModelIndex &, int)
|
||||
{
|
||||
lastChange.firstRow = 0;
|
||||
lastChange.lastRow = 0;
|
||||
lastChange.firstColumn = 0;
|
||||
lastChange.lastColumn = 0;
|
||||
lastChange.type = QAccessible2::TableModelChangeUpdate;
|
||||
}
|
||||
|
||||
QAccessibleTableCell *QAccessibleTable::cell(const QModelIndex &index) const
|
||||
{
|
||||
if (index.isValid())
|
||||
@ -349,13 +292,6 @@ bool QAccessibleTable::unselectColumn(int column)
|
||||
return true;
|
||||
}
|
||||
|
||||
QAccessible2::TableModelChange QAccessibleTable::modelChange() const
|
||||
{
|
||||
QAccessible2::TableModelChange change;
|
||||
// FIXME
|
||||
return change;
|
||||
}
|
||||
|
||||
QAccessible::Role QAccessibleTable::role() const
|
||||
{
|
||||
return m_role;
|
||||
|
@ -88,7 +88,6 @@ public:
|
||||
virtual QString rowDescription(int row) const;
|
||||
virtual int columnCount() const;
|
||||
virtual int rowCount() const;
|
||||
virtual QAccessible2::TableModelChange modelChange() const;
|
||||
|
||||
// selection
|
||||
virtual int selectedCellCount() const;
|
||||
@ -104,18 +103,8 @@ public:
|
||||
virtual bool unselectRow(int row);
|
||||
virtual bool unselectColumn(int column);
|
||||
|
||||
protected:
|
||||
virtual void modelReset();
|
||||
virtual void rowsInserted(const QModelIndex &parent, int first, int last);
|
||||
virtual void rowsRemoved(const QModelIndex &parent, int first, int last);
|
||||
virtual void columnsInserted(const QModelIndex &parent, int first, int last);
|
||||
virtual void columnsRemoved(const QModelIndex &parent, int first, int last);
|
||||
virtual void rowsMoved( const QModelIndex &parent, int start, int end, const QModelIndex &destination, int row);
|
||||
virtual void columnsMoved( const QModelIndex &parent, int start, int end, const QModelIndex &destination, int column);
|
||||
|
||||
protected:
|
||||
QAbstractItemView* view;
|
||||
QAccessible2::TableModelChange lastChange;
|
||||
inline QAccessibleTableCell *cell(const QModelIndex &index) const;
|
||||
inline QAccessible::Role cellRole() const {
|
||||
switch (m_role) {
|
||||
|
Loading…
Reference in New Issue
Block a user