diff options
Diffstat (limited to 'qtruby/rubylib/examples/qt-examples')
11 files changed, 60 insertions, 60 deletions
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) |