Skip to content

QML and Qt Quick

Looking for The Bling Thing(tm)? Post here!
20.2k Topics 77.8k Posts
  • Application Crashing

    Unsolved
    7
    0 Votes
    7 Posts
    253 Views
    S
    @jsulm .core files are generated but we are not able to read it or tranfer it to another device due to boards ifs file system restrictions and remote debugging also can't be enabled as board doesn't have network connectivity and also we can't able to say actual core dump is generated or not.
  • This topic is deleted!

    Unsolved
    1
    0 Votes
    1 Posts
    47 Views
    No one has replied
  • Obtaining window-local position updates for element in ListView delegate

    Solved qml qml c++
    5
    0 Votes
    5 Posts
    174 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; }); }
  • qt qml load assets from apk in android devices

    Unsolved
    6
    0 Votes
    6 Posts
    373 Views
    SGaistS
    Hi, You should add which version of Qt you are using.
  • How to fit Button to icon size?

    Solved
    7
    0 Votes
    7 Posts
    377 Views
    SGaistS
    Damn ! I somehow missed that you were using QML 😅 Sorry for the wrong hints. I am glad that @GrecKo was able to help you
  • Q_PROPERTY Produces TypeError When Setting QQuickWidget ContextProperty

    Solved
    6
    0 Votes
    6 Posts
    442 Views
    D
    Thank you @JKSH this really helped.
  • Qt Quick QML Read Data over Serial Port and Show on GUI

    23
    0 Votes
    23 Posts
    24k Views
    S
    A lightweight, extensible Qt QML-based serial terminal quick start project I use to build custom interfaces, visualize data, and interact with microcontrollers (Arduino/FPGA). https://github.com/shemeshg/LetsGetSerial
  • create Qml sub modules

    Unsolved
    1
    0 Votes
    1 Posts
    91 Views
    No one has replied
  • Using async call results in QML

    Unsolved
    4
    0 Votes
    4 Posts
    224 Views
    K
    Are you aware of the possibility of calling JS callbacks from C++? I use something like this: void Misc::doSomething(const QJSValue& callback) { // do sth async here but make sure to call the callback from the main thread callback.call(); } In QML: Misc.doSomething(() => { console.log("callback!"); }) You can also have arguments in the callback funtion, like for result or error.
  • Get all enum value names from C++ enum definition

    Solved
    5
    0 Votes
    5 Posts
    667 Views
    SebastianMS
    Other solution is ... to create attached properties namespace MessageTypes { Q_NAMESPACE QML_ELEMENT enum class Type { None, SessionOpened, ConfigurationExternal, ConfigurationGet, }; Q_ENUM_NS(Type) inline static const QMap<Type, QString>& typeToString() { static const QMap<Type, QString> map = { {Type::None, "None"}, {Type::SessionOpened, "SessionOpened"}, {Type::ConfigurationExternal, "configuration/external"}, {Type::ConfigurationGet, "configuration/get"}, }; return map; } inline static const QMap<QString, Type>& stringToType() { static QMap<QString, Type> reverseMap = []() { QMap<QString, Type> map; for (auto it = MessageTypes::typeToString().cbegin(); it != MessageTypes::typeToString().cend(); ++it) { map.insert(it.value(), it.key()); } return map; }(); return reverseMap; } } // Attached object type - contains the utility methods class MessageTypesAttached : public QObject { Q_OBJECT QML_ANONYMOUS // Not directly instantiable public: explicit MessageTypesAttached(QObject *parent = nullptr) : QObject(parent) {} // Helper functions Q_INVOKABLE inline static QString toString(MessageTypes::Type type) { return MessageTypes::typeToString().value(type, QString()); } Q_INVOKABLE inline static MessageTypes::Type fromString(const QString& str, MessageTypes::Type defaultValue = MessageTypes::Type::None) { return MessageTypes::stringToType().value(str, defaultValue); } Q_INVOKABLE inline static QStringList getAllTypesName() { return MessageTypes::typeToString().values(); } } // Attaching type - provides access to the attached object class MessageTypesUtils : public QObject { Q_OBJECT QML_ELEMENT QML_UNCREATABLE("MessageTypesUtils is only for attached properties") QML_ATTACHED(MessageTypesAttached) public: explicit MessageTypesUtils(QObject *parent = nullptr) : QObject(parent) {} // Required static method for attached properties static MessageTypesAttached *qmlAttachedProperties(QObject *object) { return new MessageTypesAttached(object); } };
  • This topic is deleted!

    Unsolved
    3
    0 Votes
    3 Posts
    116 Views
  • Installing a reusable component in Visual Studio?

    Unsolved
    2
    0 Votes
    2 Posts
    239 Views
    E
    Adding your component .qml file to qml.qrc file should do the trick.
  • do we have example show how to edit and display sqlite data in tableview in QML?

    Unsolved
    5
    0 Votes
    5 Posts
    262 Views
    GrecKoG
    QSqlTableModel + TableView sounds like what you need
  • Passwordchar property of TextInput as Unicode not supporting in QNX 7.1

    Unsolved
    2
    0 Votes
    2 Posts
    99 Views
    jeremy_kJ
    @IamSumit said in Passwordchar property of TextInput as Unicode not supporting in QNX 7.1: passwordCharacter: qsTr("\u2217") Is translating really the desired goal here? It's an unlikely but possible source of the problem. Does the character in question have a glyph in the font being used by the QNX system, eg can it be displayed via a Text{}?
  • Scaling of QML VideoOutput/ShaderEffect (bilinear vs nearest-neighbour interpolation)

    Unsolved
    3
    0 Votes
    3 Posts
    511 Views
    R
    Hello, do you find the solution? I'm also using the VideoOutput to display my frames and it also becomes blurry. I tried your suggestion: VideoOutput { ... layer.enabled: true smooth: false } But this still doesn't help
  • ComboBox Popup.Window does not receive mouse clicks

    Unsolved
    1
    0 Votes
    1 Posts
    74 Views
    No one has replied
  • 0 Votes
    1 Posts
    179 Views
    No one has replied
  • "currentValue" is a read-only property of ComboBox

    Solved combobox qtquick qml bug
    4
    0 Votes
    4 Posts
    331 Views
    E
    Apparently I was running 6.9.3. Code works in 6.10. Thank you!
  • Setting SphereGeometry pickable leads to QML crashing in QTquick3D

    Unsolved
    4
    1 Votes
    4 Posts
    474 Views
    J
    As a workaround it should be possible to use a built-in #Sphere mesh. You can see more info about the dimensionality here: https://doc.qt.io/qt-6/qml-qtquick3d-model.html#mesh-format-and-built-in-primitives
  • QML Material Implementation

    Solved
    2
    0 Votes
    2 Posts
    162 Views
    R
    qquickmaterialplaceholdertext_p.h