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/chart/chartform_files.rb | |
parent | 1a96c45b22d01378202d9dc7ed9c47acd30f966e (diff) | |
download | tdebindings-9ba04742771370f59740e32e11c5f3a1e6a1b70a.tar.gz tdebindings-9ba04742771370f59740e32e11c5f3a1e6a1b70a.zip |
Initial TQt conversion
Diffstat (limited to 'qtruby/rubylib/examples/qt-examples/chart/chartform_files.rb')
-rw-r--r-- | qtruby/rubylib/examples/qt-examples/chart/chartform_files.rb | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/qtruby/rubylib/examples/qt-examples/chart/chartform_files.rb b/qtruby/rubylib/examples/qt-examples/chart/chartform_files.rb index 648aba62..3063bb07 100644 --- a/qtruby/rubylib/examples/qt-examples/chart/chartform_files.rb +++ b/qtruby/rubylib/examples/qt-examples/chart/chartform_files.rb @@ -1,15 +1,15 @@ class ChartForm def load( filename ) - file = Qt::File.new( filename ) - if !file.open( Qt::IO_ReadOnly ) + file = TQt::File.new( filename ) + if !file.open( TQt::IO_ReadOnly ) statusBar().message( "Failed to load \'%s\'" % filename, 2000 ) return end init() # Make sure we have colours @filename = filename - ts = Qt::TextStream.new( file ) + ts = TQt::TextStream.new( file ) errors = 0 i = 0 while !ts.eof() @@ -52,12 +52,12 @@ class ChartForm return end - file = Qt::File.new( @filename ) - if !file.open( Qt::IO_WriteOnly ) + file = TQt::File.new( @filename ) + if !file.open( TQt::IO_WriteOnly ) statusBar().message( "Failed to save \'%s\'" % @filename, 2000 ) return end - ts = Qt::TextStream.new( file ) + ts = TQt::TextStream.new( file ) for i in 0...MAX_ELEMENTS if @elements[i].isValid() ts << @elements[i] @@ -73,10 +73,10 @@ class ChartForm def fileSaveAsPixmap() - filename = Qt::FileDialog.getSaveFileName(nil, "Images (*.png *.xpm *.jpg)", + filename = TQt::FileDialog.getSaveFileName(nil, "Images (*.png *.xpm *.jpg)", self, "file save as bitmap", "Chart -- File Save As Bitmap" ) - if Qt::Pixmap.grabWidget( @canvasView ).save( filename, + if TQt::Pixmap.grabWidget( @canvasView ).save( filename, filename.sub(/.*\.([^.]*)$/, '\1').upcase() ) statusBar().message( "Wrote \'%s\'" % filename, 2000 ) else @@ -86,11 +86,11 @@ class ChartForm def filePrint() if !@printer - @printer = Qt::Printer.new + @printer = TQt::Printer.new end if @printer.setup() - painter = Qt::Painter.new( @printer ) - @canvas.drawArea( Qt::Rect.new( 0, 0, @canvas.width(), @canvas.height() ), + painter = TQt::Painter.new( @printer ) + @canvas.drawArea( TQt::Rect.new( 0, 0, @canvas.width(), @canvas.height() ), painter, false ) if !@printer.outputFileName().empty? statusBar().message( "Printed \'%s\'" % @printer.outputFileName(), 2000 ) |