Tag Info

New answers tagged

1

I use QuaZip in the Epub module of Beru. But I've taken a different approach and just compile QuaZip as part of my module. This CMakeLists.txt shows how I did it. I'm not sure if the QuaZip .so is included in the Touch image, or if the apparmor restrictions allow you to use it if it is, so this seemed the safest approach.


2

This property holds the name of the object. The objectName is a QString property of QObject which defaults to an empty QString. You usually set this property when you need to find QML elements from Qt. By this way the signals, properties and functions of a QML element can be accessed from Qt (C++) code. Autopilot tests use this property to introspect your ...


2

1: It's used to lookup objects by name 2: All of them, it comes from QObject 3: It's used by autopilot to introspect your app from test cases 4: I'm not really sure 5: I don't think the id is discoverable from outside tools (like autopilot)


0

QML is definitely a great option for creating 2D games and can save you a lot of time and lines of code compared to other languages. As an example, V-Play (www.v-play.net) is a cross platform 2D game engine based on Qt/QML with many useful V-Play QML game components for handling multiple display resolutions & aspect ratios, an entity & component ...


1

I can only answer to the second part of the question (about the .application file), because I'm not familiar with the services offered by the U1 account. You are correct in that you need an .application file, and you actually also need a .service file as well. Fortunately, it's possible to ship them also with confined applications shipped in a click ...


1

It is not possible with the current list items to change the font. The solution for now would be to use an Empty list item and to add a Label inside where you change the font. We are working on completely new list items which will be much faster to create, and which will be more flexible including the possibility to change fonts.


1

onClicked: { Qt.openUrlExternally("http://bbc.co.uk/"); }


1

Why do you think it does not work? The following snippet of code works correctly for me: import QtQuick 2.0 import Ubuntu.Components 0.1 MainView { id: root width: units.gu(100) height: units.gu(100) Row { id: row spacing: 2 Rectangle { color: "red"; width: 50; height: 50 } Rectangle { color: "green"; ...


1

You can use almost all the javascript syntax in QML (See http://qt-project.org/doc/qt-5/ecmascript.html). The fastest method is Math.round(<NUM> * 100) / 100 But (<NUM>).toFixed(2) works (but is too slow according to this question on SO) The following snippet of code presents both implementations: import QtQuick 2.0 import Ubuntu.Components ...


2

You can use QChart.js - QML bindings for Charts.js (a simple HTML5 Charts javascript library using the canvas element) I forked the project here to support resize events (for a desktop use). I basically need to reset the canvas context to allow resize events to properly redraw the surface with an updated window size (See ...


0

Fixed it. It appears to be that I should not create a ListElement component. Instead, the ListModel should look like: import QtQuick 2.0 import Irc_App 0.1 import "../js/AlertsSettingsFunctions.js" as AlertsSettingsFunction // Using the sounds from the folder ListModel { id: alertsModel objectName: "alertsModel" Component.onCompleted: { ...


1

I think you followed the example given here, but in your case you're trying to connect to the component.statusChanged signal and at the same time expecting to see the finishCreation handler to accept arguments. It's not possible. Once connected to the signal, if emitted it will call finishCreation without arguments. I guess that explains why you're seeing ...


1

In JavaScript/QML, objects are data (variables), with properties and methods. You can also create your own objects. This example creates an object called "results", and adds four properties to it: property var results: {"passed": 15, "failed": 2, "skipped": 1, "IlikeYourQuestions": 1}; You could also add methods to it, but with just a set of properties, ...


3

Try: text: text ? text : "default text" "undefined" is just a string representation of a reference not referencing anything, just like None, or NULL in other languages. === is strict comparison operator, you might want to read this thread: http://stackoverflow.com/questions/523643/difference-between-and-in-javascript


1

I you need to keep the column size, do not use the visible property, prefer to set the Item opacity to 0: Example: import QtQuick 2.0 Rectangle { width: 200 height: 200 Column { /* outer column */ spacing: 10 Text { text: "Column Element"} Column { /* inner column */ x: 10; y: 10 spacing: 10 Rectangle ...


1

To make the KTerminalDisplay instance accessible from QML, you must register it in your main.cpp. Since you're expecting parent to be a QQuickItem, your question is not so simple. After looking at the terminal app, I can propose the following trick: QQuickItem *item = view.rootObject(); KTerminalDisplay * display = (KTerminalDisplay *) item; ...



Top 50 recent answers are included