feat: add clipboard support

This commit is contained in:
Pascal Precht 2020-06-29 15:29:12 +02:00 committed by Michał
parent 0229edc410
commit f2ce61142b
2 changed files with 9 additions and 0 deletions

View File

@ -78,6 +78,9 @@ DOS_API void DOS_CALL dos_qguiapplication_quit(void);
/// \note A QGuiApplication should have been already created through dos_qguiapplication_create()
DOS_API void DOS_CALL dos_qguiapplication_delete(void);
DOS_API void dos_qapplication_clipboard_setText(const char* text);
/// @}
/// \defgroup QApplication QApplication

View File

@ -30,6 +30,7 @@
#include <QtGui/QIcon>
#include <QtQml/QQmlContext>
#include <QtCore>
#include <QClipboard>
#include <QtQml/QQmlApplicationEngine>
#include <QtQuick/QQuickView>
#include <QtQuick/QQuickImageProvider>
@ -86,6 +87,11 @@ void dos_qguiapplication_create()
new QGuiApplication(argc, argv);
}
void dos_qapplication_clipboard_setText(const char* text)
{
QApplication::clipboard()->setText(text);
}
void dos_qguiapplication_delete()
{
delete qGuiApp;