QPlaceContentRequest Class
La classe QPlaceContentRequest rappresenta i parametri di una richiesta di contenuto. Per saperne di più...
| Header: | #include <QPlaceContentRequest> |
| qmake: | QT += location |
Funzioni pubbliche
| QPlaceContentRequest() | |
| QPlaceContentRequest(const QPlaceContentRequest &other) | |
| QPlaceContentRequest(QPlaceContentRequest &&other) | |
| ~QPlaceContentRequest() | |
| void | clear() |
| QVariant | contentContext() const |
| QPlaceContent::Type | contentType() const |
| int | limit() const |
| QString | placeId() const |
| void | setContentContext(const QVariant &context) |
| void | setContentType(QPlaceContent::Type type) |
| void | setLimit(int limit) |
| void | setPlaceId(const QString &identifier) |
| QPlaceContentRequest & | operator=(const QPlaceContentRequest &other) |
Elementi non membri correlati
| bool | operator!=(const QPlaceContentRequest &lhs, const QPlaceContentRequest &rhs) |
| bool | operator==(const QPlaceContentRequest &lhs, const QPlaceContentRequest &rhs) |
Descrizione dettagliata
La classe QPlaceContentRequest viene utilizzata insieme a un oggetto QPlaceManager per recuperare contenuti multimediali, come immagini e recensioni, in modo paginato. Il codice seguente richiederebbe una serie di 5 immagini a partire dal decimo indice:
QPlaceContentRequest request;
request.setContentType(QPlaceContent::ImageType);
request.setPlaceId(place.placeId());
request.setLimit(5);
QPlaceContentReply *contentReply = manager->getPlaceContent(request);
//..connect signals..//
...
...
void contentHandler() {
if (contentReply->error() == QPlaceReply::NoError) {
place.insertContent(contentReply->request().contentType(),
contentReply->content());
}
}Vedi anche QPlaceContentReply.
Documentazione delle funzioni membro
QPlaceContentRequest::QPlaceContentRequest()
Crea un nuovo oggetto richiesta.
[noexcept] QPlaceContentRequest::QPlaceContentRequest(const QPlaceContentRequest &other)
Crea una copia di other.
[constexpr noexcept default] QPlaceContentRequest::QPlaceContentRequest(QPlaceContentRequest &&other)
Crea un'istanza di ` QPlaceContentRequest`.
[noexcept] QPlaceContentRequest::~QPlaceContentRequest()
Elimina l'oggetto della richiesta
void QPlaceContentRequest::clear()
Cancella la richiesta di contenuto.
QVariant QPlaceContentRequest::contentContext() const
Restituisce il contesto di contenuto aggiuntivo specifico del backend associato alla richiesta di contenuto relativa a questa località.
Vedi anche setContentContext().
QPlaceContent::Type QPlaceContentRequest::contentType() const
Restituisce il tipo di contenuto da richiedere, ad esempio recensioni o immagini
Vedi anche setContentType().
int QPlaceContentRequest::limit() const
Restituisce il numero massimo di elementi di contenuto da recuperare.
Un valore negativo per il parametro `limit` indica che non è definito. Spetta al provider del backend scegliere un numero appropriato di elementi da restituire.
Il limite predefinito è -1.
Vedi anche setLimit().
QString QPlaceContentRequest::placeId() const
Restituisce l'identificatore della posizione da cui recuperare il contenuto.
Vedi anche setPlaceId().
void QPlaceContentRequest::setContentContext(const QVariant &context)
Imposta il contesto del contenuto su context.
Nota: questo metodo è destinato all'uso da parte dei plugin dei servizi geografici quando restituiscono risultati relativi ai contenuti di un luogo.
Il contesto di contenuto viene utilizzato dai backend per memorizzare ulteriori informazioni relative alla richiesta di contenuto. È necessario compilare anche altri campi pertinenti. Ad esempio, se la richiesta di contenuto riguarda un'immagine, anche il tipo di contenuto deve essere impostato su setContentType(). Il contesto di contenuto consente di conservare informazioni aggiuntive non direttamente accessibili tramite l'API Qt Location.
Il contesto del contenuto può essere di qualsiasi tipo memorizzabile in un QVariant. Il valore del contesto del contenuto non è destinato ad essere utilizzato direttamente dalle applicazioni.
Vedi anche ` contentContext()`.
void QPlaceContentRequest::setContentType(QPlaceContent::Type type)
Imposta l’ type e del contenuto da richiedere.
Vedi anche contentType().
void QPlaceContentRequest::setLimit(int limit)
Imposta il numero massimo di elementi di contenuto da recuperare su limit.
Vedi anche limit().
void QPlaceContentRequest::setPlaceId(const QString &identifier)
Imposta l'identificatore del sito da cui recuperare i contenuti su identifier.
Vedi anche placeId().
[noexcept] QPlaceContentRequest &QPlaceContentRequest::operator=(const QPlaceContentRequest &other)
Assegna “ other ” a questa richiesta di contenuto e restituisce un riferimento a tale richiesta.
Utenti non iscritti correlati
[noexcept] bool operator!=(const QPlaceContentRequest &lhs, const QPlaceContentRequest &rhs)
Restituisce "true" se lhs non è uguale a rhs, altrimenti restituisce "false".
[noexcept] bool operator==(const QPlaceContentRequest &lhs, const QPlaceContentRequest &rhs)
Restituisce true se lhs è uguale a rhs, altrimenti 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.