Skip to content

QML and Qt Quick

Looking for The Bling Thing(tm)? Post here!
19.6k Topics 75.8k Posts
  • How to implement a QAction type in QML?

    2
    0 Votes
    2 Posts
    4k Views
    M

    In qdeclarativeitemsmodule.cpp, QAction is registered as @qmlRegisterType<QAction>();@

    This type of registration does not make the class available for instantion in QML as an element. There are (at least) two pieces missing:

    QAction doesn't have a default constructor (see requirement "here":http://doc.qt.nokia.com/4.7-snapshot/qml-extending.html#adding-types) registration would need to be done via qmlRegisterType<QAction>("Qt",4,7,"Action");

    One option might be for you to subclass QAction, provide a default constructor, and then register the type yourself, in a QML plugin. e.g. @qmlRegisterType<QAction>("MyComponents",1,0,"Action");@

    and then @import Qt 4.7
    import MyComponents 1.0 as Extras

    Item {
    Extras.Action { ... }
    }
    @

    Regards,
    Michael

  • The Ultimate DevDays QtQuick Guide

    4
    0 Votes
    4 Posts
    4k Views
    H

    @mario, this is a while out in the future, but check out "http://labs.trolltech.com/blogs/2010/05/18/a-qt-scenegraph/":http://labs.trolltech.com/blogs/2010/05/18/a-qt-scenegraph/

  • QML objects accesible in QtScript?

    3
    0 Votes
    3 Posts
    4k Views
    M

    I don't think the model above can be done, but even it were possible it's not really a good fit for how QML was designed, and I think you'll lose a lot (if not all) of the advantages of QML in trying to develop this way (for example object.property = foo.bar in javascript performs an assignment, and doesn't establish a binding).

    That said, you should still be able to code application logic in script -- see for example the samegame or calculator demos in which all of the logic is implemented in script. The script will need to be coded in a "QML friendly" way though; for example you'll need to use the "dynamic object management":http://doc.qt.nokia.com/4.7-snapshot/qdeclarativedynamicobjects.html functionality provided by QML.

  • Alternating background color for ListViews

    12
    0 Votes
    12 Posts
    24k Views
    M

    [quote author="mario" date="1280820453"]@mbasser: What version of Qt are you using? I can't make it work on the beta 1 release. Well, maybe it's time to update to beta 2 anyway.
    [/quote]

    I'm using HEAD of the qt-qml staging branch. contentItem was introduced in change 9d6ccfea89ae99b747f70ece71185868f189d0f9 (June 24) -- I'm not sure if it is in beta2; if not it will definitely be in the next release candidate.

    Regards,
    Michael

  • How to create a multi-view application?

    8
    0 Votes
    8 Posts
    9k Views
    G

    That's great! Thanks for both.

  • 0 Votes
    4 Posts
    6k Views
    B

    There is a special factory QDeclarativeNetworkAccessManagerFactory to create a network access manager that should be used when accessing the network from QML. The manager created is then made known to the declarative engine by QDeclarativeEngine::setNetworkAccessManagerFactory(), as PixelQ stated already.

  • "Unselect" current item in ListView

    6
    0 Votes
    6 Posts
    7k Views
    M

    [quote author="aviral" date="1280731394"]how about trying on getting the selected item in list view and then

    selectedItem->setSelection() for required operation.[/quote]

    But I don't think I can do that in QML?

  • 0 Votes
    2 Posts
    11k Views
    M

    Hi,

    The "Exposing Data" section of "http://doc.qt.nokia.com/4.7-snapshot/qtbinding.html":http://doc.qt.nokia.com/4.7-snapshot/qtbinding.html gives an explanation of several recommended ways of passing data between C++ and QML.

    Regards,
    Michael

  • QML in C++ App error

    3
    0 Votes
    3 Posts
    7k Views
    S

    Oh thanks the "QT += declarative" statement was missing in my .pro file.

    I know this is a greenhorn mistake but sometime I'll get even this ; )

  • Qt Quick for multimedia

    3
    0 Votes
    3 Posts
    3k Views
    S

    Ok thank you thats what I'm searching for.

  • How to write scrolling games with Qt Quick?

    6
    0 Votes
    6 Posts
    6k Views
    A

    [quote author="m_p_wilcox" date="1278942548"]

    @aalpert - I basically came to that conclusion but was posting here to check. The question is, does Nokia see a future for a physics engine in QML for simple 2D games, even if it isn&#39;t there now?

    [/quote]

    I can't speak for Nokia, I just work here ;) . As for my tiny segment of Nokia, we don't have the resources to implement one ourselves.

    That said, I think a 2D physics and collisions engine for QML would be a veritable boon when creating 2D games. And it shouldn't be that hard to write either. You could just create a QDeclarativeExtensionPlugin with a QDeclarativeItem derived type. That type could do the physics calculations in C++ with other instances of the type, and presumably do them quite fast and efficiently. From there, you make your plugin module a QML module and use it to write your QML games with.

    It's a good thing that it's easy enough for anyone to do, because I don't have time to do it right now. But if you end up writing useful QML modules like that, I'm sure there's a place on the new DevNet for you to share them.

  • Qt Quick Components

    4
    0 Votes
    4 Posts
    3k Views
    A

    @brendand - currently the project is just getting started and we aren't even certain what we are going to do. So if you want to help, you can join the discussion occurring in the channels Henrik listed in his wiki page.

  • Element and Event inspection in QML (solved)

    6
    0 Votes
    6 Posts
    7k Views
    P

    Hi again,

    we have already implemented item and event introspection in a QML declarative interface.

    You can see the solution in the following link:

    "http://catedrasaes.inf.um.es/trac/blog/pedromateo-13/07/2010-qml_event_item_introspection":http://catedrasaes.inf.um.es/trac/blog/pedromateo-13/07/2010-qml_event_item_introspection

    Thank you very much for your help,
    cheers!!

  • Qt Quick on mobile devices

    11
    0 Votes
    11 Posts
    9k Views
    D

    [quote author="QtK" date="1278758498"][quote author="Henrik Hartz" date="1278757425"]In the last Nokia Qt SDK there&amp;#39;s beta functionality for "building Symbian packages in the cloud":http://blogs.forum.nokia.com/blog/lucian-tomutas-forum-nokia-blog/2009/11/08/build-without-an-sdk-test-without-a-device - supported for Linux &amp;amp; Windows.[/quote]

    That is remote compiler and remote device access for application developers. I don&#39;t think it will allow you to compile Qt Libraries.

    Remote compiler feature is there in the latest Nokia Qt SDK if anyone wants to try it out.[/quote]

    Very very true.