Skip to content

QML and Qt Quick

Looking for The Bling Thing(tm)? Post here!
20.0k Topics 77.3k Posts
  • How to show countdown timer on top of button

    Unsolved
    1
    0 Votes
    1 Posts
    407 Views
    No one has replied
  • Is it possible to dynamically remove a particular item in Repeater?

    Unsolved
    2
    0 Votes
    2 Posts
    683 Views
    fcarneyF
    Create a ListModel and use that as your model in your Repeater. Delete entries from the ListModel.
  • QWindow::startSystemMove() Can't drag by right button

    Unsolved
    1
    0 Votes
    1 Posts
    119 Views
    No one has replied
  • MapboxGL plugin built on MSVC2019 incompatible with Qt Quick

    Unsolved
    2
    0 Votes
    2 Posts
    395 Views
    M
    Hi all, Just setting "radius" to a very small value can resolve that one. for example radius: height/1000 inside the Rectangle. I still don't know why, can someone explain, please?
  • Multiple sensor data in same page

    Unsolved
    1
    0 Votes
    1 Posts
    124 Views
    No one has replied
  • QT 5 Opencv VideoCapture No Cap and Frame are seen

    Unsolved
    6
    0 Votes
    6 Posts
    465 Views
    SGaistS
    No it's not since there's nothing that invokes your function in what you posted.
  • QML Scatter3D series: base gradient along different axis

    Unsolved
    1
    0 Votes
    1 Posts
    137 Views
    No one has replied
  • QTQuick, OpenCv and Gstreamer frame capturing

    Unsolved gstreamer1.0 opencv
    1
    0 Votes
    1 Posts
    522 Views
    No one has replied
  • Qt5 vs Qt6 assigning empty string variable QML

    Solved
    2
    0 Votes
    2 Posts
    891 Views
    sierdzioS
    property string taskType: "" // Test: if (taskType.length === 0) { // something }
  • Need to fetch font size of the text which is inside the button, at runtime

    Unsolved
    1
    0 Votes
    1 Posts
    140 Views
    No one has replied
  • Drawer eats escape key event?

    Unsolved
    1
    0 Votes
    1 Posts
    156 Views
    No one has replied
  • QML video gives Error: "No valid frames decoded before end of stream" some of the time

    Unsolved
    2
    0 Votes
    2 Posts
    1k Views
    C
    Any luck on solving this problem?
  • C++ use constants that defined in qml singleton file

    Solved
    3
    0 Votes
    3 Posts
    474 Views
    D
    I was able to resolve //main.cpp I did using this lines in main.cpp QQmlComponent component(&engine, QUrl(QStringLiteral("qrc:/pathToThatQmlFile.qml"))); QObject *object = component.create(); C++ClassName::getInstance()->setObject(object); //C++ As this qml file is singleton, in C++ class where constants need to be called, In constructor add: qmlRegisterSingletonType(QUrl(QStringLiteral("qrc:/pathToQmlFile.qml")), "com.Test.TestConstants", 1, 0, "TestConstants"); void C++ClassName::setObject(QObject *newObject) { item = qobject_cast<QQuickItem *>(newObject); qDebug() << item->property("phi").toDouble); } //QML pragma Singleton import QtQuick 2.14 Item { readonly property double phi: "3.142" }
  • TableView having just one column from model

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

    Unsolved
    1
    0 Votes
    1 Posts
    21 Views
    No one has replied
  • Solution for Animating multiple QML files from a separate qml file.

    Unsolved
    1
    0 Votes
    1 Posts
    146 Views
    No one has replied
  • Qt.labs.platform Menu Position Incorrect on HighDPI Displays

    Unsolved
    1
    0 Votes
    1 Posts
    245 Views
    No one has replied
  • Execute qml->build execute file from Another qml gui

    Unsolved qml qprocess qtqml qmlbuild
    3
    0 Votes
    3 Posts
    491 Views
    J
    No, After adding below line. process.waitForFinished(-1). but nothing happening. no error , no output. And, my doubt is that process environment is correct or not.
  • Activating an animation in an imported (reusable) object

    Unsolved
    9
    0 Votes
    9 Posts
    319 Views
    M
    I got it to work by giving the rectangle a static id but wrapping it in an Item. I put the toggle function in the item to expose it and set the width and the height of the item to the rectangle width and height so the column would work properly. This way the item gets the id set from main.qml and everything references properly. main.qml: import QtQuick 2.15 import QtQuick.Window 2.15 import QtQuick.Controls 2.15 import "objects" Window { width: 640 height: 480 visible: true title: qsTr("Hello World") Column { ExpandingRect { id: expandingRect } Button { text: "change rect" onClicked: { expandingRect.toggle() } } } Component.onCompleted: { console.log("OUTPUT") } } objects/ExpandingRect.qml: import QtQuick 2.15 Item { function toggle() { animationRect.running = true } width: leftMenuRect.width height: leftMenuRect.height Rectangle { id: leftMenuRect color: "red" height: 50 width: 50 PropertyAnimation{ id: animationRect target: leftMenuRect property: "width" to: if (leftMenuRect.width == 50) return 200; else return 50 //to: 200 duration: 500 easing.type: Easing.InOutQuint } Component.onCompleted: { } } }
  • Sharing component instance with nested components

    Unsolved
    2
    0 Votes
    2 Posts
    385 Views
    B
    For now, I have got the first approach I mentioned working. For this I have renamed the ApplicationWindow id to be a meaningful, "well known" name, appWindow. I also needed to introduce a property alias for the shared id to make it accessible from child components. I am still interested in comments about what would be the recommended approach here.