本文整理汇总了C++中QAccessibleInterface::object方法的典型用法代码示例。如果您正苦于以下问题:C++ QAccessibleInterface::object方法的具体用法?C++ QAccessibleInterface::object怎么用?C++ QAccessibleInterface::object使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类QAccessibleInterface
的用法示例。
在下文中一共展示了QAccessibleInterface::object方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: indexOfChild
int QAccessibleTree::indexOfChild(const QAccessibleInterface *iface) const
{
if (!view()->model())
return -1;
QAccessibleInterface *parent = iface->parent();
if (parent->object() != view())
return -1;
if (iface->role() == QAccessible::TreeItem) {
const QAccessibleTableCell* cell = static_cast<const QAccessibleTableCell*>(iface);
const QTreeView *treeView = qobject_cast<const QTreeView*>(view());
Q_ASSERT(treeView);
int row = treeView->d_func()->viewIndex(cell->m_index) + (horizontalHeader() ? 1 : 0);
int column = cell->m_index.column();
int index = row * view()->model()->columnCount() + column;
return index;
} else if (iface->role() == QAccessible::ColumnHeader){
const QAccessibleTableHeaderCell* cell = static_cast<const QAccessibleTableHeaderCell*>(iface);
return cell->index;
} else {
qWarning() << "WARNING QAccessibleTable::indexOfChild invalid child"
<< iface->role() << iface->text(QAccessible::Name);
}
// FIXME: add scrollbars and don't just ignore them
return -1;
}
示例2: GetWindow
HRESULT STDMETHODCALLTYPE QWindowsAccessible::GetWindow(HWND *phwnd)
{
*phwnd = 0;
if (!accessible->isValid())
return E_UNEXPECTED;
QObject *o = accessible->object();
if (!o || !o->isWidgetType())
return E_FAIL;
*phwnd = static_cast<QWidget*>(o)->winId();
return S_OK;
}
示例3: deleteInterface
void QAccessibleCache::deleteInterface(QAccessible::Id id, QObject *obj)
{
QAccessibleInterface *iface = idToInterface.take(id);
if (!obj)
obj = iface->object();
if (obj)
objectToId.remove(obj);
delete iface;
#ifdef Q_OS_MAC
removeCocoaElement(id);
#endif
}
示例4: verifyHierarchy
static int verifyHierarchy(QAccessibleInterface *iface)
{
int errorAt = 0;
static int treelevel = 0; // for error diagnostics
QAccessibleInterface *if2;
++treelevel;
int middle = iface->childCount()/2 + 1;
for (int i = 0; i < iface->childCount() && !errorAt; ++i) {
if2 = iface->child(i);
EXPECT(if2 != 0);
// navigate Ancestor...
QAccessibleInterface *parent = if2->parent();
EXPECT(iface->object() == parent->object());
// verify children...
if (!errorAt)
errorAt = verifyHierarchy(if2);
}
--treelevel;
return errorAt;
}