class FirstPage

Attributes

baseClassLineEdit[RW]
classNameLineEdit[RW]
copyCtorCheckBox[RW]
defaultCtorRadioButton[RW]
headerLineEdit[RW]
qobjectCtorRadioButton[RW]
qobjectMacroCheckBox[RW]
qwidgetCtorRadioButton[RW]

Public Class Methods

new(wizard) click to toggle source
Calls superclass method
# File examples/dialogs/simplewizard/classwizard.rb, line 205
def initialize(wizard)
    super(wizard)
    @topLabel = Qt::Label.new(tr("<center><b>Class information</b></center>" +
                             "<p>This wizard will generate a skeleton class " +
                             "definition and member function definitions."))
    @topLabel.wordWrap = false

    @classNameLabel = Qt::Label.new(tr("Class &name:"))
    @classNameLineEdit = Qt::LineEdit.new
    @classNameLabel.buddy = @classNameLineEdit
    setFocusProxy(@classNameLineEdit)

    @baseClassLabel = Qt::Label.new(tr("&Base class:"))
    @baseClassLineEdit = Qt::LineEdit.new
    @baseClassLabel.buddy = @baseClassLineEdit

    @qobjectMacroCheckBox = Qt::CheckBox.new(tr("&Generate Q_OBJECT macro"))

    @groupBox = Qt::GroupBox.new(tr("&Constructor"))

    @qobjectCtorRadioButton = Qt::RadioButton.new(tr("&QObject-style constructor"))
    @qwidgetCtorRadioButton = Qt::RadioButton.new(tr("Q&Widget-style constructor"))
    @defaultCtorRadioButton = Qt::RadioButton.new(tr("&Default constructor"))
    @copyCtorCheckBox = Qt::CheckBox.new(tr("&Also generate copy constructor and " +
                                        "assignment operator"))

    @defaultCtorRadioButton.checked = true

    connect(@classNameLineEdit, SIGNAL('textChanged(const QString &)'),
            self, SLOT('classNameChanged()'))
    connect(@defaultCtorRadioButton, SIGNAL('toggled(bool)'),
            @copyCtorCheckBox, SLOT('setEnabled(bool)'))

    wizard.buttonEnabled = false

    @groupBox.layout = Qt::VBoxLayout.new do |g|
        g.addWidget(@qobjectCtorRadioButton)
        g.addWidget(@qwidgetCtorRadioButton)
        g.addWidget(@defaultCtorRadioButton)
        g.addWidget(@copyCtorCheckBox)
    end

    self.layout = Qt::GridLayout.new do |l|
        l.addWidget(@topLabel, 0, 0, 1, 2)
        l.setRowMinimumHeight(1, 10)
        l.addWidget(@classNameLabel, 2, 0)
        l.addWidget(@classNameLineEdit, 2, 1)
        l.addWidget(@baseClassLabel, 3, 0)
        l.addWidget(@baseClassLineEdit, 3, 1)
        l.addWidget(@qobjectMacroCheckBox, 4, 0, 1, 2)
        l.addWidget(@groupBox, 5, 0, 1, 2)
        l.setRowStretch(6, 1)
    end
end

Public Instance Methods

classNameChanged() click to toggle source
# File examples/dialogs/simplewizard/classwizard.rb, line 260
def classNameChanged()
    wizard = parent()
    wizard.buttonEnabled = !@classNameLineEdit.text.empty?
end