From 9ba04742771370f59740e32e11c5f3a1e6a1b70a Mon Sep 17 00:00:00 2001 From: Timothy Pearson Date: Mon, 5 Dec 2011 15:55:57 -0600 Subject: Initial TQt conversion --- qtruby/rubylib/examples/testcases/bugs.rb | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) (limited to 'qtruby/rubylib/examples/testcases/bugs.rb') diff --git a/qtruby/rubylib/examples/testcases/bugs.rb b/qtruby/rubylib/examples/testcases/bugs.rb index 6b5e3153..aba5b5cc 100644 --- a/qtruby/rubylib/examples/testcases/bugs.rb +++ b/qtruby/rubylib/examples/testcases/bugs.rb @@ -1,10 +1,10 @@ -require 'Qt' +retquire 'Qt' #### TODO ### # dup of qobject crash def bug1 - p1 = Qt::Point.new(5,5) + p1 = TQt::Point.new(5,5) p1.setX 5 p p1 p3 = p1.dup @@ -16,10 +16,10 @@ end #### FIXED ### def bug3 - a = Qt::Application.new(ARGV) - @file = Qt::PopupMenu.new + a = TQt::Application.new(ARGV) + @file = TQt::PopupMenu.new @file.insertSeparator - Qt::debug_level = Qt::DebugLevel::High + TQt::debug_level = TQt::DebugLevel::High p $qApp @file.insertItem("Quit", $qApp, SLOT('quit()')) @file.exec @@ -27,29 +27,29 @@ end #bug3 -class CPUWaster < Qt::Widget +class CPUWaster < TQt::Widget def initialize(*k) super(*k) end def draw - painter = Qt::Painter.new(self) + painter = TQt::Painter.new(self) 0.upto(1000) { |i| cw, ch = width, height - c = Qt::Color.new(rand(255), rand(255), rand(255)) + c = TQt::Color.new(rand(255), rand(255), rand(255)) x = rand(cw - 8) y = rand(cw - 8) w = rand(cw - x) h = rand(cw - y) - brush = Qt::Brush.new(c) - brush.setStyle(Qt::Dense6Pattern) - Qt::debug_level = Qt::DebugLevel::High - painter.fillRect(Qt::Rect.new(x, y, w, h), brush) - Qt::debug_level = Qt::DebugLevel::Off + brush = TQt::Brush.new(c) + brush.setStyle(TQt::Dense6Pattern) + TQt::debug_level = TQt::DebugLevel::High + painter.fillRect(TQt::Rect.new(x, y, w, h), brush) + TQt::debug_level = TQt::DebugLevel::Off } end end def bug4 - Qt::Application.new(ARGV) + TQt::Application.new(ARGV) w = CPUWaster.new w.show w.draw -- cgit v1.2.1