Questions tagged [qml]

1

votes
2

answer
43

Views

Binding loop on ListView delegate

I have this code , which gives me this error: file:///home/user/qmltests/bindingheight.qml:29:5: QML Pane: Binding loop detected for property 'height' Why would it produce the loop ? And how do I fix this? import QtQuick 2.11 import QtQuick.Controls 2.4 import QtQuick.Layouts 1.11 ListView { width:...
Nulik
1

votes
1

answer
23

Views

QML Window FramelessWindowHint on Linux still resizable

I have the below example: import QtQuick 2.12 import QtQuick.Window 2.12 Window { visible: true width: 500 height: 500 title: qsTr('Hello World') flags: Qt.FramelessWindowHint | Qt.X11BypassWindowManagerHint TextEdit { id: name text: qsTr('text') readOnly: false width: 100 height: 100 anchors.center...
bardao
1

votes
1

answer
16

Views

Accessing TextField from Another QML File

I have two .qml files: CustomText.qml: Item { TextField { id: t1 placeholderText: qsTr('Enter name') } } main.qml: Window { visible: true width: 640 height: 480 title: qsTr('Hello World') CustomText {width: 200; height: 200} Rectangle { id: r1 border.color: 'black' width: 200 height: 200 x:...
John Smith
0

votes
1

answer
19

Views

Displaying pandas dataframe in QML

I have 2 pandas dataframes, one with 6 rows and 7 columns and another one with 21 rows and 12 columns, i would like to display them using QML, while googling i got to know about TableView TableView QML Type. In that example, the data has been entered already in ListElement and it is being shown. Bu...
Techiesoft
0

votes
0

answer
5

Views

PyQt5 and QtMultimedia

I am trying to run a qml project with QtMultimedia and PyQt5. I am on Ubuntu 16.4 and I installed PyQt5 with pip3. When running the following code (with python3), I get an error 'plugin cannot be loaded for module 'QtMultimedia'' (more details below the code) main.py #!/usr/bin/env python # -*- co...
1

votes
2

answer
995

Views

Landscape mode in Qt-Android application

I created a Qt/QML application and ported the application to Android. Now I'm able to run the application on the Android device. I want to fix the orientation mode to Landscape. I manually edited the AndroidManifest.xml and set the android:screenOrientation='unspecified' to android:screenOrientation...
Vineesh TP
0

votes
0

answer
3

Views

How to embed PyQtGraph in QML with a PySide2 Python Backend?

Due to license restrictions I do not want to use QTCharts, so I am looking at PyQtGraph library. I am working with PySide2 and QML. I am having difficulty getting a simple example working using QML because I don't know where to start. How do I embed one of these charts from the Python/Pyside2 backen...
Edwin Fernandez
0

votes
0

answer
5

Views

How to display multiple video from local directory in a QML Project?

I'm trying to play a loop streaming video from local directory in my QML Project. For now I'm using this code for playing one video only, but my goal is to play all the video from my local directory, Can I possibly do that? Video { id: video anchors.right: parent.right anchors.rightMargin: 259 anc...
Double A
1

votes
1

answer
251

Views

How to show QSqlQueryModel in QML?

I want to show QSqlQueryModel in qml TableView but I don't Wan't to create separate QML file for each new query cause I can't create infinite qml files as given here . Also question is not working for me for dynamic number of columns (could be version difference as I am using 5.11) .I just want some...
voldemort
1

votes
1

answer
119

Views

QML progress bar is NOT showing up on UI

I have this QML progress bar: import QtQuick.Controls 2.0 as QQC20 Item { QQC20.ProgressBar { id: progressbar_id visible: false // even if 'true', the progress bar does NOT show up on UI from: editorScene.progressbarMin to: editorScene.progressbarMax value: editorScene.progressbarVal onValueChanged:...
user3405291
0

votes
0

answer
3

Views

View PDF in QML WebView

I would like to view a PDF file in a WebView created in my QML code. I am importing QtWebView 1.1 and setting the url property to the path of the PDF file but I am getting this error: [13044:12820:0314/144814.854:ERROR:in_progress_cache_impl.cc(192)] Cache is not initialized, cannot RetrieveEntry. [...
Chris
1

votes
2

answer
302

Views

RangeSlider onFirstChange non-existent property

I'm using RangeSlider for my project in QML. My range slider code is as follows: RangeSlider { id: rangeSLider first.value: 0.0 second.value: 1.0 anchors.horizontalCenter: parent.horizontalCenter width: 275 onFirstChanged: console.log('Change') } When I run this code, I get an error. The error is:...
test gprs
1

votes
2

answer
3.5k

Views

How can I open second qml page on button click

I use Qt 5.5.0 and Qt Creator 3.4.2 on Mac-book, I want to open second qml on button click, I want to develop application in which login page come and after login control move to next page. I try suggestion of stackoverflow, but still I face problem to open next qml on button click. I tried button2....
Tejas Virpariya
1

votes
2

answer
396

Views

Loader progress takes only 0 or 1 value

I'm loading the Game.qml component using Loader and it works fine. However the onProgressChanged slot is called only once - at the end of the process (when progress takes value 1). GameWindow { ... Loader { id: loader onLoaded: if(item) splashScene.state = 'hidden' onProgressChanged: splashScene.pro...
Paweł Krakowiak
1

votes
1

answer
147

Views

Qml RightToLeft Alignment placeholderText

Greetings Dear Programmers ;)) Im Recently entered the world of Qt programming , I want Text PlaceHolder Align From right to left'm grateful for help Me enter image description here
ErfanProgrammer
1

votes
1

answer
605

Views

Qml property hooks

Suppose there is a Qml type called Test with foo property, it is implemented as follows: Test.qml // Not necessarily QtObject, but derived from QObject QtObject { // Not necessarily var/property, but must behave like property (i.e. be accessible using '.foo') property var foo } And used in the follo...
binzo
1

votes
1

answer
289

Views

DropArea doesn't notify about actions onEntered, onExited, onDropped

I have Rectangle filled with MouseArea which on onPressAndHold() handler reveals second Rectangle and transfers drag action to that Rectangle. The problem is that when I move that second Rectangle over DropArea it doesn't notify about any actions (onEntered, onExited, onDropped). I tried to do this...
hus
1

votes
2

answer
3.4k

Views

QML: Center variable text and image

I need to horizonally center a variable-length text (red box) and an image (yellow box) in a big box (green box). The text shall wrap if it does not fit the box. Existing code: Item { id: bigBox x: 255 y: 0 width: 800 height: 100 Image { id: imageBox source: 'image.png' width: 52 height: 46 anchors....
Alexander Foken
1

votes
1

answer
1.1k

Views

Object to process touch event but also let it through

I want to create an object that will work like MultiPointTouchArea (so it will have touchUpdated signal) but also it would not steal touches, so that objects placed beneath it will receive the touch events as well. The solution may require creating C++ object. Is there a simple way to create such ob...
Filip Hazubski
1

votes
1

answer
1.3k

Views

error: C2248: 'QVariant::QVariant' : cannot access private member declared in class 'QVariant'

I get an unexpected error at the following line: MyClass * myObject = new MyClass; view.rootContext()->setContextProperty('myObject', myObject); with error: error: C2248: 'QVariant::QVariant' : cannot access private member declared in class 'QVariant' But MyClass is just a class I wrote and it doesn...
zar
1

votes
3

answer
469

Views

Global shortcut in QML

I am trying to make an application in QML (Qt 5.5) that is always running and shows up when the user presses alt+space. I have tried using the Action class in QML, but it only works when the window has the focus, not when the window is not visible. I've also tried QShortcut (which is not ideal, sinc...
LtWorf
1

votes
1

answer
660

Views

Error on compile qml-material on windows

How to compile and install the qml-material on windows7 machine ? First of all I clone and compile extra-cmake-modules like below: git clone git://anongit.kde.org/extra-cmake-modules cd extra-cmake-modules mkdir build cd build cmake -G 'MinGW Makefiles' .. After that I run the Make command but w...
X.Strange
1

votes
1

answer
1.2k

Views

QtQuick Dual Screen support

I need In My QtQuick2 application to support multi screen with same resolution. In other word i need to extend my application when i sense secondary screen connected. is it possible in QtQuick2?
sayyed mohsen zahraee
1

votes
1

answer
165

Views

Nested QML element onCompleted's signal not blocking the instanciation of QML objects

Let's say I have a main.qml file: import CustomWidgets 1.0 Item { id: itemId anchors.fill: parent CustomWidget {} Component.onCompleted: // c++ function call } including a CustomWidget coming from another file called CustomWidget.qml: Item { id: customWidgetId anchors.fill: parent // attributes...
Grégoire Borel
1

votes
1

answer
1.9k

Views

How to disable scrolling in a QML ScrollView (or TextArea)

I want to use a QML TextArea on a mobile device, where the user cannot scroll by swiping through the contents. Instead I want the widget to grow with the content (which I can do by utilizing contentHeight). But I am unable to disable the scrolling behavior. TextArea has this scrolling behavior becau...
Nathan
1

votes
1

answer
219

Views

What is wrong with this way of loading C++ QStringList as a model for a QML ListView?

This program fails silently, no message appears in the debug mode or in the release mode, the window does not show, you can see the program.exe running in the task manager though. What is going on ? how to fix it ? why it does fail ? why there is no message appear ? The QML interface file //main.qml...
Raiden Core
1

votes
1

answer
108

Views

TableView row disappears when trying to edit in QML

I am trying to use QML and the TableView component where I want to update the underlying model by editing some text box. My issue is that sometimes the row visually disappears completely from the TableView and appears again after some clicks. This seems to happen randomly and probably when clicking...
Luca
1

votes
1

answer
598

Views

Get return value in QML from Python method

I'm trying to call a Python method from QML and use the return value. QML receives undefined, from the Python method. When passed back to Python it is just an empty string. import sys from PyQt5.QtCore import QObject, pyqtSlot from PyQt5.QtWidgets import QApplication from PyQt5.QtQml import QQmlAppl...
Siecje
1

votes
1

answer
256

Views

How to prevent recreation of page in a loader?

I am developing a Qt app on Win/Android. My question is very simple. When my app starts, first a login page welcomes you. If you want to configure server settings, ServerInfo.qml is opened in a loader. The login page and ServerInfo are loaded in the same loader. My problem is that when I close Serv...
DJ.Yosemite
1

votes
2

answer
1.5k

Views

QML slider tickmark with text at start and end

How to achieve something like this. Should the text thin and thick must be outside slider as labels or can they be part of tickmarks?
Satyam Raikar
1

votes
2

answer
940

Views

QT/QML Android: How to keep an app running when the last windows is closed?

I am developing a work order app for team works on the field. This app listens to server for work order. I want this particular processing : When I close the last window, my app must run in background. Then, if my app catches a work order, it should give the user a notification. Then the user tou...
DJ.Yosemite
1

votes
1

answer
654

Views

QtQuick: Change expand icon in TreeView

I want to exchange the standard expand icon in a TreeView, is that possible? I guess I would need to define states for the image.
Bitte Wenden
1

votes
1

answer
1.4k

Views

How to programmatically set the disabled state color for a qt control?

In the load event of my window, I am accessing the rootObject() (which is a QQuickItem) and using that to get a reference to controls defined in my QML file. I am then using this code to programmatically set/change the control's color: object->setProperty('color', '#3060C0'); This works and does cha...
MusiGenesis
1

votes
1

answer
227

Views

Qt Creator: Why Qt.labs.controls appear as red boxes?

Why Qt.labs controls appear as red boxes on the Qt Creator Designer?
İbrahim
1

votes
2

answer
479

Views

Import an External SQLite database to my project

I'm interested in importing an external SQLite database to my project. When using the QT Quick Local Storage: LocalStorage.openDatabaseSync('QQmlExampleDB', '1.0', 'The Example QML SQL!', 1000000); The problem is that, the program generates a NEW database, and if it's possible I'm interested in open...
carles.sole.grau
1

votes
2

answer
480

Views

Qt TextField is not invoking the keyboard when launched on Android device

I have simple QML app, that shows only one TextField: Rectangle { color: '#00000000' TextField { anchors.centerIn: parent } } I thought, that Android keyboard will be shown automatically, when I touch on TextField, but it's not happening. I tried to use focus, Qt.inputMethod.show(), forceActiveFocus...
0x0000DEAD
1

votes
2

answer
1.1k

Views

How can QML native `date` type be updated?

QML provides a date type that appears to be freely convertible to and from both the C++ QDate class and the QML Date type. The Date type is an extension of the JS Date type. Calling the set methods on a date property is apparently permissible, because no error (e.g. 'method missing') is thrown: // i...
Kyle Strand
1

votes
1

answer
789

Views

Qt5 QML, why are onHeightChanged and onWidthChanged called without change?

import QtQuick 2.5 import QtQuick.Controls 1.4 import QtQuick.Controls.Styles 1.4 import QtQuick.Layouts 1.2 ApplicationWindow { visible: true width: 640 height: 480 property int lastW: 0 property int lastH: 0 function doSomething() { if (lastW == width && lastH == height) console.log('width & heigh...
jkj yuio
1

votes
2

answer
533

Views

How to animate multiple objects in qml

and im trying to animate several objects at once, using sequential animation. For my purposes I need to access it from outside of the sequential animation (and number animation) decleration's. This works fine, but only animates one object at a time when set. If i define a number animation per object...
LeeH
1

votes
1

answer
354

Views

Check if QML file has valid syntax

I am using Qt 5.6 with QML. I receive QML content over network, but before I use it I want to verify that the QML syntax is actually valid. I saw that there is a javascript evaluator, but nothing similar for QML specific code. Anyone done something similar to this?
iQt

View additional questions