Skip to content

QML and Qt Quick

Looking for The Bling Thing(tm)? Post here!
20.2k Topics 78.1k Posts
  • Setting up QML module dependencies with qt_add_qml_module()´s DEPENDENCIES TARGET

    Solved
    6
    2 Votes
    6 Posts
    128 Views
    JKSHJ
    @GergoK said in Setting up QML module dependencies with qt_add_qml_module()´s DEPENDENCIES TARGET: I have reported this as a bug before I noticed your answer. They have confirmed that there is an issue here: https://qt-project.atlassian.net/browse/QTBUG-144510?focusedCommentId=2617125 Thanks for writing up the bug report. Looks like it all works as expected on Qt 6.11 (you can download the beta version now) @JKSH said in Setting up QML module dependencies with qt_add_qml_module()´s DEPENDENCIES TARGET: DEPENDENCIES TARGET only affects compile-time tools (like the QML Compiler) and edit-time tools (like the QML Language Server). It has no effect on your runtime QML engine. My apologies, this was wrong. DEPENDENCIES TARGET does put import paths inside qt.conf for the runtime engine to use without deploying.
  • How to get x, y from an element of ColumnLayout?

    Unsolved
    1
    0 Votes
    1 Posts
    20 Views
    No one has replied
  • Animation tekst color

    Unsolved
    6
    0 Votes
    6 Posts
    71 Views
    MarkkyboyM
    Hi @Darq Have you not looked at/for any of the QML documentation online?, there's plenty to look at, but sometimes, you will not always find directly what you want. I have linked ScaleAnimator QML docs page, it gives a Rectangle and a nested ScaleAnimator, swap out Rectangle for Text and get busy playing/experimenting, then you can add a ColorAnimation on the same block of code, so now you can scale text and change its color. Please, for yourself, do always look for documentation as most of it gives ready to paste examples to play with. ScaleAnimator QML ~ https://doc.qt.io/qt-6/qml-qtquick-scaleanimator.html ColorAnimation QML ~ https://doc.qt.io/qt-6/qml-qtquick-coloranimation.html I'll even throw in a quick code chunk you can play with, but documentation is the way to go, mostly. Text { id: scalingText text: "READ DOCS!" color: "green" anchors.centerIn: parent SequentialAnimation on scale { loops: Animation.Infinite running: true ScaleAnimator { from: 2 to: 6 duration: 1000 easing.type: Easing.InOutQuad } ScaleAnimator { from: 6 to: 2 duration: 1000 easing.type: Easing.InOutQuad } } SequentialAnimation on color { loops: Animation.Infinite running: true ColorAnimation { to: "red" duration: 4000 } ColorAnimation { to: "green" duration: 4000 } } } Good luck, it's easy when you know how!
  • QtChartJs - Chart.js for Qt 6 QML (no WebEngine)

    2
    0 Votes
    2 Posts
    44 Views
    jsulmJ
    @code-brew You should consider posting it here: https://forum.qt.io/category/8/showcase
  • Popup Qt Quick event handler issue

    Unsolved
    7
    0 Votes
    7 Posts
    211 Views
    T
    @GrecKo if the code like below: Rectangle { id: rect width: 100 height: 100 color: mouseArea.containsMouse ? "red" : "green" MouseArea { id: mouseArea anchors.fill: rect hoverEnabled: true onClicked: popup1.open() } } Popup { id: popup1 width: 200 height: 300 modal: true focus: true anchors.centerIn: parent closePolicy: Popup.CloseOnEscape contentItem : Rectangle { } } The color of id "rect" auto change to "red" when popup1 opened. (the popup auto "catch" hovered behavior on mousearea) But if i have 2 popup like the first post, when popup2 opened (by click on btn1 on popup1) , btn1 will keep hovered behavior (not "catch" by popup2)
  • Shortcut: Only binding to one of multiple key

    Unsolved
    1
    0 Votes
    1 Posts
    39 Views
    No one has replied
  • Qt Graphs lacking functionalities - Axes range

    Unsolved
    20
    1 Votes
    20 Posts
    3k Views
    B
    @J.Hilk Thank You! I successfully compiled and ran examples QuickWidgetGraphs and HelloGraphs
  • Controls appear to break bindings when interacted with

    Unsolved
    4
    1 Votes
    4 Posts
    431 Views
    J.HilkJ
    By default, Qt Quick Controls CheckBox updates its checkState when the user interacts with it (and cycles through states when tristate is enabled). That write breaks a checked: model.value binding, so if your business logic rejects the change and does not update model.value, the UI can stay desynced. Option 1: handle onToggled and re-establish the binding (and optionally snap back immediately): CheckBox { id: cb checked: model.value onToggled: function(wanted) { model.maybe_change_value_maybe_not_depends_on_complex_business_logic(wanted) if (model.value !== wanted) { cb.checked = Qt.binding(function() { return model.value }) } } } Option 2: override nextCheckState so the control never toggles itself: CheckBox { checked: model.value onClicked: model.maybe_change_value_maybe_not_depends_on_complex_business_logic() nextCheckState: function() { return model.value ? Qt.Checked : Qt.Unchecked } }
  • QML Debugger not starting, hence, Live preview not working on Ubuntu 25.10

    Unsolved
    1
    0 Votes
    1 Posts
    44 Views
    No one has replied
  • Qt6 ApplicationWindow vs Windows - what is better to use ?

    Unsolved
    6
    0 Votes
    6 Posts
    207 Views
    Pl45m4P
    @bogong said in Qt6 ApplicationWindow vs Windows - what is better to use ?: There are two components 'Window' and 'ApplicationWindow'. What is better to use with Qt 6? I would say it's comparable to QWidget vs. QMainWindow The latter with its integrated QMenuBar, QToolBar and QStatusBar support, whereas the former provides a more "plain" Widget (or QML Control / Window in your case)
  • Beginner problems with QML and glyphs

    Unsolved
    4
    0 Votes
    4 Posts
    285 Views
    EskilE
    Which version of the font is this? I downloaded the font from the following address and at least for this version, the font family is "Material Symbols Outline" (with spaces), not "MaterialSymbolsOutline": https://github.com/google/material-design-icons/blob/master/variablefont/MaterialSymbolsOutlined[FILL%2CGRAD%2Copsz%2Cwght].ttf With this font, U+E900 works fine. Is it possible you used the wrong font name in your application? If so, other fonts on the system will be queried for the characters you request, so you may get one font for U+E900 and another one for U+E8FF, depending on what is available and the order they are queried. You can get the correct name by calling QFontDatabase::applicationFontFamilies() and pass in the ID that addApplicationFont() returned.
  • Call function in ui.qml!

    Unsolved
    5
    0 Votes
    5 Posts
    693 Views
    K
    You need to create a model with Q_INVOKABLE function: class MyModel : public QObject { Q_OBJECT QML_ELEMENT MyModel() = default; ~MyModel() = default; public: Q_INVOKABLE void doSomething(); }; Then add it to your QML Widget: import Your.App.Namespace Item { MyModel { id: myModel } } Then you can use myModel.doSomething(). Maybe read the QML documentation or contribute to a QML project to see how it works? I learnt all this while forking MuseScore.
  • Force QQuickWindow update

    Unsolved
    11
    0 Votes
    11 Posts
    408 Views
    jeremy_kJ
    My attempt to distill the end goal from a potentially misguided inquiry is: Render the current data now. Qt might be the wrong tool for the job due to greater focus on ease of use with reasonable performance across many platforms. That comes with the cost of a large and complex code base that attempts to integrate different subsystems. Attempting to pick apart that integration in the name of performance seems to lead to a lot of errors and frustration. Something like Dear ImGui may be more appropriate for this case.
  • A problem with binding to the resources prop of Item

    Unsolved
    1
    0 Votes
    1 Posts
    48 Views
    No one has replied
  • MediaPlayer does not receive stream metadata.

    Unsolved mediaplayer bug
    10
    0 Votes
    10 Posts
    2k Views
    Niclas EisenhutN
    I also tested Qt 6.4.3 because you mentioned As Qt 6.5 switched the multimedia backend to ffmpeg, in which I got Key [7] (Publisher) = HIT RADIO FFH, so the Station Name is mapped, but the Song Title (StreamTitle) is still missing I used Debian 13 btw
  • Need help on Quaternion.lookAt (NaN output)

    Unsolved
    8
    1 Votes
    8 Posts
    602 Views
    F
    Almost forgot to paste the qtbug: https://qt-project.atlassian.net/browse/QTBUG-143886 Seems they put it to Critical P1.
  • 1 Votes
    4 Posts
    343 Views
    SGaistS
    @AnttiK said in With Qt 6.10.1 and CMake, configuring a simple QML application fails when source code is in a folder with whitespaces: I'm afraid I'm not too familiar with the Qt sources and how they're organized so I'm far from certain whether my pull request or suggestion would even be considered. Don't be, every contributor had to start somewhere. It does not require a big complicated patch to get on the train :-)
  • Mitigate "Variable Delegate Size" issue in ListView

    Unsolved
    3
    0 Votes
    3 Posts
    614 Views
    GrecKoG
    If you know how to calculate the total of your delegates' height, you might want to handle the ScrollBar yourself and set its size and position manually. The position might be trickier to compute.
  • This topic is deleted!

    Unsolved
    1
    0 Votes
    1 Posts
    5 Views
    No one has replied
  • How to trigger a QQuickFramebufferObject repaint?

    Solved
    6
    0 Votes
    6 Posts
    309 Views
    K
    I don't know why I though update() was a method of the FBO::Renderer. I changed it now, and I'm having the same issue. Image gets temporarily rendered when resizing the widget, and then goes back to blank. EDIT: Oh, actually, it was my own fault. Was calling canvas->flush() which deletes the canvas after drawing. :facepalm: