Translations:Development/Tutorials/Qt4 Ruby Tutorial/Chapter 04/21/ru: Difference between revisions

From KDE TechBase
(Created page with "Как и большинство виджетов, наш виджет просто передаёт аргумент '''<tt>parent</tt>''' в конструктор класса...")
 
(No difference)

Latest revision as of 17:20, 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 04)
Like most widgets, it just passes on the '''<tt>parent</tt>''' parameter to the [http://doc.qt.nokia.com/latest/qwidget.html Qt::Widget] constructor. (If you're new to Ruby, calling '''<tt>super</tt>''' without any parameters will automatically pass on any parameters a method received to the superclass's method of the same name. ''Update'': Apparently, it's also important to leave off the parentheses — calling '''<tt>super()</tt>''' will call the superclass's method of the same name with an empty parameter list.)

Как и большинство виджетов, наш виджет просто передаёт аргумент parent в конструктор класса Qt::Widget. (Если вы не очень знакомы с Ruby: вызов super без аргументов автоматически передаёт все полученные в конструкторе аргументы в конструктор базового класса. Важно, что super написан без скобок: super() вызовет конструктор базового класса без аргументов.)