Class: CalculatorForm
- Inherits:
-
Qt::Widget
- Object
- Qt::Base
- Qt::Widget
- CalculatorForm
- Defined in:
- ext/ruby/qtruby/examples/designer/calculatorbuilder/calculatorform.rb,
ext/ruby/qtruby/examples/designer/calculatorform/calculatorform.rb
Overview
** ** Copyright © 2004-2005 Trolltech AS. All rights reserved. ** ** This file is part of the example classes of the Qt Toolkit. ** ** This file may be used under the terms of the GNU General Public ** License version 2.0 as published by the Free Software Foundation ** and appearing in the file LICENSE.GPL included in the packaging of ** this file. Please review the following information to ensure GNU ** General Public Licensing requirements will be met: ** www.trolltech.com/products/qt/opensource.html ** ** If you are unsure which license is appropriate for your use, please ** review the following information: ** www.trolltech.com/products/qt/licensing.html or contact the ** sales department at [email protected]. ** ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. **
** Translated to QtRuby by Richard Dale
Instance Method Summary collapse
-
#initialize(parent = nil) ⇒ CalculatorForm
constructor
A new instance of CalculatorForm.
- #on_inputSpinBox1_valueChanged(value) ⇒ Object
- #on_inputSpinBox2_valueChanged(value) ⇒ Object
Methods inherited from Qt::Widget
Methods inherited from Qt::Base
#%, #&, #*, #**, #+, #-, #-@, #/, #<, #<<, #<=, #==, #>, #>=, #>>, #QCOMPARE, #QEXPECT_FAIL, #QFAIL, #QSKIP, #QTEST, #QVERIFY, #QVERIFY2, #QWARN, #^, ancestors, #is_a?, #methods, private_slots, #protected_methods, #public_methods, q_classinfo, q_signal, q_slot, signals, #singleton_methods, slots, #|, #~
Constructor Details
#initialize(parent = nil) ⇒ CalculatorForm
Returns a new instance of CalculatorForm.
33 34 35 36 37 |
# File 'ext/ruby/qtruby/examples/designer/calculatorform/calculatorform.rb', line 33 def initialize(parent = nil) super(parent) @ui = Ui_CalculatorForm.new @ui.setupUi(self) end |
Instance Method Details
#on_inputSpinBox1_valueChanged(value) ⇒ Object
39 40 41 |
# File 'ext/ruby/qtruby/examples/designer/calculatorform/calculatorform.rb', line 39 def on_inputSpinBox1_valueChanged(value) @ui.outputWidget.text = "%d" % (value + @ui.inputSpinBox2.value) end |
#on_inputSpinBox2_valueChanged(value) ⇒ Object
43 44 45 |
# File 'ext/ruby/qtruby/examples/designer/calculatorform/calculatorform.rb', line 43 def on_inputSpinBox2_valueChanged(value) @ui.outputWidget.text = "%d" % (value + @ui.inputSpinBox1.value) end |