Re: [Interest] MapboxGL offline and custom vector tiles source

2019-12-23 Thread Paolo Angelelli
The current map items implementation is a bit buggy and somewhat slow.
There's one new patch line, hopefully landing in 5.15, that should improve
performance and also the visual appearence

On Mon, 23 Dec 2019 09:46:22 +0100
maitai  wrote:

> Yes it includes texts, images (icons), and many kinds of shapes 
> (polygons filled with patterns, etc).
> 
> I am trying to play with geojson for a week or so to see if it fits my 
> needs, but I am facing some issues with polygons, maybe this is on my 
> side so I need to investigate more.
> 
> Is there a clean way to prevent the plugin to try to download tiles from 
> mapbox or elsewhere and just use custom layers, paints, layouts 
> MapParameters? For the time being I am putting a dummy 
> mapboxgl.mapping.additional_style_urls parameter (http://none) but this 
> is not very clean...
> 
> Philippe.
> 
> Le 23-12-2019 02:05, Paolo Angelelli a écrit :
> > Hi, a semi-OT reply:
> > 
> > do your own geojson tiles include text or are you only going to
> > display geometric
> > shapes in the map?
> > Asking because since 5.14 there's some GeoJson support, and, together
> > with a custom model
> > that could be used to populate a map with custom vectors
> > 
> > 
> > On Thu, 19 Dec 2019 17:22:25 +0100
> > maitai  wrote:
> >   
> >> Hello,
> >> 
> >> We would like to serve custom vector tiles, ideally though an API call
> >> or eventually a local server/stream. We don't want to add data or 
> >> layers
> >> to an existing mapbox chart, but rather respond to tile queries by
> >> sending our own geojson tiles. We have already done that for OSM 
> >> plugin
> >> (with raster tiles), but we don't really know where to start with
> >> concerning mapbox vector tiles.
> >> 
> >> The tiles are not stored in a database or mbtiles, but need to be
> >> generated on request.
> >> 
> >> What would be the best approach to achieve that?
> >> 
> >> Thanks for any tip
> >> Philippe.
> >> ___
> >> Interest mailing list
> >> Interest@qt-project.org
> >> https://lists.qt-project.org/listinfo/interest  
> > 
> > ___
> > Interest mailing list
> > Interest@qt-project.org
> > https://lists.qt-project.org/listinfo/interest  
> ___
> Interest mailing list
> Interest@qt-project.org
> https://lists.qt-project.org/listinfo/interest

___
Interest mailing list
Interest@qt-project.org
https://lists.qt-project.org/listinfo/interest


Re: [Interest] MapboxGL offline and custom vector tiles source

2019-12-22 Thread Paolo Angelelli
Hi, a semi-OT reply:

do your own geojson tiles include text or are you only going to display 
geometric
shapes in the map?
Asking because since 5.14 there's some GeoJson support, and, together with a 
custom model
that could be used to populate a map with custom vectors


On Thu, 19 Dec 2019 17:22:25 +0100
maitai  wrote:

> Hello,
> 
> We would like to serve custom vector tiles, ideally though an API call 
> or eventually a local server/stream. We don't want to add data or layers 
> to an existing mapbox chart, but rather respond to tile queries by 
> sending our own geojson tiles. We have already done that for OSM plugin 
> (with raster tiles), but we don't really know where to start with 
> concerning mapbox vector tiles.
> 
> The tiles are not stored in a database or mbtiles, but need to be 
> generated on request.
> 
> What would be the best approach to achieve that?
> 
> Thanks for any tip
> Philippe.
> ___
> Interest mailing list
> Interest@qt-project.org
> https://lists.qt-project.org/listinfo/interest

___
Interest mailing list
Interest@qt-project.org
https://lists.qt-project.org/listinfo/interest


Re: [Interest] App crashes on iOS when geocode or reverseGecode is used

2019-04-12 Thread Paolo Angelelli
Hi, is the reply finished? do you get it from the finished signal of the 
manager?
Or are you trying to use what the method returns you immediately?

On Thu, 11 Apr 2019 22:42:36 +0200
Roman Wüger  wrote:

> Hello,
> 
> I try to get the city and country from coordinates.
> For this I use the functions geocode/reverseGecode. The pointer is valid but 
> if the function is accessed with valid coordinates from the 
> GeoPositionInfoSource signal,  I get a EXC_BAD_ACCESS
> 
> I use “osm” as the geo service provider.
> 
> Any hints?
> 
> Regards
> Roman
> ___
> Interest mailing list
> Interest@qt-project.org
> https://lists.qt-project.org/listinfo/interest

___
Interest mailing list
Interest@qt-project.org
https://lists.qt-project.org/listinfo/interest


Re: [Interest] Parsing data from serialport

2019-04-04 Thread Paolo Angelelli
What is the advantage of having such a continuous reading loop in a separate 
thread?

I mean it as opposed to reacting to the readyRead() signal, and having a 
while(canReadLine()) { ... } in the reacting
slot.


On Tue, 2 Apr 2019 22:01:49 +
Jérôme Godbout  wrote:

> Make sure your reading loop and processing data are separated. Call you read 
> device when needed or into a loop that can take some pause to avoid 100% CPU 
> usage for nothing.
> 
> QByteArray buffer;
> 
> void ReadDeviceHaveData()
> {
> 
>while(serial_port->bytesAvailable()) // This can be dangerous is data keep 
> coming  and might be removed
> {
> // You can read bytes per bytes or smaller chunk over here for 
> better reactivity and less memory consumption
> buffer.append(serial_port->readAll());
> processData();
> serial_port->waitForReadyRead(5);
>  }
> }
> 
> void ProcessData()
> {
>int pos = buffer.indexOf(‘\n’);
> 
>while(pos >= 0)
>{
>  QByteArray line = buffer.left(pos);
>  // Strip trailing \r for windows here
>  // Do whatever you need with your line, check data integrity
> 
>  // Remove the processed data but leave the unprocessed data alone
>  buffer.remove(0, pos + 1); // Remove \n too
>  pos = buffer.indexOf(‘\n’);
>}
> }
> 
> From: Interest  On Behalf Of Martin Marmsoler
> Sent: April 2, 2019 3:58 PM
> To: Thiago Macieira 
> Cc: interest@qt-project.org
> Subject: Re: [Interest] Parsing data from serialport
> 
>  > To be able to roll back, in case your reading from the device didn't 
> result in  
> what you wanted or you got an error. See QDataStream.
> Ah ok I understand.
> 
> So this minimal example
> QSerialPort sPort;
> sPort.open(QIODevice::ReadOnly);
> 
> if(sPort.waitForReadyRead(2000)){
> 
>   while (!device.atEnd()) {
> 
> if (device.canReadLine()) {
> 
>newData.push_back(device.readLine());
> 
>linesToRead++;
> 
> } else {
> 
>return;
> 
> }
> 
>}
> 
>...
> 
> }
> 
> works fine, if I go trough it step by step (maybe, because enouth data come 
> in). But if I'm to fast it does not work.
> 
> If I'm using the signal readyRead I will have the same problem, because new 
> data come everytime. So I check that in the
> 
> readyRead function if a complete line come in, and if no complete line I 
> return without doing something otherwise I do
> 
> something with the data? Is this the right way?
> 
> 
> 
> Martin
> 
> 
> 
> 
> Thiago Macieira mailto:thiago.macie...@intel.com>> 
> schrieb am Di., 2. Apr. 2019, 18:02:
> On Tuesday, 2 April 2019 07:04:03 PDT Martin Marmsoler wrote:
> > Thank you Thiago for your response. But what is transactionstart for?  
> 
> To be able to roll back, in case your reading from the device didn't result in
> what you wanted or you got an error. See QDataStream.
> 
> --
> Thiago Macieira - thiago.macieira (AT) intel.com
>   Software Architect - Intel System Software Products
> 
> 
> 
> ___
> Interest mailing list
> Interest@qt-project.org
> https://lists.qt-project.org/listinfo/interest

___
Interest mailing list
Interest@qt-project.org
https://lists.qt-project.org/listinfo/interest


Re: [Interest] QtLocation MapPolyLine and MouseArea

2019-03-08 Thread Paolo Angelelli
Pressed/released should work as expected, shouldn't it?

Hovered is a different story though.

On Thu, 07 Mar 2019 18:32:35 +0100
maitai  wrote:

> Hi,
> 
> I need to trigger various actions whenever a MapPolyLine is hovered or 
> pressed, such as displaying a tooltip, a menu, etc.
> 
> I have put a MouseArea on it with anchors.fills: parent, but the problem 
> is that the mouse area does not represent the line, but the polygon made 
> by the line. For instance if you have a L shape, entered event and so on 
> is triggered when you enter the bounding rectangle of the line, not when 
> you hover over the line itself.
> 
> On a QGraphicsScene we had the shape() protected method for that kinds 
> of case, for instance with a QPainterPathStroker to give some thickness 
> to the line's "mousearea".
> 
> I will probably end with a custom property that will carry the pixel 
> distance between the line segments and the mouse coordinates, but this 
> is going to be heavy to compute (I have potentially hundreds of 
> complicated lines on the map).
> 
> Is there a better way or even better a standard way to do that?
> 
> Thanks
> Philippe Lelong
> ___
> Interest mailing list
> Interest@qt-project.org
> https://lists.qt-project.org/listinfo/interest

___
Interest mailing list
Interest@qt-project.org
https://lists.qt-project.org/listinfo/interest


Re: [Interest] QtLocation MapPolyLine and MapPolyGon style

2019-02-26 Thread Paolo Angelelli
Hi, yes some limitations are there by design (projection, trajectory of lines),
and to overcome these limitations it is necessary of a bit of redesign + 
implementation
supporting it.

When it comes to the shapes, however, i might not have explained my suggestion 
well enough.
So the idea would be to create your geo polygon that you need to fancy fill 
using a shape.
Then you would need to anchor it to the map using a MapQuickItem.
However, MapQuickItem allows you to anchor one pixel of your item to one 
coordinate of the map.
So, in essence, once you have your shape correct in pixel coordinates for a 
specific zoom level,
you need to calculate the proper anchor point and rotation, and then you use 
the MapQuickItem.zoomLevel
property to make it scale with the map.



On Tue, 26 Feb 2019 18:45:05 +0100
maitai  wrote:

> Thanks Paolo for your replies here and at qt bugs report
> 
> In fact I am porting a qt widget application based on QGraphicsScene to 
> QML and indeed these painting features are badly missing. Calculating 
> polygon/shapes screen coordinates is not an issue in itself but that 
> will become really tricky to implement when the users pans or zoom, so I 
> would say unless I can do it through mapboxgl I will have to propose 
> something else than dashed areas and lines.
> 
> There are some other features which I think will be missing too, for 
> instance lines are just "loxodromic" (rhumb) lines, when they should be 
> "orthodromic" (great circle), or at least there should be an option for 
> both cases. Another big issue is the projection. Mercator is OK in most 
> cases but is there a way to have another projection (with mapboxgl maybe 
> ?), for instance Lambert conformal conic projection for usage in high 
> latitudes?
> 
> That being said Qt Location is much much better that QGraphicsScene for 
> doing all that stuff, of course.
> 
> Thanks again,
> Philippe Lelong
> 
> 
> Le 26-02-2019 15:21, Paolo Angelelli a écrit :
> > If you need dashed or dotted or styled lines, at the moment that's the
> > only workaround we can offer.
> > The built-in lines are using QTriangulatingStroker under the hood,
> > that seems to be missing that part
> > of the QPen features (brush, style).
> > 
> > as for map polygon, the only workaround i can think of, if mapboxgl
> > does not offer it/is not an option, is
> > to use a MapQuickItem instead, create the polygon with Shapes, and
> > then do the math and georeference it "manually".
> > 
> > As for your last question, i don't think i can answer since too many
> > details are missing
> > 
> > hope this helps a bit, anyway
> > 
> > 
> > 
> > On Mon, 25 Feb 2019 20:01:17 +0100
> > maitai  wrote:
> >   
> >> Hi,
> >> 
> >> I may be wrong since it seems incredible, but it seems there is no way
> >> to draw a MapPolyLine dashed or dotlined, and similarly I didn't find 
> >> a
> >> way to fill a MapPolygon with a pattern.
> >> 
> >> If that is the case, what in your opinion would be the best way to
> >> implement this?
> >> 
> >> I found QTBUG-46651 which recommends to use an empty mapboxgl layer
> >> instead of my current itemsoverlay map, would that cover the needs 
> >> since
> >> I have plenty of other mapItems and need to manage z values for each 
> >> of
> >> them?
> >> 
> >> Thanks
> >> Philippe Lelong.
> >> ___
> >> Interest mailing list
> >> Interest@qt-project.org
> >> https://lists.qt-project.org/listinfo/interest  
> > 
> > ___
> > Interest mailing list
> > Interest@qt-project.org
> > https://lists.qt-project.org/listinfo/interest  
> ___
> Interest mailing list
> Interest@qt-project.org
> https://lists.qt-project.org/listinfo/interest

___
Interest mailing list
Interest@qt-project.org
https://lists.qt-project.org/listinfo/interest


Re: [Interest] QtLocation MapPolyLine and MapPolyGon style

2019-02-26 Thread Paolo Angelelli
If you need dashed or dotted or styled lines, at the moment that's the only 
workaround we can offer.
The built-in lines are using QTriangulatingStroker under the hood, that seems 
to be missing that part
of the QPen features (brush, style).

as for map polygon, the only workaround i can think of, if mapboxgl does not 
offer it/is not an option, is
to use a MapQuickItem instead, create the polygon with Shapes, and then do the 
math and georeference it "manually".

As for your last question, i don't think i can answer since too many details 
are missing

hope this helps a bit, anyway



On Mon, 25 Feb 2019 20:01:17 +0100
maitai  wrote:

> Hi,
> 
> I may be wrong since it seems incredible, but it seems there is no way 
> to draw a MapPolyLine dashed or dotlined, and similarly I didn't find a 
> way to fill a MapPolygon with a pattern.
> 
> If that is the case, what in your opinion would be the best way to 
> implement this?
> 
> I found QTBUG-46651 which recommends to use an empty mapboxgl layer 
> instead of my current itemsoverlay map, would that cover the needs since 
> I have plenty of other mapItems and need to manage z values for each of 
> them?
> 
> Thanks
> Philippe Lelong.
> ___
> Interest mailing list
> Interest@qt-project.org
> https://lists.qt-project.org/listinfo/interest

___
Interest mailing list
Interest@qt-project.org
https://lists.qt-project.org/listinfo/interest


Re: [Interest] Replacement for Qt4 QMatrix4x4?

2019-02-22 Thread Paolo Angelelli
You aren't telling us much, except that you need to invert it and multiply 
points with it.
If QtPositioning-private is an acceptable dependency instead of pulling in 
eigen (or others),
you could probably get away with the private QDoubleMatrix4x4 that is in there, 
basically
a double QMatrix4x4.


On Thu, 21 Feb 2019 16:47:05 -0500
Matthew Woehlke  wrote:

> So... after a full day of debugging, trying to port my Qt4 app to Qt5
> and chase down a nasty case of stack clobbering, I discovered that the
> problem is that QMatrix4x4 changed from qreal to float.
> 
> (Uh...why? I am not particularly amused by the loss of precision, nor
> the extremely subtle incompatibility.)
> 
> Alas, there does not seem to be any feasible replacement in Qt. I can't
> use QGenericMatrix because it can't be used to transform QPointF's, nor
> can it be inverted, both of which are features I require. I *really*
> don't want to throw out the precision of double, especially as I have
> tons of other code that still uses double and would have to wade through
> mountains of conversion warnings to do so.
> 
> Am I missing something, or do I need to drag in Eigen?
> 

___
Interest mailing list
Interest@qt-project.org
https://lists.qt-project.org/listinfo/interest


Re: [Interest] Qt Location custom osm plugin and high res tiles

2019-02-20 Thread Paolo Angelelli
The way this works is that the logical tile size (in osm case fixed at 256x256) 
is
independent of the physical tile size (in your case 512x512).

QtLocation/Qt/OpenGL will basically push the pixels through the tiles either by 
enabling mipmapping
if the tile on-screen size is < tile physical size, or bilinear interpolation 
if the opposite is true.

in case of x1 screens, with 512x512 tiles (lets call them @2x), this is enough 
to give you a sharp map all the way through zooming.

with a high-dpi screen it's different. at x2, you will get sharp maps at 
integer zoom levels only, but in between you won't have enough pixels and will 
get tiles bilinearly interpolated because of that.

To get a map that is sharp all the way through zooming on an x2 screen, you 
would need @4x rasters, which however become overkill
(1024x1024 tiles would probably kill most desktop HW).

So it's a matter of tradeoff there



On Wed, 20 Feb 2019 17:33:05 +0100
maitai  wrote:

> Hi Paolo,
> 
> My initial question was concerning a custom map type, not a derived 
> plugin. So basically you are saying that on a retina x2 screen I can 
> send back 512x512 tiles and the plugin will mark the tile with 
> pixelRatio = 2 (i.e not just rescale it) ?
> 
> But in fact I would prefer to be able to create my own plugin, because 
> the charts I am using are just local (some of them drawn on the fly, 
> some of them stored in mbtiles, some of them encrypted, and potentially 
> I also need vector tiles). For the time being I create a thread for each 
> type of map which is also a QTcpServer, but I would prefer to be able to 
> communicate directly and control more things at the plugin level. I will 
> investigate all this once more.
> 
> Thanks again for you replies
> Philippe.
> 
> Le 20-02-2019 09:59, Paolo Angelelli a écrit :
> > I may have misunderstood what you meant with "custom osm plugin".
> > What does that mean?
> > If you meant "a modified osm plugin", then you would be already using
> > this class anyway.
> > If you meant "custom map type", then just feeding 512x512 tiles should 
> > work.
> > 
> > On Wed, 20 Feb 2019 08:38:44 +0100
> > maitai  wrote:
> >   
> >> Hi,
> >> 
> >> Seems to me that QGeoCameraCapabilities is a private qt API?
> >> 
> >> From what I found on the net seems it would help a lot for customizing
> >> own map plugin or tile server, but it's not clear how I can access it.
> >> 
> >> Philippe
> >> 
> >> Le 19-02-2019 19:40, maitai a écrit :
> >>   
> >> > Thanks I'll give it a try
> >> >
> >> >  Message d'origine 
> >> > De : Paolo Angelelli 
> >> > Date : 19/02/2019 7:21 PM (GMT+01:00)
> >> > À : interest@qt-project.org
> >> > Objet : Re: [Interest] Qt Location custom osm plugin and high res tiles
> >> >
> >> > Hi, yes it's easy.
> >> > All you have to do is setting the appropriate QGeoCameraCapabilities for 
> >> > the map types you have high dpi tiles for.
> >> > So in your case, set the tilesize to 256x256, so that you will have more 
> >> > data per logical pixel.
> >> >
> >> > hope it's clear enough. Or just check how it's done in either osm or 
> >> > here or mapbox plugins
> >> >
> >> > On Tue, 19 Feb 2019 09:51:30 +0100
> >> > maitai  wrote:
> >> >  
> >> >> Hello,
> >> >>
> >> >> Is it possible to use high res tiles with a custom osm plugin?
> >> >> In fact I created my own local server and would like to know if I can
> >> >> send high res tiles, for instance if devicePixelRatio is 2 I would send
> >> >> 512x512 tiles, expecting Qt Location to set the tile pixel ratio to 2.
> >> >>
> >> >> Thanks
> >> >> Philippe.
> >> >> ___
> >> >> Interest mailing list
> >> >> Interest@qt-project.org
> >> >> https://lists.qt-project.org/listinfo/interest  
> >> >
> >> > ___
> >> > Interest mailing list
> >> > Interest@qt-project.org
> >> > https://lists.qt-project.org/listinfo/interest
> >> >
> >> > ___
> >> > Interest mailing list
> >> > Interest@qt-project.org
> >> > https://lists.qt-project.org/listinfo/interest  
> > 
> > ___
> > Interest mailing list
> > Interest@qt-project.org
> > https://lists.qt-project.org/listinfo/interest  
> ___
> Interest mailing list
> Interest@qt-project.org
> https://lists.qt-project.org/listinfo/interest

___
Interest mailing list
Interest@qt-project.org
https://lists.qt-project.org/listinfo/interest


Re: [Interest] Qt Location custom osm plugin and high res tiles

2019-02-20 Thread Paolo Angelelli
I may have misunderstood what you meant with "custom osm plugin".
What does that mean?
If you meant "a modified osm plugin", then you would be already using this 
class anyway.
If you meant "custom map type", then just feeding 512x512 tiles should work.

On Wed, 20 Feb 2019 08:38:44 +0100
maitai  wrote:

> Hi, 
> 
> Seems to me that QGeoCameraCapabilities is a private qt API? 
> 
> From what I found on the net seems it would help a lot for customizing
> own map plugin or tile server, but it's not clear how I can access it. 
> 
> Philippe 
> 
> Le 19-02-2019 19:40, maitai a écrit :
> 
> > Thanks I'll give it a try
> > 
> >  Message d'origine 
> > De : Paolo Angelelli  
> > Date : 19/02/2019 7:21 PM (GMT+01:00) 
> > À : interest@qt-project.org 
> > Objet : Re: [Interest] Qt Location custom osm plugin and high res tiles 
> > 
> > Hi, yes it's easy.
> > All you have to do is setting the appropriate QGeoCameraCapabilities for 
> > the map types you have high dpi tiles for.
> > So in your case, set the tilesize to 256x256, so that you will have more 
> > data per logical pixel.
> > 
> > hope it's clear enough. Or just check how it's done in either osm or here 
> > or mapbox plugins
> > 
> > On Tue, 19 Feb 2019 09:51:30 +0100
> > maitai  wrote:
> >   
> >> Hello,
> >> 
> >> Is it possible to use high res tiles with a custom osm plugin?
> >> In fact I created my own local server and would like to know if I can 
> >> send high res tiles, for instance if devicePixelRatio is 2 I would send 
> >> 512x512 tiles, expecting Qt Location to set the tile pixel ratio to 2.
> >> 
> >> Thanks
> >> Philippe.
> >> ___
> >> Interest mailing list
> >> Interest@qt-project.org
> >> https://lists.qt-project.org/listinfo/interest  
> > 
> > ___
> > Interest mailing list
> > Interest@qt-project.org
> > https://lists.qt-project.org/listinfo/interest
> > 
> > ___
> > Interest mailing list
> > Interest@qt-project.org
> > https://lists.qt-project.org/listinfo/interest  

___
Interest mailing list
Interest@qt-project.org
https://lists.qt-project.org/listinfo/interest


Re: [Interest] QML Settings fails persistance on Android

2018-08-31 Thread Paolo Angelelli
I also have had several issues (mostly persistence issues) with 
Qt.labs.settings.
In the end using QSettings directly seemed to work alright, and so i kept using
that.

A pity since Qt.labs.settings looks much easier to use, but nevertheless..

On Fri, 31 Aug 2018 13:26:05 +0200
René Hansen  wrote:

> Hi,
> 
> 
> I've run into a number of weird cases where properties on a *Settings*
> element doesn't properly persist between launches of an app.
> 
> Initially I used aliasing quite heavily for it's syntactic ease, as per the
> main example from the docs. However, I found that sometimes only part of
> the the properties would properly persist for next launch. I could never
> quite reproduce the issues consistently and it had a sort of
> race-condition'y feel about it. So I gave up an aliases.
> 
> Instead I've opted for a direct one-way load binding on launch and then a
> write-back to the Settings when the app closes down. This seems to work
> correctly regarding value persistence. That is, when it actually works...
> 
> Here's the pickle; Android has two means of closing an application. One is,
> that you can directly exit it via the back button, which triggers a Close
> event on the main window, the other is by suspending the app and then
> "clearing" it out from the list of background processes.
> 
> The former produces a valid result, where properties are properly persisted
> to the *Settings*, the other does not.
> 
> I'm guessing this is because the actual write-back happens on the
> destruction of the Settings element, which is, afaict, never triggered if
> the app is cleared during suspension.
> 
> I've made a futile attempt at manually triggering the write-back, at an
> earlier stage of the shutdown, by connecting the the *application.state*,
> e.g.:
> 
> *  Connections {*
> *target: Qt.application*
> *onStateChanged: {*
> *  switch(Qt.application.state) {*
> *  case Qt.ApplicationActive:*
> *console.log("Qt.ApplicationActive")*
> *break;*
> *  case Qt.ApplicationInactive:*
> *console.log("Qt.ApplicationInactive")*
> *break;*
> *  case Qt.ApplicationSuspended:*
> *console.log("Qt.ApplicationSuspended")*
> 
> *// WRITE STUFF TO SETTINGS HERE*
> 
> *break;*
> *  case Qt.ApplicationHidden:*
> *console.log("Qt.ApplicationHidden")*
> *break;*
> *  }*
> *}*
> *  }*
> 
> However, even by doing it this way, "seemingly" before the app is
> suspended, the values are still not written back at all. Presumably it's
> because of missing destruction trigger mentioned above.
> 
> So, what are my options here if I'd like to use *Settings* here?
> 
> I notice QSettings have a sync
>  method,
> but I don't see anything similar for the QML variant.
> 
> What is the canonical way to solve this problem for Android? Has anyone
> else done this in a practical manner?
> 
> 
> Best regards,
> 
> René Hansen

___
Interest mailing list
Interest@qt-project.org
http://lists.qt-project.org/mailman/listinfo/interest


[Interest] Google Summer of Code 2018

2018-02-13 Thread Paolo Angelelli
Hi,

this year we decided that it would be a good idea to participate to the Google 
Summer of Code,
and we have also been accepted! 
Our page is at 
https://summerofcode.withgoogle.com/organizations/5388456415461376/ .

If you have additional ideas to propose, mentor, or both, please feel free to 
update the ideas wiki
page at https://wiki.qt.io/Google_Summer_of_Code/2018/Project_Ideas

Also feel free to spread the word :-)

___
Interest mailing list
Interest@qt-project.org
http://lists.qt-project.org/mailman/listinfo/interest


Re: [Interest] Video acceleration with gstreamer 1.0 omx and Qt 5.9.4 / 5.10 eglfs on RPI3 (brcm)

2018-01-31 Thread Paolo Angelelli
Maybe this could be relevant:
https://gstreamer.freedesktop.org/data/events/gstreamer-conference/2016/John%20Sadler%20-%20Smooth%20video%20on%20Raspberry%20Pi%20with%20gst-mmal%20(Lightning%20Talk).pdf

On Wed, 31 Jan 2018 18:48:47 +0100
Petar Koretić  wrote:

> Thanks Paolo,
> I also found something along that lines so I will be trying this next.
> 
> Vlad, thanks, I actually took buildroot one from that page to make sure it
> works :)
> yocto was also next on my list, but for the lack of time I always end up
> using buildroot in the end as it should work the same, and I knew I had
> this running on raspbian so I thought this will "just work" as I would
> somewhat expect this to be pretty standard
> 
> Best regards,
> Petar
> 
> 
> On Wed, Jan 31, 2018 at 6:42 PM, Vlad Stelmahovsky <
> vladstelmahov...@gmail.com> wrote:  
> 
> > Hi
> >
> > have you  checked the link: http://www.jumpnowtek.
> > com/rpi/Raspberry-Pi-Systems-with-Yocto.html ?
> >
> > On Wed, Jan 31, 2018 at 5:28 PM, Petar Koretić 
> > wrote:
> >  
> >> Hi all.
> >>
> >> So I haven't played around with this for some time but around one year
> >> ago or more I think I got this up running fairly easily. This was maybe
> >> still with gstreamer 0.10.
> >>
> >> For the past two days I was trying to get video working with acceleration
> >> on the RPI player through QtMultimedia using QML Video element.
> >>
> >> Using VC4 driver is a no go as there is no acceleration support in the
> >> driver yet as far as I know but the simple fullhd video played pretty
> >> nicely as far as it goes.
> >>
> >> Anyway I went back the standard omx route.
> >> I tried to build and use Qt 5.9 creating a system using buildroot as I
> >> always do and later checking with latest raspbian stretch.
> >> Both methods compiled without issues using eglfs and gstreamer 1 and
> >> using the broadcom driver.
> >>
> >> In the end these are the instructions that I decided to follow for
> >> rasbian http://www.tal.org/tutorials/building-qt-510-raspberry-pi-de
> >> bian-stretch
> >> where I used gstreamer-omx-rpi package.
> >>
> >> Playing example full hd video (http://cdn3.viblast.com/strea
> >> ms/hls/airshow/2670k/stream.m3u8) or any mp4 youtube file results in a
> >> not so smooth video with obvious stutters (gpu_mem is at 256mb)
> >> .GST_DEBUG=omx:4 shows that the omx is being used.
> >>
> >> I remember that I was able to play two videos at the same time (one full
> >> hd, one smaller) with animations without issues but I'm not sure if this
> >> was using eglfs and gstreamer 1.0 as it was more than a year ago.
> >>
> >> Is this expected to work in this setup with gstreamer omx on rpi and
> >> broadcom driver using eglfs or which route should I go? Any help is
> >> appreciated as I've tried a fair bit of different things and I'm still
> >> trying but can't understand if this should be possible at all.
> >>
> >> Best regards,
> >> Petar
> >>
> >>
> >>
> >>
> >>
> >>
> >>
> >> ___
> >> Interest mailing list
> >> Interest@qt-project.org
> >> http://lists.qt-project.org/mailman/listinfo/interest
> >>
> >>  
> >
> >
> > --
> > Best regards,
> > Vlad
> >  

___
Interest mailing list
Interest@qt-project.org
http://lists.qt-project.org/mailman/listinfo/interest


Re: [Interest] Video acceleration with gstreamer 1.0 omx and Qt 5.9.4 / 5.10 eglfs on RPI3 (brcm)

2018-01-31 Thread Paolo Angelelli
I did some research some time ago.

It seemed, back then, that the problem may have arised from the fact that
the sink glimagesink, that is the one that has to be used on the RPi, might
be built using mesa, but to have it run HW-accelerated, it should use broadcom's
egl.
So it might be you have to rebuild gstreamer for that.

But i'd be interested to know if that's really the case, and if so, whether
things work as expected once gstreamer gets properly rebuilt


On Wed, 31 Jan 2018 17:28:57 +0100
Petar Koretić  wrote:

> Hi all.
> 
> So I haven't played around with this for some time but around one year ago
> or more I think I got this up running fairly easily. This was maybe still
> with gstreamer 0.10.
> 
> For the past two days I was trying to get video working with acceleration
> on the RPI player through QtMultimedia using QML Video element.
> 
> Using VC4 driver is a no go as there is no acceleration support in the
> driver yet as far as I know but the simple fullhd video played pretty
> nicely as far as it goes.
> 
> Anyway I went back the standard omx route.
> I tried to build and use Qt 5.9 creating a system using buildroot as I
> always do and later checking with latest raspbian stretch.
> Both methods compiled without issues using eglfs and gstreamer 1 and using
> the broadcom driver.
> 
> In the end these are the instructions that I decided to follow for rasbian
> http://www.tal.org/tutorials/building-qt-510-raspberry-pi-debian-stretch
> where I used gstreamer-omx-rpi package.
> 
> Playing example full hd video (
> http://cdn3.viblast.com/streams/hls/airshow/2670k/stream.m3u8) or any mp4
> youtube file results in a not so smooth video with obvious stutters
> (gpu_mem is at 256mb)
> .GST_DEBUG=omx:4 shows that the omx is being used.
> 
> I remember that I was able to play two videos at the same time (one full
> hd, one smaller) with animations without issues but I'm not sure if this
> was using eglfs and gstreamer 1.0 as it was more than a year ago.
> 
> Is this expected to work in this setup with gstreamer omx on rpi and
> broadcom driver using eglfs or which route should I go? Any help is
> appreciated as I've tried a fair bit of different things and I'm still
> trying but can't understand if this should be possible at all.
> 
> Best regards,
> Petar

___
Interest mailing list
Interest@qt-project.org
http://lists.qt-project.org/mailman/listinfo/interest


Re: [Interest] Qt Location GeoServices plugin to use geo-referenced image file as map source

2017-12-07 Thread Paolo Angelelli
Indeed! As answered in the bug report, the easy workaround is to cut your tif 
into tiles
(like using QGis w QTiler plugin or gdal2tiles, or whatever other mean), and 
then you
don't even need to serve the tiles via http, you can fetch them locally either 
from file
(file:///) or qrc, depending on how it's best for you to ship them.

On Thu, 7 Dec 2017 13:24:20 +0100
Vlad Stelmahovsky  wrote:

> Hi
> 
> take a look at OSM plugin. it contains custom providers and caching
> mechanism
> 
> On Thu, Dec 7, 2017 at 3:19 AM, Richard Lang  wrote:
> 
> > Repost of question asked on Qt Forums and raised as a feature request on
> > the bug tracker...
> >
> > https://forum.qt.io/topic/85704/qt-location-geoservices-
> > plugin-to-use-geo-referenced-image-file-as-map-source
> >
> > https://bugreports.qt.io/browse/QTBUG-65018?jql=project%20%3D%20QTBUG
> >
> > 
> >
> >
> > I'm currently working on a Qt Quick application that will provide a map
> > viewer for a smallish area (1 square KM or so), the map details for which
> > will be provided in a single geo-referenced image file (GeoTIFF,
> > geo-referenced PDF, ESRI Shape file etc.), along with display of current
> > location, operator identified points of interest etc. It's primarily
> > responsibility is the display of custom maps (as opposed to generic maps
> > retrieved from public map image service providers (OSM, MabBox, ESRI etc)),
> > and it will often be used in areas with limited connectivity
> >
> > An extensive web search has identified others who have made similar
> > enquiries in the past (in these forums, Stack Overflow etc), and the
> > general suggestions for solutions are as follows:
> >
> >- ArcGIS Runtime with Qt SDK *Doesn't work for me as down the track
> >I'm intending to target an embedded linux device using an ARM processor,
> >and ArcGIS doesn't make source available for cross-compilation for
> >arbitrary targets. They've recently produced an Android release, but
> >nothing for ARM linux in general)*
> >- QGIS developer libraries *GPL licence not compatible with my
> >commercial development*
> >- Use the Qt Location *Map* component with a local tile server or
> >offline tile collection,alongside a local tiling engine to create the
> >necessary tile set from the input image file.  *Seems a bit of a hack,
> >as noted I'm primarily using custom maps, as opposed to offline copies of
> >public map server images, and my images won't be big enough to otherwise
> >warrant tiling anyway*
> >
> > It would be feasible to develop a Qt Quick component from scratch to do
> > this, but given that the existing Qt Location *Map* component provides a
> > well defined pre-existing front end interface for everything my map would
> > need to do and has an extendable plugin based architecture, writing a
> > custom Qt Location GeoServices plugin seems the most sensible and elegant
> > way forward.
> >
> > I've started examining the source code of the existing plugins, but can't
> > shake the feeling that in a world containing 8 billion people, with
> > "nothing new under the sun", this would have been done already if it was a
> > good idea
> >
> > Would anyone with more familiarity with the Qt Location module care to
> > comment?
> >
> >
> > thanks
> >
> > Richard
> >
> >
> >
> >
> >
> > ___
> > Interest mailing list
> > Interest@qt-project.org
> > http://lists.qt-project.org/mailman/listinfo/interest
> >
> >  
> 
> 

___
Interest mailing list
Interest@qt-project.org
http://lists.qt-project.org/mailman/listinfo/interest


Re: [Interest] Set transparent fill on map using mapboxgl plugin

2017-10-25 Thread Paolo Angelelli
Hi, in this case i'm not 100% sure what you mean.
I just tried to create a Map using mapboxgl plugin, with a polyline on it, and 
set
the opacity to 0.5, and it seems to behave as expected.

So yes, i would say that it might be a bug worth to report with a sample :-)


On Tue, 24 Oct 2017 14:13:16 +0200
Ola Røer Thorsen  wrote:

> >
> > MapParameter {
> > type: "paint"
> > property var layer: "water-shadow"
> > property var fillOpacity: 0.1
> > }
> >
> >  
> ... sorry for accidentally pressing send.
> 
> It seems like the map does not handle transparency properly. I also tried
> creating my own mapbox style with most fill-colors set transparent. However
> in Qt Quick Map the transparent colors are rendered as black instead so the
> map cannot be used as an overlay on top of the rest of the Qt Quick scene.
> 
> Is this a bug, or simply not possible?
> 
> Best regards,
> Ola

___
Interest mailing list
Interest@qt-project.org
http://lists.qt-project.org/mailman/listinfo/interest


Re: [Interest] QGeoPositionInfo in QML

2017-10-24 Thread Paolo Angelelli
Hi Julius,

so there is currently no easy way to have a single interoperable source for 
position info.
Either you use the C++ source, and QGeoPositionInfo or, QML's PositionSource 
and Position.

If you want to have the same source, and the data coming from that source in 
both C++ and QML, i currently see 2
approaches: either you register your own QGeoPositionInfo QML wrapper with 
accessors, and push objects
of this kind into QML from the C++ source, or you go the other way around, and 
extract the relevant bits
from a Position in a JS piece of code, and push those into some structure (even 
a variant map) to C++.

It might be worth considering to (privately?) export PositionSource, so that, 
if one has specific needs,
could depend on positioning-private, and use the class from Cpp..

On Tue, 26 Sep 2017 09:37:25 +
"Bullinger, Julius"  wrote:

> Hi there,
> 
> in Qt Location, there's the QGeoPositionInfo 
> class for storing geo positions.
> There's also the Position QML 
> type with a matching 
> interface to do the same in QML.
> 
> However, I haven't had success trying to expose a QGeoPosition object as 
> Q_PROPERTY. In QML, the type will be reported as QVariant, and I cannot 
> access any properties.
> 
> What is the supposed way to use QGeoPositionInfo in QML? There's 
> QDeclarativePosition, but it's private.
> 
> Thanks and best regards,
> Julius
> 
> 
> Intel Deutschland GmbH
> Registered Address: Am Campeon 10-12, 85579 Neubiberg, Germany
> Tel: +49 89 99 8853-0, www.intel.de
> Managing Directors: Christin Eisenschmid, Christian Lamprechter
> Chairperson of the Supervisory Board: Nicole Lau
> Registered Office: Munich
> Commercial Register: Amtsgericht Muenchen HRB 186928

___
Interest mailing list
Interest@qt-project.org
http://lists.qt-project.org/mailman/listinfo/interest


Re: [Interest] Set transparent fill on map using mapboxgl plugin

2017-10-24 Thread Paolo Angelelli
On Mon, 23 Oct 2017 13:55:15 +0200
Ola Røer Thorsen  wrote:

> Hi, I'm evaluating using QtLocation's map using mapboxgl. Currently I'm
> using the default settings, default map style, default developer access
> token.
> 
> I'd like to set most layers' fill color to transparent, to see how it works
> out as an overlay on top of some live video.
> 
> From the documentation it seems like I can use the MapParameter items to do
> this, but so far I haven't been able to do anything to change the existing
> layers.
> 
> Anyone have some hints for me how to do this? Basically i'd like to set the
> colors for layers like the background, water, etc. to transparent.
> 
> Best regards,
> Ola

Hi,
 on this the mbgl documentation is a bit lacking ( there's even an open bug 
report on this, QTBUG-62453 ).
However, the way it works at the moment is that, if you give an objectName, say 
"foo", to your map item, then you can
reference the resulting mapboxgl layer using "QtLocation-foo" as layer name.

Example (setting some layout props):

MapPolyline {
objectName: 'poly'
id: poly
line.width: 10
line.color: 'deepskyblue'
path : 
} 

MapParameter {
type: 'layout'
property var layer: 'QtLocation-poly'
property var lineJoin: 'round'
property var lineCap: 'round'
}

For your specific problem, if this is going to work, it's probably by setting 
some of the properties described
in https://www.mapbox.com/mapbox-gl-js/style-spec/#layers-fill


best,
Paolo
___
Interest mailing list
Interest@qt-project.org
http://lists.qt-project.org/mailman/listinfo/interest


Re: [Interest] Plane rotations

2017-04-05 Thread Paolo Angelelli
Just cross N and M to get the vector around which to rotate.

Then use a QQuaternion to set the rotation in the Qt3DCore::QTransform, 
and construct it with fromAxisAndAngle(const QVector3D , float angle)


On Wed, 5 Apr 2017 14:18:56 +0300
Igor Mironchik  wrote:

> Hello,
> 
> Let's say I have two vectors - N (normal vector to plane P1) and M 
> (normal vector to plane P2).
> 
> How to calculate x, y, z axis rotations angles for plane P2 to make 
> plane P2 parallel to P1?
> 
> How to calculate x, y, z axis rotations angles for plane P2 to rotate it 
> around vector N?
> 
> Thank you.
> 
> And what is the measurement of angle in rotationX() of Qt3DCore::QTransform?
> 
> I need to calculate angles in this units.
> 
> ___
> Interest mailing list
> Interest@qt-project.org
> http://lists.qt-project.org/mailman/listinfo/interest




___
Interest mailing list
Interest@qt-project.org
http://lists.qt-project.org/mailman/listinfo/interest


Re: [Interest] How to get all MapItems in a given region?

2016-11-19 Thread Paolo Angelelli
Hi,

You are right, there is no api for this at the moment.
We are considering whether to add one, and whether to base it on some
acceleration structure.

For now, the best you can do is to keep track of the map items yourself
and query your structure
(yes, map items also miss a bounding box at the present, hopefully they
will get it in 5.9)

best
Paolo

On Tue, 08 Nov 2016 13:10:41 +0530
Kishore Jonnalagadda  wrote:

> I could not find any API for this... I want to be able to get a list
> of all the mapitems on a map that have coordinates that lie within a
> given (rectangular) region. What is the best way to do this?
> 
> The only way I see right now is to iterate all the items returned by
> the mapItems() API and check if each one has coordinates that lie
> within my region of interest. Depending on the total number of
> mapItems present on the map, this may be very inefficient. Hence the
> question.

___
Interest mailing list
Interest@qt-project.org
http://lists.qt-project.org/mailman/listinfo/interest


Re: [Interest] How do i declare a QGeoCoordinate property in QML?

2016-09-26 Thread Paolo Angelelli
Hi Kishore, have you tried "property var coordinate"?

best
Paolo

On Mon, 26 Sep 2016 16:11:03 +0530
Kishore Jonnalagadda  wrote:

> I have created an custom Item in which I want to have a coordinate
> property. Further i want to create aliases to the coordinates
> properties. How do i go about this?
> 
> Example:
> 
> /**/
> Item {
>   id: myCustomItem
> 
>   property coordinate coordinate
>   property alias latitude: coordinate.latitude
>   property alias longitude: coordinate.longitude
>   property alias altitude: coordinate.altitude
> }
> /**/
> 
> I have also tried the following format...
> 
> /**/
> Item {
> id: myCustomItem
> 
> property alias coordinate: coordinate
> property alias latitude: coordinate.latitude
> property alias longitude: coordinate.longitude
> property alias altitude: coordinate.altitude
> 
> Coordinate {id: coordinate}
> }
> /**/
> 
> But for some reason, the second form results in a segmentation fault.

___
Interest mailing list
Interest@qt-project.org
http://lists.qt-project.org/mailman/listinfo/interest


Re: [Interest] How to dynamically add a MapItemView to a Map?

2016-09-08 Thread Paolo Angelelli
It is odd since i tried to correct your code and then it was working
form me.
But feel free to open a bugreport with some sample code that can be
built and run to demonstrate the problem :-)

best,
Paolo

On Thu, 8 Sep 2016 10:04:27 +0530
Kishore J <kitts.mailingli...@gmail.com> wrote:

> Thanks! I understand how that can be an issue. However, I now removed
> the enclosing Component (Which really did not do anything). Still, if
> i do not call addMapItem() it does not show on the map.
> --
> Regards,
> Kishore
> 
> On Wed, Sep 7, 2016 at 7:45 PM, Paolo Angelelli
> <paolo.angele...@qt.io> wrote:
> 
> > I see i forgot to answer one question, about delegates and
> > addMapItem.
> >
> > The problem in your case is that your delegate is incorrect.
> > The delegate of a MapItemView must be a Map Item subclass,
> > that means MapCircle MapRectangle MapPolygon etc.
> >
> > If you have it wrapped into a Component, when this component gets
> > addMapItem'd to the map, it will be also skipped.
> >
> > try removing the Component wrapper, and you'll see it works.
> > (and by the way in your example you miss a window, so the example
> > doesn't work as is)
> >
> > best,
> > Paolo
> >
> > On Tue, 6 Sep 2016 22:53:31 +0530
> > Kishore J <kitts.mailingli...@gmail.com> wrote:
> >
> > > Done. https://bugreports.qt.io/browse/QTBUG-55782
> > >
> > > Given the limitation, I think my immediate alternative is to
> > > create a MapItemView like component that is instantiated outside
> > > and write code in the map that calls addMapItem and removeMapItem
> > > on the map as and when the list is modified. To the drawing
> > > board...
> > >
> > > Is the patch for the bug requiring to call addMapItem for each
> > > item in the MapItemView delegate is due for the next release?
> > > i.e. 5.8?
> > >
> > > How about the bug relating to the setting the center of the map?
> > > Its easy to work around but I want to know if it's me doing
> > > something wrong. --
> > > Regards,
> > > Kishore
> > >
> > > On Tue, Sep 6, 2016 at 9:25 PM, Paolo Angelelli
> > > <paolo.angele...@qt.io> wrote:
> > >
> > > > On Tue, 6 Sep 2016 19:04:34 +0530
> > > > Kishore J <kitts.mailingli...@gmail.com> wrote:
> > > >
> > > > > Hi
> > > > >
> > > > > I am inching forward with using QML maps in my C++
> > > > > application. Now i'm interested in dynamically adding
> > > > > multiple MapItemView objects to a given map.
> > > > >
> > > > >
> > > > > import QtQuick 2.5
> > > > > import QtLocation 5.6
> > > > >
> > > > > Map {
> > > > > id: map
> > > > > objectName: "MyMap"
> > > > > // zoomLevel: (maximumZoomLevel - minimumZoomLevel)/2
> > > > > zoomLevel: minimumZoomLevel
> > > > >
> > > > > plugin: Plugin {
> > > > > name: "here"
> > > > > PluginParameter {name: "here.app_id"; value: "x"}
> > > > > PluginParameter {name: "here.token"; value: "x"}
> > > > > }
> > > > > // activeMapType: supportedMapTypes[3]
> > > > > center {
> > > > > latitude: 10
> > > > > longitude: 20
> > > > > }
> > > > >
> > > > > MapCircle {
> > > > > id: staticCircle
> > > > > center {
> > > > > latitude: 5
> > > > > longitude: 10
> > > > > }
> > > > > radius: 50.0
> > > > > color: 'yellow'
> > > > > border.width: 4
> > > > > border.color: 'yellow'
> > > > > Component.onCompleted: {
> > > > > console.debug("Loaded static MapCircle")
> > > > > console.debug(center + ' radius: ' + radius)
> > > > > }
> > > > > Component.onDestruction: {
> > > > > console.debug("Unloaded static MapCircle")
> > > > > }
> > > > > }
> > > > >
> > > > > MapItemView {
> > 

Re: [Interest] How to dynamically add a MapItemView to a Map?

2016-09-07 Thread Paolo Angelelli
I see i forgot to answer one question, about delegates and addMapItem.

The problem in your case is that your delegate is incorrect.
The delegate of a MapItemView must be a Map Item subclass,
that means MapCircle MapRectangle MapPolygon etc.

If you have it wrapped into a Component, when this component gets
addMapItem'd to the map, it will be also skipped. 

try removing the Component wrapper, and you'll see it works.
(and by the way in your example you miss a window, so the example
doesn't work as is)

best,
Paolo

On Tue, 6 Sep 2016 22:53:31 +0530
Kishore J <kitts.mailingli...@gmail.com> wrote:

> Done. https://bugreports.qt.io/browse/QTBUG-55782
> 
> Given the limitation, I think my immediate alternative is to create a
> MapItemView like component that is instantiated outside and write
> code in the map that calls addMapItem and removeMapItem on the map as
> and when the list is modified. To the drawing board...
> 
> Is the patch for the bug requiring to call addMapItem for each item
> in the MapItemView delegate is due for the next release? i.e. 5.8?
> 
> How about the bug relating to the setting the center of the map? Its
> easy to work around but I want to know if it's me doing something
> wrong. --
> Regards,
> Kishore
> 
> On Tue, Sep 6, 2016 at 9:25 PM, Paolo Angelelli
> <paolo.angele...@qt.io> wrote:
> 
> > On Tue, 6 Sep 2016 19:04:34 +0530
> > Kishore J <kitts.mailingli...@gmail.com> wrote:
> >
> > > Hi
> > >
> > > I am inching forward with using QML maps in my C++ application.
> > > Now i'm interested in dynamically adding multiple MapItemView
> > > objects to a given map.
> > >
> > >
> > > import QtQuick 2.5
> > > import QtLocation 5.6
> > >
> > > Map {
> > > id: map
> > > objectName: "MyMap"
> > > // zoomLevel: (maximumZoomLevel - minimumZoomLevel)/2
> > > zoomLevel: minimumZoomLevel
> > >
> > > plugin: Plugin {
> > > name: "here"
> > > PluginParameter {name: "here.app_id"; value: "x"}
> > > PluginParameter {name: "here.token"; value: "x"}
> > > }
> > > // activeMapType: supportedMapTypes[3]
> > > center {
> > > latitude: 10
> > > longitude: 20
> > > }
> > >
> > > MapCircle {
> > > id: staticCircle
> > > center {
> > > latitude: 5
> > > longitude: 10
> > > }
> > > radius: 50.0
> > > color: 'yellow'
> > > border.width: 4
> > > border.color: 'yellow'
> > > Component.onCompleted: {
> > > console.debug("Loaded static MapCircle")
> > > console.debug(center + ' radius: ' + radius)
> > > }
> > > Component.onDestruction: {
> > > console.debug("Unloaded static MapCircle")
> > > }
> > > }
> > >
> > > MapItemView {
> > > id: mapitemview
> > > objectName: "MyMapItemView"
> > > model: ListModel {
> > > id: list
> > > ListElement{lat: 10; lon: 20; rad: 80}
> > > ListElement{lat: 30; lon: 40; rad: 70}
> > > }
> > > delegate: Component {
> > > id: delegate
> > >
> > > MapCircle {
> > > id: dynmapcircle
> > > center {
> > > latitude: lat;
> > > longitude: lon;
> > > }
> > > radius: 50.0
> > > color: 'black'
> > > border.width: 4
> > > border.color: 'black'
> > > Component.onCompleted: {
> > > console.count("Loaded a MapCircle")
> > > map.addMapItem(dynmapcircle)
> > > }
> > > }
> > > }
> > >
> > > Component.onCompleted: {
> > > console.debug("Loaded first MapItemView")
> > > console.debug(model.count)
> > > }
> > > Component.onDestruction: {
> > > console.debug("Unloaded first MapItemView")
&g

Re: [Interest] How to dynamically add a MapItemView to a Map?

2016-09-07 Thread Paolo Angelelli
Thanks for the suggestion, now it's easier not to forget about it :-)

As for the patch i mentioned, that was related to the map center issue
you reported.
Patch being: https://codereview.qt-project.org/168204 (now merged in
5.7)

best,
Paolo


On Tue, 6 Sep 2016 22:53:31 +0530
Kishore J <kitts.mailingli...@gmail.com> wrote:

> Done. https://bugreports.qt.io/browse/QTBUG-55782
> 
> Given the limitation, I think my immediate alternative is to create a
> MapItemView like component that is instantiated outside and write
> code in the map that calls addMapItem and removeMapItem on the map as
> and when the list is modified. To the drawing board...
> 
> Is the patch for the bug requiring to call addMapItem for each item
> in the MapItemView delegate is due for the next release? i.e. 5.8?
> 
> How about the bug relating to the setting the center of the map? Its
> easy to work around but I want to know if it's me doing something
> wrong. --
> Regards,
> Kishore
> 
> On Tue, Sep 6, 2016 at 9:25 PM, Paolo Angelelli
> <paolo.angele...@qt.io> wrote:
> 
> > On Tue, 6 Sep 2016 19:04:34 +0530
> > Kishore J <kitts.mailingli...@gmail.com> wrote:
> >
> > > Hi
> > >
> > > I am inching forward with using QML maps in my C++ application.
> > > Now i'm interested in dynamically adding multiple MapItemView
> > > objects to a given map.
> > >
> > >
> > > import QtQuick 2.5
> > > import QtLocation 5.6
> > >
> > > Map {
> > > id: map
> > > objectName: "MyMap"
> > > // zoomLevel: (maximumZoomLevel - minimumZoomLevel)/2
> > > zoomLevel: minimumZoomLevel
> > >
> > > plugin: Plugin {
> > > name: "here"
> > > PluginParameter {name: "here.app_id"; value: "x"}
> > > PluginParameter {name: "here.token"; value: "x"}
> > > }
> > > // activeMapType: supportedMapTypes[3]
> > > center {
> > > latitude: 10
> > > longitude: 20
> > > }
> > >
> > > MapCircle {
> > > id: staticCircle
> > > center {
> > > latitude: 5
> > > longitude: 10
> > > }
> > > radius: 50.0
> > > color: 'yellow'
> > > border.width: 4
> > > border.color: 'yellow'
> > > Component.onCompleted: {
> > > console.debug("Loaded static MapCircle")
> > > console.debug(center + ' radius: ' + radius)
> > > }
> > > Component.onDestruction: {
> > > console.debug("Unloaded static MapCircle")
> > > }
> > > }
> > >
> > > MapItemView {
> > > id: mapitemview
> > > objectName: "MyMapItemView"
> > > model: ListModel {
> > > id: list
> > > ListElement{lat: 10; lon: 20; rad: 80}
> > > ListElement{lat: 30; lon: 40; rad: 70}
> > > }
> > > delegate: Component {
> > > id: delegate
> > >
> > > MapCircle {
> > > id: dynmapcircle
> > > center {
> > > latitude: lat;
> > > longitude: lon;
> > > }
> > > radius: 50.0
> > > color: 'black'
> > > border.width: 4
> > > border.color: 'black'
> > > Component.onCompleted: {
> > > console.count("Loaded a MapCircle")
> > > map.addMapItem(dynmapcircle)
> > > }
> > > }
> > > }
> > >
> > > Component.onCompleted: {
> > > console.debug("Loaded first MapItemView")
> > > console.debug(model.count)
> > > }
> > > Component.onDestruction: {
> > > console.debug("Unloaded first MapItemView")
> > > }
> > > }
> > >
> > > MapItemView {
> > > id: mapitemview2
> > > objectName: "MyMapItemView2"
> > > model: ListModel {
> > > id: list2
> > &g

Re: [Interest] How to dynamically add a MapItemView to a Map?

2016-09-06 Thread Paolo Angelelli
On Tue, 6 Sep 2016 19:04:34 +0530
Kishore J  wrote:

> Hi
> 
> I am inching forward with using QML maps in my C++ application. Now
> i'm interested in dynamically adding multiple MapItemView objects to
> a given map.
> 
> 
> import QtQuick 2.5
> import QtLocation 5.6
> 
> Map {
> id: map
> objectName: "MyMap"
> // zoomLevel: (maximumZoomLevel - minimumZoomLevel)/2
> zoomLevel: minimumZoomLevel
> 
> plugin: Plugin {
> name: "here"
> PluginParameter {name: "here.app_id"; value: "x"}
> PluginParameter {name: "here.token"; value: "x"}
> }
> // activeMapType: supportedMapTypes[3]
> center {
> latitude: 10
> longitude: 20
> }
> 
> MapCircle {
> id: staticCircle
> center {
> latitude: 5
> longitude: 10
> }
> radius: 50.0
> color: 'yellow'
> border.width: 4
> border.color: 'yellow'
> Component.onCompleted: {
> console.debug("Loaded static MapCircle")
> console.debug(center + ' radius: ' + radius)
> }
> Component.onDestruction: {
> console.debug("Unloaded static MapCircle")
> }
> }
> 
> MapItemView {
> id: mapitemview
> objectName: "MyMapItemView"
> model: ListModel {
> id: list
> ListElement{lat: 10; lon: 20; rad: 80}
> ListElement{lat: 30; lon: 40; rad: 70}
> }
> delegate: Component {
> id: delegate
> 
> MapCircle {
> id: dynmapcircle
> center {
> latitude: lat;
> longitude: lon;
> }
> radius: 50.0
> color: 'black'
> border.width: 4
> border.color: 'black'
> Component.onCompleted: {
> console.count("Loaded a MapCircle")
> map.addMapItem(dynmapcircle)
> }
> }
> }
> 
> Component.onCompleted: {
> console.debug("Loaded first MapItemView")
> console.debug(model.count)
> }
> Component.onDestruction: {
> console.debug("Unloaded first MapItemView")
> }
> }
> 
> MapItemView {
> id: mapitemview2
> objectName: "MyMapItemView2"
> model: ListModel {
> id: list2
> ListElement{lat: -10; lon: 20; rad: 80}
> ListElement{lat: -30; lon: 40; rad: 70}
> }
> delegate: Component {
> id: delegate2
> 
> MapCircle {
> id: dynmapcircle2
> center {
> latitude: lat;
> longitude: lon;
> }
> radius: 50.0
> color: 'blue'
> border.width: 4
> border.color: 'blue'
> Component.onCompleted: {
> console.count("Loaded a MapCircle2")
> map.addMapItem(dynmapcircle2)
> }
> }
> }
> 
> Component.onCompleted: {
> console.debug("Loaded second MapItemView")
> }
> Component.onDestruction: {
> console.debug("Unloaded second MapItemView")
> }
> }
> 
> Component.onCompleted:{
> center.latitude = 10
> center.longitude = 20
> console.debug('Loaded map ' + map.center)
> }
> Component.onDestruction:{
> console.debug('Unloaded map')
> }
> }
> 
> Further, i do not understand why i have to call the map.addMapItem()
> function for each MapItem. I suspect that, that is the source of my
> problem. I am currently able to define a separate qml file containing
> the second MapItemView which i instantiate in C++ and set the map as
> it's parent but that does not work.
> 
> Any help would be appreciated.
> --
> Regards,
> Kishore
> 
> PS: I also seem to be facing another issue where the center value
> specified in the map initialization does not work and I have to set
> the center in the onCompleted() slot. Funnily, it only considers the
> Latitude or Longitude value in the initialization depending on which
> is first specified!

Hi, for the first question, the answer is "you can't".
This is a limitation of the current API, and something that might be
worthwile extending.
So feel free to send a feature request to jira.

For the second question, please have a look if the (now merged) patch
fixes your bug

best,
Paolo
___
Interest mailing list
Interest@qt-project.org
http://lists.qt-project.org/mailman/listinfo/interest


Re: [Interest] QML Map & MapQuest

2016-08-26 Thread Paolo Angelelli
On Fri, 26 Aug 2016 07:00:30 +
Alexander Blasche  wrote:

> Hi,
> 
> >Since July 11, 2016 MapQuest disabled direct tile access. So QML Map
> >doesn't support MapQuest anymore. So my question when MapQuest
> >support will be implemented again?
> 
> The fix is detailed in https://bugreports.qt.io/browse/QTBUG-54599
> 
> We had to move away from MapQuest. To facilitate quicker changes in
> the future we added a level of indirection which permits us to
> redirect OSM based geoservice requests to a new service if the same
> problem occurs with the new service. This fix will be part of 5.6.2,
> 5.7.1 & 5.8.0 alpha.
> 
> I would like to point out that we discourage the use of the OSM
> plugin in production code. The same thing can happen again and
> although we have an additional indirection it is no insurance that we
> find yet another free map service thereafter. Even if we have a new
> alternative the maps may likely look completely different and your
> user experience would change underneath you. 
> 
> In summary you may use the OSM in production at your own risk. If
> this risk is not acceptable then please one of the other existing
> plugins. They have commercial T which implies that you have a
> business relationship with the provider. This reduces the risk of
> drastic changes and even if it does change, you get informed about it
> and can react early.
> 
> --
> Alex
> ___
> Interest mailing list
> Interest@qt-project.org
> http://lists.qt-project.org/mailman/listinfo/interest

I guess the easy answer is when someone will write a geoservice plugin
for MapQuest :-)

I would also like to add to Alex answer that, if you really want to use
our OSM plugin in production, you should consider using your own
redirection server/url where you have control over what servers are
in use and when.

You can of course copy what is hosted @ maps-redirect.qt.io/osm,
but, as Alex said, if, say, Thunderforest will shut down the open
access service, we might be forced to disable those map types.

If you use your own redirection server and files, you can always
switch to a provider that needs a token, and embed the token in
the template URL.



___
Interest mailing list
Interest@qt-project.org
http://lists.qt-project.org/mailman/listinfo/interest