diff options
author | Miikka Heikkinen <miikka.heikkinen@theqtcompany.com> | 2015-10-29 17:55:58 +0200 |
---|---|---|
committer | Miikka Heikkinen <miikka.heikkinen@theqtcompany.com> | 2015-10-30 07:44:29 +0000 |
commit | 5e63a05ea53ea35e895d1b7e3c9bc5bba4f18540 (patch) | |
tree | 7ff5c4b1e72e91de57cb2d85f24694bfd11ba37e /examples/charts/qmloscilloscope | |
parent | 0b24d110d889878b2ae968d5731dcb71b77ffac3 (diff) |
Use Item instead of Rectangle as a background item where possible
Using Rectangle as background is not recommended if it is only for
color. It is more efficient to simply set the window color.
Change-Id: I3447ca394d74fa415bde4e9d2f210c81f354555e
Reviewed-by: Titta Heikkala <titta.heikkala@theqtcompany.com>
Diffstat (limited to 'examples/charts/qmloscilloscope')
-rw-r--r-- | examples/charts/qmloscilloscope/main.cpp | 1 | ||||
-rw-r--r-- | examples/charts/qmloscilloscope/qml/qmloscilloscope/main.qml | 3 |
2 files changed, 2 insertions, 2 deletions
diff --git a/examples/charts/qmloscilloscope/main.cpp b/examples/charts/qmloscilloscope/main.cpp index 29d8da78..f4c2f65b 100644 --- a/examples/charts/qmloscilloscope/main.cpp +++ b/examples/charts/qmloscilloscope/main.cpp @@ -51,6 +51,7 @@ int main(int argc, char *argv[]) viewer.setSource(QUrl("qrc:/qml/qmloscilloscope/main.qml")); viewer.setResizeMode(QQuickView::SizeRootObjectToView); + viewer.setColor(QColor("#404040")); viewer.show(); return app.exec(); diff --git a/examples/charts/qmloscilloscope/qml/qmloscilloscope/main.qml b/examples/charts/qmloscilloscope/qml/qmloscilloscope/main.qml index 10cf0cfa..808fed03 100644 --- a/examples/charts/qmloscilloscope/qml/qmloscilloscope/main.qml +++ b/examples/charts/qmloscilloscope/qml/qmloscilloscope/main.qml @@ -22,11 +22,10 @@ import QtQuick 2.0 //![1] -Rectangle { +Item { id: main width: 600 height: 400 - color: "#404040" ControlPanel { id: controlPanel |