mirror of
https://github.com/JulianGro/overte.git
synced 2025-04-25 21:55:09 +02:00
49 lines
1 KiB
QML
49 lines
1 KiB
QML
//
|
|
// debugWindow.qml
|
|
//
|
|
// Brad Hefta-Gaub, created on 12/19/2016.
|
|
// Copyright 2016 High Fidelity, Inc.
|
|
//
|
|
// Distributed under the Apache License, Version 2.0.
|
|
// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html
|
|
//
|
|
|
|
import QtQuick 2.5
|
|
import QtQuick.Controls 1.4
|
|
import Hifi 1.0 as Hifi
|
|
|
|
|
|
Rectangle {
|
|
id: root
|
|
width: parent ? parent.width : 100
|
|
height: parent ? parent.height : 100
|
|
|
|
signal moved(vector2d position);
|
|
signal resized(size size);
|
|
|
|
property var channel;
|
|
|
|
TextArea {
|
|
id: textArea
|
|
width: parent.width
|
|
height: parent.height
|
|
text:""
|
|
}
|
|
|
|
function fromScript(message) {
|
|
var MAX_LINE_COUNT = 2000;
|
|
var TRIM_LINES = 500;
|
|
if (textArea.lineCount > MAX_LINE_COUNT) {
|
|
var lines = textArea.text.split('\n');
|
|
lines.splice(0, TRIM_LINES);
|
|
textArea.text = lines.join('\n');
|
|
}
|
|
textArea.append(message);
|
|
}
|
|
|
|
function clearWindow() {
|
|
textArea.remove(0,textArea.length);
|
|
}
|
|
}
|
|
|
|
|