summaryrefslogtreecommitdiffstats
path: root/languages/ruby/app_templates
diff options
context:
space:
mode:
Diffstat (limited to 'languages/ruby/app_templates')
-rw-r--r--languages/ruby/app_templates/kapp/app.rb6
-rw-r--r--languages/ruby/app_templates/kapp/appview.rb4
-rw-r--r--languages/ruby/app_templates/kapp/pref.rb12
-rwxr-xr-xlanguages/ruby/app_templates/qtruby/app.rb4
-rw-r--r--languages/ruby/app_templates/qtrubyapp/main.rb2
-rw-r--r--languages/ruby/app_templates/qtrubyapp/qtrubyapp.rb86
6 files changed, 57 insertions, 57 deletions
diff --git a/languages/ruby/app_templates/kapp/app.rb b/languages/ruby/app_templates/kapp/app.rb
index 37a00d8b..af807fe9 100644
--- a/languages/ruby/app_templates/kapp/app.rb
+++ b/languages/ruby/app_templates/kapp/app.rb
@@ -181,13 +181,13 @@ class %{APPNAMESC} < KDE::MainWindow
if @printer.nil? then @printer = KDE::Printer.new end
if @printer.setup(self)
# setup the printer. with Qt, you always "print" to a
- # Qt::Painter.. whether the output medium is a pixmap, a screen,
+ # TQt::Painter.. whether the output medium is a pixmap, a screen,
# or paper
- p = Qt::Painter.new
+ p = TQt::Painter.new
p.begin(@printer)
# we let our view do the actual printing
- metrics = Qt::PaintDeviceMetrics.new(@printer)
+ metrics = TQt::PaintDeviceMetrics.new(@printer)
@view.print(p, metrics.height(), metrics.width())
# and send the result to the printer
diff --git a/languages/ruby/app_templates/kapp/appview.rb b/languages/ruby/app_templates/kapp/appview.rb
index e75ca6bc..3fed1ce1 100644
--- a/languages/ruby/app_templates/kapp/appview.rb
+++ b/languages/ruby/app_templates/kapp/appview.rb
@@ -10,7 +10,7 @@
@author %{AUTHOR} <%{EMAIL}>
@version %{VERSION}
=end
-class %{APPNAMESC}View < Qt::Widget
+class %{APPNAMESC}View < TQt::Widget
#
# Use this signal to change the content of the statusbar
@@ -32,7 +32,7 @@ class %{APPNAMESC}View < Qt::Widget
@dcop = %{APPNAMESC}Iface.new(self)
# setup our layout manager to automatically add our widgets
- top_layout = Qt::HBoxLayout.new(self)
+ top_layout = TQt::HBoxLayout.new(self)
top_layout.setAutoAdd(true)
# we want to look for all components that satisfy our needs. the
diff --git a/languages/ruby/app_templates/kapp/pref.rb b/languages/ruby/app_templates/kapp/pref.rb
index 98669ad2..cf8339e9 100644
--- a/languages/ruby/app_templates/kapp/pref.rb
+++ b/languages/ruby/app_templates/kapp/pref.rb
@@ -15,24 +15,24 @@ class %{APPNAMESC}Preferences < KDE::DialogBase
end
end
-class %{APPNAMESC}PrefPageOne < Qt::Frame
+class %{APPNAMESC}PrefPageOne < TQt::Frame
def initialize(parent)
super(parent)
- layout = Qt::HBoxLayout.new(self)
+ layout = TQt::HBoxLayout.new(self)
layout.setAutoAdd(true)
- Qt::Label.new(i18n("Add something here"), self)
+ TQt::Label.new(i18n("Add something here"), self)
end
end
-class %{APPNAMESC}PrefPageTwo < Qt::Frame
+class %{APPNAMESC}PrefPageTwo < TQt::Frame
def initialize(parent)
super(parent)
- layout = Qt::HBoxLayout.new(self)
+ layout = TQt::HBoxLayout.new(self)
layout.setAutoAdd(true)
- Qt::Label.new(i18n("Add something here"), self)
+ TQt::Label.new(i18n("Add something here"), self)
end
end
diff --git a/languages/ruby/app_templates/qtruby/app.rb b/languages/ruby/app_templates/qtruby/app.rb
index da817328..68156edd 100755
--- a/languages/ruby/app_templates/qtruby/app.rb
+++ b/languages/ruby/app_templates/qtruby/app.rb
@@ -2,8 +2,8 @@
require 'Qt'
-app = Qt::Application.new(ARGV)
-widget = Qt::Widget.new
+app = TQt::Application.new(ARGV)
+widget = TQt::Widget.new
widget.setGeometry(50, 500, 400, 400)
widget.caption = "Hello World!"
diff --git a/languages/ruby/app_templates/qtrubyapp/main.rb b/languages/ruby/app_templates/qtrubyapp/main.rb
index 6f4bceae..431ea442 100644
--- a/languages/ruby/app_templates/qtrubyapp/main.rb
+++ b/languages/ruby/app_templates/qtrubyapp/main.rb
@@ -1,7 +1,7 @@
require 'Qt'
require '%{APPNAMELC}.rb'
-a = Qt::Application.new( ARGV )
+a = TQt::Application.new( ARGV )
mw = %{APPNAMESC}.new
mw.caption = "%{APPNAMESC}"
mw.show
diff --git a/languages/ruby/app_templates/qtrubyapp/qtrubyapp.rb b/languages/ruby/app_templates/qtrubyapp/qtrubyapp.rb
index 26b0b378..df98824d 100644
--- a/languages/ruby/app_templates/qtrubyapp/qtrubyapp.rb
+++ b/languages/ruby/app_templates/qtrubyapp/qtrubyapp.rb
@@ -1,4 +1,4 @@
-class %{APPNAMESC} < Qt::MainWindow
+class %{APPNAMESC} < TQt::MainWindow
Q_SLOTS 'newDoc()',
'choose()',
@@ -11,61 +11,61 @@ class %{APPNAMESC} < Qt::MainWindow
def initialize()
super( nil, "%{APPNAMESC}", WDestructiveClose )
- @printer = Qt::Printer.new
+ @printer = TQt::Printer.new
- fileTools = Qt::ToolBar.new( self, "file operations" )
+ fileTools = TQt::ToolBar.new( self, "file operations" )
fileTools.setLabel( tr("File Operations") )
- openIcon = Qt::Pixmap.new( "fileopen.xpm" )
- fileOpen = Qt::ToolButton.new( Qt::IconSet.new(openIcon), tr("Open File"), nil,
+ openIcon = TQt::Pixmap.new( "fileopen.xpm" )
+ fileOpen = TQt::ToolButton.new( TQt::IconSet.new(openIcon), tr("Open File"), nil,
self, SLOT('choose()'), fileTools, "open file" )
- saveIcon = Qt::Pixmap.new( "filesave.xpm" )
- fileSave = Qt::ToolButton.new( Qt::IconSet.new(saveIcon), tr("Save File"), nil,
+ saveIcon = TQt::Pixmap.new( "filesave.xpm" )
+ fileSave = TQt::ToolButton.new( TQt::IconSet.new(saveIcon), tr("Save File"), nil,
self, SLOT('save()'), fileTools, "save file" )
- printIcon = Qt::Pixmap.new( "fileprint.xpm" )
- filePrint = Qt::ToolButton.new( Qt::IconSet.new(printIcon), tr("Print File"), nil,
+ printIcon = TQt::Pixmap.new( "fileprint.xpm" )
+ filePrint = TQt::ToolButton.new( TQt::IconSet.new(printIcon), tr("Print File"), nil,
self, SLOT('print()'), fileTools, "print file" )
- Qt::WhatsThis.whatsThisButton( fileTools )
+ TQt::WhatsThis.whatsThisButton( fileTools )
fileOpenText = tr('<p><img source="fileopen"> ' +
"Click this button to open a <em>new file</em>. <br>" +
"You can also select the <b>Open</b> command " +
"from the <b>File</b> menu.</p>")
- Qt::WhatsThis.add( fileOpen, fileOpenText )
+ TQt::WhatsThis.add( fileOpen, fileOpenText )
- Qt::MimeSourceFactory.defaultFactory().setPixmap( "fileopen", openIcon )
+ TQt::MimeSourceFactory.defaultFactory().setPixmap( "fileopen", openIcon )
fileSaveText = tr("<p>Click this button to save the file you " +
"are editing. You will be prompted for a file name.\n" +
"You can also select the <b>Save</b> command " +
"from the <b>File</b> menu.</p>")
- Qt::WhatsThis.add( fileSave, fileSaveText )
+ TQt::WhatsThis.add( fileSave, fileSaveText )
filePrintText = tr("Click this button to print the file you " +
"are editing.\n You can also select the Print " +
"command from the File menu.")
- Qt::WhatsThis.add( filePrint, filePrintText )
+ TQt::WhatsThis.add( filePrint, filePrintText )
- file = Qt::PopupMenu.new( self )
+ file = TQt::PopupMenu.new( self )
menuBar().insertItem( tr("&File"), file )
- file.insertItem( tr("&New"), self, SLOT('newDoc()'), Qt::KeySequence.new(CTRL+Key_N) )
+ file.insertItem( tr("&New"), self, SLOT('newDoc()'), TQt::KeySequence.new(CTRL+Key_N) )
- id = file.insertItem( Qt::IconSet.new(openIcon), tr("&Open..."),
- self, SLOT('choose()'), Qt::KeySequence.new(CTRL+Key_O) )
+ id = file.insertItem( TQt::IconSet.new(openIcon), tr("&Open..."),
+ self, SLOT('choose()'), TQt::KeySequence.new(CTRL+Key_O) )
file.setWhatsThis( id, fileOpenText )
- id = file.insertItem( Qt::IconSet.new(saveIcon), tr("&Save"),
- self, SLOT('save()'), Qt::KeySequence.new(CTRL+Key_S) )
+ id = file.insertItem( TQt::IconSet.new(saveIcon), tr("&Save"),
+ self, SLOT('save()'), TQt::KeySequence.new(CTRL+Key_S) )
file.setWhatsThis( id, fileSaveText )
id = file.insertItem( tr("Save &As..."), self, SLOT('saveAs()') )
@@ -73,27 +73,27 @@ class %{APPNAMESC} < Qt::MainWindow
file.insertSeparator()
- id = file.insertItem( Qt::IconSet.new(printIcon), tr("&Print..."),
- self, SLOT('print()'), Qt::KeySequence.new(CTRL+Key_P) )
+ id = file.insertItem( TQt::IconSet.new(printIcon), tr("&Print..."),
+ self, SLOT('print()'), TQt::KeySequence.new(CTRL+Key_P) )
file.setWhatsThis( id, filePrintText )
file.insertSeparator()
- file.insertItem( tr("&Close"), self, SLOT('close()'), Qt::KeySequence.new(CTRL+Key_W) )
+ file.insertItem( tr("&Close"), self, SLOT('close()'), TQt::KeySequence.new(CTRL+Key_W) )
- file.insertItem( tr("&Quit"), $tqApp, SLOT( 'closeAllWindows()' ), Qt::KeySequence.new(CTRL+Key_Q) )
+ file.insertItem( tr("&Quit"), $tqApp, SLOT( 'closeAllWindows()' ), TQt::KeySequence.new(CTRL+Key_Q) )
menuBar().insertSeparator()
- help = Qt::PopupMenu.new( self )
+ help = TQt::PopupMenu.new( self )
menuBar().insertItem( tr("&Help"), help )
- help.insertItem( tr("&About"), self, SLOT('about()'), Qt::KeySequence.new(Key_F1) )
+ help.insertItem( tr("&About"), self, SLOT('about()'), TQt::KeySequence.new(Key_F1) )
help.insertItem( tr("About &Qt"), self, SLOT('aboutQt()') )
help.insertSeparator()
- help.insertItem( tr("What's &This"), self, SLOT('whatsThis()'), Qt::KeySequence.new(SHIFT+Key_F1) )
+ help.insertItem( tr("What's &This"), self, SLOT('whatsThis()'), TQt::KeySequence.new(SHIFT+Key_F1) )
- @e = Qt::TextEdit.new( self, "editor" )
+ @e = TQt::TextEdit.new( self, "editor" )
@e.setFocus()
setCentralWidget( @e )
statusBar().message( tr("Ready"), 2000 )
@@ -110,7 +110,7 @@ class %{APPNAMESC} < Qt::MainWindow
end
def choose()
- fn = Qt::FileDialog.getOpenFileName( nil, nil,
+ fn = TQt::FileDialog.getOpenFileName( nil, nil,
self)
if !fn.nil?
load( fn )
@@ -121,12 +121,12 @@ class %{APPNAMESC} < Qt::MainWindow
def load( filename )
- f = Qt::File.new( filename )
- if !f.open( Qt::IO_ReadOnly )
+ f = TQt::File.new( filename )
+ if !f.open( TQt::IO_ReadOnly )
return
end
- ts = Qt::TextStream.new( f )
+ ts = TQt::TextStream.new( f )
@e.setText( ts.read() )
@e.setModified( false )
setCaption( filename )
@@ -141,14 +141,14 @@ class %{APPNAMESC} < Qt::MainWindow
end
text = @e.text()
- f = Qt::File.new( @filename )
- if !f.open( Qt::IO_WriteOnly )
+ f = TQt::File.new( @filename )
+ if !f.open( TQt::IO_WriteOnly )
statusBar().message( tr("Could not write to %s" % @filename),
2000 )
return
end
- t = Qt::TextStream.new( f )
+ t = TQt::TextStream.new( f )
t << text
f.close()
@@ -161,7 +161,7 @@ class %{APPNAMESC} < Qt::MainWindow
def saveAs()
- fn = Qt::FileDialog.getSaveFileName( nil, nil,
+ fn = TQt::FileDialog.getSaveFileName( nil, nil,
self )
if !fn.nil?
@filename = fn
@@ -173,13 +173,13 @@ class %{APPNAMESC} < Qt::MainWindow
def print()
- # ###### Rewrite to use Qt::SimpleRichText to print here as well
+ # ###### Rewrite to use TQt::SimpleRichText to print here as well
margin = 10
pageNo = 1
if @printer.setup(self) # @printer dialog
statusBar().message( tr("Printing...") )
- p = Qt::Painter.new
+ p = TQt::Painter.new
if !p.begin( @printer ) # paint on @printer
return
end
@@ -187,7 +187,7 @@ class %{APPNAMESC} < Qt::MainWindow
p.setFont( @e.font() )
yPos = 0 # y-position for each line
fm = p.fontMetrics()
- metrics = Qt::PaintDeviceMetrics.new( @printer ) # need width/height
+ metrics = TQt::PaintDeviceMetrics.new( @printer ) # need width/height
# of @printer surface
for i in 0...@e.lines() do
if margin + yPos > metrics.height() - margin
@@ -220,7 +220,7 @@ class %{APPNAMESC} < Qt::MainWindow
return
end
- case Qt::MessageBox.information( self, tr("Qt Application Example"),
+ case TQt::MessageBox.information( self, tr("Qt Application Example"),
tr("Do you want to save the changes" +
" to the document?"),
tr("Yes"), tr("No"), tr("Cancel"),
@@ -240,14 +240,14 @@ class %{APPNAMESC} < Qt::MainWindow
private
def about()
- Qt::MessageBox.about( self, tr("Qt Application Example"),
+ TQt::MessageBox.about( self, tr("Qt Application Example"),
tr("This example demonstrates simple use of " +
- "Qt::MainWindow,\nQt::MenuBar and Qt::ToolBar."))
+ "TQt::MainWindow,\nTQt::MenuBar and TQt::ToolBar."))
end
def aboutQt()
- Qt::MessageBox.aboutQt( self, tr("Qt Application Example") )
+ TQt::MessageBox.aboutQt( self, tr("Qt Application Example") )
end
end