Skip to content

Instantly share code, notes, and snippets.

@mvidner
Created October 2, 2012 15:52
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mvidner/3820341 to your computer and use it in GitHub Desktop.
Save mvidner/3820341 to your computer and use it in GitHub Desktop.
first steps with Qt 4 + Ruby, wanting a menu item with bold text
#!/usr/bin/env ruby
require 'Qt'
app = Qt::Application.new(ARGV)
# Qt.debug_level = Qt::DebugLevel::High
menu = Qt::Menu.new
click = menu.add_action("Clickme")
click.connect(SIGNAL :triggered) do
puts "Clicked"
end
quit = Qt::Action.new("Quitme", menu) do
connect(SIGNAL :triggered) { app.quit }
end
f = quit.font
f.set_bold(true) # f.set_italic(true)
quit.font = f
menu.add_action(quit)
menu.exec
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment