mirror of https://github.com/status-im/nimqml.git
feat: appname
This commit is contained in:
parent
be76f78bc9
commit
1dc6acc87f
|
@ -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.}
|
||||
|
|
|
@ -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)
|
||||
|
|
Loading…
Reference in New Issue