Never been to DZone Snippets before?

Snippets is a public source code repository. Easily build up your personal collection of code snippets, categorize them with tags / keywords, and share them with the world

« Newer Snippets
Older Snippets »
Showing 1-1 of 1 total  RSS 

A QT 'Hello World' application

- getting started - (Using Ubuntu Linux 7.10)
1) Installed Qt bindings for Ruby

- Running the application
1) From the command line I typed ruby helloworld_qt.rb

#file: helloworld_qt.rb

require 'Qt'

    a = Qt::Application.new( ARGV )

    hello = Qt::PushButton.new( "Hello world!", nil )
    hello.resize( 100, 30 )
 
    Qt::Object::connect( hello, SIGNAL('clicked()'), a, SLOT('quit()') )
 
    a.setMainWidget( hello )
    hello.show()
 
    a.exec()

Source code copied from KDE Tutorial - p1 [kde.org]
« Newer Snippets
Older Snippets »
Showing 1-1 of 1 total  RSS