From aba191841bb1e6ffa4e91bfe34f699b89335e91a Mon Sep 17 00:00:00 2001 From: Iuri Matias Date: Fri, 8 May 2020 11:25:16 -0400 Subject: [PATCH] display account --- main.qml | 10 ++++++++-- src/applicationLogic.nim | 14 ++++++++++++++ 2 files changed, 22 insertions(+), 2 deletions(-) diff --git a/main.qml b/main.qml index bab1e79bec..5194eb9da1 100644 --- a/main.qml +++ b/main.qml @@ -21,6 +21,7 @@ ApplicationWindow { id: tabBar width: 50 height: width *2 + spacing + currentIndex: 0 transformOrigin: Item.Top Layout.alignment: Qt.AlignLeft | Qt.AlignTop 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 { diff --git a/src/applicationLogic.nim b/src/applicationLogic.nim index 8483e57b72..7e6d954c58 100644 --- a/src/applicationLogic.nim +++ b/src/applicationLogic.nim @@ -17,6 +17,7 @@ QtObject: type ApplicationLogic* = ref object of QObject app: QApplication callResult: string + accountResult: string # Constructor proc newApplicationLogic*(app: QApplication): ApplicationLogic = @@ -58,6 +59,7 @@ QtObject: proc setCallResult(self: ApplicationLogic, callResult: string) {.slot.} = if self.callResult == callResult: return self.callResult = callResult + self.accountResult = "0x123" self.callResultChanged(callResult) proc `callResult=`*(self: ApplicationLogic, callResult: string) = self.setCallResult(callResult) @@ -74,3 +76,15 @@ QtObject: # proc onMessage*(self: ApplicationLogic, message: string) {.slot.} = # self.setCallResult(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