Merge branch 'master' of github.com:cryptonomex/graphene
This commit is contained in:
commit
f19ed0c697
4 changed files with 24 additions and 66 deletions
|
|
@ -6,14 +6,16 @@ project(light_client)
|
|||
set(CMAKE_INCLUDE_CURRENT_DIR ON)
|
||||
# Instruct CMake to run moc automatically when needed.
|
||||
set(CMAKE_AUTOMOC ON)
|
||||
# Instruct CMake to run rcc automatically when needed.
|
||||
set(CMAKE_AUTORCC ON)
|
||||
|
||||
find_package(Qt5Core)
|
||||
find_package(Qt5Widgets)
|
||||
find_package(Qt5Quick)
|
||||
|
||||
file(GLOB QML qml/*)
|
||||
add_executable(light_client ClientDataModel.cpp ClientDataModel.hpp main.cpp ${QML})
|
||||
|
||||
qt5_add_resources(QML_QRC qml/qml.qrc)
|
||||
|
||||
add_executable(light_client ClientDataModel.cpp ClientDataModel.hpp main.cpp ${QML_QRC})
|
||||
add_dependencies(light_client gen_qrc)
|
||||
|
||||
target_link_libraries(light_client PRIVATE Qt5::Core Qt5::Widgets Qt5::Quick graphene_chain graphene_utilities fc)
|
||||
|
|
|
|||
|
|
@ -1,45 +0,0 @@
|
|||
import QtQuick 2.5
|
||||
import QtQuick.Controls 1.4
|
||||
import QtQuick.Layouts 1.2
|
||||
|
||||
Item {
|
||||
id: item1
|
||||
width: 640
|
||||
height: 480
|
||||
|
||||
property alias button1: button1
|
||||
property alias button2: button2
|
||||
|
||||
ColumnLayout {
|
||||
id: columnLayout1
|
||||
width: parent.width / 2
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
anchors.horizontalCenter: parent.horizontalCenter
|
||||
|
||||
RowLayout {
|
||||
id: buttonRow
|
||||
Layout.fillWidth: true
|
||||
|
||||
Button {
|
||||
id: button1
|
||||
text: qsTr("Press Me 1")
|
||||
}
|
||||
Item { Layout.fillWidth: true }
|
||||
Button {
|
||||
id: button2
|
||||
text: qsTr("Press Me 2")
|
||||
}
|
||||
}
|
||||
|
||||
Slider {
|
||||
id: slider
|
||||
Layout.fillWidth: true
|
||||
}
|
||||
ProgressBar {
|
||||
id: progressBar1
|
||||
value: Math.sin(Math.PI * slider.value)
|
||||
Layout.fillWidth: true
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -2,9 +2,12 @@ import QtQuick 2.5
|
|||
import QtQuick.Controls 1.4
|
||||
import QtQuick.Dialogs 1.2
|
||||
|
||||
import Qt.labs.settings 1.0
|
||||
|
||||
import Graphene.Client 0.1
|
||||
|
||||
ApplicationWindow {
|
||||
id: window
|
||||
visible: true
|
||||
width: 640
|
||||
height: 480
|
||||
|
|
@ -26,26 +29,25 @@ ApplicationWindow {
|
|||
|
||||
DataModel {
|
||||
id: model
|
||||
objectName: "model"
|
||||
}
|
||||
Settings {
|
||||
id: appSettings
|
||||
category: "appSettings"
|
||||
}
|
||||
|
||||
MainForm {
|
||||
id: form
|
||||
anchors.fill: parent
|
||||
button1.onClicked: {
|
||||
console.log(JSON.stringify(model.getAccount(3)))
|
||||
messageDialog.show(qsTr("Account name is %1").arg(model.getAccount(3).name))
|
||||
}
|
||||
button2.onClicked: messageDialog.show(qsTr("Account name is %1").arg(model.getAccount("steve").name))
|
||||
Label {
|
||||
anchors.centerIn: parent
|
||||
font.pointSize: 75
|
||||
text: "Dashboard goes here"
|
||||
opacity: .5
|
||||
}
|
||||
|
||||
MessageDialog {
|
||||
id: messageDialog
|
||||
title: qsTr("May I have your attention, please?")
|
||||
|
||||
function show(caption) {
|
||||
messageDialog.text = caption;
|
||||
messageDialog.open();
|
||||
}
|
||||
// This Settings is only for geometry -- it doesn't get an id. See appSettings for normal settings
|
||||
Settings {
|
||||
category: "windowGeometry"
|
||||
property alias x: window.x
|
||||
property alias y: window.y
|
||||
property alias width: window.width
|
||||
property alias height: window.height
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,7 +1,6 @@
|
|||
<RCC>
|
||||
<qresource prefix="/">
|
||||
<file>main.qml</file>
|
||||
<file>MainForm.qml</file>
|
||||
</qresource>
|
||||
</RCC>
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue