Skip to content

QML and Qt Quick

Looking for The Bling Thing(tm)? Post here!
20.1k Topics 77.7k Posts
  • Problem with dynamically loaded images when using Qt Resource System

    17
    0 Votes
    17 Posts
    8k Views
    F
    Hi, I thought I'd step into this thread, maybe you can benefit from our learnings.. We have also been seeing issues with qrc in our projects, and the default Qt implementation has a couple of disadvantages: It is ugly to have to change the qrc:/ scheme in all your images - ideally you would not need to change the scheme when you switch between qrc and non-qrc Qrc has problems if the size of all combined images gets bigger than 50MB. Thus ideally you would ship the image assets separately as non-qrc, and use qrc for your qml files (to protect them from outside use). However, you still should have the option to also put the assets into qrc, if exposing your image files is a problem. That's exactly what we allow to do in V-Play: the QML & JS files are put into qrc files (this also makes sure no one can read your source code) – the assets are put into an own assets folder and are deployed with DEPLOYMENTFOLDERS += assets in the .pro file. You can also use qrc for assets if your prefer, but it has some limitations like the 50MB limit). That way, you don’t have the size limitation of qrc files (at above ~50MB qrc hangs). Also, during development working with DEPLOYMENTFOLDERS is better on Desktop, because you can just re-run your application and dont need to recompile. What we did additionally, is to abstract the file access, i.e. you dont need a prefix assets:/… for your images, or mix up your code with any qrc:/… prefixes. You can have a look at some .pro files of our games by downloading the "V-Play SDK":http://v-play.net and then check out the <QtSDK>/examples/V-Play/demos directory. I’ve also posted some comments about the qrc approach set as default since Qt Creator 3.1 on the Qt Blog, maybe that’s interesting to the pros and cons of it (and why I think it’s bad..): http://blog.qt.digia.com/blog/2014/03/04/qt-creator-3-1-beta-released/#comment-1193034 Hope that helps, Chris
  • Ticks labels on QValueAxis / QAbstractAxis

    1
    0 Votes
    1 Posts
    739 Views
    No one has replied
  • Non rectangle/custom shape button in QML. HOW?

    2
    0 Votes
    2 Posts
    2k Views
    JKSHJ
    Hi, You can use a custom-shaped image with transparency.
  • Exposing object from C++ to qml returns null

    6
    0 Votes
    6 Posts
    2k Views
    p3c0P
    Glad that its working :) Don't forget to delete that object or there would be a memory leak. Since it is in NotificationWindow widget you can pass it as a parent using this to MessageBoard so that when NotificationWindow gets deleted so does MessageBoard gets too.
  • [solved] Flickable: Items added from C++ not moving

    4
    0 Votes
    4 Posts
    1k Views
    p3c0P
    Glad that it worked :) You can mark the post as solved by editing the post title and prepend [solved].
  • [SOLVED] Problems with launching new window

    8
    0 Votes
    8 Posts
    3k Views
    sierdzioS
    [quote author="zword" date="1422633603"]bq. Android (and EGLFS) supports only one top-level window. Is it only for QML or QT (without QML) also supports only one top-level window?[/quote] Not even that, it is Android platform itself ;-) So yes, both QtWidgets and QtQuick support only one top-level window on Android.
  • Android app seems like exits on Back Button (in main activity)

    3
    0 Votes
    3 Posts
    2k Views
    Z
    Seems like i found the "solution":https://bugreports.qt.io/browse/QTBUG-29063
  • ListView loop, reaching bottom pressing Down Key selecting top

    3
    0 Votes
    3 Posts
    747 Views
    Z
    Thank you p3c0 you are useful as always
  • [solved] How to parse QList<QMap<QString, QVariant> >

    2
    0 Votes
    2 Posts
    1k Views
    T
    I solved this problem. I sent data in format QList<QVariant>.
  • User action log implementation in QML ?

    1
    0 Votes
    1 Posts
    536 Views
    No one has replied
  • Drawing a dashed/dotted line on a canvas element

    2
    0 Votes
    2 Posts
    4k Views
    p3c0P
    Hi, AFAIK not all HTML5 Canvas features have been ported in Qt's Canvas. According to "Context2d":http://doc.qt.io/qt-5/qml-qtquick-context2d.html doc there's no such method available. The only way I think for now is to use lineTo and moveTo functions to imitate it.
  • Strange problem in QML calling C++ function..

    2
    0 Votes
    2 Posts
    640 Views
    p3c0P
    Hi, What is urlSelectorr ?
  • [SOLVED]: ListView spacing

    6
    0 Votes
    6 Posts
    3k Views
    sierdzioS
    Yes, that will not take item collision into account, as we are fooling the ListView into thinking that the item is very small, when in reality it is not.
  • Qt 5.4 static and QML

    1
    0 Votes
    1 Posts
    614 Views
    No one has replied
  • CAN protocol using Qt

    4
    0 Votes
    4 Posts
    1k Views
    N
    Hi sierdzio, Hi kuschky, Thanks for your valuable suggestions. kuschky, I'm using a linux on my embedded board and just checked the boot logs to conform CAN module is enabled and is fine. As i'm new to Qt can you please point out the sample code for the same. Also is CAN implementation the same way as to implementing i2c in Qt by writing on file systems(dev/i2c-0), or using CAN-utilities installed on the board will make my work simpler.
  • Proxy mouse/touch events

    1
    0 Votes
    1 Posts
    1k Views
    No one has replied
  • Qt 5.4: Qml Video player with custom frame source

    4
    1 Votes
    4 Posts
    2k Views
    D
    Take a look at "this":http://doc.qt.io/qt-5/qtquick-visualcanvas-scenegraph.html. Scenegraph runs in a separate thread if i understand it correct.
  • [SOLVED] Set the currentIndex of ListView immediately (without animation)

    5
    0 Votes
    5 Posts
    4k Views
    sierdzioS
    Confirmed, this works beautifully, and even can be invoked through the meta object system. Thank you!
  • QML Window onClose event not working in some cases

    2
    0 Votes
    2 Posts
    7k Views
    p3c0P
    Hi, It definitely seems to be a bug. See "QTBUG-35390":https://bugreports.qt.io/browse/QTBUG-35390. There's a workaround mentioned in the last comment there.
  • [SOLVED] Wheel Scroller

    3
    0 Votes
    3 Posts
    788 Views
    sierdzioS
    Yes, this is possible usign ListView. Check out these properties: @ ListView { highlightRangeMode: ListView.StrictlyEnforceRange preferredHighlightBegin preferredHighlightEnd highlight } @ Basically, you need to use StrictlyEnforceRange to keep your highlight in check. Then you need to make sure you position your highlight well using prefferedHighlightBegin and End properties.