[Development] registering vnd.qt.*qml types

Mohamed Fawzi Fawzi.Mohamed at digia.com
Tue Jan 29 14:26:45 CET 2013


Hi,

sorry for the noise, I had the wrong ML address.
after some discussion on the development at qt-project.org<mailto:development at qt-project.org> mailing list we
http://qt-project.org/ decided to register some qml
http://qt-project.org/wiki/Introduction_to_Qt_Quick types in the vendor tree.

Before heading to
http://www.iana.org/cgi-bin/mediatypes.pl
We wanted to post them here for review.

We would like to register

text/vnd.qt.qml => a file adhering to the QML grammar/syntax .qml suffix, subclass of text/plain; charset=utf-8

and as subclasses of that

  text/vnd.qt.qbs+qml => .qbs suffix
  text/vnd.qt.meta-info+qml => .qmltypes suffix
  text/vnd.qt.project+qml => .qmlproject suffix

I have also a patch for the free desktop shared-mime-info that reflects that change.
I am pasting it at the end of this email for reference.

Fawzi

======= diff of free desktop shared-mime-info ========
diff --git a/freedesktop.org.xml.in b/freedesktop.org.xml.in
index 3bb477e..ffe0410 100644
--- a/freedesktop.org.xml.in
+++ b/freedesktop.org.xml.in
@@ -1625,13 +1625,26 @@ command to generate the output files.
     </magic>
     <glob pattern="*.ui"/>
   </mime-type>
-  <mime-type type="text/x-qml">
+  <mime-type type="text/vnd.qt.qml">
     <_comment>Qt Markup Language file</_comment>
-    <magic priority="80">
-      <match type="string" value="import Qt " offset="0:256"/>
-    </magic>
+    <sub-class-of type="text/plain; charset=utf-8"/>
     <glob pattern="*.qml"/>
   </mime-type>
+  <mime-type type="text/vnd.qt.qbs+qml">
+    <_comment>Qt Build Suite file</_comment>
+    <sub-class-of type="text/vnd.qt.qml"/>
+    <glob pattern="*.qbs"/>
+  </mime-type>
+  <mime-type type="text/vnd.qt.meta-info+qml">
+    <_comment>File describing qml type information</_comment>
+    <sub-class-of type="text/vnd.qt.qml"/>
+    <glob pattern="*.qmltypes"/>
+  </mime-type>
+  <mime-type type="text/vnd.qt.project+qml">
+    <_comment>Qt Creator Qt Quick UI project file</_comment>
+    <sub-class-of type="text/vnd.qt.qml"/>
+    <glob pattern="*.qmlproject"/>
+  </mime-type>
   <mime-type type="application/x-desktop">
     <_comment>desktop configuration file</_comment>
     <sub-class-of type="text/plain"/>
diff --git a/tests/helloworld.qbs b/tests/helloworld.qbs
new file mode 100644
index 0000000..05c8af1
--- /dev/null
+++ b/tests/helloworld.qbs
@@ -0,0 +1,9 @@
+import qbs 1.0
+
+Application {
+    name: "HelloWorld"
+    Depends { name: "cpp" }
+    files: [
+        "main.cpp"
+    ]
+}
diff --git a/tests/list b/tests/list
index 6af5885..c607a7e 100644
--- a/tests/list
+++ b/tests/list
@@ -248,8 +248,14 @@ ssh-public-key.txt text/plain
 test.vcf text/vcard
 # Test Go source code
 test.go text/x-go oxo
-# Qt Quick (QML) file
-rectangle.qml text/x-qml
+# Qt Markup Language file
+rectangle.qml text/vnd.qt.qml
+# Qt Build Suite file
+helloworld.qbs text/vnd.qt.qbs+qml
+# File describing qml type information
+plugin.qmltypes text/vnd.qt.meta-info+qml
+# Qt Creator Qt Quick UI project file
+main.qmlproject text/vnd.qt.project+qml
 # QtiPlot (qti) file
 test.qti application/x-qtiplot
 # Scheme source code
diff --git a/tests/main.qmlproject b/tests/main.qmlproject
new file mode 100644
index 0000000..4d32f75
--- /dev/null
+++ b/tests/main.qmlproject
@@ -0,0 +1,18 @@
+import QmlProject 1.1
+
+Project {
+    mainFile: "main.qml"
+
+    /* Include .qml, .js, and image files from current directory and subdirectories */
+    QmlFiles {
+        directory: "."
+    }
+    JavaScriptFiles {
+        directory: "."
+    }
+    ImageFiles {
+        directory: "."
+    }
+    /* List of plugin directories passed to QML runtime */
+    // importPaths: [ "../exampleplugin" ]
+}
diff --git a/tests/plugin.qmltypes b/tests/plugin.qmltypes
new file mode 100644
index 0000000..ff35e72
--- /dev/null
+++ b/tests/plugin.qmltypes
@@ -0,0 +1,25 @@
+import QtQuick.tooling 1.1
+
+// This file describes the plugin-supplied types contained in the library.
+// It is used for QML tooling purposes only.
+
+Module {
+    Component {
+        name: "QDeclarative1AbstractAnimation"
+        prototype: "QObject"
+        exports: ["QtQuick/Animation 1.0"]
+        Enum {
+            name: "Loops"
+            values: {
+                "Infinite": -2
+            }
+        }
+        Property { name: "running"; type: "bool" }
+        Signal { name: "started" }
+        Signal {
+            name: "loopCountChanged"
+            Parameter { type: "int" }
+        }
+        Method { name: "complete" }
+    }
+}
diff --git a/tests/rectangle.qml b/tests/rectangle.qml
index 1635c1d..cc5d859 100644
--- a/tests/rectangle.qml
+++ b/tests/rectangle.qml
@@ -1,4 +1,5 @@
-import Qt 4.7
+import QtQuick 1.1
+
 Rectangle {
   width: 400; height: 200
   color: "lightblue"

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/development/attachments/20130129/9f59b76e/attachment.html>


More information about the Development mailing list