From 03c8072f896a4751acf347a38d403754c99e182b Mon Sep 17 00:00:00 2001 From: Khushboo Mehta Date: Mon, 16 Aug 2021 10:38:10 +0200 Subject: [PATCH] feat: Adding support for copying and downloading an Image --- src/nimqml/private/dotherside.nim | 2 ++ src/nimqml/private/qapplication.nim | 6 ++++++ 2 files changed, 8 insertions(+) diff --git a/src/nimqml/private/dotherside.nim b/src/nimqml/private/dotherside.nim index 5ddd13e..f457513 100644 --- a/src/nimqml/private/dotherside.nim +++ b/src/nimqml/private/dotherside.nim @@ -137,6 +137,8 @@ proc dos_qapplication_icon(filename: cstring) {.cdecl, dynlib: dynLibName, impor proc dos_qapplication_delete() {.cdecl, dynlib: dynLibName, importc.} proc dos_qapplication_clipboard_setText(content: cstring) {.cdecl, dynlib: dynLibName, importc.} proc dos_qapplication_installEventFilter(engine: DosStatusEventObject) {.cdecl, dynlib: dynLibName, importc.} +proc dos_qapplication_clipboard_setImage(content: cstring) {.cdecl, dynlib: dynLibName, importc.} +proc dos_qapplication_download_image(imageSource: cstring, filePath: cstring) {.cdecl, dynlib: dynLibName, importc.} # QGuiApplication proc dos_qguiapplication_create() {.cdecl, dynlib: dynLibName, importc.} diff --git a/src/nimqml/private/qapplication.nim b/src/nimqml/private/qapplication.nim index 1df6a30..e168e11 100644 --- a/src/nimqml/private/qapplication.nim +++ b/src/nimqml/private/qapplication.nim @@ -20,6 +20,12 @@ proc setClipboardText*(text: string = "") = proc installEventFilter*(application: QApplication, event: StatusEventObject) = dos_qapplication_installEventFilter(event.vptr) +proc setClipboardImage*(text: string = "") = + dos_qapplication_clipboard_setImage(text.cstring) + +proc downloadImage*(imageSource: string = "", filePath = "") = + dos_qapplication_download_image(imageSource.cstring, filePath.cstring) + proc delete*(application: QApplication) = ## Delete the given QApplication if application.deleted: