Changeset 0ea6f13 in subsurface


Ignore:
Timestamp:
Jun 11, 2017, 1:55:41 PM (6 months ago)
Author:
Dirk Hohndel <dirk@…>
Branches:
master
Children:
2d84891
Parents:
e7cd1785
git-author:
Tomaz Canabrava <tcanabrava@…> (06/05/17 09:16:12)
git-committer:
Dirk Hohndel <dirk@…> (06/11/17 13:55:41)
Message:

Add a messageHandler to take care of qDebug & friends on QML

all qDebug / qCDebug and friends now will be properly
logged into developer -> log, on QML.

Signed-off-by: Tomaz Canabrava <tcanabrava@…>
Signed-off-by: Dirk Hohndel <dirk@…>

Files:
2 added
3 edited

Legend:

Unmodified
Added
Removed
  • mobile-widgets/qml/Log.qml

    r8525805 r0ea6f13  
    55import QtQuick.Layouts 1.1
    66import QtQuick.Window 2.2
     7import QtQuick.Controls 2.1
    78import org.subsurfacedivelog.mobile 1.0
    89import org.kde.kirigami 2.0 as Kirigami
     
    2223                        text: qsTr("Application Log")
    2324                }
    24                 Kirigami.Label {
    25                         id: logContent
    26                         width: parent.width
    27                         Layout.preferredWidth: parent.width
    28                         Layout.maximumWidth: parent.width
    29                         wrapMode: TextEdit.WrapAtWordBoundaryOrAnywhere
    30                         text: manager.logText
     25
     26                ListView {
     27                        width: parent.width;
     28                        height: 500
     29                        model: logModel
     30                        delegate : Text {
     31                                text : message
     32                        }
    3133                }
     34
    3235                Rectangle {
    3336                        color: "transparent"
  • qt-models/CMakeLists.txt

    r3c3f91d r0ea6f13  
    2424        gpslistmodel.cpp
    2525        diveimportedmodel.cpp
     26        messagehandlermodel.cpp
    2627)
    2728
  • subsurface-mobile-helper.cpp

    r38e24512 r0ea6f13  
    2424#include "core/downloadfromdcthread.h"
    2525#include "qt-models/diveimportedmodel.h"
     26#include "qt-models/messagehandlermodel.h"
    2627
    2728#include "mobile-widgets/qml/kirigami/src/kirigamiplugin.h"
     
    7576        ctxt->setContextProperty("gpsModel", gpsSortModel);
    7677        ctxt->setContextProperty("vendorList", vendorList);
     78        ctxt->setContextProperty("logModel", MessageHandlerModel::self());
    7779
    7880        engine.load(QUrl(QStringLiteral("qrc:///qml/main.qml")));
Note: See TracChangeset for help on using the changeset viewer.