Skip to content

QML and Qt Quick

Looking for The Bling Thing(tm)? Post here!
20.1k Topics 77.7k Posts
  • Qt6.8 + CMake: QML components cannot find qrc resources built by qt_add_resources

    Solved
    2
    0 Votes
    2 Posts
    122 Views
    Christian EhrlicherC
    @Lopher said in Qt6.8 + CMake: QML components cannot find qrc resources built by qt_add_resources: Cannot open: qrc:/icons/close.svg Because they are not there as you can see here: qt_add_resources(IMClientResources "IMClientSvg" PREFIX "/icons" FILES resources/images/close.svg They are in :/icons/resources/images/close.svg
  • Qt SVG : Dynamic Modification

    Unsolved
    24
    0 Votes
    24 Posts
    5k Views
    EskilE
    The new svgtoqml tool and VectorImage component might be interesting for this. This will convert the SVG to QML code. The rendering will then be hardware-accelerated (being just Qt Quick under the hood). In addition, since it generates a tree of Qt Quick items with object names based on the IDs given in the source file, it is possible to traverse it using JavaScript and change properties on specific items as the original post here requested. Some more details can be found in these blogs if you are interested: https://www.qt.io/blog/vector-graphics-in-qt-6.8 https://www.qt.io/blog/animated-vector-graphics-in-qt-6.10
  • 0 Votes
    7 Posts
    309 Views
    SGaistS
    @DesiVideoGamer hi, Your class does not: inherit from QObject include the Q_OBJECT macro Hence there's no reason for moc to be doing anything.
  • DelegateModel DelegateModelGroup under the hood

    Unsolved
    2
    0 Votes
    2 Posts
    301 Views
    R
    @kkoehne sorry for tagging you, but do you know anything about that?
  • FontLoader: Cannot load font - Solution

    Solved
    1
    1 Votes
    1 Posts
    162 Views
    No one has replied
  • QML Plugin Load Error

    Unsolved
    8
    0 Votes
    8 Posts
    777 Views
    dheerendraD
    https://forum.qt.io/topic/158541/windows-qt_add_qml_module-failed-to-load-the-plugin This may help
  • Plugin error while loading in application uisng cmake

    Locked Unsolved
    2
    0 Votes
    2 Posts
    277 Views
    jsulmJ
    @Rangantha-B-V No need to ask same question twice (https://forum.qt.io/topic/163207/qml-plugin-load-error/4?_=1757653705393). In that other thread - did you react to the comment from @JKSH ?
  • 0 Votes
    2 Posts
    139 Views
    Axel SpoerlA
    onStatusChanged has been removed in Qt 6. The software is packaged with an outdated version of Qt, while the user environment obviously provides a recent version. You need to port the app to Qt 6...
  • Get all enum value names from C++ enum definition

    Solved
    4
    0 Votes
    4 Posts
    478 Views
    SebastianMS
    Partial solution which I found is to register this enum C++ class as creatable. Then in point where I need value names - is to call is JS section var obj = Qt.createQmlObject('import InfModule1.0; BackgroundType {}', parent); obj.names();
  • 0 Votes
    2 Posts
    295 Views
    Aleksey_KA
    ✅ Solution: Force layout recalculation after width changes To ensure layout syncs correctly, you need to explicitly trigger layout updates when the TableView or HorizontalHeaderView resizes. Fix: Add onWidthChanged: tableView.forceLayout() in both the TableView and the HorizontalHeaderView. 🔧 Updated code: TableView { id: tableView columnWidthProvider: function (column) { // Your width logic } onWidthChanged: tableView.forceLayout() } HorizontalHeaderView { id: header syncView: tableView onWidthChanged: tableView.forceLayout() } ✅ Even in HorizontalHeaderView, you call **tableView.forceLayout()**, not header.forceLayout(). 🧠 Why this works columnWidthProvider often runs before tableView.width is fully initialized or updated. forceLayout() triggers Qt to re-run layout and width calculations with correct sizing. syncView can now properly sync header and table widths based on the final layout pass. ✅ Result Now the header and table stay in perfect sync, even when: Resizing the window Stretching a specific column to take remaining space Changing content dynamically
  • QSyntaxHighlighter with TextEdit, format is not reflecting in TextEdit qml.

    Unsolved
    2
    0 Votes
    2 Posts
    514 Views
    SGaistS
    Hi, Which version of Qt are you using ? On which OS ? I tested your code on macOS with 6.7.2 and it's working properly.
  • How to expose a normal function to QML?

    11
    0 Votes
    11 Posts
    998 Views
    SavizS
    @JKSH said in How to expose a normal function to QML?: Do you need to expose every single C function directly to your GUI? Perhaps you could design your wrapper class as an abstraction layer that exposes fewer but higher-level methods to QML, while these higher-level functions each call multiple lower-level C functions. You are absolutely right that not all functions need to be exposed to the GUI layer. However, there are still a significant number of functions that do need to be invoked directly from the GUI. For that reason, I believe your proposed solution of creating a controller or wrapper unit with automated C++ generation is indeed the best approach. That said, I’ll continue researching to see if there are any alternative technologies that might be a better fit for my situation.
  • AM62x/Qt app renders fine after fresh flash, breaks after later redeploys

    Moved Unsolved
    4
    0 Votes
    4 Posts
    394 Views
    N
    Hi @JKSH ,It works for me. I disabled the pipeline cache by adding: QCoreApplication::setAttribute(Qt::AA_DisableShaderDiskCache); to main.cpp.
  • Application AbracaDABra cmake brings up tons QML-errors

    Unsolved
    1
    0 Votes
    1 Posts
    185 Views
    No one has replied
  • Best Approach for Displaying Multiple Camera Streams in Qt 6.9.1 with Microservices

    Unsolved
    11
    0 Votes
    11 Posts
    3k Views
    G
    @Ronel_qtmaster Yes currently we are trying to use gpu and reduce the cpu load Below is the gstreamer pipeline i'm trying by using d3d11 QString( "rtspsrc location=%1 latency=0 protocols=tcp name=src " "src. ! rtph264depay ! h264parse ! tee name=t " "t. ! queue ! d3d11h264dec ! d3d11convert ! d3d11download " "! video/x-raw,format=RGB " "! appsink name=appsink emit-signals=true sync=false max-buffers=2 drop=true" ) and we are encoding and decoding to jpeg using turbojpeg library. Do you have any suggestions on using gpu or gstreamer pipeline We are also thinking of trying to send the h264 encoded data and stream that also.
  • This topic is deleted!

    Unsolved
    0
    0 Votes
    0 Posts
    1 Views
    No one has replied
  • App UI is freezing after returning from Windows Lock screen.

    Unsolved
    1
    1 Votes
    1 Posts
    149 Views
    No one has replied
  • Map - api key requared

    Solved
    4
    0 Votes
    4 Posts
    1k Views
    JoeCFDJ
    The code in the video does not work. Not sure how he made the video. The tile address was typed to tite wrongly and the format was not correct either. The following code works for Qt5&6 QML without marker "API Key required". import QtQuick //2.15 for Qt5 import QtLocation //5.15 for Qt5 import QtPositioning //5.15 for Qt5 Window { width: Qt.platform.os == "android" ? Screen.width : 512 height: Qt.platform.os == "android" ? Screen.height : 512 visible: true title: map.center + " zoom " + map.zoomLevel.toFixed(3) + " min " + map.minimumZoomLevel + " max " + map.maximumZoomLevel Plugin { id: mapPlugin name: "osm" PluginParameter { name: "osm.mapping.providersrepository.disabled" value: true //fpr Qt5 value: "true" } PluginParameter { name: "osm.mapping.custom.host" value: "https://tile.openstreetmap.org/%z/%x/%y.png" } } Map { id: map anchors.fill: parent plugin: mapPlugin center: QtPositioning.coordinate(59.91, 10.75) // Oslo zoomLevel: 14 activeMapType: map.supportedMapTypes[map.supportedMapTypes.length - 1] property geoCoordinate startCentroid PinchHandler { id: pinch target: null onActiveChanged: if (active) { map.startCentroid = map.toCoordinate(pinch.centroid.position, false) } onScaleChanged: (delta) => { map.zoomLevel += Math.log2(delta) map.alignCoordinateToPoint(map.startCentroid, pinch.centroid.position) } onRotationChanged: (delta) => { map.bearing -= delta map.alignCoordinateToPoint(map.startCentroid, pinch.centroid.position) } grabPermissions: PointerHandler.TakeOverForbidden } WheelHandler { id: wheel // workaround for QTBUG-87646 / QTBUG-112394 / QTBUG-112432: // Magic Mouse pretends to be a trackpad but doesn't work with PinchHandler // and we don't yet distinguish mice and trackpads on Wayland either acceptedDevices: Qt.platform.pluginName === "cocoa" || Qt.platform.pluginName === "wayland" ? PointerDevice.Mouse | PointerDevice.TouchPad : PointerDevice.Mouse rotationScale: 1/120 property: "zoomLevel" } DragHandler { id: drag target: null onTranslationChanged: (delta) => map.pan(-delta.x, -delta.y) } Shortcut { enabled: map.zoomLevel < map.maximumZoomLevel sequence: StandardKey.ZoomIn onActivated: map.zoomLevel = Math.round(map.zoomLevel + 1) } Shortcut { enabled: map.zoomLevel > map.minimumZoomLevel sequence: StandardKey.ZoomOut onActivated: map.zoomLevel = Math.round(map.zoomLevel - 1) } } }
  • qt_add_qml_module with absolute QML file paths causes qmlcachegen error

    Unsolved
    3
    0 Votes
    3 Posts
    309 Views
    L
    @JKSH said in qt_add_qml_module with absolute QML file paths causes qmlcachegen error: The expectation is to have a CMakeLists.txt file in the same folder as your *.qml files. You can then link that folder to the rest of your project using add_subdirectory(). Thank you. This approach is correct. Placing the *.qml files in the src directory is indeed more appropriate. I just wanted to see how to write the CMake configuration when separating QML and C++ code.
  • This topic is deleted!

    Unsolved
    4
    0 Votes
    4 Posts
    2k Views