Class: ApplicationsTab
- Inherits:
-
Qt::Widget
- Object
- Qt::Base
- Qt::Widget
- ApplicationsTab
- Defined in:
- ext/ruby/qtruby/examples/dialogs/tabdialog/tabdialog.rb
Instance Method Summary collapse
-
#initialize(fileInfo, parent = nil) ⇒ ApplicationsTab
constructor
A new instance of ApplicationsTab.
Methods inherited from Qt::Widget
Methods inherited from Qt::Base
#%, #&, #*, #**, #+, #-, #-@, #/, #<, #<<, #<=, #==, #>, #>=, #>>, #QCOMPARE, #QEXPECT_FAIL, #QFAIL, #QSKIP, #QTEST, #QVERIFY, #QVERIFY2, #QWARN, #^, ancestors, #is_a?, #methods, private_slots, #protected_methods, #public_methods, q_classinfo, q_signal, q_slot, signals, #singleton_methods, slots, #|, #~
Constructor Details
#initialize(fileInfo, parent = nil) ⇒ ApplicationsTab
Returns a new instance of ApplicationsTab.
153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 |
# File 'ext/ruby/qtruby/examples/dialogs/tabdialog/tabdialog.rb', line 153 def initialize(fileInfo, parent = nil) super(parent) topLabel = Qt::Label.new(tr("Open with:")) applicationsListBox = Qt::ListWidget.new applications = [] (1..30).each do |i| applications.push tr("Application %d" % i) end applicationsListBox.insertItems(0, applications) if fileInfo.suffix.nil? alwaysCheckBox = Qt::CheckBox.new(tr("Always use this application to " + "open this type of file")) else alwaysCheckBox = Qt::CheckBox.new(tr("Always use this application to " + "open files with the extension '%s'" % fileInfo.suffix())) end self.layout = Qt::VBoxLayout.new do |l| l.addWidget(topLabel) l.addWidget(applicationsListBox) l.addWidget(alwaysCheckBox) end end |