Translate

Jump to: navigation, search
Settings

Information about the group Translation of the wiki page Development/Tutorials/Qt4 Ruby Tutorial/Chapter 10.
Development/Tutorials/Qt4 Ruby Tutorial/Chapter 10Current message text
...Chapter 10/Page display title/ruРазработка/Руководства/Введение в Qt4 на Ruby/Глава 10
...t4 Ruby Tutorial/Chapter 10/1/ruTutorialBrowser/ru
...t4 Ruby Tutorial/Chapter 10/2/ruВведение в программирование на Qt<sup>®</sup>4 на языке Ruby
...t4 Ruby Tutorial/Chapter 10/3/ruГладкий как шёлк
...t4 Ruby Tutorial/Chapter 10/4/ruПример 9: Пушка детям не игрушка
...t4 Ruby Tutorial/Chapter 10/5/ruПример 11: Пробный выстрел
...t4 Ruby Tutorial/Chapter 10/6/ru== Гладкий как шёлк ==
...t4 Ruby Tutorial/Chapter 10/7/ru[[Image:Qt4_Ruby_Tutorial_Screenshot_10.png|center]]
...t4 Ruby Tutorial/Chapter 10/8/ruФайлы:
...t4 Ruby Tutorial/Chapter 10/9/ru=== Обзор ===
...4 Ruby Tutorial/Chapter 10/10/ruIn this example, we add a force control.
...4 Ruby Tutorial/Chapter 10/11/ru=== Построчный обзор программы ===
...4 Ruby Tutorial/Chapter 10/12/ruThe '''<tt>CannonField</tt>''' now has a force value in addition to the angle.
...4 Ruby Tutorial/Chapter 10/13/ruThe interface to the force follows the same practice as for the angle.
...4 Ruby Tutorial/Chapter 10/14/ruThe force '''<tt>@currentForce</tt>''' is initialized to zero.
...4 Ruby Tutorial/Chapter 10/15/ruWe have made a slight change in the '''<tt>setAngle()</tt>''' function. It repaints only the portion of the widget that contains the cannon.
...4 Ruby Tutorial/Chapter 10/16/ruThe implementation of '''<tt>setForce()</tt>''' is quite similar to that of '''<tt>setAngle()</tt>'''. The only difference is that because we don't show the force value, we don't need to repaint the widget.
...4 Ruby Tutorial/Chapter 10/17/ruWe paint as in Chapter 9.
...4 Ruby Tutorial/Chapter 10/18/ruThe '''<tt>cannonRect()</tt>''' function returns the rectangle enclosing the cannon in widget coordinates. First we create a rectangle with the size 50 x 50 and then move it so its bottom-left corner is equal to the widget's own bottom-left corner.
...4 Ruby Tutorial/Chapter 10/19/ruThe [http://doc.qt.nokia.com/latest/qwidget.html#rect-prop Qt::Widget::rect()] function returns the widget's enclosing rectangle in the widget's own coordinates. The top-left corner of the rectangle is always (0, 0).
...4 Ruby Tutorial/Chapter 10/20/ruThe constructor is mostly the same, but some new bits have been added.
...4 Ruby Tutorial/Chapter 10/21/ruWe add a second '''<tt>LCDRange</tt>''', which will be used to set the force.
...4 Ruby Tutorial/Chapter 10/22/ruWe connect the '''<tt>force</tt>''' widget and the '''<tt>cannonField</tt>''' widget, just like we did for the '''<tt>angle</tt>''' widget.
...4 Ruby Tutorial/Chapter 10/23/ruIn Chapter 9, we put '''<tt>angle</tt>''' in the lower-left cell of the layout. Now we want to have two widgets in that cell, so we make a vertical box, put the vertical box in the grid cell, and put each of '''<tt>angle</tt>''' and '''<tt>range</tt>''' in the vertical box.
...4 Ruby Tutorial/Chapter 10/24/ruWe initialize the force value to 25.
...4 Ruby Tutorial/Chapter 10/25/ru=== Запуск приложения ===
...4 Ruby Tutorial/Chapter 10/26/ruWe now have a force control.
...4 Ruby Tutorial/Chapter 10/27/ru=== Exercises ===
Make the size of the cannon barrel be dependent on the force.
...4 Ruby Tutorial/Chapter 10/28/ruPut the cannon in the bottom-right corner.
...4 Ruby Tutorial/Chapter 10/29/ruTry adding a better keyboard interface. For example, make + and - increase and decrease the force and enter shoot. If you're bothered by the way the '''<tt>Left</tt>''' and '''<tt>Right</tt>''' keys work, change that too. [Hint: Reimplement [http://doc.qt.nokia.com/latest/qwidget.html#keyPressEvent Qt::Widget::keyPressEvent()].]
...4 Ruby Tutorial/Chapter 10/30/ru[[Category:Ruby/ru]]
NavigationShowing 31 messages.
KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V.Legal