Class: DetailsPage

Inherits:
LicenseWizardPage show all
Defined in:
ext/ruby/qtruby/examples/dialogs/complexwizard/licensewizard.rb

Instance Method Summary collapse

Methods inherited from WizardPage

#isLastPage

Methods inherited from Qt::Widget

#raise

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(wizard) ⇒ DetailsPage

Returns a new instance of DetailsPage.



192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
# File 'ext/ruby/qtruby/examples/dialogs/complexwizard/licensewizard.rb', line 192

def initialize(wizard)
    super(wizard)
    @topLabel = Qt::Label.new(tr("<center><b>Fill in your details</b></center>"))

    @companyLabel = Qt::Label.new(tr("&Company name:"))
    @companyLineEdit = Qt::LineEdit.new
    @companyLabel.buddy = @companyLineEdit
    setFocusProxy(@companyLineEdit)

    @emailLabel = Qt::Label.new(tr("&Email address:"))
    @emailLineEdit = Qt::LineEdit.new
    @emailLabel.buddy = @emailLineEdit

    @postalLabel = Qt::Label.new(tr("&Postal address:"))
    @postalLineEdit = Qt::LineEdit.new
    @postalLabel.buddy = @postalLineEdit

    connect(@companyLineEdit, SIGNAL('textChanged(QString)'),
            self, SIGNAL('completeStateChanged()'))
    connect(@emailLineEdit, SIGNAL('textChanged(QString)'),
            self, SIGNAL('completeStateChanged()'))
    connect(@postalLineEdit, SIGNAL('textChanged(QString)'),
            self, SIGNAL('completeStateChanged()'))

    layout = Qt::GridLayout.new
    layout.addWidget(@topLabel, 0, 0, 1, 2)
    layout.setRowMinimumHeight(1, 10)
    layout.addWidget(@companyLabel, 2, 0)
    layout.addWidget(@companyLineEdit, 2, 1)
    layout.addWidget(@emailLabel, 3, 0)
    layout.addWidget(@emailLineEdit, 3, 1)
    layout.addWidget(@postalLabel, 4, 0)
    layout.addWidget(@postalLineEdit, 4, 1)
    layout.setRowStretch(5, 1)
    setLayout(layout)
end

Instance Method Details

#isCompleteObject



239
240
241
242
243
# File 'ext/ruby/qtruby/examples/dialogs/complexwizard/licensewizard.rb', line 239

def isComplete()
    return !@companyLineEdit.text.empty? &&
           !@emailLineEdit.text.empty? &&
           !@postalLineEdit.text.empty?
end

#nextPageObject



235
236
237
# File 'ext/ruby/qtruby/examples/dialogs/complexwizard/licensewizard.rb', line 235

def nextPage()
    return @wizard.finishPage
end

#resetPageObject



229
230
231
232
233
# File 'ext/ruby/qtruby/examples/dialogs/complexwizard/licensewizard.rb', line 229

def resetPage()
    @companyLineEdit.clear
    @emailLineEdit.clear
    @postalLineEdit.clear
end