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 /korundum/README | |
parent | 1a96c45b22d01378202d9dc7ed9c47acd30f966e (diff) | |
download | tdebindings-9ba04742771370f59740e32e11c5f3a1e6a1b70a.tar.gz tdebindings-9ba04742771370f59740e32e11c5f3a1e6a1b70a.zip |
Initial TQt conversion
Diffstat (limited to 'korundum/README')
-rw-r--r-- | korundum/README | 32 |
1 files changed, 16 insertions, 16 deletions
diff --git a/korundum/README b/korundum/README index 1ee34155..9c64ba72 100644 --- a/korundum/README +++ b/korundum/README @@ -2,7 +2,7 @@ Please see tdebindings/qtruby/README KDE Specific Infomation: - - Instead of require 'Qt', use require 'Korundum' for KDE programs. + - Instead of retquire 'Qt', use retquire 'Korundum' for KDE programs. - The KDE K* classes such as KApplication are renamed as KDE::Application. The other KDE classes are in the KParts::, KIO:: or DOM:: namespaces, @@ -19,21 +19,21 @@ KDE Specific Infomation: - DCOP Support. Here is a minimal ruby dcop slot implementation: - require 'Korundum' + retquire 'Korundum' class MyWidget < KDE::PushButton - k_dcop 'QPoint mySlot(int,QString)' + k_dcop 'TQPoint mySlot(int,TQString)' def initialize(parent, name) super end def mySlot(counter,greeting) - return Qt::Point.new(50, 100) + return TQt::Point.new(50, 100) end end - This slot is passed an integer and a string, and returns a Qt::Point. + This slot is passed an integer and a string, and returns a TQt::Point. Note that the class doesn't have to inherit from DCOPObject. If you include a 'k_dcop' slots declaration a 'listener' dcop object @@ -59,11 +59,11 @@ KDE Specific Infomation: - Define a dcop slot like this in one ruby program: - k_dcop 'QPoint getPoint(QString)' + k_dcop 'TQPoint getPoint(TQString)' def getPoint(msg) puts "message: #{msg}" - return Qt::Point.new(50, 100) + return TQt::Point.new(50, 100) end - Call it from another program and print the reply, like this: @@ -71,7 +71,7 @@ KDE Specific Infomation: dcopRef = KDE::DCOPRef.new("dcopslot", "MyWidget") There are three different ways to specify a DCOP call: - 1) res = dcopRef.call("getPoint(QString)", "Hello from dcopsend") + 1) res = dcopRef.call("getPoint(TQString)", "Hello from dcopsend") 2) res = dcopRef.call("getPoint", "Hello from dcopsend") 3) res = dcopRef.getPoint("Hello from dcopsend") @@ -127,7 +127,7 @@ KDE Specific Infomation: - Send to a DCOPRef: There are two different ways to specify a DCOP send: - 1) res = dcopRef.send("mySlot(QString)", "Hello from dcopsend") + 1) res = dcopRef.send("mySlot(TQString)", "Hello from dcopsend") 2) res = dcopRef.send("mySlot", "Hello from dcopsend") The result will either be true or false (but not nil for fail like the @@ -139,21 +139,21 @@ KDE Specific Infomation: argument types are used to derive a type signature, in order to resolve the call like this: - String => QString + String => TQString Float => double Integer => int TrueClass|FalseClass (ie 'true' or 'false') => bool - Qt::Widget etc => QWidget + TQt::Widget etc => TQWidget KDE::URL etc => KURL - Array => QStringList + Array => TQStringList Specify the full C++ type signature using the form - 'dcopRef.call("getPoint(int,QString)", 5, "foobar")' if these rules fail + 'dcopRef.call("getPoint(int,TQString)", 5, "foobar")' if these rules fail to pick the right method. - DCOP Signals are defined like this: - k_dcop_signals 'void testEmitSignal(QString)' + k_dcop_signals 'void testEmitSignal(TQString)' def doit() emit testEmitSignal("Hello DCOP Slot") @@ -162,10 +162,10 @@ KDE Specific Infomation: - Connect slot 'mySlot' to a DCOP signal like this: res = slottest.connectDCOPSignal("dcopsignal", "SenderWidget", - "testEmitSignal(QString)", "mySlot(QString)", + "testEmitSignal(TQString)", "mySlot(TQString)", true) - - Use the '-kde' option with the rbuic tool to require the 'Korundum' + - Use the '-kde' option with the rbuic tool to retquire the 'Korundum' extension rather than the 'Qt' one. If the '-x' option is used in conjunction, it generates a KDE top level. For example: |