Skip to content

QML and Qt Quick

Looking for The Bling Thing(tm)? Post here!
20.0k Topics 77.3k Posts
  • Cura plugins + beginner Python + out dated QT= ishhh!

    Unsolved
    3
    0 Votes
    3 Posts
    362 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
    298 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
  • 0 Votes
    2 Posts
    428 Views
    C
    I have the exact same issue. Were you able to fix it?
  • Why does `required` change the value of a property?

    Solved
    3
    0 Votes
    3 Posts
    305 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
    156 Views
    No one has replied
  • View3D

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

    Solved
    16
    1 Votes
    16 Posts
    1k 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
    953 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
    249 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
    261 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)); }
  • How to use JSONListModel for qml ListView

    Solved
    4
    0 Votes
    4 Posts
    562 Views
    A
    I solved my issue. Here is a more detailed resume of what I did: The problem was that QML_XHR_ALLOW_FILE_READ wasn't set to 1. I received the consol log : Set QML_XHR_ALLOW_FILE_READ to 1 to enable this feature. To avoid this error I have changed my main.py file import os import sys from pathlib import Path from PySide6.QtGui import QGuiApplication from PySide6.QtQml import QQmlApplicationEngine from autogen.settings import url, import_paths os.environ["QML_XHR_ALLOW_FILE_READ"] = "1" if __name__ == '__main__': app = QGuiApplication(sys.argv) engine = QQmlApplicationEngine() app_dir = Path(__file__).parent.parent engine.addImportPath(os.fspath(app_dir)) for path in import_paths: engine.addImportPath(os.fspath(app_dir / path)) engine.load(os.fspath(app_dir/url)) if not engine.rootObjects(): sys.exit(-1) sys.exit(app.exec()) Additionally I have added an import to my ui.qml file: import JSONListModel and changed my source input from JSONListModel { id: jsonModel1 source: "jsonData.txt" query: "$.store.book[*]" } to JSONListModel { id: jsonModel1 source: Qt.resolvedUrl("jsonData.txt") query: "$.store.book[*]" } Which finally worked for me.
  • Dynamic CandleStickSeries not working

    Unsolved
    1
    0 Votes
    1 Posts
    83 Views
    No one has replied
  • Can't dynamically update CandlestickSeries in QtCharts

    Unsolved
    5
    0 Votes
    5 Posts
    323 Views
    K
    Did you solve it?
  • 0 Votes
    4 Posts
    418 Views
    L
    Hi @Pl45m4, thanks for the reply. If you know, can you enlighten me on the main question, being why/when to use qt_add_library over just using qt_add_qml_module? Thanks!
  • Dynamically add buttons to a row and change their text

    Moved Solved
    5
    0 Votes
    5 Posts
    482 Views
    A
    Hello guys, I found more information regarding the designer-developer-workflow, which is described in the Qt Design Studio documentation. I have used Qt Design Studio to design my graphical user interface and Qt Creator for the logic. This means that all visual elements are ui.qml files and the logic code can be found in .qml files.
  • programmatically changing contents of Image source

    Solved
    7
    0 Votes
    7 Posts
    412 Views
    SGaistS
    @mzimmers said in programmatically changing contents of Image source: @SGaist It's interesting that you mentioned QQuickImageProvider - I just began using that a couple days ago. I don't see, though, how I can use it to selectively edit the contents of an SVG. You would pass the color you want as parameter to the image provider, and depending on what you need the image size. There you'll modify the svg text as needed and generate the pixmap to return to the QML side.
  • Current Location on map in Android

    Unsolved
    1
    0 Votes
    1 Posts
    90 Views
    No one has replied
  • Three.js support in Qt 6.7 ?

    Unsolved
    3
    0 Votes
    3 Posts
    245 Views
    SGaistS
    Hi, Sorry, I don't however since it seems you have it working on Qt 5, the simplest would be to try writing a minimal test application using it.
  • Replacement of Canvas3D in Qt 6.7 ?

    Unsolved
    3
    0 Votes
    3 Posts
    253 Views
    B
    This is the only discussion I could find: https://lists.qt-project.org/pipermail/development/2018-August/033523.html
  • windeployqt and VectorImage

    Solved
    3
    0 Votes
    3 Posts
    275 Views
    M
    @SGaist Thank you. I did as you said first for some time ago, when I tried msvc kit, and it didn't work, so I searched and found this confusing topic (https://forum.qt.io/topic/73340/windeployqt-and-qml ) and tried pointing to Qt's qmldir. Then I switched to mingw but continued pointing to Qt's qmldir. Anyway, your answer worked with mingw kit, and msvc turned to be impossible to run even from release folder before the deployment, but that's another story. Thank you very much!