Reddit の例
RedditにアクセスするためのOAuth 2による認証の仕組みを説明しています。

このRedditのサンプルでは、Redditがサポートしている Qt Network AuthorizationRedditにサインインし、認証されたユーザーに関連付けられたRedditの投稿(テキスト形式)を表示します。
このサンプルを使用するには、Reddit からのコンシューマーキーが必要です。アプリケーションを登録するには、https://www.reddit.com/prefs/apps/ にアクセスしてください。
注: アプリケーションを作成する際は、「インストール済みアプリ」を選択してください 。
注: Reddit の設定で、リダイレクト URI をhttp://localhost:1337/に設定してください 。
例の起動
以下の手順でサンプルを実行できます:
- Qt Creator
Welcome モードを開き、Examples からこのサンプルを選択してください。詳細については、Qt Creator の「チュートリアル:ビルドと実行」を参照してください。
- Qt Extension for Visual Studio Code
Command Palette から `Qt: Open Qt examples ` コマンドを実行し、リストからサンプルを選択します。詳細については、Qt Extension for Visual Studio Code の「チュートリアル:ビルドと実行」を参照してください。
実行する前に、実行可能コマンドラインに「--client-id 」を追加し、その後にhttps://www.reddit.com/prefs/apps/ から取得したコンシューマーキーを続けて指定してください。
© 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.