Skip to content

QML and Qt Quick

Looking for The Bling Thing(tm)? Post here!
20.0k Topics 77.3k Posts
  • Getting current location GPS

    1
    0 Votes
    1 Posts
    3k Views
    No one has replied
  • How do I place XML data in a Selection Dialog

    1
    0 Votes
    1 Posts
    1k Views
    No one has replied
  • Updating data model for QML while already displaying view

    9
    0 Votes
    9 Posts
    14k Views
    B
    Hey, so the QTcpSocket works great to get all the data I need, and continue to get data while the display is up and running, but I am having a bit of trouble displaying the data once I have read it in and stored it in a map. When I try to display the data in the QML, it simply displays zero, despite the fact that I can see it updating in the application output. In my data class I have: @ Q_PROPERTY(int headingSensor READ getHeadingSensor NOTIFY headingSensorChanged) int headingSensor; @ In the c++ implementation I originally had: @ int data::getHeadingSensor(){ return data.value(heading)[headingSensorReading]; } @ Where it returns the value in the map which is being updated with the incoming information. This I realized, probably doesn't work, because the property is dependent upon the headingSensor variable, which is itself not being updated despite the correct value being returned. So, I thought if I changed it to update the headingSensor value and return that it might work. So in my data aquisition logic I wrote a method to update the variables as well. @ data.insert(key, value); updateVariables(); } } } void data::updateVariables(){ headingSensor = data.value(heading)[headingSensorReading]; } int data::getHeadingSensor(){ return headingSensor; } @ While this led to the headingSensor variable being updated in addition to the value in the map, the correct value is still not displayed in the QML display. It simply displays 0 (its default value when it is initially displayed since it has not gotten a value from incoming data yet). EDIT: Nevermind, I am a fool! I was so used to writing elements that had getters and setters (which emitted the Changed signal), that when I was writing this where the socket updates the information, I did not think to put in the emit signal.
  • Regaining Focus after asynchronous notification

    1
    0 Votes
    1 Posts
    1k Views
    No one has replied
  • [SOLVED] Play sound using qml in resource on Symbian

    8
    0 Votes
    8 Posts
    4k Views
    A
    [quote author="feldifux" date="1342621086"] So you could decide at runtime which one to use [/quote] I've used this way and even is a huge solution (resources and files) it works very well on both!!
  • QML query: Non-rectangular Mouseareas ? What is possible ?

    2
    0 Votes
    2 Posts
    2k Views
    D
    Hello I thing you could do it in C++ for sure. However you may filter the event in javascript and it could be simplier.
  • QML Loader Object

    7
    0 Votes
    7 Posts
    4k Views
    C
    @ (v->rootObject()->findChild<QObject *>(“mainloader”)->property(“item”)).value<QGraphicsObject>();@ This may not work. I tried similar method today. I will confirm it again tomorrow.
  • [SOLVED] How to link two QML files using XMLListModel?

    3
    0 Votes
    3 Posts
    2k Views
    H
    [quote author="chriadam" date="1341980227"]Define an onClicked handler for each delegate, which uses data passed to it by the model (ie, attached property or whatever). Each item in the model will have separate links/array data, I assume.[/quote] Got it. Solved. Thank you for your tips. :) For reference, here are my codes : //page1 @ import QtQuick 1.1 import com.nokia.symbian 1.1 import "../js/Util.js" as Util import "../delegates" Page { id: container property string itemTitle: "" signal feedItemSelected(string title) XmlListModel { id: test1 property string feedUrl: "" property bool loading: status == XmlListModel.Loading source: "http:// (put in the url)" query: "/plist/array/dict" XmlRole { name: "details"; query: "string[1]/string()" } } ListView { id: list1 anchors { left: parent.left right: parent.right top: headBar.bottom bottom: parent.bottom } clip: true model: test1 delegate: listDelegate1 } Component { id: listDelegate1 //settings of the details to be displayed in TestItem.qml TestItem { text1: details onClicked: { Util.log("Clicked ....on " + details) container.itemTitle = details feedItemSelected(details) onFeedItemSelected: { Util.log("Selected feed item"); pageStack.push(feedItemView); } } //link to page 2 Page2 { id: feedItemView width: parent.width itemTitle: container.itemTitle } } } @ I have another file which are placed in the same folder that defines the settings of the text to be displayed in Page 1 called TestItem1.qml @ //TestItem.qml import QtQuick 1.1 import "../js/Util.js" as Util Item { id: container property string text1: "DETAILS" signal clicked width: parent.width height: Math.max(54, itemText1.itemTextHeight) clip: true Text { id: itemText1 property int itemTextHeight: height + anchors.topMargin + anchors.bottomMargin text: container.text1 } MouseArea { id: mouseArea anchors.fill: parent onClicked: container.clicked(); } } @ solved. thanks for your help :)
  • [solved] Updating ListView sections when inserting items

    1
    0 Votes
    1 Posts
    993 Views
    No one has replied
  • XmlListModel and Xml Role problem.

    7
    0 Votes
    7 Posts
    2k Views
    G
    @wilson_chan as I said in previous posts what I did is : click on the link of your post and then Kaspersky AntiVirus, reported that there was a trojan installed, the trojan was deleted and started scanning etc.. also kaspersky found phising urls which I will not post here.
  • QtQuick Flickable kinetic movement

    8
    0 Votes
    8 Posts
    3k Views
    P
    I thought, the Flickable is container that allows to move with the object inside over the scene. Yes, I am looking for kinetic movement with inertia...
  • Qt Mobility / Service Framework / complex parameters, structures

    1
    0 Votes
    1 Posts
    1k Views
    No one has replied
  • Custom objects in QML and custom objects as properties

    4
    0 Votes
    4 Posts
    5k Views
    E
    I seem to have fixed it. Apparently the pointer returned cannot be const? There are so many little things to remember when working with custom objects in QML... very cumbersome without any productive error reporting...
  • [SOLVED] Fails to load QML extension using Qt's SVG module

    2
    0 Votes
    2 Posts
    2k Views
    V
    I upgraded my system and the application worked.
  • 0 Votes
    4 Posts
    2k Views
    L
    See "Desktop Components":http://labs.qt.nokia.com/2012/06/06/desktop-components-for-qt-5/,
  • Pulling QList from C++ to qml

    4
    0 Votes
    4 Posts
    7k Views
    F
    I figured that I was missing an include somewhere so that in one project I had to do nothing while in the other my code just worked. After a search it appears that including qdeclarativecontext.h does the job. So I need to put this macro in the .cpp file or include the qdeclarativecontext.h header. C:\Qt\4.8.0\src\declarative\qml\qdeclarativecontext.h (1 hits) Line 110: Q_DECLARE_METATYPE(QList<QObject*>)
  • Function call through loader...

    4
    0 Votes
    4 Posts
    2k Views
    D
    could you post the code please ?
  • [Solved]problem with anchors between symbian belle and belle FP1

    4
    0 Votes
    4 Posts
    2k Views
    B
    i manage to solve the problem i change the pagestackwindow to pagestack and it works great thanks
  • Listview and focus problem

    3
    0 Votes
    3 Posts
    1k Views
    A
    Ok, Thank you. I'll have a look at it
  • Standard input stream redirection on debug

    5
    0 Votes
    5 Posts
    4k Views
    P
    You are right, that really seems like a thing that could be causing the trouble. There are of course many ways how to solve this problem, I have however hoped that I would not be required to change the code itself. I have only a little experience with usage of a command-line debugger - would anybody know some command that would tell the CDB to handle the argument as a stream redirection? Thanks.