Skip to content

QML and Qt Quick

Looking for The Bling Thing(tm)? Post here!
20.1k Topics 77.8k Posts
  • Obtaining window-local position updates for element in ListView delegate

    Solved qml qml c++
    2
    0 Votes
    2 Posts
    41 Views
    M
    Alright! I found my answer through some indirect googling: Looked up how to detect when an element's ancestry moves, got this answer: https://stackoverflow.com/questions/43869586/in-mousearea-onentered-detect-if-the-cause-is-only-that-the-mousearea-moved-a Which lead me to this answer, which is exactly what I wanted: https://stackoverflow.com/questions/17927714/qml-tracking-global-position-of-a-component Sigh.. I had thought about this solution before, but I was hoping there was a better one. This one requires ancestor traversal, adding listeners, and updating, and that sounds very inefficient. Oh well. If it works, it works
  • qt qml load assets from apk in android devices

    Unsolved
    6
    0 Votes
    6 Posts
    198 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
    178 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
    290 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
    73 Views
    No one has replied
  • Qt Graphs lacking functionalities - Axes range

    Unsolved
    16
    1 Votes
    16 Posts
    998 Views
    AndyBriceA
    @JKSH said in Qt Graphs lacking functionalities - Axes range: Depending on the complexity of your existing code, migration could be simple. Ok, thanks. Can you please describe which part(s) you found more convoluted, and how it could be simplified? It seems to have more classes involved. But it is a while since I looked at QtCharts. Qt Charts has been deprecated, meaning that it will no longer receive new features or minor bugfixes. However, it should continue to be available for the lifetime of Qt 6 (removed from Qt 7). Hopefully, it will still be supported in a Qt6Compat module in Qt 7.
  • Using async call results in QML

    Unsolved
    4
    0 Votes
    4 Posts
    180 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
    598 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
    214 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
    203 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
    74 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
    486 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
    64 Views
    No one has replied
  • 0 Votes
    1 Posts
    121 Views
    No one has replied
  • "currentValue" is a read-only property of ComboBox

    Solved combobox qtquick qml bug
    4
    0 Votes
    4 Posts
    277 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
    446 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
    127 Views
    R
    qquickmaterialplaceholdertext_p.h
  • How to set-up qt qml vscode extension with pyside6?

    Unsolved
    1
    0 Votes
    1 Posts
    90 Views
    No one has replied