Skip to content

QML and Qt Quick

Looking for The Bling Thing(tm)? Post here!
20.0k Topics 77.3k Posts
  • Location of code referred to in tutorials.

    Unsolved
    2
    0 Votes
    2 Posts
    194 Views
    JKSHJ
    Hi, and welcome! @Nevil said in Location of code referred to in tutorials.: I am working on the "Creating a Qt Quick Application" tutorial through the Qt Creator - Welcome - Tutorials. It asks me to look at the example main.qml. I have searched and googled and can't find where I am supposed to find the code associated with the tutorial. Do you mean this tutorial?: https://doc.qt.io/qtcreator/qtcreator-transitions-example.html Scroll to the bottom of the page. There, you'll find a short list of files. One of them is transitions/main.qml
  • QQmlComponent initialization from C++

    Unsolved
    4
    0 Votes
    4 Posts
    472 Views
    GrecKoG
    @Kwan said in QQmlComponent initialization from C++: i have an application which sets properties of Qml from C++ That smells bad but ok. How are you creating your QQmlComponent? With urls/filename or bytearray data or in an other way? Anyway you could subclass QQmlComponent::beginCreate and set your properties there I believe.
  • PDF display - error in docs?

    Solved
    6
    0 Votes
    6 Posts
    582 Views
    F
    @fcarney Thank you very much. This is very useful information. Im' very surprised to have touched such freshly discussed arguments.
  • QML/Qt3d weird buffer display

    Unsolved
    1
    0 Votes
    1 Posts
    160 Views
    No one has replied
  • Passing Array from C++ to QML?

    Solved
    11
    0 Votes
    11 Posts
    8k Views
    J
    @LeLev and thx for fast response on an old topic :) I just tried it and it does what I need I'm pretty new to Qt. So much to learn. Cheers
  • Why is this 'keyValueList.push(KeyValue{})' code syntax incorrect in qml?

    Solved
    4
    0 Votes
    4 Posts
    405 Views
    ODБOïO
    @mirro said in Why is this 'keyValueList.push(KeyValue{})' code syntax incorrect in qml?: But I don't understand why you can't just assign values but use temporary variables instead? you can, but be aware of https://doc.qt.io/qt-5/qml-variant.html#storing-arrays-and-objects Additionally, since items and attributes are not QML objects, changing the values they contain does not trigger property change notifications. If the above example had onItemsChanged or onAttributesChanged signal handlers, they would not be called when assigning individual entries in either property. If, however, the items or attributes properties themselves were reassigned to different values, then such handlers would be called. @mirro said in Why is this 'keyValueList.push(KeyValue{})' code syntax incorrect in qml?: Also, do I need to free memory in this 'Component.onDestruction'? AFAIK no, because there is automatic garbage collection
  • The service provider does not support the QNavigationManager type

    Unsolved
    1
    0 Votes
    1 Posts
    190 Views
    No one has replied
  • Qml: How to use your own .db file

    Unsolved
    1
    0 Votes
    1 Posts
    255 Views
    No one has replied
  • How to create SwipeView gallery with prev/next pages visible?

    Unsolved
    2
    0 Votes
    2 Posts
    174 Views
    maratoriyM
    I think you should use PathView instead of SwipeView, since the first one is originally intended for your purposes.
  • Numbers are treated as strings - why?

    Solved
    3
    0 Votes
    3 Posts
    231 Views
    P
    Thanks. Problem solved. In code I had line var number = "" and I put this variable as parameter into function.
  • How To Change Color in Listview Delegate ?

    Solved
    3
    0 Votes
    3 Posts
    388 Views
    ?
    I thinks solution is Connections. It's work. ColorOverlay { id: favIconOverlay anchors.fill: favIcon source: favIcon color: getColorCode(id) transform: rotation antialiasing: true Connections { target: favoriteModel function onCountChanged(foo) { var newColor = getColorCode(id) if(newColor === '#ed670e') { favIcon.isFav = true } else { favIcon.isFav = false } favIconOverlay.color = newColor } } }
  • Is there something like class in QtQuick/QML?

    Solved
    2
    0 Votes
    2 Posts
    147 Views
    M
    https://doc.qt.io/qt-5/qml-qtqml-qtobject.html
  • How to add MenuItem dynamically (text is not set)

    Solved
    7
    0 Votes
    7 Posts
    685 Views
    P
    Below full code of Menu with adding and reading menuitem Menu { id: submenuAlarms title: "Alarms" function createMenuItemDefault() { var defaultAlarms = ["30s", "1m", "3m", "5m", "10m", "20m", "30m", "1h"]; var numberOfAlarms = defaultAlarms.length var alarmsItems = [numberOfAlarms]; var index = 0 for (var alarm of defaultAlarms) { console.log(alarm) var item = submenuAlarms.addItem(alarm) item.id = "ID_"+alarm item.triggered.connect(function(){console.log("Value: " + alarmsItems[__selectedIndex])}) alarmsItems[index] = item.text index++ } return alarmsItems } Component.onCompleted: { createMenuItemDefault() } }
  • Call base object method from QML

    Unsolved
    9
    0 Votes
    9 Posts
    1k Views
    KH-219DesignK
    I'm not sure if I understand things with total clarity. However, if I understand, then these both exist in a base class: /* (1) */ Q_INVOKABLE void saveToFile(QUrl url) {saveToFile(url.toLocalFile())}; /* (2) */ Q_INVOKABLE virtual void saveToFile(QString string) = 0; And some QML code is triggering entry/execution into (2) instead of (1). In that case, I wonder why not just remove Q_INVOKABLE from (2) so that it is not-invokable from QML?
  • Qt Quick Websocket and Listview

    Solved
    2
    0 Votes
    2 Posts
    214 Views
    ODБOïO
    hi @NullByte said in Qt Quick Websocket and Listview: Can we update the Listview instantly by QML? Yes, add whatever you want to you ListModel using append method
  • Multiple layers

    Unsolved
    2
    0 Votes
    2 Posts
    554 Views
    sierdzioS
    Each graphical effect is a separate component, you can combine as many of them as you want. If you need to blend them, use Blend component.
  • This topic is deleted!

    Unsolved
    1
    0 Votes
    1 Posts
    7 Views
    No one has replied
  • Open folder on computer QML

    Unsolved
    6
    0 Votes
    6 Posts
    832 Views
    ODБOïO
    hi @Designer23 said in Open folder on computer QML: filedia.setFolder("D:/Users/hp/Doc") I dont see setFolder() mthod here https://doc.qt.io/qt-5/qml-qtquick-dialogs-filedialog.html#methods maybe try filedia.folder = "D:/Users/hp/Doc"
  • QML filters in the table header

    Unsolved qml tableview hdr filter textfield
    1
    0 Votes
    1 Posts
    597 Views
    No one has replied
  • QtQuick Controls 2 Style: Material.background and Universal.background NOT working

    Unsolved
    2
    0 Votes
    2 Posts
    378 Views
    D
    I'm sending also printscreen: [image: 5024d9ca-a876-49b6-9d07-5cae564b22dc.png]