On 04/21/2010 03:55 AM, Allison Warwick (Nokia-D-Qt/Brisbane) wrote:
#! is magic implemented by *exec* itself, and that's not what you really want, 
right? (i.e. you don't care if QProcess can't magically run QML files). It 
would also required that you chmod+x your QML files (yikes). But you just want 
your shell to know what to do with a *.qml file, right?
The coffee room consensus this morning was that letting exec (i.e. the kernel) handle it is exactly what one would want if one were to use qml+js as a scripting language (or for writing small standalone applications for that matter). It is much better if an executable is an executable is an executable. Helps to avoid contraptions like the attached helloworld ;-)

Btw, at least the qml viewer in the tech preview refuses to open files that do not end in .qml, which seems somewhat overly cautious.

This is now drifting somewhat off topic, so I guess I better stop here.
--
Pertti

#!/bin/sh
f=`mktemp -d`; tail -n +3 $0 > $f/foo.qml; qml $f/foo.qml; exit 0
// My QML file starts here

import Qt 4.7

Item {
  width: 300
  height: 100
  Text { 
    id: hejaText
    text: "Heja Sverige!" 
    font.pointSize: 30
  }
}

_______________________________________________
Qt-qml mailing list
[email protected]
http://lists.trolltech.com/mailman/listinfo/qt-qml

Reply via email to