diff options
Diffstat (limited to 'qtruby/rubylib/examples/qt-examples/dclock/dclock.rb')
-rw-r--r-- | qtruby/rubylib/examples/qt-examples/dclock/dclock.rb | 12 |
1 files changed, 6 insertions, 6 deletions
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 |