Skip to content

QML and Qt Quick

Looking for The Bling Thing(tm)? Post here!
20.0k Topics 77.4k Posts
  • Cannot run/preview qml files from qtcreator, but works from terminal

    Unsolved
    1
    0 Votes
    1 Posts
    759 Views
    No one has replied
  • Order of QML property's dependency evaluation

    Solved qml binding properties
    5
    0 Votes
    5 Posts
    2k Views
    B
    @b-arun-kumar said in Order of QML property's dependency evaluation: Response from Qt Support: As per this old article: https://www.kdab.com/qml-engine-internals-part-2-bindings/, static value assignments happen during creation phase and binding value assignments happen at the end of creation phase. That is how it should be, literals first, then functions. But it is not actually documented so in theory it could change. This is also only true for simple literal assignments. Anything even slightly hinting about complexity makes QML engine postpone them together with all those needing the evaluation. For example it happens if you wrap the value with {} like this: p2: {true} Case 1: CustomQMLComponent{} In this case, based on the above article, p1 & p2 values are set by the time p3 value is set. The order in which these "static" properties are set is undefined and also the order in which more complex expressions are done are undefined. So it is best to avoid making assumptions about the order. Case 2: CustomQMLComponent{ p1: "my_string" p2: true } What happens in this case? In a more general sense, what happens when properties of a component are set when creating an instance of the component? Are the properties initialized with default values and then overridden by the new instance's values? Or, the properties are initialized just once with the default/new values. Just once. Although the properties do of course have some default value before the value in QML is assigned. The initial value set in constructor of a C++ class, or in case of QML defined property, default constructed value of the type (empty string, 0, false or null in case it is QObject* type). And why this could be important is because something like onXXXChanged signals are handled immediately when they occur and thus it could be ran before all those "static" assignment are done. Consider for example: onP1Changed: if (p2) {...} else {...} QML engine does not know that there is some dependency to p2 on p1 value change and in case p1 gets assigned before p2, this could take unexpected path and if p2 value change is not explicitly also handled properly in this case, could lead to mismatched state.
  • QML TreeView - handle Keyboard array events

    Unsolved
    1
    0 Votes
    1 Posts
    198 Views
    No one has replied
  • Reference Error appears, but the program runs normally.

    Unsolved
    11
    0 Votes
    11 Posts
    669 Views
    W
    @KroMignon Sorry, It's just a typo...
  • How can i Know SwitchDelegate is checked or not?

    Solved
    4
    0 Votes
    4 Posts
    331 Views
    E
    Great @lemons this is Works :D
  • Append text Gui freezed

    Unsolved qml
    1
    0 Votes
    1 Posts
    138 Views
    No one has replied
  • ScrollView far too sensitive for touchpad scrolling

    Unsolved
    3
    0 Votes
    3 Posts
    462 Views
    MarkkyboyM
    There doesn't appear to be any control over velocity with ScrollView. Perhaps to have a look at Flickable which does offer control over velocity; https://doc.qt.io/qt-5/qml-qtquick-flickable.html I could be wrong, but a good search for 'velocity' kept coming back to Flickable. I saw 'maximumFlickVelocity' for ListView mentioned in an Android thread, but it doesn't seem to apply to ListView in qml.
  • Error building QtCreator from source

    Unsolved
    2
    0 Votes
    2 Posts
    192 Views
    SGaistS
    Hi, It looks like you are using your distribution provided Qt. If so, then you have to install the development packages that provide the private parts of Qt.
  • Handwriting Recognition lipi toolkit , Myscript, T9

    Unsolved
    1
    0 Votes
    1 Posts
    229 Views
    No one has replied
  • QT QML UI is not refreshing on embedded Linux Display Unit

    Unsolved
    1
    0 Votes
    1 Posts
    164 Views
    No one has replied
  • How to set the position in QML List view

    Solved
    3
    0 Votes
    3 Posts
    517 Views
    P
    @sierdzio Thank You ListView { id: listView anchors.fill: parent model: contactModel delegate: Text { font.pixelSize: 14 text: name + ": " + number } onCountChanged: listView.contentY = 52 }
  • How to translate Dialog's standard buttons?

    Solved translation
    3
    0 Votes
    3 Posts
    833 Views
    D
    @Dmitriano Figured this out! I add qt-everywhere-src-6.2.2\qttranslations\translations\qtbase_ru.ts to the project and load qtbase_ru.qm with the Translator in C++ code.
  • Spinbox not fitting to rectangle, If it fits focus is missing

    Unsolved
    4
    0 Votes
    4 Posts
    277 Views
    MarkkyboyM
    This code does not compile. Where are the import statements?, I have to assume you are using QtQuick.Controls 1.4 not Quick 2. It is important to give as much info as you can and where possible, learn how to paste it properly making it readable and repeatable for those reading/helping. You are using components that do not exist, where does 'widthValue' and 'heightValue' come from in Rectangle? Not forgetting the strange use of anchors, why are you trying to anchor the rectangle to the top of itself?, error after error. So, all you are wanting to do, is place SpinBox in a Rectangle?; Rectangle{ id: upperValue color: "red" width: 200 height: 100 anchors.centerIn: parent SpinBox { id:spinbox minimumValue: 0.2 maximumValue: 40 stepSize: 0.2 decimals: 2 focus: true anchors.centerIn: parent } } } [image: 8cb34146-fb49-48cd-be1b-40905688d151.JPG]
  • Display text in pages

    Unsolved
    4
    0 Votes
    4 Posts
    336 Views
    ndiasN
    Hi @Iliass, If you plan to use PyQt or PySide you can check this example or follow this tutorial . Regards
  • make playback tone time constant when pitch is varying

    Unsolved
    1
    0 Votes
    1 Posts
    109 Views
    No one has replied
  • How to fetch listtype data from qml to cpp?

    Unsolved qml qqmlcomponent qqmlengine qmetaobject invokemethod
    1
    0 Votes
    1 Posts
    266 Views
    No one has replied
  • How to read properties for the currenetly selected item in a ListView

    Unsolved
    7
    1 Votes
    7 Posts
    6k Views
    C
    @tskardal Hey, I know this is an old topic, but I was directed here from Google when looking for a solution for this exact problem. Luckily I found this SO question from 2015 that has a built-in elegant solution. It has to do with using DelegateModel to encapsulate the QAbstractListModel and let the user get any item at a certain index. In OP's case, the solution will look like this: import QtQml.Models 2.15 //need this for DelegateModel ListView { id: list width: 180; height: 200 model: DelegateModel{ id:myDelegateModel model: myModel // QAbstractListModel delegate: Component { Item { width: 200 height: 30 Text { id: text text: title } MouseArea { anchors.fill: parent onClicked: { list.currentIndex = index; } } } } } onCurrentItemChanged: { var currentModelItem = myDelegateModel.items.get(list.currentIndex).model console.log("Current Item title is: " + currentModelItem.title) } } There are more current answers that to my humble opinion are far more convoluted than this solution.
  • audio file pitch vs frequency relation in audio engine in qml

    Unsolved
    1
    0 Votes
    1 Posts
    135 Views
    No one has replied
  • QtDeviceUtilities.DisplaySettings, QML and screen brightness

    Solved
    8
    0 Votes
    8 Posts
    1k Views
    SGaistS
    Since you hold a commercial license do not hesitate to contact the Qt company about that matter.
  • Creating Flowchart dynamically through qt c++ qml

    Unsolved
    4
    0 Votes
    4 Posts
    948 Views
    GrecKoG
    Take a look at http://cneben.github.io/QuickQanava/index.html