当前位置: 首页>>代码示例>>C++>>正文


C++ QAccessibleInterface类代码示例

本文整理汇总了C++中QAccessibleInterface的典型用法代码示例。如果您正苦于以下问题:C++ QAccessibleInterface类的具体用法?C++ QAccessibleInterface怎么用?C++ QAccessibleInterface使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


在下文中一共展示了QAccessibleInterface类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: while

QWindow *QWindowsAccessibility::windowHelper(const QAccessibleInterface *iface)
{
    QWindow *window = iface->window();
    if (!window) {
        QAccessibleInterface *acc = iface->parent();
        while (acc && acc->isValid() && !window) {
            window = acc->window();
            QAccessibleInterface *par = acc->parent();
            acc = par;
        }
    }
    return window;
}
开发者ID:OniLink,项目名称:Qt5-Rehost,代码行数:13,代码来源:qwindowsaccessibility.cpp

示例2: 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
}
开发者ID:AlexSoehn,项目名称:qt-base-deb,代码行数:13,代码来源:qaccessiblecache.cpp

示例3: parentId

 static jint parentId(JNIEnv */*env*/, jobject /*thiz*/, jint objectId)
 {
     QAccessibleInterface *iface = interfaceFromId(objectId);
     if (iface) {
         QAccessibleInterface *parent = iface->parent();
         if (parent) {
             if (parent->role() == QAccessible::Application)
                 return -1;
             return QAccessible::uniqueId(parent);
         }
     }
     return -1;
 }
开发者ID:Drakey83,项目名称:steamlink-sdk,代码行数:13,代码来源:androidjniaccessibility.cpp

示例4: screenRect

    static jobject screenRect(JNIEnv *env, jobject /*thiz*/, jint objectId)
    {
        QRect rect;
        QAccessibleInterface *iface = interfaceFromId(objectId);
        if (iface && iface->isValid()) {
            rect = iface->rect();
        }

        jclass rectClass = env->FindClass("android/graphics/Rect");
        jmethodID ctor = env->GetMethodID(rectClass, "<init>", "(IIII)V");
        jobject jrect = env->NewObject(rectClass, ctor, rect.left(), rect.top(), rect.right(), rect.bottom());
        return jrect;
    }
开发者ID:Drakey83,项目名称:steamlink-sdk,代码行数:13,代码来源:androidjniaccessibility.cpp

示例5: showDebug

HRESULT STDMETHODCALLTYPE QWindowsAccessible::accSelect(long flagsSelect, VARIANT varID)
{
    showDebug(__FUNCTION__, accessible);
    if (!accessible->isValid())
        return E_FAIL;

    bool res = false;

    AccessibleElement elem(varID.lVal, accessible);
    QAccessibleInterface *acc = elem.iface;
    if (acc) {
        const int entry = elem.entry;
        if (flagsSelect & SELFLAG_TAKEFOCUS)
            res = acc->doAction(SetFocus, entry, QVariantList());
        if (flagsSelect & SELFLAG_TAKESELECTION) {
            acc->doAction(ClearSelection, 0, QVariantList());   //### bug, 0 should be entry??
            res = acc->doAction(AddToSelection, entry, QVariantList());
        }
        if (flagsSelect & SELFLAG_EXTENDSELECTION)
            res = acc->doAction(ExtendSelection, entry, QVariantList());
        if (flagsSelect & SELFLAG_ADDSELECTION)
            res = acc->doAction(AddToSelection, entry, QVariantList());
        if (flagsSelect & SELFLAG_REMOVESELECTION)
            res = acc->doAction(RemoveSelection, entry, QVariantList());
    }
    return res ? S_OK : S_FALSE;
}
开发者ID:12307,项目名称:VLC-for-VS2010,代码行数:27,代码来源:qaccessible_win.cpp

示例6: hitTest

 static jint hitTest(JNIEnv */*env*/, jobject /*thiz*/, jfloat x, jfloat y)
 {
     QAccessibleInterface *root = interfaceFromId(-1);
     if (root) {
         QAccessibleInterface *child = root->childAt((int)x, (int)y);
         QAccessibleInterface *lastChild = 0;
         while (child && (child != lastChild)) {
             lastChild = child;
             child = child->childAt((int)x, (int)y);
         }
         if (lastChild)
             return QAccessible::uniqueId(lastChild);
     }
     return -1;
 }
开发者ID:Drakey83,项目名称:steamlink-sdk,代码行数:15,代码来源:androidjniaccessibility.cpp

示例7: Q_UNUSED

HRESULT STDMETHODCALLTYPE QWindowsMsaaAccessible::get_accDefaultAction(VARIANT varID, BSTR* pszDefaultAction)
{
    Q_UNUSED(varID);
    QAccessibleInterface *accessible = accessibleInterface();
    accessibleDebugClientCalls(accessible);
    if (!accessible)
        return E_FAIL;

    *pszDefaultAction = 0;
    if (QAccessibleActionInterface *actionIface = accessible->actionInterface()) {
        const QString def = actionIface->actionNames().value(0);
        if (!def.isEmpty())
            *pszDefaultAction = QStringToBSTR(def);
    }
    return *pszDefaultAction ? S_OK : S_FALSE;
}
开发者ID:CodeDJ,项目名称:qt5-hidpi,代码行数:16,代码来源:qwindowsmsaaaccessible.cpp

示例8: childIdListForAccessibleObject

    static jintArray childIdListForAccessibleObject(JNIEnv *env, jobject /*thiz*/, jint objectId)
    {
        QAccessibleInterface *iface = interfaceFromId(objectId);
        if (iface) {
            jintArray jArray = env->NewIntArray(jsize(iface->childCount()));
            for (int i = 0; i < iface->childCount(); ++i) {
                QAccessibleInterface *child = iface->child(i);
                if (child) {
                    QAccessible::Id ifaceId = QAccessible::uniqueId(child);
                    jint jid = ifaceId;
                    env->SetIntArrayRegion(jArray, i, 1, &jid);
                }
            }
            return jArray;
        }

        return env->NewIntArray(jsize(0));
    }
开发者ID:Drakey83,项目名称:steamlink-sdk,代码行数:18,代码来源:androidjniaccessibility.cpp

示例9: accessibleInterface

// moz: [important]
HRESULT STDMETHODCALLTYPE QWindowsMsaaAccessible::get_accParent(IDispatch** ppdispParent)
{
    QAccessibleInterface *accessible = accessibleInterface();
    accessibleDebugClientCalls(accessible);
    if (!accessible)
        return E_FAIL;

    QAccessibleInterface *acc = accessible->parent();
    if (acc) {
        if (IAccessible *iface = QWindowsAccessibility::wrap(acc)) {
            *ppdispParent = iface;
            return S_OK;
        }
    }

    *ppdispParent = 0;
    return S_FALSE;
}
开发者ID:CodeDJ,项目名称:qt5-hidpi,代码行数:19,代码来源:qwindowsmsaaaccessible.cpp

示例10: childWidgets

/*! \reimp */
QAccessible::Role QAccessibleWidget::role(int child) const
{
    if (!child)
        return d->role;

    QWidgetList childList = childWidgets(widget());
    if (childList.count() > 0 && child <= childList.count()) {
        QWidget *targetWidget = childList.at(child - 1);
        QAccessibleInterface *iface = QAccessible::queryAccessibleInterface(targetWidget);
        if (iface) {
            QAccessible::Role role = iface->role(0);
            delete iface;
            return role;
        }
    }

    return NoRole;
}
开发者ID:Arise,项目名称:Open-DPI-Detector,代码行数:19,代码来源:qaccessiblewidget.cpp

示例11: accessibleInterface

// moz: [important]
HRESULT STDMETHODCALLTYPE QWindowsMsaaAccessible::get_accChild(VARIANT varChildID, IDispatch** ppdispChild)
{
    QAccessibleInterface *accessible = accessibleInterface();
    accessibleDebugClientCalls(accessible);
    if (!accessible)
        return E_FAIL;

    if (varChildID.vt != VT_I4)
        return E_INVALIDARG;

    QAccessibleInterface *acc = childPointer(accessible, varChildID);
    if (acc && acc->isValid()) {
        *ppdispChild = QWindowsAccessibility::wrap(acc);
        return S_OK;
    }

    return E_FAIL;
}
开发者ID:2gis,项目名称:2gisqt5android,代码行数:19,代码来源:qwindowsmsaaaccessible.cpp

示例12: 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)->effectiveWinId();
    return S_OK;
}
开发者ID:12307,项目名称:VLC-for-VS2010,代码行数:13,代码来源:qaccessible_win.cpp

示例13: get_accRole

HRESULT STDMETHODCALLTYPE QWindowsAccessible::get_accRole(VARIANT varID, VARIANT *pvarRole)
{
#ifdef DEBUG_SHOW_ATCLIENT_COMMANDS
    showDebug(__FUNCTION__, accessible);
#endif //DEBUG_SHOW_ATCLIENT_COMMANDS
    if (!accessible->isValid())
        return E_FAIL;

    Role role = accessible->role(varID.lVal);
    if (role != NoRole) {
        (*pvarRole).vt = VT_I4;
        (*pvarRole).lVal = role;
    } else {
        (*pvarRole).vt = VT_EMPTY;
    }
    return S_OK;
}
开发者ID:GodFox,项目名称:qtopia-ezx,代码行数:17,代码来源:qaccessible_win.cpp

示例14: get_accName

HRESULT STDMETHODCALLTYPE QWindowsAccessible::get_accName(VARIANT varID, BSTR* pszName)
{
#ifdef DEBUG_SHOW_ATCLIENT_COMMANDS
    showDebug(__FUNCTION__, accessible);
#endif //DEBUG_SHOW_ATCLIENT_COMMANDS
    if (!accessible->isValid())
        return E_FAIL;

    QString n = accessible->text(Name, varID.lVal);
    if (n.size()) {
        *pszName = QStringToBSTR(n);
        return S_OK;
    }

    *pszName = 0;
    return S_FALSE;
}
开发者ID:GodFox,项目名称:qtopia-ezx,代码行数:17,代码来源:qaccessible_win.cpp

示例15: get_accKeyboardShortcut

HRESULT STDMETHODCALLTYPE QWindowsAccessible::get_accKeyboardShortcut(VARIANT varID, BSTR *pszKeyboardShortcut)
{
#ifdef DEBUG_SHOW_ATCLIENT_COMMANDS
    showDebug(__FUNCTION__, accessible);
#endif //DEBUG_SHOW_ATCLIENT_COMMANDS
    if (!accessible->isValid())
        return E_FAIL;

    QString sc = accessible->text(Accelerator, varID.lVal);
    if (sc.size()) {
        *pszKeyboardShortcut = QStringToBSTR(sc);
        return S_OK;
    }

    *pszKeyboardShortcut = 0;
    return S_FALSE;
}
开发者ID:GodFox,项目名称:qtopia-ezx,代码行数:17,代码来源:qaccessible_win.cpp


注:本文中的QAccessibleInterface类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。