![]() |
Re: Help me to code for Sailfish OS
Quote:
Thanks very much! Regards, |
Re: Help me to code for Sailfish OS
I hardly dare to ask... Today I decided to try and create an app. But first: install the SDK on Windows 10. It refuses to even start. The installer says:
Git not installed: Please ensure Git is installed and in PATH... GitHub Desktop was already installed, maybe as an app (as I cannot find it under C:\Programs). So I downloaded and installed Git from https://git-scm.com/download/win and this did not help at all. Is there a secret Git to be downloaded? Thanks! Rob |
Re: Help me to code for Sailfish OS
looks like a thread for TJC
|
How to create "advanced" GUI?
How do you create "advanced" GUI for SFOS apps?
Simple (text centered) designs can be created via IDE in text mode, but how do you create apps which are more "graphical" oriented? As design mode isn't available in Sailfish IDE, is there another way to create QML-page designs in a more graphic way? |
Re: Help me to code for Sailfish OS
if you not aware of qml you can practice with desktop qt creator to learn qml basics
|
Re: Help me to code for Sailfish OS
Quote:
The latter I'm looking for... :) |
Re: Help me to code for Sailfish OS
Quote:
|
Re: Help me to code for Sailfish OS
All right coderus, the SDK is up and running. I started with a new QtQuick/Sailfish project. It contains an empty Cover Page and two empty Pages.
I find working with a new environment not easy: where to start? What examples to use? More or less similar would be Daily Comics, but they use python code. I've done some python, but incorporating it into QtQuick seems another hurdle to me. Now, what I want to do: 1. download the webpage of https://nos.nl/ as a text file 2. zoom in on the <section class="news-in-pictures"> 3. take the details from all the (10) <figure>: url, caption, text 4. download the images (each 100 kB, write the files or keep in memory?) 5. display them, optionally with caption and text I found filedownloader https://wiki.qt.io/Download_Data_from_URL#Usage but the first instruction Code:
private slots: |
Re: Help me to code for Sailfish OS
You can always start with component gallery example project, not with dummy one.
|
Re: Help me to code for Sailfish OS
Quote:
The QtQuick examples I found on web pages are aiming to show the url directly in a browser. Do you know a way to download that url as a text? Maybe QWebDownloadItem? Maybe QNetworkAccessManager with a get method? It's so hard finding an example... |
Re: Help me to code for Sailfish OS
QNetworkRequest for network stuff, and QRegExp for parsing reply
|
Multiple TexFields
In the People App(Called "Kontakte" in german) you can add multipe Numbers. I'm guessing this phone number filed is a TextFiled in QML.
Now I would like to do this also in my app. Does anyone have an idea where I can find it in the SailfishOS code? Or have someone an example to handel this? See the orginal Question: https://together.jolla.com/question/...comment-217726 |
Re: Help me to code for Sailfish OS
Hey Guys
I want to add dynamic TextFields to my app, like the people app for Jolla. Does anyone have an idea where I can find it in the SailfishOS code? Or have someone an example to handel this? See the orginal Question here: https://together.jolla.com/question/...le-textfields/ |
Re: Help me to code for Sailfish OS
You're not a man of many words, are you? [:D] But thanks, I think I found the way to start thanks to your guidance.
I would like to find out how to store files, probably in .local. With that I think it will be easier to debug. At least now I don't know how to check whether my RegExps lead anywhere. Then I think I will make a QJsonArray of 10 QJsonObjects filled with information of the photo (jpg, title, caption, source). This QJsonArray would be handed to the QML page. If so, how. If not, what then? My GitHub repo, still very premature: https://github.com/cow-n-berg/harbour-news-photos |
Re: Help me to code for Sailfish OS
I'd like to teach to code, not write code instead)
QJsonArray/QJsonObject can be handled natively as Object in QML For storing location check QStandardPaths class |
Re: Help me to code for Sailfish OS
Quote:
|
Re: Help me to code for Sailfish OS
Do you have an example on how to initialize a QJsonArray in the QML code, so I can fill it up with QJsonObjects in the C++ code?
|
Re: Help me to code for Sailfish OS
why to initialize from one place and fill with data from another?
|
Re: Help me to code for Sailfish OS
Quote:
|
Re: Help me to code for Sailfish OS
Save downloaded data as file and pass path to this file to qml
|
Re: Help me to code for Sailfish OS
Unfortunately, I couldn't manage to bind the C++ and QML properly. In the end, I did all the RegExp work in php, and made it available at a web server. So then I could just work with QML-only code. I'm happy I got something working, and submitted it to Harbour just before Christmas.
Thanks for the help! |
Re: Help me to code for Sailfish OS
I am struggling with some icons, shown in the PhotoDelegate. Do you have experience with the behaviour of icons in light Ambiences vs. dark Ambiences?
Thanks, Rob Below: the problem. Bottom layer is a rectangle. With a light Ambience, the rectangle must be darker to show a nice photo. Works properly. Code:
Rectangle { Then in the upper right corner I show the logo of the broadcasting company as an IconButton. For dark Ambiences, it works fine. But for light Ambiences, something strange happens. Basically, I want to show the same logo. But a svg file with a white image, 0.40 opacity, will be shown as very dark grey, so like the inverse of the normal svg. Code:
IconButton { As a workaround I could work with rectangle, mousearea and image, I guess... |
Re: Help me to code for Sailfish OS
Nowadays Icon* stuff in sfos using HighlightImage magic underneath to properly adjust monochrome icons for dark/light ambiences. Try using just monochrome white image and check if it magically convert to black in light ambience?
|
Re: Help me to code for Sailfish OS
hello guys, maybe stupid question, maybe I did not judt find it.. is there proper reaction/signal on change of the OS's ambience?
|
Re: Help me to code for Sailfish OS
Might be somewhere in Theme...
Theme.colorScheme == 0 stands for a dark Ambience. |
Re: Help me to code for Sailfish OS
Quote:
Code:
Theme.LightOnDark But if initial question was about actual ambience change, there is an example in sailfish code: https://github.com/CODeRUS/better-sa...indow.qml#L225 |
Re: Help me to code for Sailfish OS
coderus: yes exactly, I have found that colorScheme is defined, only the reaction to that I had not found. Thanks a lot, I will look at it :)
EDIT: Thanks a lot, works :) Code:
import Sailfish.Silica.private 1.0 |
Re: Help me to code for Sailfish OS
Quote:
|
Re: Help me to code for Sailfish OS
Quote:
EDIT: works! Code:
property real themeType: Theme.colorScheme |
Re: Help me to code for Sailfish OS
Quote:
|
Re: Help me to code for Sailfish OS
mm, related, both, property binding and "onAboutToChange" signal does not actually work completely. Thing is, both react "too soon". I had Assigned Theme.highlightColor to my property, problem is, there is actually "old" stuff in that property, so my property changes to what was there before the change of Ambience. I can bind property highlightColor and on that it reacts better but I suppose it might screw me if I would need to use any other Theme properties.. I need reaction on Ambience already changed, it might be through property binding, but I would need to know, which is "last in list". Or can I get status of changing the ambience?
|
Re: Help me to code for Sailfish OS
in the example above os handling ambience change with 600ms timer: https://github.com/CODeRUS/better-sa...indow.qml#L234
|
Re: Help me to code for Sailfish OS
thanks, Timer then, I did not need Timer yet, I will look at it :) I could wrap some animation with it
Code:
Timer { EDIT: for the record, as "ThemeChanger" property bindind I have used Theme._homeBackgroundImage , because it changes everytime you change the ambience, even if the actual background image is the same picture (tested :) ) |
Re: Help me to code for Sailfish OS
Hi,
I have made a fully functioning UI for my LED RGBW lighting strip (10 rows / 4 buttons per row). I have used a MouseArea for each button, but this makes the code bulky. I would like to know how to call each IR code from another page within my app, but I don't really know where to start. Currently, I have this for each button on my first page; Code:
Row { id: row1; ........ Thanks, |
Re: Help me to code for Sailfish OS
Quote:
https://doc-snapshots.qt.io/qt5-5.9/...x-signals.html https://stackoverflow.com/questions/...qml-to-another https://forum.qt.io/topic/103891/qml...-another-qml/6 |
Re: Help me to code for Sailfish OS
inside main.qml declare:
Code:
function controlLamp(endpoint) { Code:
MouseArea { |
Re: Help me to code for Sailfish OS
Quote:
I now have only one mouse area per row of 4 buttons, this is much better ;) |
Re: Help me to code for Sailfish OS
Hi, I've been thinking of adding auto refresh interval to my app and also to add settings for that auto refresh and also for other things. Are there any simple code examples for C++ or JavaScript?
|
Re: Help me to code for Sailfish OS
Quote:
To store settings, SailishOS has the Configuration API for QML. I must say the documentation isn't very clear and lacking of any examples... |
Re: Help me to code for Sailfish OS
Quote:
|
All times are GMT. The time now is 15:22. |
vBulletin® Version 3.8.8