Development/Tutorials/Qt4 Ruby Tutorial/Chapter 04

Development | Tutorials | Qt4 Ruby Tutorial
Revision as of 17:03, 28 December 2009 by Alisha (Talk | contribs) (Created page with '{{Template:I18n/Language Navigation Bar|Development/Tutorials/Qt4 Ruby Tutorial/Chapter 4}} {{TutorialBrowser| series=[[Development/Tutorials/Qt4_Ruby_Tutorial|Qt4 Ruby Tutoria...')

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Development/Tutorials/Qt4 Ruby Tutorial/Chapter 4

Let There Be Widgets
Tutorial Series   Qt4 Ruby Tutorial
Previous   Tutorial 3 - Family Values
What's Next   Tutorial 5 - Building Blocks
Further Reading   n/a

Let There Be Widgets

Qt4 Ruby Tutorial Screenshot 4.png



This example shows how to create your own widget, and describes how to control the minimum and maximum sizes of a widget.

require 'Qt4'

class MyWidget < Qt::Widget

 def initialize(parent = nil)
   setFixedSize(200, 120)
   quit ='Quit'), self)
   quit.setGeometry(62, 40, 75, 30)
   quit.setFont('Times', 18, Qt::Font::Bold))
   connect(quit, SIGNAL('clicked()'), $qApp, SLOT('quit()'))


app =

widget =


Line by Line Walkthrough

Content is available under Creative Commons License SA 4.0 unless otherwise noted.