Tag Info

New answers tagged

2

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


3

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


2

You can reuse the text property outside the TextField component. Look at the following example where a Text element shows the result of the Input text + 5: The corresponding code: import QtQuick 2.0 import Ubuntu.Components 0.1 import QtQuick.Controls 1.1 import QtQuick.Controls.Styles 1.1 MainView { id: main width: 300 height: 150 Row ...


2

Both are OK as they store the text property in a String. You could use the following snippet to restrict the input (with IntValidator) and make some calculation using the standard javascript function parseInt: import QtQuick 2.0 import Ubuntu.Components 0.1 import QtQuick.Controls 1.1 import QtQuick.Controls.Styles 1.1 MainView { id: main width: ...


1

As suggested in this answer, prefer the TextField component: The corresponding code: import QtQuick 2.0 import Ubuntu.Components 0.1 import QtQuick.Controls 1.1 import QtQuick.Controls.Styles 1.1 MainView { id: main width: 200 height: 200 TextField { anchors.centerIn: parent placeholderText: "0" text: "0" ...


2

To get a background with such elements, prefer the TextField component instead (I suggested a similar usage in this answer). The corresponding code: import QtQuick 2.0 import Ubuntu.Components 0.1 import QtQuick.Controls 1.1 import QtQuick.Controls.Styles 1.1 MainView { id: main width: 400 height: 300 Column { spacing: ...


1

You made a small mistake in naming your Pagestack component: PageStack { id: pagestack Later you're calling it with pageStack.push. To work correctly you just need to rename your component id (with a capital S): PageStack { id: pageStack


1

The following code is heavily inspired by the one provided by the official SDK documentation. I only changed the default control to be Button instead of ListItem: import QtQuick 2.0 import Ubuntu.Components 0.1 MainView { width: units.gu(48) height: units.gu(60) PageStack { id: pageStack Component.onCompleted: push(page0) ...


0

QtWebKit is not the supported API in the SDK to use for phones. You need to use Oxide instead. You can do this with: import com.canonical.Oxide 1.0 It provides mostly the same API as QtWebKit does.


0

thanks for your answer. I change my code in below and it's work pretty good property int i: -1 var request = new XMLHttpRequest() request.open('GET','in.txt') request.onreadystatechange = function(event) { if (request.readyState == XMLHttpRequest.DONE) { list = ...


1

The DirectShow error tells us that you're running on Windows and most of the time, newlines are coded with \r\n on this platform. Before assigning the item source path, remove the extra \r: list[i+1] = list[i+1].replace(/(\r\n|\n|\r)/gm,""); item.source = String(list[i+1])


1

QML provides a partially-functional version of XMLHttpRequest. It's good enough to load text files from the local files system, but that's about it. An example: var request = new XMLHttpRequest() request.open('GET', 'test.txt') request.onreadystatechange = function(event) { if (request.readyState == XMLHttpRequest.DONE) { lines = ...



Top 50 recent answers are included