Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
KC3 2013 懇談会LT 「QML + C++で楽しい!」
Search
Yuto Tokunaga
September 08, 2013
Programming
1
190
KC3 2013 懇談会LT 「QML + C++で楽しい!」
2013/9/8のKC3 2013の懇談会のLTで使ったものです
LaTeX Beamerで作りました(ドヤァ
Yuto Tokunaga
September 08, 2013
Tweet
Share
More Decks by Yuto Tokunaga
See All by Yuto Tokunaga
SyaroNote
yuntan
0
1.9k
QMLでFlappyBirdを作ろう
yuntan
0
1.5k
Haskellでbrainfckインタプリタを書きたかった話
yuntan
0
860
KC3 2014 懇親会LT 「Let It ʕ ◔π◔ʔGo」
yuntan
0
140
QMLとモバイル
yuntan
0
890
Other Decks in Programming
See All in Programming
StarlingMonkeyを触ってみた話 - 2024冬
syumai
3
280
ChatGPT とつくる PHP で OS 実装
memory1994
PRO
2
130
MCP with Cloudflare Workers
yusukebe
2
230
情報漏洩させないための設計
kubotak
4
840
Webエンジニア主体のモバイルチームの 生産性を高く保つためにやったこと
igreenwood
0
340
わたしの星のままで一番星になる ~ 出産を機にSIerからEC事業会社に転職した話 ~
kimura_m_29
0
200
Online-Dokumentation, die hilft: Strukturen, Prozesse, Tools
ahus1
0
100
技術的負債と向き合うカイゼン活動を1年続けて分かった "持続可能" なプロダクト開発
yuichiro_serita
0
150
CQRS+ES の力を使って効果を感じる / Feel the effects of using the power of CQRS+ES
seike460
PRO
0
160
GitHubで育つ コラボレーション文化 : ニフティでのインナーソース挑戦事例 - 2024-12-16 GitHub Universe 2024 Recap in ZOZO
niftycorp
PRO
0
120
Monixと常駐プログラムの勘どころ / Scalaわいわい勉強会 #4
stoneream
0
290
今年のアップデートで振り返るCDKセキュリティのシフトレフト/2024-cdk-security-shift-left
tomoki10
0
230
Featured
See All Featured
Rebuilding a faster, lazier Slack
samanthasiow
79
8.7k
Helping Users Find Their Own Way: Creating Modern Search Experiences
danielanewman
29
2.3k
The Cult of Friendly URLs
andyhume
78
6.1k
YesSQL, Process and Tooling at Scale
rocio
169
14k
Art, The Web, and Tiny UX
lynnandtonic
298
20k
Designing Experiences People Love
moore
138
23k
Save Time (by Creating Custom Rails Generators)
garrettdimon
PRO
29
910
Unsuck your backbone
ammeep
669
57k
Building Your Own Lightsaber
phodgson
103
6.1k
Let's Do A Bunch of Simple Stuff to Make Websites Faster
chriscoyier
507
140k
Visualization
eitanlees
146
15k
The Psychology of Web Performance [Beyond Tellerrand 2023]
tammyeverts
45
2.2k
Transcript
QML + C++ Ͱ ָ͍͠ʂ ಙӬ ༤ే OUCC Sep 8th
ಙӬ ༤ే QML + C++ 1/13
Qtͱ Qt ͱΫϩεϓϥοτϑΥʔϜͷΞϓϦέʔγϣϯ։ ൃϑϨʔϜϫʔΫͰ͢ɻ؆୯ʹ͍͑ Qt Ͱ࡞ͨ͠ι ϑτଟ͘ͷػثͰಈ͘ͱ͍͏͜ͱͰ͢ɻ දతͳϓϥοτϑΥʔϜͱͯ͠ Windows, Mac
OS X, Unix Linux(X Window System) ͜ΕΒΛΧόʔͯ͠ ͓Γ࣮࣭తʹύιίϯͳΒͯ͢ಈ͖·͢ɻϞόΠϧ ରԠ͍ͯ͠·͕͢ Android ͱ iOSɺWindows Phone ࢼݧతͳஈ֊Ͱਖ਼ࣜʹରԠ͢Δͷ͍ۙকདྷ Ͱ͢ɻ ຊ Qt ϢʔβʔձϗʔϜϖʔδΑΓ ಙӬ ༤ే QML + C++ 2/13
࠾༻ࣄྫ Qt VirtualBox, Google Earth, Skype, Handbreak, KDE ͳͲͳ
Ͳʹ࠾༻͞Ε͍ͯΔ ಙӬ ༤ే QML + C++ 3/13
࠾༻ࣄྫ Qt VirtualBox, Google Earth, Skype, Handbreak, KDE ͳͲͳ
Ͳʹ࠾༻͞Ε͍ͯΔ ࠷ۙͷΞϓϦʮ؋ϝϞʯ Qt Λͬͯ࡞ΒΕ͍ͯ·͢ʂ ʂ ʂ http://relog.xii.jp/mt5r/2013/08/post-349.html ಙӬ ༤ే QML + C++ 3/13
Qt Quickͱ • QML(Qt Meta-Object Language) Qt Quick Ͱ৽ͨʹಋೖ͞Εͨ,UI Λهड़͢ΔͨΊͷϓϩάϥ
ϛϯάݴޠ. એݴܕݴޠʹྨ͞ΕΔ. ϩδοΫͷهड़ʹ JavaScript ͕͑Δ. • Qt Creator IDE QML/JS ʹରԠͨ͠ IDE • QtDeclarative Ϟδϡʔϧ QML Λ࣮ߦ͢ΔͨΊͷΤϯδϯ Ҏ্ͷ 3 ͔ͭΒߏ͞ΕΔ UI ςΫϊϩδʔͷϑϨʔϜϫʔΫ. Qt Japanese Blog ΑΓ ಙӬ ༤ే QML + C++ 4/13
Qt Quickͱ • QML(Qt Meta-Object Language) Qt Quick Ͱ৽ͨʹಋೖ͞Εͨ,UI Λهड़͢ΔͨΊͷϓϩάϥ
ϛϯάݴޠ. એݴܕݴޠʹྨ͞ΕΔ. ϩδοΫͷهड़ʹ JavaScript ͕͑Δ. • Qt Creator IDE QML/JS ʹରԠͨ͠ IDE • QtDeclarative Ϟδϡʔϧ QML Λ࣮ߦ͢ΔͨΊͷΤϯδϯ Ҏ্ͷ 3 ͔ͭΒߏ͞ΕΔ UI ςΫϊϩδʔͷϑϨʔϜϫʔΫ. Qt Japanese Blog ΑΓ QML ͱ JS ΛͬͯΞϓϦΛ࡞Δ = Qt Quick ͱݺΜͰ͍͍Μ ͡Όͳ͍͔ͱ ಙӬ ༤ే QML + C++ 4/13
QMLͬͯͲΜͳݴޠʁ ެ͔ࣜΒαϯϓϧͱͯ͠ग़͍ͯΔ ͷΛհ͠·͢ ಙӬ ༤ే QML + C++ 5/13
Ͳ͜Ͱಈ͘Α ಙӬ ༤ే QML + C++ 6/13
Ͳ͜Ͱಈ͘Α ָ͍͠ʂ ʂ ಙӬ ༤ే QML + C++ 7/13
͏ͪΐ ͬͱ࣮༻తͳͷΛ Qt Λͬͯͳʹ͔࣮༻తͳͷΛ࡞Γ͍ͨͳʙ . . 1 JavaScript ΛΒͳ͍ (͓͍͍͠ͷʁ)
. . 2 QML + JS Ͱશͯͷ Qt ͷϞδϡʔϧ͕͑Δ Θ͚Ͱͳ͍ . . 3 C++Ͱॻ͔Εͨ Qt ϥΠϒϥϦͦͷ··Ͱ QML ͔Β͑ͳ͍ . . 4 ษڧதͷ C++ Λ͍͍ͨ ಙӬ ༤ే QML + C++ 8/13
͏ͪΐ ͬͱ࣮༻తͳͷΛ Qt Λͬͯͳʹ͔࣮༻తͳͷΛ࡞Γ͍ͨͳʙ . . 1 JavaScript ΛΒͳ͍ (͓͍͍͠ͷʁ)
. . 2 QML + JS Ͱશͯͷ Qt ͷϞδϡʔϧ͕͑Δ Θ͚Ͱͳ͍ . . 3 C++Ͱॻ͔Εͨ Qt ϥΠϒϥϦͦͷ··Ͱ QML ͔Β͑ͳ͍ . . 4 ษڧதͷ C++ Λ͍͍ͨ C++ Ͱ QML Module Λ࡞ͬͯͦΕΛ QML ͔Β ͏͜ͱʹ͠Α͏ʂ ಙӬ ༤ే QML + C++ 8/13
QML Moduleͱ UI ෦ػೳΛఆٛͨ͠ͷ QML ͔ΒಡΈࠐΜͰ͑Δ QML Ͱ C++ Ͱ࡞ΕΔʂ
ಙӬ ༤ే QML + C++ 9/13
QML Moduleͱ UI ෦ػೳΛఆٛͨ͠ͷ QML ͔ΒಡΈࠐΜͰ͑Δ QML Ͱ C++ Ͱ࡞ΕΔʂ
UI Λ QML Ͱ, ϩδοΫΛ C++Ͱ࣮͢Δ͜ͱ Ͱ,UI ͷίʔυͱϩδοΫͷίʔυΛ͚ΒΕΔ! ಙӬ ༤ే QML + C++ 9/13
ͦ͏ͩ,twitterΫϥΠΞϯτΛ࡞Ζ͏ OAuth ೝূͷͨΊͷϥΠϒϥϦʹ kQOAuth Λ༻ ೝূը໘, λΠϜϥΠϯͳͲ UI QML
Ͱ࣮͠,OAuth ೝ ূ,twitter ͱͷ௨৴, औಘͨ͠σʔλͷཧͳͲ C++Ͱ࣮ ࠓճ Ubuntu SDK ͍·ͨ͠ ಙӬ ༤ే QML + C++ 10/13
. . . . . . aztterhometlhelper.h 1 #include <QObject>
2 #include "aztteruserstream.h" 3 4 class AztterHomeTLHelper : public QObject 5 { 6 Q_OBJECT 7 Q_PROPERTY(QVariantMap tweet READ tweet) 8 9 public: 10 explicit AztterHomeTLHelper(QObject *parent = 0); 11 Q_INVOKABLE void startFetching(); 12 Q_INVOKABLE void streamDisconnect(); 13 QVariantMap tweet() const; 14 15 signals: 16 void tweetReceived(); 17 18 private slots: 19 void parseStream(const QByteArray&); 20 private: 21 void parseTweet(const QJsonObject&); 22 23 AztterUserStream *m_stream; 24 QVariantMap m_tweet; 25 }; Yuuto Tokunaga QML + C++
. . . . . . Timeline.qml 1 import QtQuick
2.0 2 import Ubuntu.Components 0.1 3 import Ubuntu.Components.ListItems 0.1 as ListItem 4 import "aztterplugin" 1.0 5 6 ListView { 7 id: homeTLView 8 9 Component.onCompleted: helper.startFetching() 10 11 AztterHomeTLHelper { 12 id: helper 13 onTweetReceived: listModel.prepend(tweet) 14 } 15 AztterTweetListModel { 16 id: listModel 17 } 18 model: listModel 19 delegate: TweetItem { 20 text: tweetText 21 name: userName 22 screenName: "@" + userScreenName 23 iconSource: userProfileImageUrl 24 } 25 } Yuuto Tokunaga QML + C++
͜Μͳ͔Μ͡ʹ ಙӬ ༤ే QML + C++ 11/13
͜Μͳ͔Μ͡ʹ ָ͍͠ʂ ʂ ಙӬ ༤ే QML + C++ 12/13
͍͞͝ʹ ߴʹಈ࡞͠, ͔ͭ Write once, run anywhere Λࢦ͢ Qt ಙӬ
༤ే QML + C++ 13/13
͍͞͝ʹ ߴʹಈ࡞͠, ͔ͭ Write once, run anywhere Λࢦ͢ Qt ͝ਗ਼ௌ͋Γ͕ͱ͏͍͟͝·ͨ͠
ಙӬ ༤ే QML + C++ 13/13