From mboxrd@z Thu Jan 1 00:00:00 1970 Return-path: Received: from mediacenter.hi.pengutronix.de ([2001:6f8:1178:2::65]) by metis.ext.pengutronix.de with esmtp (Exim 4.72) (envelope-from ) id 1RLy0U-0000QP-VK for ptxdist@pengutronix.de; Thu, 03 Nov 2011 15:11:02 +0100 Received: from mol by mediacenter.hi.pengutronix.de with local (Exim 4.72) (envelope-from ) id 1RLy0U-0003J5-Tq for ptxdist@pengutronix.de; Thu, 03 Nov 2011 15:11:02 +0100 Date: Thu, 3 Nov 2011 15:11:02 +0100 From: Michael Olbrich Message-ID: <20111103141102.GA11457@pengutronix.de> References: <1320325983-5124-1-git-send-email-holzmayr@rsi-elektrotechnik.de> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <1320325983-5124-1-git-send-email-holzmayr@rsi-elektrotechnik.de> Subject: Re: [ptxdist] [PATCH 1/2] Add a simple QML demo application Reply-To: ptxdist@pengutronix.de List-Id: PTXdist Development Mailing List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: ptxdist-bounces@pengutronix.de Errors-To: ptxdist-bounces@pengutronix.de To: ptxdist@pengutronix.de On Thu, Nov 03, 2011 at 02:13:02PM +0100, Josef Holzmayr wrote: > Signed-off-by: Josef Holzmayr > --- > local_src/qml-demo-2011.11.0/main.cpp | 20 +++++ > local_src/qml-demo-2011.11.0/qml-demo.pro | 15 ++++ > local_src/qml-demo-2011.11.0/qml/main.qml | 125 +++++++++++++++++++++++++++++ > projectroot/etc/init.d/startup | 6 +- > rules/qml-demo.in | 15 ++++ > rules/qml-demo.make | 78 ++++++++++++++++++ > 6 files changed, 258 insertions(+), 1 deletions(-) > create mode 100644 local_src/qml-demo-2011.11.0/main.cpp > create mode 100644 local_src/qml-demo-2011.11.0/qml-demo.pro > create mode 100644 local_src/qml-demo-2011.11.0/qml/main.qml > create mode 100644 rules/qml-demo.in > create mode 100644 rules/qml-demo.make > > diff --git a/local_src/qml-demo-2011.11.0/main.cpp b/local_src/qml-demo-2011.11.0/main.cpp > new file mode 100644 > index 0000000..bd1e60d > --- /dev/null > +++ b/local_src/qml-demo-2011.11.0/main.cpp > @@ -0,0 +1,20 @@ > +#include > +#include > +#include > + > +int main(int argc, char **argv) > +{ > + > + QApplication app(argc, argv); > + > +/* Hide the mouse cursor. Guards are there to enable compileability on non-embedded qt systems*/ > +#ifdef Q_WS_QWS > + QWSServer::setCursorVisible( false ); > +#endif > + > + QDeclarativeView *qdv = new QDeclarativeView; > + qdv->setSource(QUrl::fromLocalFile("/usr/lib/qml-demo/main.qml")); > + qdv->showFullScreen(); > + > + return app.exec();; > +} > diff --git a/local_src/qml-demo-2011.11.0/qml-demo.pro b/local_src/qml-demo-2011.11.0/qml-demo.pro > new file mode 100644 > index 0000000..8587a4f > --- /dev/null > +++ b/local_src/qml-demo-2011.11.0/qml-demo.pro > @@ -0,0 +1,15 @@ > +CONFIG += qt > + > +TARGET = qml-demo > + > +SOURCES = main.cpp > +FORMS = > +HEADERS = > + > +QT += declarative > + > +MOC_DIR = moc > + > +OTHER_FILES += \ > + qml/main.qml > + > diff --git a/local_src/qml-demo-2011.11.0/qml/main.qml b/local_src/qml-demo-2011.11.0/qml/main.qml > new file mode 100644 > index 0000000..907e16e > --- /dev/null > +++ b/local_src/qml-demo-2011.11.0/qml/main.qml > @@ -0,0 +1,125 @@ > +import QtQuick 1.0 > + > +Rectangle { > + id: page > + color: "grey" > + width: 320 > + height: 240 > + > + Rectangle { > + id: rectTL > + x: 10 > + y: 10 > + width: 50 > + height: 50 > + color: "#00000000" > + border.color: "#000000" > + > + MouseArea { > + anchors.fill: parent > + onClicked: page.state = 'TL' > + } > + } > + Rectangle { > + id: rectTR > + x: 260 > + y: 10 > + width: 50 > + height: 50 > + color: "#00000000" > + border.color: "#000000" > + > + MouseArea { > + anchors.fill: parent > + onClicked: page.state = 'TR' > + } > + } > + Rectangle { > + id: rectBL > + x: 10 > + y: 180 > + width: 50 > + height: 50 > + color: "#00000000" > + border.color: "#000000" > + > + MouseArea { > + anchors.fill: parent > + onClicked: page.state = 'BL' > + } > + } > + Rectangle { > + id: rectBR > + x: 260 > + y: 180 > + width: 50 > + height: 50 > + color: "#00000000" > + border.color: "#000000" > + > + MouseArea { > + anchors.fill: parent > + onClicked: page.state = 'BR' > + } > + } > + > + Rectangle { > + id: marker > + x: 145 > + y: 105 > + width: 30 > + height: 30 > + color: "#ff0000" > + } > + > + Text { > + id: text1 > + x: 21 > + y: 78 > + text: qsTr("Touch the black squares to move the red marker.") > + anchors.horizontalCenter: parent.horizontalCenter > + horizontalAlignment: Text.AlignHCenter > + font.family: "Arial Black" > + font.underline: true > + font.pixelSize: 12 > + } > + states: [ > + State { > + name: "TL" > + > + PropertyChanges { > + target: marker > + x: 20 > + y: 20 > + } > + }, > + State { > + name: "TR" > + PropertyChanges { > + target: marker > + x: 270 > + y: 20 > + } > + }, > + State { > + name: "BL" > + PropertyChanges { > + target: marker > + x: 20 > + y: 190 > + } > + }, > + State { > + name: "BR" > + PropertyChanges { > + target: marker > + x: 270 > + y: 190 > + } > + } > + ] > + > + transitions: Transition { > + NumberAnimation { properties: "x, y"; easing.type: Easing.InOutQuad; duration: 500 } > + } > +} > diff --git a/projectroot/etc/init.d/startup b/projectroot/etc/init.d/startup > index 3b27a32..d698944 100644 > --- a/projectroot/etc/init.d/startup > +++ b/projectroot/etc/init.d/startup > @@ -6,7 +6,11 @@ > case $1 in > > start) > - /usr/bin/qt4-demo -qws & > + if [ -x /usr/bin/qt4-demo ]; then > + /usr/bin/qt4-demo -qws & > + elif [ -x /usr/bin/qml-demo ]; then > + /usr/bin/qml-demo -qws & > + fi > ;; > > esac > diff --git a/rules/qml-demo.in b/rules/qml-demo.in > new file mode 100644 > index 0000000..0e7531e > --- /dev/null > +++ b/rules/qml-demo.in > @@ -0,0 +1,15 @@ > +## SECTION=qt > + > +config QML_DEMO > + tristate > + prompt "qml-demo" > + select QT4 > + select QT4_MOUSE_TSLIB > + select STARTUP > + select RC_ONCE > + help > + Enable this entry to get a simple QML demo running at startup on > + your target. It can act as a simple example how to integrate your > + own QML based application into this PTXdist project. > + Part of this entry is the installation of a start script that runs > + this QML application when the system starts. > diff --git a/rules/qml-demo.make b/rules/qml-demo.make > new file mode 100644 > index 0000000..881692d > --- /dev/null > +++ b/rules/qml-demo.make > @@ -0,0 +1,78 @@ > +# -*-makefile-*- > +# > +# Copyright (C) 2009 by Michael Olbrich > +# Copyright (C) 2011 by Juergen Beisert > +# Copyright (C) 2011 by Josef Holzmayr > +# > +# See CREDITS for details about who has contributed to this project. > +# > +# For further information about the PTXdist project and license conditions > +# see the README file. > +# > + > +# > +# We provide this package > +# > +PACKAGES-$(PTXCONF_QML_DEMO) += qml-demo > + > +# > +# Paths and names > +# > +QML_DEMO_VERSION := 2011.11.0 > +QML_DEMO := qml-demo-$(QML_DEMO_VERSION) > +QML_DEMO_URL := file://$(PTXDIST_WORKSPACE)/local_src/$(QML_DEMO) > +QML_DEMO_DIR := $(BUILDDIR)/$(QML_DEMO) > +QML_DEMO_BUILD_OOT := YES > +QML_DEMO_BUILDDIR := $(BUILDDIR)/$(QML_DEMO)-build > + > +# ---------------------------------------------------------------------------- > +# Get > +# ---------------------------------------------------------------------------- > + > +$(QML_DEMO_SOURCE): > + @$(call targetinfo) > + @$(call get, QML_DEMO) > + > +# ---------------------------------------------------------------------------- > +# Target-Install > +# ---------------------------------------------------------------------------- > + > +$(STATEDIR)/qml-demo.targetinstall: > + @$(call targetinfo) > + > + @$(call install_init, qml-demo) > + @$(call install_fixup, qml-demo,PACKAGE,qml-demo) > + @$(call install_fixup, qml-demo,PRIORITY,optional) > + @$(call install_fixup, qml-demo,VERSION,$(QML_DEMO_VERSION)) > + @$(call install_fixup, qml-demo,SECTION,base) > + @$(call install_fixup, qml-demo,AUTHOR,"Josef Holzmayr ") > + @$(call install_fixup, qml-demo,DEPENDS,) > + @$(call install_fixup, qml-demo,DESCRIPTION, "Simple QML Demo App") > + > +# install the essentials of this build to the target > + @$(call install_copy, qml-demo, 0, 0, 0755, \ > + $(QML_DEMO_BUILDDIR)/qml-demo, \ > + /usr/bin/qml-demo) > + > +# copy basically all QML file, though there's only one in this demo. > + @for i in $(shell cd $(QML_DEMO_DIR)/qml && find . -iname *.qml); do \ > + $(call install_copy, qml-demo, 0, 0, 0755, $(QML_DEMO_DIR)/qml/$$i, /usr/lib/qml-demo/$$i); \ > + done @$(call install_tree, qml-demo, 0, 0, $(QML_DEMO_DIR)/qml \ /usr/lib/qml-demo) or something like that (untested). Michael > + > + @$(call install_alternative, qml-demo, 0, 0, 0755, \ > + /etc/rc.once.d/tscalibrate) > + > + @$(call install_finish, qml-demo) > + > + @$(call touch) > + > +# ---------------------------------------------------------------------------- > +# Clean > +# ---------------------------------------------------------------------------- > + > +qml-demo_clean: > + rm -rf $(STATEDIR)/qml-demo.* > + rm -rf $(PKGDIR)/qml-demo_* > + rm -rf $(QML_DEMO_DIR) > + > +# vim: syntax=make > -- > 1.7.4.1 > > > -- > _____________________________________________________________ > R-S-I Elektrotechnik GmbH & Co. KG > Woelkestrasse 11 > D-85301 Schweitenkirchen > Fon: +49 8444 9204-0 > Fax: +49 8444 9204-50 > www.rsi-elektrotechnik.de > > _____________________________________________________________ > Amtsgericht Ingolstadt - GmbH: HRB 191328 - KG: HRA 170363 > Gesch?ftsf?hrer: Dr.-Ing. Michael Sorg, Dipl.-Ing. Franz Sorg > USt-IdNr.: DE 128592548 > > > -- > ptxdist mailing list > ptxdist@pengutronix.de -- Pengutronix e.K. | | Industrial Linux Solutions | http://www.pengutronix.de/ | Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 | Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 | -- ptxdist mailing list ptxdist@pengutronix.de