diff options
author | Michele Calgaro <michele.calgaro@yahoo.it> | 2024-01-13 11:29:06 +0900 |
---|---|---|
committer | Michele Calgaro <michele.calgaro@yahoo.it> | 2024-01-13 11:45:40 +0900 |
commit | faf33629bb6562a6f43f930afafe4b22e9cdb60b (patch) | |
tree | 8fc6dc6d999a3a039ace28db2fe5b96712fa18e0 /qtruby/rubylib/examples/network | |
parent | 0ff7d227c65fecb4fb7482ecd679acb594ef5cf7 (diff) | |
download | tdebindings-faf33629bb6562a6f43f930afafe4b22e9cdb60b.tar.gz tdebindings-faf33629bb6562a6f43f930afafe4b22e9cdb60b.zip |
Use new TQ_METHOD, TQ_SIGNAL, TQ_SLOT defines
Signed-off-by: Michele Calgaro <michele.calgaro@yahoo.it>
Diffstat (limited to 'qtruby/rubylib/examples/network')
-rw-r--r-- | qtruby/rubylib/examples/network/clientserver/client/client.rb | 26 | ||||
-rw-r--r-- | qtruby/rubylib/examples/network/clientserver/server/server.rb | 24 |
2 files changed, 25 insertions, 25 deletions
diff --git a/qtruby/rubylib/examples/network/clientserver/client/client.rb b/qtruby/rubylib/examples/network/clientserver/client/client.rb index 1272adf0..85e769cb 100644 --- a/qtruby/rubylib/examples/network/clientserver/client/client.rb +++ b/qtruby/rubylib/examples/network/clientserver/client/client.rb @@ -12,20 +12,20 @@ class Client < TQt::VBox close = TQt::PushButton.new( tr("Close connection") , self ) quit = TQt::PushButton.new( tr("Quit") , self ) - connect( send, SIGNAL('clicked()'), SLOT('sendToServer()') ) - connect( close, SIGNAL('clicked()'), SLOT('closeConnection()') ) - connect( quit, SIGNAL('clicked()'), $qApp, SLOT('quit()') ) + connect( send, TQ_SIGNAL('clicked()'), TQ_SLOT('sendToServer()') ) + connect( close, TQ_SIGNAL('clicked()'), TQ_SLOT('closeConnection()') ) + connect( quit, TQ_SIGNAL('clicked()'), $qApp, TQ_SLOT('quit()') ) # create the socket and connect various of its signals @socket = TQt::Socket.new( self ) - connect( @socket, SIGNAL('connected()'), - SLOT('socketConnected()') ) - connect( @socket, SIGNAL('connectionClosed()'), - SLOT('socketConnectionClosed()') ) - connect( @socket, SIGNAL('readyRead()'), - SLOT('socketReadyRead()') ) - connect( @socket, SIGNAL('error(int)'), - SLOT('socketError(int)') ) + connect( @socket, TQ_SIGNAL('connected()'), + TQ_SLOT('socketConnected()') ) + connect( @socket, TQ_SIGNAL('connectionClosed()'), + TQ_SLOT('socketConnectionClosed()') ) + connect( @socket, TQ_SIGNAL('readyRead()'), + TQ_SLOT('socketReadyRead()') ) + connect( @socket, TQ_SIGNAL('error(int)'), + TQ_SLOT('socketError(int)') ) # connect to the server @infoText.append( tr("Trying to connect to the server\n") ) @@ -41,8 +41,8 @@ class Client < TQt::VBox @socket.close() if @socket.state() == TQt::Socket::Closing # We have a delayed close. - connect( @socket, SIGNAL('delayedCloseFinished()'), - SLOT('socketClosed()') ) + connect( @socket, TQ_SIGNAL('delayedCloseFinished()'), + TQ_SLOT('socketClosed()') ) else # The socket is closed. socketClosed() diff --git a/qtruby/rubylib/examples/network/clientserver/server/server.rb b/qtruby/rubylib/examples/network/clientserver/server/server.rb index 4a53fbf0..2454115f 100644 --- a/qtruby/rubylib/examples/network/clientserver/server/server.rb +++ b/qtruby/rubylib/examples/network/clientserver/server/server.rb @@ -9,10 +9,10 @@ class ClientSocket < TQt::Socket def initialize(sock, parent=nil, name=nil) super( parent, name ) @line = 0 - connect( self, SIGNAL('readyRead()'), - SLOT('readClient()') ) - connect( self, SIGNAL('connectionClosed()'), - SLOT('deleteLater()') ) + connect( self, TQ_SIGNAL('readyRead()'), + TQ_SLOT('readClient()') ) + connect( self, TQ_SIGNAL('connectionClosed()'), + TQ_SLOT('deleteLater()') ) setSocket( sock ) end @@ -84,20 +84,20 @@ class ServerInfo < TQt::VBox # See the comment above about why the 'ClientSocket*' # type cannot be used - connect( @server, SIGNAL('newConnect(TQSocket*)'), - SLOT('newConnect(TQSocket*)') ) - connect( quit, SIGNAL('clicked()'), $qApp, - SLOT('quit()') ) + connect( @server, TQ_SIGNAL('newConnect(TQSocket*)'), + TQ_SLOT('newConnect(TQSocket*)') ) + connect( quit, TQ_SIGNAL('clicked()'), $qApp, + TQ_SLOT('quit()') ) end slots 'newConnect(TQSocket*)', 'connectionClosed()' def newConnect( s ) @infoText.append( tr("New connection\n") ) - connect( s, SIGNAL('logText(const TQString&)'), - @infoText, SLOT('append(const TQString&)') ) - connect( s, SIGNAL('connectionClosed()'), - SLOT('connectionClosed()') ) + connect( s, TQ_SIGNAL('logText(const TQString&)'), + @infoText, TQ_SLOT('append(const TQString&)') ) + connect( s, TQ_SIGNAL('connectionClosed()'), + TQ_SLOT('connectionClosed()') ) end def connectionClosed() |