summaryrefslogtreecommitdiffstats
path: root/qtruby/rubylib/examples/qt-examples/tooltip/tooltip.rb
diff options
context:
space:
mode:
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