Qt 4.8
Public Functions | Protected Functions | Private Functions | Properties | List of all members
QAccessibleItemView Class Reference

#include <complexwidgets.h>

Inheritance diagram for QAccessibleItemView:
QAccessibleAbstractScrollArea QAccessibleTableInterface QAccessibleWidgetEx QAccessible2Interface QAccessibleObjectEx QAccessibleInterfaceEx QAccessibleInterface QAccessible

Public Functions

QAccessibleInterfaceaccessibleAt (int row, int column)
 
QAccessibleInterfacecaption ()
 
void cellAtIndex (int index, int *row, int *column, int *rowSpan, int *columnSpan, bool *isSelected)
 
int childAt (int x, int y) const
 Returns the 1-based index of the child that contains the screen coordinates (x, y). More...
 
int childCount () const
 Returns the number of children that belong to this object. More...
 
QModelIndex childIndex (int child) const
 
int childIndex (int rowIndex, int columnIndex)
 
int columnCount ()
 
QString columnDescription (int column)
 
QAccessibleInterfacecolumnHeader ()
 
int columnIndex (int childIndex)
 
int columnSpan (int row, int column)
 
int entryFromIndex (const QModelIndex &index) const
 
QHeaderViewhorizontalHeader () const
 
int indexOfChild (const QAccessibleInterface *iface) const
 Returns the 1-based index of the object child in this object's children list, or -1 if child is not a child of this object. More...
 
bool isColumnSelected (int column)
 
bool isRowSelected (int row)
 
bool isSelected (int row, int column)
 
bool isValid () const
 Returns true if all the data necessary to use this interface implementation is valid (e. More...
 
bool isValidChildRole (QAccessible::Role role) 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. More...
 
QObjectobject () const
 Returns a pointer to the QObject this interface implementation provides information for. More...
 
 QAccessibleItemView (QWidget *w)
 
QRect rect (int child) const
 Returns the geometry of the object, or of the object's child if child is not 0. More...
 
Role role (int child) const
 Returns the role of the object, or of the object's child if child is not 0. More...
 
int rowCount ()
 
QString rowDescription (int row)
 
QAccessibleInterfacerowHeader ()
 
int rowIndex (int childIndex)
 
int rowSpan (int row, int column)
 
void selectColumn (int column)
 
int selectedColumnCount ()
 
int selectedColumns (int maxColumns, QList< int > *columns)
 
int selectedRowCount ()
 
int selectedRows (int maxRows, QList< int > *rows)
 
void selectRow (int row)
 
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. More...
 
State state (int child) const
 Returns the current state of the object, or of the object's child if child is not 0. More...
 
QAccessibleInterfacesummary ()
 
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. More...
 
void unselectColumn (int column)
 
void unselectRow (int row)
 
QHeaderViewverticalHeader () const
 
- Public Functions inherited from QAccessibleAbstractScrollArea
QAbstractScrollAreaabstractScrollArea () const
 
QVariant invokeMethodEx (QAccessible::Method method, int child, const QVariantList &params)
 
 QAccessibleAbstractScrollArea (QWidget *widget)
 
- Public Functions inherited from QAccessibleWidgetEx
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 child is not 0. More...
 
bool doAction (int action, int child, const QVariantList &params)
 Asks the object, or the object's child if child is not 0, to execute action using the parameters, params. More...
 
 QAccessibleWidgetEx (QWidget *o, Role r=Client, const QString &name=QString())
 
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.
More...
 
- Public Functions inherited from QAccessibleObjectEx
 QAccessibleObjectEx (QObject *object)
 
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. More...
 
- Public Functions inherited from QAccessibleInterfaceEx
virtual QAccessible2Interfaceinterface_cast (QAccessible2::InterfaceType)
 
virtual QVariant virtual_hook (const QVariant &data)
 
- Public Functions inherited from QAccessibleInterface
QAccessibleActionInterfaceactionInterface ()
 
QColor backgroundColor ()
 
QAccessibleEditableTextInterfaceeditableTextInterface ()
 
QColor foregroundColor ()
 
QAccessibleImageInterfaceimageInterface ()
 
QVariant invokeMethod (Method method, int child=0, const QVariantList &params=QVariantList())
 Invokes a method on child with the given parameters params and returns the result of the operation as QVariant. More...
 
QSet< MethodsupportedMethods ()
 Returns a QSet of QAccessible::Method that are supported by this accessible interface. More...
 
QAccessibleTable2Interfacetable2Interface ()
 
QAccessibleTableInterfacetableInterface ()
 
QAccessibleTextInterfacetextInterface ()
 
QAccessibleValueInterfacevalueInterface ()
 
virtual ~QAccessibleInterface ()
 Destroys the object. More...
 
- Public Functions inherited from QAccessibleTableInterface
QAccessible2InterfaceqAccessibleTableCastHelper ()
 
- Public Functions inherited from QAccessible2Interface
virtual ~QAccessible2Interface ()
 

Protected Functions

QModelIndex index (int row, int column) const
 
QAbstractItemViewitemView () const
 
- Protected Functions inherited from QAccessibleWidgetEx
void addControllingSignal (const QString &signal)
 
QObjectparentObject () const
 
void setAccelerator (const QString &accel)
 
void setDescription (const QString &desc)
 
void setHelp (const QString &help)
 
void setValue (const QString &value)
 
QWidgetwidget () const
 
 ~QAccessibleWidgetEx ()
 
- Protected Functions inherited from QAccessibleObjectEx
virtual ~QAccessibleObjectEx ()
 

Private Functions

bool atViewport () const
 
QAccessible::Role expectedRoleOfChildren () const
 

Properties

bool atVP
 

Additional Inherited Members

- Public Types inherited from QAccessibleAbstractScrollArea
enum  AbstractScrollAreaElement {
  Self = 0, Viewport, HorizontalContainer, VerticalContainer,
  CornerWidget, Undefined
}
 
- Public Types inherited from QAccessible
enum  Action {
  DefaultAction = 0, Press = -1, FirstStandardAction = Press, SetFocus = -2,
  Increase = -3, Decrease = -4, Accept = -5, Cancel = -6,
  Select = -7, ClearSelection = -8, RemoveSelection = -9, ExtendSelection = -10,
  AddToSelection = -11, LastStandardAction = AddToSelection
}
 This enum describes the possible types of action that can occur. More...
 
enum  Event {
  SoundPlayed = 0x0001, Alert = 0x0002, ForegroundChanged = 0x0003, MenuStart = 0x0004,
  MenuEnd = 0x0005, PopupMenuStart = 0x0006, PopupMenuEnd = 0x0007, ContextHelpStart = 0x000C,
  ContextHelpEnd = 0x000D, DragDropStart = 0x000E, DragDropEnd = 0x000F, DialogStart = 0x0010,
  DialogEnd = 0x0011, ScrollingStart = 0x0012, ScrollingEnd = 0x0013, MenuCommand = 0x0018,
  ActionChanged = 0x0101, ActiveDescendantChanged = 0x0102, AttributeChanged = 0x0103, DocumentContentChanged = 0x0104,
  DocumentLoadComplete = 0x0105, DocumentLoadStopped = 0x0106, DocumentReload = 0x0107, HyperlinkEndIndexChanged = 0x0108,
  HyperlinkNumberOfAnchorsChanged = 0x0109, HyperlinkSelectedLinkChanged = 0x010A, HypertextLinkActivated = 0x010B, HypertextLinkSelected = 0x010C,
  HyperlinkStartIndexChanged = 0x010D, HypertextChanged = 0x010E, HypertextNLinksChanged = 0x010F, ObjectAttributeChanged = 0x0110,
  PageChanged = 0x0111, SectionChanged = 0x0112, TableCaptionChanged = 0x0113, TableColumnDescriptionChanged = 0x0114,
  TableColumnHeaderChanged = 0x0115, TableModelChanged = 0x0116, TableRowDescriptionChanged = 0x0117, TableRowHeaderChanged = 0x0118,
  TableSummaryChanged = 0x0119, TextAttributeChanged = 0x011A, TextCaretMoved = 0x011B, TextColumnChanged = 0x011D,
  TextInserted = 0x011E, TextRemoved = 0x011F, TextUpdated = 0x0120, TextSelectionChanged = 0x0121,
  VisibleDataChanged = 0x0122, ObjectCreated = 0x8000, ObjectDestroyed = 0x8001, ObjectShow = 0x8002,
  ObjectHide = 0x8003, ObjectReorder = 0x8004, Focus = 0x8005, Selection = 0x8006,
  SelectionAdd = 0x8007, SelectionRemove = 0x8008, SelectionWithin = 0x8009, StateChanged = 0x800A,
  LocationChanged = 0x800B, NameChanged = 0x800C, DescriptionChanged = 0x800D, ValueChanged = 0x800E,
  ParentChanged = 0x800F, HelpChanged = 0x80A0, DefaultActionChanged = 0x80B0, AcceleratorChanged = 0x80C0
}
 This enum type defines accessible event types. More...
 
typedef QAccessibleInterface *(* InterfaceFactory) (const QString &key, QObject *)
 This is a typedef for a pointer to a function with the following signature: More...
 
enum  Method {
  ListSupportedMethods = 0, SetCursorPosition = 1, GetCursorPosition = 2, ForegroundColor = 3,
  BackgroundColor = 4
}
 This enum describes the possible types of methods that can be invoked on an accessible object. More...
 
enum  RelationFlag {
  Unrelated = 0x00000000, Self = 0x00000001, Ancestor = 0x00000002, Child = 0x00000004,
  Descendent = 0x00000008, Sibling = 0x00000010, HierarchyMask = 0x000000ff, Up = 0x00000100,
  Down = 0x00000200, Left = 0x00000400, Right = 0x00000800, Covers = 0x00001000,
  Covered = 0x00002000, GeometryMask = 0x0000ff00, FocusChild = 0x00010000, Label = 0x00020000,
  Labelled = 0x00040000, Controller = 0x00080000, Controlled = 0x00100000, LogicalMask = 0x00ff0000
}
 This enum type defines bit flags that can be combined to indicate the relationship between two accessible objects. More...
 
enum  Role {
  NoRole = 0x00000000, TitleBar = 0x00000001, MenuBar = 0x00000002, ScrollBar = 0x00000003,
  Grip = 0x00000004, Sound = 0x00000005, Cursor = 0x00000006, Caret = 0x00000007,
  AlertMessage = 0x00000008, Window = 0x00000009, Client = 0x0000000A, PopupMenu = 0x0000000B,
  MenuItem = 0x0000000C, ToolTip = 0x0000000D, Application = 0x0000000E, Document = 0x0000000F,
  Pane = 0x00000010, Chart = 0x00000011, Dialog = 0x00000012, Border = 0x00000013,
  Grouping = 0x00000014, Separator = 0x00000015, ToolBar = 0x00000016, StatusBar = 0x00000017,
  Table = 0x00000018, ColumnHeader = 0x00000019, RowHeader = 0x0000001A, Column = 0x0000001B,
  Row = 0x0000001C, Cell = 0x0000001D, Link = 0x0000001E, HelpBalloon = 0x0000001F,
  Assistant = 0x00000020, List = 0x00000021, ListItem = 0x00000022, Tree = 0x00000023,
  TreeItem = 0x00000024, PageTab = 0x00000025, PropertyPage = 0x00000026, Indicator = 0x00000027,
  Graphic = 0x00000028, StaticText = 0x00000029, EditableText = 0x0000002A, PushButton = 0x0000002B,
  CheckBox = 0x0000002C, RadioButton = 0x0000002D, ComboBox = 0x0000002E, ProgressBar = 0x00000030,
  Dial = 0x00000031, HotkeyField = 0x00000032, Slider = 0x00000033, SpinBox = 0x00000034,
  Canvas = 0x00000035, Animation = 0x00000036, Equation = 0x00000037, ButtonDropDown = 0x00000038,
  ButtonMenu = 0x00000039, ButtonDropGrid = 0x0000003A, Whitespace = 0x0000003B, PageTabList = 0x0000003C,
  Clock = 0x0000003D, Splitter = 0x0000003E, LayeredPane = 0x0000003F, Terminal = 0x00000040,
  Desktop = 0x00000041, UserRole = 0x0000ffff
}
 This enum defines the role of an accessible object. More...
 
typedef void(* RootObjectHandler) (QObject *)
 A function pointer type. More...
 
enum  StateFlag {
  Normal = 0x00000000, Unavailable = 0x00000001, Selected = 0x00000002, Focused = 0x00000004,
  Pressed = 0x00000008, Checked = 0x00000010, Mixed = 0x00000020, ReadOnly = 0x00000040,
  HotTracked = 0x00000080, DefaultButton = 0x00000100, Expanded = 0x00000200, Collapsed = 0x00000400,
  Busy = 0x00000800, Marqueed = 0x00002000, Animated = 0x00004000, Invisible = 0x00008000,
  Offscreen = 0x00010000, Sizeable = 0x00020000, Movable = 0x00040000, SelfVoicing = 0x00080000,
  Focusable = 0x00100000, Selectable = 0x00200000, Linked = 0x00400000, Traversed = 0x00800000,
  MultiSelectable = 0x01000000, ExtSelectable = 0x02000000, Protected = 0x20000000, HasPopup = 0x40000000,
  Modal = 0x80000000, HasInvokeExtension = 0x10000000
}
 This enum type defines bit flags that can be combined to indicate the state of an accessible object. More...
 
enum  Text {
  Name = 0, Description, Value, Help,
  Accelerator, UserText = 0x0000ffff
}
 This enum specifies string information that an accessible object returns. More...
 
typedef void(* UpdateHandler) (QObject *, int who, Event reason)
 A function pointer type. More...
 
- Static Public Functions inherited from QAccessible
static void cleanup ()
 
static void initialize ()
 
static void installFactory (InterfaceFactory)
 Installs the InterfaceFactory factory. More...
 
static RootObjectHandler installRootObjectHandler (RootObjectHandler)
 Installs the given handler as the function to be used by setRootObject(), and returns the previously installed handler. More...
 
static UpdateHandler installUpdateHandler (UpdateHandler)
 Installs the given handler as the function to be used by updateAccessibility(), and returns the previously installed handler. More...
 
static bool isActive ()
 Returns true if an accessibility implementation has been requested during the runtime of the application; otherwise returns false. More...
 
static QAccessibleInterfacequeryAccessibleInterface (QObject *)
 If a QAccessibleInterface implementation exists for the given object, this function returns a pointer to the implementation; otherwise it returns 0. More...
 
static void removeFactory (InterfaceFactory)
 Removes factory from the list of installed InterfaceFactories. More...
 
static void setRootObject (QObject *)
 Sets the root accessible object of this application to object. More...
 
static void updateAccessibility (QObject *, int who, Event reason)
 Notifies accessibility clients about a change in object's accessibility information. More...
 

Detailed Description

Definition at line 163 of file complexwidgets.h.

Constructors and Destructors

◆ QAccessibleItemView()

QAccessibleItemView::QAccessibleItemView ( QWidget w)
explicit

Definition at line 806 of file complexwidgets.cpp.

Referenced by navigate().

807  : QAccessibleAbstractScrollArea(w->objectName() == QLatin1String("qt_scrollarea_viewport") ? w->parentWidget() : w)
808 {
809  atVP = w->objectName() == QLatin1String("qt_scrollarea_viewport");
810 
811 }
QWidget * parentWidget() const
Returns the parent of this widget, or 0 if it does not have any parent widget.
Definition: qwidget.h:1035
QAccessibleAbstractScrollArea(QWidget *widget)
QLatin1String(DBUS_INTERFACE_DBUS))) Q_GLOBAL_STATIC_WITH_ARGS(QString
QString objectName() const

Functions

◆ accessibleAt()

QAccessibleInterface * QAccessibleItemView::accessibleAt ( int  row,
int  column 
)
virtual

Implements QAccessibleTableInterface.

Definition at line 1161 of file complexwidgets.cpp.

1162 {
1163  QWidget *indexWidget = itemView()->indexWidget(index(row, column));
1164  return QAccessible::queryAccessibleInterface(indexWidget);
1165 }
The QWidget class is the base class of all user interface objects.
Definition: qwidget.h:150
QWidget * indexWidget(const QModelIndex &index) const
Returns the widget for the item at the given index.
QAbstractItemView * itemView() const
static QAccessibleInterface * queryAccessibleInterface(QObject *)
If a QAccessibleInterface implementation exists for the given object, this function returns a pointer...
QModelIndex index(int row, int column) const

◆ atViewport()

bool QAccessibleItemView::atViewport ( ) const
inlineprivate

◆ caption()

QAccessibleInterface * QAccessibleItemView::caption ( )
virtual

Implements QAccessibleTableInterface.

Definition at line 1168 of file complexwidgets.cpp.

1169 {
1170  return 0;
1171 }

◆ cellAtIndex()

void QAccessibleItemView::cellAtIndex ( int  index,
int *  row,
int *  column,
int *  rowSpan,
int *  columnSpan,
bool *  isSelected 
)
virtual

Implements QAccessibleTableInterface.

Definition at line 1334 of file complexwidgets.cpp.

1336 {
1337  *row = rowIndex(index);
1338  *column = columnIndex(index);
1339  *rSpan = rowSpan(*row, *column);
1340  *cSpan = columnSpan(*row, *column);
1341  *isSelect = isSelected(*row, *column);
1342 }
int columnIndex(int childIndex)
int rowSpan(int row, int column)
int columnSpan(int row, int column)
int rowIndex(int childIndex)
bool isSelected(int row, int column)
QModelIndex index(int row, int column) const

◆ childAt()

int QAccessibleItemView::childAt ( int  x,
int  y 
) const
virtual

Returns the 1-based index of the child that contains the screen coordinates (x, y).

This function returns 0 if the point is positioned on the object itself. If the tested point is outside the boundaries of the object this function returns -1.

This function is only relyable for visible objects (invisible object might not be laid out correctly).

All visual objects provide this information.

See also
rect()

Reimplemented from QAccessibleAbstractScrollArea.

Definition at line 1052 of file complexwidgets.cpp.

1053 {
1054  if (atViewport()) {
1055  QPoint p(x, y);
1056  for (int i = childCount(); i >= 0; --i) {
1057  if (rect(i).contains(p))
1058  return i;
1059  }
1060  return -1;
1061  } else {
1063  }
1064 }
int childCount() const
Returns the number of children that belong to this object.
int childAt(int x, int y) const
Returns the 1-based index of the child that contains the screen coordinates (x, y).
The QPoint class defines a point in the plane using integer precision.
Definition: qpoint.h:53
QRect rect(int child) const
Returns the geometry of the object, or of the object&#39;s child if child is not 0.
bool atViewport() const

◆ childCount()

int QAccessibleItemView::childCount ( ) const
virtual

Returns the number of children that belong to this object.

A child can provide accessibility information on its own (e.g. a child widget), or be a sub-element of this accessible object.

All objects provide this information.

See also
indexOfChild()

Reimplemented from QAccessibleAbstractScrollArea.

Definition at line 944 of file complexwidgets.cpp.

Referenced by childAt().

945 {
946  if (atViewport()) {
947  if (itemView()->model() == 0)
948  return 0;
950  QModelIndex idx = m->index(0,0);
951  if (!idx.isValid())
952  return 0;
954  int count = 1;
955  while (it.next()) {
956  ++count;
957  }
958  if (horizontalHeader())
959  ++count;
960 
961  return count;
962  } else {
964  }
965 }
#define it(className, varName)
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...
QAbstractItemView * itemView() const
bool isValid() const
Returns true if this model index is valid; otherwise returns false.
The QAbstractItemModel class provides the abstract interface for item model classes.
The QModelIndex class is used to locate data in a data model.
int childCount() const
Returns the number of children that belong to this object.
QHeaderView * horizontalHeader() const
QAbstractItemModel * model() const
Returns the model that this view is presenting.
bool atViewport() const

◆ childIndex() [1/2]

QModelIndex QAccessibleItemView::childIndex ( int  child) const

Definition at line 915 of file complexwidgets.cpp.

Referenced by navigate(), setText(), state(), and text().

916 {
917  if (!atViewport())
918  return QModelIndex();
920  it.next(child - 1);
921  return it.current();
922 }
#define it(className, varName)
QAbstractItemView * itemView() const
The QModelIndex class is used to locate data in a data model.
bool atViewport() const

◆ childIndex() [2/2]

int QAccessibleItemView::childIndex ( int  rowIndex,
int  columnIndex 
)
virtual

Implements QAccessibleTableInterface.

Definition at line 1174 of file complexwidgets.cpp.

1175 {
1176  return rowIndex * itemView()->model()->columnCount() + columnIndex;
1177 }
int columnIndex(int childIndex)
virtual int columnCount(const QModelIndex &parent=QModelIndex()) const =0
Returns the number of columns for the children of the given parent.
int rowIndex(int childIndex)
QAbstractItemView * itemView() const
QAbstractItemModel * model() const
Returns the model that this view is presenting.

◆ columnCount()

int QAccessibleItemView::columnCount ( )
virtual

Implements QAccessibleTableInterface.

Definition at line 1214 of file complexwidgets.cpp.

Referenced by columnIndex(), and rowIndex().

1215 {
1216  return itemView()->model()->columnCount();
1217 }
virtual int columnCount(const QModelIndex &parent=QModelIndex()) const =0
Returns the number of columns for the children of the given parent.
QAbstractItemView * itemView() const
QAbstractItemModel * model() const
Returns the model that this view is presenting.

◆ columnDescription()

QString QAccessibleItemView::columnDescription ( int  column)
virtual

Implements QAccessibleTableInterface.

Definition at line 1180 of file complexwidgets.cpp.

1181 {
1182  return itemView()->model()->headerData(column, Qt::Horizontal).toString();
1183 }
QString toString() const
Returns the variant as a QString if the variant has type() String , Bool , ByteArray ...
Definition: qvariant.cpp:2270
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.
QAbstractItemView * itemView() const
QAbstractItemModel * model() const
Returns the model that this view is presenting.

◆ columnHeader()

QAccessibleInterface * QAccessibleItemView::columnHeader ( )
virtual

Implements QAccessibleTableInterface.

Definition at line 1192 of file complexwidgets.cpp.

1193 {
1194 #ifndef QT_NO_TREEVIEW
1195  if (QTreeView *tree = qobject_cast<QTreeView *>(itemView()))
1196  return QAccessible::queryAccessibleInterface(tree->header());
1197 #endif
1198 #ifndef QT_NO_TABLEVIEW
1199  if (QTableView *table = qobject_cast<QTableView *>(itemView()))
1200  return QAccessible::queryAccessibleInterface(table->horizontalHeader());
1201 #endif
1202  return 0;
1203 }
The QTreeView class provides a default model/view implementation of a tree view.
Definition: qtreeview.h:58
QAbstractItemView * itemView() const
The QTableView class provides a default model/view implementation of a table view.
Definition: qtableview.h:58
static QAccessibleInterface * queryAccessibleInterface(QObject *)
If a QAccessibleInterface implementation exists for the given object, this function returns a pointer...

◆ columnIndex()

int QAccessibleItemView::columnIndex ( int  childIndex)
virtual

Implements QAccessibleTableInterface.

Definition at line 1205 of file complexwidgets.cpp.

Referenced by cellAtIndex(), and childIndex().

1206 {
1207  int columnCount = itemView()->model()->columnCount();
1208  if (!columnCount)
1209  return 0;
1210 
1211  return childIndex % columnCount;
1212 }
virtual int columnCount(const QModelIndex &parent=QModelIndex()) const =0
Returns the number of columns for the children of the given parent.
QAbstractItemView * itemView() const
QAbstractItemModel * model() const
Returns the model that this view is presenting.
QModelIndex childIndex(int child) const

◆ columnSpan()

int QAccessibleItemView::columnSpan ( int  row,
int  column 
)
virtual

Implements QAccessibleTableInterface.

Definition at line 1186 of file complexwidgets.cpp.

Referenced by cellAtIndex().

1187 {
1188  return 1;
1189 }

◆ entryFromIndex()

int QAccessibleItemView::entryFromIndex ( const QModelIndex index) const

Definition at line 924 of file complexwidgets.cpp.

Referenced by indexOfChild().

925 {
926  int entry = -1;
927  if (false) {
928 #ifndef QT_NO_TREEVIEW
929  } else if (QTreeView *tree = qobject_cast<QTreeView*>(itemView())) {
930  entry = tree->visualIndex(index) + 1;
931 #endif
932 #ifndef QT_NO_LISTVIEW
933  } else if (QListView *list = qobject_cast<QListView*>(itemView())) {
934  entry = list->visualIndex(index) + 1;
935 #endif
936 #ifndef QT_NO_TABLEVIEW
937  } else if (QTableView *table = qobject_cast<QTableView*>(itemView())) {
938  entry = table->visualIndex(index) + 1;
939 #endif
940  }
941  return entry;
942 }
The QTreeView class provides a default model/view implementation of a tree view.
Definition: qtreeview.h:58
QAbstractItemView * itemView() const
The QTableView class provides a default model/view implementation of a table view.
Definition: qtableview.h:58
The QListView class provides a list or icon view onto a model.
Definition: qlistview.h:57

◆ expectedRoleOfChildren()

QAccessible::Role QAccessibleItemView::expectedRoleOfChildren ( ) const
private

◆ horizontalHeader()

QHeaderView * QAccessibleItemView::horizontalHeader ( ) const

Definition at line 814 of file complexwidgets.cpp.

Referenced by childCount(), indexOfChild(), navigate(), rect(), and state().

815 {
816  QHeaderView *header = 0;
817  if (false) {
818 #ifndef QT_NO_TABLEVIEW
819  } else if (const QTableView *tv = qobject_cast<const QTableView*>(itemView())) {
820  header = tv->horizontalHeader();
821 #endif
822 #ifndef QT_NO_TREEVIEW
823  } else if (const QTreeView *tv = qobject_cast<const QTreeView*>(itemView())) {
824  header = tv->header();
825 #endif
826  }
827  return header;
828 }
The QTreeView class provides a default model/view implementation of a tree view.
Definition: qtreeview.h:58
QAbstractItemView * itemView() const
The QTableView class provides a default model/view implementation of a table view.
Definition: qtableview.h:58
The QHeaderView class provides a header row or header column for item views.
Definition: qheaderview.h:58

◆ index()

QModelIndex QAccessibleItemView::index ( int  row,
int  column 
) const
protected

Definition at line 1156 of file complexwidgets.cpp.

Referenced by accessibleAt(), isSelected(), navigate(), selectColumn(), selectRow(), unselectColumn(), and unselectRow().

1157 {
1158  return itemView()->model()->index(row, column);
1159 }
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...
QAbstractItemView * itemView() const
QAbstractItemModel * model() const
Returns the model that this view is presenting.

◆ indexOfChild()

int QAccessibleItemView::indexOfChild ( const QAccessibleInterface child) const
virtual

Returns the 1-based index of the object child in this object's children list, or -1 if child is not a child of this object.

0 is not a possible return value.

All objects provide this information about their children.

See also
childCount()

Reimplemented from QAccessibleAbstractScrollArea.

Definition at line 888 of file complexwidgets.cpp.

889 {
890  if (atViewport()) {
891  if (!iface || !isValidChildRole(iface->role(0)))
892  return -1;
893 
894  int entry = -1;
895  // ### This will fail if a row is hidden.
896  const QAccessibleItemRow *ifRow = static_cast<const QAccessibleItemRow *>(iface);
897  if (ifRow->horizontalHeader())
898  return 1;
899 
900  QModelIndex idx = ifRow->row;
901  if (!idx.isValid())
902  return -1;
903 
904  entry = entryFromIndex(idx);
905  if (horizontalHeader())
906  ++entry;
907 
908  return entry;
909 
910  } else {
912  }
913 }
bool isValidChildRole(QAccessible::Role role) const
int entryFromIndex(const QModelIndex &index) const
bool isValid() const
Returns true if this model index is valid; otherwise returns false.
int indexOfChild(const QAccessibleInterface *child) const
Returns the 1-based index of the object child in this object&#39;s children list, or -1 if child is not a...
The QModelIndex class is used to locate data in a data model.
QHeaderView * horizontalHeader() const
QHeaderView * horizontalHeader() const
bool atViewport() const
QPersistentModelIndex row

◆ isColumnSelected()

bool QAccessibleItemView::isColumnSelected ( int  column)
virtual

Implements QAccessibleTableInterface.

Definition at line 1295 of file complexwidgets.cpp.

1296 {
1297  return itemView()->selectionModel()->isColumnSelected(column, QModelIndex());
1298 }
bool isColumnSelected(int column, const QModelIndex &parent) const
Returns true if all items are selected in the column with the given parent.
QItemSelectionModel * selectionModel() const
Returns the current selection model.
QAbstractItemView * itemView() const
The QModelIndex class is used to locate data in a data model.

◆ isRowSelected()

bool QAccessibleItemView::isRowSelected ( int  row)
virtual

Implements QAccessibleTableInterface.

Definition at line 1300 of file complexwidgets.cpp.

1301 {
1302  return itemView()->selectionModel()->isRowSelected(row, QModelIndex());
1303 }
QItemSelectionModel * selectionModel() const
Returns the current selection model.
QAbstractItemView * itemView() const
The QModelIndex class is used to locate data in a data model.
bool isRowSelected(int row, const QModelIndex &parent) const
Returns true if all items are selected in the row with the given parent.

◆ isSelected()

bool QAccessibleItemView::isSelected ( int  row,
int  column 
)
virtual

Implements QAccessibleTableInterface.

Definition at line 1305 of file complexwidgets.cpp.

Referenced by cellAtIndex().

1306 {
1307  return itemView()->selectionModel()->isSelected(index(row, column));
1308 }
QItemSelectionModel * selectionModel() const
Returns the current selection model.
bool isSelected(const QModelIndex &index) const
Returns true if the given model item index is selected.
QAbstractItemView * itemView() const
QModelIndex index(int row, int column) const

◆ isValid()

bool QAccessibleItemView::isValid ( ) const
virtual

Returns true if all the data necessary to use this interface implementation is valid (e.

g. all pointers are non-null); otherwise returns false.

See also
object()

Reimplemented from QAccessibleAbstractScrollArea.

Definition at line 1114 of file complexwidgets.cpp.

1115 {
1116  if (atViewport())
1118  else
1120 }
bool isValid() const
Returns true if all the data necessary to use this interface implementation is valid (e...
bool isValid() const
Returns true if all the data necessary to use this interface implementation is valid (e...
bool atViewport() const

◆ isValidChildRole()

bool QAccessibleItemView::isValidChildRole ( QAccessible::Role  role) const

Definition at line 843 of file complexwidgets.cpp.

Referenced by indexOfChild().

844 {
845  if (atViewport()) {
846  if (false) {
847 #ifndef QT_NO_TREEVIEW
848  } else if (qobject_cast<const QTreeView*>(itemView())) {
849  return (role == TreeItem || role == Row);
850 #endif
851 #ifndef QT_NO_LISTVIEW
852  } else if (qobject_cast<const QListView*>(itemView())) {
853  return (role == ListItem);
854 #endif
855  }
856  // TableView
857  return role == Row;
858  } else {
859  if (false) {
860 #ifndef QT_NO_TREEVIEW
861  } else if (qobject_cast<const QTreeView*>(itemView())) {
862  return (role == Tree);
863 #endif
864 #ifndef QT_NO_LISTVIEW
865  } else if (qobject_cast<const QListView*>(itemView())) {
866  return (role == List);
867 #endif
868  }
869  // TableView
870  return (role == Table);
871  }
872 }
QAbstractItemView * itemView() const
The Row item arranges its children horizontally.
Role role(int child) const
Returns the role of the object, or of the object&#39;s child if child is not 0.
bool atViewport() const

◆ itemView()

QAbstractItemView * QAccessibleItemView::itemView ( ) const
protected

◆ navigate()

int QAccessibleItemView::navigate ( RelationFlag  relation,
int  index,
QAccessibleInterface **  iface 
) const
virtual

Navigates from this object to an object that has a relationship relation to this object, and returns the respective object in target.

It is the caller's responsibility to delete *target after use.

If an object is found, target is set to point to the object, and the index of the child of target is returned. The return value is 0 if target itself is the requested object. target is set to null if this object is the target object (i.e. the requested object is a handled by this object).

If no object is found target is set to null, and the return value is -1.

The entry parameter has two different meanings:

  • Hierarchical and Logical relationships – if multiple objects with the requested relationship exist entry specifies which one to return. entry is 1-based, e.g. use 1 to get the first (and possibly only) object with the requested relationship.

    The following code demonstrates how to use this function to navigate to the first child of an object:

    int targetChild = object->navigate(Accessible::Child, 1, &child);
    if (child) {
    // ...
    delete child;
    }
  • Geometric relationships – the index of the child from which to start navigating in the specified direction. entry can be 0 to navigate to a sibling of this object, or non-null to navigate within contained children that don't provide their own accessible information.

Note that the Descendent value for relation is not supported.

All objects support navigation.

See also
relationTo(), childCount()

Reimplemented from QAccessibleAbstractScrollArea.

Definition at line 1122 of file complexwidgets.cpp.

Referenced by QAccessibleItemRow::navigate(), and rect().

1124 {
1125  if (atViewport()) {
1126  if (relation == Ancestor && index == 1) {
1127  *iface = new QAccessibleItemView(itemView());
1128  return 0;
1129  } else if (relation == Child && index >= 1) {
1130  if (horizontalHeader()) {
1131  if (index == 1) {
1132  *iface = new QAccessibleItemRow(itemView(), QModelIndex(), true);
1133  return 0;
1134  }
1135  --index;
1136  }
1137 
1138  //###JAS hidden rows..
1139  QModelIndex idx = childIndex(index);
1140  if (idx.isValid()) {
1141  *iface = new QAccessibleItemRow(itemView(), idx);
1142  return 0;
1143  }
1144  } else if (relation == Sibling && index >= 1) {
1146  return parent->navigate(Child, index, iface);
1147  }
1148  *iface = 0;
1149  return -1;
1150  } else {
1151  return QAccessibleAbstractScrollArea::navigate(relation, index, iface);
1152  }
1153 }
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.
QAccessibleItemView(QWidget *w)
QAbstractItemView * itemView() const
bool isValid() const
Returns true if this model index is valid; otherwise returns false.
The QAccessibleInterface class defines an interface that exposes information about accessible objects...
Definition: qaccessible.h:370
The QModelIndex class is used to locate data in a data model.
QModelIndex index(int row, int column) const
int navigate(RelationFlag relation, int entry, QAccessibleInterface **target) const
Navigates from this object to an object that has a relationship relation to this object, and returns the respective object in target.
QHeaderView * horizontalHeader() const
bool atViewport() const
QModelIndex childIndex(int child) const

◆ object()

QObject * QAccessibleItemView::object ( ) const
virtual

Returns a pointer to the QObject this interface implementation provides information for.

See also
isValid()

Reimplemented from QAccessibleObjectEx.

Definition at line 874 of file complexwidgets.cpp.

875 {
877  Q_ASSERT(qobject_cast<const QAbstractItemView *>(view));
878  if (atViewport())
879  view = qobject_cast<const QAbstractItemView *>(view)->viewport();
880  return view;
881 }
T qobject_cast(QObject *object)
Definition: qobject.h:375
QObject * object() const
Returns a pointer to the QObject this interface implementation provides information for...
#define Q_ASSERT(cond)
Definition: qglobal.h:1823
The QObject class is the base class of all Qt objects.
Definition: qobject.h:111
The QAbstractItemView class provides the basic functionality for item view classes.
bool atViewport() const

◆ rect()

QRect QAccessibleItemView::rect ( int  child) const
virtual

Returns the geometry of the object, or of the object's child if child is not 0.

The geometry is in screen coordinates.

This function is only reliable for visible objects (invisible objects might not be laid out correctly).

All visual objects provide this information.

See also
childAt()

Reimplemented from QAccessibleAbstractScrollArea.

Definition at line 999 of file complexwidgets.cpp.

Referenced by childAt().

1000 {
1001  if (atViewport()) {
1002  QRect r;
1003  if (!child) {
1004  // Make sure that the rect *include* the vertical and horizontal headers, while
1005  // not including the potential vertical and horizontal scrollbars.
1006  QAbstractItemView *w = itemView();
1007 
1008  int vscrollWidth = 0;
1009  const QScrollBar *sb = w->verticalScrollBar();
1010  if (sb && sb->isVisible())
1011  vscrollWidth = sb->width();
1012 
1013  int hscrollHeight = 0;
1014  sb = w->horizontalScrollBar();
1015  if (sb && sb->isVisible())
1016  hscrollHeight = sb->height();
1017 
1018  QPoint globalPos = w->mapToGlobal(QPoint(0,0));
1019  r = w->rect().translated(globalPos);
1020  if (w->isRightToLeft()) {
1021  r.adjust(vscrollWidth, 0, 0, -hscrollHeight);
1022  } else {
1023  r.adjust(0, 0, -vscrollWidth, -hscrollHeight);
1024  }
1025  } else {
1026  QAccessibleInterface *iface = 0;
1027  if (navigate(Child, child, &iface) == 0) {
1028  r = iface->rect(0);
1029  delete iface;
1030  }
1031  }
1032  return r;
1033  } else {
1035  if (child == 1) {
1036  // include the potential vertical and horizontal headers
1037 
1038  const QHeaderView *header = verticalHeader();
1039  int headerWidth = (header && header->isVisible()) ? header->width() : 0;
1040  header = horizontalHeader();
1041  int headerHeight= (header && header->isVisible()) ? header->height() : 0;
1042  if (itemView()->isRightToLeft()) {
1043  r.adjust(0, -headerHeight, headerWidth, 0);
1044  } else {
1045  r.adjust(-headerWidth, -headerHeight, 0, 0);
1046  }
1047  }
1048  return r;
1049  }
1050 }
bool isVisible() const
Definition: qwidget.h:1005
QRect translated(int dx, int dy) const
Returns a copy of the rectangle that is translated dx along the x axis and dy along the y axis...
Definition: qrect.h:328
QScrollBar * verticalScrollBar() const
Returns the vertical scroll bar.
int height() const
The QScrollBar widget provides a vertical or horizontal scroll bar.
Definition: qscrollbar.h:59
int width() const
void adjust(int x1, int y1, int x2, int y2)
Adds dx1, dy1, dx2 and dy2 respectively to the existing coordinates of the rectangle.
Definition: qrect.h:434
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.
QAbstractItemView * itemView() const
QRect rect() const
The QAbstractItemView class provides the basic functionality for item view classes.
QHeaderView * verticalHeader() const
The QAccessibleInterface class defines an interface that exposes information about accessible objects...
Definition: qaccessible.h:370
The QPoint class defines a point in the plane using integer precision.
Definition: qpoint.h:53
QScrollBar * horizontalScrollBar() const
Returns the horizontal scroll bar.
The QRect class defines a rectangle in the plane using integer precision.
Definition: qrect.h:58
virtual QRect rect(int child) const =0
Returns the geometry of the object, or of the object&#39;s child if child is not 0.
bool isRightToLeft() const
Definition: qwidget.h:428
QHeaderView * horizontalHeader() const
QRect rect(int child) const
Returns the geometry of the object, or of the object&#39;s child if child is not 0.
bool atViewport() const
QPoint mapToGlobal(const QPoint &) const
Translates the widget coordinate pos to global screen coordinates.
The QHeaderView class provides a header row or header column for item views.
Definition: qheaderview.h:58

◆ role()

QAccessible::Role QAccessibleItemView::role ( int  child) const
virtual

Returns the role of the object, or of the object's child if child is not 0.

The role of an object is usually static.

All accessible objects have a role.

See also
text(), state()

Reimplemented from QAccessibleWidgetEx.

Definition at line 1066 of file complexwidgets.cpp.

1067 {
1068  if ((!atViewport() && child) || (atViewport() && child == 0)) {
1069  QAbstractItemView *view = itemView();
1070 #ifndef QT_NO_TABLEVIEW
1071  if (qobject_cast<QTableView *>(view))
1072  return Table;
1073 #endif
1074 #ifndef QT_NO_LISTVIEW
1075  if (qobject_cast<QListView *>(view))
1076  return List;
1077 #endif
1078  return Tree;
1079  }
1080  if (atViewport()) {
1081  if (child)
1082  return Row;
1083  }
1084 
1086 }
Role role(int child) const
Returns the role of the object, or of the object&#39;s child if child is not 0.
QAbstractItemView * itemView() const
The QAbstractItemView class provides the basic functionality for item view classes.
bool atViewport() const

◆ rowCount()

int QAccessibleItemView::rowCount ( )
virtual

Implements QAccessibleTableInterface.

Definition at line 1219 of file complexwidgets.cpp.

1220 {
1221  return itemView()->model()->rowCount();
1222 }
virtual int rowCount(const QModelIndex &parent=QModelIndex()) const =0
Returns the number of rows under the given parent.
QAbstractItemView * itemView() const
QAbstractItemModel * model() const
Returns the model that this view is presenting.

◆ rowDescription()

QString QAccessibleItemView::rowDescription ( int  row)
virtual

Implements QAccessibleTableInterface.

Definition at line 1234 of file complexwidgets.cpp.

1235 {
1236  return itemView()->model()->headerData(row, Qt::Vertical).toString();
1237 }
QString toString() const
Returns the variant as a QString if the variant has type() String , Bool , ByteArray ...
Definition: qvariant.cpp:2270
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.
QAbstractItemView * itemView() const
QAbstractItemModel * model() const
Returns the model that this view is presenting.

◆ rowHeader()

QAccessibleInterface * QAccessibleItemView::rowHeader ( )
virtual

Implements QAccessibleTableInterface.

Definition at line 1245 of file complexwidgets.cpp.

1246 {
1247 #ifndef QT_NO_TABLEVIEW
1248  if (QTableView *table = qobject_cast<QTableView *>(itemView()))
1249  return QAccessible::queryAccessibleInterface(table->verticalHeader());
1250 #endif
1251  return 0;
1252 }
QAbstractItemView * itemView() const
The QTableView class provides a default model/view implementation of a table view.
Definition: qtableview.h:58
static QAccessibleInterface * queryAccessibleInterface(QObject *)
If a QAccessibleInterface implementation exists for the given object, this function returns a pointer...

◆ rowIndex()

int QAccessibleItemView::rowIndex ( int  childIndex)
virtual

Implements QAccessibleTableInterface.

Definition at line 1254 of file complexwidgets.cpp.

Referenced by cellAtIndex().

1255 {
1256  int columnCount = itemView()->model()->columnCount();
1257  if (!columnCount)
1258  return 0;
1259 
1260  return int(childIndex / columnCount);
1261 }
virtual int columnCount(const QModelIndex &parent=QModelIndex()) const =0
Returns the number of columns for the children of the given parent.
QAbstractItemView * itemView() const
QAbstractItemModel * model() const
Returns the model that this view is presenting.
QModelIndex childIndex(int child) const

◆ rowSpan()

int QAccessibleItemView::rowSpan ( int  row,
int  column 
)
virtual

Implements QAccessibleTableInterface.

Definition at line 1240 of file complexwidgets.cpp.

Referenced by cellAtIndex().

1241 {
1242  return 1;
1243 }

◆ selectColumn()

void QAccessibleItemView::selectColumn ( int  column)
virtual

Implements QAccessibleTableInterface.

Definition at line 1316 of file complexwidgets.cpp.

1317 {
1320 }
The QItemSelectionModel class keeps track of a view&#39;s selected items.
QItemSelectionModel * selectionModel() const
Returns the current selection model.
QAbstractItemView * itemView() const
virtual void select(const QModelIndex &index, QItemSelectionModel::SelectionFlags command)
Selects the model item index using the specified command, and emits selectionChanged().
QModelIndex index(int row, int column) const

◆ selectedColumnCount()

int QAccessibleItemView::selectedColumnCount ( )
virtual

Implements QAccessibleTableInterface.

Definition at line 1224 of file complexwidgets.cpp.

1225 {
1226  return itemView()->selectionModel()->selectedColumns().count();
1227 }
int count(const T &t) const
Returns the number of occurrences of value in the list.
Definition: qlist.h:891
QItemSelectionModel * selectionModel() const
Returns the current selection model.
QAbstractItemView * itemView() const
QModelIndexList selectedColumns(int row=0) const
Returns the indexes in the given row for columns where all rows are selected.

◆ selectedColumns()

int QAccessibleItemView::selectedColumns ( int  maxColumns,
QList< int > *  columns 
)
virtual

Implements QAccessibleTableInterface.

Definition at line 1276 of file complexwidgets.cpp.

1277 {
1278  Q_ASSERT(columns);
1279 
1280  const QModelIndexList selColumns = itemView()->selectionModel()->selectedColumns();
1281  int maxCount = qMin(selColumns.count(), maxColumns);
1282 
1283  for (int i = 0; i < maxCount; ++i)
1284  columns->append(selColumns.at(i).row());
1285 
1286  return maxCount;
1287 }
Q_DECL_CONSTEXPR const T & qMin(const T &a, const T &b)
Definition: qglobal.h:1215
int count(const T &t) const
Returns the number of occurrences of value in the list.
Definition: qlist.h:891
#define Q_ASSERT(cond)
Definition: qglobal.h:1823
void append(const T &t)
Inserts value at the end of the list.
Definition: qlist.h:507
QItemSelectionModel * selectionModel() const
Returns the current selection model.
int row() const
Returns the row this model index refers to.
const T & at(int i) const
Returns the item at index position i in the list.
Definition: qlist.h:468
QAbstractItemView * itemView() const
QModelIndexList selectedColumns(int row=0) const
Returns the indexes in the given row for columns where all rows are selected.

◆ selectedRowCount()

int QAccessibleItemView::selectedRowCount ( )
virtual

Implements QAccessibleTableInterface.

Definition at line 1229 of file complexwidgets.cpp.

1230 {
1231  return itemView()->selectionModel()->selectedRows().count();
1232 }
QModelIndexList selectedRows(int column=0) const
Returns the indexes in the given column for the rows where all columns are selected.
int count(const T &t) const
Returns the number of occurrences of value in the list.
Definition: qlist.h:891
QItemSelectionModel * selectionModel() const
Returns the current selection model.
QAbstractItemView * itemView() const

◆ selectedRows()

int QAccessibleItemView::selectedRows ( int  maxRows,
QList< int > *  rows 
)
virtual

Implements QAccessibleTableInterface.

Definition at line 1263 of file complexwidgets.cpp.

1264 {
1265  Q_ASSERT(rows);
1266 
1267  const QModelIndexList selRows = itemView()->selectionModel()->selectedRows();
1268  int maxCount = qMin(selRows.count(), maxRows);
1269 
1270  for (int i = 0; i < maxCount; ++i)
1271  rows->append(selRows.at(i).row());
1272 
1273  return maxCount;
1274 }
QModelIndexList selectedRows(int column=0) const
Returns the indexes in the given column for the rows where all columns are selected.
Q_DECL_CONSTEXPR const T & qMin(const T &a, const T &b)
Definition: qglobal.h:1215
int count(const T &t) const
Returns the number of occurrences of value in the list.
Definition: qlist.h:891
#define Q_ASSERT(cond)
Definition: qglobal.h:1823
void append(const T &t)
Inserts value at the end of the list.
Definition: qlist.h:507
QItemSelectionModel * selectionModel() const
Returns the current selection model.
int row() const
Returns the row this model index refers to.
const T & at(int i) const
Returns the item at index position i in the list.
Definition: qlist.h:468
QAbstractItemView * itemView() const

◆ selectRow()

void QAccessibleItemView::selectRow ( int  row)
virtual

Implements QAccessibleTableInterface.

Definition at line 1310 of file complexwidgets.cpp.

1311 {
1314 }
The QItemSelectionModel class keeps track of a view&#39;s selected items.
QItemSelectionModel * selectionModel() const
Returns the current selection model.
QAbstractItemView * itemView() const
virtual void select(const QModelIndex &index, QItemSelectionModel::SelectionFlags command)
Selects the model item index using the specified command, and emits selectionChanged().
QModelIndex index(int row, int column) const

◆ setText()

void QAccessibleItemView::setText ( Text  t,
int  child,
const QString text 
)
virtual

Sets the text property t of the object, or of the object's child if child is not 0, to text.

Note that the text properties of most objects are read-only.

See also
text()

Reimplemented from QAccessibleAbstractScrollArea.

Definition at line 984 of file complexwidgets.cpp.

985 {
986  if (atViewport()) {
987  if (!child) {
989  return;
990  }
991 
992  QAccessibleItemRow item(itemView(), childIndex(child));
993  item.setText(t, 1, text);
994  } else {
996  }
997 }
void setText(Text textType, int child, const QString &text)
Sets the text property t of the object, or of the object&#39;s child if child is not 0, to text.
QAbstractItemView * itemView() const
bool atViewport() const
QModelIndex childIndex(int child) const

◆ state()

QAccessible::State QAccessibleItemView::state ( int  child) const
virtual

Returns the current state of the object, or of the object's child if child is not 0.

The returned value is a combination of the flags in the QAccessible::StateFlag enumeration.

All accessible objects have a state.

See also
text(), role()

Reimplemented from QAccessibleAbstractScrollArea.

Definition at line 1088 of file complexwidgets.cpp.

1089 {
1090  State st = Normal;
1091 
1092  if (itemView() == 0)
1093  return State(Unavailable);
1094 
1095  bool queryViewPort = (atViewport() && child == 0) || (!atViewport() && child == 1);
1096  if (queryViewPort) {
1098  st |= Selectable;
1099  st |= Focusable;
1100  }
1101  } else if (atViewport()) { // children of viewport
1102  if (horizontalHeader())
1103  --child;
1104  if (child) {
1105  QAccessibleItemRow item(itemView(), childIndex(child));
1106  st |= item.state(0);
1107  }
1108  } else if (!atViewport() && child != 1) {
1110  }
1111  return st;
1112 }
SelectionMode selectionMode
which selection mode the view operates in
The State element defines configurations of objects and properties.
QAbstractItemView * itemView() const
State
Definition: qaudio.h:59
State state(int child) const
Returns the current state of the object, or of the object&#39;s child if child is not 0...
#define st(var, type, card)
QHeaderView * horizontalHeader() const
bool atViewport() const
QModelIndex childIndex(int child) const

◆ summary()

QAccessibleInterface * QAccessibleItemView::summary ( )
virtual

Implements QAccessibleTableInterface.

Definition at line 1290 of file complexwidgets.cpp.

1291 {
1292  return 0;
1293 }

◆ text()

QString QAccessibleItemView::text ( Text  t,
int  child 
) const
virtual

Returns the value of the text property t of the object, or of the object's child if child is not 0.

The Name is a string used by clients to identify, find, or announce an accessible object for the user. All objects must have a name that is unique within their container. The name can be used differently by clients, so the name should both give a short description of the object and be unique.

An accessible object's Description provides textual information about an object's visual appearance. The description is primarily used to provide greater context for vision-impaired users, but is also used for context searching or other applications. Not all objects have a description. An "OK" button would not need a description, but a tool button that shows a picture of a smiley would.

The Value of an accessible object represents visual information contained by the object, e.g. the text in a line edit. Usually, the value can be modified by the user. Not all objects have a value, e.g. static text labels don't, and some objects have a state that already is the value, e.g. toggle buttons.

The Help text provides information about the function and usage of an accessible object. Not all objects provide this information.

The Accelerator is a keyboard shortcut that activates the object's default action. A keyboard shortcut is the underlined character in the text of a menu, menu item or widget, and is either the character itself, or a combination of this character and a modifier key like Alt, Ctrl or Shift. Command controls like tool buttons also have shortcut keys and usually display them in their tooltip.

All objects provide a string for Name .

See also
role(), state()

Reimplemented from QAccessibleAbstractScrollArea.

Definition at line 967 of file complexwidgets.cpp.

968 {
969  if (atViewport()) {
970  if (!child)
971  return QAccessibleAbstractScrollArea::text(t, child);
972 
973  QAccessibleItemRow item(itemView(), childIndex(child));
974  if (item.isValid()) {
975  return item.text(t, 1);
976  } else {
977  return QString();
978  }
979  } else {
980  return QAccessibleAbstractScrollArea::text(t, child);
981  }
982 }
The QString class provides a Unicode character string.
Definition: qstring.h:83
QAbstractItemView * itemView() const
QString text(Text textType, int child) const
Returns the value of the text property t of the object, or of the object&#39;s child if child is not 0...
bool atViewport() const
QModelIndex childIndex(int child) const

◆ unselectColumn()

void QAccessibleItemView::unselectColumn ( int  column)
virtual

Implements QAccessibleTableInterface.

Definition at line 1328 of file complexwidgets.cpp.

1329 {
1332 }
The QItemSelectionModel class keeps track of a view&#39;s selected items.
QItemSelectionModel * selectionModel() const
Returns the current selection model.
QAbstractItemView * itemView() const
virtual void select(const QModelIndex &index, QItemSelectionModel::SelectionFlags command)
Selects the model item index using the specified command, and emits selectionChanged().
QModelIndex index(int row, int column) const

◆ unselectRow()

void QAccessibleItemView::unselectRow ( int  row)
virtual

Implements QAccessibleTableInterface.

Definition at line 1322 of file complexwidgets.cpp.

1323 {
1326 }
The QItemSelectionModel class keeps track of a view&#39;s selected items.
QItemSelectionModel * selectionModel() const
Returns the current selection model.
QAbstractItemView * itemView() const
virtual void select(const QModelIndex &index, QItemSelectionModel::SelectionFlags command)
Selects the model item index using the specified command, and emits selectionChanged().
QModelIndex index(int row, int column) const

◆ verticalHeader()

QHeaderView * QAccessibleItemView::verticalHeader ( ) const

Definition at line 830 of file complexwidgets.cpp.

Referenced by rect().

831 {
832  QHeaderView *header = 0;
833  if (false) {
834 #ifndef QT_NO_TABLEVIEW
835  } else if (const QTableView *tv = qobject_cast<const QTableView*>(itemView())) {
836  header = tv->verticalHeader();
837 #endif
838  }
839  return header;
840 }
QAbstractItemView * itemView() const
The QTableView class provides a default model/view implementation of a table view.
Definition: qtableview.h:58
The QHeaderView class provides a header row or header column for item views.
Definition: qheaderview.h:58

Properties

◆ atVP

bool QAccessibleItemView::atVP
private

Definition at line 226 of file complexwidgets.h.

Referenced by QAccessibleItemView().


The documentation for this class was generated from the following files: