summaryrefslogtreecommitdiffstats
path: root/qtruby/rubylib/examples/qt-examples/dclock
diff options
context:
space:
mode:
Diffstat (limited to 'qtruby/rubylib/examples/qt-examples/dclock')
-rw-r--r--qtruby/rubylib/examples/qt-examples/dclock/dclock.rb12
-rwxr-xr-xqtruby/rubylib/examples/qt-examples/dclock/main.rb6
2 files changed, 9 insertions, 9 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
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)