Tag Info

New answers tagged

1

Yes and no. The Ubuntu UI Toolkit provides a default theme, but there is no setting to use a different theme. A different random theme might entirely change how the UI functions, as well as looks, and might not work well on touch based devices. However, in your app, you can specify some different colors for things. You'll notice for example that the ...


1

Template, TemplateFlow, TemplateRow, TemplateSection and TemplateSectionNavigation are all internal components used by the ubuntu-ui-toolkit-examples package (See the full list here). To run the gallery, just type in a terminal: /usr/lib/ubuntu-ui-toolkit/examples/ubuntu-ui-toolkit-gallery/gallery They are not standard components of the Ubuntu SDK but ...


1

QML relies on the core internationalization (aka i18n) capabilities provided by Qt, tr() serves two purposes: It is used by lupdate as a marker for translatable strings. It parses the argument to tr() and places them in a .ts file. It is used for the i18n run time. It is a method that translates the string given to it. See ...


1

Get at least 1 GiB free disk space sudo apt-get install schroot Tools > Options > Ubuntu > Create Click Target > armhf (i386 and amd64 targets are broken as of now) Projects > Add Kit > UbuntuSDK Select it and build against it. Publish. Optional Create an emulator image. Install gdb-multiarch: sudo apt-get install gdb-multiarch


2

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.


1

You can use the [QtQuick.Window][1] API to access Qt::ScreenOrientation (requires Qt >= 5.1, 14.04 provides 5.2): Qt.PrimaryOrientation: The display's primary orientation. Qt.LandscapeOrientation: Landscape orientation, display width is greater than display height. Qt.PortraitOrientation: Portrait orientation, display height is greater than display width, ...


1

Setting OptionSelector.currentlyExpanded instead of OptionSelector.expanded makes it expanded initially, but as soon as you select an option, it collapses. This is closer to what I want, but not the most optimal solution. OptionSelector { id: projectSelector property int projectIndex: 0 width: pageLayout.width model: projects.count > 0 ? ...


0

LocalStorage example storage.js function getDatabase() { return LocalStorage.openDatabaseSync("appname", "0.1", "SettingsDatabase", 100); } function set(setting, value) { var db = getDatabase(); var res = ""; db.transaction(function(tx) { tx.executeSql('CREATE TABLE IF NOT EXISTS settings(setting TEXT UNIQUE, value TEXT)'); ...


1

You can use a simple JavaScript Date Object to set a default value: import QtQuick 2.0 import Ubuntu.Components 0.1 import Ubuntu.Components.Pickers 0.1 DatePicker { id: timePicker mode: "Hours|Minutes" date: new Date(0,0,0,8,5) } The Date object is used to work with dates and times. Date objects are created with new Date(). There are four ...


0

DatePicker { id: timePicker mode: "Hours|Minutes" date: { var time = new Date() time.setHours(8) time.setMinutes(5) return time } }


1

The Flickable item places its children on a surface that can be dragged and flicked, causing the view onto the child items to scroll. This behavior forms the basis of Items that are designed to show large numbers of child items, such as ListView and GridView. In traditional user interfaces, views can be scrolled using standard controls, such as scroll bars ...


1

Look at the following code snippet: import QtQuick 2.0 import Ubuntu.Components 0.1 MainView { width: 160 height: 160 Button { id: my_button Text { id: my_text anchors {centerIn: parent } text: my_button.width + " x " + my_button.height } Component.onCompleted: ...


0

You may want to try a QML forum, like this one: https://gitorious.org/forum-qml It will probably be more helpful. I hope that one is ok.


6

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


1

Ubuntu 14.04 The concept of QProcess Launcher type is now working without problems in Trusty with ubuntu-sdk-team PPA. Just create QML Extension Library + Tabbed UI project (don't use hyphens in project name yet), replace contents of mytype.h #ifndef LAUNCHER_H #define LAUNCHER_H #include <QObject> #include <QProcess> class Launcher : ...


0

You should declare SubChild1 and SubChild2 statically in ChildA. Then append signal "pageClosed" to both of them with set of required parameters. Last step - add handler for these signals, for example SubChild1 { id: subChild1 ... onPageClosed: { /* my staff */ } }


0

Indeed your app needs to set a couple of env. variables to tell gettext which .mo file to use and where to find it. https://www.gnu.org/software/gettext/manual/html_node/Triggering.html


1

Solution for 14.04 (Easy, QML only) The following QML code will work on 14.04 only because it requires Qt >= 5.1 (and Trusty provides 5.2.1). You can have a .desktop file containing: Exec=/usr/bin/qmlscene %U /path/to/your/qml-app/myapp.qml MimeType=x-scheme-handler/myapp and use Qt.application.arguments[1] to receive the URL content. Solution for ...


2

In this version I replaced the last Row by just an Item element. I also added a Scrollbar component: Scrollbar { flickableItem: list align: Qt.AlignTrailing } As ListView inherits Flickable, adding the Scrollbar enables the Vertical scroll. import QtQuick 2.0 import Ubuntu.Components 0.1 MainView { width: units.gu(60) height: ...


2

In your case you need to specify that the second row goes below the first one using: anchors.top: buttonRow.bottom I also modified the way you render your ListView by calculating listarea height from the number of elements in the list. The final QML code is below, included in a Mainview so that it's ready to be tested with qmlscene: import QtQuick 2.0 ...


2

Set anchors.fill: parent on your Row


2

If all the logic for talking to the remote API and parsing the results, is in C++ as a component plug-in, you can use the googlemock library, packaged as google-mock in Ubuntu, to create unit tests that mock expected results and data. However, if the API on the server changes, your code may still fail, even though the tests would pass, as you are only ...


1

You can manage resource files with the Qt resource system, but it's only meant to be use for applications mixing QML AND C++, not for projects started as simple Touch UI: The Qt resource system allows resource files to be stored as binary files in an application executable. This can be useful when building a mixed QML/C++ application as it enables ...


1

You just need to call Qt.openUrlExternally(link) in the onLinkActivated signal handler: onLinkActivated: { Qt.openUrlExternally(link) } It will attempt to open the specified target url in an external application, based on the user's desktop preferences.


0

Basically you have two options that will depend on the Ubuntu version you're using (or plan to use). Before 14.04 (Qt version are 5.0.x) The only way to open a file dialog window is to use some C++ code. You'll have to expose a method that is a public slot to access it from your QML application. Visit the following links to get a template to start with: ...


0

You need to install the package qtdeclarative5-test-plugin



Top 50 recent answers are included