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