summaryrefslogtreecommitdiff
path: root/tests/applications/positioning_backend/logwidget.cpp
diff options
context:
space:
mode:
authorAlex Blasche <alexander.blasche@qt.io>2018-12-11 10:31:42 +0100
committerAlex Blasche <alexander.blasche@qt.io>2018-12-12 10:22:16 +0000
commit2bb003b7b158890e87731b1a85f3b71008d6284f (patch)
tree6759fd6ba939483bd82a7901f47fc060c09c2df6 /tests/applications/positioning_backend/logwidget.cpp
parentfa56cc36c287108a095f006fa2083796610afe27 (diff)
downloadqtlocation-2bb003b7b158890e87731b1a85f3b71008d6284f.tar.gz
Add ability to visually log position updates in test app
This makes it much easier to check received positions outside of debug/console output. Regular updates cannot be received inside a building which means a device can be taken out of the office for further testing without the need to have a developer machine attached. Change-Id: I1a54a1b2fa269ec4ab75aacc4531158a02345382 Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
Diffstat (limited to 'tests/applications/positioning_backend/logwidget.cpp')
-rw-r--r--tests/applications/positioning_backend/logwidget.cpp46
1 files changed, 46 insertions, 0 deletions
diff --git a/tests/applications/positioning_backend/logwidget.cpp b/tests/applications/positioning_backend/logwidget.cpp
new file mode 100644
index 00000000..5ec47230
--- /dev/null
+++ b/tests/applications/positioning_backend/logwidget.cpp
@@ -0,0 +1,46 @@
+/****************************************************************************
+**
+** Copyright (C) 2018 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the QtPositioning module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:GPL-EXCEPT$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 3 as published by the Free Software
+** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
+** included in the packaging of this file. Please review the following
+** information to ensure the GNU General Public License requirements will
+** be met: https://www.gnu.org/licenses/gpl-3.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "logwidget.h"
+#include <QVBoxLayout>
+
+LogWidget::LogWidget(QWidget *parent) : QWidget(parent)
+{
+ QVBoxLayout *verticalLayout = new QVBoxLayout(this);
+ verticalLayout->setSpacing(6);
+ verticalLayout->setContentsMargins(11, 11, 11, 11);
+ verticalLayout->setObjectName(QString::fromUtf8("verticalLayout"));
+
+ editor = new QPlainTextEdit(this);
+ verticalLayout->addWidget(editor);
+}
+
+void LogWidget::appendLog(const QString &line)
+{
+ editor->appendPlainText(line);
+}