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
Ruby Desktop Apps with Qt
Search
ynonperek
June 25, 2012
Technology
1
550
Ruby Desktop Apps with Qt
Writing desktop applications using ruby and Qt
ynonperek
June 25, 2012
Tweet
Share
More Decks by ynonperek
See All by ynonperek
QtRuby for Qt Developers
ynonperek
0
250
Qt Hybrid Apps
ynonperek
1
220
QtRuby In Action
ynonperek
1
130
Cool CPAN Modules
ynonperek
2
590
Advanced Perl Moose
ynonperek
4
2.6k
Perl Golf
ynonperek
4
1.9k
git
ynonperek
3
780
Concurrency In Qt Applications
ynonperek
1
250
Moose Design Patterns
ynonperek
4
470
Other Decks in Technology
See All in Technology
ブラックフライデーで購入したPixel9で、Gemini Nanoを動かしてみた
marchin1989
1
520
Oracle Cloudの生成AIサービスって実際どこまで使えるの? エンジニア目線で試してみた
minorun365
PRO
4
280
Microsoft Azure全冠になってみた ~アレを使い倒した者が試験を制す!?~/Obtained all Microsoft Azure certifications Those who use "that" to the full will win the exam! ?
yuj1osm
1
110
アップデート紹介:AWS Data Transfer Terminal
stknohg
PRO
0
180
Snykで始めるセキュリティ担当者とSREと開発者が楽になる脆弱性対応 / Getting started with Snyk Vulnerability Response
yamaguchitk333
2
180
成果を出しながら成長する、アウトプット駆動のキャッチアップ術 / Output-driven catch-up techniques to grow while producing results
aiandrox
0
180
20241214_WACATE2024冬_テスト設計技法をチョット俯瞰してみよう
kzsuzuki
3
440
watsonx.ai Dojo #5 ファインチューニングとInstructLAB
oniak3ibm
PRO
0
160
10分で学ぶKubernetesコンテナセキュリティ/10min-k8s-container-sec
mochizuki875
3
330
NW-JAWS #14 re:Invent 2024(予選落ち含)で 発表された推しアップデートについて
nagisa53
0
250
バクラクのドキュメント解析技術と実データにおける課題 / layerx-ccc-winter-2024
shimacos
2
1k
re:Invent 2024 Innovation Talks(NET201)で語られた大切なこと
shotashiratori
0
300
Featured
See All Featured
実際に使うSQLの書き方 徹底解説 / pgcon21j-tutorial
soudai
169
50k
GitHub's CSS Performance
jonrohan
1030
460k
[RailsConf 2023] Rails as a piece of cake
palkan
53
5k
Responsive Adventures: Dirty Tricks From The Dark Corners of Front-End
smashingmag
251
21k
Reflections from 52 weeks, 52 projects
jeffersonlam
347
20k
Learning to Love Humans: Emotional Interface Design
aarron
273
40k
10 Git Anti Patterns You Should be Aware of
lemiorhan
PRO
656
59k
A Philosophy of Restraint
colly
203
16k
The Illustrated Children's Guide to Kubernetes
chrisshort
48
48k
The Straight Up "How To Draw Better" Workshop
denniskardys
232
140k
Practical Orchestrator
shlominoach
186
10k
Statistics for Hackers
jakevdp
796
220k
Transcript
Back To The Desktop Ynon Perek http://qtcollege.co.il Monday, June 25,
12
WHY ? Monday, June 25, 12
Desktop Apps • Office • Web Browser • Skype •
IDE • Torrent / FTP Client Monday, June 25, 12
So You Want To Write A Ruby Desktop App ...
Monday, June 25, 12
Mature and Widely Used • Choosing a widely used framework
ensures that you won’t run into bumps when scaling up • Choosing a framework with future ensures it won’t suddenly disappear Monday, June 25, 12
Cross Platform • The more the better • Code once,
look good everywhere Monday, June 25, 12
Cross Platform Monday, June 25, 12
Cross Language • C++ • Java • Ruby • Perl
• Python Monday, June 25, 12
Good UI Designer Monday, June 25, 12
Choose Qt • Cross Platform • Cross Languages • Awesome
Tools • Here To Stay Monday, June 25, 12
Famous Qt Apps • Skype • Google Earth • KDE
• KOffice • VLC • PhantomJS Monday, June 25, 12
QtRuby In Action • Installation • UI Design • Add
Actions • Use Stock Dialogs • Code: http://github.com/ynonp/ ruby-underground-talk Monday, June 25, 12
Installation: Windows gem install qtbindings Monday, June 25, 12
Installation: Mac/Linux • Install Qt SDK from Nokia • gem
install qtbindings • Details: https://github.com/ryanmelt/ qtbindings Monday, June 25, 12
Hello QtRuby 1 require 'Qt' 2 3 app = Qt::Application.new
( ARGV ) 4 5 b = Qt::PushButton.new( "DIE ALL HUMANS" ) 6 b.connect ( SIGNAL :clicked ) { app.exit } 7 8 b.show 9 app.exec 10 Monday, June 25, 12
Signals & Slots • Signals are Semantic Events • Slots
are handlers (methods or blocks) • signal -----> slot Monday, June 25, 12
Object Trees • Each Qt::Widget may contain other widgets •
Pass a container (parent) to initialize • Use layouts to determine ordering Monday, June 25, 12
No Layout 1 require 'Qt' 2 3 app = Qt::Application.new
( ARGV ) 4 5 w = Qt::Widget.new 6 b = Qt::PushButton.new( "Ouch! That hurt" , w) 7 c = Qt::PushButton.new("9", w) 8 9 w.show 10 11 app.exec 12 Monday, June 25, 12
With Layout 1 require 'Qt' 2 3 app = Qt::Application.new
( ARGV ) 4 5 w = Qt::Widget.new 6 7 b = Qt::PushButton.new( "Ouch! That hurt") 8 c = Qt::PushButton.new("9") 9 10 l = Qt::VBoxLayout.new( w ) 11 l.addWidget ( b ) 12 l.addWidget ( c ) 13 14 w.show 15 16 app.exec 17 Monday, June 25, 12
Monday, June 25, 12
UI Design • Run Qt Designer • Make GUI •
Save as .ui file • Convert to ruby with: rbuic4 file.ui -x -o file_ui.rb Monday, June 25, 12
Nested Layouts Combine different layout managers to make the layout
on the right Monday, June 25, 12
Add Actions • Connect actions with • obj.connect ( SIGNAL
:sig ) { action } Monday, June 25, 12
Use Stock Dialogs • Qt::MessageBox.about • Qt::FileDialog.get_open_file_name • Qt::FileDialog.get_save_file_name Monday,
June 25, 12
QtRuby First App • Rapid UI with Designer • Easy
layouts with Qt’s Layout Managers • Extensive library of Widgets and Stock Dialogs Monday, June 25, 12
Add Some Color • Use css-like style sheets to style
your app • Syntax: http://qt-project.org/ doc/qt-4.8/stylesheet- syntax.html Monday, June 25, 12
Happy Coding ! • Ynon Perek • http://qtcollege.co.il •
[email protected]
Monday, June 25, 12