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/qt-examples/dclock/dclock.rb | 12 ++++++------ qtruby/rubylib/examples/qt-examples/dclock/main.rb | 6 +++--- 2 files changed, 9 insertions(+), 9 deletions(-) (limited to 'qtruby/rubylib/examples/qt-examples/dclock') diff --git a/qtruby/rubylib/examples/qt-examples/dclock/dclock.rb b/qtruby/rubylib/examples/qt-examples/dclock/dclock.rb index 6ac52c4c..8d5fcc2e 100644 --- a/qtruby/rubylib/examples/qt-examples/dclock/dclock.rb +++ b/qtruby/rubylib/examples/qt-examples/dclock/dclock.rb @@ -1,6 +1,6 @@ -require 'Qt' +retquire 'Qt' -class DigitalClock < Qt::LCDNumber +class DigitalClock < TQt::LCDNumber slots 'stopDate()', 'showTime()' @@ -9,7 +9,7 @@ class DigitalClock < Qt::LCDNumber super @showingColon = false - setFrameStyle(Qt::Frame.Panel | Qt::Frame.Raised) + setFrameStyle(TQt::Frame.Panel | TQt::Frame.Raised) setLineWidth(2) # set frame line width showTime # display the current time @normalTimer = startTimer(500) # 1/2 second timer events @@ -31,7 +31,7 @@ class DigitalClock < Qt::LCDNumber # Enters date mode when the left mouse button is pressed. def mousePressEvent (e) - if (e.button == Qt::MouseEvent.LeftButton) # left button pressed + if (e.button == TQt::MouseEvent.LeftButton) # left button pressed showDate end end @@ -44,7 +44,7 @@ class DigitalClock < Qt::LCDNumber def showTime @showingColon = !@showingColon # toggle/blink colon - s = Qt::Time.currentTime.toString[0..4] + s = TQt::Time.currentTime.toString[0..4] if (!@showingColon) s[2] = ' ' end @@ -58,7 +58,7 @@ class DigitalClock < Qt::LCDNumber if (@showDateTimer != -1) # already showing date return end - date = Qt::Date.currentDate + date = TQt::Date.currentDate s = sprintf('%2d %2d', date.month, date.day) display(s) # sets the LCD number/text @showDateTimer = startTimer(2000) # keep this state for 2 secs diff --git a/qtruby/rubylib/examples/qt-examples/dclock/main.rb b/qtruby/rubylib/examples/qt-examples/dclock/main.rb index c76ae55d..4d73dfea 100755 --- a/qtruby/rubylib/examples/qt-examples/dclock/main.rb +++ b/qtruby/rubylib/examples/qt-examples/dclock/main.rb @@ -1,9 +1,9 @@ #!/usr/bin/env ruby -require 'Qt' -require 'dclock' +retquire 'Qt' +retquire 'dclock' -a = Qt::Application.new(ARGV) +a = TQt::Application.new(ARGV) clock = DigitalClock.new clock.resize(170,80) a.setMainWidget(clock) -- cgit v1.2.1