本文整理汇总了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);
}
}
示例2: isClickedOnSoftwareInputPanel
bool MInverseMouseArea::isClickedOnSoftwareInputPanel() const
{
QQuickItem * item = canvas()->activeFocusItem();
while(item != NULL) {
if(item->objectName() == "softwareInputPanel")
return true;
item = item->parentItem();
}
return false;
}
示例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();
}