Translations:Development/Tutorials/Qt4 Ruby Tutorial/Chapter 05/25/fi: Difference between revisions

From KDE TechBase
(Created page with "[http://doc.qt.nokia.com/latest/qwidget.html#setLayout Qt::Widget::setLayout()]-funktio asentaa asettelun kohteelle '''<tt>MyWidget</tt>'''. Tämä tekee asettelusta käyttöliit...")
 
(No difference)

Latest revision as of 18:40, 4 September 2011

Information about message (contribute)
This message has no documentation. If you know where or how this message is used, you can help other translators by adding documentation to this message.
Message definition (Development/Tutorials/Qt4 Ruby Tutorial/Chapter 05)
The [http://doc.qt.nokia.com/latest/qwidget.html#setLayout Qt::Widget::setLayout()] function installs the layout on '''<tt>MyWidget</tt>'''. This makes the layout a child widget of '''<tt>MyWidget</tt>''' so we don't have to worry about deleting it; it will be deleted together with '''<tt>MyWidget</tt>'''. Also, the call to [http://doc.qt.nokia.com/latest/qwidget.html#setLayout Qt::Widget::setLayout()] automatically reparents the widgets in the layout so that they are children of '''<tt>MyWidget</tt>'''. Because of this, we didn't need to specify '''<tt>self</tt>''' as the parent for the '''<tt>quit</tt>''', '''<tt>lcd</tt>''', and '''<tt>slider</tt>''' widgets.

Qt::Widget::setLayout()-funktio asentaa asettelun kohteelle MyWidget. Tämä tekee asettelusta käyttöliittymäkomponentin MyWidget tytärkomponentin, joten meidän ei tarvitse huolehtia sen poistamisestat; se poistetaan yhdessä käyttöliittymäkomponentin MyWidget:n kanssa. Myös kutsu kohteeseen Qt::Widget::setLayout() muodostaa automaattisesti käyttöliittymäkomponentin emo-tytärsuhteen niin että se on MyWidget:n tytär. Tästä syystä meidän ei tarvitse määritellä käyttöliitymäkomponenttia self komponenttien quit, lcd, ja slider emoksi.