feat: appname

This commit is contained in:
Richard Ramos 2020-06-25 10:36:15 -04:00
parent be76f78bc9
commit 1dc6acc87f
No known key found for this signature in database
GPG Key ID: 80D4B01265FDFE8F
2 changed files with 5 additions and 5 deletions

View File

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

View File

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