Re: [SailfishDevel] QBluetoothServer Client app

2016-11-15 Thread Bea Lam
Hi Riku,

> On 16 Nov 2016, at 3:17 pm, Riku Lahtinen  wrote:
> 
> Hi!
> 
> I have tried to modify my Fast chess app to have a two player mode with two 
> devices. I planned to code it using bluetooth technology. I found a good QT 
> example Ping Pong, which has a functionality I need.
> 
> Currently in my code I think I can get the server running in my Jolla C or 
> Jolla 1. When I try to connect my client device, some discovery is done, but 
> the connection is not established. Currently I can't find any bug in my code.
> 
> Is Jolla and SailfishOS capable to create that kind of app? If the answer is 
> YES I will hunt more possible bugs in code. If the answer is NO, I have to 
> find another solution to pair devices.

Note that the devices have to be paired already via the Sailfish Settings app, 
as there are restrictions on creating new pairings outside of the system 
framework. If the devices are successfully paired and trusted, I assume that it 
would be possible to establish a RFCOMM connection, so I would suggest studying 
the hcidump logs to see where it breaks down.

Note that the QtBluetooth library is not yet included in the Harbour APIs, so 
it cannot be used in apps distributed via the Store.

Cheers,
Bea

___
SailfishOS.org Devel mailing list
To unsubscribe, please send a mail to devel-unsubscr...@lists.sailfishos.org


Re: [SailfishDevel] QBluetoothServiceDiscoveryAgent search fails on Sailfish OS

2016-07-13 Thread Bea Lam
Hi Krzysztof,

> On 14 Jul 2016, at 5:17 am, Krzysztof Lesiak  wrote:

> Now, I have found this thread: 
> https://lists.sailfishos.org/pipermail/devel/2015-March/005781.html
> 
> I'd very much like to be able to submit my application to harbour when it's 
> done, which can take some time, but still. Should I:
> 
> a) use the patched Qt Bluetooth module from the thread and package that with 
> my app instead of using the system lib
> b) try to gain access to the privileged group for easier development and wait 
> for Qt Bluetooth to become stable enough for harbour

Someone with more knowledge on the Harbour submission rules can comment on a), 
but in regards to b), I would not wait for changes in Qt Bluetooth for BlueZ 4 
on Sailfish OS; that is unlikely to change much as Qt Bluetooth has been ported 
to BlueZ 5. We are currently looking at porting the Sailfish OS Bluetooth stack 
to BlueZ 5, and after that stabilizes we would like to look into the use of Qt 
Bluetooth and ensure it is more usable for Harbour applications.

Cheers,
Bea

___
SailfishOS.org Devel mailing list
To unsubscribe, please send a mail to devel-unsubscr...@lists.sailfishos.org


Re: [SailfishDevel] Known Bluetooth devices

2014-06-23 Thread Bea Lam
On 24 Jun 2014, at 11:30 am, Tomasz Sterna  wrote:

> Hello.
> 
> Is there a way of obtaining a list of known BT devices from pure Qt C++?
> 
> I know there is KnownDevicesModel in Sailfish.Bluetooth QML module, but
> I would like to get that information on C++ level - in an command-line
> application running without UI.

Hi Tomasz, 

I suggest using the BlueZ 4.x API directly through QtDBus until there is public 
API support for Bluetooth functionality. You can call 
org.bluez.Adapter.GetProperties and check the “Devices” property in the 
returned map to get a list of object paths for known devices. This is what 
KnownDevicesModel does internally. 

We would like to provide some kind of public API support for Bluetooth in the 
future — in the form of QtBluetooth support, for example — though this will be 
some way off.

cheers,
Bea
___
SailfishOS.org Devel mailing list
To unsubscribe, please send a mail to devel-unsubscr...@lists.sailfishos.org


Re: [SailfishDevel] cannot hide() contextmenu

2013-12-18 Thread Bea Lam

On 19 Dec 2013, at 12:45 am, Wim de Vries  wrote:

> Thx. That works.
> Maybe sth for in the documentation in the future?

Sounds good, I’ll add a note to the docs to say that the height of the 
ContextMenu should not be explicitly set or changed.

cheers,
Bea

___
SailfishOS.org Devel mailing list


Re: [SailfishDevel] cannot hide() contextmenu

2013-12-17 Thread Bea Lam
Hello,

On 17 Dec 2013, at 11:17 pm, Wim de Vries  wrote:
> Hi,
> I am trying a contextmenu. I can show() it, but not hide it.
> Clicking on the lower rectangle does not hide it:

Just remove the “anchors.fill: parent” from your ContextMenu declaration. The 
ContextMenu type internally adjusts its ‘height’ property in order to make its 
contents appear and disappear when you call show() and hide(), so if you fix 
the menu’s dimensions using anchors.fill, it will not be able to internally 
control its height, as anchors take precedence over width/height values.

In any case, you wouldn’t want to explicitly control the height of a 
ContextMenu because it automatically adjusts its height according to the number 
of items in the menu.

cheers,
Bea
___
SailfishOS.org Devel mailing list


Re: [SailfishDevel] connect gridview on delegates click signal

2013-11-21 Thread Bea Lam
Hi Franck,

To get a reference to a particular instance of a delegate, just give the 
delegate an id, and references to that id from within the delegate declaration 
will refer to that instance only. The “this” keyword is not valid in this 
context. (See 
http://qt-project.org/doc/qt-5.0/qtqml/qtqml-javascript-hostenvironment.html.)

E.g.

GridView {
// …

delegate: Card {
id: cardDelegate
onClicked: console.log(“You clicked:”, cardDelegate)
}
}

If you click different cards in the view, you’ll see that each click prints out 
a reference to a different Card object.

Though, if you only need to pass on some data from the model — for example, the 
“ico” or “val” properties — it’s probably better to pass those details instead 
of the Card delegate instance itself, as the GridView creates and destroys its 
delegate instances as necessary when the view is scrolled. However, this may 
not be a concern in your case if you are simply pushing another page onto the 
stack at this point, and not changing the state of the GridView.

cheers,

Bea
___
SailfishOS.org Devel mailing list


Re: [SailfishDevel] SearchField and focus

2013-08-11 Thread Bea Lam
I've updated the SearchField docs, so it should be there in the next SDK 
release.

Thanks,
Bea


From: devel-boun...@lists.sailfishos.org [devel-boun...@lists.sailfishos.org] 
on behalf of Lucien XU [sfietkonstan...@free.fr]
Sent: 09 August 2013 20:29
To: devel@lists.sailfishos.org
Subject: Re: [SailfishDevel] SearchField and focus

Hello !

It works here on Weatherfish. Thanks ! However, it might worth it to mention
it in official docs, since it might happen often.

Cheers,
Lucien

Le vendredi 9 août 2013 12:11:35 Benoît HERVIER a écrit :
> Hello,
>
> Indeed.
>
> Thanks a lot for the explanation.
>
> Regards,
>
> Le 2013-08-09 03:12, Bea Lam a écrit :
> > Hello,
> >
> > The problem is that when the model changes, the last added delegate
> > steals the focus, as ListView has a focus scope.
> >
> > If you set "currentIndex: -1" on the ListView, then this behaviour
> > will be disabled. (This is what's done in the SearchPage.qml example
> > in silicacomponentgallery.)
> >
> > cheers,
> > Bea
> >
> >
> > 
> > From: devel-boun...@lists.sailfishos.org
> > [devel-boun...@lists.sailfishos.org] on behalf of Martin Grimme
> > [martin.gri...@gmail.com]
> > Sent: 09 August 2013 02:06
> > To: Lucien XU
> > Cc: devel@lists.sailfishos.org
> > Subject: Re: [SailfishDevel] SearchField and focus
> >
> > Hi,
> >
> > I had exactly the same problem. My solution was to define the
> > SearchField _outside_ the list view, like this:
> >
> > SilicaListView {
> >
> > id: listview
> >
> > ...
> >
> > header: Item {
> >
> > // This is just a placeholder for the header box. To avoid the
> > // list view resetting the input box everytime the model
> >
> > resets,
> >
> > // the search entry is defined outside the list view.
> > height: headerBox.implicitHeight
> >
> > }
> >
> > }
> >
> > ...
> >
> > Column {
> >
> > id: headerBox
> >
> > property int neutralPos: 0
> >
> > y: 0 - listview.contentY + neutralPos
> > width: parent.width
> >
> > Component.onCompleted: {
> >
> > neutralPos = listview.contentY;
> >
> > }
> >
> > SearchField {
> >
> > ...
> >
> > }
> >
> > }
> >
> >
> > That way, the SearchField floats on top of the list at the place
> > reserved by the placeholder Item.
> >
> >
> > Martin
> >
> > 2013/8/8, Lucien XU :
> >> Le jeudi 8 août 2013 17:10:26 Benoît HERVIER a écrit :
> >>> Hi,
> >>>
> >>> I'm trying to use SearchField to have a  suspense ... a search
> >>> field for my list view.
> >>> So i try to filter in realtime ... and i notice that SearchField
> >>> lose
> >>> focus
> >>>
> >>> Basically, i do a reset on the ListModel and append data
> >>>
> >>> This could come from the use i made from SearchField, so here a
> >>> snippet
> >>>
> >>> of the code :
> >>>  SilicaListView {
> >>>
> >>>  id: notesView
> >>>  model: notesModel
> >>>  anchors.fill: parent
> >>>  header: Column {
> >>>
> >>>  width: parent.width
> >>>  PageHeader {
> >>>
> >>>  title: "ownNotes"
> >>>
> >>>  }
> >>>  SearchField {
> >>>
> >>>  id: searchField
> >>>  placeholderText: "Search"
> >>>  width: parent.width
> >>>  onTextChanged: {
> >>>
> >>>  searchText = searchField.text;
> >>>  notesModel.applyFilter(searchText)
> >>>
> >>>  }
> >>>
> >>>  }
> >>>
> >>>  }
> >>>  section {
> >>>
> >>>  property: 'category'
> >>>  delegate: SectionHeader {
> >>>
> >>>  text: section
> >>>
> >>>  }
> >>>
> >>>  }
> >>>
> >>> Any advices ?
> >>
> >> I have the same issue. The searchfield got unfocused each time data
> >> is added
> >>
> >> in a list view. That's not conveinent for an autocomplete field ...
> >>
> >> No advices though, I'm trying to see what's wrong.
> >> ___
> >> SailfishOS.org Devel mailing list
> >
> > ___
> > SailfishOS.org Devel mailing list
> > ___
> > SailfishOS.org Devel mailing list
___
SailfishOS.org Devel mailing list
___
SailfishOS.org Devel mailing list


Re: [SailfishDevel] SearchField and focus

2013-08-08 Thread Bea Lam
Hello,

The problem is that when the model changes, the last added delegate steals the 
focus, as ListView has a focus scope.

If you set "currentIndex: -1" on the ListView, then this behaviour will be 
disabled. (This is what's done in the SearchPage.qml example in 
silicacomponentgallery.)

cheers,
Bea



From: devel-boun...@lists.sailfishos.org [devel-boun...@lists.sailfishos.org] 
on behalf of Martin Grimme [martin.gri...@gmail.com]
Sent: 09 August 2013 02:06
To: Lucien XU
Cc: devel@lists.sailfishos.org
Subject: Re: [SailfishDevel] SearchField and focus

Hi,

I had exactly the same problem. My solution was to define the
SearchField _outside_ the list view, like this:

SilicaListView {
id: listview

...

header: Item {
// This is just a placeholder for the header box. To avoid the
// list view resetting the input box everytime the model resets,
// the search entry is defined outside the list view.
height: headerBox.implicitHeight
}

}

...

Column {
id: headerBox

property int neutralPos: 0

y: 0 - listview.contentY + neutralPos
width: parent.width

Component.onCompleted: {
neutralPos = listview.contentY;
}

SearchField {
...
}
}


That way, the SearchField floats on top of the list at the place
reserved by the placeholder Item.


Martin


2013/8/8, Lucien XU :
> Le jeudi 8 août 2013 17:10:26 Benoît HERVIER a écrit :
>> Hi,
>>
>> I'm trying to use SearchField to have a  suspense ... a search
>> field for my list view.
>> So i try to filter in realtime ... and i notice that SearchField lose
>> focus
>>
>> Basically, i do a reset on the ListModel and append data
>>
>> This could come from the use i made from SearchField, so here a snippet
>> of the code :
>>
>>  SilicaListView {
>>  id: notesView
>>  model: notesModel
>>  anchors.fill: parent
>>  header: Column {
>>  width: parent.width
>>  PageHeader {
>>  title: "ownNotes"
>>  }
>>  SearchField {
>>  id: searchField
>>  placeholderText: "Search"
>>  width: parent.width
>>  onTextChanged: {
>>  searchText = searchField.text;
>>  notesModel.applyFilter(searchText)
>>  }
>>
>>  }
>>  }
>>  section {
>>  property: 'category'
>>  delegate: SectionHeader {
>>  text: section
>>  }
>>  }
>>
>> Any advices ?
>
> I have the same issue. The searchfield got unfocused each time data is added
>
> in a list view. That's not conveinent for an autocomplete field ...
>
> No advices though, I'm trying to see what's wrong.
> ___
> SailfishOS.org Devel mailing list
>
___
SailfishOS.org Devel mailing list
___
SailfishOS.org Devel mailing list


Re: [SailfishDevel] Dynamically filling up a Combobox

2013-06-16 Thread Bea Lam
Hi Aleksi,

You could use a Repeater to fill the ComboBox's ContextMenu and then 
dynamically change the model of the Repeater. E.g.

ComboBox {
menu: ContextMenu {
  Repeater { 
   model: ListModel { id: listModel }
   MenuItem { text: model.name }
  }
 }
}

function fillModel() {
 listModel.append({"name": "Click me"})
}


cheers,
Bea


From: devel-boun...@lists.sailfishos.org [devel-boun...@lists.sailfishos.org] 
on behalf of Stefan Lahner [lahner.ste...@gmx.at]
Sent: 17 June 2013 05:08
To: devel@lists.sailfishos.org
Subject: Re: [SailfishDevel] Dynamically filling up a Combobox

Hello,

maybe this (https://qt-project.org/wiki/QML-Dynamic-Objects) would help?
I never used it but this seam to be the way to do this.

Regards,
Stefan

Am 16.06.2013 20:52, schrieb Aleksi Suomalainen:
> Hello,
>
> I was wondering if there is a way to dynamically fill up a ComboBox
> Silica element in QML ?
>
> BR,
>
> Aleksi Suomalainen
> ___
> SailfishOS.org Devel mailing list

___
SailfishOS.org Devel mailing list
___
SailfishOS.org Devel mailing list