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


C++ QQuickItem::objectName方法代码示例

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


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

示例1:

Web3DOverlay::~Web3DOverlay() {
    if (_webSurface) {
        QQuickItem* rootItem = _webSurface->getRootItem();

        if (rootItem && rootItem->objectName() == "tabletRoot") {
            auto tabletScriptingInterface = DependencyManager::get<TabletScriptingInterface>();
            tabletScriptingInterface->setQmlTabletRoot("com.highfidelity.interface.tablet.system", nullptr);
        }

        // Fix for crash in QtWebEngineCore when rapidly switching domains
        // Call stop on the QWebEngineView before destroying OffscreenQMLSurface.
        if (rootItem) {
            QObject* obj = rootItem->findChild<QObject*>("webEngineView");
            if (obj) {
                // stop loading
                QMetaObject::invokeMethod(obj, "stop");
            }
        }

        _webSurface->pause();
        auto overlays = &(qApp->getOverlays());
        QObject::disconnect(overlays, &Overlays::mousePressOnOverlay, this, nullptr);
        QObject::disconnect(overlays, &Overlays::mouseReleaseOnOverlay, this, nullptr);
        QObject::disconnect(overlays, &Overlays::mouseMoveOnOverlay, this, nullptr);
        QObject::disconnect(overlays, &Overlays::hoverLeaveOverlay, this, nullptr);
        QObject::disconnect(this, &Web3DOverlay::scriptEventReceived, _webSurface.data(), &OffscreenQmlSurface::emitScriptEvent);
        QObject::disconnect(_webSurface.data(), &OffscreenQmlSurface::webEventReceived, this, &Web3DOverlay::webEventReceived);
        DependencyManager::get<OffscreenQmlSurfaceCache>()->release(QML, _webSurface);
        _webSurface.reset();
    }
    auto geometryCache = DependencyManager::get<GeometryCache>();
    if (geometryCache) {
        geometryCache->releaseID(_geometryId);
    }
}
开发者ID:cozza13,项目名称:hifi,代码行数:35,代码来源:Web3DOverlay.cpp

示例2: isClickedOnSoftwareInputPanel

bool MInverseMouseArea::isClickedOnSoftwareInputPanel() const
{
    QQuickItem * item = canvas()->activeFocusItem();
    while(item != NULL) {
        if(item->objectName() == "softwareInputPanel")
            return true;
        item = item->parentItem();
    }
    return false;
}
开发者ID:anushakalyan,项目名称:qmluiextensions,代码行数:10,代码来源:minversemousearea.cpp

示例3: resizeGL

void GLWidget::resizeGL(int width, int height)
{
    int x, y, w, h;
    double this_aspect = (double) width / height;
    double video_aspect = m_monitorProfile->dar();

    // Special case optimisation to negate odd effect of sample aspect ratio
    // not corresponding exactly with image resolution.
    if ((int) (this_aspect * 1000) == (int) (video_aspect * 1000))
    {
        w = width;
        h = height;
    }
    // Use OpenGL to normalise sample aspect ratio
    else if (height * video_aspect > width)
    {
        w = width;
        h = width / video_aspect;
    }
    else
    {
        w = height * video_aspect;
        h = height;
    }
    x = (width - w) / 2;
    y = (height - h) / 2;
    m_rect.setRect(x, y, w, h);
    double scale = (double) m_rect.width() / m_monitorProfile->width() * m_zoom;
    QPoint center = m_rect.center();
    QQuickItem* rootQml = rootObject();
    if (rootQml) {
        rootQml->setProperty("center", center);
        rootQml->setProperty("scale", scale);
        if (rootQml->objectName() == "rootsplit") {
            // Adjust splitter pos
            rootQml->setProperty("splitterPos", x + (rootQml->property("realpercent").toDouble() * w));
        }
    }
    emit rectChanged();
}
开发者ID:rugubara,项目名称:kdenlive-15.08.1,代码行数:40,代码来源:glwidget.cpp


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