Category : qml

I am creating a subclass of QAbstractListModel called MyModel, these are the role names: QHash<int, QByteArray> MyModel::roleNames() const { QHash<int, QByteArray> names; names[FILE] = "file"; return names; } This class contains a vector of elements that I populate in main: qmlRegisterType<CardsModel>("MyModels", 1, 0, "MyModel"); MyModel my_model; my_model.loadData(); QQmlApplicationEngine engine; engine.setImportPathList( QStringList() << "qrc:///" ); engine.rootContext()->setContextProperty(QStringLiteral("cpp_my_model"), ..

Read more

I’ve encountered an unexpected behavior (for my point of view) of objects from C++ classes created in QML part of application. An example to be clear: The starting point is empty QML application. After that TestEntity class is added: #ifndef TESTENTITY_H #define TESTENTITY_H #include <Qt3DCore> #include <Qt3DExtras> class TestEntity : public Qt3DCore::QEntity { Q_OBJECT public: ..

Read more

On my qml ui most clickable elements (buttons, combo, table entries) are enabled/disabled in respect to the current users access level. The element uses the standard ‘isEnabled’ property for enabling/disabling. The new request is to show a message with the required access level when a disabled element is clicked. One way would be to not ..

Read more

I cloned the vlc repository and I’m trying to modify the qt interface. I stumbled upon this file MainInterface.qml which has a particular line: import org.videolan.vlc 0.1 I can’t help finding this module. I understood it’s related to some other qmldir file but I don’t understand where it might be. Qt Creator doesn’t show me ..

Read more

Any idea why the "Alt+Left" keyboard shortcut doesn’t work in the following snippet? import Qt.labs.platform 1.1 as Labs import QtQuick.Controls 2.15 import QtQuick 2.15 import QtQuick.Window 2.15 ApplicationWindow { width: 400 height: 300 Labs.MenuBar { Labs.Menu { title: "&Control" Labs.MenuItem { text: "Back" shortcut: StandardKey.Back onTriggered: console.log("back") } } } } Source: Windows..

Read more

Qt 6.2.0, Ubuntu 20.04. Here the code of my PathView: PathView { id: view property int item_gap: 60 anchors.fill: parent pathItemCount: 3 preferredHighlightBegin: 0.5 preferredHighlightEnd: 0.5 highlightRangeMode: PathView.StrictlyEnforceRange highlightMoveDuration: 1000 snapMode: PathView.SnapToItem rotation: -90 model: modelContent delegate: DelegateContent { } path: Path { startX: view.width + item_gap; startY: view.height / 2 PathAttribute { name: "iconScale"; ..

Read more

By default when you scroll ListView, instead of changing contentY value immediately instead it runs an animation on property change, can I remove that animation? Also why is ScrollBar top position is not on top of content, but on top of table header? Source: Windows Que..

Read more