Questions tagged [qml]

1

votes
1

answer
295

Views

What is the difference between Label and Text in Qt5?

I am new in using Qt creator and QML language. recently I have seen two classes named Label and Text. What is the difference between them? Thanks
Anmk
1

votes
1

answer
54

Views

QML Animation to transition color from bottom to top

I have a login QML page. When the user inputs the code, I have 4 circles in white, and I would like to transition to blue, filling the circle from bottom to top. So basically, I want to animate the color property so it transitions from white to blue when 'isNumberInserted' is true, and just move it...
laurapons
1

votes
2

answer
58

Views

How to use JavaScript libraries on QML

I use some javascript libraries with QML on 5.12.2. Some of them works like Proj4JS. But I get errors when using geographiclib.js library with QML. How can the JavaScript library be imported into QML? main.qml: import QtQuick 2.12 import QtQuick.Window 2.12 import 'geographiclib.js' as MyGeo Window...
Edip Ahmet
1

votes
1

answer
30

Views

Error: Unknown method parameter type: QString&

On C++ side, I had this method: class MyClass : public QObject { Q_OBJECT Q_INVOKABLE QVariant getFamily_byParentName(QString &parentName) const; // ... } I was calling the C++ method on QML: onButtonClicked: { myClass.getFamily_byParentName(items3D.model[0]) // items3D.model[0] is a string } The ab...
user3405291
1

votes
1

answer
31

Views

Collection of QObjects like ListModel

I want to create a list of ShortcutItems as a QObject and add ShortcutItems into that. For example, I have this: #include class ShortcutItem : public QObject { Q_OBJECT Q_PROPERTY(QString title READ title WRITE setTitle NOTIFY titleChanged) Q_PROPERTY(QString action READ action WRITE setAction NOTI...
MoreMag
1

votes
1

answer
35

Views

How to change property of QML item from c++

I am writing a small QT(5.12) application in C++, which will be moving center of QMap every second. I am trying to update the coordinates so the center will refresh, but after debugging it, it's always staying the same (original value). That's my first attempt with QML, so I am helping myself with t...
tomazj
1

votes
1

answer
2.6k

Views

How to connect Python and QML with PySide2?

I want to write a simple desktop application on Ubuntu and I thought that an easy way was to use Qt with QML as GUI and Python as the language for the logic, since I am somewhat familiar with Python. Now I am trying for hours to somehow connect the GUI and the logic, but it is not working. I manage...
Fabian
1

votes
1

answer
37

Views

QML Popup: know how it was closed

I've a QML Popup that I can close by clicking outside of it or by pressing escape (hence default closing policy is fine). However, I need to do different things if the popup is closed with escape (cancel a few things) or by clicking outside (commit the changes). I can't use Dialog, we don't want exp...
Davidbrcz
1

votes
0

answer
151

Views

Dynamically add PropertyChanges to a State in QML

Is it possible to extend or dynamically add property changes to a qml state? For example Item { id: myItem; state: 'opened'; states: [ State { name: 'opened'; PropertyChanges { target: myItem; height: 100; } }, State { name: 'closed'; PropertyChanges { target: myItem; height: 10; } } ] } but later I...
Brian
1

votes
0

answer
157

Views

Handling touch events in a QML game

Part of my game includes a table in which there is a ball rotating. There are also two rectangles like rackets that a player can use for the game. At first I used a simple rectangle with a mouse area filling the racket and some drag properties. It was somewhat fine when I ran the program on my Deskt...
Franky
1

votes
1

answer
550

Views

How to set Value Axis Label Format on QML from milliseconds to mm:ss?

Background I am using QtCreator and I have a file called myScopeView.qml, which represents a scope view similar to the example provided here. In myScopeView.qml, there is a ChartView that is updated every second with a timer so the plot changes values on X axis and Y axis. X axis represents time exp...
titiro89
1

votes
1

answer
262

Views

How to set an item property of one qml from main.qml

I waste my time to find how set the visible property to false, the delegate being in an another qml file. For instance here is a simple example based on Places Map. Marker.qml import QtQuick 2.0 import QtLocation 5.6 MapQuickItem { id: idPointsMarker sourceItem: Loader{sourceComponent: idRect} visib...
kontiki
1

votes
0

answer
191

Views

Qt/QML : XmlListModel not able to read the xml file

I am not able to read a simple xml file using XMLListModel. The below error is shown all times in console. Error FODC0002 in tag:trolltech.com,2007:QtXmlPatterns:QIODeviceVariable:src, at line 1, column 38: Unsupported XML version. XML File: A blog post Sat, 07 Sep 2010 10:00:01 GMT Another blog po...
Prasoon
1

votes
1

answer
206

Views

Qt's FileDialog defaultSuffix not functionning

I'm using the following code to the new property of the filedialog under QtQuick.Dialogs 1.3 & Qt 5.10.0. I've build it using Qt Creator 5.10 default kit. import QtQuick 2.10 import QtQuick.Window 2.2 import QtQuick.Dialogs 1.3 Window { visible: true width: 640 height: 480 title: qsTr('Hello World')...
AlexandreBorowczyk
1

votes
0

answer
97

Views

Qml: overwritten var type property from c++ side gets invalidated

While playing around with accessing qml properties from c++ side I stumbled upon weird behavior. If property type is var and I overwrite property value with different type it gets invalidated when destructor is called. When one overwrites qml objects property value to i.e. QVariant(QString()) value...
Eligijus Pupeikis
1

votes
1

answer
79

Views

Qt Designer can't reference ApplicationWindow size

This is my first post here in stackoverflow so I'm having a hard time even explaining the issue. I started to develop a UI for my App in Qt Designer and the Creator. With concerns for Scalability I design all my app pages to parent the ApplicationWindow widgth and height. This works fine when the ap...
pralima87
1

votes
0

answer
445

Views

QML RTSP Stream from a network camera

I have a question about the RTSP Stream. How can I display a RTSP Stream from a netwok camera in qml? the settings: Qt5.10 Camera: LunaIP L-DA-5203-V2 OS: Windows 7 Things I have tested: QML: Camera, MediaPlayer, VideoOutput Until now I didn't found any things how I can solve it in QML? I am very gr...
Ben
1

votes
0

answer
257

Views

How to load a QML file from plugin in Qt5

I'm trying to develop a plugin model for my app. The idea is simple: I have an interface that all plugins implement. In my app I have special area where plugin would display UI. For step 2 in main application I can use Qml Loader component to load an external QML file. So main.qml looks like this: R...
1

votes
0

answer
134

Views

How to create a tree menu structure in QML Qt Quick?

Like this image in QML I want to create a tree menu in QML. How to do that in QML?
HariP
1

votes
1

answer
96

Views

How to make swipeable TextField in QML?

Here's what I've got: a SwipeDelegate in a ListView and TextField that fills this delegate. When I'm trying to swipe delegate, TextField gets focus, and I'm not able to do it. Here's what I need: to swipe TextField when I'm trying to swipe it and to pass focus only when I'm tapping on it. An exampl...
Dmytro Aviedikov
1

votes
1

answer
1.6k

Views

Qt Virtual Keyboard Custom Style

I need to build a custom Style for a Qt VirtualKeyboard on a small screen to maximize its readability. I have built a custom layout into my project, and using the QT_VIRTUALKEYBOARD_LAYOUT_PATH it works great. The problem I am having is that the documentation states that the custom style must be p...
Kyle Gray
1

votes
1

answer
474

Views

Dynamic validator for TextField / Change validator at runtime

I have small problem/requirement about validators, which i'm currently not able to implement. I have a simple TextField (QtQuick.Control 2) which is decorated with different colors depending on a state. It should also use a different RegExpValidator (with another regular expression) depending on the...
ruuns
1

votes
3

answer
153

Views

QML Image not displaying in Application

I am having trouble displaying a simple image into my application. Here's the main.py: import sys from PyQt5.QtQml import QQmlApplicationEngine from PyQt5.QtGui import QGuiApplication from PyQt5.QtCore import QObject, QUrl if __name__ == '__main__': sys.argv += ['--style', 'material'] app = QGuiApp...
HaR
1

votes
0

answer
971

Views

How to set Google Maps api in QML

I'm having problem probably setting Google Maps Api in my code. My program needs to use google map satellite view and I have to add merkers, draw lines and other stuff like this. This is the code: import QtQuick 2.7 import QtQuick.Controls 1.4 import QtQuick.Window 2.0 import QtLocation 5.6 import Q...
Salvo
1

votes
0

answer
176

Views

macdeployqt not deploying QtQuick modules

I'm using macdeployqt to deploy one QML application to Mac OS and when I finish, with all paths fine and try to execute it from .dmg generated package I can start application. Trying to execute it from term I get a QML error that says QtQuick.Window and other modules are not installed. Any clue abou...
jgd
1

votes
0

answer
349

Views

QML Clip Custom Item

I made my own QQuickItem, which I draw using the updatePaintNode method (using the scenegraph). In a qml File I add this item as a child to a Rectangle: Rectangle { anchors.centerIn: parent width: parent.width/2. height: parent.height/2. border.color: '#000000' clip: true MyItem { id: myitem anchors...
numberCruncher
1

votes
1

answer
176

Views

How to listen for QQuickItem childItem adding

I've created c++ class with QML attached properties to use it in qml. Now I want to add attached property to one QQuickItem object and propagate this attached property for all QQuickItem child items (those which returned by QQuickItem::childItems() not by QObject::children()). I can easily iterate o...
Kamil Zaripov
1

votes
1

answer
85

Views

Is possible set order by bool in QSortFilterProxyModel with setSortRole()?

Hello i have a class Filtro(in english is Filter) that is QSortFilterProxyModel , i have setted her sourceModel with myModel class. myModel class is a QAbstractListModel in this class i have a QList m_recipes; Tile class is this: class Tile { public : Tile (const QString &nameRecipe,const QString &...
pablodepas87
1

votes
0

answer
61

Views

Unable to translate GUI in QML

I have written following code to load .ts file #include #include #include #include #include int main(int argc, char *argv[]) { #if defined(Q_OS_WIN) QCoreApplication::setAttribute(Qt::AA_EnableHighDpiScaling); #endif QGuiApplication app(argc, argv); QQmlApplicationEngine engine; engine.load(QU...
Sanket Joshi
1

votes
0

answer
736

Views

QML ListView - Limit the number of items displayed in the list

I have a ListView ListModel with 10 ListElements, I want the ListView to display the first ListElement from the model. Is there a way to limit the number of ListElement items that are displayed, or select the ListElement to display from an ID in the data? Example ListModel: ListModel { id: homeMenuM...
CLiown
1

votes
0

answer
120

Views

Fullscreen QML application and background RPI touchscreen activity

I am working with QML on RPI. I have a problem with touchscreen. I am using Qt 5.9.1 and connecting RPI with VNC. When I debug my gui applications they are always working fullscreen on touchscreen and I can't see the app window on VNC. I am ok with only working fullscreen and not seeing on VNC but i...
Serkan
1

votes
0

answer
74

Views

QML Canvas: How to use CanvasWindow and CanvasSize properly

I have a qml canvas with many elements, and when I zoom in, the elements needs to redrawn, if the canvas size grows too much, the rendering is delayed and quite visible. I couldnt use the canvassize, canvaswindow properly to render only part of the scene, didnt find any proper examples to use this....
itapadar
1

votes
0

answer
42

Views

qml project: SIGFPE Arithmetic exception

I have application crash on this line, then run app on Android 4.4.2 x86 emulator: QQmlApplicationEngine engine; Exception is: SIGFPE Arithmetic exception emptyQml.pro QT += qml quick CONFIG += c++11 SOURCES += main.cpp qnx: target.path = /tmp/$${TARGET}/bin else: unix:!android: target.path = /opt/$...
pier_nasos
1

votes
0

answer
74

Views

Why Qt signal will not work after use class as property in qml page?

I have a c++ class like below and i used this class after registering that in an qml page and that signals works well in qml page class1.cpp QString Class1::message(){ return m_Message; } void Class1::setMessage(QString m){ m_Message=m ; emit messageChanged(); } void Class1::invokeEvent(){ setMessag...
mohsen
1

votes
1

answer
258

Views

How to do a QML viewer slide itself into the screen

I plan to add a button on flow1 that will make column slide from right to left very fast so I can change some options and then give it ok so it slides back. It's kinda like when you swipe from left to right on Android and it slides a column for you to make chnges. As you can see, I placed the column...
1

votes
0

answer
30

Views

Alarms & Notifications for plasmoids

I'm having a hard time finding any literature or examples on how to write notifications for plasmoids. My plasmoid can so far display notifications and sound alarms when certain conditions are met but i don't know how to: add a 'Dismiss' button to the notification to stop playing a continuous alarm,...
yamahama
1

votes
1

answer
160

Views

Qt (qml): Access Bundle file in Qt for Webview Url in ios?

As i am new in ios development for Qt, i don't have idea to call bundle data file as url for Webview. Note :: Webview doesn't support resource system for url. Took qt minibrwoser example for implementation. Update in .pro file, Added html_file folder as Bundle data: ios { deployment.files = $${PWD}...
Deepak Patel
1

votes
1

answer
76

Views

How translate Message that comes from web service?

I have an qt quick application that works with a web service behind code for qml file here I want get list of book void BookManager::findBook(QString bookName){ QNetworkReply* reply=getRequest('api/Book/Find/'+bookName); connect(reply,SIGNAL(finished()),this,SLOT(getListFinished())); } and here...
mohsen
1

votes
1

answer
27

Views

Creating a complex template?

I want to create a type of slideshow in which the user can hit enter to get the details of that particular item, which are organized in another slideshow. So, my crude template would be something like this: Item { property string label property string icon width: 500 height: 500 Text { text: label...
brandon
1

votes
1

answer
206

Views

QML How to position a child outside it's parent

I am currently working on a Video/Stream Management program for my university. The body of my application is a GridView. I implemented a playbar for each video so I can use my playback functions specifically for each member of the GridView. The Problem now is FullScreen. I couldn't find a showFullSc...
NhatNienne

View additional questions