mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
QML UI: Implement showing of the dive profile on QML
Link the QMLProfile class to the DiveList.qml file. The profile is displayed above the dive details. Signed-off-by: Grace Karanja <gracie.karanja89@gmail.com>
This commit is contained in:
parent
59232ca172
commit
0c9756c5d7
3 changed files with 10 additions and 1 deletions
|
@ -458,7 +458,7 @@ endif()
|
||||||
|
|
||||||
# create the executables
|
# create the executables
|
||||||
if(SUBSURFACE_MOBILE)
|
if(SUBSURFACE_MOBILE)
|
||||||
set(MOBILE_SRC qt-mobile/qmlmanager.cpp qt-models/divelistmodel.cpp)
|
set(MOBILE_SRC qt-mobile/qmlmanager.cpp qt-mobile/qmlprofile.cpp qt-models/divelistmodel.cpp)
|
||||||
add_definitions(-DSUBSURFACE_MOBILE)
|
add_definitions(-DSUBSURFACE_MOBILE)
|
||||||
qt5_add_resources(MOBILE_RESOURCES qt-mobile/mobile-resources.qrc)
|
qt5_add_resources(MOBILE_RESOURCES qt-mobile/mobile-resources.qrc)
|
||||||
if(ANDROID)
|
if(ANDROID)
|
||||||
|
|
|
@ -19,6 +19,7 @@
|
||||||
#include <QQmlContext>
|
#include <QQmlContext>
|
||||||
#include "qt-mobile/qmlmanager.h"
|
#include "qt-mobile/qmlmanager.h"
|
||||||
#include "qt-models/divelistmodel.h"
|
#include "qt-models/divelistmodel.h"
|
||||||
|
#include "qt-mobile/qmlprofile.h"
|
||||||
QObject *qqWindowObject = NULL;
|
QObject *qqWindowObject = NULL;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -40,6 +41,7 @@ void run_ui()
|
||||||
#ifdef SUBSURFACE_MOBILE
|
#ifdef SUBSURFACE_MOBILE
|
||||||
window->hide();
|
window->hide();
|
||||||
qmlRegisterType<QMLManager>("org.subsurfacedivelog.mobile", 1, 0, "QMLManager");
|
qmlRegisterType<QMLManager>("org.subsurfacedivelog.mobile", 1, 0, "QMLManager");
|
||||||
|
qmlRegisterType<QMLProfile>("org.subsurfacedivelog.mobile", 1, 0, "QMLProfile");
|
||||||
QQmlApplicationEngine engine;
|
QQmlApplicationEngine engine;
|
||||||
DiveListModel diveListModel;
|
DiveListModel diveListModel;
|
||||||
QQmlContext *ctxt = engine.rootContext();
|
QQmlContext *ctxt = engine.rootContext();
|
||||||
|
|
|
@ -77,6 +77,13 @@ Rectangle {
|
||||||
id: editorDetails
|
id: editorDetails
|
||||||
width: detailsPage.width
|
width: detailsPage.width
|
||||||
columns: 2
|
columns: 2
|
||||||
|
Text { }
|
||||||
|
QMLProfile {
|
||||||
|
diveId: id
|
||||||
|
height: 400
|
||||||
|
Layout.fillWidth: true
|
||||||
|
}
|
||||||
|
|
||||||
Text { text: "Location:"; font.bold: true }
|
Text { text: "Location:"; font.bold: true }
|
||||||
TextField { id: txtLocation; text: location; Layout.fillWidth: true }
|
TextField { id: txtLocation; text: location; Layout.fillWidth: true }
|
||||||
Text { text: "Air Temp:"; font.bold: true }
|
Text { text: "Air Temp:"; font.bold: true }
|
||||||
|
|
Loading…
Add table
Reference in a new issue