diff options
author | toma <toma@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2009-11-25 17:56:58 +0000 |
---|---|---|
committer | toma <toma@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2009-11-25 17:56:58 +0000 |
commit | 90825e2392b2d70e43c7a25b8a3752299a933894 (patch) | |
tree | e33aa27f02b74604afbfd0ea4f1cfca8833d882a /qtruby/rubylib/examples/testcases/bugs.rb | |
download | tdebindings-90825e2392b2d70e43c7a25b8a3752299a933894.tar.gz tdebindings-90825e2392b2d70e43c7a25b8a3752299a933894.zip |
Copy the KDE 3.5 branch to branches/trinity for new KDE 3.5 features.
BUG:215923
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdebindings@1054174 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'qtruby/rubylib/examples/testcases/bugs.rb')
-rw-r--r-- | qtruby/rubylib/examples/testcases/bugs.rb | 57 |
1 files changed, 57 insertions, 0 deletions
diff --git a/qtruby/rubylib/examples/testcases/bugs.rb b/qtruby/rubylib/examples/testcases/bugs.rb new file mode 100644 index 00000000..6b5e3153 --- /dev/null +++ b/qtruby/rubylib/examples/testcases/bugs.rb @@ -0,0 +1,57 @@ +require 'Qt' + + +#### TODO ### +# dup of qobject crash +def bug1 + p1 = Qt::Point.new(5,5) + p1.setX 5 + p p1 + p3 = p1.dup + p3.setX 5 + p p3 +end +#bug1 + + +#### FIXED ### +def bug3 + a = Qt::Application.new(ARGV) + @file = Qt::PopupMenu.new + @file.insertSeparator + Qt::debug_level = Qt::DebugLevel::High + p $qApp + @file.insertItem("Quit", $qApp, SLOT('quit()')) + @file.exec +end +#bug3 + + +class CPUWaster < Qt::Widget + def initialize(*k) + super(*k) + end + def draw + painter = Qt::Painter.new(self) + 0.upto(1000) { |i| + cw, ch = width, height + c = Qt::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 + } + end +end +def bug4 + Qt::Application.new(ARGV) + w = CPUWaster.new + w.show + w.draw +end +bug4 |