Skip to content

QML and Qt Quick

Looking for The Bling Thing(tm)? Post here!
20.2k Topics 77.9k Posts
  • Restore TextInput after invalid input

    Unsolved
    4
    0 Votes
    4 Posts
    53 Views
    jeremy_kJ
    @GrecKo said in Restore TextInput after invalid input: onEditingFinished: m.setData(m.index(index, 0), text) No need to call setData either in 6.9, you can do it with onEditingFinished: model.display = text. Indeed. Simplifying further: ListView { anchors.fill: parent model: m delegate: TextInput { text: display onEditingFinished: display = text } } bool setData(const QModelIndex &index, const QVariant &value, int role) override { auto updated = (role == Qt::ItemDataRole::DisplayRole) ? value.toString().toUpper() : value; if (role == Qt::ItemDataRole::DisplayRole && updated.toString().contains('!')) { return false; } return QStandardItemModel::setData(index, updated, role); }
  • Displaying a GStreamer Video Stream Inside a Specific Area of a Qt Application

    Unsolved
    9
    0 Votes
    9 Posts
    206 Views
    SGaistS
    Give more details about the errors
  • Popup with popupType Qt.PopupWindow disappearing when losing focus on application

    Unsolved
    1
    0 Votes
    1 Posts
    16 Views
    No one has replied
  • 0 Votes
    2 Posts
    89 Views
    J
    Can you explain a bit more detailed what you mean with "combine multiple objects together"? Do you want the objects to be locked together but being able to rotate independently or something? If you simply want to disable collisions between objects you can use https://doc.qt.io/qt-6/qml-qtquick3d-physics-physicsnode.html#filterGroup-prop
  • 0 Votes
    2 Posts
    121 Views
    J
    Is this "Warning: Failed to load image: <path_to_ktx2>" the actual output or have you redacted the path?
  • MediaPlayer does not receive stream metadata.

    Unsolved mediaplayer bug
    8
    0 Votes
    8 Posts
    1k Views
    SGaistS
    @Niclas-Eisenhut hi and welcome to devnet, Can you also confirme this with the latest 6.10 release ?
  • How to use qmlpreview?

    Unsolved qml qmlpreview
    10
    0 Votes
    10 Posts
    164 Views
    R
    @GrecKo Don't you handle key press signals from QML and invoke clearSingletons, clearComponentCache and loadFromModule in main.cpp? That was the impression I got from post #4 where you introduced the enable_qml_hotreload CMake function. Basically, I'm asking: how do you currently do a hot reload with a key press? Minimal working example or a bit more details would be useful since I'm a bit lost in the advice so far. I'm especially interested in your approach since you said that you maintain the same QML in production and for hot reloading: @GrecKo said in How to use qmlpreview?: ...but I believe using Loader is not the correct approach since that's different from the production code you want. In other words, you avoid the QML scaffolding needed for hot reloading (apart from catching the hot reload key press, I guess).
  • How to register a class in a .js file of QML using C++?

    Unsolved
    4
    0 Votes
    4 Posts
    86 Views
    Y
    @Axel-Spoerl I found that the following code works: QQmlApplicationEngine engine; auto ctor = engine.evaluate(R"( (function() { this.name = "test" this.create = function(){ return "hello world!" } }) )"); engine.globalObject().setProperty("OaiClient", ctor); However, I don’t understand what the documentation means when it says that the globalobject properties should not be modified, and I’m unsure what the implications of doing so might be.
  • 1 Votes
    5 Posts
    20k Views
    RokeJulianLockhartR
    @fxam, stackoverflow.com/questions/73475849 might be of interest.
  • onCurrentItemChanged is not called when proxy model is sorted

    Unsolved
    1
    0 Votes
    1 Posts
    40 Views
    No one has replied
  • Updating model from QML delegate

    Solved
    4
    0 Votes
    4 Posts
    76 Views
    GrecKoG
    The first solution works pre 6.10. It puzzles me why the readwrite mode wasn't the default mode from the start though.
  • 0 Votes
    1 Posts
    61 Views
    No one has replied
  • How to use enums from a C++ singleton in another QML plugin (Qt 6, qt_add_qml_module)

    Unsolved
    2
    0 Votes
    2 Posts
    82 Views
    SGaistS
    Hi, AFAIK, if you want to share stuff between different plugins, use a shared library that contains that stuff and link it to both plugins.
  • SortFilterProxyModel and modelData

    Solved
    2
    0 Votes
    2 Posts
    97 Views
    GrecKoG
    @Ashley-Paul You can't, those work based on roles. If your model is a list of QObject* I would suggest using https://github.com/OlivierLDff/ObjectListModel/ or QRangeModel as your model.
  • SwipeView artefacts on resizing

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

    Unsolved
    1
    0 Votes
    1 Posts
    5 Views
    No one has replied
  • QML Repeater with Qt Graphs Invalid Y Values

    Unsolved qabstractmodel qml c++ qml qt graphs repeater
    4
    0 Votes
    4 Posts
    257 Views
    A
    My full code you can look at pastebin, it works for me. For moderators: please look why the system rejects my message? [image: fae470cf-ff66-44ba-b543-ad6d11a3d330.png]
  • Impicit import 'QtQml' of QML module 'QtQuick' not found

    Unsolved
    4
    1 Votes
    4 Posts
    1k Views
    V
    @fixgoats said in Impicit import 'QtQml' of QML module 'QtQuick' not found: @sable I was having a similar issue on Ubuntu as well. I needed to install qml6-module-qtqml and that fixed the warning. Which is odd because the base project compiled just fine before then. Install this package solved it for me (Qt 6.4.2 in Ubuntu 24.04). Thank you!
  • Absence of "QmlHelper" variable on a panel PC

    Unsolved
    2
    0 Votes
    2 Posts
    122 Views
    JKSHJ
    Hi @erenguness, and welcome! I don't recognize QmlHelper or that dialog box. They look like custom components, rather than built-in Qt components. So, please contact the author(s) of your "terminalQML" tool for further help.
  • ML Window/Item Resize Bug: Anchors/Layout not adjusting correctly on window resize

    Unsolved
    6
    0 Votes
    6 Posts
    249 Views
    SGaistS
    What kind of graphics card do you have ?