Jump to content

Translate

AllDevelopment/Tutorials/Qt4 Ruby Tutorial/Chapter 06
Translate to Hausa

Translation of the wiki page Development/Tutorials/Qt4 Ruby Tutorial/Chapter 06 from English (en).

This tool does not work without JavaScript. JavaScript is disabled, failed to work, or this browser is unsupported.
Development/Tutorials/Qt4 Ruby Tutorial/Chapter 06
Translations:Development/Tutorials/Qt4 Ruby Tutorial/Chapter 06/Page display title/ha
Development/Tutorials/Qt4 Ruby Tutorial/Chapter 06
You need translation rights to translate messages.Get permission
Loading...
Latest updatesAll changes
Suggestions
In other languages
TutorialBrowser
Translations:Development/Tutorials/Qt4 Ruby Tutorial/Chapter 06/1/ha
TutorialBrowser
You need translation rights to translate messages.Get permission
Loading...
Latest updatesAll changes
Suggestions
In other languages
Qt4 Ruby Tutorial
Building Blocks Galore!
Tutorial 5 - Building Blocks
Tutorial 7 - One Thing Leads to Another
== Building Blocks Galore! ==
[[Image:Qt4_Ruby_Tutorial_Screenshot_6.png|center]]
Files:
=== Overview ===
This example shows how to encapsulate two widgets into a new component and how easy it is to use many widgets. For the first time, we use a custom widget as a child widget.
=== Line by Line Walkthrough ===
The '''<tt>LCDRange</tt>''' widget is a widget without any API. It just has a constructor. This sort of widget is not very useful, so we'll add some API later.
This is lifted straight from the '''<tt>MyWidget</tt>''' constructor in [[Special:myLanguage/Development/Tutorials/Qt4_Ruby_Tutorial/Chapter_05|Chapter 5]]. The only differences are that the <strong>Quit</strong> button is left out and the class is renamed.
'''<tt>MyWidget</tt>''', too, contains no API except a constructor.
The push button that used to be in what is now '''<tt>LCDRange</tt>''' has been separated so that we can have one <strong>Quit</strong> button and many '''<tt>LCDRange</tt>''' objects.
We create a [http://doc.qt.nokia.com/latest/qwidget.html Qt::Widget] with a [http://doc.qt.nokia.com/latest/qgridlayout.html Qt::GridLayout] that will contain three columns. The [http://doc.qt.nokia.com/latest/qgridlayout.html Qt::GridLayout] automatically arranges its widgets in rows and columns; you can specify the row and column numbers when adding widgets to the layout, and [http://doc.qt.nokia.com/latest/qgridlayout.html Qt::GridLayout] will fit them into the grid.
We create nine '''<tt>LCDRange</tt>''' widgets, all of which are children of the grid object, and we arrange them in three rows and three columns.
=== Running the Application ===
This program shows how easy it is to use many widgets at a time. Each one behaves like the slider and LCD number in the previous chapter. Again, the difference lies in the implementation.
=== Exercises ===
Initialize each slider with a different/random value on startup.
[[Category:Ruby]]
Loading messages...
0% translated, 0% reviewed
All
Recent