Translate
Appearance
Text
This page always uses small font size
Width
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.
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
Need more help?Ask for more information
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
Need more help?Ask for more information
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.
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.
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.
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.
Loading messages...
0% translated, 0% reviewed
Retrieved from "https://techbase.kde.org/Special:Translate"