Skip to content

QML and Qt Quick

Looking for The Bling Thing(tm)? Post here!
20.0k Topics 77.4k Posts
  • Scope trouble. Accessing propeties out of scope.

    Solved
    5
    0 Votes
    5 Posts
    386 Views
    fcarneyF
    Are you wanting the Rectangle to exist when not visible or the data? If its the latter then take a data driven approach rather than messing with Items. You can build a ListModel in QML with your data and access the data inside that. Then it is primed to be used with various views.
  • TabView & Tab missing from Quickcontrols 2

    Unsolved
    1
    0 Votes
    1 Posts
    148 Views
    No one has replied
  • NOTIFY on grouped properties

    Solved
    4
    0 Votes
    4 Posts
    491 Views
    raven-worxR
    @ocgltd EVERY property you use in a statement must either be CONSTANT or have a NOTIFY signal. depending on which property gets changed, this notifier signal causes a reevaluation of the property binding.
  • Insert characters with accentuation in inputText

    Moved Unsolved
    2
    0 Votes
    2 Posts
    189 Views
    R
    The problem is caused because I'm using Qt Virtual Keyboard but I don't know how to avoid it.
  • Network programming with Qt

    Unsolved
    7
    0 Votes
    7 Posts
    756 Views
    GrecKoG
    Networking is such a broad concept that if you don't have a specific use case it's hard to give advices. The client code for a REST API can be very boring. see this code I made a long time ago to display the bike share network of my city as an example : https://github.com/oKcerG/MeetupSFPMMap/blob/master/main.qml the code to fetch the data is barely 10 lines (and simple ones). The model is handled via https://github.com/benlau/qsyncable , don't populate data manually in a for loop like done in the QML book. For more advance use case you would use QNetworkAccessManager in C++, potentially with OAuth and expose a nice API to QML. Or maybe you need to use a third party lib or implement a binary protocol with QTcpSocket. Or maybe something with zmq or protobuf ...
  • Calling C++ method from QML before UI is shown

    Unsolved
    3
    0 Votes
    3 Posts
    307 Views
    J.HilkJ
    @ocgltd Colors is a singleton, so why don't you create a c++ instance/get a reference and call the default color change setter there. After that you load your main.qml. Order of execution is important here.
  • form serial port communication. Send the data from Gui to another board

    Unsolved
    2
    0 Votes
    2 Posts
    242 Views
    jsulmJ
    @kk2507 You should start here: https://doc.qt.io/qt-5/qtserialport-index.html There is also link to examples.
  • 0 Votes
    3 Posts
    294 Views
    KroMignonK
    @kk2507 Your are mixing up several things: error unknown module: do you have installed QSerialPort? By the way how did you install Qt and which version are you using?(not Qt Creator which is only an IDE) If there is no serial port not available in "Tera Term", it is perhaps because your PC does not have any serial port available?
  • "Item could be not created" under Quick

    Unsolved
    1
    0 Votes
    1 Posts
    159 Views
    No one has replied
  • How to use virtualkeyboard in popup

    Unsolved
    1
    1 Votes
    1 Posts
    149 Views
    No one has replied
  • CustomMaterial shader compile error message and log absent

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

    Unsolved
    1
    0 Votes
    1 Posts
    1 Views
    No one has replied
  • Slot Machine in Qt Quick

    Unsolved
    5
    0 Votes
    5 Posts
    2k Views
    ndiasN
    @NullByte : I don't have any example implementing thins. But, with little effort, you can generate a random number and set the currentIndex for every Tumbler component. But I'm not sure how you can increase the speed to have a movement effect when incrementing the currentIndex. he movement effect can also be done by quickly incrementing the currentIndex. import QtQuick import QtQuick.Window import QtQuick.Controls ApplicationWindow { property var numItens: 5 Rectangle { anchors.fill: parent Row { Tumbler { id: tumbler1 model: numItens wrap: true } Tumbler { id: tumbler2 model: numItens wrap: true } Tumbler { id: tumbler3 model: numItens wrap: true } } Timer { id: incTimer1 property var counter: 0 property var frequency: 2 interval: 1000 / frequency repeat: true running: counter != 0 onTriggered: { tumbler1.currentIndex = counter % numItens; counter = counter-1 console.debug(incTimer1.counter + " " + tumbler1.currentIndex) } } MouseArea { id: playArea anchors.fill: parent onPressed: { incTimer1.startIndex = incTimer1.counter incTimer1.counter = 5*incTimer1.frequency + Math.floor(Math.random() * numItens) // 5 seconds + X variable time console.debug(incTimer1.counter) } } } }
  • Is it possible to queue events in QML?

    Solved
    4
    0 Votes
    4 Posts
    558 Views
    GrecKoG
    Or use StackView, push or replace pages onto it and pop them when needed.
  • MacOS: previous border remains when animating in transparent mode

    Unsolved
    1
    0 Votes
    1 Posts
    119 Views
    No one has replied
  • How use QtGraphicalEffects in Qt6

    Solved
    4
    0 Votes
    4 Posts
    2k Views
    MarkkyboyM
    I've only just started using QT6, for me, just adding the import statement was not enough in my case. I had to use the maintenance tool to add the compatibility module. Notably, there is also no shortcut in Start Menu for the maintenance tool, which can be found in the installation folder of Qt itself.
  • QtQuick.Extras is not working using qt 6.1.3 version

    Unsolved
    2
    0 Votes
    2 Posts
    318 Views
    MarkkyboyM
    https://www.qt.io/blog/qt-extras-modules-in-qt-6
  • This topic is deleted!

    Unsolved
    2
    0 Votes
    2 Posts
    28 Views
  • QML - SwipeDelegate

    Unsolved
    1
    0 Votes
    1 Posts
    206 Views
    No one has replied
  • Qtquick\Qml Arc

    Unsolved arc shape canvas beginner help
    4
    0 Votes
    4 Posts
    3k Views
    ndiasN
    Hi @fallouthase, Please find bellow a simple example using PathAngleArc: https://doc.qt.io/qt-6/qml-qtquick-pathanglearc.html import QtQuick.Shapes Shape { width: 200 height: 200 anchors.top: parent.top anchors.left: parent.left // Enable multisampled rendering layer.enabled: true layer.samples: 4 // Outer gray arc: ShapePath { fillColor: "transparent" strokeColor: "gray" strokeWidth: 20 capStyle: ShapePath.RoundCap PathAngleArc { centerX: 100; centerY: 100 radiusX: 100-20/2; radiusY: 100-20/2 startAngle: 135 sweepAngle: 270 } } // Inner blue arc: ShapePath { fillColor: "transparent" strokeColor: "blue" strokeWidth: 20 capStyle: ShapePath.RoundCap PathAngleArc { centerX: 100; centerY: 100 radiusX: 100-20/2; radiusY: 100-20/2 startAngle: 135 sweepAngle: 180 } } } [image: 512e5cf8-7b1e-4b4c-aa93-d98a1b78f9c0.png] You can also use already implemented customizable QML Circular Slider: https://github.com/arunpkqt/CircularSlider Best Regards