Suche senden
Hochladen
QML を用いた YouTube クライアントの作成 - 関東 Qt 勉強会
•
1 gefällt mir
•
2,390 views
Jumpei Ogawa
Folgen
Melden
Teilen
Melden
Teilen
1 von 28
Jetzt herunterladen
Downloaden Sie, um offline zu lesen
Empfohlen
Try Jetpack
Try Jetpack
Hideaki Miyake
俺のXcodeがiBeaconを 発信しながらGistに投稿できるわけがない
俺のXcodeがiBeaconを 発信しながらGistに投稿できるわけがない
Toshiki Chiba
Jetpack Workshop
Jetpack Workshop
Hideaki Miyake
node+socket.io+enchant.jsでチャットゲーを作る
node+socket.io+enchant.jsでチャットゲーを作る
Kiyoshi SATOH
Pycon2014 django performance
Pycon2014 django performance
hirokiky
仕事の手離れを良くする手段としての、静的検査のあるテンプレートエンジン (YATT::Lite talk at 2014 テンプレートエンジンNight)
仕事の手離れを良くする手段としての、静的検査のあるテンプレートエンジン (YATT::Lite talk at 2014 テンプレートエンジンNight)
Hiroaki KOBAYASHI
Djangoによるスマホアプリバックエンドの実装
Djangoによるスマホアプリバックエンドの実装
Nakazawa Yuichi
concrete5デザインカスタマイズに必要なPHPの知識
concrete5デザインカスタマイズに必要なPHPの知識
Hishikawa Takuro
Empfohlen
Try Jetpack
Try Jetpack
Hideaki Miyake
俺のXcodeがiBeaconを 発信しながらGistに投稿できるわけがない
俺のXcodeがiBeaconを 発信しながらGistに投稿できるわけがない
Toshiki Chiba
Jetpack Workshop
Jetpack Workshop
Hideaki Miyake
node+socket.io+enchant.jsでチャットゲーを作る
node+socket.io+enchant.jsでチャットゲーを作る
Kiyoshi SATOH
Pycon2014 django performance
Pycon2014 django performance
hirokiky
仕事の手離れを良くする手段としての、静的検査のあるテンプレートエンジン (YATT::Lite talk at 2014 テンプレートエンジンNight)
仕事の手離れを良くする手段としての、静的検査のあるテンプレートエンジン (YATT::Lite talk at 2014 テンプレートエンジンNight)
Hiroaki KOBAYASHI
Djangoによるスマホアプリバックエンドの実装
Djangoによるスマホアプリバックエンドの実装
Nakazawa Yuichi
concrete5デザインカスタマイズに必要なPHPの知識
concrete5デザインカスタマイズに必要なPHPの知識
Hishikawa Takuro
Djangoフレームワークの紹介
Djangoフレームワークの紹介
Shinya Okano
jQuery Performance Tips – jQueryにおける高速化 -
jQuery Performance Tips – jQueryにおける高速化 -
Hayato Mizuno
WordPressとjQuery
WordPressとjQuery
Seto Takahiro
WordPressプラグイン作成入門
WordPressプラグイン作成入門
Yuji Nojima
TDC20111031_Groovy_Geb
TDC20111031_Groovy_Geb
Nobuhiro Sue
.htaccessによるリダイレクト徹底解説
.htaccessによるリダイレクト徹底解説
Cherry Pie Web
Dgeni with AngularJS Application
Dgeni with AngularJS Application
K Kinzal
2005 07 30_xwj_customizinig
2005 07 30_xwj_customizinig
Tom Hayakawa
Ginとbindataで作るシングルバイナリWebApp
Ginとbindataで作るシングルバイナリWebApp
Akihiko Horiuchi
EC-CUBEプラグイン講義
EC-CUBEプラグイン講義
ria1201
20120118 titanium
20120118 titanium
Hiroshi Oyamada
Pythonで電卓アプリ(デスクトップ)を作成する
Pythonで電卓アプリ(デスクトップ)を作成する
Jun Okazaki
Google App Engine for Java
Google App Engine for Java
Takuya Tsuchida
仕事で使うちょっとしたコードをOSSとして開発メンテしていく- Django Redshift Backend の開発 - PyCon JP 2016
仕事で使うちょっとしたコードをOSSとして開発メンテしていく- Django Redshift Backend の開発 - PyCon JP 2016
Takayuki Shimizukawa
Nuxt なしで Vue App 作る時に乗り越えるべき5つの壁
Nuxt なしで Vue App 作る時に乗り越えるべき5つの壁
Yutaro Miyazaki
Chrome Extensionsの基本とデザインパターン
Chrome Extensionsの基本とデザインパターン
Yoichiro Tanaka
翻訳から始めるVue.js 入門
翻訳から始めるVue.js 入門
Makoto Chiba
プロダクトに 1 から Vue.js を導入した話
プロダクトに 1 から Vue.js を導入した話
Shohei Okada
JJUG CCC 2011 Fall / Web test automation with Geb and Spock
JJUG CCC 2011 Fall / Web test automation with Geb and Spock
Nobuhiro Sue
getAllEntriesByKey vs createViewNavFromKey
getAllEntriesByKey vs createViewNavFromKey
Haruyuki Nakano
Azure IoT Edge で Custom Vision
Azure IoT Edge で Custom Vision
Yoshitaka Seo
13016 n分で作るtype scriptでnodejs
13016 n分で作るtype scriptでnodejs
Takayoshi Tanaka
Weitere ähnliche Inhalte
Was ist angesagt?
Djangoフレームワークの紹介
Djangoフレームワークの紹介
Shinya Okano
jQuery Performance Tips – jQueryにおける高速化 -
jQuery Performance Tips – jQueryにおける高速化 -
Hayato Mizuno
WordPressとjQuery
WordPressとjQuery
Seto Takahiro
WordPressプラグイン作成入門
WordPressプラグイン作成入門
Yuji Nojima
TDC20111031_Groovy_Geb
TDC20111031_Groovy_Geb
Nobuhiro Sue
.htaccessによるリダイレクト徹底解説
.htaccessによるリダイレクト徹底解説
Cherry Pie Web
Dgeni with AngularJS Application
Dgeni with AngularJS Application
K Kinzal
2005 07 30_xwj_customizinig
2005 07 30_xwj_customizinig
Tom Hayakawa
Ginとbindataで作るシングルバイナリWebApp
Ginとbindataで作るシングルバイナリWebApp
Akihiko Horiuchi
EC-CUBEプラグイン講義
EC-CUBEプラグイン講義
ria1201
20120118 titanium
20120118 titanium
Hiroshi Oyamada
Pythonで電卓アプリ(デスクトップ)を作成する
Pythonで電卓アプリ(デスクトップ)を作成する
Jun Okazaki
Google App Engine for Java
Google App Engine for Java
Takuya Tsuchida
仕事で使うちょっとしたコードをOSSとして開発メンテしていく- Django Redshift Backend の開発 - PyCon JP 2016
仕事で使うちょっとしたコードをOSSとして開発メンテしていく- Django Redshift Backend の開発 - PyCon JP 2016
Takayuki Shimizukawa
Nuxt なしで Vue App 作る時に乗り越えるべき5つの壁
Nuxt なしで Vue App 作る時に乗り越えるべき5つの壁
Yutaro Miyazaki
Chrome Extensionsの基本とデザインパターン
Chrome Extensionsの基本とデザインパターン
Yoichiro Tanaka
翻訳から始めるVue.js 入門
翻訳から始めるVue.js 入門
Makoto Chiba
プロダクトに 1 から Vue.js を導入した話
プロダクトに 1 から Vue.js を導入した話
Shohei Okada
JJUG CCC 2011 Fall / Web test automation with Geb and Spock
JJUG CCC 2011 Fall / Web test automation with Geb and Spock
Nobuhiro Sue
getAllEntriesByKey vs createViewNavFromKey
getAllEntriesByKey vs createViewNavFromKey
Haruyuki Nakano
Was ist angesagt?
(20)
Djangoフレームワークの紹介
Djangoフレームワークの紹介
jQuery Performance Tips – jQueryにおける高速化 -
jQuery Performance Tips – jQueryにおける高速化 -
WordPressとjQuery
WordPressとjQuery
WordPressプラグイン作成入門
WordPressプラグイン作成入門
TDC20111031_Groovy_Geb
TDC20111031_Groovy_Geb
.htaccessによるリダイレクト徹底解説
.htaccessによるリダイレクト徹底解説
Dgeni with AngularJS Application
Dgeni with AngularJS Application
2005 07 30_xwj_customizinig
2005 07 30_xwj_customizinig
Ginとbindataで作るシングルバイナリWebApp
Ginとbindataで作るシングルバイナリWebApp
EC-CUBEプラグイン講義
EC-CUBEプラグイン講義
20120118 titanium
20120118 titanium
Pythonで電卓アプリ(デスクトップ)を作成する
Pythonで電卓アプリ(デスクトップ)を作成する
Google App Engine for Java
Google App Engine for Java
仕事で使うちょっとしたコードをOSSとして開発メンテしていく- Django Redshift Backend の開発 - PyCon JP 2016
仕事で使うちょっとしたコードをOSSとして開発メンテしていく- Django Redshift Backend の開発 - PyCon JP 2016
Nuxt なしで Vue App 作る時に乗り越えるべき5つの壁
Nuxt なしで Vue App 作る時に乗り越えるべき5つの壁
Chrome Extensionsの基本とデザインパターン
Chrome Extensionsの基本とデザインパターン
翻訳から始めるVue.js 入門
翻訳から始めるVue.js 入門
プロダクトに 1 から Vue.js を導入した話
プロダクトに 1 から Vue.js を導入した話
JJUG CCC 2011 Fall / Web test automation with Geb and Spock
JJUG CCC 2011 Fall / Web test automation with Geb and Spock
getAllEntriesByKey vs createViewNavFromKey
getAllEntriesByKey vs createViewNavFromKey
Ähnlich wie QML を用いた YouTube クライアントの作成 - 関東 Qt 勉強会
Azure IoT Edge で Custom Vision
Azure IoT Edge で Custom Vision
Yoshitaka Seo
13016 n分で作るtype scriptでnodejs
13016 n分で作るtype scriptでnodejs
Takayoshi Tanaka
Tide - SmalltalkでSPA
Tide - SmalltalkでSPA
Masashi Umezawa
Android Lecture #04 @PRO&BSC Inc.
Android Lecture #04 @PRO&BSC Inc.
Yuki Higuchi
Firefox DevTools
Firefox DevTools
dynamis
SpringMVCとmixer2で作るWebアプリのキホン 2013-01-24 Spring勉強会 #jsug
SpringMVCとmixer2で作るWebアプリのキホン 2013-01-24 Spring勉強会 #jsug
Y Watanabe
Grafana Dashboards as Code
Grafana Dashboards as Code
Takuhiro Yoshida
Twitter sphere of #twitter4j #twtr_hack
Twitter sphere of #twitter4j #twtr_hack
kimukou_26 Kimukou
Titanium勉強会
Titanium勉強会
洋平 前田
Chrome Developer Toolsを使いこなそう!
Chrome Developer Toolsを使いこなそう!
yoshikawa_t
Jetpack Library 事始め
Jetpack Library 事始め
Tomohiro Kaizu
CodeIgniterによるPhwittr
CodeIgniterによるPhwittr
kenjis
VSCodeで始めるAzure Static Web Apps開発
VSCodeで始めるAzure Static Web Apps開発
Yuta Matsumura
jQuery超入門編
jQuery超入門編
Yasuhito Yabe
Html5 Web Applications
Html5 Web Applications
totty jp
Jqm20120210
Jqm20120210
cmtomoda
Recap: Modern CI/CD with Tekton and Prow Automated via Jenkins X - Kubernetes...
Recap: Modern CI/CD with Tekton and Prow Automated via Jenkins X - Kubernetes...
JUNICHI YOSHISE
Cast SDK for Flutter
Cast SDK for Flutter
KojiYamada22
Internet Explorer 9 の新機能「固定サイト」 (Pinned sites)
Internet Explorer 9 の新機能「固定サイト」 (Pinned sites)
shigeya
OpenGLプログラミング
OpenGLプログラミング
幸雄 村上
Ähnlich wie QML を用いた YouTube クライアントの作成 - 関東 Qt 勉強会
(20)
Azure IoT Edge で Custom Vision
Azure IoT Edge で Custom Vision
13016 n分で作るtype scriptでnodejs
13016 n分で作るtype scriptでnodejs
Tide - SmalltalkでSPA
Tide - SmalltalkでSPA
Android Lecture #04 @PRO&BSC Inc.
Android Lecture #04 @PRO&BSC Inc.
Firefox DevTools
Firefox DevTools
SpringMVCとmixer2で作るWebアプリのキホン 2013-01-24 Spring勉強会 #jsug
SpringMVCとmixer2で作るWebアプリのキホン 2013-01-24 Spring勉強会 #jsug
Grafana Dashboards as Code
Grafana Dashboards as Code
Twitter sphere of #twitter4j #twtr_hack
Twitter sphere of #twitter4j #twtr_hack
Titanium勉強会
Titanium勉強会
Chrome Developer Toolsを使いこなそう!
Chrome Developer Toolsを使いこなそう!
Jetpack Library 事始め
Jetpack Library 事始め
CodeIgniterによるPhwittr
CodeIgniterによるPhwittr
VSCodeで始めるAzure Static Web Apps開発
VSCodeで始めるAzure Static Web Apps開発
jQuery超入門編
jQuery超入門編
Html5 Web Applications
Html5 Web Applications
Jqm20120210
Jqm20120210
Recap: Modern CI/CD with Tekton and Prow Automated via Jenkins X - Kubernetes...
Recap: Modern CI/CD with Tekton and Prow Automated via Jenkins X - Kubernetes...
Cast SDK for Flutter
Cast SDK for Flutter
Internet Explorer 9 の新機能「固定サイト」 (Pinned sites)
Internet Explorer 9 の新機能「固定サイト」 (Pinned sites)
OpenGLプログラミング
OpenGLプログラミング
QML を用いた YouTube クライアントの作成 - 関東 Qt 勉強会
1.
QML を用いた YouTube クライアントの作成 小川
純平 (Jumpei Ogawa / @phanect) 日本 KDE ユーザー会
2.
Qt とは ●
C++ のフレームワーク ● 最近 QML という UI 記述言語と、JavaScript を用いる方法が導入された ● デスクトップ (Windows / Mac / Linux) や モバイル系 OS (MeeGo / Android / Symbian)、組み込み Linux などで動作 ● Qt for Android は現在 alpha 版
3.
QML で YouTube クライアントを作成
4.
作るもの ●
YouTube の動画を検索して結果を一覧表示 ● 選択した動画を再生する
5.
テキストボックスを配置 ●
ウィンドウサイズを変更 ● 左上の[ナビゲータ] で Rectangle を選択し、 右の [プロパティ] > [ジオメトリ] > [サイ ズ] の値を変更 ● デザイナでテキストとテキストボックスを配 置 ● 左下の [ライブラリ] > [アイテム] タブ から [Text] と [Text Input] をドラッグアンドド ロップ – [Text Edit] は複数行用 ● 右上の ID を編集 ● 右下の [テキスト] を編集
6.
ここまでのコード Rectangle {
width: 600 height: 400 Text { id: text1 x: 14 y: 15 text: "検索キーワード:" font.pixelSize: 12 } TextInput { id: in_keyword x: 124 y: 13 width: 137 height: 20 text: "キーワードをここに入力" font.pixelSize: 12
7.
QML のボタンコンポーネント ●
モバイル (Symbian/MeeGo) では Qt Quick Components が既に利用可能 ● PC で利用したい場合は git://gitorious.org/qt- components/desktop.git から落とす
8.
QML のボタンコンポーネント ●
面倒なので今回は自前で作成
9.
ボタンを作成 ●
Rectangle を新たに作成 ● その中に Text を入れる ● ナビゲータで Rectangle の下位に Text がき ていることを確認 – 来ていなければ、ナビゲータで Rectangle に Text をドラッグアンドドロップ ● コードエディタで anchor.centerIn: parent を追加
10.
ここまでのコード Rectangle {
... Text {...} TextInput {...} Rectangle { id: button x: 286 y: 13 width: 72 height: 20 color: "#ffffff" Text { id: buttontext anchors.centerIn: parent text: "検索" font.pixelSize: 12 }
11.
anchor の設定 ●
anchors で他のコンポーネントに対しての位 置を指定 ● anchors.top / bottom / left / right ● anchors.verticalCenter: 縦方向の中心点 ● anchors.fill: 上下左右の端 ● anchors.centerIn: 中心点 ● 詳細 > Qt Quick 入門 第7回: レイアウト ● http://labs.qt.nokia.co.jp/2011/01/06/qml-lay
12.
anchor で TextInput
の 位置指定 ● TextInput で、 ● x: 286 → anchors.left: text1.right ● y: 13 → anchors.verticalCenter: text1.verticalCenter と変更 ● anchors.margins: 10 を TextInput に追加 ● 周囲からの間隔を指定 ● ボタンに対しても同様に行う
13.
YouTube API ●
動画の検索 API ● http://gdata.youtube.com/feeds/api/vide os?v=2&q=キーワード で XML が返ってくる ● v=2 は API のバージョン番号
14.
<feed ...>
... <entry> <title type="text">My walk with Mr. Darcy</title> <media:group> <media:thumbnail url="http://img.youtube.com/.../2.jpg" /> <yt:videoid>EXS0BFS6QT4</yt:videoid> </media:group> </entry> ... </feed>
15.
YouTube タイトル・サムネイル <feed ...>
<entry> <title type="text">My walk with Mr. Darcy</title> </entry> <entry> ... </entry> </feed> XPath は “/feed/entry/title”
16.
XmlListModel で XML
を解析 XmlListModel { id: ytlist source: "http://gdata.youtube.com/feeds/api/videos?v=2&q=キー ワード" query: "/feed/entry" // XPath で <entry> タグを繰り返し読込 namespaceDeclarations:"declare default element namespace 'http://www.w3.org/2005/Atom';" XmlRole { name: "title"; query: "title/string()" } }
17.
ListView で解析結果を表示 ListView {
id: videolist model: ytlist delegate: Text {text: title} anchors.top: in_keyword.bottom anchors.margins: 10 width: parent.width / 2 height: parent.height }
18.
YouTube タイトル・サムネイル <feed>
<entry> <media:group> <media:thumbnail url='http://i.ytimg.com/.../0.jpg' .../> <media:thumbnail url='http://i.ytimg.com/.../1.jpg' .../> <media:thumbnail url='http://i.ytimg.com/.../2.jpg' .../> <media:thumbnail url='http://i.ytimg.com/.../3.jpg' .../> </media:group> </entry> </feed> XPath は “/feed/entry/media:group/media:thumbnail[1]/@url” 0ではなく1から始まることに注意↑
19.
XmlListModel で XML
を解析 XmlListModel { id: ytlist source: "http://gdata.youtube.com/feeds/api/videos? v=2&q=キーワード" query: "/feed/entry" namespaceDeclarations:"declare default element namespace 'http://www.w3.org/2005/Atom'; declare namespace media='http://search.yahoo.com/mrss/';" XmlRole { name: "title"; query: "title/string()" } XmlRole { name: "thumbnail" query: "media:group/media:thumbnail[1]/@url/string()"
20.
ListView で解析結果を表示 ListView {
id: videolist model: ytlist delegate: Column{ Image { source: thumbnail } Text {text: title} } anchors.top: in_keyword.bottom anchors.margins: 10 width: parent.width / 2 height: parent.height
21.
動画プレイヤー部分の作成 ●
ブラウザコンポーネント (WebView) 上に YouTube の Embedded player を貼り付け ● http://www.youtube.com/embed/VIDEO_I D // ?html5=1 ● ?html5=1 は Flash 版ではなく HTML5 Player を使いたい場合に付ける
22.
本当はよくない方法ですが... ●
本来は Video を用いるべきだが、デスクトッ プでの利用が面倒くさそうなので... ● モバイルならこちらの方が早いかも...
23.
WebView を追加 WebView {
url: "http://www.youtube.com/embed/" + videoId" // Flash Player を有効化 settings.pluginsEnabled:true anchors.top: in_keyword.bottom anchors.left: videolist.right anchors.right: parent.right anchors.bottom: parent.bottom anchors.margins: 10 }
24.
YouTube 動画 ID <feed
...> <entry> <media:group> <yt:videoid>CL-vIg4Ivqw</yt:videoid> </media:group> </entry> </feed> XPath は “/feed/entry/media:group/yt:videoid”
25.
XmlListModel で XML
を解析 XmlListModel { id: ytlist source: "http://gdata.youtube.com/feeds/api/videos? v=2&q=キーワード" query: "/feed/entry" NamespaceDeclarations:"... declare namespace yt='http://gdata.youtube.com/schemas/2007';" XmlRole { … } // 前の XmlRole は省略 XmlRole { name: "videoId" query: "media:group/yt:videoid/string()" }
26.
ListView にクリックイベントを ListView {
追加 id: videolist model: ytlist delegate: Column{ Image { source: thumbnail } Text {text: title} MouseArea { anchors.fill: parent onClicked: { videoplayer.url = "http://www.youtube.com/embed/" + videoId } } } ... }
27.
検索ボタンにクリックイベントを Rectangle {
追加 id: rectangle1 ... Text { id: text2 text: "Search" } MouseArea { anchors.fill: parent onClicked: { ytlist.source = "http://gdata.youtube.com/feeds/api/videos?v=2&q=" + text_input1.text } } }
28.
End of Slides ●
本日のスライド ● http://slidesha.re/obeI9k ● 本日のコード ● http://bit.ly/oeuejD ● zip: http://bit.ly/oJHauZ
Hinweis der Redaktion
Web 系の開発で言うと、QML が HTML に対応して、C++ が PHP や Java などに対応。(JS は JS) .NET で言うと、QML は XAML、C++ は VC++ とか C# とか VB とか。
<entry>...</entry> の部分がビデオ一個分
Jetzt herunterladen