-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Begin implementing a counter item for the edh app.
- Loading branch information
Showing
7 changed files
with
144 additions
and
83 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,2 @@ | ||
add_subdirectory(edit) | ||
add_subdirectory(edh) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
project(aspire-edh) | ||
|
||
project_add_executable(${PROJECT_NAME}) | ||
|
||
target_sources(${PROJECT_NAME} PRIVATE | ||
main.cpp | ||
) | ||
|
||
target_link_libraries(${PROJECT_NAME} PRIVATE | ||
Qt::Quick | ||
aspireplugin | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
import QtQuick | ||
import aspire | ||
|
||
Rectangle { | ||
width: 1280 | ||
height: 720 | ||
anchors.fill: parent | ||
color: "blue" | ||
border.width: 4 | ||
border.color: "grey" | ||
|
||
Counter { | ||
color: "red" | ||
width: parent.width / 2 | ||
height: parent.height / 2 | ||
rotation: 180 | ||
value: 40 | ||
} | ||
|
||
Counter { | ||
color: "blue" | ||
x: parent.width / 2 | ||
width: parent.width / 2 | ||
height: parent.height / 2 | ||
rotation: 180 | ||
value: 40 | ||
} | ||
|
||
Counter { | ||
color: "green" | ||
y: parent.height / 2 | ||
width: parent.width / 2 | ||
height: parent.height / 2 | ||
value: 40 | ||
} | ||
|
||
Counter { | ||
color: "brown" | ||
y: parent.height / 2 | ||
x: parent.width / 2 | ||
width: parent.width / 2 | ||
height: parent.height / 2 | ||
value: 40 | ||
} | ||
|
||
FrameMetrics { | ||
id: metrics | ||
|
||
thread: FrameMetrics.Thread.Render | ||
} | ||
|
||
Text { | ||
text: metrics.fpsRolling.toFixed(2) | ||
color: "white" | ||
font.pixelSize: 50 | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
#include <QGuiApplication> | ||
#include <QQmlApplicationEngine> | ||
#include <QQuickView> | ||
|
||
int main(int argc, char** argv) | ||
{ | ||
const QGuiApplication app{argc, argv}; | ||
|
||
QQuickView window{}; | ||
|
||
constexpr auto width{1280}; | ||
constexpr auto height{720}; | ||
window.setWidth(width); | ||
window.setHeight(height); | ||
window.setTitle("Aspire EDH"); | ||
window.engine()->addImportPath(":/"); | ||
window.setSource(QUrl{"qrc:/aspire/edh/Main.qml"}); | ||
window.show(); | ||
|
||
return QGuiApplication::exec(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,6 +9,7 @@ project_add_module( | |
Meters.cpp | ||
Meters.h | ||
QML_FILES | ||
Counter.qml | ||
Square.qml | ||
IMPORTS | ||
QtQuick | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
import QtQuick | ||
|
||
Rectangle { | ||
id: root | ||
|
||
property int value: 0 | ||
|
||
border.color: "red" | ||
border.width: 2 | ||
color: Qt.rgba(0.5, 0.5, 0.5, 0.5) | ||
|
||
Text { | ||
id: text | ||
|
||
anchors.fill: text.parent | ||
text: root.value.toString() | ||
font.pixelSize: text.height | ||
color: "white" | ||
horizontalAlignment: Text.AlignHCenter | ||
verticalAlignment: Text.AlignVCenter | ||
} | ||
|
||
MouseArea { | ||
id: left | ||
|
||
height: root.height | ||
width: root.width / 2 | ||
|
||
onClicked: { | ||
root.value -= 1; | ||
} | ||
} | ||
|
||
MouseArea { | ||
id: right | ||
|
||
x: root.width / 2 | ||
height: root.height | ||
width: root.width / 2 | ||
|
||
onClicked: { | ||
root.value += 1; | ||
} | ||
} | ||
} |