Skip to content

QML and Qt Quick

Looking for The Bling Thing(tm)? Post here!
20.0k Topics 77.3k Posts
  • QtQuick3d - Item3d attachment

    1
    0 Votes
    1 Posts
    817 Views
    No one has replied
  • Save Image from a Qml Webview

    1
    0 Votes
    1 Posts
    1k Views
    No one has replied
  • [SOLVED] Size of layout elements

    4
    0 Votes
    4 Posts
    2k Views
    D
    Could you then put [SOLVED] in the title of the post? :)
  • Parsing Json with QML

    8
    0 Votes
    8 Posts
    35k Views
    W
    [quote author="dridk" date="1308668221"]Hello here is my point of view! I tested everything! XMLModel, javascript XML parser, C++ side parser etc... Do Not use C++ Json parser : Because exchange data between c++ and QML is slow Make a Javascript parser ! It's more easy with eval ! Here is an example : Json data @ {"index":["all"],"flux":{"all":[{"data":{"title":"boris","icon":"icon.png"}]}} @ QML side : main.qml @ import QtQuick 1.0 import "parser.js" as JS Item { id:root width: 360 height: 640 Component.onCompleted: JS.load() ListModel { id:listModel } ListView { id:view anchors.fill:parent model : listModel delegate: Rectangle { width:parent.width height:80 Text { anchors.center:parent text: title } } } } @ javascript side : parser.js @ function load() { listModel.clear(); var xhr = new XMLHttpRequest(); xhr.open("GET","http://data.json",true); xhr.onreadystatechange = function() { if ( xhr.readyState == xhr.DONE) { if ( xhr.status == 200) { var jsonObject = eval('(' + xhr.responseText + ')'); loaded(jsonObject) } } } xhr.send(); } function loaded(jsonObject) { for ( var index in jsonObject.flux.all ) { listModel.append({ "title" : jsonObject.flux.all[index].data["title"], "icon" : jsonObject.flux.all[index].data["icon"]}); } // get directly the json object. Should work but not tested //listModel.append({jsonObject.flux.all}); } @[/quote] Hi, My name is wilson. I have test out using this method to parsing Json with Xml. But when I click on the page, it shown a blank page. May I know why is this happen??
  • [solved]Does qt quick support s60v5 phones?

    5
    0 Votes
    5 Posts
    7k Views
    F
    Qt Quick Components are not available for S60v5 out of box. Nevertheless I just shared sources of the sample application on Google Code "here":http://goo.gl/u2TCy, which will demonstrate you, how to bring the power of them to S60 5th edition platform too. The key idea is to build them from sources and then embed into Symbian installer as Qt Quick plugins.
  • Qt Quick components for Symbian 1

    5
    0 Votes
    5 Posts
    5k Views
    F
    Qt Quick Components are not available for S60v5 out of box. Nevertheless I just shared sources of the sample application on Google Code "here":http://goo.gl/u2TCy, which will demonstrate you, how to bring the power of them to S60 5th edition platform too. The key idea is to build them from sources and then embed into Symbian installer as Qt Quick plugins.
  • How can I changed the default icon of desktop in symbian

    6
    0 Votes
    6 Posts
    3k Views
    L
    [quote author="Tslv" date="1342050388"]After googling around I have realized that this really works. The problem is that you have to restart your phone in order for this to work.[/quote] Yes, I was just going to give you the tip to restart the device :) This is a Symbian specific issue.
  • System setting and update through QML GUI and slots

    11
    0 Votes
    11 Posts
    4k Views
    B
    Ok, I understand the Q_property syntax and interaction better, but I am still having a bit of trouble understanding the access to the temperature property. I have been reading lots of examples and documentation on this, but it is all just becoming muddled. I think I am misunderstanding either Q_Property or the use of setContextProperty. Right now, I create the temperature property with read and write access in a Q_Property: @ class carData : public QObject { Q_PROPERTY(int temperature READ temperature WRITE setTemperature NOTIFY temperatureChanged) @ Then in main.cpp I create a carData object, and pass it into the setContextProperty as I have seen done in several examples. @ MainWindow w; carData *data = new carData(); w.rootContext()->setContextProperty("data", data); @ I am confused by this part because the documentation has examples where objects are passed in and then used to access data (see background color example: http://apidocs.meego.com/1.2/qt4/qtbinding.html ), and also where properties within the QML are set such as in: @ C++ { w.rootContext()->setContextProperty("information", 3);} QML{ text: information } @ I want to set temperature with all the property's read/write abilities, but I am not sure exactly how I should do this. Initially, I just had it set in the QML like this: @ text: "Temperature: " + data.temperature @ But, this returns undefined. Seeing that setContextProperty is setting a property, I also thought to try in QML something like this: @ property int temperature: data.temperature @ ...but it simply sets temperature to 0, even when I have the return value statically defined as "2" etc, so I assume it is just setting 0 as the default value for temperature since data.temperature is not defined. So, I am wondering, how do I correctly pass in the data object and access the temperature property in QML? EDIT: Problem Solved. The problem was that by passing in the context as ("data", data), when referencing data in QML it wasn't correctly identifying the property. By changing what was passed in to ("carData", data), and setting property int temperature: carData.temperature, it works
  • QML update image

    2
    0 Votes
    2 Posts
    2k Views
    W
    Ah, the image does refresh, however only when I manually change the window size ...
  • [SOLVED] AnchorChanges strange effect

    3
    0 Votes
    3 Posts
    1k Views
    G
    Thanks.
  • Fickable + TextField + InputContext

    2
    0 Votes
    2 Posts
    2k Views
    R
    Updated. Has anyone done something similar?
  • XMLHttpRequest troubles

    2
    0 Votes
    2 Posts
    2k Views
    G
    https://bugreports.qt-project.org/browse/QTBUG-9315 Request aborts itself after some time or you can use xmlhttprequest.abort(). xmlhttprequest.timeout property doesn't work for me, it seems not implemented. Yes, it is possible.
  • QML ListView contentHeight not changed when list is cleared

    3
    0 Votes
    3 Posts
    4k Views
    B
    Indeed, that looks like my problem :) I have "fixed" this as follows by changing my Scrollbar: @ BorderImage { property variant target property string scrollBarState source: getImage("scrollbar") border {left: 0; top: 3; right: 0; bottom: 3} width: 17 anchors {top: target.top; bottom: target.bottom; right: target.right } visible: (track.height == slider.height || target.count==0) ? false : true @ I added the target.count==0 to the visible property.
  • 0 Votes
    4 Posts
    2k Views
    A
    Benchmarking is the only answer to the question, and that answer will be only valid for your system. Also, it depends on how you define "runs faster" and on your actual QML, I'd wager.
  • How can i start a global qml viewer or a child Form of my app?

    12
    0 Votes
    12 Posts
    4k Views
    A
    Keep the pointer to the QmlQpplicationViewer object somewhere. At the moment, you just let it go out of scope. On the other hand, you could also just set the WA_DeleteOnClose flag on the widget.
  • [SOLVED] import com.nokia.symbian 1.1 is not recognized

    10
    0 Votes
    10 Posts
    9k Views
    3
    thx for your response, but after changing "import com.nokia.symbian 1.1" to "import com.nokia.symbian 1.2" it is still underlined red (QML Module not found). best regards
  • Basic Form Layout for Symbian in QML

    8
    0 Votes
    8 Posts
    4k Views
    R
    Sorry for the triple post, but I just figured out that setting contentHeight to contentItem.childrenRect.height actually fixed all of my problems! Thanks everyone!
  • Xml array data problem.

    1
    0 Votes
    1 Posts
    947 Views
    No one has replied
  • QML state changes on double click

    3
    0 Votes
    3 Posts
    5k Views
    C
    The reason is that "doubleClicked" is a signal, not a property. The "when" property of a State, is of type Binding which expects the result of the binding expression to be boolean.
  • MouseArea pressedButtons

    5
    0 Votes
    5 Posts
    2k Views
    G
    pressedButtons & Qt.LeftButton don't work too but in a different way. It stay true after releasing right mouse button but then releasing left button it is not reset. Bugreport here https://bugreports.qt-project.org/browse/QTBUG-26458