diff options
Diffstat (limited to 'qtruby/rubylib/examples')
22 files changed, 119 insertions, 119 deletions
diff --git a/qtruby/rubylib/examples/base/rui.rb b/qtruby/rubylib/examples/base/rui.rb index ad14bc11..8f1df3c8 100644 --- a/qtruby/rubylib/examples/base/rui.rb +++ b/qtruby/rubylib/examples/base/rui.rb @@ -11,7 +11,7 @@ def build_actions(actions) } else qt_action = $kIcons.make_qt_action(self, a.text_with_accel, a.icon_type) - connect(qt_action, SIGNAL('activated()'), a.rec, a.slot) + connect(qt_action, TQ_SIGNAL('activated()'), a.rec, a.slot) a.included_in.each { |to| qt_action.addTo(to) } diff --git a/qtruby/rubylib/examples/canvastest/canvastest.rb b/qtruby/rubylib/examples/canvastest/canvastest.rb index b695505c..5c07875b 100644 --- a/qtruby/rubylib/examples/canvastest/canvastest.rb +++ b/qtruby/rubylib/examples/canvastest/canvastest.rb @@ -43,11 +43,11 @@ class MyWidget < TQt::MainWindow fileMenu = TQt::PopupMenu.new(self) actions = [ - RAction.new("&New", Icons::FILE_NEW, self, SLOT('new()'), [fileTools, fileMenu]), - RAction.new("&Open...", Icons::FILE_OPEN, self, SLOT('open()'), [fileTools, fileMenu]), - @save = RAction.new("Save &As...", Icons::FILE_SAVE_AS, self, SLOT('save_as()'), [fileTools, fileMenu]), + RAction.new("&New", Icons::FILE_NEW, self, TQ_SLOT('new()'), [fileTools, fileMenu]), + RAction.new("&Open...", Icons::FILE_OPEN, self, TQ_SLOT('open()'), [fileTools, fileMenu]), + @save = RAction.new("Save &As...", Icons::FILE_SAVE_AS, self, TQ_SLOT('save_as()'), [fileTools, fileMenu]), RSeperator.new([fileMenu]), - RAction.new("E&xit", Icons::EXIT, $qApp, SLOT('quit()'), [fileMenu]) + RAction.new("E&xit", Icons::EXIT, $qApp, TQ_SLOT('quit()'), [fileMenu]) ] build_actions(actions) 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() diff --git a/qtruby/rubylib/examples/passivepopup/passivepopup.rb b/qtruby/rubylib/examples/passivepopup/passivepopup.rb index 5cc2b4ea..ae3e1374 100644 --- a/qtruby/rubylib/examples/passivepopup/passivepopup.rb +++ b/qtruby/rubylib/examples/passivepopup/passivepopup.rb @@ -19,7 +19,7 @@ class PassiveWindow < TQt::Frame TQt::Label.new(message, self) quit=TQt::PushButton.new(tr("Close"), self) - connect(quit, SIGNAL("clicked()"), SLOT("close()")) + connect(quit, TQ_SIGNAL("clicked()"), TQ_SLOT("close()")) end def show diff --git a/qtruby/rubylib/examples/qt-examples/aclock/aclock.rb b/qtruby/rubylib/examples/qt-examples/aclock/aclock.rb index 618b7d76..0e6a13d0 100644 --- a/qtruby/rubylib/examples/qt-examples/aclock/aclock.rb +++ b/qtruby/rubylib/examples/qt-examples/aclock/aclock.rb @@ -11,7 +11,7 @@ class AnalogClock < TQt::Widget @time = TQt::Time::currentTime @internalTimer = TQt::Timer.new(self) - connect(@internalTimer, SIGNAL('timeout()'), self, SLOT('timeout()')) + connect(@internalTimer, TQ_SIGNAL('timeout()'), self, TQ_SLOT('timeout()')) @internalTimer.start(5000) end diff --git a/qtruby/rubylib/examples/qt-examples/chart/chartform.rb b/qtruby/rubylib/examples/qt-examples/chart/chartform.rb index 0ebff47e..dd3523fd 100644 --- a/qtruby/rubylib/examples/qt-examples/chart/chartform.rb +++ b/qtruby/rubylib/examples/qt-examples/chart/chartform.rb @@ -42,41 +42,41 @@ class ChartForm < TQt::MainWindow fileNewAction = TQt::Action.new( "New Chart", TQt::IconSet.new(TQt::Pixmap.new( "images/file_new.xpm" )), "&New", TQt::KeySequence.new(CTRL+Key_N), self, "new" ) - connect( fileNewAction, SIGNAL( 'activated()' ), self, SLOT( 'fileNew()' ) ) + connect( fileNewAction, TQ_SIGNAL( 'activated()' ), self, TQ_SLOT( 'fileNew()' ) ) fileOpenAction = TQt::Action.new( "Open Chart", TQt::IconSet.new(TQt::Pixmap.new( "images/file_open.xpm" )), "&Open...", TQt::KeySequence.new(CTRL+Key_O), self, "open" ) - connect( fileOpenAction, SIGNAL( 'activated()' ), self, SLOT( 'fileOpen()' ) ) + connect( fileOpenAction, TQ_SIGNAL( 'activated()' ), self, TQ_SLOT( 'fileOpen()' ) ) fileSaveAction = TQt::Action.new( "Save Chart", TQt::IconSet.new(TQt::Pixmap.new( "images/file_save.xpm" )), "&Save", TQt::KeySequence.new(CTRL+Key_S), self, "save" ) - connect( fileSaveAction, SIGNAL( 'activated()' ), self, SLOT( 'fileSave()' ) ) + connect( fileSaveAction, TQ_SIGNAL( 'activated()' ), self, TQ_SLOT( 'fileSave()' ) ) fileSaveAsAction = TQt::Action.new( "Save Chart As", TQt::IconSet.new(TQt::Pixmap.new( "images/file_save.xpm" )), "Save &As...", TQt::KeySequence.new(0), self, "save as" ) - connect( fileSaveAsAction, SIGNAL( 'activated()' ), - self, SLOT( 'fileSaveAs()' ) ) + connect( fileSaveAsAction, TQ_SIGNAL( 'activated()' ), + self, TQ_SLOT( 'fileSaveAs()' ) ) fileSaveAsPixmapAction = TQt::Action.new( "Save Chart As Bitmap", TQt::IconSet.new(TQt::Pixmap.new( "images/file_save.xpm" )), "Save As &Bitmap...", TQt::KeySequence.new(CTRL+Key_B), self, "save as bitmap" ) - connect( fileSaveAsPixmapAction, SIGNAL( 'activated()' ), - self, SLOT( 'fileSaveAsPixmap()' ) ) + connect( fileSaveAsPixmapAction, TQ_SIGNAL( 'activated()' ), + self, TQ_SLOT( 'fileSaveAsPixmap()' ) ) filePrintAction = TQt::Action.new( "Print Chart", TQt::IconSet.new(TQt::Pixmap.new( "images/file_print.xpm" )), "&Print Chart...", TQt::KeySequence.new(CTRL+Key_P), self, "print chart" ) - connect( filePrintAction, SIGNAL( 'activated()' ), - self, SLOT( 'filePrint()' ) ) + connect( filePrintAction, TQ_SIGNAL( 'activated()' ), + self, TQ_SLOT( 'filePrint()' ) ) optionsSetDataAction = TQt::Action.new( "Set Data", TQt::IconSet.new(TQt::Pixmap.new( "images/options_setdata.xpm" )), "Set &Data...", TQt::KeySequence.new(CTRL+Key_D), self, "set data" ) - connect( optionsSetDataAction, SIGNAL( 'activated()' ), - self, SLOT( 'optionsSetData()' ) ) + connect( optionsSetDataAction, TQ_SIGNAL( 'activated()' ), + self, TQ_SLOT( 'optionsSetData()' ) ) chartGroup = TQt::ActionGroup.new( self ) # Connected later @@ -102,17 +102,17 @@ class ChartForm < TQt::MainWindow optionsSetFontAction = TQt::Action.new( "Set Font", TQt::IconSet.new(TQt::Pixmap.new( "images/options_setfont.xpm" )), "Set &Font...", TQt::KeySequence.new(CTRL+Key_F), self, "set font" ) - connect( optionsSetFontAction, SIGNAL( 'activated()' ), - self, SLOT( 'optionsSetFont()' ) ) + connect( optionsSetFontAction, TQ_SIGNAL( 'activated()' ), + self, TQ_SLOT( 'optionsSetFont()' ) ) optionsSetOptionsAction = TQt::Action.new( "Set Options", TQt::IconSet.new(TQt::Pixmap.new( "images/options_setoptions.xpm" )), "Set &Options...", TQt::KeySequence.new(0), self, "set options" ) - connect( optionsSetOptionsAction, SIGNAL( 'activated()' ), - self, SLOT( 'optionsSetOptions()' ) ) + connect( optionsSetOptionsAction, TQ_SIGNAL( 'activated()' ), + self, TQ_SLOT( 'optionsSetOptions()' ) ) fileQuitAction = TQt::Action.new( "Quit", "&Quit", TQt::KeySequence.new(CTRL+Key_Q), self, "quit" ) - connect( fileQuitAction, SIGNAL( 'activated()' ), self, SLOT( 'fileQuit()' ) ) + connect( fileQuitAction, TQ_SIGNAL( 'activated()' ), self, TQ_SLOT( 'fileQuit()' ) ) fileTools = TQt::ToolBar.new( self, "file operations" ) @@ -164,9 +164,9 @@ class ChartForm < TQt::MainWindow helpMenu = TQt::PopupMenu.new( self ) menuBar().insertItem( "&Help", helpMenu ) - helpMenu.insertItem( "&Help", self, SLOT('helpHelp()'), TQt::KeySequence.new(Key_F1) ) - helpMenu.insertItem( "&About", self, SLOT('helpAbout()') ) - helpMenu.insertItem( "About &Qt", self, SLOT('helpAboutQt()') ) + helpMenu.insertItem( "&Help", self, TQ_SLOT('helpHelp()'), TQt::KeySequence.new(Key_F1) ) + helpMenu.insertItem( "&About", self, TQ_SLOT('helpAbout()') ) + helpMenu.insertItem( "About &Qt", self, TQ_SLOT('helpAboutQt()') ) @printer = nil @@ -198,8 +198,8 @@ class ChartForm < TQt::MainWindow # Connect *after* we've set the chart type on so we don't call # drawElements() prematurely. - connect( chartGroup, SIGNAL( 'selected(TQAction*)' ), - self, SLOT( 'updateChartType(TQAction*)' ) ) + connect( chartGroup, TQ_SIGNAL( 'selected(TQAction*)' ), + self, TQ_SLOT( 'updateChartType(TQAction*)' ) ) resize( windowWidth, windowHeight ) if windowX != -1 || windowY != -1 @@ -336,7 +336,7 @@ class ChartForm < TQt::MainWindow end if i < @recentFiles.length() @fileMenu.insertItem( "&%d %s" % [i + 1, @recentFiles[i]], - self, SLOT( 'fileOpenRecent(int)' ), + self, TQ_SLOT( 'fileOpenRecent(int)' ), TQt::KeySequence.new(0), i ) end end diff --git a/qtruby/rubylib/examples/qt-examples/chart/optionsform.rb b/qtruby/rubylib/examples/qt-examples/chart/optionsform.rb index 35c2aea8..a83fe828 100644 --- a/qtruby/rubylib/examples/qt-examples/chart/optionsform.rb +++ b/qtruby/rubylib/examples/qt-examples/chart/optionsform.rb @@ -94,9 +94,9 @@ class OptionsForm < TQt::Dialog @buttonsLayout.addWidget( @cancelPushButton ) @optionsFormLayout.addLayout( @buttonsLayout ) - connect( @fontPushButton, SIGNAL( 'clicked()' ), self, SLOT( 'chooseFont()' ) ) - connect( @okPushButton, SIGNAL( 'clicked()' ), self, SLOT( 'accept()' ) ) - connect( @cancelPushButton, SIGNAL( 'clicked()' ), self, SLOT( 'reject()' ) ) + connect( @fontPushButton, TQ_SIGNAL( 'clicked()' ), self, TQ_SLOT( 'chooseFont()' ) ) + connect( @okPushButton, TQ_SIGNAL( 'clicked()' ), self, TQ_SLOT( 'accept()' ) ) + connect( @cancelPushButton, TQ_SIGNAL( 'clicked()' ), self, TQ_SLOT( 'reject()' ) ) @chartTypeTextLabel.setBuddy( @chartTypeComboBox ) @decimalPlacesTextLabel.setBuddy( @decimalPlacesSpinBox ) diff --git a/qtruby/rubylib/examples/qt-examples/chart/setdataform.rb b/qtruby/rubylib/examples/qt-examples/chart/setdataform.rb index 3f361061..5ef31f45 100644 --- a/qtruby/rubylib/examples/qt-examples/chart/setdataform.rb +++ b/qtruby/rubylib/examples/qt-examples/chart/setdataform.rb @@ -64,15 +64,15 @@ class SetDataForm < TQt::Dialog @tableButtonBox.addLayout( @buttonBox ) - connect( @table, SIGNAL( 'clicked(int,int,int,const TQPoint&)' ), - self, SLOT( 'setChosenColor(int,int)' ) ) - connect( @table, SIGNAL( 'currentChanged(int,int)' ), - self, SLOT( 'currentChanged(int,int)' ) ) - connect( @table, SIGNAL( 'valueChanged(int,int)' ), - self, SLOT( 'valueChanged(int,int)' ) ) - connect( @colorPushButton, SIGNAL( 'clicked()' ), self, SLOT( 'setColor()' ) ) - connect( okPushButton, SIGNAL( 'clicked()' ), self, SLOT( 'accept()' ) ) - connect( cancelPushButton, SIGNAL( 'clicked()' ), self, SLOT( 'reject()' ) ) + connect( @table, TQ_SIGNAL( 'clicked(int,int,int,const TQPoint&)' ), + self, TQ_SLOT( 'setChosenColor(int,int)' ) ) + connect( @table, TQ_SIGNAL( 'currentChanged(int,int)' ), + self, TQ_SLOT( 'currentChanged(int,int)' ) ) + connect( @table, TQ_SIGNAL( 'valueChanged(int,int)' ), + self, TQ_SLOT( 'valueChanged(int,int)' ) ) + connect( @colorPushButton, TQ_SIGNAL( 'clicked()' ), self, TQ_SLOT( 'setColor()' ) ) + connect( okPushButton, TQ_SIGNAL( 'clicked()' ), self, TQ_SLOT( 'accept()' ) ) + connect( cancelPushButton, TQ_SIGNAL( 'clicked()' ), self, TQ_SLOT( 'reject()' ) ) patterns = Array.new(MAX_PATTERNS) patterns[0] = TQt::Pixmap.new( "images/pattern01.xpm" ) diff --git a/qtruby/rubylib/examples/qt-examples/checklists/checklists.rb b/qtruby/rubylib/examples/qt-examples/checklists/checklists.rb index 458dc127..9c428c12 100644 --- a/qtruby/rubylib/examples/qt-examples/checklists/checklists.rb +++ b/qtruby/rubylib/examples/qt-examples/checklists/checklists.rb @@ -55,8 +55,8 @@ class CheckLists < TQt::Widget copy1 = TQt::PushButton.new(' -> ', self) tmp.addWidget(copy1) copy1.setMaximumWidth(copy1.sizeHint.width) - # connect the SIGNAL clicked() of the pushbutton with the SLOT copy1to2() - connect(copy1, SIGNAL('clicked()'), self, SLOT('copy1to2()')) + # connect the TQ_SIGNAL clicked() of the pushbutton with the TQ_SLOT copy1to2() + connect(copy1, TQ_SIGNAL('clicked()'), self, TQ_SLOT('copy1to2()')) # another widget for layouting vbox2 = TQt::VBoxLayout.new(lay) @@ -79,8 +79,8 @@ class CheckLists < TQt::Widget copy2 = TQt::PushButton.new(' -> ', self) lay.addWidget( copy2 ) copy2.setMaximumWidth(copy2.sizeHint.width) - # ...and connect its clicked() SIGNAL to the copy2to3() SLOT - connect(copy2, SIGNAL('clicked()'), self, SLOT('copy2to3()')) + # ...and connect its clicked() TQ_SIGNAL to the copy2to3() TQ_SLOT + connect(copy2, TQ_SIGNAL('clicked()'), self, TQ_SLOT('copy2to3()')) tmp = TQt::VBoxLayout.new(lay) tmp.setMargin(5) @@ -90,7 +90,7 @@ class CheckLists < TQt::Widget tmp.addWidget(@label) end - # SLOT copy1to2() + # TQ_SLOT copy1to2() # # Copies all checked ListViewItems from the first ListView to # the second one, and inserts them as Radio-ListViewItem. @@ -121,7 +121,7 @@ class CheckLists < TQt::Widget end - # SLOT copy2to3() + # TQ_SLOT copy2to3() # # Copies the checked item of the second ListView into the # Label at the right. diff --git a/qtruby/rubylib/examples/qt-examples/fonts/simple-qfont-demo/viewer.rb b/qtruby/rubylib/examples/qt-examples/fonts/simple-qfont-demo/viewer.rb index feed96f0..17fb43ef 100644 --- a/qtruby/rubylib/examples/qt-examples/fonts/simple-qfont-demo/viewer.rb +++ b/qtruby/rubylib/examples/qt-examples/fonts/simple-qfont-demo/viewer.rb @@ -27,16 +27,16 @@ class Viewer < TQt::Widget @defaultButton = TQt::PushButton.new('Default', self, 'pushbutton1') @defaultButton.setFont(TQt::Font.new('times')) - connect(@defaultButton, SIGNAL('clicked()'), self, SLOT('setDefault()')) + connect(@defaultButton, TQ_SIGNAL('clicked()'), self, TQ_SLOT('setDefault()')) @sansSerifButton = TQt::PushButton.new('Sans Serif', self, 'pushbutton2') @sansSerifButton.setFont(TQt::Font.new('Helvetica', 12)) - connect(@sansSerifButton, SIGNAL('clicked()'), self, SLOT('setSansSerif()')) + connect(@sansSerifButton, TQ_SIGNAL('clicked()'), self, TQ_SLOT('setSansSerif()')) @italicsButton = TQt::PushButton.new('Italics', self, 'pushbutton1') @italicsButton.setFont(TQt::Font.new('lucida', 12, TQt::Font.Bold, true)) - connect(@italicsButton, SIGNAL('clicked()'), self, SLOT('setItalics()')) + connect(@italicsButton, TQ_SIGNAL('clicked()'), self, TQ_SLOT('setItalics()')) layout end diff --git a/qtruby/rubylib/examples/qt-examples/forever/forever.rb b/qtruby/rubylib/examples/qt-examples/forever/forever.rb index 8cbf9754..1ef42a71 100755 --- a/qtruby/rubylib/examples/qt-examples/forever/forever.rb +++ b/qtruby/rubylib/examples/qt-examples/forever/forever.rb @@ -26,8 +26,8 @@ class Forever < TQt::Widget @rectangles = 0 startTimer( 0 ) # run continuous timer counter = TQt::Timer.new( self ) - connect( counter, SIGNAL("timeout()"), - self, SLOT("updateCaption()") ) + connect( counter, TQ_SIGNAL("timeout()"), + self, TQ_SLOT("updateCaption()") ) counter.start( 1000 ) end diff --git a/qtruby/rubylib/examples/qt-examples/hello/hello.rb b/qtruby/rubylib/examples/qt-examples/hello/hello.rb index ef70154f..4fbb6b69 100644 --- a/qtruby/rubylib/examples/qt-examples/hello/hello.rb +++ b/qtruby/rubylib/examples/qt-examples/hello/hello.rb @@ -13,7 +13,7 @@ class Hello < TQt::Widget @text = text @sin_tbl = [0, 38, 71, 92, 100, 92, 71, 38, 0, -38, -71, -92, -100, -92, -71, -38] timer = TQt::Timer.new(self); - connect(timer, SIGNAL('timeout()'), SLOT('animate()')) + connect(timer, TQ_SIGNAL('timeout()'), TQ_SLOT('animate()')) timer.start(40); resize(260, 130) diff --git a/qtruby/rubylib/examples/qt-examples/hello/main.rb b/qtruby/rubylib/examples/qt-examples/hello/main.rb index 5be3ce68..1b310551 100755 --- a/qtruby/rubylib/examples/qt-examples/hello/main.rb +++ b/qtruby/rubylib/examples/qt-examples/hello/main.rb @@ -14,7 +14,7 @@ end h = Hello.new(s) h.setCaption('QtRuby says hello') -h.connect(h, SIGNAL('clicked()'), a, SLOT('quit()')) +h.connect(h, TQ_SIGNAL('clicked()'), a, TQ_SLOT('quit()')) h.setFont(TQt::Font.new('times', 32, TQt::Font.Bold)) # default font h.setBackgroundColor(TQt::white) # default bg color a.setMainWidget(h) diff --git a/qtruby/rubylib/examples/qt-examples/progress/progress.rb b/qtruby/rubylib/examples/qt-examples/progress/progress.rb index 1ec02614..3b0b11f8 100644 --- a/qtruby/rubylib/examples/qt-examples/progress/progress.rb +++ b/qtruby/rubylib/examples/qt-examples/progress/progress.rb @@ -118,18 +118,18 @@ class CPUWaster < TQt::Widget FIRST_DRAW_ITEM.upto(LAST_DRAW_ITEM) { |i| file.insertItem( "#{drawItemRects(i)} Rectangles", i) } - connect( menubar, SIGNAL('activated(int)'), self, SLOT('doMenuItem(int)') ) + connect( menubar, TQ_SIGNAL('activated(int)'), self, TQ_SLOT('doMenuItem(int)') ) @file.insertSeparator - @file.insertItem("Quit", $qApp, SLOT('quit()')) + @file.insertItem("Quit", $qApp, TQ_SLOT('quit()')) @options = TQt::PopupMenu.new @menubar.insertItem("&Options", options) - @td_id = options.insertItem("Timer driven", self, SLOT('timerDriven()')) - @ld_id = options.insertItem("Loop driven", self, SLOT('loopDriven()')) + @td_id = options.insertItem("Timer driven", self, TQ_SLOT('timerDriven()')) + @ld_id = options.insertItem("Loop driven", self, TQ_SLOT('loopDriven()')) @options.insertSeparator - @dl_id = options.insertItem("Default label", self, SLOT('defaultLabel()')) - @cl_id = options.insertItem("Custom label", self, SLOT('customLabel()')) + @dl_id = options.insertItem("Default label", self, TQ_SLOT('defaultLabel()')) + @cl_id = options.insertItem("Custom label", self, TQ_SLOT('customLabel()')) @options.insertSeparator - @md_id = options.insertItem("No minimum duration", self, SLOT('toggleMinimumDuration()')) + @md_id = options.insertItem("No minimum duration", self, TQ_SLOT('toggleMinimumDuration()')) @options.setCheckable true loopDriven @@ -239,7 +239,7 @@ class CPUWaster < TQt::Widget @rects = n @pb = newProgressDialog("Drawing rectangles.\nUsing timer event.", n, false) @pb.setCaption("Please Wait") - connect(@pb, SIGNAL('cancelled()'), self, SLOT('stopDrawing()')) + connect(@pb, TQ_SIGNAL('cancelled()'), self, TQ_SLOT('stopDrawing()')) enableDrawingItems(false) startTimer(0) @got_stop = false diff --git a/qtruby/rubylib/examples/qt-examples/tictac/tictac.rb b/qtruby/rubylib/examples/qt-examples/tictac/tictac.rb index 1b8bbe35..f16585af 100644 --- a/qtruby/rubylib/examples/qt-examples/tictac/tictac.rb +++ b/qtruby/rubylib/examples/qt-examples/tictac/tictac.rb @@ -48,7 +48,7 @@ class TicTacGameBoard < TQt::Widget ttb = TicTacButton.new(self) ttb.setPalette(p) ttb.setEnabled(false) - connect(ttb, SIGNAL('clicked()'), self, SLOT('buttonClicked()')) + connect(ttb, TQ_SIGNAL('clicked()'), self, TQ_SLOT('buttonClicked()')) grid.addWidget(ttb, i % @nBoard, i / @nBoard) @buttons[i] = ttb @btArray[i] = TicTacButton::Blank @@ -262,7 +262,7 @@ class TicTacToe < TQt::Widget # Create the game board and connect the signal finished() # to this/self gameOver() slot @board = TicTacGameBoard.new(boardSize, self) - connect(@board, SIGNAL('finished()'), self, SLOT('gameOver()')); + connect(@board, TQ_SIGNAL('finished()'), self, TQ_SLOT('gameOver()')); l.addWidget(@board) # Create a horizontal frame line @@ -279,9 +279,9 @@ class TicTacToe < TQt::Widget # Create the push buttons and connect their signals to the right slots @newGame = TQt::PushButton.new('Play!', self) - connect(@newGame, SIGNAL('clicked()'), self, SLOT('newGameClicked()')) + connect(@newGame, TQ_SIGNAL('clicked()'), self, TQ_SLOT('newGameClicked()')) @quit = TQt::PushButton.new('Quit', self) - connect(@quit, SIGNAL('clicked()'), $qApp, SLOT('quit()')) + connect(@quit, TQ_SIGNAL('clicked()'), $qApp, TQ_SLOT('quit()')) b = TQt::HBoxLayout.new l.addLayout(b) b.addWidget(@newGame) diff --git a/qtruby/rubylib/examples/qtscribble/scribble.rb b/qtruby/rubylib/examples/qtscribble/scribble.rb index 0ba2a4b4..a2ce927b 100644 --- a/qtruby/rubylib/examples/qtscribble/scribble.rb +++ b/qtruby/rubylib/examples/qtscribble/scribble.rb @@ -26,7 +26,7 @@ require 'Qt' # create a pop-up menu @_popupmenu = TQt::PopupMenu.new() - @_popupmenu.insertItem( "&Clear", self, SLOT( "slotClearArea()" ) ) + @_popupmenu.insertItem( "&Clear", self, TQ_SLOT( "slotClearArea()" ) ) end # @@ -159,10 +159,10 @@ class ScribbleWindow < TQt::Widget # The next lines build the menu bar. We first create the menus # one by one, then add them to the menu bar. # @_filemenu = TQt::PopupMenu.new() # create a file menu - @_filemenu.insertItem( "&Load", self, SLOT( "slotLoad()" ) ) - @_filemenu.insertItem( "&Save", self, SLOT( "slotSave()" ) ) + @_filemenu.insertItem( "&Load", self, TQ_SLOT( "slotLoad()" ) ) + @_filemenu.insertItem( "&Save", self, TQ_SLOT( "slotSave()" ) ) @_filemenu.insertSeparator() - @_filemenu.insertItem( "&Quit", $qApp, SLOT( "quit()" ) ) + @_filemenu.insertItem( "&Quit", $qApp, TQ_SLOT( "quit()" ) ) @_colormenu = TQt::PopupMenu.new() # create a color menu @_colormenu.insertItem( "B&lack", COLOR_MENU_ID_BLACK) @@ -170,12 +170,12 @@ class ScribbleWindow < TQt::Widget @_colormenu.insertItem( "&Blue", COLOR_MENU_ID_BLUE) @_colormenu.insertItem( "&Green", COLOR_MENU_ID_GREEN) @_colormenu.insertItem( "&Yellow", COLOR_MENU_ID_YELLOW) - TQt::Object.connect( @_colormenu, SIGNAL( "activated( int )" ), - self, SLOT( "slotColorMenu( int )" ) ) + TQt::Object.connect( @_colormenu, TQ_SIGNAL( "activated( int )" ), + self, TQ_SLOT( "slotColorMenu( int )" ) ) @_helpmenu = TQt::PopupMenu.new() # create a help menu - @_helpmenu.insertItem( "&About QtScribble", self, SLOT( "slotAbout()" ) ) - @_helpmenu.insertItem( "&About Qt", self, SLOT( "slotAboutQt()" ) ) + @_helpmenu.insertItem( "&About QtScribble", self, TQ_SLOT( "slotAbout()" ) ) + @_helpmenu.insertItem( "&About Qt", self, TQ_SLOT( "slotAboutQt()" ) ) @_menubar = TQt::MenuBar.new( self, "" ) # create a menu bar @_menubar.insertItem( "&File", @_filemenu ) @@ -190,12 +190,12 @@ class ScribbleWindow < TQt::Widget @_scribblearea = ScribbleArea.new() @_scribblearea.setGeometry( 0, 0, 1000, 1000 ) @_scrollview.addChild( @_scribblearea ) - TQt::Object.connect( self, SIGNAL( "colorChanged(TQColor)" ), - @_scribblearea, SLOT( "setColor(TQColor)" ) ) - TQt::Object.connect( self, SIGNAL( "save(const TQString&)" ), - @_scribblearea, SLOT( "slotSave(const TQString&)" ) ) - TQt::Object.connect( self, SIGNAL( "load(const TQString&)" ), - @_scribblearea, SLOT( "slotLoad(const TQString&)" ) ) + TQt::Object.connect( self, TQ_SIGNAL( "colorChanged(TQColor)" ), + @_scribblearea, TQ_SLOT( "setColor(TQColor)" ) ) + TQt::Object.connect( self, TQ_SIGNAL( "save(const TQString&)" ), + @_scribblearea, TQ_SLOT( "slotSave(const TQString&)" ) ) + TQt::Object.connect( self, TQ_SIGNAL( "load(const TQString&)" ), + @_scribblearea, TQ_SLOT( "slotLoad(const TQString&)" ) ) end def resizeEvent( event ) diff --git a/qtruby/rubylib/examples/ruboids/ruboids/CameraDialog.rb b/qtruby/rubylib/examples/ruboids/ruboids/CameraDialog.rb index 623abe4b..6ac04192 100644 --- a/qtruby/rubylib/examples/ruboids/ruboids/CameraDialog.rb +++ b/qtruby/rubylib/examples/ruboids/ruboids/CameraDialog.rb @@ -96,14 +96,14 @@ class CameraDialog < TQt::Dialog # The Close button button = TQt::PushButton.new('Close', self, 'Dialog Close') - connect(button, SIGNAL('clicked()'), self, SLOT('close()')) + connect(button, TQ_SIGNAL('clicked()'), self, TQ_SLOT('close()')) button.setDefault(true) button.setFixedSize(button.sizeHint()) buttonLayout.addWidget(button) # The Close button button = TQt::PushButton.new('Reset', self, 'Dialog Reset') - connect(button, SIGNAL('clicked()'), self, SLOT('slotReset()')) + connect(button, TQ_SIGNAL('clicked()'), self, TQ_SLOT('slotReset()')) button.setFixedSize(button.sizeHint()) buttonLayout.addWidget(button) @@ -133,7 +133,7 @@ class CameraDialog < TQt::Dialog layout.addWidget(slider, row, 1) # Connection from slider signal to our slot - connect(slider, SIGNAL('valueChanged(int)'), self, SLOT(slot)) + connect(slider, TQ_SIGNAL('valueChanged(int)'), self, TQ_SLOT(slot)) # Number display num = TQt::Label.new('XXXXX', box) diff --git a/qtruby/rubylib/examples/ruboids/ruboids/World.rb b/qtruby/rubylib/examples/ruboids/ruboids/World.rb index 4bd56d88..6c6e8e34 100644 --- a/qtruby/rubylib/examples/ruboids/ruboids/World.rb +++ b/qtruby/rubylib/examples/ruboids/ruboids/World.rb @@ -51,7 +51,7 @@ class World < TQt::Object } @clock = TQt::Timer.new() - connect(@clock, SIGNAL('timeout()'), self, SLOT('slotMove()')) + connect(@clock, TQ_SIGNAL('timeout()'), self, TQ_SLOT('slotMove()')) @camera = Camera.new # Reads values from params setupTranslation() diff --git a/qtruby/rubylib/examples/ruboids/ruboids/WorldWindow.rb b/qtruby/rubylib/examples/ruboids/ruboids/WorldWindow.rb index 56459729..4ce389be 100644 --- a/qtruby/rubylib/examples/ruboids/ruboids/WorldWindow.rb +++ b/qtruby/rubylib/examples/ruboids/ruboids/WorldWindow.rb @@ -31,7 +31,7 @@ class WorldWindow < TQt::MainWindow # Create and populate file menu menu = TQt::PopupMenu.new(self) - menu.insertItem("Exit", $qApp, SLOT("quit()"), TQt::KeySequence.new(CTRL+Key_Q)) + menu.insertItem("Exit", $qApp, TQ_SLOT("quit()"), TQt::KeySequence.new(CTRL+Key_Q)) # Add file menu to menu bar menuBar.insertItem("&File", menu) @@ -42,7 +42,7 @@ class WorldWindow < TQt::MainWindow # Add options menu to menu bar and link it to method below menuBar.insertItem("&Options", menu) - connect(menu, SIGNAL("activated(int)"), self, SLOT('slotMenuActivated(int)')) + connect(menu, TQ_SIGNAL("activated(int)"), self, TQ_SLOT('slotMenuActivated(int)')) end diff --git a/qtruby/rubylib/examples/testcases/bugs.rb b/qtruby/rubylib/examples/testcases/bugs.rb index 92bb8e80..215aea19 100644 --- a/qtruby/rubylib/examples/testcases/bugs.rb +++ b/qtruby/rubylib/examples/testcases/bugs.rb @@ -21,7 +21,7 @@ def bug3 @file.insertSeparator TQt::debug_level = TQt::DebugLevel::High p $qApp - @file.insertItem("Quit", $qApp, SLOT('quit()')) + @file.insertItem("Quit", $qApp, TQ_SLOT('quit()')) @file.exec end #bug3 diff --git a/qtruby/rubylib/examples/textedit/textedit.rb b/qtruby/rubylib/examples/textedit/textedit.rb index 1f80cb7a..bb67fed7 100644 --- a/qtruby/rubylib/examples/textedit/textedit.rb +++ b/qtruby/rubylib/examples/textedit/textedit.rb @@ -40,7 +40,7 @@ class MyTextEditor < TQt::TextEdit end def createPopupMenu(pos) # virtual pm = TQt::PopupMenu.new - pm.insertItem("Insert Image!", self, SLOT('insert_icon()')) + pm.insertItem("Insert Image!", self, TQ_SLOT('insert_icon()')) pm end def has_metadata @@ -111,18 +111,18 @@ class MyWidget < TQt::MainWindow def initialize() super @editor = MyTextEditor.new(self) - connect(@editor, SIGNAL('textChanged()'), self, SLOT('text_changed()')) - connect(@editor, SIGNAL('saved()'), self, SLOT('saved()')) + connect(@editor, TQ_SIGNAL('textChanged()'), self, TQ_SLOT('text_changed()')) + connect(@editor, TQ_SIGNAL('saved()'), self, TQ_SLOT('saved()')) fileTools = TQt::ToolBar.new(self, "file operations") fileMenu = TQt::PopupMenu.new(self) actions = [ - RAction.new("&New", Icons::FILE_NEW, @editor, SLOT('new()'), [fileTools, fileMenu]), - RAction.new("&Open...", Icons::FILE_OPEN, @editor, SLOT('open()'), [fileTools, fileMenu]), - @save = RAction.new("Save &As...", Icons::FILE_SAVE_AS, @editor, SLOT('save_as()'), [fileTools, fileMenu]), + RAction.new("&New", Icons::FILE_NEW, @editor, TQ_SLOT('new()'), [fileTools, fileMenu]), + RAction.new("&Open...", Icons::FILE_OPEN, @editor, TQ_SLOT('open()'), [fileTools, fileMenu]), + @save = RAction.new("Save &As...", Icons::FILE_SAVE_AS, @editor, TQ_SLOT('save_as()'), [fileTools, fileMenu]), RSeperator.new([fileMenu]), - RAction.new("E&xit", Icons::EXIT, $qApp, SLOT('quit()'), [fileMenu]) + RAction.new("E&xit", Icons::EXIT, $qApp, TQ_SLOT('quit()'), [fileMenu]) ] build_actions(actions) |