Skip to content

QML and Qt Quick

Looking for The Bling Thing(tm)? Post here!
20.0k Topics 77.4k Posts
  • Calling method from modelData

    Unsolved
    5
    0 Votes
    5 Posts
    413 Views
    P
    Thank you for helping me understand. Have a nice day
  • What does the third parameter of Flickable::resizeContent() do?

    Unsolved
    7
    0 Votes
    7 Posts
    663 Views
    C
    @jsulm mouseArea is a MouseArea which covers all the screen (because I don’t want the user to need to hover over the listview to be able to zoom). The value of the mapped point is in the range of the ListView and seems to do what it is supposed to do. When hovering on the top left of the listview it’s (0|0), at the bottom right it’s the listviews width and height (middle-ish it might be around (520|400)
  • How to stop GridView resetting its page/position?

    Unsolved gridview
    1
    0 Votes
    1 Posts
    191 Views
    No one has replied
  • Flickable and ScrollBar not working as desired

    Solved
    3
    0 Votes
    3 Posts
    1k Views
    mzimmersM
    I got it working. There were a few things wrong with my original example, but the main problem was I needed to declare the scrollbar differently: Flickable { id: flickable Layout.fillHeight: true Layout.fillWidth: true clip: true contentHeight: equipmentGrid.height GridLayout { id: equipmentGrid ... } ScrollBar.vertical: ScrollBar { policy: ScrollBar.AsNeeded } } } Once I got the scroll bar operational, I needed to add the "clip: true" in order to prevent the flickable from scrolling up over items above the GridLayout.
  • C++ return to QML

    Solved
    6
    0 Votes
    6 Posts
    895 Views
    kshegunovK
    @SPlatten said in C++ return to QML: Can anyone point / help me to a good example / tutorial on using QVariant to construct an object that can be returned to QML ? For your type to be accessible in QML it is either a primitive, a gadget (a.k.a. a value type) or a QObject derived class. No other options are allowed. If it's a primitive - it's directly accessible. If it's a gadget then it must qualify for a metatype and has to have the Q_GADGET macro, (usually) have it registered with qRegisterMetatype if it's a parameter for signal/slot connections, and most importantly be registered with the QML engine with QML_VALUE_TYPE. https://doc.qt.io/qt-6/qtqml-cppintegration-definetypes.html QObject derived types simply have the Q_OBJECT macro and the QML_ELEMENT annotation. Either way you should declare the available properties with Q_PROPERTY.
  • how is this not a binding loop?

    Solved
    3
    0 Votes
    3 Posts
    251 Views
    mzimmersM
    @JoeCFD yeah, I did read that, but I didn't understand it at first. I guess the purpose of a Flickable is more to accept user input than to control the display of its contents? As I mentioned in another thread, I'm still not able to get my Flickable's ScrollBar working, and I thought it might be related to this, but...now I guess not. Thanks...
  • Catching QML runtime exceptions

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

    Unsolved
    2
    0 Votes
    2 Posts
    21 Views
  • "Right" string does not work for indicating right-arrow in Shortcut-Type

    Solved
    2
    0 Votes
    2 Posts
    232 Views
    C
    I found the problem. It was a TextField which I forced active focus on upon completion of a object I used in that window. Removing forcing the focus fixes the problem
  • will the both of the work in same time

    Unsolved
    2
    0 Votes
    2 Posts
    159 Views
    sierdzioS
    What do you mean by "downloading"?
  • How to setup a rectangle like this

    Solved
    5
    0 Votes
    5 Posts
    469 Views
    Y
    Thanks for this I got it how to do it :) This is for those who came this post for similar solution: Rectangle{ color:"transparent" border.color:"#88000000" border.width: 5 x:200 y:200 width:640 height:480 radius:5 Rectangle{ x:parent.border.width width:parent.width-10 y:parent.border.width height:30 color:"#88000000" } } And it's output: [image: cd562bd9-830f-4716-8b47-9c9054ae80f0.png]
  • More complex example. Don't work

    Solved
    9
    0 Votes
    9 Posts
    483 Views
    K
    I change some data organization logic. And now I can show and update my charts. I show all channels in one chart (similar to https://forum.qt.io/topic/140468/periodically-update-data-in-qml-solved/4, but model = numberOfHub*8) After generating dates from all channel I update corresponded Hub. void HubSet::setLatestChannelData(QList<double> newLatestChannelData) { m_latestChannelData = newLatestChannelData; int j=0; QList<double> temp_8_sized; for (int i = 0; i < 8*m_hubset.count(); ++i) { temp_8_sized.append(m_latestChannelData[i]); if (((i+1) % 8)==0) { m_hubset[j]->setChannelData(temp_8_sized); j++; temp_8_sized.clear(); } } emit latestChannelDataChanged(); } ..... protected: QList<Hub *> m_hubset;
  • Is it possible to dynamically assign a component?

    Solved
    17
    0 Votes
    17 Posts
    1k Views
    kshegunovK
    @mzimmers said in Is it possible to dynamically assign a component?: @kshegunov thanks for the suggestions. I'm curious why you think it would be better to use sourceComponent instead of source. It's much more flexible. I can define the component in the source of the user file (the QML that uses the above), or I can instantiate it from a QML file by name, or - god forbid ;) - expose it from C++ ... e.g. Component { id: someComponent ComboBox {} } MyTile { delegate: someComponent opened: true titleText: "whatever" }
  • This topic is deleted!

    Unsolved
    1
    0 Votes
    1 Posts
    7 Views
    No one has replied
  • Track GPS route in QML and remove previous marker

    Unsolved
    2
    0 Votes
    2 Posts
    343 Views
    D
    Hello, as a clarification in case you have any ideas, this is what I try to achieve: https://www.youtube.com/watch?v=-OcEpGMBNzg
  • QML JS function return type `void`

    Unsolved
    6
    0 Votes
    6 Posts
    2k Views
    P
    @JonB said in QML JS function return type &#x60;void&#x60;: @paulmasri One thing: that looks like a warning in the code editor parser. Does it cause any problem/generate an error when you run the code? Warnings are yellow, errors red in my setup. Yes it does cause build errors, not just Qt Creator syntax errors. (Good question though as sometimes qmllint is not correct in Qt Creator.)
  • Unknown component. (M300) for inline components

    Unsolved
    1
    0 Votes
    1 Posts
    185 Views
    No one has replied
  • QT charts extremely slow - QLineSeries

    Solved qtchart qtcharts qlineseries python
    25
    0 Votes
    25 Posts
    8k Views
    fcarneyF
    "append" causes a redraw. There is no way to disable the redraw that I can find. The QML api for charts is kinda crappy for adding data points. Which is why I had to use "replace" in C++. I have done thousands of points this way and it doesn't cause delays in the UI interface.
  • Keyboard concept

    Unsolved
    1
    0 Votes
    1 Posts
    139 Views
    No one has replied
  • How to create multiple rectangles with Scene Graph?

    Unsolved
    2
    0 Votes
    2 Posts
    336 Views
    GrecKoG
    You don't want to do that in QML ? That would be my advice. A Repeater with a Rectangle as delegate