Questions tagged [qml]

Questions related to the development of QML applications on the Ubuntu environment.

QML coupled with the underlying Qt libraries is a high-level UI technology that enables developers to create animated, touch-enabled UIs and light-weight applications.

Useful links:

352 questions
31
votes
4 answers

How to use Qt Creator with Python?

I want to use Qt for developing Ubuntu desktop, phone and tablet applications but I don't want to learn a new programming language (C++, JavaScript). Is it possible to write Qt application in Python utilizing Qt-Creator as IDE?
Ralf Hersel
  • 2,793
28
votes
1 answer

(QML) Flickable not working as supposed

So, while building an Ubuntu app I needed to use flickable for scrolling, so now I have code of the form Page{ ... Flickable { anchors.fill: parent content.height: element1.height + element2.height ... ... } } When I run it on my…
24
votes
2 answers

How to lock ubuntu device orientation in portrait or landscape from user input?

I am working on a reader app to be used on Ubuntu-Touch. When reading books from the app it would be a helpful feature to lock the orientation in either portrait or landscape. This would be useful when reading in bed sideways. I've tried to use…
19
votes
5 answers

Run system commands from QML App

I want to run a system command from inside my application. It's suppose to run a command on a remote server using SSH. But that's not really the point. The point is that I don't know how to run any kind of command from the app. I asked in the mail…
17
votes
4 answers

How do you check if a property is undefined in qml?

How do you check if a property is undefined in qml? This is what I am trying to do: Button { id: myButton text: if (text === "undefined"){"default text"} }
Anon
  • 12,339
16
votes
1 answer

How to change index in OptionSelector immediately (without animation)?

In my app, I use an OptionSelector to choose from a list of bike stations. I also have a map component with placemarkers for each station. When I tap a placemarker, it also changes the OptionSelector to the index of the corresponding station, as…
13
votes
4 answers

Why Ubuntu.Components 0.1 missing from QTCreator?

First of all i need to create a "hello world" app using QML & QT Creator as described here http://developer.ubuntu.com/get-started/gomobile/ Second, when i was trying to install QML platform and the dependencies i couldn't run the step 2 (of…
CodeArtist
  • 387
  • 1
  • 3
  • 11
11
votes
2 answers

How to use gettext to make QML files translatable

I'd like to write a QtQuick app based on Python (PySide) and QML. I know Qt apps have got their own translation technology, but I would like to stick to gettext for this one. I'd like to know if it's possible to: Mark strings for translation in QML…
10
votes
1 answer

How to emit onDropped in QML drag n drop example?

In the qml documentation there is a drag'n'drop example: import QtQuick 2.0 Item { width: 200; height: 200 DropArea { x: 75; y: 75 width: 50; height: 50 onDropped: console.log("dropped") onEntered:…
xubuntix
  • 5,580
10
votes
1 answer

How to use theming in QML for Ubuntu Phone

The Ubuntu Interface Toolkit Documentations documents Theming for QML Elements with a syntax that is quite similar to CSS. It sounds amazing to me, but I am unable to get started with it. I have tried a lot but I guess I’m missing answers to some…
10
votes
2 answers

How do I dynamically add tab to tabs?

I am trying to add a new tab to the tabs component with the code below. When running there is no error reported but no additional tabs are show. I have tried using both tabs and tabs.__tabsModel as the parent but no additional tabs are show. import…
9
votes
2 answers

Can a single Ubuntu SDK target touch and desktop with separate layouts?

I know that touch apps will run on the desktop with the same UI, but I was wondering if it will be possible for a single Ubuntu SDK app to have a multi-window UI with desktop style UI elements when running in desktop mode, while also providing a…
9
votes
2 answers

Playing Sound with Ubuntu QML Toolkit preview

I've installed the Ubuntu QML Toolkit Preview as per the instructions on http://developer.ubuntu.com/get-started/gomobile/ (with a minor fiddle to get it working on 12.04). I'm trying to write an app that plays a sound file. Aparrently you can do…
8
votes
1 answer

How do you round numbers in qml to two decimal places?

I have these ridiculously long real numbers such as 33.088117576394794, and I am trying to convert them to doubles (Two decimal places). So in this case, I want 33.09. How do you do this in QML?
Anon
  • 12,339
8
votes
3 answers

QML: Simplest way to write to a text file?

QML at the moment lacks basic system commands, so I am looking for the most simple template to write to /tmp/text.txt.
Anon
  • 12,339
1
2 3
23 24