Skip to content

Blog

Everything more or less news-worthy will show up in this forum at some point.
8 Topics 46 Posts
Qt 6.11 is out! See what's new in the release blog
  • Hot Reload in Qt 6.12

    Moved
    4
    6 Votes
    4 Posts
    440 Views
    KH-219DesignK
    This looks to be a quite nice feature and an extremely well-written overview (which deserves to be on doc.qt.io site somewhere 😉). I have not yet read the entire write-up. But for many, many months now I have wanted to ask where is the "missing" replacement for the dummydata folder that qmlscene knew how to use? Reading this part of today's (present) forum thread post: ...not destroy it in the first place: update only the QML data of the application, and leave the C++ objects alive wherever we can. (emphasis mine) If all you did was adjust a color, a size, a binding, or the body of some function, nothing is re-created at all. The application keeps running and merely looks different from one moment to the next. You stay on the fifth screen. (emphasis mine) From what I am reading so far, this "QML Preview" is still running my complete app, including my C++ production application logic. Yes? The reason I continue to cling to qmlscene (even building it from source as needed when it fails to install on some platform for some newer Qt version)... Is that qmlscene (with the key aspect of dummydata) lets me "swap in" a fully QML-mocked backend. This capability has made rapid prototyping of QML screens and their transitions, animations, and error-handling modes go extremely rapidly. Now that qmlscene is deprecated, where does that concept live? Is that a dead concept? I want to "run only my QML" without loading or running any of the C++. I want to have "shadow viewModel" classes implemented as QML dummydata. Am I the only one who clings to this workflow? (Feel free to spin this out into its own separate thread if I have gone too off the rails. However, I think there is some important overlap that justifies me asking this question here and now, because my question also implies a kind of critique of where the current preview-tool development effort is heading, potentially.) Thank you for your consideration! Again: bravo on a great write-up!
  • StyleKit

    Unsolved
    11
    3 Votes
    11 Posts
    913 Views
    JKSHJ
    @Richard-Moe-Gustavsen said in StyleKit: comparing performance against Qt Style Sheets is on our to-do list Other than performance, it's also worth comparing the usability of StyleKit vs. style sheets. I remember getting quite frustrated with style sheets before and had to fight hard to make things look exactly how I want. I've yet to do a deep dive into StyleKit, but from a quick glance it seems more intuitive+flexible and less "surprising" than style sheets.
  • Qt Canvas Painter blog post series

    Unsolved
    24
    5 Votes
    24 Posts
    13k Views
    K
    New Qt Canvas Painter related blog post: https://www.qt.io/blog/qt-canvas-painter-accelerated-performance-using-paths This one is about the QCanvasPath class. Explains how to use it, the differences to QPainterPath, the GPU-side caching approach, and how paths can be used for progressive rendering. An imperative painting API can be very fast when optimized for GPU usage from the ground up. [image: 479c4dcc-201e-4503-af10-277fd880cf22.png]
  • Qt Extension 1.14.0 for VS Code Released

    Unsolved
    1
    0 Votes
    1 Posts
    843 Views
    No one has replied
  • Qt Creator 19 - CMake Update

    1
    1 Votes
    1 Posts
    728 Views
    No one has replied
  • QML Tooling in 6.11 blog post series

    Unsolved
    3
    0 Votes
    3 Posts
    2k Views
    S
    Part 3 is out at: https://www.qt.io/blog/whats-new-in-qmllint-for-qt-6.11-part-3 The latest Qt release, Qt 6.11, is just around the corner. This short blog post series presents the new features that QML tooling brings in Qt 6.11. You can find part 1 on new qmlls features here, and part 2 on new qmllint warnings here{rel="noopener" target="_blank"}. In this blog post, we will start with a short recap on the context property and go through the new context property support in qmllint and QML Language Server. Recap on context properties What are they? Context properties embed C++ objects into QML. They are defined at runtime on the QQmlContext of a QObject, and can be accessed from QML. Here is an example: [image: image-png-Mar-16-2026-02-12-41-5518-PM.png] The C++ code uses engine.rootContext()->setContextProperty(...) to define the context property at runtime, and the QML code accesses it via myProperty. Running the above program will print out the date and time obtained from QDateTime::currentDateTime() during the setContextProperty()-call. Why are they bad? The above example suffers from multiple problems because of its use of context properties. Limited reusability of the QML files QML files with context property usages have a dependency on a specific QQmlContext, even if there is nothing in the QML files that states that dependency. Therefore, anyone trying to reuse your code will have difficulty determining whether the reuse location has a QQmlContext sufficient for your code. In our previous example, reusing Main.qml in another place with a different context triggers these runtime errors: qrc:/qt/qml/contextproperties/Main.qml:6: ReferenceError: myProperty is not defined qrc:/qt/qml/contextproperties/Main.qml:4: ReferenceError: myProperty is not defined Limited QML tooling support QML tooling doesn't know about the context property definition and can't discern unqualified accesses from context property usages. You might have seen in the previous screenshot that QML Language Server warns that usages of myProperty are unqualified accesses How to replace them? You can find a guide on how to replace them with singletons or required properties in the documentation (warning: might contains spoilers!) . What if replacing them is not an option? Sometimes replacing context property usages might not be feasible, for example, because they are too widespread or come from a third-party API. The rest of the blog post explains how to teach QML tooling about context properties to avoid all those "unqualified access"-warnings when using context properties. Configurable context properties warnings qmllint adds basic support for context properties in Qt 6.11. Prior to 6.11, qmllint treated unqualified accesses and context property accesses identically. This meant that warnings about the use of context properties couldn't be silenced without losing actual relevant unqualified access warnings. To separate actual unqualified accesses from context property accesses, we added a new configuration file that allows you to declare the context properties that exist in your code. To use the new context property configuration file, create a .contextProperties.ini file with the following content inside your project source folder. [General] disableUnqualifiedAccess = "myContextProperty1,myContextProperty2" warnOnUsage = "myContextProperty3,myContextProperty4,myContextProperty5" disableHeuristic = false We will explain each setting key in this example in the next sections. Here is how the warning looks without any .contextProperties.ini file. [image: image-png-Mar-16-2026-01-59-02-5249-PM.png] Disable unqualified access If you have decided that a context property can't or won't be replaced with a better alternative, and if you want to silence all unqualified access warnings on that context property, then disableUnqualifiedAccess was made for you. That setting key should contain all the context property names where unqualified access warnings should be silenced. Use "," to separate multiple context property names. qmllint silences all unqualified access warnings on those property names, allowing you to focus on the other relevant unqualified access warnings. In our example, adding our context property name to disableUnqualifiedAccess silences the warning: [image: image-png-Mar-16-2026-01-59-37-7852-PM.png] Warn on usage You might have (rightfully!) decided that you still want to get rid of your context property usages, so silencing the warning via disableUnqualifiedAccess and forgetting about the context properties might not be feasible for you. In that case, you might want unqualified accesses to emit unqualified access warnings and context property accesses to emit context property-related warnings. To do so, add the context property name to the warnOnUsage key. Use "," to separate multiple context property names. qmllint will emit a different warning with a different warning category for unqualified accesses on properties in the warnOnUsage-list. This allows you to unclutter the unqualified warning category. In our example, adding our context property name to warnOnUsage makes qmllint emit a different warning: [image: image-png-Mar-16-2026-02-00-22-7733-PM.png] You might ask yourself now, "This is all good, but do I really have to type all of my context property names inside this configuration file? What if I can't remember how I named my context properties ages ago?" Fortunately, there is a heuristic that can help you find your context properties. Find context property definitions The CMake scripts in 6.11 include a heuristic search for context property definitions in C++ code. It greps your source folder for setContextProperty() calls and saves the result into your build folder. This way, qmllint picks up the context property definitions at runtime and can warn when accessing them. Grepping the source folder with the heuristic takes some time on bigger projects and is therefore disabled by default. To run the heuristic manually, call the dump_qml_context_properties CMake target. The results of the heuristic search are saved in the build folder and read by qmllint during linting. To run the heuristic search automatically during the CMake linting targets, like all_qmllint, for example, set the QT_QMLLINT_CONTEXT_PROPERTY_DUMP CMake variable to ON before calling the linting target. After running the dump_qml_context_properties target via the editor's CMake extension, for example, by typing cm dump_qml_context_properties in Qt Creator's locator and hitting enter, we get the following warnings on our context property usage: [image: image-png-Mar-16-2026-02-02-40-1441-PM.png] The unqualified warning is no longer the only one: a new warning has been added about a potential context property access being detected. It also contains the location of the "definition" for the context property that can be seen when looking at the entire warning message: [image: image-png-Mar-16-2026-02-06-23-5570-PM.png] The location of the "definition" we can use to check whether myProperty is really a context property or a false positive. If it really is a context property, we can add it to warnOnUsage in the .contextProperties.ini to remove the unqualified access warning. The entire list of context property names found by the heuristic is in the build folder at <build>/.qt/.contextPropertyDump.ini. Disable the heuristic To disable warnings about context property names found by the heuristic, set the disableHeuristic key in the configuration file to true, or delete the .contextPropertyDump.ini file from the build folder. Summary We started with a recap on what context properties are and went through the new context property support in QML tooling. This was the last part of this series. We hope that you enjoyed it. Remember to open a bug report in JIRA if anything is not working as expected or is insufficiently documented.
  • Qt Extension 1.12.0 for VS Code Released

    Unsolved
    2
    1 Votes
    2 Posts
    1k Views
    No one has replied
  • New in Qt 6.11: QRangeModel updates and QRangeModelAdapter

    Unsolved
    3
    3 Votes
    3 Posts
    2k Views
    V
    @JonB that is correct; our tests compile and run with a C++ 17 only toolchain. But if you use it with a newer C++ standard, then you get some support for new language features (like multi-dimensional subscripts from C++23, or std::ranges). This is possible with QRangeModel(Adapter) as the implementation is mostly inline in the headers.