Skip to content

QML and Qt Quick

Looking for The Bling Thing(tm)? Post here!
20.3k Topics 78.4k Posts
Qt 6.12 LTS is out! See what's new in the release blog
  • Does QML have a RubberBand component ?

    Unsolved
    3
    0 Votes
    3 Posts
    128 Views
    GilboonetG
    @SGaist Ok, I'm going to try to implement that.
  • How do I switch the FluentWinUI3 style to Dark theme?

    Unsolved
    3
    0 Votes
    3 Posts
    600 Views
    D
    It will follow the application's colorScheme (https://doc.qt.io/qt-6/qstylehints.html#colorScheme-prop) so you can set it like this: Qt.styleHints.colorScheme = Qt.Dark
  • QML Version of QStatusBar

    Unsolved
    2
    0 Votes
    2 Posts
    96 Views
    JKSHJ
    Hello! @jayrickaby said in QML Version of QStatusBar: Is there a way to replicate QStatusBar in QML? I noticed it used to exist, but got removed (for whatever reason). Status Bars are independently styled within a QStyle so I wonder if there is any way for it to exist, or at least get the styling? It would be nice having the size grip as well, and I'd rather not remake the app in Qt Widgets. Is it sufficient to assign a Label to your ApplicationWindow's footer? GUIs seem to have mostly dropped size grips over the past 20 years or so; windows can be easily resized nowadays without a dedicated grip element. But you could anchor a cosmetic Image or Shape to the bottom-right corner of your ApplicationWindow or its footer.
  • Is there a way to make QML use 2D data model ?

    Solved
    19
    0 Votes
    19 Posts
    1k Views
    GilboonetG
    I finally found a way to have my nested repeater correctly updated. I have a function that updates it on Component.onCompleted, and that function not only uses data (rows) that I sent packed into a string, but also make calls to a dataset that contains uptodate data. For my simplest use case it works, I'm going to see if it is ok too for the other uses cases.
  • 0 Votes
    3 Posts
    185 Views
    GilboonetG
    @JKSH Thank you, I changed import QtQuick.Controls to import QtQuick.Controls.Basic and the warnings disappear. I also tested on WASM and it's also ok.
  • Tutorial "Introduction to Qt Quick Controls", Fallen at first hurdle.

    Unsolved
    7
    0 Votes
    7 Posts
    2k Views
    PsnarfP
    In the Qt Creator Projects pane, right-click appHomeControls or whatever is just below CmakeLists.txt, choose "Add Existing Files," open the assets folder and select all of the files. "Resources" now appears in the Projects pane. When I took the course, the source: property of the background: Image type was Qt.resolvedUrl("assets/BrushedMetal.jpg").
  • Make TreeViewDelegate always fill the TreeView width

    Solved treeview
    2
    0 Votes
    2 Posts
    166 Views
    Grzesiek11G
    Apparently I should've talked with my rubber duck. The way you do this is not by altering the TreeViewDelegates, but the TreeView itself. It derives from TableView, and there are docs for this: https://doc.qt.io/archives/qt-5.15/qml-qtquick-tableview.html#columnWidthProvider-prop tl;dr: TreeView { columnWidthProvider: (column) => { return width } } Though for more complex cases, you might want to actually put some logic in it to take data wider than the view.
  • Get QtGraphs with XYModelMapper working

    Unsolved
    16
    0 Votes
    16 Posts
    7k Views
    M
    Qt 6.12 added a log scale support to Qt Graphs: LogValueAxis
  • 0 Votes
    2 Posts
    1k Views
    M
    Hi Camellia :) In case it still helps: CustomSeries creates one QQuickItem from your delegate for every data item. At 10k+ candles, that's 10k+ items, each with its own scene graph node. That scales poorly. Qt 6.12 adds an opt-in 2D backend on Qt Canvas Painter for Qt Graphs. With it, a C++ QCustomSeriesCanvasRenderer can draw the whole series in one paint call instead of using delegates. It's off by default, though: Qt has to be built with -feature-graphs-2d-high-performance-backend. I haven't tested it, just saw it in the release notes. It might be worth to try. I suspect this will become a default setting in future Qt versions. Otherwise, what scales is one custom QQuickItem in C++ that builds a single QSGGeometryNode for all candle bodies and one for the wicks, and rebuilds them only when the data or the visible range changes. 10k candles is under 100k vertices, which is easy for any GPU. This is the approach I use in QAccelPlot (Note: I'm an author). You can check the sources for the reference: https://github.com/michalgrabarczyk/QAccelPlot (there's no candlestick plot there yet though).
  • QML module not found (QtQuick.VirtualKeyboard)

    Unsolved
    4
    0 Votes
    4 Posts
    4k Views
    PsnarfP
    Apologies for the necropost, but the question remains. Use the Qt Maintenance Tool to "add or remove components." Under Qt For Development/Qt/Qt version/Additional Libraries, make sure Qt Virtual Keyboard is checked. The error message "QML Module Not Found" simply means the library is not installed. Obquote: "Think in assembler; program in C" --Computer Scientists circa 1990
  • 1 Votes
    5 Posts
    333 Views
    SGaistS
    @Grzesiek11 said in Calling the data method of a QAbstractItemModel in QML always uses display role instead of the requested role: If this has thrown a type error at me, I would have probably figured it out faster, but instead any string seems to be implicitly converted to 0. I think this would be worth discussing on the project bug tracker.
  • Qt Graphs lacking functionalities - Axes range

    Unsolved
    21
    1 Votes
    21 Posts
    8k Views
    M
    @AndyBrice said in Qt Graphs lacking functionalities - Axes range: I guess I will be using QtCharts and hoping that it is supported for some time into the forseeable future. Hi Andy, I'm wondering what did you end up using? I ran into similar dillema a while ago and ended up handcrafting a library. Are you considering using 3rd party libs?
  • ValueAxis label and tick misalignment when modifying range in Qt Graphs (QML)

    Unsolved
    4
    0 Votes
    4 Posts
    266 Views
    M
    Hi, I have submitted the bug report on Jira along with a minimal reproducible example and screenshots: https://qt-project.atlassian.net/browse/QTBUG-152112 Thank you for your guidance!
  • ListView for chat message history: positionViewAtIndex doesn't work reliably (+repro)

    Unsolved
    3
    0 Votes
    3 Posts
    409 Views
    J
    This is an interesting issue with Qt Quick ListView, especially when working with variable-height delegates. The estimated delegate sizes can sometimes cause unexpected scroll positioning when jumping to items that are outside the visible area. Calling positionViewAtIndex() twice may help as a workaround, as the first call allows ListView to create nearby delegates and update its size estimates.
  • QML HighDPI scaling problem on Windows 11

    Solved
    9
    0 Votes
    9 Posts
    895 Views
    Y
    @Axel-Spoerl Sorry. It looks like the black rectangle isn't a regression, but rather the implementation of dark mode support. In version 6.8, dark mode wasn't applied automatically. If the system color theme is light, both versions look identical. Qt 6.8.3, Dark theme, scale 100%: [image: 71a73ecd-1d25-45ed-8f99-4f2ec5c51524.png] Qt 6.12.0, Light theme, scale 100%: [image: 8b33cb68-132d-4875-abc8-16958c5d9507.png] Interestingly, even at 100% scale, the scrollbar looks a bit jagged in both versions, even though the scrollbar itself is straight. However, Fusion.ScrollBar looks good. Thank You. [image: 31dff5ec-b1ac-45f7-a7c0-780738a887fd.png] Should I close the topic as resolved?
  • 1 Votes
    3 Posts
    376 Views
    Z
    Thank you! Very little useful information unfortunately. I get this upon initialization, but nothing else (even when updating the render target): [18] Creating QRhi with backend Vulkan for window 0x55beb55752a0 (wflags 0x1) Graphics API debug/validation layers: 0 Debug markers: 0 Timestamps: 0 Prefer software device: 0 Shader/pipeline cache collection: 1 [18] Using existing native Vulkan physical device 0x55beb59dcc80 device 0x55beb5acb7c0 graphics queue family index 0 [18] Initializing QRhi Vulkan backend 0x55beb559cef0 with flags 20 [18] Enabled instance extensions: [18] VK_KHR_get_physical_device_properties2 [18] VK_EXT_swapchain_colorspace [18] Using imported physical device 'NVIDIA GeForce RTX 5070 Laptop GPU' 610.228.256 (api 1.4.341 vendor 0x10DE device 0x2D18 type 2) [18] 280 device extensions available [18] Using imported device 0x55beb5acb7c0 [18] Using queue family index 0 and queue index 0 [18] Created QRhi 0x55bec060c310 for window 0x55beb55752a0 [18] Attempting to seed pipeline cache for QRhi 0x55bec060c310 from '/home/znurre/.cache/qtpipelinecache-x86_64-little_endian-lp64/qqpc_vulkan' [18] Created pipeline cache with initial data of 291394 bytes [18] rhi texture atlas dimensions: 2048x1024
  • How to get current file name with extension?

    Unsolved
    3
    0 Votes
    3 Posts
    413 Views
    L
    @KH-219Design said in How to get current file name with extension?: From this older post: https://forum.qt.io/topic/122818/get-file-name-line-number-and-function-name-in-qml-javascript-how I learned that this is possible in QML: const e = new Error() console.log(e.stack) Sample output: expression for myCustomPropertyName@file:///long/path/to/my/qml/VersionLabel.qml:28 The older forum thread has additional ideas for parsing the string if you prefer to see only a substring of what is in Error().stack or here is how it looks when the QML file is compiled into the C++ app binary: expression for myCustomPropertyName@qrc:/qml/VersionLabel.qml:28 Took a look but it seems that if you have a file that does this and is called by another QML file it'll stack the expression to that file as well. For example if I call it from a file called Page.qml but the error stack is called from Settings.qml I'd get Debug: expression for onCompleted@file:///Settings.qml:14 expression for onCompleted@file:///Page.qml:103 So I'd guess I'd need to some how parse the first line of the stack
  • 1 Votes
    1 Posts
    186 Views
    No one has replied
  • Why is drawcall batching (using my own QSGNodes) slower?

    Solved
    3
    0 Votes
    3 Posts
    486 Views
    S
    I used 1024 segments because it was mend as stress test. But after I switched to 32-64 segments there was a significant difference.
  • What is best way to implement controls that render very fast?

    Solved
    7
    0 Votes
    7 Posts
    2k Views
    S
    See my post 'Why is drawcall batching (using my own QSGNodes) slower?'