mirror of https://github.com/status-im/nimqml.git
chore(@desktop): Expose QTimer functions
This commit is contained in:
parent
0931c98089
commit
c428cf4397
|
@ -30,6 +30,7 @@ include "nimqml/private/qabstracttablemodel.nim"
|
|||
include "nimqml/private/qresource.nim"
|
||||
include "nimqml/private/qdeclarative.nim"
|
||||
include "nimqml/private/qsettings.nim"
|
||||
include "nimqml/private/qtimer.nim"
|
||||
include "nimqml/private/nimqmlmacros.nim"
|
||||
include "nimqml/private/singleinstance.nim"
|
||||
include "nimqml/private/status/statusevent.nim"
|
||||
|
|
|
@ -36,6 +36,7 @@ type
|
|||
DosStatusOSNotification = DosQObject
|
||||
DosQSettings = DosQObject
|
||||
DosStatusKeychainManager = DosQObject
|
||||
DosQTimer = DosQObject
|
||||
|
||||
DosParameterDefinition = object
|
||||
name: cstring
|
||||
|
@ -371,6 +372,26 @@ proc dos_qsettings_remove(vptr: DosQSettings, key: cstring)
|
|||
proc dos_qsettings_delete(vptr: DosQSettings)
|
||||
{.cdecl, dynlib: dynLibName, importc.}
|
||||
|
||||
# QTimer
|
||||
proc dos_qtimer_create(): DosQTimer
|
||||
{.cdecl, dynlib: dynLibName, importc.}
|
||||
proc dos_qtimer_delete(vptr: DosQTimer)
|
||||
{.cdecl, dynlib: dynLibName, importc.}
|
||||
proc dos_qtimer_set_interval(vptr: DosQTimer, interval: int)
|
||||
{.cdecl, dynlib: dynLibName, importc.}
|
||||
proc dos_qtimer_interval(vptr: DosQTimer): int
|
||||
{.cdecl, dynlib: dynLibName, importc.}
|
||||
proc dos_qtimer_start(vptr: DosQTimer)
|
||||
{.cdecl, dynlib: dynLibName, importc.}
|
||||
proc dos_qtimer_stop(vptr: DosQTimer)
|
||||
{.cdecl, dynlib: dynLibName, importc.}
|
||||
proc dos_qtimer_set_single_shot(vptr: DosQTimer, singleShot: bool)
|
||||
{.cdecl, dynlib: dynLibName, importc.}
|
||||
proc dos_qtimer_is_single_shot(vptr: DosQTimer): bool
|
||||
{.cdecl, dynlib: dynLibName, importc.}
|
||||
proc dos_qtimer_is_active(vptr: DosQTimer): bool
|
||||
{.cdecl, dynlib: dynLibName, importc.}
|
||||
|
||||
# DosStatusKeychainManager
|
||||
proc dos_keychainmanager_create(service: cstring, authenticationReason: cstring):
|
||||
DosStatusKeychainManager
|
||||
|
|
|
@ -113,6 +113,8 @@ type
|
|||
|
||||
QNetworkConfigurationManager* = ref object of QObject
|
||||
|
||||
QTimer* = ref object of QObject
|
||||
|
||||
QNetworkAccessManagerFactory* = ref object of RootObj ## \
|
||||
vptr: DosQQNetworkAccessManagerFactory
|
||||
|
||||
|
|
|
@ -0,0 +1,31 @@
|
|||
proc delete*(self: QTimer) =
|
||||
dos_qtimer_delete(self.vptr)
|
||||
self.vptr.resetToNil
|
||||
|
||||
proc setup*(self: QTimer) =
|
||||
self.vptr = dos_qtimer_create()
|
||||
|
||||
proc newQTimer*() : QTimer =
|
||||
new(result, delete)
|
||||
result.setup()
|
||||
|
||||
proc setInterval*(self: QTimer, interval: int) =
|
||||
dos_qtimer_set_interval(self.vptr, interval)
|
||||
|
||||
proc interval*(self: QTimer): int =
|
||||
return dos_qtimer_interval(self.vptr)
|
||||
|
||||
proc start*(self:QTimer) =
|
||||
dos_qtimer_start(self.vptr)
|
||||
|
||||
proc stop*(self:QTimer) =
|
||||
dos_qtimer_stop(self.vptr)
|
||||
|
||||
proc setSingleShot*(self:QTimer, singleShot: bool) =
|
||||
dos_qtimer_set_single_shot(self.vptr, singleShot)
|
||||
|
||||
proc isSingleShot*(self:QTimer): bool =
|
||||
return dos_qtimer_is_single_shot(self.vptr)
|
||||
|
||||
proc isActive*(self:QTimer): bool =
|
||||
return dos_qtimer_is_active(self.vptr)
|
Loading…
Reference in New Issue