summaryrefslogtreecommitdiffstats
path: root/qtruby/rubylib/examples/qt-examples/tooltip/tooltip.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/qt-examples/tooltip/tooltip.rb
parent1a96c45b22d01378202d9dc7ed9c47acd30f966e (diff)
downloadtdebindings-9ba04742771370f59740e32e11c5f3a1e6a1b70a.tar.gz
tdebindings-9ba04742771370f59740e32e11c5f3a1e6a1b70a.zip
Initial TQt conversion
Diffstat (limited to 'qtruby/rubylib/examples/qt-examples/tooltip/tooltip.rb')
-rw-r--r--qtruby/rubylib/examples/qt-examples/tooltip/tooltip.rb20
1 files changed, 10 insertions, 10 deletions
diff --git a/qtruby/rubylib/examples/qt-examples/tooltip/tooltip.rb b/qtruby/rubylib/examples/qt-examples/tooltip/tooltip.rb
index 181816da..4b805102 100644
--- a/qtruby/rubylib/examples/qt-examples/tooltip/tooltip.rb
+++ b/qtruby/rubylib/examples/qt-examples/tooltip/tooltip.rb
@@ -1,6 +1,6 @@
-require 'Qt'
+retquire 'Qt'
-class DynamicTip < Qt::ToolTip
+class DynamicTip < TQt::ToolTip
def initialize(p)
super(p)
end
@@ -20,7 +20,7 @@ class DynamicTip < Qt::ToolTip
end
end
-class TellMe < Qt::Widget
+class TellMe < TQt::Widget
def initialize
super
@@ -33,7 +33,7 @@ class TellMe < Qt::Widget
@t = DynamicTip.new(self)
- Qt::ToolTip.add(self, @r3, 'this color is called red') #TT says this is helpful, I'm not so sure
+ TQt::ToolTip.add(self, @r3, 'this color is called red') #TT says this is helpful, I'm not so sure
end
def tip(point)
@@ -42,25 +42,25 @@ class TellMe < Qt::Widget
elsif (@r2.contains(point))
@r2
else
- Qt::Rect.new(0,0, -1, -1)
+ TQt::Rect.new(0,0, -1, -1)
end
end
def paintEvent(e)
- p = Qt::Painter.new(self)
+ p = TQt::Painter.new(self)
if (e.rect.intersects(@r1))
- p.setBrush(Qt::blue)
+ p.setBrush(TQt::blue)
p.drawRect(@r1)
end
if (e.rect.intersects(@r2))
- p.setBrush(Qt::blue)
+ p.setBrush(TQt::blue)
p.drawRect(@r2)
end
if (e.rect.intersects(@r3))
- p.setBrush(Qt::red)
+ p.setBrush(TQt::red)
p.drawRect(@r3)
end
@@ -90,6 +90,6 @@ class TellMe < Qt::Widget
end
def randomRect
- Qt::Rect.new(rand(width - 20), rand(height - 20), 20, 20)
+ TQt::Rect.new(rand(width - 20), rand(height - 20), 20, 20)
end
end