In questa pagina

Esempio Reddit

Mostra come effettuare l'autenticazione con OAuth 2 per accedere a Reddit.

Screenshot dell'esempio

L'esempio Reddit utilizza OAuth 2, supportato dall'autorizzazionQt Network , per effettuare l'accesso a Reddit e visualizzare i post di Reddit (in formato testo) associati all'utente autenticato.

Per utilizzare questo esempio, è necessaria una chiave consumer fornita da Reddit. Per registrare l'applicazione, visitare https://www.reddit.com/prefs/apps/.

Nota: quando si crea l’applicazione,selezionare “app installata ”.

Nota: nelle impostazioni di Reddit,imposta l’URI di reindirizzamento su http://localhost:1337/.

Esecuzione dell’esempio

È possibile eseguire l'esempio da:

Prima dell’avvio, aggiungi --client-id alla riga di comando dell’eseguibile, seguito dalla tua chiave consumer disponibile su https://www.reddit.com/prefs/apps/.

Progetto di esempio su code.qt.io

© 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.