Questions tagged [qml]

QML (Qt Modeling Language) is a declarative language that allows user interfaces to be described in terms of their visual components and how they interact and relate with one another. It is a highly readable language, JSON-like syntax with support for imperative JavaScript expressions combined with dynamic property bindings. It can be used to build fluid animated user interfaces that can be connected to any backend C++ libraries.

QML is a declarative language that allows user interfaces to be described in terms of their visual components and how they interact and relate with one another. It is a highly readable language that was designed to enable components to be interconnected in a dynamic manner, and it allows components to be easily reused and customized within a user interface. Using the QtQuick module, designers and developers can easily build fluid animated user interfaces in QML, and have the option of connecting these user interfaces to any back-end C++ libraries.

Resources

11756 questions
3
votes
1 answer

How to hide text in QML TextInput if it is out of bounds

I try to hide the text if it width more then Rectangle id: field. But it does not work "from the box". How can I hide text if the width of text bigger then Rectangle's (where TextInput location) width? Rectangle { id: field …
3
votes
5 answers

How can I organize QML files into nested folders?

I have a sample project at https://github.com/jh3010-qt-questions/qml_location If my hierarchy looks like: $ tree qml_location/ qml_location/ ├── MyDeepComponent.qml ├── MyDeepComponentForm.ui.qml ├── main.cpp ├── main.qml ├── qml.qrc └──…
James Hudson
  • 844
  • 6
  • 19
3
votes
1 answer

Qml ListView dynamic height item transition

I am having a problem with qml listview and dynamic height of items. My task is to show a list of items, that can have a different height value based on a flow item in it. When I use transition, it moves my items on a wrong distance. I am getting…
Korvin
  • 41
  • 4
3
votes
2 answers

Qt5 QML in CLion - QQmlApplicationEngine failed to load component

I'm getting an error while trying to get Qt .qml environment working in CLion, cause I don't really want to use QtCreator: QQmlApplicationEngine failed to load component qrc:/main.qml:2:1: module "QtQuick.Window" is not installed qrc:/main.qml:1:1:…
matez
  • 142
  • 1
  • 11
3
votes
1 answer

QML layer element "reveals" element above it when they overlap

Is it possible in QML, maybe using shader effects with layers, to create an item that makes another item (with a higher z index) visible only when the two layers overlap? I've been messing aroud with OpacityMask and ThresholdMask but have been…
comp1201
  • 407
  • 3
  • 13
3
votes
1 answer

qt qml Object already has a QQmlContext

I want get json file from local and send it to QML using this: #include #include #include int main(int argc, char *argv[]) { #if QT_VERSION < QT_VERSION_CHECK(6, 0, 0) …
Tryliom
  • 895
  • 1
  • 12
  • 37
3
votes
3 answers

How to create DropShadow effect in QML with Qt6?

In Qt5 this was easy with using DropShadow. But in Qt6 the module QtGraphicalEffects is removed. Is there any trick, workaround or maybe new way in Qt6 to create drop shadow around some component?
user123445151156
  • 331
  • 2
  • 10
3
votes
2 answers

How to select a row in TableView (QML)?

In Qt 6, all QtQuick 1 components are removed. I want to rewrite an old application using Qt 6. The application uses the TableView control version 1. How can I select a row in a new control TableView and get the values of all cells in the row?
Compozitor
  • 59
  • 1
  • 12
3
votes
0 answers

Qt, QML and C++: tips to increase compilation speed

I am a Qt developer. I have a very fast Ryzen 3900X and I'm looking for tips to speed up my daily work (faster builds in linux) This is a sample project: full rebuild 24 cores: Elapsed time: 00:38. modify main.cpp: Elapsed time: 00:02. modify…
3
votes
2 answers

Qt6 for Python (PySide6) on Windows 10: can't make QtQml and QtQuick work from QML

On my Windows 10 machine I'm trying few simple examples of new Qt6 and QML based example doesn't work for me. I'm running Python 3.8.6 and a virtual env python3 -m venv venv .\venv\Scripts\Activate.ps1 The pyside6 installs without any warnings into…
3
votes
1 answer

How to create a QVariant-based generic model?

Quite often I find myself in need of some custom scheme model, mandating the implementation of more and more models, made even more tedious by the inability of QObject derived classes to be templates. Qt has the QStandardItemModel but that seems a…
dtech
  • 47,916
  • 17
  • 112
  • 190
3
votes
1 answer

Importing QML from a Resource (QRC) file with PySide2

I have added a simple QML component ("qml/MyButton") to my "resource.qrc" file: qml/MyButton.qml I then compiled the QRC to a python module with: pyside2-rcc -o resource.py…
Aaron
  • 759
  • 1
  • 7
  • 15
3
votes
1 answer

"engine.rootObjects().first()" in main.cpp crashes when main.qml imports over HTTP

We have a line of code that I've been using forever (or longer) to fetch a pointer to the root window. We've recently started importing our components from a server using the HTTP syntax for import. When we put then together, the program crashes,…
Mark
  • 217
  • 2
  • 9
3
votes
1 answer

Why using QQuickWindow::grabWindow() causes a window to turn into an image?

I have a QQuickWidget and want to grab a screenshot using QQuickWindow::grabWindow(). However when I do that the QQuickWindow becomes an image and is not responsive. Below is a minimal reproducible code: The bug is reproducible in Qt5.13 to Qt5.15.1…
SkySoft
  • 133
  • 7
3
votes
1 answer

How to programatically scroll a ScrollView to the bottom?

I've been trying to create a function that programmatically scrolls to bottom a ScrollView using Qt Quick Controls 2. I've tried various options, but much of the support I found online refers to Qt Quick Controls 1, not 2. This is what I've…
Jacob Krieg
  • 2,834
  • 15
  • 68
  • 140
1 2 3
99
100