Development/Tutorials/Qt4 Ruby Tutorial: Difference between revisions

From KDE TechBase
(add translate tags)
(Marked this version for translation)
Line 2: Line 2:
{{Template:I18n/Language Navigation Bar|Development/Tutorials/Qt4 Ruby Tutorial}}
{{Template:I18n/Language Navigation Bar|Development/Tutorials/Qt4 Ruby Tutorial}}


<translate>''Author:'' [mailto:[email protected] Darshan Ishaya, [email protected]]</translate>
<translate><!--T:1-->
''Author:'' [mailto:[email protected] Darshan Ishaya, [email protected]]</translate>


<translate>''Original link:''http://www.darshancomputing.com/qt4-qtruby-tutorial/</translate>
<translate><!--T:2-->
''Original link:''http://www.darshancomputing.com/qt4-qtruby-tutorial/</translate>


<translate>
<translate>
== Qt®4 Tutorial for Ruby ==
== Qt®4 Tutorial for Ruby == <!--T:3-->
</translate>
</translate>
<translate>
<translate>
<!--T:4-->
This tutorial gives an introduction to GUI programming using the  
This tutorial gives an introduction to GUI programming using the  
[http://qt.nokia.com Qt toolkit],
[http://qt.nokia.com Qt toolkit],
Line 16: Line 19:
</translate>
</translate>
<translate>
<translate>
<!--T:5-->
It is simply a port of Nokia's fine  
It is simply a port of Nokia's fine  
[http://doc.qt.nokia.com//4.2/tutorial.html Qt Tutorial].
[http://doc.qt.nokia.com//4.2/tutorial.html Qt Tutorial].
</translate>
</translate>
<translate>
<translate>
<!--T:6-->
Therefore, most of the text after this paragraph comes straight from their tutorial. I have modified it as necessary to make it make sense with the Ruby bindings, and have rearranged or rewritten a few parts to make them (I hope) a bit clearer.
Therefore, most of the text after this paragraph comes straight from their tutorial. I have modified it as necessary to make it make sense with the Ruby bindings, and have rearranged or rewritten a few parts to make them (I hope) a bit clearer.


<!--T:7-->
This tutorial doesn't cover everything; the emphasis is on teaching the programming philosophy of GUI programming, and Qt's features are introduced as needed. Some commonly used features are never used in this tutorial.
This tutorial doesn't cover everything; the emphasis is on teaching the programming philosophy of GUI programming, and Qt's features are introduced as needed. Some commonly used features are never used in this tutorial.


<!--T:8-->
Chapter one starts with a minimal "Hello world" program and the following chapters introduce new concepts. By Chapter 14, the "Hello world" program from Chapter 1 will have turned into a 448-line game.
Chapter one starts with a minimal "Hello world" program and the following chapters introduce new concepts. By Chapter 14, the "Hello world" program from Chapter 1 will have turned into a 448-line game.


<!--T:9-->
If you're completely new to Qt, you might want to read [http://doc.qt.nokia.com/latest/how-to-learn-qt.html How to Learn Qt] if you haven't already done so. Keep in mind that like most documents about Qt, it is very C++ oriented.  
If you're completely new to Qt, you might want to read [http://doc.qt.nokia.com/latest/how-to-learn-qt.html How to Learn Qt] if you haven't already done so. Keep in mind that like most documents about Qt, it is very C++ oriented.  
</translate>
</translate>


<translate>
<translate>
==Table of Contents==
==Table of Contents== <!--T:10-->
</translate>
</translate>


#[[Special:myLanguage/Development/Tutorials/Qt4 Ruby Tutorial/Chapter 01|<translate>Hello World!</translate>]]
#[[Special:myLanguage/Development/Tutorials/Qt4 Ruby Tutorial/Chapter 01|<translate><!--T:11-->
#[[Special:myLanguage/Development/Tutorials/Qt4 Ruby Tutorial/Chapter 2|<translate>Calling it Quits</translate>]]
Hello World!</translate>]]
#[[Special:myLanguage/Development/Tutorials/Qt4 Ruby Tutorial/Chapter 3|<translate>Family Values</translate>]]
#[[Special:myLanguage/Development/Tutorials/Qt4 Ruby Tutorial/Chapter 2|<translate><!--T:12-->
#[[Special:myLanguage/Development/Tutorials/Qt4 Ruby Tutorial/Chapter 04|<translate>Let There Be Widgets</translate>]]
Calling it Quits</translate>]]
#[[Special:myLanguage/Development/Tutorials/Qt4 Ruby Tutorial/Chapter 05|<translate>Building Blocks</translate>]]
#[[Special:myLanguage/Development/Tutorials/Qt4 Ruby Tutorial/Chapter 3|<translate><!--T:13-->
#[[Special:myLanguage/Development/Tutorials/Qt4 Ruby Tutorial/Chapter 06|<translate>Building Blocks Galore!</translate>]]
Family Values</translate>]]
#[[Special:myLanguage/Development/Tutorials/Qt4 Ruby Tutorial/Chapter 07|<translate>One Thing Leads to Another</translate>]]
#[[Special:myLanguage/Development/Tutorials/Qt4 Ruby Tutorial/Chapter 04|<translate><!--T:14-->
#[[Special:myLanguage/Development/Tutorials/Qt4 Ruby Tutorial/Chapter 08|<translate>Preparing for Battle</translate>]]
Let There Be Widgets</translate>]]
#[[Special:myLanguage/Development/Tutorials/Qt4 Ruby Tutorial/Chapter 09|<translate>With Cannon You Can</translate>]]
#[[Special:myLanguage/Development/Tutorials/Qt4 Ruby Tutorial/Chapter 05|<translate><!--T:15-->
#[[Special:myLanguage/Development/Tutorials/Qt4 Ruby Tutorial/Chapter 10|<translate>Smooth as Silk</translate>]]
Building Blocks</translate>]]
#[[Special:myLanguage/Development/Tutorials/Qt4 Ruby Tutorial/Chapter 11|<translate>Giving It a Shot</translate>]]
#[[Special:myLanguage/Development/Tutorials/Qt4 Ruby Tutorial/Chapter 06|<translate><!--T:16-->
#[[Special:myLanguage/Development/Tutorials/Qt4 Ruby Tutorial/Chapter 12|<translate>Hanging in the Air the Way Bricks Don't</translate>]]
Building Blocks Galore!</translate>]]
#[[Special:myLanguage/Development/Tutorials/Qt4 Ruby Tutorial/Chapter 13|<translate>Game Over</translate>]]
#[[Special:myLanguage/Development/Tutorials/Qt4 Ruby Tutorial/Chapter 07|<translate><!--T:17-->
#[[Special:myLanguage/Development/Tutorials/Qt4 Ruby Tutorial/Chapter 14|<translate>Facing the Wall</translate>]]
One Thing Leads to Another</translate>]]
#[[Special:myLanguage/Development/Tutorials/Qt4 Ruby Tutorial/Chapter 08|<translate><!--T:18-->
Preparing for Battle</translate>]]
#[[Special:myLanguage/Development/Tutorials/Qt4 Ruby Tutorial/Chapter 09|<translate><!--T:19-->
With Cannon You Can</translate>]]
#[[Special:myLanguage/Development/Tutorials/Qt4 Ruby Tutorial/Chapter 10|<translate><!--T:20-->
Smooth as Silk</translate>]]
#[[Special:myLanguage/Development/Tutorials/Qt4 Ruby Tutorial/Chapter 11|<translate><!--T:21-->
Giving It a Shot</translate>]]
#[[Special:myLanguage/Development/Tutorials/Qt4 Ruby Tutorial/Chapter 12|<translate><!--T:22-->
Hanging in the Air the Way Bricks Don't</translate>]]
#[[Special:myLanguage/Development/Tutorials/Qt4 Ruby Tutorial/Chapter 13|<translate><!--T:23-->
Game Over</translate>]]
#[[Special:myLanguage/Development/Tutorials/Qt4 Ruby Tutorial/Chapter 14|<translate><!--T:24-->
Facing the Wall</translate>]]


<translate>
<translate>
<!--T:25-->
This little game doesn't look much like a modern GUI application. It uses some GUI techniques, but after you've worked through it, I recommend checking out the [http://doc.qt.nokia.com/latest/mainwindows-application.html Application] example, which presents a small GUI application with menus, tool bars, a status bar, and so on. There are quite a few very educational [http://doc.qt.nokia.com/latest/all-examples.html Examples]. They are all written in C++, but are easy enough to follow since the point of them is to demonstrate usage of the Qt library, not C++ features.
This little game doesn't look much like a modern GUI application. It uses some GUI techniques, but after you've worked through it, I recommend checking out the [http://doc.qt.nokia.com/latest/mainwindows-application.html Application] example, which presents a small GUI application with menus, tool bars, a status bar, and so on. There are quite a few very educational [http://doc.qt.nokia.com/latest/all-examples.html Examples]. They are all written in C++, but are easy enough to follow since the point of them is to demonstrate usage of the Qt library, not C++ features.
</translate>
</translate>


<translate>
<translate>
<!--T:26-->
[[Category:Ruby]]
[[Category:Ruby]]
</translate>
</translate>

Revision as of 19:33, 1 July 2011

Other languages:


Development/Tutorials/Qt4 Ruby Tutorial


Author: Darshan Ishaya, [email protected]

Original link:http://www.darshancomputing.com/qt4-qtruby-tutorial/

Qt®4 Tutorial for Ruby

This tutorial gives an introduction to GUI programming using the Qt toolkit, Ruby, and qt4-qtruby. It is simply a port of Nokia's fine Qt Tutorial. Therefore, most of the text after this paragraph comes straight from their tutorial. I have modified it as necessary to make it make sense with the Ruby bindings, and have rearranged or rewritten a few parts to make them (I hope) a bit clearer.

This tutorial doesn't cover everything; the emphasis is on teaching the programming philosophy of GUI programming, and Qt's features are introduced as needed. Some commonly used features are never used in this tutorial.

Chapter one starts with a minimal "Hello world" program and the following chapters introduce new concepts. By Chapter 14, the "Hello world" program from Chapter 1 will have turned into a 448-line game.

If you're completely new to Qt, you might want to read How to Learn Qt if you haven't already done so. Keep in mind that like most documents about Qt, it is very C++ oriented.

Table of Contents

  1. Hello World!
  2. Calling it Quits
  3. Family Values
  4. Let There Be Widgets
  5. Building Blocks
  6. Building Blocks Galore!
  7. One Thing Leads to Another
  8. Preparing for Battle
  9. With Cannon You Can
  10. Smooth as Silk
  11. Giving It a Shot
  12. Hanging in the Air the Way Bricks Don't
  13. Game Over
  14. Facing the Wall

This little game doesn't look much like a modern GUI application. It uses some GUI techniques, but after you've worked through it, I recommend checking out the Application example, which presents a small GUI application with menus, tool bars, a status bar, and so on. There are quite a few very educational Examples. They are all written in C++, but are easy enough to follow since the point of them is to demonstrate usage of the Qt library, not C++ features.