From 1dc6acc87f51388f79a811b05f42da7070d9424b Mon Sep 17 00:00:00 2001 From: Richard Ramos Date: Thu, 25 Jun 2020 10:36:15 -0400 Subject: [PATCH] feat: appname --- src/nimqml/private/dotherside.nim | 2 +- src/nimqml/private/qapplication.nim | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/nimqml/private/dotherside.nim b/src/nimqml/private/dotherside.nim index 6b191fb..372fbcb 100644 --- a/src/nimqml/private/dotherside.nim +++ b/src/nimqml/private/dotherside.nim @@ -126,7 +126,7 @@ proc dos_qcoreapplication_application_dir_path(): cstring {.cdecl, dynlib: dynLi proc dos_qapplication_enable_hdpi() {.cdecl, dynlib: dynLibName, importc.} # QApplication -proc dos_qapplication_create() {.cdecl, dynlib: dynLibName, importc.} +proc dos_qapplication_create(appName: cstring) {.cdecl, dynlib: dynLibName, importc.} proc dos_qapplication_exec() {.cdecl, dynlib: dynLibName, importc.} proc dos_qapplication_quit() {.cdecl, dynlib: dynLibName, importc.} proc dos_qapplication_icon(filename: cstring) {.cdecl, dynlib: dynLibName, importc.} diff --git a/src/nimqml/private/qapplication.nim b/src/nimqml/private/qapplication.nim index 6e72883..daf58ea 100644 --- a/src/nimqml/private/qapplication.nim +++ b/src/nimqml/private/qapplication.nim @@ -1,6 +1,6 @@ -proc setup*(application: QApplication) = +proc setup*(application: QApplication, appName: string) = ## Setup a new QApplication - dos_qapplication_create() + dos_qapplication_create(appName.cstring) application.deleted = false proc exec*(application: QApplication) = @@ -22,7 +22,7 @@ proc delete*(application: QApplication) = dos_qapplication_delete() application.deleted = true -proc newQApplication*(): QApplication = +proc newQApplication*(appName: string = "Unknown"): QApplication = ## Return a new QApplication new(result, delete) - result.setup() + result.setup(appName)