本文整理汇总了C++中QXcbScreen::connection方法的典型用法代码示例。如果您正苦于以下问题:C++ QXcbScreen::connection方法的具体用法?C++ QXcbScreen::connection怎么用?C++ QXcbScreen::connection使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类QXcbScreen
的用法示例。
在下文中一共展示了QXcbScreen::connection方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: QGLXContext
QPlatformOpenGLContext *QXcbIntegration::createPlatformOpenGLContext(QOpenGLContext *context) const
{
QXcbScreen *screen = static_cast<QXcbScreen *>(context->screen()->handle());
#if defined(XCB_USE_GLX)
return new QGLXContext(screen, context->format(), context->shareHandle());
#elif defined(XCB_USE_EGL)
return new QEGLXcbPlatformContext(context->format(), context->shareHandle(),
screen->connection()->egl_display(), screen->connection());
#else
Q_UNUSED(screen);
qWarning("QXcbIntegration: Cannot create platform OpenGL context, neither GLX nor EGL are enabled");
return 0;
#endif
}
示例2: QWindowSurface
QXcbWindowSurface::QXcbWindowSurface(QWidget *widget, bool setDefaultSurface)
: QWindowSurface(widget, setDefaultSurface)
, m_image(0)
, m_syncingResize(false)
{
QXcbScreen *screen = static_cast<QXcbScreen *>(QPlatformScreen::platformScreenForWidget(widget));
setConnection(screen->connection());
}
示例3: QPlatformBackingStore
QXcbBackingStore::QXcbBackingStore(QWindow *window)
: QPlatformBackingStore(window)
, m_image(0)
, m_syncingResize(false)
{
QXcbScreen *screen = static_cast<QXcbScreen *>(window->screen()->handle());
setConnection(screen->connection());
}
示例4: defined
void *QXcbNativeInterface::eglDisplayForWidget(QWidget *widget)
{
#if defined(XCB_USE_DRI2) || defined(XCB_USE_EGL)
QXcbScreen *screen = qPlatformScreenForWidget(widget);
return screen->connection()->egl_display();
#else
Q_UNUSED(widget)
return 0;
#endif
}
示例5: qWarning
QPlatformOffscreenSurface *QXcbIntegration::createPlatformOffscreenSurface(QOffscreenSurface *surface) const
{
QXcbScreen *screen = static_cast<QXcbScreen *>(surface->screen()->handle());
QXcbGlIntegration *glIntegration = screen->connection()->glIntegration();
if (!glIntegration) {
qWarning("QXcbIntegration: Cannot create platform offscreen surface, neither GLX nor EGL are enabled");
return Q_NULLPTR;
}
return glIntegration->createPlatformOffscreenSurface(surface);
}
示例6: QXcbEglContext
QPlatformOpenGLContext *QXcbEglIntegration::createPlatformOpenGLContext(QOpenGLContext *context) const
{
QXcbScreen *screen = static_cast<QXcbScreen *>(context->screen()->handle());
QXcbEglContext *platformContext = new QXcbEglContext(context->format(),
context->shareHandle(),
eglDisplay(),
screen->connection(),
context->nativeHandle());
context->setNativeHandle(platformContext->nativeHandle());
return platformContext;
}
示例7: QGLXPbuffer
QPlatformOffscreenSurface *QXcbIntegration::createPlatformOffscreenSurface(QOffscreenSurface *surface) const
{
#if defined(XCB_USE_GLX)
return new QGLXPbuffer(surface);
#elif defined(XCB_USE_EGL)
QXcbScreen *screen = static_cast<QXcbScreen *>(surface->screen()->handle());
return new QEGLPbuffer(screen->connection()->egl_display(), surface->requestedFormat(), surface);
#else
Q_UNUSED(surface);
qWarning("QXcbIntegration: Cannot create platform offscreen surface, neither GLX nor EGL are enabled");
return 0;
#endif
}
示例8: setAutoRepeatKeys
void QIrrlichtWidget::setAutoRepeatKeys(bool mode)
{
qDebug() << "QIrrlichtWidget::setAutoRepeatKeys";
XKeyboardControl control;
control.auto_repeat_mode = (mode ? 1 : 0); // Set mode to 1 for
// autorepeat, 0 to disable
control.key = -1; // We want to change the behaviour for all keys
QList<QScreen*> screens = QGuiApplication::screens();
QXcbScreen *xcbscreen = static_cast<QXcbScreen*>(screens.at(0)->handle());
Display *display = static_cast<Display*>(xcbscreen->connection()->xlib_display());
XChangeKeyboardControl(display, KBAutoRepeatMode, &control);
}
示例9: QXcbWindow
QPlatformWindow *QXcbIntegration::createPlatformWindow(QWindow *window) const
{
QXcbScreen *screen = static_cast<QXcbScreen *>(window->screen()->handle());
QXcbGlIntegration *glIntegration = screen->connection()->glIntegration();
if (window->type() != Qt::Desktop) {
if (glIntegration) {
QXcbWindow *xcbWindow = glIntegration->createWindow(window);
xcbWindow->create();
return xcbWindow;
}
}
Q_ASSERT(window->type() == Qt::Desktop || !window->supportsOpenGL()
|| (!glIntegration && window->surfaceType() == QSurface::RasterGLSurface)); // for VNC
QXcbWindow *xcbWindow = new QXcbWindow(window);
xcbWindow->create();
return xcbWindow;
}