I am following examples all over, including this SO answer: https://stackoverflow.com/a/14114878/274354
My code falls over when trying to create the ListWidgetItem with the icon with this message:
/usr/lib64/ruby/site_ruby/1.9.1/Qt/qtruby4.rb:2642:in `initialize': unresolved constructor call Qt::ListWidgetItem (ArgumentError)
Here is the code:
require 'Qt4'
app = Qt::Application.new(ARGV)
# Main Window
widget = Qt::Widget.new()
# Create icon from a file, and create a list widget item from the icon
icon = Qt::Icon.new("/home/user1/Pictures/testimage.JPG")
item = Qt::ListWidgetItem.new(icon) #<-- Falls over here
# Create a list widget
list = Qt::ListWidget.new(widget)
# Set the icon size for the list
iconsize = Qt::Size(40,40)
list.setIconSize(iconsize)
# Add the list item with the image
list.addItem(item)
widget.show()
app.exec()