Skip to content

QML and Qt Quick

Looking for The Bling Thing(tm)? Post here!
20.1k Topics 77.6k Posts
  • QML TextArea performance with large data buffers

    Unsolved
    6
    0 Votes
    6 Posts
    778 Views
    B
    @afalsa thanks for those links. I have only looked at the first one and skim read it, but it seems like they ended up with a very similar solution to mine. That is reassuring in the sense that there doesn't seem to be a much simpler approach that I missed. I don't recall finding that page when I had the issue, but I suspect I was grappling with it a year or two before that was written.
  • Why is setPreeditText not directly available in QML?

    Unsolved
    3
    0 Votes
    3 Posts
    336 Views
    jeremy_kJ
    According to the documentation, https://doc.qt.io/qt-5/qml-qtquick-virtualkeyboard-inputcontext.html#preeditText-prop: preeditText : string This property sets the pre-edit text. The property isn't marked read-only, indicating that an application can assign to it.
  • a generic qml label for display of an image and a text

    Unsolved
    2
    0 Votes
    2 Posts
    1k Views
    SavizS
    @JoeCFD said in a generic qml label for display of an image and a text: any recommendations for making a generic qml label to display an image and a text? If by "image and text" you mean a label that displays an icon (e.g., SVG) alongside text, you can use the IconLabel type. While there is no official documentation for it, you can view its source code. It allows you to assign text, an icon, and even customize the layout. For example, this is how it is used in a Button: Button { id: control property real radius: 0 implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset, implicitContentWidth + leftPadding + rightPadding) implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset, implicitContentHeight + topPadding + bottomPadding) opacity: control.enabled ? 1 : 0.5 padding: 6 spacing: 6 icon.width: 24 icon.height: 24 contentItem: IconLabel { id: iconLabel spacing: control.spacing mirrored: control.mirrored display: control.display // Controls Layout icon: control.icon // Icon text: control.text // Text font: control.font } } If by "image" you mean PNG or other non-icon image types, your best option is to use an Image type alongside a Text or Label type within a layout. I don’t see any other straightforward approach.
  • 0 Votes
    9 Posts
    733 Views
    A
    I decided to follow Bob's suggestion to replace moveRows with removeRows followed by insertRows and it seemed to work out for me. Thank you all for the suggestions.
  • exclude item inside QML Qt Quick Control from interaction

    Unsolved
    3
    0 Votes
    3 Posts
    332 Views
    M
    Thank you, @GrecKo ! That helped a lot. Just adding it as you suggested didn't work, but in combination with the following on the control level works good. containmentMask: QtObject { function contains (point: point) : bool { return control.contentItem.contains(point) || control.indicator.contains(point) } }
  • qmlRegisterTypeSingleton with contextData error while using PySide6

    Solved
    9
    0 Votes
    9 Posts
    725 Views
    SGaistS
    You're welcome ! You know, inverting lines can happen quickly and innocuously :-) Anyway, now you're back on track.
  • Shadow Mapping not working after porting to Qt 6,8

    Solved
    6
    0 Votes
    6 Posts
    729 Views
    SGaistS
    Thanks for the feedback and bug reports !
  • Ripple effect on material style

    Unsolved qml c++ ripple linux qt quick
    3
    0 Votes
    3 Posts
    1k Views
    N
    I am also facing the same issue. Have you found any solution for this?
  • Regarding dynamic graph creation using Shape qml component.

    Unsolved
    1
    0 Votes
    1 Posts
    201 Views
    No one has replied
  • Passing model data from delegate Loader to component in TableView object.

    Unsolved
    12
    0 Votes
    12 Posts
    894 Views
    J
    @Bob64 Thank you, just using 'type' worked! I knew it would be something simple like this. And @GrecKo thanks for the tip, that looks like a better solution so ill definitely look into it.
  • Which class in Qt Virtual Keyboard handles hardware keyboard input processing?

    Unsolved
    2
    0 Votes
    2 Posts
    256 Views
    SGaistS
    Hi, AFAIK there's no such class. Qt Virtual Keyboard provides an on screen keyboard that is not tied to any hardware. What is your goal ?
  • Cura plugins + beginner Python + out dated QT= ishhh!

    Unsolved
    3
    0 Votes
    3 Posts
    425 Views
    F
    @SGaist Thanks for the reply. I forgot how qt was multi-platform/multi-os. But yeah you have right, I'm running on Windows 10. Now for the crash, it's pretty funny actually. After I've move qt/bin dll into Cura root folder and some Pyd/Pyi... I didn't remember which one, i've to create a kind of cura patch file for.. but anyway.... To say after i've modified cura, i've the same bug into PythonDemo and CuraPlugins. [image: 8b6e6274-f561-4058-9bd1-bb3eda473d9f.png] import os.path from UM.Application import Application from UM.PluginRegistry import PluginRegistry from cura.Stages.CuraStage import CuraStage from PyQt6.QtCore import QUrl #from PyQt6.QtWebEngineWidgets import QWebEngineView class FluiddStage(CuraStage): """Stage for web Interface""" #view = QWebEngineView() def __init__(self, parent = None): super().__init__(parent) Application.getInstance().engineCreatedSignal.connect(self._engineCreated) def _engineCreated(self): self.addDisplayComponent("menu", os.path.join(PluginRegistry.getInstance().getPluginPath("FluiddStage"), "FluiddMenu.qml")) self.addDisplayComponent("main", os.path.join(PluginRegistry.getInstance().getPluginPath("FluiddStage"), "FluiddMain.qml")) My first plugins crash was that I cannot import QWebEngineView and I cannot create QWebEngineView() class instance. Now with cura file patch, I can. Of course I cannot use view.show() it's crash the plugins. The second plugins crash was about QML file. I cannot import nothing, except maybe QtQuick/UM/Cura. And it's where is funny... I seem to have the same problem with my QML demo version since i try to QML the demo. I Cannot import QtWebEngine/QtWebView or whatever into QML file. it's crash demo and plugins. Does I miss something into init.py? Remark demo folder doesn't have.
  • QML Drag and Drop including reordering the C++ model

    Unsolved
    2
    0 Votes
    2 Posts
    328 Views
    M
    Here is a link to the full code: https://mega.nz/file/XQlQECqa#LxhaaqWAmvVyTEFLd3MtnMCnRcmU9glXgZWYC6yyrv4 Based on the article: https://raymii.org/s/tutorials/Qml_Drag_and_Drop_example_including_reordering_the_Cpp_Model.html
  • Why does `required` change the value of a property?

    Solved
    3
    0 Votes
    3 Posts
    376 Views
    GrecKoG
    and do fix it you should do: delegate: MyItem { required property var model mdl: model } (or rename mdl to model in MyItem.qml)
  • QtQuick.VectorImage is not installed

    Unsolved
    1
    0 Votes
    1 Posts
    172 Views
    No one has replied
  • View3D

    Unsolved
    1
    0 Votes
    1 Posts
    150 Views
    No one has replied
  • How to Display Frames in QML from C++ for Real-Time Applications

    Solved
    16
    1 Votes
    16 Posts
    2k Views
    B
    @Wertyus said in How to Display Frames in QML from C++ for Real-Time Applications: Did you experience any latency issues with the QQuickPaintedItem approach when handling high frame rates (e.g., 30 FPS)? I did some initial experiments to test the viability of the general approach and was able to get frame rates above 30fps. Since implementing the real thing, I have not explicitly measured this but it has been good enough for our purposes. In our case, the frames are provided not by a video stream but by a rendering of a 3D model provided by a back end server. Using QQuickPaintedItem was driven by our need to be able to react to mouse events and so on that are fed back to the server. It might be that for your case, treating it as a video stream and using the specialised support for that would be more appropriate. Also, how did you handle buffer updates efficiently when new frames arrived? This is a sketch of the code in the QQuickPaintedItem. Because it's a "pull" approach, it is possible that frames could arrive too quickly for this to display all of them and anything between the last image requested and the current one will have been dropped. void ViewerItem::checkForNewImage() { // Called on timer trigger // Note no significant copying here. // `imageProvider` works on separate thread; `currentImage()` is mutex protected internally std::pair<std::shared_ptr<Image>, int> image = imageProvider->currentImage(); if (image.second != m_currentIndex) { // New image - update the pixmap member m_pixmap.convertFromImage( QImage(image.first->pixelBuffer(), image.first->width, image.first->height, image.first->width*3, QImage::Format_RGB888 ) ); // New image so update index m_currentIndex = image.second; // update() is QQuickPaintedItem member - will call `paint(QPainter*)` on the present class // our implementation of paint() uses `drawPixmap(0, 0, m_pixmap)` update() } }
  • Duplicate items in ListView

    Unsolved
    7
    0 Votes
    7 Posts
    1k Views
    GrecKoG
    They are still visible but they shouldn't be displayed anymore. If not it warrants a bug report
  • How to Dynamically Load Candlesticks in QML

    Unsolved
    2
    0 Votes
    2 Posts
    284 Views
    B
    I wonder if there is a bug in Qt. In the debugger I see count go up on candleSeries each time a CandlestickSet is added, but like you I see nothing on the chart. (I am using Qt 5.15 - so this doesn't seem to be an issue with specific versions.)
  • How to select the role of a QSortFilterProxyModel from QML?

    Unsolved qproxymodel role filter
    2
    0 Votes
    2 Posts
    300 Views
    dheerendraD
    Try something like this. Use the data method of index. bool CustomProxyModel::filterAcceptsRow(int source_row, const QModelIndex &source_parent) const { const QModelIndex sourceIndex = sourceModel()->index(source_row, 0, source_parent); // Some how get the the role you require. const QString filterElement = sourceIndex.data(role).toString(); return(filterElement.toLower().startsWith(m_filterText)); }