My First App & How To --- a Question from a daft beginner

Does anyone have a simple explanation on how to get “myfirstapp” or self-made app in general on the Phone?
The build works just fine (I think) with the Qt creator but what do I do after it? I get the app on the emulator but whatabout the phone?
How do I login on the Build Engine (Picture)? What userid/pw is it?
Do I even need to do anything there?

1 Like

Here you can see how to add a phone as device that you can deploy to. Then it is as easy as with the emulator.

I don’t remember, should be searchable. But no, you shouldn’t need to do that basically ever.

Happy hacking!

1 Like

Thanks. I thought I followed that instruction…Iĺl re-read / re-do.

You can do with ssh (the sshkey path is specified somewhere in Qtcreator settings) or nowadays with sfdk engine exec -t bash on the cmdline.

Like it was already explained above, it’s really rare that you need to do that. Also, -t bash is not necessary, by default sfdk engine exec will execute bash.

Hello ! another question from draft beginner.

I’m used to python but not to Qml and Javascript and trying to use SilicaListView on a filtered ListModel according a search text. Thanks to examples, creating ListModel from a file with python and triggering the ListModel update when search is changed are OK.

But I’m unable to make a buffer copy of the ListModel (found_list). It would be used to re-populated displayed ListModel (mylist) according search text :
- Using “=” is to much as modifying one list also modify the other.
- Using JSON seems not enough as rowCount method is not copied ?

Is there a way to make a copy of mylist ?

I feel very lost ! Even not knowing what I don’t know !! Is there some reading recommendation (in addition to sailfish/apps doc) ?
But starting with sailfish IDE & Virtualbox phone emulator was quiet straightforward (:-).

Thank you

Here is python
Python {
id: python
Component.onCompleted: {addImportPath(Qt.resolvedUrl(’.’));
console.log(“in python”);
importModule(‘init_list’, function () {
call(‘init_list.get_data’, [], function(result) {
for (var i=0; i<result.length; i++) {
mylist.append(result[i]);
// found_list.append(result[i]);
}
var found_list = JSON.parse(JSON.stringify(mylist));
//found_list=mylist;
console.log(“mylist len=”+mylist.rowCount());
//console.log(“found_list len=”+found_list.rowCount());
mylist.remove(1);
console.log(“mylist len=”+mylist.rowCount());
console.log(“found_list len=”+found_list.rowCount());
});
}
);

    }
}

and the listview:

    SilicaListView {
        VerticalScrollDecorator { flickable: listView }
        width: parent.width
        height: parent.height-searchField.height
        model: ListModel {
            id:mylist
            function update() {}
        
        delegate: Item {
            width: parent.width
            height: Theme.itemSizeSmall
            anchors {
                left: parent.left
                right: parent.right
                margins: Theme.paddingLarge
                
            }
            Label {
                text: x1
                font.pixelSize: Theme.fontSizeMedium
                anchors {
                    left: parent.left
                    right: parent.Center
                    margins: Theme.paddingLarge
                    
                }
                
            }
            Label {
                text: x2
                font.pixelSize: Theme.fontSizeSmall
                anchors {
                    left: parent.Center
                    right: parent.right
                }
            }
            
            
        }
    }
}

This may be already covered somewhere in documentation https://docs.sailfishos.org/. (EDIT: yes, page Your First App | Sailfish OS Documentation was already proposed, sorry attah, I missed your answer - as much I also missed the date of the question :upside_down_face:).

However, here is my procedure, done some time ago, hopefully I still remember correctly.

  1. On the phone: enable Developer mode, enable ssh access to the phone, check or change ssh user/password and IP address that will be used on your phone. You will find Developer mode in System part of Settings (very bottom)

  2. In QT Creator: define your device in tab Devices

  1. Check field Private Key file. You do not need to create new key if you already have one in your folder ~/.ssh (never remove or rename any existing file in your .ssh folder if you do not exactly know what you are doing, but you can create new files and delete them as much as you want). Use button Deploy public key to transfer it to your phone. IP and other data must be already correct.

there are tons of apps that have a searchable list.
i would suggest you check them out on github or whereever their repos are …
seems the most feasable approach for me.

e.g. in my app olive goes shopping is a searchable list, in squeezer is also one …

i believe this commit did introduce search on several pages.

2 Likes

hello PawelSpoon.

many thanks !!
using : Qt.createQmlObject(‘import QtQuick 2.0; ListModel {}’, Qt.application" like in your Squeeze app is OK.
It add been added to the page with :
property var found_list : Qt.createQmlObject(‘import QtQuick 2.0; ListModel {}’, Qt.application
Then it’s populated same time a displayed list. i don’t know if it’s a good way.

have a nice day.

You might also want to checkout opal gallery for some controls or the demo app of jolla that comes with the ide i think