Skip to content

QML and Qt Quick

Looking for The Bling Thing(tm)? Post here!
20.1k Topics 77.7k Posts
  • TableView struggles

    Unsolved
    2
    0 Votes
    2 Posts
    117 Views
    B
    For keyboard navigation, the documentation says to set the keyNavigationEnabled property to true. This needs at least Qt 6.4. It also says you need to assign an ItemSelectionModel to selectionModel. My recollection is that item selection models and their use are not particularly well documented in QML. See this forum post that might help: https://forum.qt.io/topic/133628/how-to-use-itemselectionmodel-with-tableview. It links to a Stack Overflow question that might also be useful.
  • This topic is deleted!

    Unsolved
    1
    0 Votes
    1 Posts
    9 Views
    No one has replied
  • TableView: ReferenceError: styleData is not defined

    Unsolved
    2
    0 Votes
    2 Posts
    19 Views
    B
    It looks like you are basing your code on an example for the Quick Controls 1 version of TableView, which was deprecated in the final releases of Qt 5 and was removed entirely from Qt 6. The version of TableView that exists in Qt 6 is a completely different implementation and does not use styleData.
  • Error while trying to use svg image

    Unsolved
    2
    0 Votes
    2 Posts
    121 Views
    mzimmersM
    I've used standard SVG files without a problem. Can you post one of your smaller .svg files? I'd like to see what specifically Qt is complaining about.
  • Issue: Transferring a class that inherits QAbstractListModel via QtRO

    Unsolved
    4
    0 Votes
    4 Posts
    130 Views
    SGaistS
    Oh ! Great ! Smple solution :-) Since you have it working now, please mark the thread as solved using the "Topic Tools" button or the three dotted menu beside the answer you deem correct so other forum users may know a solution has been found :-)
  • Howto setup qml android 16kb Pages

    Unsolved
    7
    0 Votes
    7 Posts
    567 Views
    M
    That's useful. Thanks!
  • Qt6: the Qt.labs.qmlmodels library is not imported.

    Solved
    5
    0 Votes
    5 Posts
    161 Views
    W
    @JKSH said in Qt6: the Qt.labs.qmlmodels library is not imported.: The auto-completer might not see the module for some reason, but you can type it out manually. Does that work? Yes, it works! The TableModelColumn now has syntax highlighting! Thank you very much! @JKSH said in Qt6: the Qt.labs.qmlmodels library is not imported.: We recommend omitting the version number. Just write import Qt.labs.qmlmodels Fixed it.
  • Dialog modality ignored

    Unsolved
    5
    0 Votes
    5 Posts
    488 Views
    Q
    Same issue in Qt6.9.2 on Windows 10 IoT 企业版 LTSC 19044.1288
  • TableView refuses to show in the UI

    Unsolved
    2
    0 Votes
    2 Posts
    182 Views
    jeremy_kJ
    @gsal said in TableView refuses to show in the UI: I am at a loss, here, any hints? tests? Look for the usual stuff. In no particular order: Remove everything believed to be extraneous (window titles, scroll bars, unused imports, non-trivial dummy data, ...), until the problem goes away. Reintroduce the last change, and remove everything else extraneous. Keep going until the absolute minimum is reached. Post that if the answer still isn't obvious. Check the return value of functions, and the existence/lifetime of objects. Does XYZTableModel refer to a valid object? Does QUrl.fromLocalFile(filename) return the expected url? Does the content of the url's target match what is expected? QML and Qt in general has a bias toward types starting with an upper case letter, and properties starting with lower case. Violating that custom can have unexpected results. (There are exceptional cases...) Turn on categorized logging and run the program via something that logs or displays standard error. Avoid context properties.
  • QML Binding Triggers Unnecessary Initial Assignment with Same Value

    Solved
    2
    0 Votes
    2 Posts
    115 Views
    jeremy_kJ
    This would be easier to discuss with a minimal working example. There's a lot of room for misinterpretation with natural language. In general, the QML engine invokes a property setter during initialization on assignment any time a component of a binding emits a changed signal It's the responsibility of property setters to recognize and ignore duplicate or otherwise invalid inputs. class Object : public QObject { Q_OBJECT Q_PROPERTY(int prop MEMBER m_prop WRITE setProp NOTIFY propChanged) int m_prop = 1; int m_max = 5; signals: void propChanged(); public: void setProp(int newValue) { if (newValue == m_prop || newValue > m_max) return; m_prop = newValue; emit propChanged(); } };
  • How to get current theme color ?

    Unsolved theme color qml
    10
    1 Votes
    10 Posts
    4k Views
    RokeJulianLockhartR
    @QtTester, I think I'd misunderstood, too... Thanks.
  • Windows - qt_add_qml_module failed to load the plugin

    Solved
    5
    0 Votes
    5 Posts
    625 Views
    Q
    @dheerendra can you show some demo source? I don't konw how to write qml plugin and use the component in app.qml, thank you .
  • This topic is deleted!

    Unsolved
    1
    0 Votes
    1 Posts
    33 Views
    No one has replied
  • Qt6.8 + CMake : <Unknown File>: No module named "IMClient" found

    Solved
    6
    0 Votes
    6 Posts
    702 Views
    JKSHJ
    Hi, and welcome! @Lopher said in Qt6.8 + CMake : <Unknown File>: No module named "IMClient" found: I'm uncertain whether this is a sustainable solution and if it aligns with proper practices." For the cleanest solution: Use qt_standard_project_setup(REQUIRES 6.8) in your top-level CMakeLists.txt -- this automatically applies QTP0001 and QTP0004, so you don't need to set them manually Don't set a custom RESOURCE_PREFIX Don't call addImportPath() Don't put your QML files on a specific place on disk -- let your app load it from the embedded resources instead Give your main *.qml file a name that starts with an uppercase letter (so Login.qml, not login.qml) Now, you can call engine.loadFromModule("IMClientQml", "Login"); Note: The whole point of introducing QTP0001 was to avoid the need for RESOURCE_PREFIX and addImportPath() For further troubleshooting, call the following and inspect the output: qDebug() << "Import paths:" << engine.importPaths(); qDebug("### Resources ###"); QDirIterator qrc(":", QDirIterator::Subdirectories); while(qrc.hasNext()) qDebug() << qrc.next();
  • Qt6.8 + CMake: QML components cannot find qrc resources built by qt_add_resources

    Solved
    2
    0 Votes
    2 Posts
    121 Views
    Christian EhrlicherC
    @Lopher said in Qt6.8 + CMake: QML components cannot find qrc resources built by qt_add_resources: Cannot open: qrc:/icons/close.svg Because they are not there as you can see here: qt_add_resources(IMClientResources "IMClientSvg" PREFIX "/icons" FILES resources/images/close.svg They are in :/icons/resources/images/close.svg
  • Qt SVG : Dynamic Modification

    Unsolved
    24
    0 Votes
    24 Posts
    4k Views
    EskilE
    The new svgtoqml tool and VectorImage component might be interesting for this. This will convert the SVG to QML code. The rendering will then be hardware-accelerated (being just Qt Quick under the hood). In addition, since it generates a tree of Qt Quick items with object names based on the IDs given in the source file, it is possible to traverse it using JavaScript and change properties on specific items as the original post here requested. Some more details can be found in these blogs if you are interested: https://www.qt.io/blog/vector-graphics-in-qt-6.8 https://www.qt.io/blog/animated-vector-graphics-in-qt-6.10
  • 0 Votes
    7 Posts
    247 Views
    SGaistS
    @DesiVideoGamer hi, Your class does not: inherit from QObject include the Q_OBJECT macro Hence there's no reason for moc to be doing anything.
  • DelegateModel DelegateModelGroup under the hood

    Unsolved
    2
    0 Votes
    2 Posts
    300 Views
    R
    @kkoehne sorry for tagging you, but do you know anything about that?
  • FontLoader: Cannot load font - Solution

    Solved
    1
    1 Votes
    1 Posts
    158 Views
    No one has replied
  • Setting SphereGeometry pickable leads to QML crashing in QTquick3D

    Unsolved
    2
    0 Votes
    2 Posts
    273 Views
    J
    This sounds like a bug and I think you should report it to https://bugreports.qt.io/