Skip to content

QML and Qt Quick

Looking for The Bling Thing(tm)? Post here!
20.0k Topics 77.3k Posts
  • Rescaling right axis in QtQuick ChartView rescales the left one and vice-versa

    Unsolved
    1
    0 Votes
    1 Posts
    151 Views
    No one has replied
  • display math formulas using label in qml

    Solved
    5
    0 Votes
    5 Posts
    948 Views
    raven-worxR
    @qAminzzz if you know the formulas and they are static (always the same), then simply render them to an image and then display them on the label: https://math.tools/equation/image
  • QML DateTimeAxis show UTC time

    Unsolved
    1
    0 Votes
    1 Posts
    578 Views
    No one has replied
  • SVGs used for button icons are fuzzy on HighDPI devices

    Unsolved
    1
    0 Votes
    1 Posts
    273 Views
    No one has replied
  • QGuiApplication palette not set to ApplicationWindow

    Unsolved
    3
    0 Votes
    3 Posts
    321 Views
    I
    It only works if you use the Fusion-style. The documentation states: The Fusion style uses the standard system palettes to provide colors that match the desktop environment.
  • ApplicationWindow not calling onClosing on cmd+q on macOS

    Solved
    3
    0 Votes
    3 Posts
    529 Views
    E
    I've found a much simpler (and maybe obvious?) workaround! Just capture the Quit menu on macOS: // (...) import Qt.labs.platform ApplicationWindow { id: mainwindow // (...) MenuBar { id: menubar // (...) Menu { title: "" MenuItem { id: quitaction text: qsTr("&Quit") shortcut: StandardKey.Quit onTriggered: mainwindow.close() } } } }
  • Add an image to a QML project built by CMake

    Unsolved
    1
    0 Votes
    1 Posts
    488 Views
    No one has replied
  • How do I load all files in a resource directory in one method

    Unsolved
    4
    0 Votes
    4 Posts
    825 Views
    raven-worxR
    @AI_Messiah from QML-only via FolderListModel
  • QML OpenGl layout issue with a retina screen

    Unsolved
    1
    0 Votes
    1 Posts
    130 Views
    No one has replied
  • I want to use the asynchronous property of a Shape object

    Unsolved
    1
    0 Votes
    1 Posts
    166 Views
    No one has replied
  • I want to clip an image with Shape

    Unsolved
    1
    0 Votes
    1 Posts
    243 Views
    No one has replied
  • QVector<int> not working as model?

    Solved
    3
    0 Votes
    3 Posts
    867 Views
    T
    Thank you, that solved my problem!
  • My first use of Qt 6 based on QML (qt6) book

    Unsolved
    7
    0 Votes
    7 Posts
    697 Views
    ndiasN
    Hi @qcoderpro , Here you can find a video tutorial, a little outdated but quite complete, on how to setup and use QML for Android: https://www.youtube.com/watch?v=w2RRgRGHsDA This one is also very explicit, but it is in Spanish language and does not show all setup steps: https://www.youtube.com/watch?v=v6SvsTPEe4I Both allowed me to develop my first android application. Regards
  • Thread interruption from QML

    Solved
    2
    0 Votes
    2 Posts
    215 Views
    U
    as a workaround for now I added a slot in my thread to do that for me using C++ and called it using QML [image: 8b83f1ec-87ba-4d97-a211-904f108e4390.png] if there's a better way to do it please do tell!
  • how to filter listmodel elements by text without deleting and remaking items?

    Unsolved
    2
    0 Votes
    2 Posts
    505 Views
    fcarneyF
    https://doc.qt.io/archives/qt-5.9/qtquick-tutorials-dynamicview-dynamicview4-example.html I kind of wish I saw this earlier when doing some of this work. I ended up using some C++ models to do this.
  • Style into button

    Unsolved
    2
    0 Votes
    2 Posts
    217 Views
    MarkkyboyM
    See here; https://forum.qt.io/topic/79071/how-to-set-style-of-button-in-qml Try this; import QtQuick 2.12 import QtQuick.Window 2.12 import QtQuick.Controls 2.12 Window { width: 640 height: 480 visible: true title: qsTr("Hello World") Button { id: control text: "Button" anchors.centerIn: parent background: Rectangle { implicitWidth: 200 implicitHeight: 50 border.width: control.activeFocus ? 2 : 1 border.color: "#888" radius: 4 gradient: Gradient { GradientStop { position: 0 ; color: control.pressed ? "#ccc" : "#eee" } GradientStop { position: 1 ; color: control.pressed ? "#aaa" : "#ccc" } } } } }
  • close on click event in design studio

    Unsolved
    1
    0 Votes
    1 Posts
    108 Views
    No one has replied
  • How do I add an alarm sound(Audio)?

    Unsolved
    2
    0 Votes
    2 Posts
    421 Views
    ndiasN
    Hello @LeoWillian, You ca create a 1 second timer object to get system current time and play a sound when current times equal to your alarm time: property var hms: {'hours': 0, 'minutes': 0, 'seconds': 0 } // (object containing integer numbers representing hours, minutes, seconds) Timer { interval: 1000; running: true; repeat: true onTriggered: { var dt = new Date() currentTime = dt.toLocaleTimeString(Qt.locale('EN'), "hh:mm:ss") hms = {'hours': dt.getHours(), 'minutes': dt.getMinutes(), 'seconds': dt.getSeconds()} if (hms.hours === alarmTime.hours && hms.minutes === alarmTime.minutes && hms.seconds === 0) { console.info("ALARM!!!") alarmSound.play() } } } MediaPlayer { id: alarmSound source: "./sounds/pager-beeps.wav" loops: SoundEffect.Infinite audioOutput: AudioOutput {} } To stop alarm sound you can use: alarmSound.stop() Best regards
  • Clustering QtLocation markers technique

    Unsolved
    4
    0 Votes
    4 Posts
    755 Views
    E
    @tomaslov I found QGeoView, an interesting and small/simple slippy map for Qt (No qml BS). I have forked the project and made a class (in a branch called draft) that manages a set of POIs and support clustering : https://github.com/embeddedmz/QGeoView/tree/draft it's in the "demo" directory. In 2022, I will continue working on that project.
  • Loader "progress" property always showing 1

    Solved
    3
    0 Votes
    3 Posts
    351 Views
    V
    @J-Hilk : Thanks ! it works now Updated code: Window { id: root width: Screen.desktopAvailableWidth height: Screen.desktopAvailableHeight visible: true title: qsTr("Hello World") Component { id: imageComponent Image { source: "https://images.pexels.com/photos/1115090/pexels-photo-1115090.jpeg?cs=srgb&dl=beautiful-flowers-bloom-blossom-1115090.jpg&fm=jpg" } } Loader { id: _loader anchors.fill: parent sourceComponent: imageComponent asynchronous: true } Rectangle { width: parent.width * _loader.item.progress height: 30 color:"red" } }