Qt 4.8
Public Functions | Properties | List of all members
QItemViewInterfaceFactory Class Reference
Inheritance diagram for QItemViewInterfaceFactory:
QInterfaceFactory

Public Functions

QAElement element (int id)
 
QAElement element (const QAInterface &interface)
 
QAInterface interface (UInt64 identifier)
 
 QItemViewInterfaceFactory (const QAInterface &interface)
 
void registerChildren ()
 
 ~QItemViewInterfaceFactory ()
 
- Public Functions inherited from QInterfaceFactory
virtual ~QInterfaceFactory ()
 

Properties

int columnCount
 
QAInterface m_interface
 
HIObjectRef object
 

Detailed Description

Definition at line 910 of file qaccessible_mac.mm.

Constructors and Destructors

◆ QItemViewInterfaceFactory()

QItemViewInterfaceFactory::QItemViewInterfaceFactory ( const QAInterface interface)
inline

Definition at line 913 of file qaccessible_mac.mm.

914  : m_interface(interface), object(interface.hiObject())
915  {
916  CFRetain(object);
917  columnCount = 0;
918  if (QTableView * tableView = qobject_cast<QTableView *>(interface.parent().object())) {
919  if (tableView->model())
920  columnCount = tableView->model()->columnCount();
921  if (tableView->verticalHeader())
922  ++columnCount;
923  }
924  }
HIObjectRef hiObject() const
QAInterface parent() const
The QTableView class provides a default model/view implementation of a table view.
Definition: qtableview.h:58
QObject * object() const

◆ ~QItemViewInterfaceFactory()

QItemViewInterfaceFactory::~QItemViewInterfaceFactory ( )
inline

Definition at line 926 of file qaccessible_mac.mm.

927  {
928  CFRelease(object);
929  }

Functions

◆ element() [1/2]

QAElement QItemViewInterfaceFactory::element ( int  id)
inlinevirtual

Implements QInterfaceFactory.

Definition at line 963 of file qaccessible_mac.mm.

964  {
965  if (id != 0) {
966  return QAElement();
967  }
968  return QAElement(object, 0);
969  }

◆ element() [2/2]

QAElement QItemViewInterfaceFactory::element ( const QAInterface interface)
inlinevirtual

Reimplemented from QInterfaceFactory.

Definition at line 971 of file qaccessible_mac.mm.

972  {
973  if (interface.object() && interface.object() == m_interface.object()) {
974  return QAElement(object, 0);
975  } else if (m_interface.role() == QAccessible::List) {
976  if (interface.parent().object() && interface.parent().object() == m_interface.object())
977  return QAElement(object, m_interface.indexOfChild(interface));
978  } else if (m_interface.role() == QAccessible::Table) {
979  QAInterface currentInterface = interface;
980  int index = 0;
981 
982  while (currentInterface.isValid() && currentInterface.object() == 0) {
983  const QAInterface parentInterface = currentInterface.parent();
984 /*
985  qDebug() << "current index" << index;
986  qDebug() << "current interface" << interface;
987 
988  qDebug() << "parent interface" << parentInterface;
989  qDebug() << "grandparent interface" << parentInterface.parent();
990  qDebug() << "childCount" << interface.childCount();
991  qDebug() << "index of child" << parentInterface.indexOfChild(currentInterface);
992 */
993  index += ((parentInterface.indexOfChild(currentInterface) - 1) * (currentInterface.childCount() + 1)) + 1;
994  currentInterface = parentInterface;
995 // qDebug() << "new current interface" << currentInterface;
996  }
997  if (currentInterface.object() == m_interface.object())
998  return QAElement(object, index);
999 
1000 
1001  }
1002  return QAElement();
1003  }
int indexOfChild(const QAInterface &child) const
bool isValid() const
QAInterface parent() const
int childCount() const
QAInterface interface(UInt64 identifier)
QObject * object() const
Role role() const
quint16 index

◆ interface()

QAInterface QItemViewInterfaceFactory::interface ( UInt64  identifier)
inlinevirtual

Implements QInterfaceFactory.

Definition at line 931 of file qaccessible_mac.mm.

932  {
933  if (identifier == 0)
934  return m_interface;
935 
937  return m_interface.childAt(identifier);
938 
940  const int index = identifier;
941  if (index == 0)
942  return m_interface; // return the item view interface.
943 
944  const int rowIndex = (index - 1) / (columnCount + 1);
945  const int cellIndex = (index - 1) % (columnCount + 1);
946 /*
947  qDebug() << "index" << index;
948  qDebug() << "rowIndex" << rowIndex;
949  qDebug() << "cellIndex" << cellIndex;
950 */
951  const QAInterface rowInterface = m_interface.childAt(rowIndex + 1);
952 
953  if ((cellIndex) == 0) // Is it a row?
954  return rowInterface;
955  else {
956  return rowInterface.childAt(cellIndex);
957  }
958  }
959 
960  return QAInterface();
961  }
QAInterface childAt(int x, int y) const
Role role() const
quint16 index

◆ registerChildren()

void QItemViewInterfaceFactory::registerChildren ( )
inlinevirtual

Implements QInterfaceFactory.

Definition at line 1005 of file qaccessible_mac.mm.

1006  {
1007  // Item view child interfraces don't have their own qobjects, so there is nothing to register here.
1008  }

Properties

◆ columnCount

int QItemViewInterfaceFactory::columnCount
private

Definition at line 1013 of file qaccessible_mac.mm.

◆ m_interface

QAInterface QItemViewInterfaceFactory::m_interface
private

Definition at line 1011 of file qaccessible_mac.mm.

◆ object

HIObjectRef QItemViewInterfaceFactory::object
private

Definition at line 1012 of file qaccessible_mac.mm.


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