feat: Adding support for copying and downloading an Image

This commit is contained in:
Khushboo Mehta 2021-08-16 10:38:10 +02:00 committed by khushboo-dev-cpp
parent b3309ae7c9
commit 03c8072f89
2 changed files with 8 additions and 0 deletions

View File

@ -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.}

View File

@ -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: