Skip to content

QML and Qt Quick

Looking for The Bling Thing(tm)? Post here!
20.0k Topics 77.3k Posts
  • 0 Votes
    6 Posts
    3k Views
    C
    [quote author="qttester5" date="1399359647"]Yes, that does work. I should have updated this question to note it was solved. I did some extensive experiments yesterday and arrived at the same conclusion. Thanks.[/quote] This is very interesting. Could you perhaps give some more detail about how your clojurescript -> qml setup works? Does this mean you can have arbitrary clojurescript generated javascript executed by the Qt V4VM js engine?
  • 0 Votes
    4 Posts
    2k Views
    sierdzioS
    Ah sure, I somehow partially forgot about the zoom point thing ;P No, I don't have more ideas.
  • How to get the path of the application directory on Android?

    2
    0 Votes
    2 Posts
    1k Views
    dheerendraD
    Have you checked QCoreApplication::applicationFilePath() ? I have not tried on android though.
  • Blocking Issue WebView: in QML does not handle dropdown lists

    10
    0 Votes
    10 Posts
    3k Views
    J
    @asergiu thanks for the response I was leaving towards doing that as well. @jeremy_k I understand the needing the ability to have a custom item selector if desired but if the c++ can handle it by default, why can't the QML one? It seems more of a bug/omission to me to not have an overidable default.
  • Qml and qt qrc resources

    5
    0 Votes
    5 Posts
    2k Views
    SGaistS
    Ok, thanks for the explanation. Can you also update you thread title prepending [solved] so other forum users may know a solution has been found :)
  • Cube-like animation

    5
    0 Votes
    5 Posts
    4k Views
    G
    For those who still are looking for an answer to this here's a simple example in Qt5 @import QtQuick 2.2 Rectangle { id: root width: 360 height: 360 property int rotationAngle MouseArea { anchors.fill: parent onClicked: { Qt.quit(); } } Rectangle{ id: rectA width: 200 height: 200 anchors.centerIn: parent color: "red" scale: 1- Math.abs(Math.sin(rotA.angle/180*Math.PI)*0.075) anchors.horizontalCenterOffset: -Math.sin(rotA.angle/180*Math.PI)*rectA.width/2 transform: Rotation{ id: rotA angle: rotationAngle+90 axis { x: 0; y: 1; z: 0 } origin { x:rectA.width/2; y:rectA.height/2; } } } Rectangle{ id: rectB width: 200 height: 200 anchors.centerIn: parent color: "blue" scale: 1- Math.abs(Math.sin(rotB.angle/180*Math.PI)*0.075) anchors.horizontalCenterOffset: -Math.sin(rotB.angle/180*Math.PI)*rectB.width/2 transform: Rotation{ id: rotB angle: rotationAngle axis { x: 0; y: 1; z: 0 } origin { x:rectB.width/2; y:rectB.height/2; } } } NumberAnimation{ property int side from: 90 to: 180 running: true target: root properties: "rotationAngle" duration: 1000 onRunningChanged: { if (!running){ restart() side = (side +1) % 2 if (side===1){ rectA.color = "blue" rectB.color = "red" }else{ rectA.color = "red" rectB.color = "blue" } } } } } @
  • How to start with QtQuick?

    2
    0 Votes
    2 Posts
    631 Views
    J
    I agree that the documentation isn't that good at simply getting you into the basics. I have previously done a couple of presentations that more or less covers the basics: "Rapid prototyping with Qt Quick":https://www.youtube.com/watch?v=k1pnEhyF1pg In addition there is an online book which should give you a pretty good overview "here":http://qmlbook.org/qt5_cadaques.pdf
  • ListView require items from model at back order

    4
    0 Votes
    4 Posts
    944 Views
    M
    Tnx All 4 answers!!! Model contains sorted list of items. I check once again model and made sure so order in list is correct. When I add to ListView delegate based at Loader and set property "asynchronous: true" i seen so items start showing from the end of model list. list view is more then standard: @ListView { anchors.margins: 8 anchors { top: header.bottom left: parent.left right: parent.right bottom: parent.bottom } clip: true model: myModel delegate: myDelegate }@
  • Positioning text right after word wrapped text

    2
    0 Votes
    2 Posts
    577 Views
    B
    Solved. Used html to do the formatting. Rich text will kick in and things will work wonderfully.
  • How to pass JS function to a ListModel

    3
    0 Votes
    3 Posts
    1k Views
    J
    Not the best solution, but it is a workaround: @import QtQuick 2.2 import QtQuick.Window 2.1 Window { visible: true width: 360 height: 360 ListModel { property var functions: []; id: bottonModel } ListView { anchors.fill: parent model: bottonModel delegate: MouseArea { width: 50 height: 50 Rectangle { anchors.fill: parent color: "red" radius: 5 Text { anchors.fill: parent text: label horizontalAlignment: Text.AlignHCenter } } onClicked: { bottonModel.functions[index](); } } Component.onCompleted: { bottonModel.append({"label":"OK"}); bottonModel.functions.push(function() {console.log("foobar"); }); } } } @ Of course you need to keep model index and function index in sync, which I left out.
  • QAbstractListModel & QML

    6
    0 Votes
    6 Posts
    5k Views
    Q
    Oh, right. Thanks
  • 0 Votes
    4 Posts
    3k Views
    S
    hi bercik, fxam, thanks for the advice. i could make it work by forcing the signal to be emitted, @void MaQGate::SomethingChanged(void) { nameChanged(); weightChanged(); }@ I call SomethingChanged() after a property change, and the QML is synced. IT WORKS ! This works fine for now, I'll have a closer look at QAbstractListModel, it may be a more elegant solution.
  • Bind a QML property on JS object through a function

    2
    0 Votes
    2 Posts
    2k Views
    S
    Just stumbled upon this myself. Any idea?
  • Cannot make QQuickView transparent

    5
    0 Votes
    5 Posts
    2k Views
    EddyE
    I would expect to use this in your main before any qml file is loaded. Hope it helps
  • Capture Screen in qml

    1
    0 Votes
    1 Posts
    553 Views
    No one has replied
  • QML thumbnail list

    3
    0 Votes
    3 Posts
    2k Views
    J
    Hi and thanks for replying. Yesterday I've had some success with append() method - I've realized that it shouldn't be that hard if I use underlying C++ for handling file names only - QML's ListModel append() would work just fine if my underlying C++ class could provide it with proper file names and file count, which is really easy to implement - I'll give it a go and post back. What I do find funny is that my whole app blocks when I instantiate the fore-mentioned ListModel without ListElements. My current workaround is to put one ListElement to it and then clear() the list when it's loaded, although this is quite dumb - do you have any idea why ListModel doesn't work when there's no elements in it at startup?
  • Applicaton icon Qt5.2, Windows and Linux, QML

    7
    0 Votes
    7 Posts
    5k Views
    p3c0P
    Is it giving any error now or it is not just displaying icon ? Instead of loading from resource try it from a fixed path. For e.g @ app.setWindowIcon(QIcon("/root/new_blue.png")); @
  • [Solved] How to detect Menu closed or dismissal?

    4
    0 Votes
    4 Posts
    2k Views
    Q
    As per the bug report comment, there seems to be a work around (for now, at least). So closing of this forum post as "Solved". " on__PopupVisibleChanged: console.log("visible " + __popupVisible) The implementation can change without warning in future versions of Qt, but you could use it as a workaround for now. " The issue is being picked up as a feature request, for Qt 5.4.
  • Qml in qt widgets

    11
    0 Votes
    11 Posts
    3k Views
    K
    Hi, I already know where was the problem. I didn't set size of container and thus of that there was no place to display qml object. Strange, because it's hard to set ( probably for me :) ) right size policy between qml object and container widget. If someone have some good examples where qml objects are combined with Qt widgets I will be thankful.
  • Qt installation problem

    3
    0 Votes
    3 Posts
    932 Views
    U
    Now it is installed. checked disk space. But installer isn't made properly, because it said firstly that space is available