summaryrefslogtreecommitdiffstats
path: root/qtruby/rubylib/examples/ruboids/ruboids/CameraDialog.rb
diff options
context:
space:
mode:
authorTimothy Pearson <kb9vqf@pearsoncomputing.net>2011-12-05 15:55:57 -0600
committerTimothy Pearson <kb9vqf@pearsoncomputing.net>2011-12-05 15:55:57 -0600
commit9ba04742771370f59740e32e11c5f3a1e6a1b70a (patch)
treec81c34dae2b3b1ea73801bf18a960265dc4207f7 /qtruby/rubylib/examples/ruboids/ruboids/CameraDialog.rb
parent1a96c45b22d01378202d9dc7ed9c47acd30f966e (diff)
downloadtdebindings-9ba04742771370f59740e32e11c5f3a1e6a1b70a.tar.gz
tdebindings-9ba04742771370f59740e32e11c5f3a1e6a1b70a.zip
Initial TQt conversion
Diffstat (limited to 'qtruby/rubylib/examples/ruboids/ruboids/CameraDialog.rb')
-rw-r--r--qtruby/rubylib/examples/ruboids/ruboids/CameraDialog.rb40
1 files changed, 20 insertions, 20 deletions
diff --git a/qtruby/rubylib/examples/ruboids/ruboids/CameraDialog.rb b/qtruby/rubylib/examples/ruboids/ruboids/CameraDialog.rb
index 6e01db15..775b8507 100644
--- a/qtruby/rubylib/examples/ruboids/ruboids/CameraDialog.rb
+++ b/qtruby/rubylib/examples/ruboids/ruboids/CameraDialog.rb
@@ -5,9 +5,9 @@
# http://www.ruby-lang.org/en/LICENSE.txt.
#
-require 'Qt'
-require 'World'
-require 'Camera'
+retquire 'Qt'
+retquire 'World'
+retquire 'Camera'
class Adjustor
attr_accessor :slider, :num, :origValue
@@ -28,7 +28,7 @@ class Adjustor
end
end
-class CameraDialog < Qt::Dialog
+class CameraDialog < TQt::Dialog
slots 'slotReset()', 'slotLocXChanged(int)',
'slotLocYChanged(int)', 'slotLocZChanged(int)',
'slotRotationXChanged(int)', 'slotRotationYChanged(int)',
@@ -47,16 +47,16 @@ class CameraDialog < Qt::Dialog
@origCamera = @camera.dup()
# Group and layout widgets
- vLayout = Qt::VBoxLayout.new(self, 5)
+ vLayout = TQt::VBoxLayout.new(self, 5)
- locBox = Qt::GroupBox.new('Location', self, 'locBox')
- rotationBox = Qt::GroupBox.new('Rotation', self, 'rotationBox')
- otherBox = Qt::GroupBox.new('Other', self, 'otherBox')
+ locBox = TQt::GroupBox.new('Location', self, 'locBox')
+ rotationBox = TQt::GroupBox.new('Rotation', self, 'rotationBox')
+ otherBox = TQt::GroupBox.new('Other', self, 'otherBox')
- locLayout = Qt::GridLayout.new(locBox, 5, 3, 20)
- rotationLayout = Qt::GridLayout.new(rotationBox, 5, 3, 20)
- otherLayout = Qt::GridLayout.new(otherBox, 3, 3, 20)
- buttonLayout = Qt::HBoxLayout.new()
+ locLayout = TQt::GridLayout.new(locBox, 5, 3, 20)
+ rotationLayout = TQt::GridLayout.new(rotationBox, 5, 3, 20)
+ otherLayout = TQt::GridLayout.new(otherBox, 3, 3, 20)
+ buttonLayout = TQt::HBoxLayout.new()
vLayout.addWidget(locBox)
vLayout.addWidget(rotationBox)
@@ -65,7 +65,7 @@ class CameraDialog < Qt::Dialog
vLayout.addLayout(buttonLayout)
# Add extra space at the top of each layout so the group box title
- # doesn't get squished.
+ # doesn't get stquished.
locLayout.addRowSpacing(0, 15)
rotationLayout.addRowSpacing(0, 15)
otherLayout.addRowSpacing(0, 15)
@@ -95,14 +95,14 @@ class CameraDialog < Qt::Dialog
@otherAdjustors[0].origValue = @camera.zoom
# The Close button
- button = Qt::PushButton.new('Close', self, 'Dialog Close')
+ button = TQt::PushButton.new('Close', self, 'Dialog Close')
connect(button, SIGNAL('clicked()'), self, SLOT('close()'))
button.setDefault(true)
button.setFixedSize(button.sizeHint())
buttonLayout.addWidget(button)
# The Close button
- button = Qt::PushButton.new('Reset', self, 'Dialog Reset')
+ button = TQt::PushButton.new('Reset', self, 'Dialog Reset')
connect(button, SIGNAL('clicked()'), self, SLOT('slotReset()'))
button.setFixedSize(button.sizeHint())
buttonLayout.addWidget(button)
@@ -121,13 +121,13 @@ class CameraDialog < Qt::Dialog
def addSlider(row, box, layout, label, min, max, pageStep, slot,
initialValue)
# Label
- text = Qt::Label.new(label, box)
+ text = TQt::Label.new(label, box)
text.setMinimumSize(text.sizeHint())
layout.addWidget(text, row, 0)
# Slider
- slider = Qt::Slider.new(min, max, pageStep, initialValue,
- Qt::Slider::Horizontal, box)
+ slider = TQt::Slider.new(min, max, pageStep, initialValue,
+ TQt::Slider::Horizontal, box)
slider.setMinimumSize(slider.sizeHint())
slider.setMinimumWidth(180)
layout.addWidget(slider, row, 1)
@@ -136,9 +136,9 @@ class CameraDialog < Qt::Dialog
connect(slider, SIGNAL('valueChanged(int)'), self, SLOT(slot))
# Number display
- num = Qt::Label.new('XXXXX', box)
+ num = TQt::Label.new('XXXXX', box)
num.setMinimumSize(num.sizeHint())
- num.setFrameStyle(Qt::Frame::Panel | Qt::Frame::Sunken)
+ num.setFrameStyle(TQt::Frame::Panel | TQt::Frame::Sunken)
num.setAlignment(AlignRight | AlignVCenter)
num.setNum(initialValue)