[Kde-bindings] RubyQt getting output when app quit
Abdelrahman Ghanem
abom.jdev at gmail.com
Tue Mar 31 20:19:19 UTC 2015
Can't get what you want exactly, but you can try this simple app:
require 'Qt4'
class Window < Qt::Widget
def initialize(values)
super(nil) # no parent
@combo = Qt::ComboBox.new
@combo.addItems(values)
@layout = Qt::VBoxLayout.new
@layout.addWidget(@combo)
self.windowTitle = "Combo App"
self.resize(300, 50)
self.layout = @layout
end
def closeEvent(event)
puts @combo.currentText
end
end
if $0 == __FILE__
app = Qt::Application.new(ARGV) # you may use the QApplication
lastWindowClosed
win = Window.new(('A'..'Z').to_a)
win.show
app.exec
end
http://pastebin.com/CxtiA3SP
On Sun, Mar 29, 2015 at 4:11 PM, Yvon Thoraval <yvon.thoraval at gmail.com>
wrote:
> I'm trying a simple app it shows in a combobox some values and I want to
> output the choosen value when quitting the app.
> this little app will be use from command line that's the reason i want the
> choosen value to STDOUT.
>
> best.
>
>
> _______________________________________________
> Kde-bindings mailing list
> Kde-bindings at kde.org
> https://mail.kde.org/mailman/listinfo/kde-bindings
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kde-bindings/attachments/20150331/35918578/attachment.html>
More information about the Kde-bindings
mailing list