geoShape QML Value Type
Un tipo geoShape rappresenta un'area geografica astratta. Per saperne di più...
| Import Statement: | import QtPositioning |
Proprietà
Metodi
- bool contains(geoCoordinate coord)
Descrizione dettagliata
Questo tipo è una rappresentazione QML di ` QGeoShape `, ovvero un'area geografica astratta. Include attributi e metodi comuni a tutte le aree geografiche. Per creare oggetti che rappresentino un'area geografica valida, utilizzare ` geoRectangle ` o ` geoCircle`.
L'attributo ` isValid ` può essere utilizzato per verificare se la forma rappresenta un'area geografica valida.
L'attributo ` isEmpty ` può essere utilizzato per verificare se la forma rappresenta una regione con area geometrica pari a 0.
Il metodo ` contains()` può essere utilizzato per verificare se un oggetto ` geoCoordinate ` si trova all'interno della forma.
Esempio di utilizzo
Per creare un valore geoShape, utilizzare la funzione QtPositioning.shape():
Quando si integra con C++, tenere presente che qualsiasi valore QGeoShape passato a QML da C++ viene automaticamente convertito in un valore geoShape e viceversa.
Documentazione delle proprietà
isEmpty : bool
Restituisce se questa figura è vuota. Una figura vuota è una regione con area geometrica pari a 0.
isValid : bool
Indica se questa forma è valida.
Una forma è considerata non valida se alcuni dei dati necessari per descriverla in modo univoco non sono stati impostati o sono stati impostati con un valore non idoneo.
type : ShapeType
Restituisce il tipo corrente della forma.
GeoShape.UnknownType- Il tipo della forma non è noto.GeoShape.RectangleType- La forma è un geoRectangle.GeoShape.CircleType- La forma è di tipo ` geoCircle`.GeoShape.PathType- La forma è un'geoPath. (A partire da Qt 5.9)GeoShape.PolygonType- La forma è un'geoPolygon. (A partire da Qt 5.10)
Questa proprietà Qml è stata introdotta con Qt 5.5.
Documentazione del metodo
bool contains(geoCoordinate coord)
Restituisce true se l'coordinate e specificato da coord rientra in questa forma; in caso contrario, restituisce false.
© 2026 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.