演示采用 OAuth 2 進行身份驗證以訪問 Reddit。
The Reddit 範例使用 OAuth 2,因為支持通過 Qt Network Authorization , to sign in to Reddit and display the Reddit posts (in text format) associated with the authenticated user.
To use this example, a consumer key from Reddit is needed. To register the application visit https://www.reddit.com/prefs/apps/ .
注意: Choose 安裝 APP 當創建應用程序時。
注意: 將重定嚮 URI (統一資源標識符) 設為 http://localhost:1337/ 在 Reddit 設置中。
要運行範例從 Qt Creator ,打開 歡迎 模式,然後選擇範例從 範例 。更多信息,見 Qt Creator:教程:構建並運行 .
Before launching, add
--client-id
to the executable command line, followed by your consumer key from
https://www.reddit.com/prefs/apps/
.