代码拉取完成,页面将自动刷新
同步操作将从 openKylin/ukui-clipboard 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
#include <QGuiApplication>
#include <QQmlApplicationEngine>
#include <QQmlContext>
#include <QKeyEvent>
#include <QCommandLineOption>
#include <QCommandLineParser>
#include <QQuickWindow>
#include <QTranslator>
#include <QDebug>
#include "qtsingleapplication.h"
#include "clipboardbackend.h"
#include "windowsettings.h"
int main(int argc, char *argv[])
{
QCoreApplication::setAttribute(Qt::AA_EnableHighDpiScaling);
QtSingleApplication app(argc, argv);
QCommandLineParser parser;
QCommandLineOption showWorkSpaceOption("show-menu","show contentMenu");
parser.addOption(showWorkSpaceOption);
parser.process(app);
if (app.isRunning())
{
if (parser.isSet("show-menu")) {
app.sendMessage(QApplication::arguments().length() > 1 ? QApplication::arguments().at(1) : app.applicationFilePath());
}
return EXIT_SUCCESS;
}
QTranslator translator;
if (!translator.load(QLocale::system(), QLatin1String("ukui-clipboard"),QLatin1String("_"), QLatin1String(":/"))){
// 如果指定语言的翻译文件未找到,尝试加载默认的翻译文件
if (!translator.load(QString("ukui-clipboard"))) {
qWarning() << "Failed to load translation files!";
}
}
app.installTranslator(&translator);
QQmlApplicationEngine engine;
qmlRegisterUncreatableType<ContentMenu>(
"ContentMenu", 1, 0, "ContentType",
"Not be instantiated in QML, we should only pass the enum types to QML "
"!");
ClipboardBackend backend;
QObject::connect(&app, &QtSingleApplication::messageReceived, [&backend](){
backend.open();
});
engine.rootContext()->setContextProperty("backend", &backend);
engine.addImageProvider(QLatin1String("inMemoryImages"), backend.getImageProvider());
const QUrl url(QStringLiteral("qrc:/FunctionMenuWindow.qml"));
QObject::connect(&engine, &QQmlApplicationEngine::objectCreated,
&app, [url](QObject *obj, const QUrl &objUrl) {
if (!obj && url == objUrl)
QCoreApplication::exit(-1);
}, Qt::QueuedConnection);
engine.load(url);
const QUrl url1(QStringLiteral("qrc:/ClipboardWindow.qml"));
engine.load(url1);
WindowSettings settings;
return app.exec();
}
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。