From c665d93204206e2c2098620db3be09d2f8f99cdb Mon Sep 17 00:00:00 2001 From: Oscar Andreasson Date: Fri, 29 May 2015 10:07:04 -0700 Subject: [PATCH] Everything run form inside a qrc file instead. --- QmlMirror.pro | 3 +- QmlMirror.pro.user | 35 ++++-- QmlMirror.qml | 20 +++- Transport.qml | 106 ++++++++++++++++++ Weather.qml | 2 +- .../{components => }/BigForecastIcon.qml | 0 weatherinfo/{components => }/ForecastIcon.qml | 0 weatherinfo/{components => }/WeatherIcon.qml | 3 +- weatherinfo/WeatherInfo.qml | 3 +- weatherinfo/images.qrc | 24 ++++ .../{icons => }/weather-few-clouds.png | Bin weatherinfo/{icons => }/weather-fog.png | Bin weatherinfo/{icons => }/weather-haze.png | Bin weatherinfo/{icons => }/weather-icy.png | Bin weatherinfo/{icons => }/weather-overcast.png | Bin weatherinfo/{icons => }/weather-showers.png | Bin weatherinfo/{icons => }/weather-sleet.png | Bin weatherinfo/{icons => }/weather-snow.png | Bin weatherinfo/{icons => }/weather-storm.png | Bin .../weather-sunny-very-few-clouds.png | Bin weatherinfo/{icons => }/weather-sunny.png | Bin .../{icons => }/weather-thundershower.png | Bin weatherinfo/weatherinfo.pro | 32 +++--- 23 files changed, 196 insertions(+), 32 deletions(-) create mode 100644 Transport.qml rename weatherinfo/{components => }/BigForecastIcon.qml (100%) rename weatherinfo/{components => }/ForecastIcon.qml (100%) rename weatherinfo/{components => }/WeatherIcon.qml (97%) create mode 100644 weatherinfo/images.qrc rename weatherinfo/{icons => }/weather-few-clouds.png (100%) rename weatherinfo/{icons => }/weather-fog.png (100%) rename weatherinfo/{icons => }/weather-haze.png (100%) rename weatherinfo/{icons => }/weather-icy.png (100%) rename weatherinfo/{icons => }/weather-overcast.png (100%) rename weatherinfo/{icons => }/weather-showers.png (100%) rename weatherinfo/{icons => }/weather-sleet.png (100%) rename weatherinfo/{icons => }/weather-snow.png (100%) rename weatherinfo/{icons => }/weather-storm.png (100%) rename weatherinfo/{icons => }/weather-sunny-very-few-clouds.png (100%) rename weatherinfo/{icons => }/weather-sunny.png (100%) rename weatherinfo/{icons => }/weather-thundershower.png (100%) diff --git a/QmlMirror.pro b/QmlMirror.pro index 7a6c0ef..290edbd 100644 --- a/QmlMirror.pro +++ b/QmlMirror.pro @@ -5,5 +5,6 @@ SUBDIRS = weatherinfo SOURCES = QmlMirror.qml \ Clock.qml \ - Weather.qml + Weather.qml \ + Transport.qml diff --git a/QmlMirror.pro.user b/QmlMirror.pro.user index c4d7af0..e3c3979 100644 --- a/QmlMirror.pro.user +++ b/QmlMirror.pro.user @@ -1,6 +1,6 @@ - + EnvironmentId @@ -61,7 +61,7 @@ Desktop Qt 5.4.1 GCC 64bit Desktop Qt 5.4.1 GCC 64bit qt.54.gcc_64_kit - 0 + 1 0 0 @@ -72,8 +72,8 @@ qmake QtProjectManager.QMakeBuildStep - false - true + true + false false false @@ -150,10 +150,23 @@ -r false - + -j 4 - 2 + + true + Make + + Qt4ProjectManager.MakeStep + + -w + -r + + false + install + + + 3 Build ProjectExplorer.BuildSteps.Build @@ -238,19 +251,19 @@ 2 - - + QmlMirror.qml + /opt/Qt/5.4/gcc_64/bin/qmlscene false %{buildDir} - Custom Executable + Run /opt/Qt/5.4/gcc_64/bin/qmlscene ProjectExplorer.CustomExecutableRunConfiguration 3768 false true false - false - true + true + false 1 diff --git a/QmlMirror.qml b/QmlMirror.qml index 5d637e4..8dbc7dd 100644 --- a/QmlMirror.qml +++ b/QmlMirror.qml @@ -4,18 +4,34 @@ import QtQuick.Window 2.0 ApplicationWindow { title: qsTr("Hello World") - width: 640 - height: 250 + width: 1080 + height: 1920 color: "black" Clock { anchors.top: parent.top anchors.left: parent.left + width: 360 + height: 240 } Weather { id: weatherId anchors.top: parent.top anchors.right: parent.right + width: 360 + height: 240 } + + Transport { + id: transportId + anchors.top: weatherId.bottom + anchors.right: parent.right + width: 360 + height: 480 + color: "black" + border.color: "grey" + border.width: 0 + } + } diff --git a/Transport.qml b/Transport.qml new file mode 100644 index 0000000..4a9c5ea --- /dev/null +++ b/Transport.qml @@ -0,0 +1,106 @@ +import QtQuick 2.0 +import QtQuick.Layouts 1.1 +import QtQuick.Controls 1.3 +import QtQuick.Controls.Styles 1.2 + +Rectangle { + color: "black" + width: 360 + height: 480 + + ListModel { + id: lineModel + + ListElement { + number: 16 + destination: "Eketrägatan" + arriving: "5" + next: "10" + } + ListElement { + number: 16 + destination: "Högsbohöjd" + arriving: "5" + next: "10" + } + ListElement { + number: 60 + destination: "Kungssten" + arriving: "5" + next: "10" + } + ListElement { + number: 60 + destination: "Eketrägatan" + arriving: "5" + next: "10" + } + } + + TableView { + anchors.fill: parent + model: lineModel + + style: TableViewStyle { + backgroundColor: "black" + alternateBackgroundColor: "black" + + headerDelegate: Rectangle { + height: textItem.implicitHeight * 1.2 + width: textItem.implicitWidth + color: "black" + Text { + id: textItem + anchors.fill: parent + verticalAlignment: Text.AlignVCenter + horizontalAlignment: Text.AlignLeft + anchors.leftMargin: 0 + text: styleData.value + elide: Text.ElideRight + color: "white" + renderType: Text.NativeRendering + } + Rectangle { + anchors.right: parent.right + anchors.top: parent.top + anchors.bottom: parent.bottom + anchors.bottomMargin: 1 + anchors.topMargin: 1 + width: 1 + color: "black" + } + } + + itemDelegate: Rectangle { + color: "black" + Text { + anchors.verticalCenter: parent.verticalCenter + color: "white" + text: styleData.value + } + } + + } + + TableViewColumn { + role: "number" + title: "No" + width: parent.width / 6 + } + TableViewColumn { + role: "destination" + title: "Destination" + width: (parent.width / 6) * 3 + } + TableViewColumn { + role: "arriving" + title: "Arriving" + width: parent.width / 6 + } + TableViewColumn { + role: "next" + title: "Next" + width: (parent.width / 6)-2 + } + } +} diff --git a/Weather.qml b/Weather.qml index 7239c44..ef26761 100644 --- a/Weather.qml +++ b/Weather.qml @@ -1,5 +1,5 @@ import QtQuick 2.0 -import positioning.weatherinfo 1.0 +import net.frozentux.weatherinfo 1.0 WeatherInfo { diff --git a/weatherinfo/components/BigForecastIcon.qml b/weatherinfo/BigForecastIcon.qml similarity index 100% rename from weatherinfo/components/BigForecastIcon.qml rename to weatherinfo/BigForecastIcon.qml diff --git a/weatherinfo/components/ForecastIcon.qml b/weatherinfo/ForecastIcon.qml similarity index 100% rename from weatherinfo/components/ForecastIcon.qml rename to weatherinfo/ForecastIcon.qml diff --git a/weatherinfo/components/WeatherIcon.qml b/weatherinfo/WeatherIcon.qml similarity index 97% rename from weatherinfo/components/WeatherIcon.qml rename to weatherinfo/WeatherIcon.qml index 485a15a..beb1c7a 100644 --- a/weatherinfo/components/WeatherIcon.qml +++ b/weatherinfo/WeatherIcon.qml @@ -39,6 +39,7 @@ ****************************************************************************/ import QtQuick 2.0 +import net.weatherinfo.weatherinfo 1.0 Item { id: container @@ -46,7 +47,7 @@ Item { property string weatherIcon: "01d" //server icons are too small. we keep using the local images - property bool useServerIcon: true + property bool useServerIcon: false Image { id: img diff --git a/weatherinfo/WeatherInfo.qml b/weatherinfo/WeatherInfo.qml index 0374bc0..877f4bb 100644 --- a/weatherinfo/WeatherInfo.qml +++ b/weatherinfo/WeatherInfo.qml @@ -39,9 +39,8 @@ ****************************************************************************/ import QtQuick 2.0 -import "components" +import net.frozentux.weatherinfo 1.0 //! [0] -import WeatherData 1.0 Item { id: window diff --git a/weatherinfo/images.qrc b/weatherinfo/images.qrc new file mode 100644 index 0000000..3e7a32c --- /dev/null +++ b/weatherinfo/images.qrc @@ -0,0 +1,24 @@ + + + weather-few-clouds.png + weather-fog.png + weather-haze.png + weather-icy.png + weather-overcast.png + weather-showers.png + weather-sleet.png + weather-snow.png + weather-storm.png + weather-sunny.png + weather-sunny-very-few-clouds.png + weather-thundershower.png + + + BigForecastIcon.qml + ForecastIcon.qml + WeatherIcon.qml + + + WeatherInfo.qml + + diff --git a/weatherinfo/icons/weather-few-clouds.png b/weatherinfo/weather-few-clouds.png similarity index 100% rename from weatherinfo/icons/weather-few-clouds.png rename to weatherinfo/weather-few-clouds.png diff --git a/weatherinfo/icons/weather-fog.png b/weatherinfo/weather-fog.png similarity index 100% rename from weatherinfo/icons/weather-fog.png rename to weatherinfo/weather-fog.png diff --git a/weatherinfo/icons/weather-haze.png b/weatherinfo/weather-haze.png similarity index 100% rename from weatherinfo/icons/weather-haze.png rename to weatherinfo/weather-haze.png diff --git a/weatherinfo/icons/weather-icy.png b/weatherinfo/weather-icy.png similarity index 100% rename from weatherinfo/icons/weather-icy.png rename to weatherinfo/weather-icy.png diff --git a/weatherinfo/icons/weather-overcast.png b/weatherinfo/weather-overcast.png similarity index 100% rename from weatherinfo/icons/weather-overcast.png rename to weatherinfo/weather-overcast.png diff --git a/weatherinfo/icons/weather-showers.png b/weatherinfo/weather-showers.png similarity index 100% rename from weatherinfo/icons/weather-showers.png rename to weatherinfo/weather-showers.png diff --git a/weatherinfo/icons/weather-sleet.png b/weatherinfo/weather-sleet.png similarity index 100% rename from weatherinfo/icons/weather-sleet.png rename to weatherinfo/weather-sleet.png diff --git a/weatherinfo/icons/weather-snow.png b/weatherinfo/weather-snow.png similarity index 100% rename from weatherinfo/icons/weather-snow.png rename to weatherinfo/weather-snow.png diff --git a/weatherinfo/icons/weather-storm.png b/weatherinfo/weather-storm.png similarity index 100% rename from weatherinfo/icons/weather-storm.png rename to weatherinfo/weather-storm.png diff --git a/weatherinfo/icons/weather-sunny-very-few-clouds.png b/weatherinfo/weather-sunny-very-few-clouds.png similarity index 100% rename from weatherinfo/icons/weather-sunny-very-few-clouds.png rename to weatherinfo/weather-sunny-very-few-clouds.png diff --git a/weatherinfo/icons/weather-sunny.png b/weatherinfo/weather-sunny.png similarity index 100% rename from weatherinfo/icons/weather-sunny.png rename to weatherinfo/weather-sunny.png diff --git a/weatherinfo/icons/weather-thundershower.png b/weatherinfo/weather-thundershower.png similarity index 100% rename from weatherinfo/icons/weather-thundershower.png rename to weatherinfo/weather-thundershower.png diff --git a/weatherinfo/weatherinfo.pro b/weatherinfo/weatherinfo.pro index edfe6d7..8b31c76 100644 --- a/weatherinfo/weatherinfo.pro +++ b/weatherinfo/weatherinfo.pro @@ -10,27 +10,31 @@ SOURCES += appmodel.cpp \ HEADERS += appmodel.h \ weatherplugin.h -target.path = $$[QT_INSTALL_QML]/positioning/weatherinfo +target.path = $$[QT_INSTALL_QML]/net/frozentux/weatherinfo INSTALLS += target -uri=weatherdata +uri=net.frozentux.weatherinfo + OTHER_FILES += \ components/BigForecastIcon.qml \ components/ForecastIcon.qml \ components/WeatherIcon.qml \ - icons/weather-few-clouds.png \ - icons/weather-fog.png \ - icons/weather-haze.png \ - icons/weather-icy.png \ - icons/weather-overcast.png \ - icons/weather-showers.png \ - icons/weather-sleet.png \ - icons/weather-snow.png \ - icons/weather-storm.png \ - icons/weather-sunny.png \ - icons/weather-sunny-very-few-clouds.png \ - icons/weather-thundershower.png \ + icons/weather-few-clouds.xcf \ + icons/weather-fog.xcf \ + icons/weather-haze.xcf \ + icons/weather-icy.xcf \ + icons/weather-overcast.xcf \ + icons/weather-showers.xcf \ + icons/weather-sleet.xcf \ + icons/weather-snow.xcf \ + icons/weather-storm.xcf \ + icons/weather-sunny.xcf \ + icons/weather-sunny-very-few-clouds.xcf \ + icons/weather-thundershower.xcf \ icons/README.txt DISTFILES += \ WeatherInfo.qml + +RESOURCES += \ + images.qrc