display account

This commit is contained in:
Iuri Matias 2020-05-08 11:25:16 -04:00
parent 5a174f260a
commit aba191841b
2 changed files with 22 additions and 2 deletions

View File

@ -21,6 +21,7 @@ ApplicationWindow {
id: tabBar id: tabBar
width: 50 width: 50
height: width *2 + spacing height: width *2 + spacing
currentIndex: 0
transformOrigin: Item.Top transformOrigin: Item.Top
Layout.alignment: Qt.AlignLeft | Qt.AlignTop Layout.alignment: Qt.AlignLeft | Qt.AlignTop
Layout.fillHeight: true Layout.fillHeight: true
@ -141,9 +142,14 @@ ApplicationWindow {
} }
Item { ColumnLayout {
anchors.fill: parent
} RowLayout {
Layout.fillHeight: true
TextArea { id: accountsResult; Layout.fillWidth: true; text: logic.accountsResult; readOnly: true }
}
}
Item { Item {

View File

@ -17,6 +17,7 @@ QtObject:
type ApplicationLogic* = ref object of QObject type ApplicationLogic* = ref object of QObject
app: QApplication app: QApplication
callResult: string callResult: string
accountResult: string
# Constructor # Constructor
proc newApplicationLogic*(app: QApplication): ApplicationLogic = proc newApplicationLogic*(app: QApplication): ApplicationLogic =
@ -58,6 +59,7 @@ QtObject:
proc setCallResult(self: ApplicationLogic, callResult: string) {.slot.} = proc setCallResult(self: ApplicationLogic, callResult: string) {.slot.} =
if self.callResult == callResult: return if self.callResult == callResult: return
self.callResult = callResult self.callResult = callResult
self.accountResult = "0x123"
self.callResultChanged(callResult) self.callResultChanged(callResult)
proc `callResult=`*(self: ApplicationLogic, callResult: string) = self.setCallResult(callResult) proc `callResult=`*(self: ApplicationLogic, callResult: string) = self.setCallResult(callResult)
@ -74,3 +76,15 @@ QtObject:
# proc onMessage*(self: ApplicationLogic, message: string) {.slot.} = # proc onMessage*(self: ApplicationLogic, message: string) {.slot.} =
# self.setCallResult(message) # self.setCallResult(message)
# echo "Received message: ", message # echo "Received message: ", message
proc accountResult*(self: ApplicationLogic): string {.slot.} =
result = self.accountResult
proc setAccountResult(self: ApplicationLogic, accountResult: string) {.slot.} =
if self.accountResult == accountResult: return
self.accountResult = "0x123"
self.callResultChanged(callResult)
QtProperty[string] accountsResult:
read = accountResult
notify = callResultChanged