Translations:Development/Tutorials/Qt4 Ruby Tutorial/Chapter 05/24/ru: Difference between revisions

From KDE TechBase
(Created page with "'''<tt>MyWidget</tt>''' теперь использует [http://doc.qt.nokia.com/latest/qvboxlayout.html Qt::VBoxLayout] (вертикальная компоновка видж...")
 
(No difference)

Latest revision as of 17:30, 2 July 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)
'''<tt>MyWidget</tt>''' now uses a [http://doc.qt.nokia.com/latest/qvboxlayout.html Qt::VBoxLayout] to manage the geometry of its child widgets. For that reason, we don't need to specify the screen coordinates for each widget like we did in Chapter 4. In addition, using a layout ensures that the child widgets are resized when the window is resized. Then we add the '''<tt>quit</tt>''', '''<tt>lcd</tt>''', and '''<tt>slider</tt>''' widgets to the layout using [http://doc.qt.nokia.com/latest/qboxlayout.html#addWidget Qt::BoxLayout::addWidget()].

MyWidget теперь использует Qt::VBoxLayout (вертикальная компоновка виджетов) для управления геометрией дочерних объектов. Поэтому теперь не нужно задавать координаты каждого виджета, как это делалось в 4-й главе. Кроме того, при использовании компоновки дочерние виджеты автоматически меняют размеры при изменении размеров окна. Затем мы добавляем виджеты quit, lcd, and slider в объект компоновки с помощью метода Qt::BoxLayout::addWidget().