Skip to content

QML and Qt Quick

Looking for The Bling Thing(tm)? Post here!
20.2k Topics 77.9k Posts
  • Acess an element of QList<QObject*> that we exposed to QML

    Solved qml
    7
    0 Votes
    7 Posts
    820 Views
    B
    @J-Hilk thanks you. The list was empty.
  • How to use Date () with GMT Brazil (GMT - 03:00) ??

    Solved
    5
    0 Votes
    5 Posts
    453 Views
    M
    @KroMignon thanks, this solves my problem
  • Exposing C++ model as Q_PROPERTY ?

    Solved qml tableview table table model
    5
    0 Votes
    5 Posts
    2k Views
    B
    Thanks you all. I'll try to do it.
  • Qt MapBoxGL Plugin and MSVC

    Unsolved
    1
    0 Votes
    1 Posts
    180 Views
    No one has replied
  • How to make the width & height of a rectangle change dynamically with text.

    Solved
    2
    0 Votes
    2 Posts
    1k Views
    KroMignonK
    @Circuits To do this, the easiest way is to use TextMetrics. Something like this: Rectangle { property alias text: _label.text implicitWidth: tm.width implicitHeight: tm.height Label { id: _label anchors.centerIn: parent } TextMetrics { id: tm font: _label.font text: _label.text } }
  • Dialog window close when opening another dialog inside

    Unsolved
    3
    0 Votes
    3 Posts
    432 Views
    B
    @J-Hilk here is my code i create a first dialog to a toolBar button. Loader{ id:dlgLoader sourceComponent: diaComp active: false } Component{ id:diaComp Dialog{ id:dialogplan width: paneldev.implicitWidth height: paneldev.implicitHeight title:"Planning" standardButtons: Dialog.Ok | Dialog.Cancel onAccepted:{ plan.addToDatabase(); dialogplan.close() } onRejected: { } PanelContainer{ id:paneldev anchors.fill: parent resizable: false detachable: false collapsable: false size: Style.realPixels(640) TabView{ id:tabView anchors.fill: parent anchors.margins: 2 tabPosition: Qt.TopEdge Layout.minimumWidth: 360 Layout.minimumHeight: 360 Layout.preferredWidth: 480 Layout.preferredHeight: 640 Tab{ title: "Parameters setting" PagePlannification{ } } Tab{ title: "Equipement" } Tab{ title: "Planning" Planning{ } } style: TabViewStyle { frameOverlap: 1 tab: Rectangle { color: styleData.selected ? "gray" :"white" border.color: "black" implicitWidth: Math.max(text.width + 4, 80) implicitHeight: 20 radius: 2 Text { id: text anchors.centerIn: parent text: styleData.title color: styleData.selected ? "white" : "black" } } frame: Rectangle { color: "white" } } } } } } And inside that dialog i create the following one. The problem is when i open it, my first dialog window close automatically. Dialog{ id:dialogPaliers width: 640 height: 480 title:qsTr("Sélectionner les paliers") standardButtons: Dialog.Ok | Dialog.Cancel onAccepted: dialogPaliers.close() PanelContainer{ anchors.fill: parent id:paneldev size: Style.realPixels(300) resizable: false detachable: false collapsable: false Rectangle{ anchors.fill: parent color: "#ffffff" ScrollView{ anchors.fill:parent StretchColumnContainer{ id:container spacing: 20 anchors.top: parent.top anchors.topMargin: spacing Repeater{ id:rep model:spinNumSteps.value StretchRowContainer{ spacing: 200 TextLabel { text: qsTr("Saisr la valeur du palier " + (index+1)) } SpinBox{ id:spinPal minimumValue: 0 maximumValue: 10000 decimals: 2 onEditingFinished: { plan.addValue(spinPal.value,index) } } } } } } } } }
  • Trouble with anchors

    Solved
    2
    0 Votes
    2 Posts
    274 Views
    ODБOïO
    @Circuits hi can margins and offsets help ? https://doc.qt.io/qt-5/qtquick-positioning-anchors.html#anchor-margins-and-offsets
  • QGuiApplication height of the window title bar

    Unsolved
    1
    0 Votes
    1 Posts
    797 Views
    No one has replied
  • (Newbie warning) TypeError, function from backend doesn't exist

    Solved
    3
    0 Votes
    3 Posts
    675 Views
    W
    I've declared them as slots. I am unsure how the slots system works. I've been reading up on it from here. How would i create a signal for the buttons to call the slot? I also wanna apologize for the horrible casing lol
  • How to conditionally disable QML Binding to C++ backend?

    Unsolved
    2
    0 Votes
    2 Posts
    777 Views
    J.HilkJ
    @HiddenNetwork in all honesty, the best/proper way would be by using a Loader component to only load those files that you actually need/want to show. That would take care of the binding issue and increase even more the performance.
  • change offlineStoragePath qml

    Unsolved
    1
    0 Votes
    1 Posts
    196 Views
    No one has replied
  • how to detect idle status

    Solved
    15
    0 Votes
    15 Posts
    4k Views
    S
    @J-Hilk thanks you very much, that's work
  • Font Quick Controls 1

    Unsolved
    2
    0 Votes
    2 Posts
    230 Views
    M
    So I found that I can set renderType: Text.NativeRendering. I use Linux and when I set anti aliasing to gray only the result looks similar. However, I still have the feeling that the quick controls 1 font is more readable than Roboto. Does someone know which font it is?
  • Is there way to create the simplest bar chart?

    Unsolved
    6
    0 Votes
    6 Posts
    3k Views
    N
    Even though this topic is old I want to share the solution which works for me with qt 5.14. I had used the Qt Quick approach from orzel1244 , and by the way want to say thanks him. But afterwords, I managed to solve the "separete color for each bar" topic with StackedBarSeries and some modifications. Final result is bellow : StackedBarSeries { id: barSeries axisX: BarCategoryAxis { id: categoriesAxis } axisYRight: valueAxisY //customize it yourself labelsVisible: true labelsPosition: AbstractBarSeries.LabelsInsideBase } /////////////////////////// function setPoints(pointsTime) { barSeries.clear() categoriesAxis.clear() for (var i = 0; i < pointsTime.length; i++) { barSeries.append(i, [Qt.point(i, pointsTime[i])]) barSeries.at(i).color = calculateColor(...) categoriesAxis.categories.push(i+1) } } [image: 6f9a683a-5e07-455d-8878-242a133f1e06.png]
  • Extract metaData

    Unsolved
    3
    0 Votes
    3 Posts
    997 Views
    S
    @raven-worx can you give me an example i am new to QML and QT?
  • Zero-second Timer doesn't run in qmlscene?

    Unsolved
    5
    0 Votes
    5 Posts
    509 Views
    P
    @J-Hilk so any interval < 16 doesn't make much sense to begin with. Thanks for pointing that out, as it helps in the case that someone is attempting to optimize performance in animations. @LeLev if you need to Trigger immediately, QML Timer has triggeredOnStart bool property you can set to true for the first tick, otherwise an interval of 0ms makes absolutely no sense A zero-second timer would be used for wanting something to execute whenever there is idle time in the event loop. This would obviously lock a graphical application, but can be used effectively in short bursts or for discrete worker tasks, or simply to queue a one-off update after the current GUI job is done for example when you want to initialize a component after onCompleted is finished. In these cases you managing the running property to start and top the timer but leave the interval at 0. This is a common use case, especially when there are a lot of bugs in the built-in Qml types (which is often the case) and you are trying to workaround them. triggeredOnStart does not accomplish this as it starts the timer in the same call as setting running = true.
  • Problem with Math.random()

    Solved
    21
    0 Votes
    21 Posts
    4k Views
    M
    The problem is fixed after updating my BIOS Successfully which updated AGESA to version 1.0.0.3 ABBA @fcarney Yes, it is very annoying one! Thanks Everyone for helping me :)) Special Thanks to @JKSH as he mentioned that the problem is a hardware issue not software one.
  • Problem with QML Map tiles updating

    Unsolved
    1
    0 Votes
    1 Posts
    565 Views
    No one has replied
  • How to use border-color and border-collapse in html table?

    Unsolved
    9
    0 Votes
    9 Posts
    4k Views
    JonBJ
    @JKSH Damn good point :) Couldn't see the wood for the trees....
  • findChild and loader

    6
    0 Votes
    6 Posts
    1k Views
    B
    @maxwell31 It sounds like what @rrlopez suggested earlier is the right way to go. You need to expose your data via a C++ model.