本文整理汇总了C++中QWindow::screen方法的典型用法代码示例。如果您正苦于以下问题:C++ QWindow::screen方法的具体用法?C++ QWindow::screen怎么用?C++ QWindow::screen使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类QWindow
的用法示例。
在下文中一共展示了QWindow::screen方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: presentBuffer
void QEglFSKmsIntegration::presentBuffer(QPlatformSurface *surface)
{
QWindow *window = static_cast<QWindow *>(surface->surface());
QEglFSKmsScreen *screen = static_cast<QEglFSKmsScreen *>(window->screen()->handle());
screen->flip();
}
示例2: waitForVSync
void QEglFSKmsIntegration::waitForVSync(QPlatformSurface *surface) const
{
QWindow *window = static_cast<QWindow *>(surface->surface());
QEglFSKmsScreen *screen = static_cast<QEglFSKmsScreen *>(window->screen()->handle());
screen->waitForFlip();
}
示例3: QVBoxLayout
void tst_QWidget_window::tst_updateWinId_QTBUG40681()
{
QWidget w;
QVBoxLayout *vl = new QVBoxLayout(&w);
QLabel *lbl = new QLabel("HELLO1");
lbl->setAttribute(Qt::WA_NativeWindow);
lbl->setObjectName("label1");
vl->addWidget(lbl);
w.setMinimumWidth(200);
w.show();
QVERIFY(QTest::qWaitForWindowExposed(&w));
QCOMPARE(lbl->winId(), lbl->windowHandle()->winId());
// simulate screen change and notification
QWindow *win = w.windowHandle();
w.windowHandle()->destroy();
lbl->windowHandle()->destroy();
w.windowHandle()->create();
lbl->windowHandle()->create();
QWindowPrivate *p = qt_window_private(win);
p->emitScreenChangedRecursion(win->screen());
QCOMPARE(lbl->winId(), lbl->windowHandle()->winId());
}
示例4: inputItemChanged
void QMeeGoPlatformInputContext::inputItemChanged()
{
if (!d->valid)
return;
QInputPanel *panel = qApp->inputPanel();
QObject *input = panel->inputItem();
QWindow *window = panel->inputWindow();
d->imState["focusState"] = input != 0;
if (input) {
if (window)
d->imState["winId"] = static_cast<qulonglong>(window->winId());
if (!d->active) {
d->active = true;
d->server->activateContext();
// ### react to orientation changes, too
if (window)
d->server->appOrientationChanged(orientationAngle(window->screen()->currentOrientation()));
}
}
d->sendStateUpdate(/*focusChanged*/true);
if (input && window && d->visibility == InputPanelShowRequested)
showInputPanel();
}
示例5: setGeometry
void QQuickMenuPopupWindow::setGeometry(int posx, int posy, int w, int h)
{
QWindow *pw = transientParent();
if (!pw && parentItem())
pw = parentItem()->window();
if (!pw)
pw = this;
QRect g = pw->screen()->availableVirtualGeometry();
if (posx + w > g.right()) {
if (qobject_cast<QQuickMenuPopupWindow *>(transientParent())) {
// reposition submenu window on the parent menu's left side
int submenuOverlap = pw->x() + pw->width() - posx;
posx -= pw->width() + w - 2 * submenuOverlap;
} else {
posx = g.right() - w;
}
} else {
posx = qMax(posx, g.left());
}
posy = qBound(g.top(), posy, g.bottom() - h);
QQuickWindow::setGeometry(posx, posy, w, h);
}