Tag Info

Hot answers tagged

12

This isn't something that QML supports, the typical answer is to write a C++ plugin to handle that kind of thing. However, the SDK team is planning out various extensions to provide to QML app developers, and this may be something that they implement in a generic plugin that you can use.


8

Problem solved, the answer is to use QtMultimedia 5.0, which now provides the Audio element. http://qt-project.org/doc/qt-5.0/qtmultimedia/qml-qtmultimedia5-audio.html


8

Well, Qt is owned by Digia, not related to Ubuntu/Canonical. Qt itself is licensed under the GNU Lesser General Public License (LGPL) version 2.1. This allows you to create and redistribute your closed source apps very well, as long as you're dynamically linking to Qt, or adhere to the limitations of statically linking. See also these Q&A on SO: Use ...


7

There will be; we're working on it. I plan to have the QML U1DB declarative API published soon. In the meantime, until that arrives, you may find this code interesting; it is a simple notes app, but written with QML and using U1DB. This U1DB QML addition follows the declarative QML U1DB API I mentioned above, but it's a Python-based prototype of that API. ...


7

These instructions were tested on Ubuntu 12.04, Ubuntu 12.10 both 32-bit and 64-bit. First off we need to install some dependencies. Install these even if you already have Qt5 installed: sudo apt-get install build-essential libgtk2.0-dev libgl1-mesa-dev If you haven't already, download and install the QtSDK from http://qt-project.org/downloads. For ...


7

Update: For 14.04 see the much simplified answer by int_ua. Original Text: At http://talk.maemo.org/showthread.php?t=87580 there is a basic overview of how to add the extension to QML. I decided to give it a shot using the ubuntu-sdk instead, which is slightly different. I'll document below. For this project I selected Ubuntu Touch/Simple UI with C++ ...


7

gu is short for grid unit. From the user interface manual: Measurement Units A new measurement unit is defined called the grid unit, abbreviated gu. 1 grid unit translates to a given number of pixels depending on the type of screen that the user interface is displayed on. For example, on a laptop computer 1 grid unit will typically translate to 8 ...


7

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 ...


6

If there is no QML module that can help you accessing IRC servers, you will probably need to write a QML plugin in C++ that does that work as a backend. You can then use QML to implement the UI frontend.


6

Yes, Qt-Creator is a C++ IDE, with little support for other languages but since version 2.8.0 a quite basic python support has been added. That said you can use Qt-Designer (the form building tool), Qt-Translator (the translate tool), etc... easily with python. There are two Qt-Python bindings right now, the GPL/Commercial dual licensed PyQt, and the LGPL ...


6

With the release of Qt Creator 2.8 things are changing. It now natively supports Python for code editing and there are few Python-based features. From Qt Creator 2.8 release announcement: An editor specific for Python was added, with highlighting and indentation, and a Python class wizard


5

There is already a bug assigned. See here: https://bugs.launchpad.net/ubuntu-ui-toolkit/+bug/1158246 The ui toolkit is still under heavy development, the bug is confirmed and assigned to the tutorials author David Planella.


5

Changing aspects of the layout depending on the size of the window can be accomplished in a number of ways. At the most basic level, you can just set properties to different values based on the dimensions. Here is a minimal example that draws a grey square that turns orange if you make the window bigger: Run with qmlscene path/to/file.qml import QtQuick ...


5

No. You can also use Java, Python, C, Javascript, QML, Vala, and C#, and probably other launguages too. Source of image


5

The i18n portion is the component name, and the tr() function is the function to translate a string, in the Ubuntu SDK, with QML. This method of translation support uses gettext, and not the built-in localization features of Qt/QML, which are not compatible with gettext.


5

You can us the SQLite offline storage API directly from Qml using Javascript: import QtQuick.LocalStorage 2.0 If you want in-depth examples, I'd suggest looking at the source of some of the Ubuntu Touch Core-Apps. I know that at least the weather, clock, and RSS reader apps all use this. For now though, here's a simple example: import QtQuick.LocalStorage ...


5

To install the "QtMultimediaKit" you only need to install the libqtmultimediakit1 package: sudo apt-get install libqtmultimediakit1 Hopefully, it will install the Qt module that you are missing too.


5

Qt Quick Controls are available since Qt 5.1 and the Qt 5 version in Ubuntu repositories seems to be Qt 5.0.2. Consequently you cannot use Qt Quick Controls with the current version of Qt5 in Ubuntu repositories. If you want to use them, you have got 3 options: Using official Qt Project packages for Linux. You can download them here. Waiting a version of ...


5

When you set applicationName in the main .qml file of your project, you need to set it to the namespace of your application. This could look like “com.ubuntu.developer.jbloggs.superapp” for example. This will ensure that the app is working properly under confinement.


5

You could try QtWebKit.experimental. If you add import QtWebKit.experimental 1.0 to your QML files, your WebView objects will have access to experimental attributes: import QtQuick 2.0 import QtWebKit.experimental 1.0 import Ubuntu.Components 0.1 MainView { id: main width: units.gu(100) height: units.gu(75) Page { id: mypage ...


5

toolbaritems has been deprecated in Ubuntu.Components 1.1, so its use is strongly discouraged. It is maintained for backward compatibility, but the right way to add items to the header toolbar is now using head.actions. The main difference between head.actions and toolbaritems is that you don't need anymore to add ToolbarButton items and then set their ...


5

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


5

The following code should do what you need by putting the Image into a MouseArea component: import QtQuick 2.0 MouseArea { width: my_background.width height: my_background.height Image { id: my_background source: "background.png" } onClicked: my_background.source = "background.png" }


5

You can do it using some Javascript code in QML: import QtQuick 2.0 import Ubuntu.Components 0.1 Item { width: 200 height: 150 ListModel { id: model } ListView { id: listview anchors.fill: parent model: model delegate: Text { text: jsondata } } function getData() { ...


5

After having a chat with designers and SDK developers, it seems that the plan moving forward is to deprecate OptionSelector, and in general embedding UbuntuShapes in controls. I understand that there is no particular reason for having both components, as they have overlapping functionality. So the recommendation is to use ItemSelector for now.


4

You can also install the LogViewer app from the store to see the logs with a graphical interface. The application provides the following features, Graphical interface for viewing logs Exporting logs to pastebin


4

There's no built-in equivalent, but you can reproduce this behavior by setting up a message handler in a user script that triggers an event in the DOM that you handle in the HTML document. For each of these steps, the code to be executed is passed along. For a simple example: oxide-test.qml import QtQuick 2.0 import Ubuntu.Components 0.1 import ...


4

You're probably getting this warning because you're developing your application on a desktop. QML applications using Ubuntu components need this for identifying themselves throughout the system, see ApplicationId. To get rid of this warning, just prefix your qmlscene command like this: APP_ID=foo qmlscene ./foo.qml Resources: ...


4

I reused your qml file to start a fresh project in QtCreator. Please find below the files I used to compile and use the application successfully: the project file: test.pro # The .cpp file which was generated for your project. Feel free to hack it. SOURCES += main.cpp # Please do not modify the following two lines. Required for deployment. ...


4

I ran your qml snippet in this qml file on Ubuntu 13.10: import QtQuick 2.0 import Ubuntu.Components 0.1 MainView { id: main width: units.gu(30) height: units.gu(35) Page { Text { anchors.fill: parent anchors.margins: units.gu(2) horizontalAlignment: Text.AlignJustify text: "aaaaaa ...



Only top voted, non community-wiki answers of a minimum length are eligible