commit 269b48ed9d2c345ed32d8f8886c325bc577ad025 Author: Anika Raemer Date: Wed Oct 17 20:51:39 2018 +0200 initial commit, basic project with basic components diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..5c77fa9 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +build-LenaPi-Desktop-Debug diff --git a/LenaPi/CircularListDelegate.qml b/LenaPi/CircularListDelegate.qml new file mode 100644 index 0000000..1ce8541 --- /dev/null +++ b/LenaPi/CircularListDelegate.qml @@ -0,0 +1,29 @@ +import QtQuick 2.0 +import QtGraphicalEffects 1.0 + +Rectangle{ + id: circle + width: 100 + height: width + radius: width/2 + color: "blue" + Image{ + id: contentImage + source: "file:///home/ar/source/LenaPi/pics/benjamin.jpeg" + anchors.centerIn: parent + width: parent.width-10 + height: width + fillMode: Image.PreserveAspectCrop + layer.enabled: true + layer.effect: OpacityMask{ + maskSource: circle + } + } + MouseArea{ + id: controlObject + anchors.fill: parent + onClicked:{ + console.log("circle clicked") + } + } +} diff --git a/LenaPi/LenaPi.pro b/LenaPi/LenaPi.pro new file mode 100644 index 0000000..30a9c5d --- /dev/null +++ b/LenaPi/LenaPi.pro @@ -0,0 +1,30 @@ +TEMPLATE = app + +QT += qml quick +CONFIG += c++11 + +SOURCES += main.cpp + +RESOURCES += qml.qrc + +# Additional import path used to resolve QML modules in Qt Creator's code model +QML_IMPORT_PATH = + +# Additional import path used to resolve QML modules just for Qt Quick Designer +QML_DESIGNER_IMPORT_PATH = + +# The following define makes your compiler emit warnings if you use +# any feature of Qt which as been marked deprecated (the exact warnings +# depend on your compiler). Please consult the documentation of the +# deprecated API in order to know how to port your code away from it. +DEFINES += QT_DEPRECATED_WARNINGS + +# You can also make your code fail to compile if you use deprecated APIs. +# In order to do so, uncomment the following line. +# You can also select to disable deprecated APIs only up to a certain version of Qt. +#DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x060000 # disables all the APIs deprecated before Qt 6.0.0 + +# Default rules for deployment. +qnx: target.path = /tmp/$${TARGET}/bin +else: unix:!android: target.path = /opt/$${TARGET}/bin +!isEmpty(target.path): INSTALLS += target diff --git a/LenaPi/LenaPi.pro.user b/LenaPi/LenaPi.pro.user new file mode 100644 index 0000000..c477d3c --- /dev/null +++ b/LenaPi/LenaPi.pro.user @@ -0,0 +1,336 @@ + + + + + + EnvironmentId + {76cb87c9-a04b-479b-87ff-1b3ddab073a7} + + + ProjectExplorer.Project.ActiveTarget + 0 + + + ProjectExplorer.Project.EditorSettings + + true + false + true + + Cpp + + CppGlobal + + + + QmlJS + + QmlJSGlobal + + + 2 + UTF-8 + false + 4 + false + 80 + true + true + 1 + true + false + 0 + true + true + 0 + 8 + true + 1 + true + true + true + false + + + + ProjectExplorer.Project.PluginSettings + + + + ProjectExplorer.Project.Target.0 + + Desktop + Desktop + {f9938f31-357c-4785-aa6e-21a3feac2ebf} + 0 + 0 + 0 + + /home/ar/source/LenaPi/build-LenaPi-Desktop-Debug + + + true + qmake + + QtProjectManager.QMakeBuildStep + true + + false + false + false + + + true + Make + + Qt4ProjectManager.MakeStep + + -w + -r + + false + + + + 2 + Build + + ProjectExplorer.BuildSteps.Build + + + + true + Make + + Qt4ProjectManager.MakeStep + + -w + -r + + true + clean + + + 1 + Clean + + ProjectExplorer.BuildSteps.Clean + + 2 + false + + Debug + + Qt4ProjectManager.Qt4BuildConfiguration + 2 + true + + + /home/ar/source/LenaPi/build-LenaPi-Desktop-Release + + + true + qmake + + QtProjectManager.QMakeBuildStep + false + + false + false + false + + + true + Make + + Qt4ProjectManager.MakeStep + + -w + -r + + false + + + + 2 + Build + + ProjectExplorer.BuildSteps.Build + + + + true + Make + + Qt4ProjectManager.MakeStep + + -w + -r + + true + clean + + + 1 + Clean + + ProjectExplorer.BuildSteps.Clean + + 2 + false + + Release + + Qt4ProjectManager.Qt4BuildConfiguration + 0 + true + + + /home/ar/source/LenaPi/build-LenaPi-Desktop-Profile + + + true + qmake + + QtProjectManager.QMakeBuildStep + true + + false + true + false + + + true + Make + + Qt4ProjectManager.MakeStep + + -w + -r + + false + + + + 2 + Build + + ProjectExplorer.BuildSteps.Build + + + + true + Make + + Qt4ProjectManager.MakeStep + + -w + -r + + true + clean + + + 1 + Clean + + ProjectExplorer.BuildSteps.Clean + + 2 + false + + Profile + + Qt4ProjectManager.Qt4BuildConfiguration + 0 + true + + 3 + + + 0 + Deploy + + ProjectExplorer.BuildSteps.Deploy + + 1 + Deploy locally + + ProjectExplorer.DefaultDeployConfiguration + + 1 + + + false + false + 1000 + + true + + false + false + false + false + true + 0.01 + 10 + true + 1 + 25 + + 1 + true + false + true + valgrind + + 0 + 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + 10 + 11 + 12 + 13 + 14 + + 2 + + LenaPi + + Qt4ProjectManager.Qt4RunConfiguration:/home/ar/source/LenaPi/LenaPi/LenaPi.pro + true + + LenaPi.pro + false + + + 3768 + false + true + false + false + true + + 1 + + + + ProjectExplorer.Project.TargetCount + 1 + + + ProjectExplorer.Project.Updater.FileVersion + 18 + + + Version + 18 + + diff --git a/LenaPi/MainForm.ui.qml b/LenaPi/MainForm.ui.qml new file mode 100644 index 0000000..f2cd99e --- /dev/null +++ b/LenaPi/MainForm.ui.qml @@ -0,0 +1,29 @@ +import QtQuick 2.7 + +Rectangle { + property alias mouseArea: mouseArea + property alias textEdit: textEdit + + width: 360 + height: 360 + + MouseArea { + id: mouseArea + anchors.fill: parent + } + + TextEdit { + id: textEdit + text: qsTr("Enter some text...") + verticalAlignment: Text.AlignVCenter + anchors.top: parent.top + anchors.horizontalCenter: parent.horizontalCenter + anchors.topMargin: 20 + Rectangle { + anchors.fill: parent + anchors.margins: -10 + color: "transparent" + border.width: 1 + } + } +} diff --git a/LenaPi/MyScrollView.qml b/LenaPi/MyScrollView.qml new file mode 100644 index 0000000..4d3e6e8 --- /dev/null +++ b/LenaPi/MyScrollView.qml @@ -0,0 +1,32 @@ +import QtQuick 2.0 +import QtQuick.Controls 1.4 +import QtQuick.Controls.Styles 1.4 + +ScrollView{ + style: ScrollViewStyle{ + transientScrollBars: true + handle: Item { + implicitWidth: 16 + implicitHeight: 8 + Rectangle { + color: "blue" + border.color: "black" + radius: height/2 + anchors.fill: parent + anchors.topMargin: 1 + anchors.leftMargin: 1 + anchors.rightMargin: 1 + anchors.bottomMargin: 1 + } + } + scrollBarBackground: Rectangle{ + color: "transparent" + border.color: "grey" + border.width: 1 + height: 8 + radius: height/2 + } + decrementControl: Item{} + incrementControl: Item{} + } +} diff --git a/LenaPi/RectangularListDelegate.qml b/LenaPi/RectangularListDelegate.qml new file mode 100644 index 0000000..4f2fb2e --- /dev/null +++ b/LenaPi/RectangularListDelegate.qml @@ -0,0 +1,23 @@ +import QtQuick 2.0 + +Rectangle{ + id: container + width: 100 + height: width + color: "blue" + Image{ + id: contentImage + source: "file:///home/ar/source/LenaPi/pics/benjamin.jpeg" + anchors.centerIn: parent + width: parent.width-10 + height: width + fillMode: Image.PreserveAspectCrop + } + MouseArea{ + id: controlObject + anchors.fill: parent + onClicked:{ + console.log("rectangle clicked") + } + } +} diff --git a/LenaPi/main.cpp b/LenaPi/main.cpp new file mode 100644 index 0000000..d76049d --- /dev/null +++ b/LenaPi/main.cpp @@ -0,0 +1,12 @@ +#include +#include + +int main(int argc, char *argv[]) +{ + QGuiApplication app(argc, argv); + + QQmlApplicationEngine engine; + engine.load(QUrl(QStringLiteral("qrc:/main.qml"))); + + return app.exec(); +} diff --git a/LenaPi/main.qml b/LenaPi/main.qml new file mode 100644 index 0000000..d9d3e16 --- /dev/null +++ b/LenaPi/main.qml @@ -0,0 +1,50 @@ +import QtQuick 2.7 +import QtQuick.Window 2.2 +import QtQuick.Controls 1.4 + +Window { + visible: true + width: 800 + height: 480 + title: "LenaPi 1.0" + + MyScrollView{ + id: circleList + anchors.left: parent.left + anchors.right: parent.right + anchors.top: parent.top + anchors.margins: 20 + + flickableItem.interactive: true + contentItem: + ListView{ + model: 20 + anchors.fill: parent + spacing: 10 + orientation: ListView.Horizontal + delegate: + CircularListDelegate{ + id: test + } + } + } + MyScrollView{ + anchors.left: parent.left + anchors.right: parent.right + anchors.top: circleList.bottom + anchors.margins: 20 + + flickableItem.interactive: true + contentItem: + ListView{ + model: 20 + anchors.fill: parent + spacing: 10 + orientation: ListView.Horizontal + delegate: + RectangularListDelegate{ + id: test + } + } + } +} diff --git a/LenaPi/qml.qrc b/LenaPi/qml.qrc new file mode 100644 index 0000000..9394177 --- /dev/null +++ b/LenaPi/qml.qrc @@ -0,0 +1,9 @@ + + + main.qml + MainForm.ui.qml + CircularListDelegate.qml + MyScrollView.qml + RectangularListDelegate.qml + + diff --git a/pics/benjamin.jpeg b/pics/benjamin.jpeg new file mode 100644 index 0000000..54eaf0a Binary files /dev/null and b/pics/benjamin.jpeg differ