本文整理汇总了C++中QPlatformIntegration::clipboard方法的典型用法代码示例。如果您正苦于以下问题:C++ QPlatformIntegration::clipboard方法的具体用法?C++ QPlatformIntegration::clipboard怎么用?C++ QPlatformIntegration::clipboard使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类QPlatformIntegration
的用法示例。
在下文中一共展示了QPlatformIntegration::clipboard方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: displayHandleGlobal
void QWaylandDisplay::displayHandleGlobal(uint32_t id,
const QByteArray &interface,
uint32_t version)
{
Q_UNUSED(version);
if (interface == "wl_output") {
struct wl_output *output = wl_output_create(mDisplay, id, 1);
wl_output_add_listener(output, &outputListener, this);
} else if (interface == "wl_compositor") {
mCompositor = wl_compositor_create(mDisplay, id, 1);
wl_compositor_add_listener(mCompositor,
&compositorListener, this);
} else if (interface == "wl_shm") {
mShm = wl_shm_create(mDisplay, id, 1);
} else if (interface == "wl_shell") {
mShell = wl_shell_create(mDisplay, id, 1);
wl_shell_add_listener(mShell, &shellListener, this);
} else if (interface == "wl_input_device") {
QWaylandInputDevice *inputDevice =
new QWaylandInputDevice(mDisplay, id);
mInputDevices.append(inputDevice);
} else if (interface == "wl_selection_offer") {
QPlatformIntegration *plat = QApplicationPrivate::platformIntegration();
QWaylandClipboard *clipboard = static_cast<QWaylandClipboard *>(plat->clipboard());
clipboard->createSelectionOffer(id);
}
}
示例2: handleSelectionRequest
void QXlibScreen::handleSelectionRequest(XEvent *event)
{
QPlatformIntegration *integration = QApplicationPrivate::platformIntegration();
QXlibClipboard *clipboard = static_cast<QXlibClipboard *>(integration->clipboard());
clipboard->handleSelectionRequest(event);
}