Tag Info

New answers tagged

0

The close event in QML seems to be a recent addition (Qt 5.1) so only 14.04 which provides Qt 5.2 will be able to catch such event with this kind of handler: import QtQuick 2.1 import QtQuick.Window 2.1 Window { onClosing: { console.log("Bye") } } Alternatively you can also use onVisibleChanged signal handler. Sources: ...


0

Try wrapping the listener in anonymous function like this: canvas.addEventListener("touchstart", function() {touchStart;}, false);


2

Components are reusable, encapsulated QML elements with well-defined interfaces. Components are often defined by qml files. The Component element allows components to be defined within QML items rather than in a separate file. This may be useful for reusing a small component within a QML file, or for defining a component that logically belongs with other ...


1

You can't directly use Qt methods on JavaScript var, to do what you want prefer a pure js implementation: x.match(/[a-z]/i);


0

http://askubuntu.com/a/446736/253579 This solution allows one to execute terminal commands in QML. Ergo; One could simply Launcher { id: qprocess } Text { anchors.centerIn: parent text: qprocess.launch("echo '" + "insert file text" + "' > /tmp/text.txt") } After trying this, I could not get it to ...


2

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

A daemon is basically a program with no direct user interaction... So there is nothing really specific about it. Nevertheless, you have to take care about some keys points : any output or log should go to syslog, not the standard output at startup, create a pid file under /var/run. And clear it at shutdown. you have to write a service supervision file, to ...


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


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


1

One of the HTML5 SDK devs here, the docs are correct, here is a working demo <!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title>An Ubuntu HTML5 application</title> <meta name="description" content="An Ubuntu HTML5 application"> <meta name="viewport" content="width=device-width, ...


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.


2

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

I am guessing you are reading through the Ubuntu HTML5 Guide page, since I myself was just doing that and had the exact same problem. What you need to do is first add the tab.js script tag in the <head> section just under tabs.js. Note: There is a difference between tabs.js and tab.js. <script ...


1

To get the path, you should be able to do something like this (untested): def on_iconview_selection_changed(self, widget): try: path = widget.get_selected_items()[0] except IndexError: # No icon selected, so the list returned by get_selected_items() is # empty and indexing returns an IndexError ...


0

I try Understand. That is great but unfortunately is not free. Look at here there is video manual


0

Not all steps in my answer here can be done without internet. However for the others this is a possible way out: Do step 1 as in my answer. The required packages in Steps 2 and 3 can be installed as follows: Get those packages in .tar.gz form (you can google them) and download them on friend's PC and transfer to yours. Follow the instructions in the ...


0

I don't think permissions can propagate, imagine in a pipe, you still need to add "sudo" for each command in order to lift the permission constraint, not only once.


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 */ } }


2

I'm presuming you want to create your own GUI I recommend to use opengl if you want to have portable code between platforms. you need to write draw functions that will draw the GUI element(such as text input fields/buttons...) and write event function that goes with them(on mouse click,on focus..). Here is a Tutorial to get you started


1

don't worry about kernel 3.X not being mentioned. The last big change of the SCSI passthrough mechanism was in 2.5. So the documentation talks of old 2.4 versus new 2.6. More problematic nowadays may be demons which believe to own the CD drive. Escpecially when burning CDs you do not want to have an unattended process to grope your drive. The workarounds ...


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

Yes, we support most of the PhoneGap (Cordova) APIs, see http://developer.ubuntu.com/apps/html-5/guides/cordova-guide/ for more information on that. You can also use QML/Javascript on any Ubuntu device (phone, tablet or desktop).


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


0

From simple QML apps, you can't launch an external application (the Ubuntu SDK will probably support this feature in the future though). To start a system application, your Touch application must be using some C++ code an then rely on QProcess. Regarding communication between apps, again using C++ you could use QDBus.


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


0

Ubuntu Studio is two things: Custom Kernel allowing realtime processing (for better performance in encoding audio, exporting videos, etc) Custom Packages, which I found is particularly useful for setting up JACK (which is a headache otherwise). You should be able to get the SDK (qtcreator) for it, although considering that it is generally encouraged to ...


1

Ubuntu studio is nothing but Ubuntu with some special music/video related softwares. The customisability of Ubuntu(or GNU/Linux in general) that you can install any linux software on any linux distro (doesn't mean it will work). So you can do everything that you do on Ubuntu, on Ubuntu studo as well.You can develop, test do everything.


0

With the proyect Java Ayatana (http://code.google.com/p/java-swing-ayatana/), The appmenu for Java 6/7 Swing application is supported. sudo add-apt-repository ppa:danjaredg/jayatana sudo apt-get update sudo apt-get install jayatana Finally, restar your session



Top 50 recent answers are included