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
width: 50
height: width *2 + spacing
currentIndex: 0
transformOrigin: Item.Top
Layout.alignment: Qt.AlignLeft | Qt.AlignTop
Layout.fillHeight: true
@ -141,8 +142,13 @@ ApplicationWindow {
}
Item {
ColumnLayout {
anchors.fill: parent
RowLayout {
Layout.fillHeight: true
TextArea { id: accountsResult; Layout.fillWidth: true; text: logic.accountsResult; readOnly: true }
}
}
Item {

View File

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