display account
This commit is contained in:
parent
5a174f260a
commit
aba191841b
8
main.qml
8
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,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 {
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue