Skip to content

QML and Qt Quick

Looking for The Bling Thing(tm)? Post here!
20.0k Topics 77.4k Posts
  • Replacement of Canvas3D in Qt 6.7 ?

    Unsolved
    3
    0 Votes
    3 Posts
    274 Views
    B
    This is the only discussion I could find: https://lists.qt-project.org/pipermail/development/2018-August/033523.html
  • windeployqt and VectorImage

    Solved
    3
    0 Votes
    3 Posts
    309 Views
    M
    @SGaist Thank you. I did as you said first for some time ago, when I tried msvc kit, and it didn't work, so I searched and found this confusing topic (https://forum.qt.io/topic/73340/windeployqt-and-qml ) and tried pointing to Qt's qmldir. Then I switched to mingw but continued pointing to Qt's qmldir. Anyway, your answer worked with mingw kit, and msvc turned to be impossible to run even from release folder before the deployment, but that's another story. Thank you very much!
  • PushButton icon spacing

    Unsolved
    2
    0 Votes
    2 Posts
    279 Views
    SGaistS
    Hi and welcome to devnet, AFAIK, you can't do it like that. If you want that distance to be different, you will have to implement that yourself. One way is to customize the size handling and paint event. The other is to create an image with a transparent background which provides the extra gap you are after.
  • Failed to import C++ class into QML in Qt6.5

    Solved
    2
    0 Votes
    2 Posts
    205 Views
    T
    Solution: Everything was working correctly except for the import warning in Qt Creator. The issue is related to Qt Creator itself and not the Qt framework. The application runs and works as expected without any issues. This import warning can be safely ignored, as it does not affect the functionality of the application.
  • Problem with virtual keyboard in WASM

    Solved
    4
    0 Votes
    4 Posts
    313 Views
    A
    For other persons, in pro file: static { QT += svg QTPLUGIN += qtvirtualkeyboardplugin } and in main.cpp #include <QtVirtualKeyboard> qputenv("QT_IM_MODULE", QByteArray("qtvirtualkeyboard")); with this VKB works well
  • QT can't load qml controls

    Solved
    8
    0 Votes
    8 Posts
    663 Views
    F
    Thank you @Bob64 @JoeCFD and @jsulm , I fallback to QT5.x, the program can run again.
  • How to Print a Scrollable Application Window as a Full PDF in Qt

    Unsolved
    1
    0 Votes
    1 Posts
    95 Views
    No one has replied
  • Help, How to fix the bug of "cannot load library 'xxx\QtQuick3D\qquick3dplugin.dll"?

    Solved
    4
    0 Votes
    4 Posts
    647 Views
    A
    I fixed this problem. I lost some Qt5Quick3D dll in my application path. this dll need use windeployqt to run qquick3dplugin.dll in cmd.
  • "QtWebEngine is not installed" warning even though it is - urgent

    Solved
    2
    0 Votes
    2 Posts
    240 Views
    No one has replied
  • Issues With Customizing ScrollBar

    Solved
    10
    0 Votes
    10 Posts
    3k Views
    R
    Thank you very much. I will try it
  • QML TreeView with custom delegate

    Solved
    6
    0 Votes
    6 Posts
    923 Views
    O
    Hi! Thank you for your responses! Unfortunately, the documentation for TreeView is not very detailed, and examples are quite scarce. I followed your advice and dug deeper into how the delegate works for TreeView. As a result, I managed to achieve exactly what I needed, as shown in the original screenshot. To help others understand this topic more easily, I’ll share my code below. Key ideas: The entire view layout can be customized using the delegate. There’s no need to come up with complex solutions like DelegateChooser, which I had been trying earlier. You can use the column and row variables to determine which row or column is being processed. As mentioned earlier, to align text, you should use horizontalAlignment. You need to align the row yourself (make indents depending on the nesting). import QtQuick import QtQuick.Controls import Qt5Compat.GraphicalEffects Item { id: root width: 260 height: 700 TreeView { id: treeView anchors.fill: parent anchors.margins: 10 clip: true model: assetModel selectionModel: ItemSelectionModel { model: treeView.model } delegate: Item { implicitWidth: column === 0 ? root.width * 2/3 - padding * 2 : root.width * 1/3 - padding * 2 implicitHeight: label.implicitHeight * 1.5 readonly property real indentation: 20 readonly property real padding: 5 // Assigned to by TreeView: required property TreeView treeView required property bool isTreeNode required property bool expanded required property int hasChildren required property int depth required property int row required property int column required property bool current property Animation indicatorAnimation: NumberAnimation { target: indicator property: "rotation" from: expanded ? 0 : 90 to: expanded ? 90 : 0 duration: 100 easing.type: Easing.OutQuart } TableView.onPooled: indicatorAnimation.complete() TableView.onReused: if (current) indicatorAnimation.start() onExpandedChanged: indicator.rotation = expanded ? 90 : 0 Rectangle { id: background anchors.fill: parent color: row === treeView.currentRow ? "#0085F8" : "transparent" } Label { id: indicator x: padding + (depth * indentation) + 5 anchors.verticalCenter: parent.verticalCenter visible: isTreeNode && hasChildren text: "▶" color: "white" TapHandler { onSingleTapped: { let index = treeView.index(row, column) treeView.selectionModel.setCurrentIndex(index, ItemSelectionModel.NoUpdate) treeView.toggleExpanded(row) } } } Image { id: image x: (isTreeNode ? (depth + 1) * indentation : 0) anchors.verticalCenter: parent.verticalCenter width: 13 height: 13 source: hasChildren ? "../../images/svg-folder.svg" : "../../images/svg-file.svg" visible: column === 0 ? true : false ColorOverlay { source: image anchors.fill: image color: "white" } } Label { id: label x: image.x + image.width + 5 anchors.verticalCenter: parent.verticalCenter width: parent.width - padding - x clip: true text: model.display color: column === 0 ? "white" : "#ABABAB" font.pixelSize: column === 0 ? 14 : 10 horizontalAlignment: isTreeNode ? Text.AlignLeft : Text.AlignRight rightPadding: 10 font.family: "Roboto Medium" } } MouseArea { id: menuMouseArea anchors.fill: parent acceptedButtons: Qt.RightButton Connections { target: menuMouseArea onClicked: { menu.open() menu.x = menuMouseArea.mouseX menu.y = menuMouseArea.mouseY } } } } Menu { id: menu width: 150 leftPadding: 5 font.family: "Roboto Medium" palette.window: "#1f1f1f" palette.text: "white" palette.windowText: "white" palette.light: "#898989" MenuItem { text: "Rename" icon.source: "../../images/svg-edit.svg" icon.width: 14 icon.height: 14 } MenuItem { text: "Delete" icon.source: "../../images/svg-trash.svg" icon.width: 14 icon.height: 14 } } } Now it looks like this: [image: 4f7d83ed-313b-430f-b390-18116851959d.png] Thank you all!
  • Is it possible to use Qt Quick modules without QML?

    Unsolved
    16
    1 Votes
    16 Posts
    2k Views
    B
    @drwho-0 said in Is it possible to use Qt Quick modules without QML?: quick widget substantiation I'm curious about this - what does this mean?
  • 0 Votes
    2 Posts
    170 Views
    T
    I've managed to get to the bottom of this. We have extended the qml Text item with our own type and use it for building menus, labelling buttons and other widgets. It turns out this extended Text item has a ToolTip added in by us ... this must be a big no-no, because thanks to the heavy use of this Text item we instance 1500 text items and therefor 1500 of the ToolTips .... it's those tool tips that are registering somewhere in the QAccessible system (I think because they inherit PopUp, and I think on Windows a PopUp is a Window which make themselves known to QAccessible). This is killing the performance in that setActive method, I suppose 1500 hidden windows is probably a bit excessive! (I realise I contradicted myself in the OP about the number of Text items, it turns out I wasn't counting them correctly in the first place.)
  • ComboBox popup accessibility issue - JAWS announces the Popup as "dialog"

    Unsolved
    3
    0 Votes
    3 Posts
    193 Views
    napajejenunedk0N
    Qt 6.5.3.16 Windows 11 Enterprise 23H2 22631.4602 JAWS 2025.2412.50
  • I have sample show video app, can you guys check for me pls ?

    Unsolved
    2
    0 Votes
    2 Posts
    174 Views
    SGaistS
    Hi and welcome to devnet, What exactly are you expecting from people here ? On a side note, please using coding tags (using for example de </> button) to make your code readable.
  • 0 Votes
    3 Posts
    1k Views
    P
    For anyone coming across this thread, the answer is... tl;dr: You need to add the runFullTrust capability. With Qt 5, there was support for UWP apps. This made it possible for Windows apps to be delivered through the Microsoft Store. (This is how my app was built and delivered.) Then Microsoft opened up the Microsoft Store for Win32 apps too; i.e. standard desktop apps. As a developer you have a choice of either packaging your own installer and delivering that through the Microsoft Store, or just your app, letting Microsoft Store handle installation. The latter option behaves more like the handling of a UWP app and Microsoft handles the code-signing certificate for you. As a consequence, Qt decided to drop support for UWP as of Qt 6. This was done with no public notification to the Qt community 🤬, with just a message on the Qt development mailing list. I eventually found this out via a convoluted bug report. What Qt themselves did not realise is that if you submit a Win32 app via the Microsoft Store, because it is a desktop app and does not sit nicely in a sandbox like a UWP app, you need to add the runFullTrust capability. If you don't do this, you get the weird behaviour of the application window opening in a separate window described above. However be aware that when you add runFullTrust Microsoft will require you to justify why your app needs access to the whole Windows system. I was able to pass certification with a message along the lines of "My app is built with the Qt framework that only generates Win32 apps. My app does not operate outside the sandbox and behaves nicely." One more gotcha if you're going this route. The path QStandardPaths::AppDataLocation was different for UWP apps than Win32 apps. The following only applies if you had a UWP app in Qt 5 and stored data there as the path will be wrong for your Win32 app in Qt 6. To fix this, I use the following: https://gist.github.com/paulmasri/75dcd3386a4e8eaf705058240ef547d1
  • Question about Component.onCompleted: signal handler

    Unsolved
    2
    0 Votes
    2 Posts
    183 Views
    BondrusiekB
    Component is a special type in the QtQml module that acts as a blueprint for creating objects in QML. Every QML object is implicitly part of a Component, even if you don't explicitly wrap it in a Component block. For example: import QtQuick Item { Component.onCompleted: { console.log("Hello World") } } Internally, QML treats this as if it is wrapped in a Component: import QtQuick Component { Item { Component.onCompleted: { console.log("Hello World") } } } You can analyze QQuickItem class and you will see that it inherits from QObject and QQmlParserStatus, hence it is possible to call Component.onCompleted() in Item objects.
  • Get properties list from Item

    Solved
    2
    1 Votes
    2 Posts
    216 Views
    BondrusiekB
    I found a solution: onClicked: { Object.keys(rectangle).forEach((key) => { if (rectangle.hasOwnProperty(key) && typeof rectangle[key] !== "function") { console.log(key + ": " + rectangle[key]) } }) }
  • Create 2 gst-pipeline on qml

    Unsolved
    1
    0 Votes
    1 Posts
    101 Views
    No one has replied
  • Speech to text conversation

    Unsolved
    5
    0 Votes
    5 Posts
    295 Views
    SGaistS
    @JoeCFD hence my remark about the wip branch named wip/speech-recognition.