Skip to content

QML and Qt Quick

Looking for The Bling Thing(tm)? Post here!
20.0k Topics 77.4k Posts
  • Help structuring code with QML modules

    Moved Solved
    5
    0 Votes
    5 Posts
    570 Views
    L
    And as a bonus question, I fail to understand why modules are sometimes built as plain modules and sometime as libraries, by adding this (and then linking as a plugin): qt_add_library( StyleModule STATIC ) In that case, also, is this needed in the main.cpp: Q_IMPORT_QML_PLUGIN( StyleModulePlugin ); It works with and without, so I'm missing the point. There are a lot of examples circulating online, for various versions of Qt and all of this has changed quite a lot. The documentation being pretty thick, it's not easy to find up-to-date basic guidelines. Explanation or examples of use cases welcome! Thanks!
  • Qt nested ListView or can I use TreeView

    Unsolved c++ listview treeview qml
    6
    0 Votes
    6 Posts
    6k Views
    C
    bro ur the goat ive been stuck on this for hours, i think the key was wrappping the whole delegate in a component on the qml side
  • Efficient way to draw 2D complicated shape in Qt QML?

    Unsolved
    5
    0 Votes
    5 Posts
    541 Views
    R
    @Asperamanca Sorry for late response, and thanks for your answer, it's helpful, I will try that!
  • fonts not loading in my app

    Moved Unsolved
    4
    0 Votes
    4 Posts
    371 Views
    JonBJ
    @MaximBozek Bear in mind that I don't know anything about QML, only non-QML/widgets Qt. There I would expect to be able to go qDebug() << QFile::exists(":/fonts/Onest-....ttf") (I think that is right for non-QML, you could try on "qrc:/fonts/Onest-....ttf" but I believe the qrc is for QML only) and see it confirm that it can find that resource file at least. Can you do something similar from QML? I don't know that you can use any C++ code so I have to leave it to you). I don't know anything about whether fonts actually have to be installed or not. One would have thought not, they would work from the resource file, but I don't know.
  • Flickable Drag&Zoom

    Unsolved
    1
    0 Votes
    1 Posts
    137 Views
    No one has replied
  • Embedding external application on QML screen in Linux

    Unsolved
    5
    0 Votes
    5 Posts
    526 Views
    Pl45m4P
    @Vermithor said in Embedding external application on QML screen in Linux: These things are helping to bring a new window but unable to run the VS code within the window I don't see the reason why you want to do this... but apparently you haven't read the whole thing. How to embed foreign windows is indeeed described there.
  • This topic is deleted!

    Unsolved
    1
    0 Votes
    1 Posts
    4 Views
    No one has replied
  • Qmlls.exe not find C++ Custom Types

    Unsolved
    3
    0 Votes
    3 Posts
    331 Views
    K
    @chids This doesn't work for me。 I have restarted qmls.exe and cleared CmakeCache。 [image: 9b3dd312-cc49-4f77-9a3c-32e776e0394f.png]
  • 0 Votes
    1 Posts
    806 Views
    No one has replied
  • propagateComposedEvents for MultiPointTouchArea

    Unsolved
    4
    0 Votes
    4 Posts
    351 Views
    johngodJ
    Hi @therealmatiss Since it is not in the MultiPointTouchArea docs it should not be a bug, maybe it just was not developed for it. You can ask about it in the qt dev mailing list and create a feature request in qt bug report https://bugreports.qt.io/secure/Dashboard.jspa. I am a bit work overloaded right now but when I find the time I will try to check qt code and see if this would be feasible to port.
  • Rounded Image in Qt6

    Solved
    10
    0 Votes
    10 Posts
    5k Views
    J
    To anyone seeing this in the future who has the same problem as me with the jagged edges: The problem seems to actually be caused by the smoothstep that the Qt6 MultiEffect uses but the Qt5 OpacityMask doesn't. This is used for the maskThreshold- and maskSpreadAt- properties of MultiEffect. I don't really understand how these properties work, but by recreating this part of the shader in my own project I found out that if the first two elements of mask are about 0 and 1 respectively, the edges will be smooth. By looking into how these values are calculated, I found that setting maskThresholdMin to 0.5 and maskSpreadAtMin to 1.0 reaches basically this and the edges will then be smooth enough TLDR: Set these values in the MultiEffect: maskThresholdMin: 0.5 maskSpreadAtMin: 1.0 Edit: And just to clarify, layer.smooth: true also has to be set on the mask item
  • QTextDocument cannot size or center images

    Unsolved
    3
    0 Votes
    3 Posts
    237 Views
    F
    Yes, I've tried resizing and centering w/ a parent <div>, parent <table><tr><td align="center"> and many other ways... and it seems to respect any other non-<img> element. There's no defaultStyleSheet on the document and no other HTML/CSS beyond the two <img> components. The images are added as resources like such (same QTextDocument as above): document->addResource(QTextDocument::ImageResource, QUrl("derp://img1.png"), img1); document->addResource(QTextDocument::ImageResource, QUrl("derp://img2.png"), img2); And then setHtml sets the following: <html> <body> <img width="50px" height="50px" src="derp://img1.png"/> <img width="50px" height="50px" src="derp://img2.png"/> </body> I've started putting together a new document w/ QTextCursor, but it'd be nice to just use HTML.
  • "qt.qpa.wayland: Wayland does not support QWindow::requestActivate()"

    Unsolved
    12
    0 Votes
    12 Posts
    10k Views
    JonBJ
    @Scotsgeek Yes, you get that with Qt5.x, Ubuntu 22, Wayland. Nothing you can do about it. It's just a warning, that should not stop you porting 5 to 6. As it happens with Qt6.x, Ubuntu 24, Wayland that message does not appear (though I don't think that means requestActivate() does anything). Still plenty of Wayland issues outside Qt, for my part I have made Ubuntu desktop revert to Xorg.
  • ROS2 Humble with QML

    Solved
    3
    0 Votes
    3 Posts
    412 Views
    R
    My conclusion is don't do this because the cmakes is different in both so try to separete it
  • Qt crashes because of a button background

    Moved
    5
    0 Votes
    5 Posts
    430 Views
    K
    The problem wasn't there at all. It was crashing because of a pie chart
  • 0 Votes
    5 Posts
    480 Views
    JoeCFDJ
    @Deep-Patle Sorry I misread your post. To implement speech-to-text in C++, you can leverage speech recognition APIs or libraries such as Google's Speech-to-Text API, Microsoft Azure Speech API, or open-source libraries like pocketsphinx or deepspeech
  • TextField: "floating" label on top of field

    Moved Unsolved
    2
    0 Votes
    2 Posts
    225 Views
    GrecKoG
    The Qt Quick Controls Material Style implements this for the placeholderText of TextField.
  • Usage of ArcGis to trace vehicle path

    Unsolved
    3
    0 Votes
    3 Posts
    359 Views
    F
    @ldanzinger The link is outdated. Current link: https://github.com/Esri/arcgis-maps-sdk-samples-qt/blob/main/CppSamples/Maps/ShowLocationHistory
  • Qml flickable disable scroll inertia

    Unsolved flickable scrol listview flick smooth
    5
    1 Votes
    5 Posts
    7k Views
    T
    I know it's been a few years, but this might still be helpful to someone :) For me, this approach works: delegate: MyDelegate { MouseArea { id: _mouseArea anchors.fill: parent } Binding { when: _mouseArea.pressed target: _listView property: "interactive" value: false } } With this setup, you should be able to scroll the list view using the scroll wheel. When you perform a press-and-drag gesture, it will disable the scrolling or flicking behavior. Once you release the mouse button, the binding will be restored, making the list view interactive again, so you can scroll with the mouse wheel once more. Even when you have multiple elements (i.e., instantiated delegates), dragging across them won't reset the interactive property until you release the mouse button.
  • How to make round imageas

    Solved
    5
    0 Votes
    5 Posts
    406 Views
    K
    @Markkyboy The whole problem with OpacityMask was QtGraphicalEffects since it is not included in Qt6 but I in a forum I found import Qt5Compat.GraphicalEffects and it now works like following: Rectangle { id: mask anchors.left: parent.left anchors.leftMargin: 15 width: 50 height: 50 radius: 25 clip: true } Image { id: storeIcon anchors.fill: mask source: "qrc:/image.png" fillMode: Image.PreserveAspectCrop layer.enabled: true layer.effect: OpacityMask { maskSource: mask } }