Skip to content

QML and Qt Quick

Looking for The Bling Thing(tm)? Post here!
20.2k Topics 78.1k Posts
  • Qt Graphs lacking functionalities - Axes range

    Unsolved
    20
    1 Votes
    20 Posts
    2k 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
    395 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
    21 Views
    No one has replied
  • Qt6 ApplicationWindow vs Windows - what is better to use ?

    Unsolved
    6
    0 Votes
    6 Posts
    115 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
    249 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
    656 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
    324 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
    31 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
  • Popup Qt Quick event handler issue

    Unsolved
    2
    0 Votes
    2 Posts
    72 Views
    mzimmersM
    I'm not sure what behavior you expect, but I think you want to disable hovered behavior on the first popup button while the second popup is up. If that's true, here's your code rewritten into a full QML page (I also added a Loader example to give you an idea of an alternative implementation). If I understand your requirement, this works for me. import QtQuick import QtQuick.Controls Window { width: 640 height: 480 visible: true Component.onCompleted: { loader.item.open() } Loader { id: loader sourceComponent: popupComponent } Popup { id: popup1 width: 100 height: 100 x: 100 y: 100 padding: 0 modal: true focus: true contentItem: Rectangle { id: popup1Container Button { id: btn1 anchors.fill: parent background: Rectangle { color: btn1.hovered ? "red" : "green" } onClicked: popup2.open() } } } Popup { id: popup2 width: 100 height: 100 padding: 0 closePolicy: Popup.NoAutoClose x: popup1.x + popup1.width y: popup1.y + popup1.height modal: true focus: true contentItem: Rectangle { id: popup2Container height: 100 width: 100 Button { id: btn2 anchors.fill: parent background: Rectangle { color: "yellow" } onClicked: popup2.close() Text { text: "Close" anchors.centerIn: parent } } } } Component { id: popupComponent Popup { width: 100 height: 100 modal: true focus: true background: Rectangle { id: popupContainer color: "blue" TapHandler { onTapped: popup1.open() } } } } }
  • Need help on Quaternion.lookAt (NaN output)

    Unsolved
    8
    1 Votes
    8 Posts
    491 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
    325 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
    601 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
    265 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:
  • Why did "useOpenGL" not work?

    Unsolved
    10
    0 Votes
    10 Posts
    736 Views
    F
    @JKSH Oh that definitely sounds good
  • Need guide on modifying Qt modules

    Unsolved
    6
    0 Votes
    6 Posts
    194 Views
    JKSHJ
    @FishBoneEK said in Need guide on modifying Qt modules: @SGaist I'm considering adding gaps in LineSeries of QtGraphs (with qQNaN() perhaps), instead of using multiple LineSeries. OK, so this is a continuation of https://forum.qt.io/post/836004 As mentioned there, this feature is coming to Qt 6.11 (currently downloadable as a beta) -- please give that a try before editing Qt.
  • My CharacterController won't fall

    Solved
    3
    0 Votes
    3 Posts
    139 Views
    S
    Slightly off-topic: Maybe it's a typo, but Earth's gravity is 9.81 and not 9.18.
  • qml type annotation with local enum

    Unsolved
    4
    0 Votes
    4 Posts
    533 Views
    R
    https://doc.qt.io/qt-6/qtqml-javascript-hostenvironment.html#type-annotations-and-assertions It says: Note: In QML, enumerations are not types and can therefore not be used as type annotations. Their underlying numeric type, int or double, should be used instead.
  • QGraphsView How to get mouse events

    Unsolved
    2
    0 Votes
    2 Posts
    118 Views
    GrecKoG
    Have you tried a HoverHandler?