28 static inline bool isClipboardAvailable()
30#if !QT_CONFIG(clipboard)
32#elif defined(Q_OS_MACOS)
33 PasteboardRef pasteboard;
34 OSStatus status = PasteboardCreate(0, &pasteboard);
36 CFRelease(pasteboard);
37 return status == noErr;
39 if (QGuiApplication::platformName() != QLatin1StringView(
"xcb"))
43 QClipboard *clipBoard = QGuiApplication::clipboard();
46 const QString &oldText = clipBoard->text();
47 QScopeGuard guard([&](){ clipBoard->setText(oldText); });
48 const QLatin1StringView prefix(
"Something to prefix ");
49 const QString newText = prefix + oldText;
50 clipBoard->setText(newText);
51 return QTest::qWaitFor([&](){
return clipBoard->text() == newText; });