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
580
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
280
Qt Hybrid Apps
ynonperek
1
240
QtRuby In Action
ynonperek
1
150
Cool CPAN Modules
ynonperek
2
610
Advanced Perl Moose
ynonperek
4
2.6k
Perl Golf
ynonperek
4
2k
git
ynonperek
3
790
Concurrency In Qt Applications
ynonperek
1
270
Moose Design Patterns
ynonperek
4
520
Other Decks in Technology
See All in Technology
コスト最適重視でAurora PostgreSQLのログ分析基盤を作ってみた #jawsug_tokyo
non97
1
810
勝手に!深堀り!Cloud Run worker pools / Deep dive Cloud Run worker pools
iselegant
4
560
Dynamic Reteaming And Self Organization
miholovesq
3
690
Aspire をカスタマイズしよう & Aspire 9.2
nenonaninu
0
290
技術者はかっこいいものだ!!~キルラキルから学んだエンジニアの生き方~
masakiokuda
2
280
Notion x ポストモーテムで広げる組織の学び / Notion x Postmortem
isaoshimizu
1
130
10ヶ月かけてstyled-components v4からv5にアップデートした話
uhyo
5
420
日経電子版 for Android の技術的課題と取り組み(令和最新版)/android-20250423
nikkei_engineer_recruiting
1
560
今日からはじめるプラットフォームエンジニアリング
jacopen
8
1.8k
フルカイテン株式会社 エンジニア向け採用資料
fullkaiten
0
5.4k
Рекомендации с нуля: как мы в Lamoda превратили главную страницу в ключевую точку входа для персонализированного шоппинга. Данил Комаров, Data Scientist, Lamoda Tech
lamodatech
0
830
バクラクの認証基盤の成長と現在地 / bakuraku-authn-platform
convto
4
820
Featured
See All Featured
VelocityConf: Rendering Performance Case Studies
addyosmani
329
24k
Docker and Python
trallard
44
3.4k
Visualization
eitanlees
146
16k
Why Our Code Smells
bkeepers
PRO
336
57k
実際に使うSQLの書き方 徹底解説 / pgcon21j-tutorial
soudai
178
53k
Principles of Awesome APIs and How to Build Them.
keavy
126
17k
The Cost Of JavaScript in 2023
addyosmani
49
7.7k
Refactoring Trust on Your Teams (GOTO; Chicago 2020)
rmw
34
2.9k
How To Stay Up To Date on Web Technology
chriscoyier
790
250k
Building Applications with DynamoDB
mza
94
6.3k
The Invisible Side of Design
smashingmag
299
50k
Evolution of real-time – Irina Nazarova, EuRuKo, 2024
irinanazarova
8
680
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 • ynonperek@yahoo.com
Monday, June 25, 12