Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. QML and Qt Quick
  4. Porting QML to JS/HTML5
QtWS25 Last Chance

Porting QML to JS/HTML5

Scheduled Pinned Locked Moved QML and Qt Quick
40 Posts 8 Posters 46.1k Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • Q Offline
    Q Offline
    qtnext
    wrote on last edited by
    #18

    it rocks !!! I hopes that it will evolve ... seems very promising !

    1 Reply Last reply
    0
    • P Offline
      P Offline
      Philius
      wrote on last edited by
      #19

      I wonder if this could be combined with QtGui in html5?

      You can see a demo of it at

      http://www.philipashmore.com/html5/timeline/

      It's part "v3c-storyboard" (I couldn't call it "storyboard"
      because of a name clash) in Sourceforge.

      Comments welcome.

      1 Reply Last reply
      0
      • L Offline
        L Offline
        lpaimen
        wrote on last edited by
        #20

        Depends. This far I've managed without, as the elements have been rather simple. However, if/as it gets more complicated in the future, middle layer may pay off. And more Qt-like, the better.

        I took a quick glance to the sources, and there was also Qt's signal-slot and event systems implemented. That's something I had on todo-list before rewriting binding code...

        1 Reply Last reply
        0
        • P Offline
          P Offline
          Philius
          wrote on last edited by
          #21

          Well, then sooner or later we're going to have to take this to the next level and get a bit more organized, so the following issues have to be addressed.

          1. Where to host (I guess gitorious is the logical choice)
            This should also include showcase and doc web pages.
          2. What to call it/them: QtHtml5Qml, QtHtml5QtCore, QtHtml5QtGui
            seem over the top - any better names?
          3. I've namespaced everything under Qt, is that too much?
          4. (eventually) enable QtWebkit/Qml to step in with "real" c++
            implementations, even avoiding downloading the .js files whose
            functionality it replaces.
          5. Collaborators! I for one would love to hand over chunks of work
            (like the layout classes for starters) for willing participants.
          6. Implementation coverage charts / progress
            Thinking of "Uno", it's nice to see what features are done,
            todo, and tested as percentages. This means project planning,
            tools and an interface.
          7. Qt5 - should we aim for that exclusively?

          And of course anything else you can think of, insert/replace above.

          I've created a thread called "QtHtml5Script anyone?"

          http://developer.qt.nokia.com/forums/viewthread/8726
          

          as QtGui is something that might be of interest in its own right.

          I think following the Qt hierarchy/model is the most sensible
          approach.

          Philip

          1 Reply Last reply
          0
          • P Offline
            P Offline
            Philius
            wrote on last edited by
            #22

            Sorry, when I said "uno", I really meant "mono" - see

            http://go-mono.com/status/status.aspx?reference=4.0&profile=4.0&assembly=System

            for some ideas.

            1 Reply Last reply
            0
            • P Offline
              P Offline
              Philius
              wrote on last edited by
              #23

              I created a project in sourceForge called "qtjs".

              http://sourceforge.net/projects/qtjs/

              I also created a thread with the same name here.

              1 Reply Last reply
              0
              • L Offline
                L Offline
                lpaimen
                wrote on last edited by
                #24

                Great!

                I'll probably borrow (rip off) some code there :P

                Just have to check that BSD and LGPLv3 are somewhat compatible.

                1 Reply Last reply
                0
                • P Offline
                  P Offline
                  Philius
                  wrote on last edited by
                  #25

                  Hmm.

                  I think that QtJs would be useful in it's own right.

                  I would suggest keeping them separate, just like they are (will be?) in Qt5 for that very reason.

                  Also, the code available will change a lot until I get the fakery^W implementation layer into a better state.

                  I'm working on that now, so borrowing and then modifying the code would not be a once-off.

                  I thought that if I wanted to include the QtScript generator examples then it would have to be GPL as well.

                  http://code.google.com/p/qtscriptgenerator/

                  I sent an email about this issue to Nokia and am awaiting feedback.

                  Yep, I just realized that I've got to change all those LGPL lines to GPL in the source, thanks.

                  Finally, do give me profs when you embed a copy of the software in your project, like you should for any GPL project.

                  Oh, and did I mention, collaborators welcome?

                  1 Reply Last reply
                  0
                  • L Offline
                    L Offline
                    lpaimen
                    wrote on last edited by
                    #26

                    QtJs is useful on its own, but it also is useful for qml project. I've already forked UglifyJS code to the project to gain a Javascript parser. The preference (for bug fixes etc) is the original code/project, and keeping files borrowed to qml project somewhat up-to-date with the original.

                    I am not a lawyer, but I don't see the GPL of qtscriptgenerator examples forcing you to use GPL on QtJs, as the examples can also be ran on qtscriptgenerator environment. Again, IANAL.

                    I'm all for GPL. If you wish to enforce principles of RM Stallman, I guess the right license would be AGPLv3 with "any later version" and http://www.gnu.org/philosophy/javascript-trap.html clauses.

                    1 Reply Last reply
                    0
                    • P Offline
                      P Offline
                      Philius
                      wrote on last edited by
                      #27

                      "I am not a lawyer, but I don’t see the GPL of qtscriptgenerator examples forcing you to use GPL on QtJs, as the examples can also be ran on qtscriptgenerator environment. Again, IANAL."

                      It will if I want to package them with QtJs as examples.

                      1 Reply Last reply
                      0
                      • L Offline
                        L Offline
                        lpaimen
                        wrote on last edited by
                        #28

                        Yeah, it's about packaging. Assuming QtJs works without the examples, you can deliver two packages with different licenses. I guess these can be even served from same svn repository as long as the file clearly indicates to which package/license it belongs. For qml project, I've BSD-licensed all the core parts (files in src directory) and the rest of the files (test files in test directory) are, well, unlicensed. I think those could be also licensed to some other license, though in the end, it may also be court/lawyers to decide.

                        Now stopping the off-topic license speculation from my part.

                        1 Reply Last reply
                        0
                        • P Offline
                          P Offline
                          Philius
                          wrote on last edited by
                          #29

                          That JavaScript trap link you posted got me to thinking.

                          If I'm going to write a facility that can substitute native code for a JavaScript url (or several) then it could be put to use to allow arbitrary substitutions, as the link describes.

                          Maybe this could be a general purpose plugin that can have wider applications.

                          I'll start a thread called "JavaScript override" to discuss it.

                          1 Reply Last reply
                          0
                          • P Offline
                            P Offline
                            Philius
                            wrote on last edited by
                            #30

                            While taking a break I read up on the SVG specification.

                            http://www.w3.org/AudioVideo/

                            I'm not QML savvy, but does it have anything in common with SMIL?

                            Would "porting" it there make sense?

                            I'm thinking of porting QtJs there too.

                            1 Reply Last reply
                            0
                            • P Offline
                              P Offline
                              Philius
                              wrote on last edited by
                              #31

                              Have you looked at emscripten? http://emscripten.org/

                              It's a c++ to JavaScript converter!

                              I posted a message to the blog site about QtJs http://syntensity.blogspot.com/2011/07/emscripten-15.html

                              I hope this helps.

                              1 Reply Last reply
                              0
                              • T Offline
                                T Offline
                                trusktr
                                wrote on last edited by
                                #32

                                Any progress on this???

                                1 Reply Last reply
                                0
                                • P Offline
                                  P Offline
                                  Philius
                                  wrote on last edited by
                                  #33

                                  Sorry for leaving this to stagnate.
                                  I'm not in the loop regarding QML, but "Qt for Google native client":http://qt-project.org/wiki/Qt_for_Google_Native_Client is the way I'm going.

                                  1 Reply Last reply
                                  0
                                  • L Offline
                                    L Offline
                                    lpaimen
                                    wrote on last edited by
                                    #34

                                    As for the qmlweb project (porting qml to standard web browser), the project has been semi-active for a while now. It recently got second contributor, so it's not just me anymore. More developers are of course welcome.

                                    You can run very simple QML apps with the engine, but it is not yet production quality. It supports standard browsers (most post-IE8), and works for example on PS3 and iPad browsers.

                                    Demo app -- slides written as QML application -- is available at
                                    http://tinyurl.com/qmlslides
                                    and code from
                                    https://gitorious.org/qmlweb

                                    1 Reply Last reply
                                    0
                                    • T Offline
                                      T Offline
                                      trusktr
                                      wrote on last edited by
                                      #35

                                      @lpaimen I'm writing a QML app and it will also have an HTML5 version. A tool like this would be so handy. I'll have to check it out and possibly contribute.

                                      1 Reply Last reply
                                      0
                                      • L Offline
                                        L Offline
                                        lpaimen
                                        wrote on last edited by
                                        #36

                                        @trusktr Well but that would be excellent! I've been slow with this project but Anton (co-dev) has been steadily contributing improvements here and there. Since November he has been reworking bindings/property system, introduced DOM-based rendering frontend, support for Repeaters and so on, all kinds of exciting and neato stuff.

                                        But still the code ain't ready. The best way to get going is probably scratch your own itch -- try your QML app with the qmlweb engine and see what is missing and start hacking. Then just drop us a mail and we add you to qmlweb gitorious.org team to get your code into mainline :P

                                        1 Reply Last reply
                                        0
                                        • T Offline
                                          T Offline
                                          trusktr
                                          wrote on last edited by
                                          #37

                                          Sweet. Was it rendered in canvas previously? If so, 2D or 3D context?

                                          Just an idea (not sure if you already considered it) but perhaps the qmlweb renderer can be written using mrdoob's three.js (http://threejs.org) .

                                          Using three.js would mean that the qmlweb renderer could be written in a single code base using the three.js drawing API. Someone using qmlweb could specify for qmlweb to use the Canvas2D renderer, the WebGL renderer, or the CSS3D renderer. The internals of three.js would handle how stuff is rendered in each mode. All we'd need to worry about is writing the qmlweb renderer using the three.js drawing API.

                                          Here's an amazing WebGL example:
                                          http://threejs.org/examples/#webgl_animation_cloth

                                          An amazing Canvas2D example:
                                          http://threejs.org/examples/#canvas_geometry_birds

                                          and an amazing CSS3D example:
                                          http://threejs.org/examples/#css3d_periodictable

                                          2D stuff (e.g. for user interfaces) would basically just be done by creating a camera that doesn't move. It can be aimed downward facing the X-Y plain at 90 degrees, then 2D objects can be drawon on the XY plain, while giving them Z values that have tiny differences from each other to create layers. E.g. Z=0 for the base layer, Z=0.00001 for the next layer, etc.

                                          Using three.js would then mean that the 3D parts of Qt QML could also be rendered. 3D effects could also be added to "2D" user interfaces (e.g. new screen could zoom in or out, anything you can do with the QML 3D stuff).

                                          There's also the pixi.js library, that specializes in 2D graphics and uses WebGL for hardware acceleration, with a Canvas2D fallback for deices without WebGL. This might be easier to use initially for QML 2D interfaces, but it might be a barrier for 3D QML.
                                          There's plenty of other 2D libraries: http://stackoverflow.com/questions/11456758/is-there-at-two-js-counterpart-to-three-js

                                          What is your thought on using a library like three.js for rendering?

                                          1 Reply Last reply
                                          0

                                          • Login

                                          • Login or register to search.
                                          • First post
                                            Last post
                                          0
                                          • Categories
                                          • Recent
                                          • Tags
                                          • Popular
                                          • Users
                                          • Groups
                                          • Search
                                          • Get Qt Extensions
                                          • Unsolved