Expression qt.QFont(arg) returns a new font object. Argument arg may be a string previously returned by qfont:tostring() or a table whose fields specify the desired font characteristics. The following fields are recognized, listed in order of priority:

Example:

  require 'qtwidget'
  w=qtwidget.newwindow(300,300)
  w:moveto(20,20)
  w:setfont(qt.QFont{serif=true,size=12,italic=true})
  w:show("foo")
  w:setfont(qt.QFont{serif=true,size=12,italic=true,underline=true})
  w:setcolor("blue")
  w:show("bar")