Skip to content

QML and Qt Quick

Looking for The Bling Thing(tm)? Post here!
20.0k Topics 77.4k Posts
  • How to disable/Stop default console logs from AudioEngine QML type

    Unsolved
    1
    0 Votes
    1 Posts
    179 Views
    No one has replied
  • Mousearea drag lag

    7
    0 Votes
    7 Posts
    2k Views
    MarkkyboyM
    Loving the attitudes here.......waiting for someone else to provide a fix, yet not one of you have bothered posting a code snippet for 'us' to look at or play with. Help us help you, the more info you give, the better the help is likely to be and if dragthreshold doesn't work, why are only 5 people complaining about it?, I suggest your code is mising something.
  • The content of ListView disappears when scrolling ScrollView

    Solved
    2
    0 Votes
    2 Posts
    342 Views
    V
    Sorry for disturbing. This is the answer: https://doc.qt.io/qt-5/qml-qtquick-listview.html#cacheBuffer-prop
  • QML Profiler Command Line tool

    Unsolved
    1
    0 Votes
    1 Posts
    329 Views
    No one has replied
  • Qt Qml Architecture best practice

    Unsolved
    8
    0 Votes
    8 Posts
    2k Views
    T
    @Mantas-Kast It's kind of an old topic, but I am curious. Have you found a satisfactory answer to your topic by now? Imo, FLUX/FELGO are the best practices for qml architecture. There should be a global "store" and global "actions". It allows you to change your UI quickly without any pain. Calling qml from c++ should be done via Connection where target is your C++ object and your UI "action" is called. Calling C++ from qml should be done via C++ object, defined in setProperty in qmlEngine.
  • Using ColumnLayout with a ScrollView

    Unsolved
    7
    0 Votes
    7 Posts
    999 Views
    L
    You have to tweak the layout behavior to match your requirements. Per default, all available space will be distributed equally between all children. import QtQuick.Window 2.15 import QtQuick 2.15 import QtQuick.Controls 2.15 import QtQuick.Layouts 1.12 Window { width: 500 height: 400 visible: true ColumnLayout { // set outer bounderies for layout, not in the children anchors.fill: parent anchors.rightMargin: parent.width / 2 spacing: 10 anchors.margins: 10 Label { Layout.fillWidth: true // disable taking more height then required Layout.fillHeight: false color: "darkgray" text: qsTr("Type your text below") wrapMode: "Wrap" font.pointSize: 14 } ScrollView { Layout.fillWidth: true // automatically fill empty height // > if you would set this to TRUE for multiple children, the available // space will be equally distributed between them Layout.fillHeight: true TextArea { // you don't need width&height or anchors.fill here // TextArea automatically fills ScrollView background: Rectangle { color: "red" } // use Wrap instead of WordWrap to avoid long single // words to overflow // > Wrap automatically prefers WordWrap wrapMode: "Wrap" padding: 10 } } } }
  • This topic is deleted!

    Unsolved
    1
    0 Votes
    1 Posts
    1 Views
    No one has replied
  • Strange behavior with QQmlFileSelector

    Unsolved
    2
    0 Votes
    2 Posts
    335 Views
    M
    Hello again! I stumbled into this behavior again, as one of my files, where I used relative paths, has changed its Qt.resolvedUrl behavior "overnight". I was not yet able to find out which commit has broken it, as the the built binaries do no behave the same all times, weird... :O The file lies under @/Base/Interface/+foo/ and Qt.resolvedUrl("../") does now resolve to qrc:/Interface/+foo/ and not qrc:/ as like before. The need for using relative paths came as the absolute paths with "qrc:/" were not working as expected under all circumstances (see previous post). So I decided to give that a closer look again. Here is what I found out so far: All that cases I had shown in the first part of the previous post, do work correctly when I encapsulate the source's string into a Qt.resolvedUrl. That means, I no longer get a completely different result for Image { source: "qrc:/Assets" + "/logo.png" when I do that by saying: Image { source: Qt.resolvedUrl("qrc:/Assets" + "/logo.png") With that the image's source gets resolved correctly to qrc:/Assets/+foo/+bar/logo.png The same counts for StateChangeScript { script: imageSource = Qt.resolvedUrl("qrc:/Assets/error.png") } where 'imageSource' is still a property of type string, but the image's source gets resolved correctly to qrc:/Assets/+foo/+bar/error.png. And also for PropertyChanges { target: image source: Qt.resolvedUrl("qrc:/Assets/error.png") } the source gets resolved correctly to qrc:/Assets/+foo/error.png Does anyone have a clue on what Qt.resolvedUrl does in an other way than the implicit conversion of strings to urls? Naively you will think like, this will happen internally by using Qt.resolvedUrl, but yeah... Regards, matzze.
  • How to list all QQuickItems within a certain rectangle?

    Unsolved
    1
    0 Votes
    1 Posts
    214 Views
    No one has replied
  • QWindow won't give up its active focus

    Unsolved
    1
    0 Votes
    1 Posts
    190 Views
    No one has replied
  • How to run a shell script from qml ?

    6
    0 Votes
    6 Posts
    12k Views
    AlbertoSalviaNovellaA
    Example Mind that the call is asynchronous. Hence the command sends a signal when it finishes, and a different part of the code picks the signal and continues with the next step you want to perform.
  • OpenGL/FBO/QML - How to correctly render using FBO?

    Solved
    2
    0 Votes
    2 Posts
    477 Views
    0
    I've found another solution for me, that uses QuickItem class without any problems with rendering GitHub link
  • Push StackView from C++

    Unsolved
    6
    0 Votes
    6 Posts
    772 Views
    fcarneyF
    @therealmatiss said in Push StackView from C++: There's literally nothing there about C++. https://doc.qt.io/qt-5/qtquick-modelviewsdata-modelview.html#c-data-models The first link (same page as this link) gives you an overview of how to present data to qml. The sublink shows how this relates to data models and shows how to expose those models to qml from c++. Having a good understanding of the model view is essential for using qml and c++ effectively together.
  • How to display set of items in List View with Scrolling

    Unsolved
    1
    0 Votes
    1 Posts
    191 Views
    No one has replied
  • JavaScript Fetch API

    Unsolved
    2
    0 Votes
    2 Posts
    1k Views
    L
    @None-None-None Never tried if it is working, as I still use my old helper method and pass a function into the callback: function doRequest(url, method, callback) { var xhr = new XMLHttpRequest() xhr.onreadystatechange = (function (myxhr) { return function () { if (xhr.readyState === XMLHttpRequest.DONE) callback(myxhr) } })(xhr) xhr.open(method, url, true) xhr.send('') }
  • qml create TableView columns dynamically

    Unsolved
    1
    0 Votes
    1 Posts
    182 Views
    No one has replied
  • 0 Votes
    3 Posts
    595 Views
    Q
    i have the same problem and i've used Repeater but it gives an error: Repeater { model: ["name", "color"] delegate: TableModelColumn { display: model } } the error: Cannot assign object to list property "columns"
  • Error when adding chart to main.qml

    Moved Solved
    3
    0 Votes
    3 Posts
    507 Views
    D
    @GrecKo thank you very much. This error took a lot of my time.
  • Cannot select from multiple available GPUs used by QQuickWindow.

    Unsolved
    3
    0 Votes
    3 Posts
    374 Views
    GrecKoG
    I would post this in https://lists.qt-project.org/listinfo/interest if I were you.
  • QOpenglWidget and QML

    Unsolved
    2
    0 Votes
    2 Posts
    249 Views
    dheerendraD
    Not possible.