Skip to content
  • 1 Votes
    3 Posts
    209 Views
    A
    That's really helpful. thank you.
  • 0 Votes
    3 Posts
    143 Views
    D
    Thank you very much for looking at this in the first place. The Initializer is an unfamiliar Component I'll be using better. The TableModel however, is something I cannot use. When your provide code works runs by itself, it doesn't produce the error. However, the reason for the initializeXYModel is tied to QAbstractTableModel, not the Repeater or the Instantiator . When I run the XYModelMapper with the TableModel from the Qt.labs.qmlmodels as the model, the error disappears. However, when I use the QAbstractTableModel, the error is thrown with either the Repeater or the Instantiator . Is there a way to have the Instantiator or Repeater work with the QAbstractTableModel as the model property to your knowledge?
  • 0 Votes
    5 Posts
    347 Views
    M
    Bonus question: Would you happen to know how to re-implement this in C++? I tried my best but I don't think my best is good enough haha: #pragma once #include <QQuickItem> #include <qproperty.h> // Item that tracks when its window-local position is changed at any point class PositionTrackingItem : public QQuickItem { Q_OBJECT QML_ELEMENT Q_PROPERTY(QPointF globalPosition READ getGlobalPosition NOTIFY globalPositionChanged BINDABLE bindableGlobalPosition) public: PositionTrackingItem(QQuickItem* parent = nullptr); inline QPointF getGlobalPosition() const { return globalPosition; } QBindable<QPointF> bindableGlobalPosition() { return &globalPosition; } signals: void globalPositionChanged(); private: Q_OBJECT_BINDABLE_PROPERTY(PositionTrackingItem, QPointF, globalPosition, &PositionTrackingItem::globalPositionChanged) }; #include "PositionTrackingItem.h" #include <qproperty.h> // https://forum.qt.io/post/833294 PositionTrackingItem::PositionTrackingItem(QQuickItem* parent) : QQuickItem(parent) { globalPosition.setBinding([&]() { QPointF pos = QPointF(property("x").toFloat(), property("y").toFloat()); for (QQuickItem* item = property("parent").value<QQuickItem*>(); item != nullptr; item = item->property("parent").value<QQuickItem*>()) pos += QPointF(item->property("x").toFloat(), item->property("y").toFloat()); return pos; }); }
  • 0 Votes
    10 Posts
    2k Views
    JKSHJ
    @StudentScripter said in Feedback needed: QML is this the right way to link other QML Files?: removing RESOURCE_PREFIX / is no problem, works still fine, thanks. :D Good to hear, that's what I expected :) There were some changes in Qt 6.5 to make things easier, so you should no longer need to specify RESOURCE_PREFIX unless you want some unconventional structure (which is not recommended) However do you mean changing all mymodules mentions to mymodulesplugin or only this one? I meant only one: target_link_libraries(appQmlLibraryTest PRIVATE Qt6::Quick mymodulesplugin # <-- Like this ) Cause when changing only one it gives me errors. Can you please share the full error message? Without it, it makes it hard to troubleshoot for you. @StudentScripter said in Feedback needed: QML is this the right way to link other QML Files?: Also another question what to do if i wanted to add another subfolder inside my mymodules/ directory? Lets say: mymodules/extras You could create a new QML module (in mymodules/extras/CMakeLists.txt)
  • How to support Vulkan with QML?

    Unsolved QML and Qt Quick vulkan qml c++ shader
    2
    0 Votes
    2 Posts
    746 Views
    SGaistS
    Hi, Are you looking for something like the Vulkan under QML example ?
  • 0 Votes
    2 Posts
    658 Views
    QjayQ
    hey solved using installing following qml packages too sudo apt install qml-module-qtquick-extras qml-module-qtquick-controls
  • 1 Votes
    3 Posts
    1k Views
    F
    @jsulm thanks! I just added target_include_directories(<appName> PUBLIC src) what works well.
  • 0 Votes
    2 Posts
    660 Views
    bibasmallB
    As I understand it, the child should receive the event before the parent, but in my case, the child is deaf. I thought maybe the problem was the size of the child, so I set it equal to the parent size, but it didn't help. I can call mousePressEvent(e) directly for the child in the parent's overload, but it looks like a very bad design. UPD: currentPrimitive_->setKeepMouseGrab(true); allows to pass the event to the child without ugly direct call of mousePressEvent(e) .
  • Ripple effect on material style

    Unsolved QML and Qt Quick 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?
  • Painting images over qml maps

    Unsolved QML and Qt Quick qml qml map qml rendering qml c++ c++ qt
    1
    1 Votes
    1 Posts
    597 Views
    No one has replied
  • How to add C++ QQuickPaintedItem in QML

    Unsolved QML and Qt Quick qt6 qml types qml c++
    4
    0 Votes
    4 Posts
    1k Views
    C
    I am pretty sure you need to register it to the qmlEngine via qmlRegisterType<NotchedRectangle>("My.Items", 1, 0, "NotchedRectangle"); In your main.cpp, then you should be able to use it. (https://www.qt.io/blog/qml-type-registration-in-qt-5.15) In your qml file you can then just type: import My.Items and then you should be able to use NotchedRectangle
  • 0 Votes
    2 Posts
    573 Views
    sierdzioS
    Yes, you can put any QObject-subclass in as a property (use pointers). Also works with Q_GADGETs.
  • 0 Votes
    1 Posts
    523 Views
    No one has replied
  • 0 Votes
    3 Posts
    3k Views
    I
    They both seem like dead projects, nothing you can rely on. grassator/react-qml last commit was Dec 15, 2017 only 1 contributor, only active 4 years ago. ongseespace/react-qml last commit was Mar 26, 2020 had 2 contributors, most active 3-4 years ago. As you may sensed for the extremely few amount of responses before and considering that ReactJS is since many many years one the most prominent JavaScript library in the world, mostly top 1 (https://2021.stateofjs.com/en-US/libraries/front-end-frameworks). It looks not to be in the priority of the Qt strategy. Looking at the architecture of Qt, they seem pretty much incompatible. Qt is a complete stack with a complete e2e experience. Where you don't want to mix other stacks or other frameworks. That also means, I think, you cannot for example create QML based components that are reusable in other frontend stacks, where the backend may be anything else. QML are closed components. So, in other words no support for Web Components specification: https://www.webcomponents.org/introduction which was created to be able to produce reusable components. If anybody, disagrees or have more insights, happy to know about it :)
  • 1 Votes
    8 Posts
    2k Views
    G
    I have picked up QML about three weeks ago and I am liking it very much; I have been implementing some small program with PySide6 and QML and it is a pleasure to program in it, but I do find that I can't find examples; currently, I can't get a TableView to work with the ability to edit values....where can I get some assistance?
  • QT QML realtime chart

    Unsolved QML and Qt Quick qml qml c++ qml binding chartview chart
    5
    0 Votes
    5 Posts
    2k Views
    V
    @J-Hilk Ok that's enough I think. One more question what will happen to scrolleft(). If I keep on incrementing these, will there be any increase in runtime memory or processor load?
  • 0 Votes
    1 Posts
    480 Views
    No one has replied
  • Deployment of QML/C++ app on windows

    Solved QML and Qt Quick qml c++ qml windows windeployqt
    7
    0 Votes
    7 Posts
    3k Views
    K
    @J-Hilk I got it to work with ifw as well. However, the option --plugindir apparently does not work correctly. The plugins were stored in the folder of the exe. However, also the installation using ifw was finally successful.