Skip to content

QML and Qt Quick

Looking for The Bling Thing(tm)? Post here!
20.0k Topics 77.4k Posts
  • Migrate Qt6 from Qt5 scenegraph

    Unsolved
    1
    0 Votes
    1 Posts
    398 Views
    No one has replied
  • Good way to completely change a page through options

    Unsolved
    1
    0 Votes
    1 Posts
    135 Views
    No one has replied
  • QML - how to add custom virtual keyboard layout?

    Unsolved
    1
    0 Votes
    1 Posts
    247 Views
    No one has replied
  • Qt6 QML QQmlApplicationEngine failed to load component error

    Unsolved
    1
    0 Votes
    1 Posts
    663 Views
    No one has replied
  • ListView section with QList<QObject*> as model not working

    Solved
    2
    0 Votes
    2 Posts
    342 Views
    fcarneyF
    Test this out with a QML ListModel with the same QML. I don't think all properties on a QObject are automatically turned into properties the ListView delegate can see. Otherwise it would pollute the delegate namespace. To get the values out of the QObject you will have to use modelData.<property>. You could try that in section.property to see if that will work. "modelData" for a "list" used as a model is the property it injects. For a "proper" model you would need to base off of QAbstractListModel or similar. Then the properties you see are defined in roleNames function. Try this to see if this is what is happening (not sure if this would work though): section.property: "modelData.label" Edit: I think I said something badly: When using a list of some sort (QList, [], etc) that is not based upon one of the abstract models. The injected delegate property is called "modelData". This would be each item from the list in that property. So in your case it would be the LandmarkViewModel object.
  • read translation text from excel sheet into QTranslator at runtime

    Solved
    8
    0 Votes
    8 Posts
    856 Views
    V
    Finally, I have implemented this using QXlsx https://github.com/QtExcel/QXlsx library for reading MS Xlsx file and store it in the below DS to load data mentioned in post image above: QMap<QString, QMap<QString, QString>> m_langTransMap; QMap<Input String,QMap<LangName,TranslatedText>> Use of Own Translator: QML: Text{ text: myTranslator.getTranslatedText( "Main Controller") + myTranslator.emptyString] } class TranslationHandler : public QObject { Q_OBJECT Q_PROPERTY(QString emptyString READ getEmptyString NOTIFY languageChanged) public: void TranslationHandler::loadTranslationData() { /// Read Excel Data /// load it into QMap emit languageChanged(); } Reference Link: https://wiki.qt.io/How_to_do_dynamic_translation_in_QML https://www.kdab.com/wp-content/uploads/stories/QmlComponentDesign-TwoWayBindingProblem-AndreSomers.pdf Read Cell Data: https://github.com/QtExcel/QXlsx/blob/master/TestExcel/extractdata.cpp https://github.com/QtExcel/QXlsx/blob/master/TestExcel/hello.cpp
  • QML Item states precedence?

    Solved
    2
    0 Votes
    2 Posts
    272 Views
    fcarneyF
    It looks like there is a precedence: import QtQuick 2.15 import QtQuick.Window 2.15 import QtQuick.Layouts 1.15 import QtQuick.Controls 2.15 Window { width: 640 height: 480 visible: true title: qsTr("State Precedence") Text { text: rect.state } RowLayout { anchors.fill: parent ColumnLayout { Layout.preferredWidth: 150 Layout.fillHeight: true Repeater { id: staterepeat model: 5 delegate: CheckBox { text: "state %1".arg(modelData) } Component.onCompleted: { for(let ind=0; ind<model; ++ind){ let nstate = rect.states[ind] nstate.when = Qt.binding(()=>itemAt(ind).checked) } } } } Rectangle { id: rect width: 200 height: 200 border.width: 1 states: [ State { name: "state 0" PropertyChanges { target: rect color: "red" } }, State { name: "state 1" PropertyChanges { target: rect color: "blue" } }, State { name: "state 2" PropertyChanges { target: rect color: "green" } }, State { name: "state 3" PropertyChanges { target: rect color: "yellow" } }, State { name: "state 4" PropertyChanges { target: rect color: "orange" } } ] color: "black" } } } Items that appear first in the list have precedence vs things that appear later.
  • Is command line: -platform webgl:port=xx deprecated?

    Unsolved
    2
    0 Votes
    2 Posts
    343 Views
    SGaistS
    Hi and welcome to devnet, From a quick search, QtQuick WebGL is not available at all in Qt 6 currently. See here for the comparison and explanation. Depending on what you are developing, Qt for WebAssembly might be a possibility.
  • This topic is deleted!

    Solved
    4
    0 Votes
    4 Posts
    30 Views
  • Will the new version of the Windows UI Kit be supported?

    Moved Unsolved
    1
    0 Votes
    1 Posts
    141 Views
    No one has replied
  • ListView and scrollable TextArea refreshing problems

    Unsolved listview textarea scrollview
    1
    0 Votes
    1 Posts
    437 Views
    No one has replied
  • Best way to manage multiple random screens in a single window

    Unsolved
    5
    0 Votes
    5 Posts
    371 Views
    fcarneyF
    I should point out, that you could use a push instead of a replace. Then have a back button that pops the last one off to go back. So you could use it the same way except with depth instead of how I did it.
  • How to make QQuickView behave like a popup menu?

    Solved
    2
    0 Votes
    2 Posts
    282 Views
    A
    This doesn't seem to be implemented. Setting Qt::Popup doesn't work for QQuickView, and doesn't work for QQuickWidget, either. A workaround is to use a plain QWidget as popup, and add a QQuickWidget as child.
  • StackView pop not working

    Unsolved
    1
    0 Votes
    1 Posts
    148 Views
    No one has replied
  • Enable QML error when loading objects dynamically

    Solved
    3
    0 Votes
    3 Posts
    266 Views
    M
    @jsulm Ok I didn't understand what this sentence actually says. Thanks for pointing out!
  • PropertyAnimation in signal handler

    Unsolved
    3
    0 Votes
    3 Posts
    212 Views
    M
    @GrecKo I was trying to find a way to execute an animation without declaring it separately. In "meta-code": onSignalTrigger: { timer.stop() doSomething() doSomethingElse() // animate property PropertyAnimation { target: theObject; property: "opacity"; to: 0 } } The long way is: PropertyAnimation { id: myAnim; target: theObject; property: "opacity"; to: 0 } onSignalTrigger: { timer.stop() doSomething() doSomethingElse() // animate property myAnim.start() } I find the first syntax is more readable
  • StateMachine or SequentialAnimation?

    Unsolved
    1
    0 Votes
    1 Posts
    141 Views
    No one has replied
  • How to Customise RangeSlider in qml

    Unsolved
    1
    0 Votes
    1 Posts
    400 Views
    No one has replied
  • Weather data value to rotation

    Solved
    7
    0 Votes
    7 Posts
    429 Views
    MarkkyboyM
    @J-Hilk - sorry, scrap that last comment, I changed it to value and now it works!, yay!!, thank you @J-Hilk, you sir are a genius!! :)
  • This topic is deleted!

    Unsolved
    1
    0 Votes
    1 Posts
    6 Views
    No one has replied