Navigation

    Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Search
    1. Home
    2. Tags
    3. properties
    Log in to post

    • SOLVED Property of gradle.properties
      Mobile and Embedded • properties gradle • • Montjet  

      6
      1
      Votes
      6
      Posts
      722
      Views

      @TripleF Awesome, this works! Thank you
    • SOLVED Why does decoupling from random signal fix QML binding loop?
      QML and Qt Quick • qml properties • • stan.m  

      8
      0
      Votes
      8
      Posts
      788
      Views

      @stan.m The root cause was a thread-safety problem; data was read by the main thread at the same time that it was written by another thread. Specifically, the C++ getter for the QString "value" property was called at the same time that the value was written. Other data was written and read at the same time, but their types write as an atomic operation on the ARM processor. The data that caused the problem was of type: QString. A QString object's member data is a heap pointer to the 16-bit unicode array. When written and read simultaneously, the C++ getter passes a corrupted pointer into the QML runtime. As I wrote before, the "binding loop" warning came after many of these "first-chance" exceptions and had nothing to do with a true binding loop. The first-chance exception occurred when two value changes occurred back-to-back and the QML runtime called the C++ getter to retrieve the value at the same time that the second change was written. My initial "fix" worked because polling the value every 100ms allowed the first change propagate to QML long before the next change comes in. I since have revised the code to use a mutex to prevent writing and reading simultaneously.
    • SOLVED findChild() always returns 0 for QML objects
      QML and Qt Quick • qml properties findchild • • Erlend E. Aasland  

      3
      0
      Votes
      3
      Posts
      3225
      Views

      @sierdzio Thanks for your input! The this-object was the parent widget holding the QQuickView. I solved it by saving the root object of the QQuickView: QObject *obj = quickview->rootObject(); if (obj) obj->setProperty("ticks", tick_count); else qDebug() << "Could not set tick count!"; Anyway, I'll have a look at the different approach you suggest. It sound like a more robust way of interacting with QML. Best regards, E
    • UNSOLVED setting QML Drawer properties in another QML file
      QML and Qt Quick • qml qt quick properties property alias property bindin • • Qjay  

      8
      0
      Votes
      8
      Posts
      2978
      Views

      ok. Let us look at like this. Instead of web view, put the Rectangle{} Try to show & hide the rectangle instead of web-view. Till me whether it works or not. Try something like this OffLine_Pages.qml Pane{ id: view property string local_url : "" property string pid : "" property alias vis: web.visible Rectangle{ id : web width: 200;height: 200;color: "red" visible: false } }
    • UNSOLVED CSS: dynamic properties and (pseudo) states
      General and Desktop • css properties states • • tgru  

      1
      0
      Votes
      1
      Posts
      400
      Views

      No one has replied

    • SOLVED Binding C++ properties exposed to QML to dynamically created QML objects
      QML and Qt Quick • qml listmodel binding properties createobject • • Obi-Wan  

      27
      0
      Votes
      27
      Posts
      9308
      Views

      @GrecKo said in Binding C++ properties exposed to QML to dynamically created QML objects: Ultimately I think that you should use imperative object creation only for temporary object needed by the UI layer, like showing a dialog for example. I have yet to see another legit usecase for it (or I don't remember it). I will keep this in mind! Hopefully this little discusion might help someone else struggling to understand the same concepts!
    • UNSOLVED QML: How to access context property if its name is shadowed by a component-local property?
      QML and Qt Quick • properties syntax shadowing • • Stefan Monov76  

      5
      0
      Votes
      5
      Posts
      2009
      Views

      @raven-worx: Yes, it's ambiguous because I don't know (or there isn't) a syntax for disambiguating. For example in C++ a roughly equivalent statement, involving a local text and a global text, would be text = ::text which is unambiguous. Hehe, I was discussing that with others last week, a way to differentiate context properties from regular object properties. Could be used in your case to disambiguate the root context property, or to access model properties from outside a delegate, for example : listView.currentItem::age without having to expose it as a property. This syntax is not achievable for the moment, but you could do something like this listView.currentItem.Context.property("age"), you won't get notified of any change though. You could also do it for the root context with a singleton exposing it with the same caveat about the changes.
    • SOLVED A way to avoid boilerplate code for defining QObject properties in C++ (to be accessible from QML)?
      QML and Qt Quick • properties boilerplate • • Stefan Monov76  

      2
      0
      Votes
      2
      Posts
      763
      Views

      Hi, Take a look at the MEMBER element of the Q_PROPERTY declaration here. It likely does what you want. Hope it helps
    • UNSOLVED Does really property var mdl: model copies the full model object in memory?
      QML and Qt Quick • qml property properties • • Kofr  

      4
      0
      Votes
      4
      Posts
      1208
      Views

      @Kofr Hi! If you want to be really sure (because you don't trust the docs or your code ^_^) then add something like qDebug() << "hello"; to the destructor of the model and see how often that's called.
    • UNSOLVED MessageDialog QML Type does not accept common properties
      General and Desktop • qml properties dialogs m16 • • ars1614  

      1
      0
      Votes
      1
      Posts
      449
      Views

      No one has replied

    • SOLVED Compose pointer to property of object
      General and Desktop • c++ properties pointer objects • • McLion  

      25
      0
      Votes
      25
      Posts
      5302
      Views

      Got it solved :-) QWebFrame * webGUIframe = qobject_cast<QWebFrame >(sender()); QWebView * webGUI = (QWebView)(webGUIframe->parent())->parent(); webGUI->page()->mainFrame()->addToJavaScriptWindowObject("NativeBridge", this);
    • UNSOLVED QObject serialization/deserialization library
      Showcase • qobject xml serialization properties tool • • Wilk  

      2
      0
      Votes
      2
      Posts
      1732
      Views

      @Wilk it's cool! What about JSON serialization? I will try to use your library in my project http://forum.qt.io/topic/64999/qt-micro-rest-client-framework-beta
    • SOLVED Strange approach to properties
      General and Desktop • qwidget serialization properties qmetaobject metadata • • Wilk  

      12
      0
      Votes
      12
      Posts
      3275
      Views

      @mrjj Thanks)
    • UNSOLVED Can the moc automatically generate getter, setter, and notify methods for properties?
      General and Desktop • c++ qmake moc properties • • Guy Gizmo  

      3
      0
      Votes
      3
      Posts
      3077
      Views

      Hi, Actually it's a feature that's available within Q_PROPERTY declaration. See here for the MEMBER keyword and how to use it.
    • UNSOLVED Access properties from dynamically loaded component
      QML and Qt Quick • loader binding properties • • morte  

      2
      0
      Votes
      2
      Posts
      3629
      Views

      Maybe //main.qml: import QtQuick 2.5 Loader { id: loader source: "MyComponent.qml" onLoaded: { loader.item.property1 = "secret" loader.item.property2 = 777 } } //MyComponent.qml: import QtQuick 2.0 Rectangle { id: rect property string property1 property int property2 TextEdit { id: text_edit anchors.centerIn: parent text: property1 + property2 } } or //main.qml: import QtQuick 2.5 Item { id: main width: 200; height: 200 property string property1: "secret" property int property2: 777 Loader { id: loader source: "MyComponent.qml" onLoaded: loader.item.text = property1 + property2 } } //MyComponent.qml: import QtQuick 2.0 Rectangle { id: rect property alias text: text_edit.text TextEdit { id: text_edit anchors.centerIn: parent text: property1 + property2 } } or import QtQuick 2.0 Rectangle { id: rect TextEdit { id: text_edit anchors.centerIn: parent // rect.parent -> loader; rect.parent.parent -> Item with id 'main' text: (rect.parent.parent.property1 !== undefined) ? rect.parent.parent.property1 : "" } }
    • SOLVED How to change color for inactive status of StatusIndicator?
      QML and Qt Quick • properties qtquick.extras • • RolBri  

      4
      0
      Votes
      4
      Posts
      1558
      Views

      Thank you very much for this nice solution :-)
    • Read property value from different files - QML
      General and Desktop • qml properties qml signalsslot public properti • • Anas A. Ismail  

      1
      0
      Votes
      1
      Posts
      436
      Views

      No one has replied