Skip to content

QML and Qt Quick

Looking for The Bling Thing(tm)? Post here!
20.1k Topics 77.6k Posts
  • No QML Variables and expression inspection for MinGW-LLVM ?

    Unsolved
    6
    0 Votes
    6 Posts
    799 Views
    mzimmersM
    I just tested - it does indeed produce QML console messages. (The output is kind of smashed together, but the content is there.) [image: b7a1823a-dccf-4ead-931f-d2d47df98bf3.png] Thanks for pointing this out, @cristian-adam .
  • Best Approach for Displaying Multiple Camera Streams in Qt 6.9.1 with Microservices

    Unsolved
    10
    0 Votes
    10 Posts
    2k Views
    Ronel_qtmasterR
    @greed_14 Yes. exactly. I have a thread class that gets the streamed image in realtime and send it to the UI. I do not do any copy of the images, as it consumes a lot of memory. I am using ffmpeg for frame streaming and opencv for object detection. For QML it is the same approach. So, each streaming contains a thread for getting streamed images, an image processing alogirithm and memory allocation feature. You should also consider how to run the program on GPU or loading those image in the GPU
  • How I Can Use MapView + ScrollView

    Unsolved
    2
    0 Votes
    2 Posts
    1k Views
    mzimmersM
    I didn't actually test this, but here's one possible approach: MapView { interactive: !scrollView.dragging ScrollView { id: scrollView
  • Observed UI flickering on ARM target

    Solved
    15
    0 Votes
    15 Posts
    3k Views
    P
    Hi @SGaist , I'm encountering a similar issue in our application — there's a brief flicker with a light white background whenever a button is clicked. Here are the details of the machine - Device Information Kernel Version: 6.11.0-24-generic Processor: Intel® Core™ i5-4570TE CPU @ 2.70GHz (4 threads, 2 cores, VT-x supported) Resolution: 3840×2160 @ 60Hz (4K UHD) SOC: Not explicitly listed, but the CPU is part of Intel's Haswell family, typically used in embedded or low-power systems. GPU: NVIDIA Quadro P1000 (GP107GL), professional-grade graphics card with active nvidia driver Display Driver: nvidia Display Interface: X11  OS: Ubuntu 24.04.1 LTS on an x86_64 architecture Qt: QMake version 3.1, Using Qt version 6.5.3 in /opt/Qt/6.5.3/gcc_64/lib Application is developed using qt widgets. Also, how are you starting your application? ./start.sh Are you using something like Wayland? No, it's - x11 What parameters are you using? - QMAKE=/opt/Qt/6.5.3/gcc_64/bin/qmake SHELL=/bin/bash JAVA_HOME=/usr/local/jdk1.7.0_79 cmake=/usr/local/cmake-3.0.0 QT_PATH=/opt/Qt/6.5.3/gcc_64 mico_home=/sect/package/mico_2.3.13.1 mongodb=/sect/package/rpmapkgs/software/mongodb-v3.4.6/bin PWD=/home/local LOGNAME=local XDG_SESSION_TYPE=tty glc_home=/sect/package/libGLC AGLCMSPATH=/home/local/aglcms HOME=/home/local LANG=en_US.UTF-8 QT6_PATH=/opt/Qt/6.5.3/gcc_64 SSH_CONNECTION=10.78.235.154 60587 10.78.235.167 22 CATALINA_BASE=/opt/tomcat SSL_ENABLE=0 LESSCLOSE=/usr/bin/lesspipe %s %s XDG_SESSION_CLASS=user TERM=xterm CATALINA_HOME=/opt/tomcat LESSOPEN=| /usr/bin/lesspipe %s USER=local SHLVL=1 XDG_SESSION_ID=29 QT6_DIR=/opt/Qt/6.5.3/gcc_64/bin/ LD_LIBRARY_PATH=:/opt/Qt/6.5.3/gcc_64/lib:/opt/Qt/6.5.3/gcc_64/lib:/home/local/efps/lib/:/sect/package/mico_2.3.13.1/lib:/sect/package/libGLC/lib:/opt/Qt/6.5.3/gcc_64/lib:/opt/Qt/6.5.3/gcc_64/lib:/home/local/efps/lib/ XDG_RUNTIME_DIR=/run/user/1000 SSH_CLIENT=10.78.235.154 60587 22 DEBUGINFOD_URLS=https://debuginfod.ubuntu.com mysql_lib=/usr/lib64/mysql host=bues3-sun9167 XDG_DATA_DIRS=/usr/share/gnome:/usr/local/share:/usr/share:/var/lib/snapd/desktop PATH=/opt/Qt/6.5.3/gcc_64/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:/home/local/aglcms/bin:.:/home/local/bin:/home/local/aglcms/bin:.:/home/local/.local/bin:/home/local/bin:/home/local/aglcms/bin:.:/usr/lib64/mysql:/sect/package/cmake/bin:/usr/local/cmake-3.0.0:/usr/local/jdk1.7.0_79/bin/java:/opt/tomcat:/opt/tomcat:/sect/package/rpmapkgs/software/mongodb-v3.4.6/bin:/opt/Qt/6.5.3/gcc_64/bin/ DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/1000/bus SSH_TTY=/dev/pts/9 _=/usr/bin/printenv
  • QSyntaxHighlighter with TextEdit, format is not reflecting in TextEdit qml.

    Unsolved
    1
    0 Votes
    1 Posts
    180 Views
    No one has replied
  • Absolute QML newbie lost on alignment on anchors

    Solved
    8
    0 Votes
    8 Posts
    2k Views
    JKSHJ
    You're welcome! Thank you for sharing your journey and your solution. Here are some additional tidbits that might be of interest to you: Anchor default values Items are always placed at their parent's top-left by default. So, you can omit these lines and still get the same result: anchors.top: parent.top anchors.left: parent.left Having said that, you can also keep them for clarity. Label vs. Text Displaying text inside a coloured rectangle is a very common requirement. You can simplify your code by using Label instead (https://doc.qt.io/qt-6/qml-qtquick-controls-label.html ). Add import QtQuick.Controls.Basic and try the following: Label { id: name background: Rectangle { color: "blue" } text: myContactInfo.name font.pointSize: 30 } Label { id: address anchors.top: name.bottom background: Rectangle { color: "green" } text: myContactInfo.address font.pointSize: 15 } Note: One difference is that Label might change your font colour based on your OS settings (e.g. dark mode) Positioners vs. Anchors See https://doc.qt.io/qt-6/qtquick-positioning-layouts.html -- instead of anchoring your 2nd label to the 1st label, you could put them inside a Column: Column { // Quiz (open-book): What is the width and height of this Column? Label { id: name background: Rectangle { color: "blue" } text: myContactInfo.name font.pointSize: 30 } Label { id: address background: Rectangle { color: "green" } text: myContactInfo.address font.pointSize: 15 } }
  • How to implement multiple actions on onClicked [SOLVED]

    Solved mousearea qml signal
    7
    1 Votes
    7 Posts
    5k Views
    SGaistS
    @RokeJulianLockhart hi, This thread is 10 years old and was created with the previous version of the forum software where there was no concept yet of "solved state" hence the [solved] in the title which was how threads were marked at that time. [edit: fixed the resolution]
  • 0 Votes
    11 Posts
    4k Views
    JKSHJ
    @RokeJulianLockhart said in plugin cannot be loaded for module "QtQuick.Layouts": Cannot protect module QtQuick.Layouts 2 as it was never registered QML debugging is enabled...: qml-qt6 ./main.qml works perfectly Great! Thanks for sharing. Just remember that you are bound to your distro's version of Qt 6, so the qml-qt6 tool won't be able to process QML code that uses functionality from newer versions. The tool is also intended as a way to quickly preview *.qml files. It won't be able to handle custom types/classes defined from C++ or Python for example (unless you put your class in a C++ plugin that's formally installed)
  • kde integration

    Unsolved
    4
    0 Votes
    4 Posts
    1k Views
    RokeJulianLockhartR
    I thought seetings "Breeze" would change QQuickControls aspect but I think I'm wrong. @Jim-Gir, yeah: print( "Current QQuickStyle: ", PySide6.QtQuickControls2.QQuickStyle.name() ) PySide6.QtQuickControls2.QQuickStyle.setStyle("Breeze") print( "Current QQuickStyle: ", PySide6.QtQuickControls2.QQuickStyle.name() ) ...returns "Fusion", then "Breeze", yet the controls appear identical regardless, despite them being quite different styles: Fusion Breeze [image: 441c28d5-597c-45c4-abce-c2b44c341273.png] [image: 057417eb-1519-4126-88fb-290f22823792.png] Perhaps, ask at discuss.kde.org/t/1240, or a new thread on that instance? Environment Operating System: Fedora Linux 42 KDE Plasma Version: 6.4.4 KDE Frameworks Version: 6.17.0 Qt Version: 6.9.1 Kernel Version: 6.15.9-201.fc42.x86_64 (64-bit) Graphics Platform: Wayland
  • How to add icon to button?

    Solved
    10
    1 Votes
    10 Posts
    13k Views
    RokeJulianLockhartR
    You can simply set iconName to the the name the icon has in the theme and use iconSource as a fallback. Can anyone provide an example for this? I also want to utilise the system icons, if possible.
  • Resize window to content

    Unsolved
    3
    1 Votes
    3 Posts
    3k Views
    RokeJulianLockhartR
    @KillerSmath, it doesn't for me (versionlessly): [image: 76ffee03-5032-44ac-8fcd-c40f65666fa0.png] If it did, I doubt that stackoverflow.com/questions/45066601 would have been asked (I doubt it's a failure of my compositor).
  • How can I space QML elements based upon text size?

    Solved
    7
    0 Votes
    7 Posts
    717 Views
    RokeJulianLockhartR
    @JKSH, thank you! That provides a direct answer, of which spacing: fontMetrics.averageCharacterWidth appears to be the most general-purpose solution. I'm surprised that the default spacing value is 0 for so many elements, though. Perhaps, KDE's QQuickStyle lacks defaults that it should provide? Regardless, is this generally how spacing is conducted in QML? If so (which I expect), I'll presume that there's some guidance documented about when/where one should utilise such values?
  • 0 Votes
    2 Posts
    652 Views
    JKSHJ
    Hi, and welcome! @Morty56 said in About the position of engine->rootContext()->setContextProperty() and engine->load() resulting SEGFAULT: What I've done is just move one method to another by integrating two functions to resolve this issue. Nothing else has changed. Here is my code. Which part could bring the result of segmentation fault? I am so confused. Your code could contain a race condition, where moving functions around changes the outcome of the race. Check your code using tools like ASan and TSan.
  • Sudden QML system issues not solved by reinstall

    Unsolved
    9
    0 Votes
    9 Posts
    802 Views
    JKSHJ
    @SanderVc said in Sudden QML system issues not solved by reinstall: qrc:/qt/qml/org/kde/breeze/impl/Theme.qml:10 QtObject is not a type Looks like your project incorporates external KDE types. How do you add them to your project? Please show us your *.pro/CMakeLists.txt file where this happens. For further debugging, set the environment variable, QML_IMPORT_TRACE=1 before launching your app.
  • QT 5.10 Expected token `numeric literal' bug

    Solved
    5
    0 Votes
    5 Posts
    6k Views
    RokeJulianLockhartR
    @aurora_ns, your thread is inaccessible to me. As post/824859 explains, qmlscene does not support the shebang. At least, not #!/usr/bin/env -S qml. Removing that remediated that error for me (although merely resurfaced post/830428). If the error is prepended with :1, it should for you.
  • Mitigate "Variable Delegate Size" issue in ListView

    Unsolved
    1
    0 Votes
    1 Posts
    420 Views
    No one has replied
  • ScrollView vs Flickable

    Unsolved
    2
    1 Votes
    2 Posts
    934 Views
    RokeJulianLockhartR
    @MohsenNz, ListView appears to inherit from Flickable, which ScrollView appears to extend: ScrollView provides scrolling for user-defined content. It can be used to either replace a Flickable, or to decorate an existing one. As of Qt-6.0, ScrollView automatically clips its contents if you don't use a Flickable as a child. If this is not wanted, you can set your own Flickable as a child, and control the clip property on the Flickable explicitly. Consequently, their usage isn't 1:1. However, I don't understand what their uses are.
  • When to use ScrollView instead of Flickable + ScrollBar

    Solved scrollview flickable
    2
    1 Votes
    2 Posts
    1k Views
    RokeJulianLockhartR
    @Jkimmy, perhaps follow post/557344. It's a year older, so if anyone does ever respond, it'll be there.
  • This topic is deleted!

    1
    0 Votes
    1 Posts
    5 Views
    No one has replied
  • Map - api key requared

    Solved
    3
    0 Votes
    3 Posts
    669 Views
    SGaistS
    @Mihaill hi, It would be nice to also post here the code you used to fix your issue in case the video is taken down.