Class: UpdatePage

Inherits:
Qt::Widget show all
Defined in:
ext/ruby/qtruby/examples/dialogs/configdialog/pages.rb

Instance Method Summary collapse

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(parent = nil) ⇒ UpdatePage

Returns a new instance of UpdatePage.



99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
# File 'ext/ruby/qtruby/examples/dialogs/configdialog/pages.rb', line 99

def initialize(parent = nil)
    super(parent)
    packagesGroup = Qt::GroupBox.new(tr("Look for packages"))

    nameLabel = Qt::Label.new(tr("Name:"))
    nameEdit = Qt::LineEdit.new

    dateLabel = Qt::Label.new(tr("Released after:"))
    dateEdit = Qt::DateTimeEdit.new(Qt::Date.currentDate())

    releasesCheckBox = Qt::CheckBox.new(tr("Releases"))
    upgradesCheckBox = Qt::CheckBox.new(tr("Upgrades"))

    hitsSpinBox = Qt::SpinBox.new do |h|
        h.prefix = tr("Return up to ")
        h.suffix = tr(" results")
        h.specialValueText = tr("Return only the first result")
        h.minimum = 1
        h.maximum = 100
        h.singleStep = 10
    end

    startQueryButton = Qt::PushButton.new(tr("Start query"))

    packagesGroup.layout = Qt::GridLayout.new do |p|
        p.addWidget(nameLabel, 0, 0)
        p.addWidget(nameEdit, 0, 1)
        p.addWidget(dateLabel, 1, 0)
        p.addWidget(dateEdit, 1, 1)
        p.addWidget(releasesCheckBox, 2, 0)
        p.addWidget(upgradesCheckBox, 3, 0)
        p.addWidget(hitsSpinBox, 4, 0, 1, 2)
    end

    self.layout = Qt::VBoxLayout.new do |m|
        m.addWidget(packagesGroup)
        m.addSpacing(12)
        m.addWidget(startQueryButton)
        m.addStretch(1)
    end
end