LogForm.ui.qml 954 B

12345678910111213141516171819202122232425262728293031323334353637383940
  1. import QtQuick 2.4
  2. import QtQuick.Controls 2.4
  3. import QtQuick.Layouts 1.3
  4. Page {
  5. width: 1280
  6. height: 570
  7. id: logForm
  8. font.capitalization: Font.MixedCase
  9. Connections {
  10. target: _qmlHandler
  11. onLog: {
  12. log.append(new Date().toLocaleTimeString(Qt.locale("C"),
  13. "[hh:mm:ss]\n") + logText)
  14. logFlickable.contentY = log.height - logFlickable.height
  15. }
  16. }
  17. Flickable {
  18. anchors.fill: parent
  19. id: logFlickable
  20. flickableDirection: Flickable.VerticalFlick
  21. Layout.preferredHeight: 170
  22. Layout.preferredWidth: parent.width
  23. TextArea.flickable: TextArea {
  24. selectByMouse: true
  25. id: log
  26. readOnly: true
  27. wrapMode: TextArea.Wrap
  28. text: qsTr("")
  29. font.pointSize: 15
  30. }
  31. ScrollBar.vertical: ScrollBar {
  32. }
  33. }
  34. }