qml

QML - Import external JavaScript file

核能气质少年 提交于 2020-01-06 06:59:47
问题 I can import JavaScript files which are already part of the project tree like this: import "myFile.js" as MyFile Is there any way to do this for external files that aren't already included in my project, i.e. by passing an absolute or relative path to the file on my disc? 回答1: For some questions that go like: Is it possible to do something like [this...] usually the easiest way, is to try it out. In your question a important detail is missing: Is the QML file in question in a qrc -file or not

QmlPluginDump errors with 'cannot create a QWidget without QApplication'

一个人想着一个人 提交于 2020-01-06 06:32:11
问题 I am trying to create the plugins.qmltypes file using qmlplugindump as described here. It complains it cannot create a QWidget without QApplication . My folder structure looks like this: ~/imports/ - MyWidget/ - qmldir - MyWidget.dll I run the following command (from ~): qmlplugindump MyWidget 1.0 import --output import/MyWidget/plugins.qmltypes My qmldir file looks like: module MyWidget # name to use in your qml which will use this plugin plugin MyWidget # should match dll name 回答1: To

deploying qt quick application to android fail

大城市里の小女人 提交于 2020-01-06 05:29:27
问题 I'm trying to deploy an application to my android device ( android version 4.4.4 ) and I'm using the kit: Android for armeabi-v7a(GCC 4.9,QT5.8.0) and i get the following error : Invalid json output from qmlimportscanner. 13:19:33: Le processus "D:\Qt5.8.0_android\5.8\android_armv7\bin\androiddeployqt.exe" s'est terminé avec le code 4. Erreur lors de la compilation/déploiement du projet untitled5 (kit : Android for armeabi-v7a (GCC 4.9, Qt 5.8.0)) When executing step "Build Android APK" I don

Render QML without being visible, like a background task

拈花ヽ惹草 提交于 2020-01-06 05:26:06
问题 Suppose I have a map, and a few polygons. I want to render them and take a screenshot of each one of them. If the QQuickView is visible, thats easy. But, how could I achieve this, with the QQuickView not visible , like a background task ? Any ideas? I`m using Qt 5.12. 来源: https://stackoverflow.com/questions/59503641/render-qml-without-being-visible-like-a-background-task

QML: Dynamic view re-ordering in original model

霸气de小男生 提交于 2020-01-06 04:29:06
问题 Implemented QML Dynamic View Ordering by Dragging View Items using this Qt tutorial: QML Dynamic View Ordering Tutorial. Original underlying model is QAbstractListModel descendant in our case. Model stores data in a QList<QObject*> objectList; field type. Works fine, however item ordering changed in proxy DelegateModel only. How to change items order automatically in original underlying model as well for other C++ and QML consumers where order matters? Or I could we otherway access some

Qt 5.5: module “QtAudioEngine” is not installed

亡梦爱人 提交于 2020-01-05 15:36:52
问题 I'm running the official Qt 5.5 SDK on Ubuntu 15.10 and trying to play 3D sounds in QML: import QtAudioEngine 1.0 The project file: qt += multimedia The import statement results in qrc:///Main.qml:1:1: module "QtAudioEngine" is not installed . I'm a bit confused as I can see that the needed libs are in the SDK. What might be wrong here? 回答1: It's a bug in the official Qt SDK : https://bugreports.qt.io/browse/QTBUG-51567 来源: https://stackoverflow.com/questions/35640341/qt-5-5-module

Binding text from a TextField that belongs to a Repeater

℡╲_俬逩灬. 提交于 2020-01-05 10:26:59
问题 My main.qml: Window { visible: true width: 640 height: 480 color: "grey" GridLayout { anchors.fill: parent columns : 2 rows : 2 Repeater { id: rectRepeater model: 3 TextField { text: "hi" } } } Rectangle { id: r1 width: 100 height: 100 x: 200 y: 200 border.color: "red" Text { id: t1 } } Component.onCompleted: { t1.text= rectRepeater.itemAt(0).text } } The Text in the rectangle r1 displays the text at the start, but if I enter new text to the TextField, the rectangle will not be updated. How

Qt application crashes on exit, OS applies “fault tolerant heap shim”

落花浮王杯 提交于 2020-01-05 10:04:15
问题 I can't isolate what is causing the application to crash on exit. What adds further confusion is that it doesn't always crash, sometimes it does, sometimes it doesn't and it seems to be completely arbitrary. The sample basically crates a custom image provider that loads a static google maps API request as a PNG image to show in QML. The image provider itself works, I first suspected that the issue might be with instantiating the network access manager on the stack, but that's not it, I get

Show, change data and keep QQmlListProperty in qml

最后都变了- 提交于 2020-01-05 08:49:08
问题 in the past i resolved a problem with QQmlListProperty for expose c++ qlist to qml, and the problem was resolved, now i try use their solution again, but i can't. the first time the list exposed to qml every time are different, this time no, i have a Qlist in a main class, and many data from her are loaded from db, and others changed in runtime. When the application start, the load of data and exposed to Qml is ok, i need change of page(gui) and keep the data stored in program and probably

IMEI Number In bb 10 Cascades

若如初见. 提交于 2020-01-05 07:37:21
问题 I want to get the imei number In bb 10 cascades.In that path, I need to to add using namespace bb::data; #include <bb/device/HardwareInfo> I have Also Included LIBS += -lbbpim LIBS += -lbbsystem LIBS += -lbbdevice LIBS += -lbbdata files to my project.pro file !!! but I am getting Error message like... - expected namespace-name before ';' token - 'data' is not a namespace-name I want to know why i am getting this error ,how to resolve that Error and I would be hapy if post any code snippet how