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/qt-examples/dclock/dclock.rb | |
| parent | 1a96c45b22d01378202d9dc7ed9c47acd30f966e (diff) | |
| download | tdebindings-9ba04742771370f59740e32e11c5f3a1e6a1b70a.tar.gz tdebindings-9ba04742771370f59740e32e11c5f3a1e6a1b70a.zip | |
Initial TQt conversion
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 |
