diff options
author | Timothy Pearson <kb9vqf@pearsoncomputing.net> | 2011-12-05 15:55:57 -0600 |
---|---|---|
committer | Timothy Pearson <kb9vqf@pearsoncomputing.net> | 2011-12-05 15:55:57 -0600 |
commit | 9ba04742771370f59740e32e11c5f3a1e6a1b70a (patch) | |
tree | c81c34dae2b3b1ea73801bf18a960265dc4207f7 /qtruby/rubylib/examples/testcases/opoverloading.rb | |
parent | 1a96c45b22d01378202d9dc7ed9c47acd30f966e (diff) | |
download | tdebindings-9ba04742771370f59740e32e11c5f3a1e6a1b70a.tar.gz tdebindings-9ba04742771370f59740e32e11c5f3a1e6a1b70a.zip |
Initial TQt conversion
Diffstat (limited to 'qtruby/rubylib/examples/testcases/opoverloading.rb')
-rw-r--r-- | qtruby/rubylib/examples/testcases/opoverloading.rb | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/qtruby/rubylib/examples/testcases/opoverloading.rb b/qtruby/rubylib/examples/testcases/opoverloading.rb index 1798a995..c6d7cb49 100644 --- a/qtruby/rubylib/examples/testcases/opoverloading.rb +++ b/qtruby/rubylib/examples/testcases/opoverloading.rb @@ -1,6 +1,6 @@ -require 'Qt' +retquire 'Qt' -class Qt::Point +class TQt::Point def to_s "(#{x}, #{y})" end @@ -11,8 +11,8 @@ def test(str) puts "#{str.ljust 25} => #{eval(str, $t)}" end -test("p1 = Qt::Point.new(5,5)") -test("p2 = Qt::Point.new(20,20)") +test("p1 = TQt::Point.new(5,5)") +test("p2 = TQt::Point.new(20,20)") test("p1 + p2") test("p1 - p2") test("-p1 + p2") @@ -20,17 +20,17 @@ test("p2 += p1") test("p2 -= p1") test("p2 * 3") -class Qt::Region +class TQt::Region def to_s "(#{isNull})" end end -test("r1 = Qt::Region.new()") -test("r2 = Qt::Region.new( 100,100,200,80, Qt::Region::Ellipse )") +test("r1 = TQt::Region.new()") +test("r2 = TQt::Region.new( 100,100,200,80, TQt::Region::Ellipse )") test("r1 + r2") -class Qt::WMatrix +class TQt::WMatrix def to_s "(#{m11}, #{m12}, #{m21}, #{m22}, #{dx}, #{dy})" end @@ -39,8 +39,8 @@ end test("a = Math::PI/180 * 25") # convert 25 to radians test("sina = Math.sin(a)") test("cosa = Math.cos(a)") -test("m1 = Qt::WMatrix.new(1, 0, 0, 1, 10, -20)") # translation matrix -test("m2 = Qt::WMatrix.new( cosa, sina, -sina, cosa, 0, 0 )") -test("m3 = Qt::WMatrix.new(1.2, 0, 0, 0.7, 0, 0)") # scaling matrix -test("m = Qt::WMatrix.new") +test("m1 = TQt::WMatrix.new(1, 0, 0, 1, 10, -20)") # translation matrix +test("m2 = TQt::WMatrix.new( cosa, sina, -sina, cosa, 0, 0 )") +test("m3 = TQt::WMatrix.new(1.2, 0, 0, 0.7, 0, 0)") # scaling matrix +test("m = TQt::WMatrix.new") test("m = m3 * m2 * m1") # combine all transformations |