Skip to content

QML and Qt Quick

Looking for The Bling Thing(tm)? Post here!
20.0k Topics 77.4k Posts
  • ListView: disable auto selection

    Solved
    4
    0 Votes
    4 Posts
    915 Views
    M
    @KroMignon Thank you, it works
  • Passing a variable to a CircularGauge object.

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

    Unsolved
    1
    0 Votes
    1 Posts
    12 Views
    No one has replied
  • DelegateChooser not working with TableView and QStandardItemModel

    Unsolved
    5
    0 Votes
    5 Posts
    1k Views
    strahlexS
    I'm seeing the same thing here as well. Has anyone reported it as bug?
  • Qml TextEdit Custom key event not processed properly

    Solved
    2
    0 Votes
    2 Posts
    222 Views
    C
    Seems like I have to write event.accepted = false and then it works
  • QSortFilterProxyModel sub-class registration and instantiation issue.

    Solved
    2
    0 Votes
    2 Posts
    314 Views
    SiN_BizkitS
    Maybe it will help someone. This code fixed the issue: #if (QT_VERSION >= QT_VERSION_CHECK(5, 14, 0)) qmlRegisterAnonymousType<QAbstractItemModel>(uri, 1); #else qmlRegisterType<QAbstractItemModel>(); #endif
  • 0 Votes
    2 Posts
    237 Views
    oria66O
    For the record, I used custom getters of the model, with the current index of the Listmodel.
  • QML TreeView using only QtQuick 2 works fine?

    Solved
    5
    1 Votes
    5 Posts
    2k Views
    jsulmJ
    @maxwell31 What exactly do you mean? Do you want to modify QQuickTreeModelAdaptor? Or why else you would need to "copy"? If you want to modify QQuickTreeModelAdaptor then you have ot make your changes open source (LGPL requirement).
  • Qt Quick emulation crashed. (line 1) error

    Unsolved
    1
    0 Votes
    1 Posts
    157 Views
    No one has replied
  • module "QtApplicationManager" is not installed

    Unsolved
    2
    0 Votes
    2 Posts
    587 Views
    raven-worxR
    @flwwater when you are talking about this QtApplicationManager type, you will need a commercial license of Qt first.
  • Get file name, line number and function name in QML Javascript. How?

    Solved
    9
    1 Votes
    9 Posts
    5k Views
    KH-219DesignK
    @ondrejandrej said in Get file name, line number and function name in QML Javascript. How?: Is there a way to print file name only? Yes and no. These are the tokens accepted by qSetMessagePattern: https://doc.qt.io/qt-5/qtglobal.html#qSetMessagePattern For filename, there is only one choice (the "%{file}" that we have already seen). There isn't anything like "shortfile" or "filebasename" from what I can see. So I can think of two options. (1) you can write your own QtMessageHandler function, as done in this example: https://github.com/qt/qtbase/blob/fcea8e7aa8a/examples/vulkan/hellovulkanwidget/main.cpp#L79 Anything that is logged will get routed to your handler function, and you can get the filename and all the other info from the QMessageLogContext passed to the handler, and you can then have total control over logging. (2) Keep the logging as you have it now (with long file name and file path), and write a separate little bash script (or perl script, or python script) to filter the output whenever you pipe logging info to your script. I guess (2) might not be great if you are looking at the output inside a debugger. Nonetheless, here is an example of what I mean in (2), as demonstrated at a bash prompt... If I launch my app like so: ./app This long line of output appears 2021-04-26 08:33:52 [QT-info][thr:1991]/opt/repositories/client/self/heory/gits/heory/src/app/event_filter.cc(76): this GUI thread is running unblocked. But if I launch it and pipe output through a sed filter: ./app |& sed 's/opt\/repositories\/client\/self\/heory\/gits//' That same log line will shrink to: 2021-04-26 08:33:46 [QT-info][thr:1951]//heory/src/app/event_filter.cc(76): this GUI thread is running unblocked. (Sidenote: in case the |& that I like to call pipepersand is as new to anyone as it is recently new to me, here is a reference on piping in bash with {pipe,ampersand})
  • 0 Votes
    4 Posts
    353 Views
    JKSHJ
    @JL-SABATIER You're most welcome. Happy coding!
  • [SOLVED] Is it possible to conditionally handle a gradient

    4
    0 Votes
    4 Posts
    4k Views
    B
    It worked for me. :)
  • Load image from C++ on QML

    Unsolved
    5
    0 Votes
    5 Posts
    678 Views
    J
    @jeremy_k Thank you for your advice. I have changed few things, but I don't know if I did it in a right way.
  • How to load image using Timer in QML?

    Unsolved
    2
    0 Votes
    2 Posts
    186 Views
    jeremy_kJ
    This is a repost of https://forum.qt.io/topic/125992/load-image-from-c-on-qml/3. Please stick to the original thread rather than repeating the question.
  • Switching visibility of a Rectangle via button

    Solved
    4
    0 Votes
    4 Posts
    1k Views
    A
    Thanks gents, @eyllanesc is it possible to bind the myRectangle visibility to 2 buttons? Something like this: Rectangle { id: myRectangle visible: myButton.checked : myButton2.checked no idea of the correct syntax...
  • [QML] Fixed Popup direction

    Unsolved
    1
    0 Votes
    1 Posts
    184 Views
    No one has replied
  • Adding behavior prevents color change of rectangle

    Solved
    2
    0 Votes
    2 Posts
    298 Views
    ocgltdO
    Seems to be an error in the docs (in an example). Once I used ColorAnimation instead of NumberAnimation it worked.
  • list of images with different sources [Repeater]

    Solved
    2
    1 Votes
    2 Posts
    187 Views
    M
    after perseverence, I ended up finding a good approach. but I stay tuned if there is better: delegate-prop Grid { columns: 1 spacing: 2 Rectangle { color: "red"; width: 200; height: 200; Column { Repeater { id: rep Image { source: modelData } } } } Button { text: "Load" onClicked: { var img = ['https://pbs.twimg.com/profile_images/875749462957670400/T0lwiBK8_400x400.jpg', 'https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcQNWZZEtSli3K3SYZN-Mhsl0WPo_1o6qYQ5ag&usqp=CAU']; rep.model = img } } }
  • Flickable contentY alias in views

    Unsolved flickable property alias mvc
    1
    0 Votes
    1 Posts
    343 Views
    No one has replied