Skip to content

QML and Qt Quick

Looking for The Bling Thing(tm)? Post here!
20.0k Topics 77.4k Posts
  • This topic is deleted!

    Unsolved
    2
    0 Votes
    2 Posts
    7 Views
  • How to get default value in qml?

    Unsolved
    2
    0 Votes
    2 Posts
    105 Views
    J.HilkJ
    @TomNow99 Use an explicit binding, instead of a JS-Evauation Binding { target: xyzInstance; property: "x"; value: myTextField.text; when: someCondition; restoreMode: Binding.RestoreValue}
  • Scrollbar Quirks

    Solved
    3
    0 Votes
    3 Posts
    206 Views
    P
    Thank you so much, Mid does indeed change the color of the handle, but another color seems to control the color of the handle while it is being dragged. I will figure it out. One more question. Is this documented anywhere? Or is the source code available? I searched everywhere I could think of and could not locate it. I found this page: https://doc.qt.io/qt-6/qtquickcontrols-fusion.html which only covers a subset of the palette usage.
  • Equivalent to QGraphicsView and QGraphicsScene?

    Unsolved
    9
    0 Votes
    9 Posts
    678 Views
    S
    Thanks to y'all who replied. @JoeCFD @Asperamanca @GrecKo @Axel-Spoerl @JKSH I had looked at the Drag and Drop examples but they used the DropArea type which didn't fit my need because it wouldn't allow me to place the tiles freely in a shared plane, or at least that's my understanding. With the help of AI tools (which I've found extremely useful in fast prototyping a project, especially in a framework that I'm not familiar with like in this case QML), I've created exactly what I needed with basic Qt Quick Items. Here's the basic structure: Window { // button to add a new tile Button { onClicked: { tileComponent.createObject(dashboardArea, { "x": /* x position in dashboard area */, "y": /* y position in dashboard area */, "tile specific properties": data }); } } // dashboard area Item { id: dashboardArea // this component holds dynamically created tiles Component { id: tileComponent Tile {} } } } // Tile.qml Rectangle { // tile specific properties ... // Make the tile draggable MouseArea {} }
  • This topic is deleted!

    Unsolved
    1
    0 Votes
    1 Posts
    16 Views
    No one has replied
  • This topic is deleted!

    Unsolved
    1
    0 Votes
    1 Posts
    4 Views
    No one has replied
  • QQmlApplicationEngine failed to load component

    Unsolved
    3
    0 Votes
    3 Posts
    208 Views
    JKSHJ
    @imxande said in QQmlApplicationEngine failed to load component: want to understand what is really happening. One way to start doing this is to inspect your embedded resources: QDirIterator qrc(":", QDirIterator::Subdirectories); while(qrc.hasNext()) qDebug() << qrc.next(); Note that if I add engine.addImportPath("qt/qml") to my main.cpp file the engine finds the module What does engine.importPathList() produce after you do that?
  • Qt 6.5: QML TableView lose resizing ability when using columnWidthProvider

    Unsolved
    4
    3 Votes
    4 Posts
    815 Views
    Z
    some tips for this. ApplicationWindow { visible: true width: 640 height: 480 title: qsTr("HeaderView") TableModel { id: qmlTabModel TableModelColumn { display: "name" } TableModelColumn { display: "color" } TableModelColumn { display: "age" } rows: [ { "name": "cat", "color": "black", "age": "1.1" }, { "name": "dog", "color": "brown", "age": "1.2" }, { "name": "bird", "color": "white", "age": "1.3" } ] } Rectangle { id: bgtab anchors.fill: parent color: Qt.styleHints.appearance === Qt.Light ? palette.mid : palette.midlight onWidthChanged: { tableView.forceLayout() } HorizontalHeaderView { id: horizontalHeader anchors.left: tableView.left anchors.right: parent.right; anchors.top: parent.top syncView: tableView clip: true model: qmlTabModel delegate: Label { text: qmlTabModel.columns[column].display } } VerticalHeaderView { id: verticalHeader anchors.top: tableView.top anchors.left: parent.left syncView: tableView clip: true } TableView { id: tableView anchors.left: verticalHeader.right anchors.top: horizontalHeader.bottom anchors.bottom: parent.bottom contentWidth: parent.width; columnSpacing: 1 rowSpacing: 1 boundsBehavior: Flickable.StopAtBounds property var columnWidths: [100, 50, bgtab.width] columnWidthProvider: function(column) { let w = explicitColumnWidth(column) if (w >= 0 && column !== (columns - 1)) { columnWidths[column] = w; return w; } if (column === (columns - 1)) { w = columnWidths[column]; let i = columns - 1; while(--i !== -1) w -= columnWidths[i]; return w; } return columnWidths[column]; } model: qmlTabModel delegate: Rectangle { implicitHeight: 20 color: palette.base Label { text: display } } } } }
  • How to propagate hover events when using MouseArea?

    Solved mousearea hover mouse event event handling
    4
    0 Votes
    4 Posts
    264 Views
    GrecKoG
    Nice, note that TapHandler has a doubleTapped signal.
  • How to dynamically pair qml objects with c++ objects

    Solved
    29
    0 Votes
    29 Posts
    3k Views
    GrecKoG
    Yes that's exactly what I meant, thanks for explaining it Bob64.
  • QMediaPlayer and Qml

    Unsolved
    2
    0 Votes
    2 Posts
    139 Views
    jsulmJ
    @SetupIa Take a look at this example: https://doc.qt.io/qt-6/qtmultimedia-video-qmlvideo-example.html
  • "at least one required feature is not present" error

    Unsolved
    2
    0 Votes
    2 Posts
    126 Views
    H
    i tried "link with qt", but result is the same.
  • Qt 6.5 MultiEffect for shadow

    Solved
    11
    0 Votes
    11 Posts
    5k Views
    C
    If your shadow is cut off, I recommend to choose a bigger padding rect. What was a surprise for me - the x and y should be positive numbers if you want the rectangle to "wrap" top left corner too. Try something like: paddingRect: Qt.rect(100, 100, 300, 300) The size should be as small as possible though, cause it affects performance.
  • 0 Votes
    2 Posts
    179 Views
    Axel SpoerlA
    One of the (probably new) dependencies of the labs platform plugin is missing. You have to use the dependency walker directly on the plugin, to see which one it is.
  • Is it more efficient to go from qml to c++ or c++ to qml?

    Solved
    5
    0 Votes
    5 Posts
    377 Views
    J
    @JKSH Agreed!
  • QML TreeView - expansion status of hidden nodes

    Unsolved
    4
    0 Votes
    4 Posts
    256 Views
    B
    @GrecKo As expected, I get (-1, -1) cell coordinates back for non-visible indices.
  • osm.mapping.offline.directory parameter value issues

    Unsolved
    1
    0 Votes
    1 Posts
    82 Views
    No one has replied
  • Adding QML into library with Qt6 and CMake. How?

    Solved
    3
    0 Votes
    3 Posts
    215 Views
    B
    @JKSH Thx. Will try it today.
  • How can QML get a 2D double array filled by Q_INVOKABLE C++ member function?

    Unsolved
    4
    0 Votes
    4 Posts
    299 Views
    SGaistS
    @Tom-asso hi, Check the build log, you likely have a warning about that issue from the compiler.
  • IconImage and ColorImage current state

    Unsolved
    2
    0 Votes
    2 Posts
    257 Views
    B
    I would be interested in this too. I happened across ColourImage in some Qt source the other day and thought it looked useful before realising that it's internal. This was in 6.8. I am porting some Qt5 code at the moment and was trying to figure out how to colour an svg. I used to use GraphicalEffects and the compatibility library isn't available with the in-house Qt build I have to use. Meanwhile MultiEffect, which I understood to be the Qt 6 replacement, doesn't appear to work, with no clues provided as to why not.