48 #include <private/qtreewidget_p.h> 52 #ifndef QT_NO_ACCESSIBILITY 58 #ifndef QT_NO_ITEMVIEWS 96 int row = logicalIndex / columns;
97 int column = logicalIndex % columns;
117 qWarning() <<
"QAccessibleTable2::childFromLogical: Invalid index at: " << row << column;
128 if (qobject_cast<const QTableView*>(
view())) {
130 }
else if (qobject_cast<const QTreeView*>(
view())) {
132 }
else if (qobject_cast<const QListView*>(
view())) {
148 #ifndef QT_NO_TABLEVIEW 149 }
else if (
const QTableView *tv = qobject_cast<const QTableView*>(
view())) {
150 header = tv->horizontalHeader();
152 #ifndef QT_NO_TREEVIEW 153 }
else if (
const QTreeView *tv = qobject_cast<const QTreeView*>(
view())) {
154 header = tv->header();
164 #ifndef QT_NO_TABLEVIEW 165 }
else if (
const QTableView *tv = qobject_cast<const QTableView*>(
view())) {
166 header = tv->verticalHeader();
238 if (!
view()->model())
244 qWarning() <<
"QAccessibleTable2::cellAt: invalid index: " << index <<
" for " <<
view();
257 if (!
view()->model())
264 if (!
view()->model())
271 if (!
view()->model())
278 if (!
view()->selectionModel())
285 if (!
view()->selectionModel())
292 if (!
view()->selectionModel())
299 if (!
view()->model())
307 if (!
view()->selectionModel())
318 if (!
view()->selectionModel())
328 if (!
view()->selectionModel())
344 if (!
view()->selectionModel())
351 if (!
view()->selectionModel())
358 if (!
view()->model() || !
view()->selectionModel())
369 if (!
view()->model() || !
view()->selectionModel())
380 if (!
view()->model() || !
view()->selectionModel())
391 if (!
view()->model() || !
view()->selectionModel())
436 if (!
view()->model())
445 if (!
view()->model())
460 qWarning() <<
"WARNING QAccessibleTable2::indexOfChild Fix my children..." 478 if (!
view()->isVisible())
487 if ((index < 0) || (!
view()->model()))
492 if (index == 1 &&
view()->parent()) {
542 if (treeView->d_func()->viewItems.count() <= row) {
543 qWarning() <<
"QAccessibleTree::indexFromLogical: invalid index: " << row << column <<
" for " << treeView;
546 QModelIndex modelIndex = treeView->d_func()->viewItems.at(row).index;
548 if (modelIndex.
isValid() && column > 0) {
564 int row = treeView->d_func()->viewIndex(index) + (
horizontalHeader() ? 1 : 0);
565 int column = index.
column();
576 if (!
view()->model())
587 return treeView->d_func()->viewItems.count();
592 if (!
view()->model())
608 return cell->
index + 1;
610 qWarning() <<
"WARNING QAccessibleTable2::indexOfChild invalid child" 620 if ((index < 0) || (!
view()->model()))
640 QModelIndex modelIndex = indexFromLogical(row, column);
642 *iface =
cell(modelIndex);
663 qWarning() <<
"Requested invalid tree cell: " << row << column;
676 if (!
view()->selectionModel())
684 if (!
view()->selectionModel())
727 #ifndef QT_NO_TABLEVIEW 728 }
else if (
const QTableView *tv = qobject_cast<const QTableView*>(
view)) {
729 header = tv->horizontalHeader();
731 #ifndef QT_NO_TREEVIEW 732 }
else if (
const QTreeView *tv = qobject_cast<const QTreeView*>(
view)) {
733 header = tv->header();
743 #ifndef QT_NO_TABLEVIEW 745 header = tv->verticalHeader();
760 int row = treeView->d_func()->viewIndex(
m_index);
879 if (relation ==
Ancestor && index == 1) {
972 :
view(view_),
index(index_), orientation(orientation_)
997 #ifndef QT_NO_TABLEVIEW 998 }
else if (
const QTableView *tv = qobject_cast<const QTableView*>(
view)) {
1000 header = tv->horizontalHeader();
1002 header = tv->verticalHeader();
1005 #ifndef QT_NO_TREEVIEW 1006 }
else if (
const QTreeView *tv = qobject_cast<const QTreeView*>(
view)) {
1007 header = tv->header();
1016 ?
QRect(zero.
x() + sectionPos, zero.
y(), sectionSize, header->
height())
1017 :
QRect(zero.
x(), zero.
y() + sectionPos, header->
width(), sectionSize);
1056 #ifndef QT_NO_TREEVIEW 1057 }
else if (qobject_cast<const QTreeView*>(
view)) {
1075 #ifndef QT_NO_ACTION 1096 #endif // QT_NO_ITEMVIEWS 1100 #endif // QT_NO_ACCESSIBILITY virtual void columnsMoved(const QModelIndex &parent, int start, int end, const QModelIndex &destination, int column)
QModelIndexList selectedRows(int column=0) const
Returns the indexes in the given column for the rows where all columns are selected.
T qobject_cast(QObject *object)
virtual int columnCount(const QModelIndex &parent=QModelIndex()) const =0
Returns the number of columns for the children of the given parent.
virtual void rowsRemoved(const QModelIndex &parent, int first, int last)
Role role(int child) const
Returns the role of the object, or of the object's child if child is not 0.
bool isNull() const
Returns true if the rectangle is a null rectangle, otherwise returns false.
virtual ~QAccessibleTable2()
virtual QAccessibleTable2Interface * table() const
QAccessible::Role cellRole() const
#define QT_END_NAMESPACE
This macro expands to.
virtual QList< int > selectedRows() const
int childAt(int x, int y) const
Returns the 1-based index of the child that contains the screen coordinates (x, y).
int childCount() const
Returns the number of children that belong to this object.
virtual bool selectColumn(int column)
virtual int rowCount() const
virtual QRect visualRect(const QModelIndex &index) const =0
Returns the rectangle on the viewport occupied by the item at index.
Role role(int child) const
Returns the role of the object, or of the object's child if child is not 0.
bool isColumnSelected(int column, const QModelIndex &parent) const
Returns true if all items are selected in the column with the given parent.
virtual QList< QAccessibleInterface * > columnHeaderCells() const
QObject * object() const
Returns a pointer to the QObject this interface implementation provides information for...
virtual int selectedCellCount() const
virtual int rowCount(const QModelIndex &parent=QModelIndex()) const =0
Returns the number of rows under the given parent.
virtual void rowsMoved(const QModelIndex &parent, int start, int end, const QModelIndex &destination, int row)
virtual int columnExtent() const
QModelIndexList selectedIndexes() const
Returns a list of all selected model item indexes.
Role
This enum defines the role of an accessible object.
QAbstractItemView * view() const
friend class QAccessibleTable2
QHeaderView * horizontalHeader() const
QAccessibleTable2Cell * cell(const QModelIndex &index) const
QModelIndex indexFromLogical(int row, int column=0) const
virtual QAccessible2::TableModelChange modelChange() const
QString toString() const
Returns the variant as a QString if the variant has type() String , Bool , ByteArray ...
virtual void rowColumnExtents(int *row, int *column, int *rowExtents, int *columnExtents, bool *selected) const
QRect rect(int child) const
Returns the geometry of the object, or of the object's child if child is not 0.
virtual bool setData(const QModelIndex &index, const QVariant &value, int role=Qt::EditRole)
Sets the role data for the item at index to value.
virtual QList< QAccessibleTable2CellInterface * > selectedCells() const
int navigate(RelationFlag relation, int m_index, QAccessibleInterface **iface) const
Navigates from this object to an object that has a relationship relation to this object, and returns the respective object in target.
int userActionCount(int child) const
Returns the number of custom actions of the object, or of the object's child if child is not 0...
int count(const T &t) const
Returns the number of occurrences of value in the list.
State state(int child) const
Returns the current state of the object, or of the object's child if child is not 0...
int logicalIndex(const QModelIndex &index) const
bool isExpanded(const QModelIndex &index) const
Returns true if the model item index is expanded; otherwise returns false.
Relation relationTo(int child, const QAccessibleInterface *other, int otherChild) const
Returns the relationship between this object's \a child and the \a other object's \a otherChild...
The QString class provides a Unicode character string.
bool isValid() const
Returns true if all the data necessary to use this interface implementation is valid (e...
QModelIndex parent() const
Returns the parent of the model index, or QModelIndex() if it has no parent.
virtual QVariant headerData(int section, Qt::Orientation orientation, int role=Qt::DisplayRole) const
Returns the data for the given role and section in the header with the specified orientation.
SelectionMode selectionMode
which selection mode the view operates in
bool isExpandable() const
TableModelChangeType type
QAccessible2::TableModelChange lastChange
QHeaderView * verticalHeader() const
int toInt(bool *ok=0) const
Returns the variant as an int if the variant has type() Int , Bool , ByteArray , Char ...
virtual QModelIndex index(int row, int column, const QModelIndex &parent=QModelIndex()) const =0
Returns the index of the item in the model specified by the given row, column and parent index...
QString text(Text t, int child) const
Returns the value of the text property t of the object, or of the object's child if child is not 0...
virtual int columnCount() const
void append(const T &t)
Inserts value at the end of the list.
bool isRowSelected(int row) const
friend class QAccessibleTree
#define QT_BEGIN_NAMESPACE
This macro expands to.
QString rowDescription(int row) const
virtual bool unselectColumn(int column)
virtual bool hasChildren(const QModelIndex &parent=QModelIndex()) const
Returns true if parent has any children; otherwise returns false.
virtual int navigate(RelationFlag relation, int index, QAccessibleInterface **iface) const =0
Navigates from this object to an object that has a relationship relation to this object, and returns the respective object in target.
bool isEmpty() const
Returns true if the string has no characters; otherwise returns false.
QItemSelectionModel * selectionModel() const
Returns the current selection model.
bool isSelected(const QModelIndex &index) const
Returns true if the given model item index is selected.
RelationFlag
This enum type defines bit flags that can be combined to indicate the relationship between two access...
The QTreeView class provides a default model/view implementation of a tree view.
int row() const
Returns the row this model index refers to.
const QAbstractItemModel * model() const
Returns a pointer to the model containing the item that this index refers to.
virtual int selectedRowCount() const
virtual QList< int > selectedColumns() const
Q_CORE_EXPORT void qWarning(const char *,...)
virtual bool isRowSelected(int row) const
int navigate(RelationFlag relation, int index, QAccessibleInterface **iface) const
Navigates from this object to an object that has a relationship relation to this object, and returns the respective object in target.
virtual QVariant data(const QModelIndex &index, int role=Qt::DisplayRole) const =0
Returns the data stored under the given role for the item referred to by the index.
QModelIndex currentIndex() const
Returns the model item index for the current item, or an invalid index if there is no current item...
virtual int rowIndex() const
virtual QAccessibleInterface * caption() const
virtual void rowsInserted(const QModelIndex &parent, int first, int last)
The State element defines configurations of objects and properties.
virtual bool selectRow(int row)
virtual int rowExtent() const
The QTableView class provides a default model/view implementation of a table view.
virtual int selectedColumnCount() const
bool isValid() const
Returns true if this model index is valid; otherwise returns false.
virtual QString columnDescription(int column) const
The QAbstractItemModel class provides the abstract interface for item model classes.
Qt::ItemFlags flags() const
Returns the flags for the item referred to by the index.
static QAccessibleInterface * queryAccessibleInterface(QObject *)
If a QAccessibleInterface implementation exists for the given object, this function returns a pointer...
virtual Role role(int child) const =0
Returns the role of the object, or of the object's child if child is not 0.
int navigate(RelationFlag relation, int index, QAccessibleInterface **iface) const
Navigates from this object to an object that has a relationship relation to this object, and returns the respective object in target.
The QAbstractItemView class provides the basic functionality for item view classes.
QAccessibleTable2Cell(QAbstractItemView *view, const QModelIndex &m_index, QAccessible::Role role)
QModelIndexList selectedColumns(int row=0) const
Returns the indexes in the given row for columns where all rows are selected.
QHeaderView * horizontalHeader() const
The QAccessibleInterface class defines an interface that exposes information about accessible objects...
QString Q_GUI_EXPORT qt_accStripAmp(const QString &text)
virtual void select(const QModelIndex &index, QItemSelectionModel::SelectionFlags command)
Selects the model item index using the specified command, and emits selectionChanged().
virtual void columnsRemoved(const QModelIndex &parent, int first, int last)
bool doAction(int action, int child, const QVariantList ¶ms)
Asks the object, or the object's child if child is not 0, to execute action using the parameters...
#define st(var, type, card)
The QPoint class defines a point in the plane using integer precision.
The QModelIndex class is used to locate data in a data model.
virtual bool unselectRow(int row)
virtual QString text(Text t, int child) const =0
Returns the value of the text property t of the object, or of the object's child if child is not 0...
QAccessibleTable2Interface * table2Interface()
virtual bool isColumnSelected(int column) const
virtual int columnIndex() const
The QRect class defines a rectangle in the plane using integer precision.
virtual void modelReset()
int y() const
Returns the y coordinate of this point.
int indexOfChild(const QAccessibleInterface *) const
Returns the 1-based index of the object child in this object's children list, or -1 if child is not a...
QString actionText(int action, Text t, int child) const
Returns the text property t of the action action supported by the object, or of the object's child if...
int childCount() const
Returns the number of children that belong to this object.
Relation relationTo(int child, const QAccessibleInterface *other, int otherChild) const
Returns the relationship between this object's \a child and the \a other object's \a otherChild...
#define Q_FOREACH(variable, container)
Same as foreach(variable, container).
QAccessibleTable2CellInterface * cellAt(int row, int column) const
QPointer< QAbstractItemView > view
bool isValid() const
Returns true if all the data necessary to use this interface implementation is valid (e...
bool intersects(const QRect &r) const
Returns true if this rectangle intersects with the given rectangle (i.
virtual QString rowDescription(int row) const
int x() const
Returns the x coordinate of this point.
State state(int child) const
Returns the current state of the object, or of the object's child if child is not 0...
int childAt(int x, int y) const
Returns the 1-based index of the child that contains the screen coordinates (x, y).
void setText(Text t, int child, const QString &text)
Sets the text property t of the object, or of the object's child if child is not 0, to text.
QAccessibleTable2(QWidget *w)
QAbstractItemModel * model() const
Returns the model that this view is presenting.
void translate(int dx, int dy)
Moves the rectangle dx along the x axis and dy along the y axis, relative to the current position...
int indexOfChild(const QAccessibleInterface *) const
Returns the 1-based index of the object child in this object's children list, or -1 if child is not a...
QString actionText(int action, Text t, int child) const
Returns the text property t of the action action supported by the object, or of the object's child if...
virtual QList< QAccessibleInterface * > rowHeaderCells() const
virtual QAccessibleTable2CellInterface * cellAt(int row, int column) const
QAccessibleInterface * childFromLogical(int logicalIndex) const
QRect rect(int child) const
Returns the geometry of the object, or of the object's child if child is not 0.
bool doAction(int action, int child, const QVariantList ¶ms)
Asks the object, or the object's child if child is not 0, to execute action using the parameters...
Relation relationTo(int child, const QAccessibleInterface *other, int otherChild) const
Returns the relationship between this object's \a child and the \a other object's \a otherChild...
QHeaderView * verticalHeader() const
int userActionCount(int child) const
Returns the number of custom actions of the object, or of the object's child if child is not 0...
QString text(Text t, int child) const
Returns the value of the text property t of the object, or of the object's child if child is not 0...
bool isRowSelected(int row, const QModelIndex &parent) const
Returns true if all items are selected in the row with the given parent.
int column() const
Returns the column this model index refers to.
The QList class is a template class that provides lists.
virtual bool isSelected() const
The Text item allows you to add formatted text to a scene.
virtual QModelIndex indexAt(const QPoint &point) const =0
Returns the model index of the item at the viewport coordinates point.
virtual QAccessibleInterface * summary() const
virtual void columnsInserted(const QModelIndex &parent, int first, int last)