From 8815fd2b65d128f0267e2e1ad903ce70485e996f Mon Sep 17 00:00:00 2001 From: Louis-Joseph Fournier Date: Sun, 27 Dec 2015 09:51:42 +0100 Subject: [PATCH] Desktop: simple window with tuner intergration --- qml/Desktop.qml | 12 ++++++++++++ src/desktop.cpp | 6 ++++-- 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/qml/Desktop.qml b/qml/Desktop.qml index 459c82a..5cbbfce 100644 --- a/qml/Desktop.qml +++ b/qml/Desktop.qml @@ -1,4 +1,16 @@ import QtQuick 2.0 +import LJTuner 1.0 Item { + anchors.fill: parent + Tuner { + id: tuner + running: true + } + Text { + text: tuner.freq.toFixed(2) + " Hz" + font.pixelSize: parent.height / 4 + anchors.horizontalCenter: parent.horizontalCenter + anchors.verticalCenter: parent.verticalCenter + } } diff --git a/src/desktop.cpp b/src/desktop.cpp index 2ad74a3..df0a65e 100644 --- a/src/desktop.cpp +++ b/src/desktop.cpp @@ -2,9 +2,11 @@ #include #include -int main(int argc, char* argv[]) +#include "Tuner.hpp" + +Q_DECL_EXPORT int main(int argc, char* argv[]) { -// qmlRegisterType("LJDBMeter", 1, 0, "DBMeter"); + qmlRegisterType("LJTuner", 1, 0, "Tuner"); QGuiApplication app(argc, argv); QQuickView view;