Upgrade to Pro — share decks privately, control downloads, hide ads and more …

QtRuby In Action

ynonperek
August 03, 2012

QtRuby In Action

My talk at August Penguin 2012.
Introducing how to use Qt with Ruby programming language

ynonperek

August 03, 2012
Tweet

More Decks by ynonperek

Other Decks in Technology

Transcript

  1. Choose Qt • Easy To Start • Mature and widely

    used • True Cross Platform Friday, August 3, 12
  2. Choose Qt • Easy To Start • Mature and widely

    used • True Cross Platform • Cross Language Friday, August 3, 12
  3. Choose Qt • C++ • Java • Ruby • Perl

    • Python • And More... Friday, August 3, 12
  4. Hello Qt require 'Qt' app = Qt::Application.new( ARGV ) w

    = Qt::Label.new( "Hello World" ) w.set_alignment( Qt::AlignHCenter | Qt::AlignVCenter ) w.show app.exec Friday, August 3, 12
  5. Qt Terminology • a Widget is a visible component •

    Label, Button, Table, List, ... Friday, August 3, 12
  6. Qt Layouts • A top level widget may contain other

    widgets • Child widgets are arranged in a layout Friday, August 3, 12
  7. Qt Terminology • Signals are connected to slots which are

    the handling code Friday, August 3, 12
  8. Designer Takeaways • Drag & Drop to create UI •

    Save as .ui file • Run: rbuic4 file.ui -x -o file_ui.rb • Use resulting .rb file but don’t modify it Friday, August 3, 12
  9. Qt Actions require 'Qt' require './demo1_ui.rb' a = Qt::Application.new(ARGV) u

    = Ui_Form.new w = Qt::Widget.new u.setupUi(w) w.show u.btn1.connect( SIGNAL :clicked ) { u.list1.add_item( "Qt FTW" ) } a.exec Friday, August 3, 12
  10. Qt Stock Dialogs require 'Qt' require './demo1_ui.rb' a = Qt::Application.new(ARGV)

    u = Ui_Form.new w = Qt::Widget.new u.setupUi(w) w.show u.btn1.connect( SIGNAL :clicked ) { filename = Qt::FileDialog.get_open_file_name; u.list1.add_item( filename ) } a.exec Friday, August 3, 12
  11. What Next • Qt Developers Meetup • August 7, 19:00

    • http://meetup.com/QtEverywhere/ Tel-Aviv-Yafo-IL/740512/ Friday, August 3, 12