Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/torch/qtlua.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRonan Collobert <ronan@collobert.com>2013-10-16 15:30:36 +0400
committerRonan Collobert <ronan@collobert.com>2013-10-16 15:30:36 +0400
commita15e7822f8fa4c12e76f13b1b20afac725471a37 (patch)
tree19a4aeb51040d9a801b01e79ca5cbc3d7c29973c
parentdd9ea1ce086c5ae132e8f1924730922809c1c605 (diff)
qtgui: dok -> md
-rw-r--r--packages/qtgui/doc/README.md1192
-rw-r--r--packages/qtgui/dok/index.dok1191
2 files changed, 1192 insertions, 1191 deletions
diff --git a/packages/qtgui/doc/README.md b/packages/qtgui/doc/README.md
new file mode 100644
index 0000000..27feebd
--- /dev/null
+++ b/packages/qtgui/doc/README.md
@@ -0,0 +1,1192 @@
+<a name="qtgui.dok"/>
+# QtGui Bindings #
+
+The package `qtgui`
+contains bindings for classes defined by the Qt module
+[QtGui](http://doc.trolltech.com/4.4/qtcore.html).
+
+Besides the capabilites reported below, all qt variants inherit a set
+of [default methods](..:qt:index#qt.QVariants), and all qt object
+classes inherit the capabilities from their superclasses and
+automatically expose [[..:qt:index#qt.QObjects|properties, slots and
+signals]].
+
+
+<a name="qaction"/>
+## qt.QAction, qt.QtLuaAction ##
+<a name="qtluaaction"/>
+
+Qt class
+[QAction](http://doc.trolltech.com/4.4/qaction.html)
+is a sublass of [qt.QObject](..:qtcore:index#qt.qobject)
+that represents actions associated with menu items
+and toolbar icons.
+
+
+<a name="qaction"/>
+### qt.QAction([arg]) ###
+
+Expression `qt.QAction([arg])` returns a new `QAction` object.
+The optional argument `arg` can be a qt object that
+becomes the action parent or a table whose
+members contain initial values for the action properties.
+This table can also contain a function value
+which is then connected to the signal `triggered(bool)`
+of the qt action object.
+
+Example:
+```lua
+ a === qt.QAction { text="Automatic Mode",
+ checkable === true, checked === false,
+ function(b) setAutoMode(b) end }
+```
+
+Unless a parent is specified, the action is owned
+by the Lua interpreter and therefore is automatically
+destroyed when the garbage collector determines that
+it is no longer referenced.
+
+Actions are always created from the main thread using
+the [thread hopping](..:qt:index#qt.qcall) mechanism.
+
+<a name="qaction.menu"/>
+### qaction:menu() ###
+
+Same as the C++ function `QAction::menu()`.
+
+<a name="qaction.setmenu"/>
+### qaction:setMenu() ###
+
+
+Same as the C++ function `QAction::setMenu()`.
+
+<a name="qtluaaction"/>
+### qt.QtLuaAction([arg]) ###
+
+This constructor takes the same arguments as `qt.QAction`
+but returns an instance of a convenient subclass
+that enables or disables the action according
+to the availability of the Lua engine.
+
+The action follows its property `enabled`
+when the Lua engine is ready to invoke Lua
+functions connected to Qt signals.
+Otherwise the action is disabled regardless
+of the value of property `enabled`.
+
+<a name="qtluaaction.autodisable"/>
+### qtluaaction.autoDisable ###
+
+This property applies only to action objects of class `qt.QtLuaAction`.
+It controls whether the action is automatically disabled
+when the Lua engine is not available.
+The default is `true`.
+
+
+<a name="qapplication"/>
+## qt.QApplication ##
+
+Qt class [QApplication](http://doc.trolltech.com/4.4/qapplication.html)
+manages the GUI application's control flow and main settings. This is a
+subclass of [QCoreApplication](..:qtcore:index#qcoreapplication).
+
+<a name="qapplication.changeOverrideCursor"/>
+### qt.QApplication.changeOverrideCursor(qcursor) ###
+
+Changes the currently active application override cursor to cursor
+without disturbing the cursor stack. This function has no
+effect if `setOverrideCursor()` was not called.
+
+<a name="qapplication.keyboardModifiers"/>
+### qt.QApplication.keyboardModifiers() ###
+
+Returns a string describing the currently depressed keyboard modifiers.
+
+<a name="qapplication.mouseButtons"/>
+### qt.QApplication.mouseButtons() ###
+
+Returns a string describing the currently depressed mouse buttons.
+
+<a name="qapplication.overrideCursor"/>
+### qt.QApplication.overrideCursor() ###
+
+Returns the active application override cursor.
+This function returns `nil` if no application cursor
+has been defined (i.e. the internal cursor stack is empty).
+
+<a name="qapplication.restoreOverrideCursor"/>
+### qt.QApplication.restoreOverrideCursor() ###
+
+Undoes the last `setOverrideCursor()`.
+
+<a name="qapplication.setoverridecursor"/>
+### qt.QApplication.setOverrideCursor(qcursor) ###
+
+Sets the application override cursor to `qcursor`.
+Application override cursors are intended for showing the user that
+the application is in a special state, for example during an operation that might take some time.
+Override cursors are stored on a stack. Function `setOverrideCursor()` pushes a cursor on the stack.
+Function `restoreOverrideCursor()` pops the stack.
+
+
+<a name="qbrush"/>
+## qt.QBrush ##
+
+Qt class
+[QBrush](http://doc.trolltech.com/4.4/qbrush.html)
+represents the painter settings that determine how shape
+are filled and how text is rendered. Brushes are represented
+by Qt variants of class `qt.QBrush`.
+
+
+<a name="qbrush"/>
+### qt.QBrush(table) ###
+<a name="qbrushfromtable"/>
+
+Expression `qt.QBrush(table)` returns a brush whose settings
+are determined by the fields of table `table`.
+The following fields are recognized:
+
+ * Field `color` contains a [qt.QColor](#qcolor) value representing the brush color.
+
+ * Field `texture` contains a [qt.QImage](#qimage) value representing the brush texture.
+
+ * Field `gradient` contains a [qt.QGradient](#qgradient) value representing a color gradient.
+
+ * Field `transform` contains a `qt.QTransform` value that defines a additional transformation applied to the brush before painting it into the current coordinate system.
+
+ * Field `style` contains the name of the [brush style](http://doc.trolltech.com/4.4/qt.html#BrushStyle-enum). The default brush style is `SolidPatter` when field `color` is defined, `TexturePattern` when field `texture` is defined, or one of the gradient styles when field `gradient` is defined. Otherwise the default style is `NoBrush` meaning that nothing is painted.
+
+
+<a name="qbrush.totable"/>
+### qbrush:totable() ###
+
+Expression `qbrush:totable()` returns a table describing the brush.
+See the documentation of [qt.QBrush(table)](#qbrushfromtable)
+for a description of the table fields.
+
+
+<a name="qcolor"/>
+## qt.QColor ##
+
+Qt class
+[QColor](http://doc.trolltech.com/4.4/qcolor.html)
+represents colors for painting purposes.
+Qt variant of class `qt.QColor` have a textual representation
+of the form =="#RRGGBB" where letters `R`, `G`, or `B` are
+hexadecimal digits representing the intensities of the
+color components.
+
+
+<a name="qcolor"/>
+### qt.QColor(...) ###
+
+There are several ways to construct a Qt variant of class `qt.QColor`.
+
+__`qt.QColor(r,g,b,[a])`__
+
+Arguments `r`, `g`, `b`, and `a` are numbers in range `[0,1]`
+representing the intensities of the red, green, blue, and alpha channels.
+The default value for argument `a` is `1` for a fully opaque color.
+
+__ `qt.QColor(string)` __
+
+Argument `string` is a string representing a color name.
+All [SVG color names](http://www.w3.org/TR/SVG/types.html#ColorKeywords)
+are recognized.Color names can have also the format `"#RGB"`,
+`"#RRGGBB"`, `"#RRRGGGBBB"`, or =="#RRRRGGGGBBBB"
+where letters `R`, `G`, or `B` represent hexadecimal
+digits for each of the color component.
+
+__ `qt.QColor(table)` __
+
+Argument `table` is a table whose fields `r`, `g`, `b` and `a`
+contain numbers in range `[0,1]` representing the intensities
+of the red, green, blue, and alpha channels. Such a table
+is returned by function [qcolor:totable()](#qcolortotable).
+
+<a name="qcolor.totable"/>
+### qcolor:totable() ###
+<a name="qcolortotable"/>
+
+Expression `qcolor:totable()` returns a table whose fields
+`r`, `g`, `b` and `a` contain numbers in range `[0,1]`
+representing the intensities of the red, green, blue,
+and alpha channels.
+
+
+<a name="qcolordialog"/>
+## qt.QColorDialog ##
+
+Qt class
+[QColorDialog](http://doc.trolltech.com/4.4/qcolordialog.html)
+implements a dialog for selecting colors.
+The recommended way to use this class is the static function `getColor`.
+
+<a name="qcolordialog.getcolor"/>
+### qt.QColorDialog.getColor([font],[parent]) ###
+
+Pops up a dialog for selecting a color.
+Optional argument `color` is the initial color selection.
+Argument `parent` is the parent widget.
+This function returns `nil` if the no color was selected.
+Otherwise it returns a qvariant of type [qt.QColor](#qcolor).
+
+<a name="qcursor"/>
+## qt.QCursor ##
+
+Qt class
+[QCursor](http://doc.trolltech.com/4.4/qcursor.html)
+provides a mouse cursor with an arbitrary shape.
+
+<a name="qcursor"/>
+### qt.QCursor(cursorshape) ###
+
+Returns a standard cursor.
+Argument `cursorshape` is the name of a
+[standard shape](http://doc.trolltech.com/4.4/qt.html#CursorShape-enum).
+
+<a name="qcursor"/>
+### qt.QCursor(image,[mask],[posx,[posy]) ###
+
+Constructs a cursor with the specified image, mask and hot spot.
+
+<a name="qcursor.hotSpot"/>
+### qcursor:hotSpot() ###
+
+Return a `qt.QPoint` with the cursor's hot spot coordinates.
+
+<a name="qcursor.mask"/>
+### qcursor:mask() ###
+
+Return the cursor's mask.
+
+<a name="qcursor.pixmap"/>
+### qcursor:pixmap() ###
+
+Return the cursor's pixmap.
+
+<a name="qcursor.shape"/>
+### qcursor:shape() ###
+
+Return the name of the cursor's
+[standard shape](http://doc.trolltech.com/4.4/qt.html#CursorShape-enum).
+
+<a name="qcursor.pos"/>
+### qt.QCursor.pos() ###
+
+Returns a `QPoint` with the global coordinates of the mouse cursor.
+
+<a name="qcursor.setPos"/>
+### qt.QCursor.setPos(qpoint) ###
+
+Sets the global coordinates of the mouse cursor.
+
+<a name="qdialog"/>
+## qt.QDialog ##
+
+Qt class
+[QDialog](http://doc.trolltech.com/4.4/qdialog.html)
+is the base class of dialog windows.
+
+<a name="qdialog"/>
+### qt.QDialog([parent]) ###
+
+Expression `qt.QDialog(parent)` returns a new `QDialog` instance.
+The optional argument `parent` specifies the widget parent.
+When argument `parent` is `nil` or not specified,
+the new widget is owned by the Lua interpreter
+and is automatically destroyed when the garbage collector
+determines that it is no longer referenced.
+
+<a name="qdialog.result"/>
+### qdialog:result() ###
+
+Gets the dialog's result code as an integer.
+This is usually `1` when the dialog has been accepted
+and `0` when the dialog has been rejected.
+
+<a name="qdialog.setresult"/>
+### qdialog:setResult(integer) ###
+
+Sets the dialog's result code.
+This is usually `1` when the dialog has been accepted
+and `0` when the dialog has been rejected.
+
+
+<a name="qfiledialog"/>
+## qt.QFileDialog ##
+
+Qt class
+[QFileDialog](http://doc.trolltech.com/4.4/qfiledialog.html)
+provides a dialog that allow users to select files or directories.
+This is a subclass of [qt.QDialog](#qdialog).
+
+<a name="qfiledialog.getExistingDirectory"/>
+### qt.QFileDialog.getExistingDirectory([p.[c,[d,[opt]]]]) ###
+
+This convenience function shows a file dialog
+for selecting an existing directory.
+Argument `p` is the parent widget.
+Argument `c` is the dialog caption.
+Argument `d` is the initial directory shown in the dialog.
+Argument `opt` are the [file dialog options](http://doc.trolltech.com/4.4/qfiledialog.html#Option-enum).
+
+The function returns a `qt.QString` containing the selected directory name.
+
+<a name="qfiledialog.getOpenFileName"/>
+### qt.QFileDialog.getOpenFileName([p,[c,[d,[f,[s,[opt]]]]]]) ###
+
+This convenience function shows a file dialog
+for selecting an existing file.
+ * Argument `p` is the parent widget.
+ * Argument `c` is the dialog caption.
+ * Argument `d` is the initial directory shown in the dialog.
+ * Argument `f` contains the filters separated by double semicolons.
+ * Argument `s` contains the selected filter
+ * Argument `opt` are the [file dialog options](http://doc.trolltech.com/4.4/qfiledialog.html#Option-enum).
+
+The function returns a `qt.QString` containing the selected file name
+and a `qt.QString` contaning the selected filter.
+
+<a name="qfiledialog.getOpenFileNames"/>
+### qt.QFileDialog.getOpenFileNames([p,[c,[d,[f,[s,[opt]]]]]]) ###
+
+This convenience function shows a file dialog
+for selecting multiple existing files.
+ * Argument `p` is the parent widget.
+ * Argument `c` is the dialog caption.
+ * Argument `d` is the initial directory shown in the dialog.
+ * Argument `f` contains the filters separated by double semicolons.
+ * Argument `s` contains the selected filter
+ * Argument `opt` are the [file dialog options](http://doc.trolltech.com/4.4/qfiledialog.html#Option-enum).
+
+The function returns a `qt.QStringList` containing the file names
+and a `qt.QString` contaning the selected filter.
+
+<a name="qfiledialog.getsavefilename"/>
+### qt.QFileDialog.getSaveFileName([p,[c,[d,[f,[s,[opt]]]]]]) ###
+
+This convenience function shows a file dialog
+for selecting a file name for saving data.
+ * Argument `p` is the parent widget.
+ * Argument `c` is the dialog caption.
+ * Argument `d` is the initial directory shown in the dialog.
+ * Argument `f` contains the filters separated by double semicolons.
+ * Argument `s` contains the selected filter
+ * Argument `opt` are the [file dialog options](http://doc.trolltech.com/4.4/qfiledialog.html#Option-enum).
+
+The function returns a `qt.QString` containing the selected file name
+and a `qt.QString` contaning the selected filter.
+
+<a name="qfiledialog.new"/>
+### qt.QFileDialog.new([parent.[caption,[dir,[filters]]]]) ###
+
+Function `qt.QFileDialog.new` returns a new file dialog object.
+ * Argument `parent` is the parent widget
+ * Argument `caption` is the dialog caption.
+ * Argument `dir` is the initial directory shown in the dialog.
+ * Argument `filters` contains the filters separated by double semicolons.
+
+When argument `parent` is `nil` or not specified,
+the new widget is owned by the Lua interpreter
+and is automatically destroyed when the garbage collector
+determines that it is no longer referenced.
+
+<a name="qfiledialog.directory"/>
+### qfiledialog:directory() ###
+
+Returns a `qt.QString` containing the path of the selected directory.
+
+<a name="qfiledialog.nameFilters"/>
+### qfiledialog:nameFilters() ###
+
+Returns a `qt.QStringList` containing the name filters.
+
+<a name="qfiledialog.selectedFiles"/>
+### qfiledialog:selectedFiles() ###
+
+Returns a `qt.QStringList` containing the selected files.
+
+<a name="qfiledialog.selectFile"/>
+### qfiledialog:selectFile(fname) ###
+
+Select file `fname` in the file dialog.
+
+<a name="qfiledialog.selectNameFilter"/>
+### qfiledialog:selectNameFilter(filter) ###
+
+Select name filter `filter` in the file dialog.
+
+<a name="qfiledialog.setDirectory"/>
+### qfiledialog:setDirectory(dirname) ###
+
+Set the file dialog directory to `dirname`.
+
+<a name="qfiledialog.setNameFilters"/>
+### qfiledialog:setNameFilters(filters) ###
+
+Set the file dialog name filters to `filters`.
+Argument `filters` may be a `qt.QStringList`
+or a string containing the filters separated by
+two semicolons `";;"`.
+
+<a name="qfiledialog.setOption"/>
+### qfiledialog:setOption(option, bool) ###
+
+Sets the specified
+[file dialog option](http://doc.trolltech.com/4.5/qfiledialog.html#Option-enum)
+to the boolean value `bool`. Not available before Qt-4.5.
+
+### qfiledialog:testOption(option) ###
+
+Returns the value of the specified
+[file dialog option](http://doc.trolltech.com/4.5/qfiledialog.html#Option-enum).
+Not available before Qt-4.5.
+
+<a name="qfont"/>
+## qt.QFont ##
+
+Qt class
+[QFont](http://doc.trolltech.com/4.4/qfont.html)
+represents the painter settings that determine the font(s)
+used to display text.
+
+
+<a name="qfont"/>
+### qt.QFont(arg) ###
+<a name="qfontfromtable"/>
+
+Expression `qt.QFont(arg)` returns a new font object.
+Argument `arg` may be a string previously returned
+by [qfont:tostring()](#qfonttostring) or
+a table whose fields specify the desired font characteristics.
+The following fields are recognized, listed in order of priority:
+
+ * String field `family` may contain a comma separated list of the desired font families.
+
+ * Setting boolean field `sans` to `true` indicates a preference for sans serif font families such as "Helvetica". This is more portable than specifying a family.
+
+ * Setting boolean field `serif` to `true` indicates a preference for serif font families such as "Times". This is more portable than specifying a family.
+
+ * Setting boolean field `typewriter` to `true` indicates a preference for a fixed width font families such as "Courier". This is more portable than specifying a family.
+
+ * Numerical field `size` specify the desired size of the font. The default size is 10 points.
+
+ * Numerical fields `pixelSize` and `pointSize` also indicates the desired size of the font. Field `pixelSize` is an alias for `size`. Field `pointSize` includes a correction factor corresponding to the actual resolution of the target device. When both are precised, `pointSize` takes precedence.
+
+ * Numerical field `weight` defines the weight of the font. Weight 50 corresponds to a normal font and weight 75 corresponds to a bold font.
+
+ * Numerical field `stretch` is a percentage applied to the width of all characters. Value 100 corresponds to a normal width. Value 150 increases all width by 50 percent.
+
+ * Setting boolean field `bold` to `true` requests a bold font if the selected font family defines a bold variant.
+
+ * Setting boolean field `italic` to `true` requests and italic font if the selected font family defines an italic or oblique variant.
+
+ * Setting boolean field `fixedPitch` to `true` requests a fixed pitch font if the selected font family defines such a variant (rare).
+
+ * Setting boolean field `underline` to `true` draws a line below all the character at a font-specified position.
+
+ * Setting boolean field `overline` to `true` draws a line above all the character at a font-specified position.
+
+ * Setting boolean field `strikeOut` to `true` draws a line that crosses the character at a font-specified position.
+
+Example:
+```lua
+ 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")
+```
+
+
+<a name="qfont.totable"/>
+### qfont:totable() ###
+
+Expression `qfont:totable()` returns a table
+suitable for use with [qt.QFont(table)](#qfontfromtable).
+All the supported fields are populated.
+
+Example:
+```lua
+ require 'qtwidget'
+ f=qt.QFont{serif=true,size=12,bold=true}
+ for k,v in pairs(f:totable()) do print(k,v) end
+```
+
+<a name="qfonttostring"/>
+### qfont:tostring() ###
+<a name="qfont.tostring"/>
+
+Expression `qfont:tostring()` returns a string
+representation of the font settings that is
+suitable for storing in configuration files for instance.
+Use [qt.QFont(string)](#qfontfromtable) to
+reconstruct the corresponding font object.
+
+<a name="qfontinfo"/>
+### qfont:info() ###
+<a name="qfont.info"/>
+
+Expression `qfont:info()` returns a table describing
+the actual font selected by the font matching algorithm
+when one uses `qfont` to display text on the screen.
+This table can be used as argument to
+function [qt.QFont()](#qfontfromtable)
+as it uses the same keys.
+This is achieved using the Qt class
+[QFontInfo](http://doc.trolltech.com/4.4/qfontinfo.html).
+Fields `"underline"`, `"overline"`, `"strikeOut"`, and `"stretch"`
+are copied verbatim from the `qfont` object.
+
+<a name="qfontdialog"/>
+## qt.QFontDialog ##
+
+Qt class
+[QFontDialog](http://doc.trolltech.com/4.4/qfontdialog.html)
+implements a dialog for selecting fonts.
+The recommended way to use this class is the static function `getFont`.
+
+<a name="qfontdialog.getfont"/>
+### qt.QFontDialog.getFont([font],[parent, [caption]]) ###
+
+Pops up a dialog for selecting a font.
+All arguments are optional.
+Argument `font` is the initial font selection.
+Argument `parent` is the parent widget.
+Argument `caption` is the dialog window title.
+This function returns `nil` if the no font was selected.
+Otherwise it returns a qvariant of type [qt.QFont](#qfont).
+
+
+<a name="qgradient"/>
+## qt.QGradient ##
+
+Qt class
+[QGradient](http://doc.trolltech.com/4.4/qgradient.html)
+represents a color gradient for use in [gradient brushes](#qbrush).
+No specific Lua methods have been defined for this Qt variant class.
+
+
+<a name="qicon"/>
+## qt.QIcon ##
+
+Qt class
+[QIcon](http://doc.trolltech.com/4.4/qimage.html)
+provides scalable icons in different modes and states.
+
+<a name="qicon"/>
+### qt.QIcon([arg]) ###
+
+Returns a new icon.
+Argument `arg` can be a qt value of
+type [qt.QImage](#qimage)
+or [qt.QPixmap](#qpixmap).
+Alternatively, argument `arg` may be a
+file name that will be loaded on demand.
+
+
+<a name="qimage"/>
+## qt.QImage ##
+
+Qt class
+[QImage](http://doc.trolltech.com/4.4/qimage.html)
+represents a device independent off-screen image.
+Such images are represented in Lua
+as Qt variants of class `qt.QImage`.
+
+<a name="qimage"/>
+### qt.QImage(...) ###
+
+There are several ways to construct a Qt variant of class `qt.QImage`.
+
+__ `qt.QImage(w,h,monoflag)` __
+
+Returns a new image of width `w` and height `h`.
+The image is bitonal when the optional boolean flag `monoflag`
+is `true`. Otherwise the image is a 32 bits RGBA image.
+
+__ `qt.QImage(f,format)` __
+
+Returns a new image obtained by reading the image file `f`.
+Argument `f` can be a file name or a Lua file descriptor.
+The [file format](#qimageformats) is determined
+by the optional string `format` or by the file name extension.
+
+
+<a name="qimage.depth"/>
+### qimage:depth() ###
+
+Expression `qimage:depth()` returns the depth of the image `qimage`.
+A depth of 1 indicates a bitonal image.
+A depth of 24 or 32 indicates a true color image.
+
+<a name="qimage.rect"/>
+### qimage:rect() ###
+
+Expression `qimage:rect()` returns a Qt variant of class
+[qt.QRect](..:qtcore:index#qrect) representing the
+boundaries of the image `qimage`.
+
+<a name="qimage.save"/>
+### qimage:save(f,[format]) ###
+
+Expression `qimage:save(f,format)` saves the image data into file `f`.
+Argument `f` can be a file name or a Lua file descriptor.
+The [file format](#qimageformats) is determined by the
+optional string `format` or by the file name extension.
+
+<a name="qimage.size"/>
+### qimage:size() ###
+
+Expression `qimage:size()` returns a Qt variant of class
+[qt.QSize](..:qtcore:index#qsize) representing the
+size of the image `qimage`.
+
+<a name="qimage.formats"/>
+### qt.QImage.formats([string]) ###
+<a name="qimageformats"/>
+
+Function `qt.QImage.formats` describes the
+supported formats for reading or saving files.
+The optional `string` argument must be a string
+starting with letter `"r"` or `"w"` to indicate if
+one is interested in the supported formats for reading or
+writing image files. When this letter is followed by letter `"f"`,
+the function returns a string suitable for selecting name
+filters in a file dialog. Otherwise, the function
+returns a `qt.QStringList` with the supported formats.
+
+
+
+<a name="qkeysequence"/>
+## qt.QKeySequence ##
+
+Qt class
+[QKeySequence](http://doc.trolltech.com/4.4/qkeysequence.html)
+encapsulates a key sequence as used by shortcuts.
+
+<a name="qkeysequence"/>
+### qt.QKeySequence(string) ###
+
+Returns a Qt value of class `qt.QKeySequence`
+associated with the key combination described in string `string`.
+Up to four key codes may be entered by separating
+them with commas, e.g. `"Alt+V,Ctrl+Down,A,Shift+Home"`.
+
+<a name="qkeysequence.tostring"/>
+### qkeysequence:tostring() ###
+
+Returns a string describing the keys in the key sequence.
+
+
+<a name="qmainwindow"/>
+## qt.QMainWindow ##
+
+Qt class
+[QMainWindow](http://doc.trolltech.com/4.4/qmainwindow.html)
+provides a main application window with menu, statusbar, toolbars
+and dockable widgets. This is a subclass of [QWidget](#qwidget).
+
+<a name="qmainwindow"/>
+### qt.QMainWindow([parent]) ###
+
+Expression `qt.QMainWindow(parent)` returns a new `QMainWindow` instance.
+The optional argument `parent` specifies the widget parent.
+When argument `parent` is `nil` or not specified,
+the new widget is owned by the Lua interpreter
+and is automatically destroyed when the garbage collector
+determines that it is no longer referenced.
+
+<a name="qmainwindow.centralWidget"/>
+### qmainwindow:centralWidget() ###
+
+Expression `qmainwindow:centralWidget()` returns the
+central widget managed by the main window.
+
+<a name="qmainwindow.menuBar"/>
+### qmainwindow:menuBar() ###
+
+Returns the main window's menu bar.
+This function creates and returns an empty menu bar
+if the menu bar does not exist yet.
+
+<a name="qmainwindow.setcentralwidget"/>
+### qmainwindow:setCentralWidget(qwidget) ###
+
+Sets the widget `qwidget` to be the main window's central widget.
+The main window takes ownership of the widget pointer and
+deletes it at the appropriate time.
+
+<a name="qmainwindow.setmenubar"/>
+### qmainwindow:setMenuBar(qmenubar) ###
+
+Sets the menu bar for the main window to `qmenubar`.
+The main window takes ownership of the menu bar and
+deletes it at the appropriate time.
+
+<a name="qmainwindow.setstatusbar"/>
+### qmainwindow:setStatusBar(qstatusbar) ###
+
+Sets the status bar for the main window to `qstatusbar`.
+The main window takes ownership of the status bar and
+deletes it at the appropriate time.
+
+<a name="qmainwindow.statusBar"/>
+### qmainwindow:statusBar() ###
+
+Returns the main window's status bar.
+This function creates and returns an empty status bar
+if the status bar does not exist yet.
+
+
+<a name="qmenu"/>
+## qt.QMenu ##
+
+Qt class
+[QMenu](http://doc.trolltech.com/4.4/qmenu.html)
+provides a menu widget for use in menu bars,
+context menus, and other popup menus.
+This is a subclass of [qt.QWidget](#qwidget).
+
+The most flexible way to populate a menu
+consists of first creating [qt.QAction](#qaction)
+objects for all the menu items.
+These objects can then be inserted
+into the menu using the method `addAction` defined by
+the superclass [QWidget](#qwidget).
+
+Function `qmenu:addLuaAction` provides a more convenient way
+to create menu items bound to specific lua functions.
+See [qt.QMenuBar](#qmenubar) for an example.
+
+<a name="qmenu.addLuaAction"/>
+### qmenu:addLuaAction([icon,]text[,keys[,statustip]][,function]) ###
+
+Creates a new [QtLuaAction](#qaction) owned by the menu
+and appends it to the menu as a new menu item.
+This function returns the newly created action.
+
+ * Argument `icon` is an optional [qt.QIcon](#qicon) for the action.
+ * Argument `text` specifies the text for the menu item.
+ * Argument `keys` can be either a [qt.QKeySequence](#qkeysequence)specifying the menu item shortcut, or a string representing the shortcut key name.
+ * Argument `statustip` is an optional string that is displayed in the statusbar when the menu item is highlighted.
+Finally argument `function` is a Lua function that is
+connected to the action signal `triggered(bool)` and
+therefore is called when the menu item is selected.
+
+<a name="qmenu.addMenu"/>
+### qmenu:addMenu(newqmenu) ###
+
+Adds the menu `newqmenu` as a submenu of the menu `qmenu`
+and returns the corresponding action object.
+
+<a name="qmenu.addMenu"/>
+### qmenu:addMenu([icon,] text) ###
+
+Creates a new submenu with the specified `icon` and `text`
+and adds it into the menu `qmenu`. This function returns
+the new menu as an object of class `qt.QMenu`.
+
+<a name="qmenu.addSeparator"/>
+### qmenu:addSeparator() ###
+
+Adds a separator into the menu
+and returns the corresponding action object.
+
+<a name="qmenu.clear"/>
+### qmenu:clear() ###
+
+Removes all the menu items.
+Actions owned by the menu and not shown
+in any other widget are deleted.
+
+<a name="qmenu.exec"/>
+### qmenu:exec([qpoint[, defaultqaction]]) ###
+
+Pops up the menu `qmenu` at position `qpoint` and returns
+the action object corresponding to the selected menu item.
+This function returns `nil` if no menu item was selected.
+Argument `defaultqaction` specifies which action is located
+below the mouse cursor when the menu is first shown.
+Argument `qpoint` defaults to `qmenu.pos`.
+
+Note that actions added with `qmenu:addLuaAction`
+are automatically disabled while Lua is running.
+Therefore such actions cannot be used with
+`qmenu:exec` because they would all be disabled.
+
+<a name="qmenu.insertMenu"/>
+### qmenu:insertMenu(beforeqaction, newqmenu) ###
+
+Inserts the menu `newqmenu` as a submenu into the menu `qmenu`
+and returns the corresponding action object.
+The submenu is inserted before action `beforeqaction`
+or is appended when `beforeqaction` is null or invalid for this widget.
+
+<a name="qmenu.insertSeparator"/>
+### qmenu:insertSeparator(beforeqaction) ###
+
+Inserts a new separator before action `beforeqaction`
+and returns the corresponding action object.
+
+<a name="qmenu.menuAction"/>
+### qmenu:menuAction() ###
+
+Returns the action associated with the menu `qmenu`.
+
+<a name="qmenubar"/>
+## qt,QMenuBar ##
+
+Qt class
+[QMenuBar](http://doc.trolltech.com/4.4/qmenu.html)
+provides a horizontal menu bar for use in main windows.
+This is a subclass of [qt.QWidget](#qwidget).
+
+Example:
+```lua
+ w === qt.QMainWindow()
+ w:setCentralWidget(...) -- do something smart here
+ menubar === w:menuBar()
+ filemenu === menubar:addMenu("&File")
+ filemenu:addLuaAction("&Open", "Ctrl+O", function() doOpen(w) end)
+ filemenu:addLuaAction("&Close", "Ctrl+W", function() w:close() end)
+ editmenu === menubar:addMenu("&Edit")
+ editmenu:addLuaAction("&Cu&t", "Ctrl+X", function() doCut(w) end)
+ editmenu:addLuaAction("&Copy", "Ctrl+C", function() doCopy(w) end)
+ editmenu:addLuaAction("&Paste", "Ctrl+V", function() doPaste(w) end)
+ w:show()
+```
+
+<a name="qmenubar.addMenu"/>
+### qmenubar:addMenu(qmenu) ###
+
+Adds the menu `qmenu` as a menu of the menubar `qmenubar`
+and returns the corresponding action object.
+
+<a name="qmenubar.addMenu"/>
+### qmenubar:addMenu([icon,] text) ###
+
+Creates a new menu with the specified `icon` and `text`
+and adds it into the menubar `qmenubar`. This function returns
+the new menu as an object of class `qt.QMenu`.
+
+<a name="qmenubar.clear"/>
+### qmenubar:clear() ###
+
+Removes all the menus and actions from the menu bar.
+Actions owned by the menu and not shown
+in any other widget are deleted.
+
+<a name="qmenubar.insertMenu"/>
+### qmenubar:insertMenu(beforeqaction, qmenu) ###
+
+Inserts the menu `qmenu` into the menu bar `qmenubar`
+and returns the corresponding action object.
+The submenu is inserted before action `beforeqaction`
+or is appended when `beforeqaction` is null or invalid for this widget.
+
+<a name="qmenubar.insertSeparator"/>
+### qmenubar:insertSeparator(beforeqaction) ###
+
+Inserts a new separator before action `beforeqaction`
+and returns the corresponding action object.
+
+<a name="qpainterpath"/>
+## qt.QPainterPath ##
+
+Qt class
+[QPainterPath](http://doc.trolltech.com/4.4/qpainterpath.html)
+represents mathematical boundaries delimiting
+regions that can be painted using [painter:fill](..:qtwidget:index#painterfill)
+or delimited using [painter:stroke](..:qtwidget:index#painterstroke).
+No specific Lua methods have been defined for this Qt variant class.
+
+
+<a name="qpixmap"/>
+## qt.QPixmap ##
+
+Qt class
+[QPixmap](http://doc.trolltech.com/4.4/qpixmap.html)
+represents a server-side image containing device-dependent data.
+No specific Lua methods have been defined for this Qt variant class.
+
+
+<a name="qpen"/>
+## qt.QPen ##
+
+Qt class
+[QPen](http://doc.trolltech.com/4.4/qpen.html)
+represents the painter settings that determine how
+lines are drawn.
+
+<a name="qpen"/>
+### qt.QPen(table) ###
+<a name="qpenfromtable"/>
+
+Expression `qt.QPen(table)` returns a pen whose settings
+are determined by the fields of table `table`.
+The following fields are recognized:
+
+ * Field `style` specifies the name of the [pen style](http://doc.trolltech.com/4.4/qt.html#PenStyle-enum). The default style is `SolidLine`.
+
+ * Field `brush` contains a `qt.QBrush` value that defines the appearance of the painted areas.
+
+ * Field `color` contains a `qt.QColor` value for the brush color. Setting this field is equivalent to setting field `brush` with a solid brush of the specified color. Field `brush` has precedence over this field.
+
+ * Numerical field `width` contains the desired line width. A line width of zero indicates a cosmetic pen. This means that the pen width is always drawn one pixel wide, independent of the transformation on the painter.
+
+ * Setting boolean field `cosmetic` to `true` indicates that the pen width has a constant width regardless of the transformation on the painter.
+
+ * Field `style` specifies the name of the [pen style](http://doc.trolltech.com/4.4/qt.html#PenStyle-enum) which determines
+
+ * Field `joinStyle` specifies the name of the [pen join style](http://doc.trolltech.com/4.4/qt.html#PenJoinStyle-enum) which determines how lines meet with different angles. The default join style is `BevelJoin`.
+
+ * Field `capStyle` specifies the name of the [pen cap style](http://doc.trolltech.com/4.4/qt.html#PenCapStyle-enum) which determines how lines end are drawn. The default cap style is `SquareCap`.
+
+ * Numerical field `miterLimit` determines how far a [miter join](http://doc.trolltech.com/4.4/qpen.html#setMiterLimit) can extend from the join point. This is used to reduce artifacts between line joins where the lines are close to parallel.
+
+
+<a name="qpen.totable"/>
+### qpen:totable() ###
+
+Expression `qpen:totable()` returns a table describing the pen.
+See the documentation of [qt.QPen(table)](#qpenfromtable)
+for a description of the table fields.
+
+
+<a name="qtransform"/>
+## qt.QTransform ##
+
+Qt class
+[QTransform](http://doc.trolltech.com/4.4/qtransform.html)
+represents a 2D transformation of a coordinate system.
+Transformation matrices are represented as Qt variants
+of class `qt.QTransform`.
+
+<a name="qtransform"/>
+### qt.QTransform([table[,table]]) ###
+<a name="qtransformfromtable"/>
+
+Expression `qt.QTransform()` constructs an identity transformation matrix.
+
+Expression `qt.QTransform(table)` constructs a transformation matrix
+whose matrix elements are initialized with the fields `m11`, `m12`, `m13`,
+`m21`, `m22`, `m23`, `m31`, `m32`, and `m33` of table `table`.
+
+Expression `qt.QTransform(fquad,tquad)` constructs a transformation matrix
+that maps the quad `fquad` to the quad `tquad`.
+Both arguments `fquad` and `tquad` are table containing exactly four
+[qt.QPointF](..:qtcore:index#qpoint) representing the four corners of the quad.
+
+<a name="qtransform.totable"/>
+### qtransform:totable() ###
+
+Expression `qtransform:totable()` returns a table suitable
+for use with expression [qt.QTransform(table)](#qtransformfromtable).
+
+<a name="qtransform.scaled"/>
+### qtransform:scaled(sx,sy) ###
+
+Function `qtransform:scaled` returns a new transformation matrix
+representing a coordinate system whose axes have been
+scaled by coefficient `sx` and `sy`.
+
+<a name="qtransform.translated"/>
+### qtransform:translated(dx,dy) ###
+
+Function `qtransform:translated` returns a new transformation matrix
+representing a coordinate system whose origin has been
+translated by `dx` units along the X axis and `dy` units along the Y axis.
+
+
+<a name="qtransform.sheared"/>
+### qtransform:sheared(cx,cy) ###
+
+Function `qtransform:sheared` returns a new transformation matrix
+representing a coordinate system that has been sheared using coefficients
+`cx` horizontally and `cy` vertically.
+
+
+<a name="qtransform.rotated"/>
+### qtransform:rotated(angle,[axis,[unit]]) ###
+
+Function `qtransform:rotated` returns a new transformation matrix
+representing a coordinate system rotated by `angle` units around the origin.
+The optional string argument `axis` may be `XAxis`, `YAxis`, or `ZAxis` and
+defaults to `ZAxis`. The optional string argument `unit` may
+be `Degrees` or `Radians`
+and default to `Degrees`.
+
+<a name="qtransform.inverted"/>
+### qtransform:inverted() ###
+
+Function `qtransform:inverted` returns
+the inverse transform of its argument
+or `nil` when it is not invertible.
+
+<a name="qtransform.map"/>
+### qtransform:map(...) ###
+
+Function `qtransform:map` applies
+a transformation to its argument and returns
+a new qvariant of the same type.
+The argument can be a `QPoint`, `QPointF`, `QLine`, `QLineF`,
+`QPolygon`, `QPolygonF`, `QRegion`, `QPainterPath`,
+`QRect`, or `QRectF`. When the argument is a rectangle,
+the function returns the bounding rectangle of the polygon
+representing the transformed rectangle.
+This function also take as argument to reals representing
+the coordinates of a point and return two reals
+representing the transformed coordinates.
+
+<a name="qwidget"/>
+## qt.QWidget ##
+
+Qt class
+[QWidget](http://doc.trolltech.com/4.4/qwidget.html)
+is the base class of all graphical interface components.
+All widgets inherit class `qt.QWidget` and
+its superclass [qt.QObject](..:qtcore:index#qobject).
+
+<a name="qwidget"/>
+### qt.QWidget([parent]) ###
+
+Expression `qt.QWidget(parent)` returns a new widget.
+The optional argument `parent` specifies the widget parent.
+New widgets are always created from the main thread using
+the [thread hopping](..:qt:index#qt.qcall) mechanism.
+
+When argument `parent` is `nil` or not specified,
+the new widget is owned by the Lua interpreter
+and is automatically destroyed when the garbage collector
+determines that it is no longer referenced.
+
+
+<a name="qwidget.actions"/>
+### qwidget:actions() ###
+
+Expression `qwidget:actions()` returns a
+qt value of class [qt.QVariantList](..:qtcore:index#qvariantlist)
+containing list of actions associated with this widget.
+
+<a name="qwidget.addAction"/>
+### qwidget:addAction(qaction) ###
+
+Appends action `qaction` to the
+list of actions associated with this widget.
+
+Example: creating a context menu
+```lua
+ action1 === qt.QtLuaAction{text="Checkme", checkable=true,
+ function(b) print("checked:", b) end}
+ action2 === qt.QtLuaAction{text="Pickme",
+ function() print("picked") end}
+ w:addAction(action1)
+ w:addAction(action2)
+ w.contextMenuPolicy='ActionsContextMenu'
+```
+
+<a name="qwidget.insertAction"/>
+### qwidget:insertAction(beforeqaction, qaction) ###
+
+Insert action ==qaction== into the
+list actions associated with this widget.
+Argument ==beforeqaction== indicates at which position
+to insert the action. If ==beforeqaction== is omitted
+or invalid, the action is simply appended.
+
+<a name="qwidget.mapToGlobal"/>
+### qwidget:mapToGlobal(qpoint) ###
+
+Translates the widget coordinates `qpoint` to global screen coordinates.
+Both argument `qpoint` and the return value are Qt value of class
+[qt.QPoint](..:qtcore:index#qpoint).
+
+<a name="qwidget.mapFromGlobal"/>
+### qwidget:mapFromGlobal(qpoint) ###
+
+Translates the global screen coordinates `qpoint` to widget coordinates.
+Both argument `qpoint` and the return value are Qt value of class
+[qt.QPoint](..:qtcore:index#qpoint).
+
+
+<a name="qwidget.removeAction"/>
+### qwidget:removeAction(qaction) ###
+
+Removes action `qaction` from the
+list actions associated with this widget.
+
+
+<a name="qwidget.render"/>
+### qwidget:render([pointer]) ###
+
+When called without argument,
+this function draws the widget into an image
+and returns the image.
+
+The optional argument `pointer` can be a
+pointer to a `QPainter` or a `QPaintDevice`
+where the widget should be rendered.
+Such pointers can be obtained using functions
+[painter:painter](..:qtwidget:index#painterpainter) or
+[painter:device](..:qtwidget:index#painterdevice).
+When such an argument is specified,
+nothing is returned.
+
+<a name="qwidget.setAttribute"/>
+### qwidget:setAttribute(widgetattribute,[value]) ###
+
+Sets the specified
+[widget attribute](http://doc.trolltech.com/4.4/qt.html#WidgetAttribute-enum)
+to boolean value `value`.
+Some of these flags are used internally by Qt.
+Care is required.
+
+<a name="qwidget.setWindowFlag"/>
+### qwidget:setWindowFlag(windowflag,[value]) ###
+
+Sets the specified
+[window flag](http://doc.trolltech.com/4.4/qt.html#WindowType-enum)
+to boolean value `value`.
+Flags indicating a window type
+are handled as exclusive flags.
+Setting these flags usually hides the window.
+You need to do call `qwidget:show` again.
+
+<a name="qwidget.testAttribute"/>
+### qwidget:testAttribute(widgetattribute) ###
+
+Returns a boolean indicating the value of the specified
+[widget attribute](http://doc.trolltech.com/4.4/qt.html#WidgetAttribute-enum).
+Flags indicating a window type
+are handled as exclusive flags.
+
+<a name="qwidget.testWindowFlag"/>
+### qwidget:testWindowFlag(windowflag) ###
+
+Returns a boolean indicating the value of the specified
+[window flag](http://doc.trolltech.com/4.4/qt.html#WindowType-enum).
+Flags indicating a window type
+are handled as exclusive flags.
+
+<a name="qwidget.window"/>
+### qwidget:window() ###
+
+Expression `qwidget:window()` returns the window for widget `qwidget`,
+that is the next ancestor that is (or could be) displayed
+with a window frame.
+
+For instance the following code changes the
+title of the window containing widget `qwidget`.
+```lua
+ qwidget:window().windowTitle "New Title"
+```
+
+
+
+
diff --git a/packages/qtgui/dok/index.dok b/packages/qtgui/dok/index.dok
deleted file mode 100644
index 214c8de..0000000
--- a/packages/qtgui/dok/index.dok
+++ /dev/null
@@ -1,1191 +0,0 @@
-====== QtGui Bindings ======
-{{anchor:qtgui.dok}}
-
-The package ''qtgui''
-contains bindings for classes defined by the Qt module
-[[http://doc.trolltech.com/4.4/qtcore.html|QtGui]].
-
-Besides the capabilites reported below, all qt variants inherit a set
-of [[..:qt:index#qt.QVariants|default methods]], and all qt object
-classes inherit the capabilities from their superclasses and
-automatically expose [[..:qt:index#qt.QObjects|properties, slots and
-signals]].
-
-
-===== qt.QAction, qt.QtLuaAction =====
-{{anchor:qaction}}
-{{anchor:qtluaaction}}
-
-Qt class
-[[http://doc.trolltech.com/4.4/qaction.html|QAction]]
-is a sublass of [[..:qtcore:index#qt.qobject|qt.QObject]]
-that represents actions associated with menu items
-and toolbar icons.
-
-
-==== qt.QAction([arg]) ====
-{{anchor:qaction}}
-
-Expression ''qt.QAction([arg])'' returns a new ''QAction'' object.
-The optional argument ''arg'' can be a qt object that
-becomes the action parent or a table whose
-members contain initial values for the action properties.
-This table can also contain a function value
-which is then connected to the signal ''triggered(bool)''
-of the qt action object.
-
-Example:
-<file lua>
- a === qt.QAction { text="Automatic Mode",
- checkable === true, checked === false,
- function(b) setAutoMode(b) end }
-</file>
-
-Unless a parent is specified, the action is owned
-by the Lua interpreter and therefore is automatically
-destroyed when the garbage collector determines that
-it is no longer referenced.
-
-Actions are always created from the main thread using
-the [[..:qt:index#qt.qcall|thread hopping]] mechanism.
-
-==== qaction:menu() ====
-{{anchor:qaction.menu}}
-
-Same as the C++ function ''QAction::menu()''.
-
-==== qaction:setMenu() ====
-{{anchor:qaction.setmenu}}
-
-
-Same as the C++ function ''QAction::setMenu()''.
-
-==== qt.QtLuaAction([arg]) ====
-{{anchor:qtluaaction}}
-
-This constructor takes the same arguments as ''qt.QAction''
-but returns an instance of a convenient subclass
-that enables or disables the action according
-to the availability of the Lua engine.
-
-The action follows its property ''enabled''
-when the Lua engine is ready to invoke Lua
-functions connected to Qt signals.
-Otherwise the action is disabled regardless
-of the value of property ''enabled''.
-
-==== qtluaaction.autoDisable ====
-{{anchor:qtluaaction.autodisable}}
-
-This property applies only to action objects of class ''qt.QtLuaAction''.
-It controls whether the action is automatically disabled
-when the Lua engine is not available.
-The default is ''true''.
-
-
-===== qt.QApplication =====
-{{anchor:qapplication}}
-
-Qt class [[http://doc.trolltech.com/4.4/qapplication.html|QApplication]]
-manages the GUI application's control flow and main settings. This is a
-subclass of [[..:qtcore:index#qcoreapplication|QCoreApplication]].
-
-==== qt.QApplication.changeOverrideCursor(qcursor) ====
-{{anchor:qapplication.changeOverrideCursor}}
-
-Changes the currently active application override cursor to cursor
-without disturbing the cursor stack. This function has no
-effect if ''setOverrideCursor()'' was not called.
-
-==== qt.QApplication.keyboardModifiers() ====
-{{anchor:qapplication.keyboardModifiers}}
-
-Returns a string describing the currently depressed keyboard modifiers.
-
-==== qt.QApplication.mouseButtons() ====
-{{anchor:qapplication.mouseButtons}}
-
-Returns a string describing the currently depressed mouse buttons.
-
-==== qt.QApplication.overrideCursor() ====
-{{anchor:qapplication.overrideCursor}}
-
-Returns the active application override cursor.
-This function returns ''nil'' if no application cursor
-has been defined (i.e. the internal cursor stack is empty).
-
-==== qt.QApplication.restoreOverrideCursor() ====
-{{anchor:qapplication.restoreOverrideCursor}}
-
-Undoes the last ''setOverrideCursor()''.
-
-==== qt.QApplication.setOverrideCursor(qcursor) ====
-{{anchor:qapplication.setoverridecursor}}
-
-Sets the application override cursor to ''qcursor''.
-Application override cursors are intended for showing the user that
-the application is in a special state, for example during an operation that might take some time.
-Override cursors are stored on a stack. Function ''setOverrideCursor()'' pushes a cursor on the stack.
-Function ''restoreOverrideCursor()'' pops the stack.
-
-
-===== qt.QBrush =====
-{{anchor:qbrush}}
-
-Qt class
-[[http://doc.trolltech.com/4.4/qbrush.html|QBrush]]
-represents the painter settings that determine how shape
-are filled and how text is rendered. Brushes are represented
-by Qt variants of class ''qt.QBrush''.
-
-
-==== qt.QBrush(table) ====
-{{anchor:qbrush}}
-{{anchor:qbrushfromtable}}
-
-Expression ''qt.QBrush(table)'' returns a brush whose settings
-are determined by the fields of table ''table''.
-The following fields are recognized:
-
- * Field ''color'' contains a [[#qcolor|qt.QColor]] value representing the brush color.
-
- * Field ''texture'' contains a [[#qimage|qt.QImage]] value representing the brush texture.
-
- * Field ''gradient'' contains a [[#qgradient|qt.QGradient]] value representing a color gradient.
-
- * Field ''transform'' contains a ''qt.QTransform'' value that defines a additional transformation applied to the brush before painting it into the current coordinate system.
-
- * Field ''style'' contains the name of the [[http://doc.trolltech.com/4.4/qt.html#BrushStyle-enum|brush style]]. The default brush style is ''SolidPatter'' when field ''color'' is defined, ''TexturePattern'' when field ''texture'' is defined, or one of the gradient styles when field ''gradient'' is defined. Otherwise the default style is ''NoBrush'' meaning that nothing is painted.
-
-
-==== qbrush:totable() ====
-{{anchor:qbrush.totable}}
-
-Expression ''qbrush:totable()'' returns a table describing the brush.
-See the documentation of [[#qbrushfromtable|qt.QBrush(table)]]
-for a description of the table fields.
-
-
-===== qt.QColor =====
-{{anchor:qcolor}}
-
-Qt class
-[[http://doc.trolltech.com/4.4/qcolor.html|QColor]]
-represents colors for painting purposes.
-Qt variant of class ''qt.QColor'' have a textual representation
-of the form =="#RRGGBB" where letters ''R'', ''G'', or ''B'' are
-hexadecimal digits representing the intensities of the
-color components.
-
-
-==== qt.QColor(...) ====
-{{anchor:qcolor}}
-
-There are several ways to construct a Qt variant of class ''qt.QColor''.
-
-**''qt.QColor(r,g,b,[a])''**
-
-Arguments ''r'', ''g'', ''b'', and ''a'' are numbers in range ''[0,1]''
-representing the intensities of the red, green, blue, and alpha channels.
-The default value for argument ''a'' is ''1'' for a fully opaque color.
-
-** ''qt.QColor(string)'' **
-
-Argument ''string'' is a string representing a color name.
-All [[http://www.w3.org/TR/SVG/types.html#ColorKeywords|SVG color names]]
-are recognized.Color names can have also the format ''"#RGB"'',
-''"#RRGGBB"'', ''"#RRRGGGBBB"'', or =="#RRRRGGGGBBBB"
-where letters ''R'', ''G'', or ''B'' represent hexadecimal
-digits for each of the color component.
-
-** ''qt.QColor(table)'' **
-
-Argument ''table'' is a table whose fields ''r'', ''g'', ''b'' and ''a''
-contain numbers in range ''[0,1]'' representing the intensities
-of the red, green, blue, and alpha channels. Such a table
-is returned by function [[#qcolortotable|qcolor:totable()]].
-
-==== qcolor:totable() ====
-{{anchor:qcolor.totable}}
-{{anchor:qcolortotable}}
-
-Expression ''qcolor:totable()'' returns a table whose fields
-''r'', ''g'', ''b'' and ''a'' contain numbers in range ''[0,1]''
-representing the intensities of the red, green, blue,
-and alpha channels.
-
-
-===== qt.QColorDialog =====
-{{anchor:qcolordialog}}
-
-Qt class
-[[http://doc.trolltech.com/4.4/qcolordialog.html|QColorDialog]]
-implements a dialog for selecting colors.
-The recommended way to use this class is the static function ''getColor''.
-
-==== qt.QColorDialog.getColor([font],[parent]) ====
-{{anchor:qcolordialog.getcolor}}
-
-Pops up a dialog for selecting a color.
-Optional argument ''color'' is the initial color selection.
-Argument ''parent'' is the parent widget.
-This function returns ''nil'' if the no color was selected.
-Otherwise it returns a qvariant of type [[#qcolor|qt.QColor]].
-
-===== qt.QCursor =====
-{{anchor:qcursor}}
-
-Qt class
-[[http://doc.trolltech.com/4.4/qcursor.html|QCursor]]
-provides a mouse cursor with an arbitrary shape.
-
-==== qt.QCursor(cursorshape) ====
-{{anchor:qcursor}}
-
-Returns a standard cursor.
-Argument ''cursorshape'' is the name of a
-[[http://doc.trolltech.com/4.4/qt.html#CursorShape-enum|standard shape]].
-
-==== qt.QCursor(image,[mask],[posx,[posy]) ====
-{{anchor:qcursor}}
-
-Constructs a cursor with the specified image, mask and hot spot.
-
-==== qcursor:hotSpot() ====
-{{anchor:qcursor.hotSpot}}
-
-Return a ''qt.QPoint'' with the cursor's hot spot coordinates.
-
-==== qcursor:mask() ====
-{{anchor:qcursor.mask}}
-
-Return the cursor's mask.
-
-==== qcursor:pixmap() ====
-{{anchor:qcursor.pixmap}}
-
-Return the cursor's pixmap.
-
-==== qcursor:shape() ====
-{{anchor:qcursor.shape}}
-
-Return the name of the cursor's
-[[http://doc.trolltech.com/4.4/qt.html#CursorShape-enum|standard shape]].
-
-==== qt.QCursor.pos() ====
-{{anchor:qcursor.pos}}
-
-Returns a ''QPoint'' with the global coordinates of the mouse cursor.
-
-==== qt.QCursor.setPos(qpoint) ====
-{{anchor:qcursor.setPos}}
-
-Sets the global coordinates of the mouse cursor.
-
-===== qt.QDialog =====
-{{anchor:qdialog}}
-
-Qt class
-[[http://doc.trolltech.com/4.4/qdialog.html|QDialog]]
-is the base class of dialog windows.
-
-==== qt.QDialog([parent]) ====
-{{anchor:qdialog}}
-
-Expression ''qt.QDialog(parent)'' returns a new ''QDialog'' instance.
-The optional argument ''parent'' specifies the widget parent.
-When argument ''parent'' is ''nil'' or not specified,
-the new widget is owned by the Lua interpreter
-and is automatically destroyed when the garbage collector
-determines that it is no longer referenced.
-
-==== qdialog:result() ====
-{{anchor:qdialog.result}}
-
-Gets the dialog's result code as an integer.
-This is usually ''1'' when the dialog has been accepted
-and ''0'' when the dialog has been rejected.
-
-==== qdialog:setResult(integer) ====
-{{anchor:qdialog.setresult}}
-
-Sets the dialog's result code.
-This is usually ''1'' when the dialog has been accepted
-and ''0'' when the dialog has been rejected.
-
-
-===== qt.QFileDialog =====
-{{anchor:qfiledialog}}
-
-Qt class
-[[http://doc.trolltech.com/4.4/qfiledialog.html|QFileDialog]]
-provides a dialog that allow users to select files or directories.
-This is a subclass of [[#qdialog|qt.QDialog]].
-
-==== qt.QFileDialog.getExistingDirectory([p.[c,[d,[opt]]]]) ====
-{{anchor:qfiledialog.getExistingDirectory}}
-
-This convenience function shows a file dialog
-for selecting an existing directory.
-Argument ''p'' is the parent widget.
-Argument ''c'' is the dialog caption.
-Argument ''d'' is the initial directory shown in the dialog.
-Argument ''opt'' are the [[http://doc.trolltech.com/4.4/qfiledialog.html#Option-enum|file dialog options]].
-
-The function returns a ''qt.QString'' containing the selected directory name.
-
-==== qt.QFileDialog.getOpenFileName([p,[c,[d,[f,[s,[opt]]]]]]) ====
-{{anchor:qfiledialog.getOpenFileName}}
-
-This convenience function shows a file dialog
-for selecting an existing file.
- * Argument ''p'' is the parent widget.
- * Argument ''c'' is the dialog caption.
- * Argument ''d'' is the initial directory shown in the dialog.
- * Argument ''f'' contains the filters separated by double semicolons.
- * Argument ''s'' contains the selected filter
- * Argument ''opt'' are the [[http://doc.trolltech.com/4.4/qfiledialog.html#Option-enum|file dialog options]].
-
-The function returns a ''qt.QString'' containing the selected file name
-and a ''qt.QString'' contaning the selected filter.
-
-==== qt.QFileDialog.getOpenFileNames([p,[c,[d,[f,[s,[opt]]]]]]) ====
-{{anchor:qfiledialog.getOpenFileNames}}
-
-This convenience function shows a file dialog
-for selecting multiple existing files.
- * Argument ''p'' is the parent widget.
- * Argument ''c'' is the dialog caption.
- * Argument ''d'' is the initial directory shown in the dialog.
- * Argument ''f'' contains the filters separated by double semicolons.
- * Argument ''s'' contains the selected filter
- * Argument ''opt'' are the [[http://doc.trolltech.com/4.4/qfiledialog.html#Option-enum|file dialog options]].
-
-The function returns a ''qt.QStringList'' containing the file names
-and a ''qt.QString'' contaning the selected filter.
-
-==== qt.QFileDialog.getSaveFileName([p,[c,[d,[f,[s,[opt]]]]]]) ====
-{{anchor:qfiledialog.getsavefilename}}
-
-This convenience function shows a file dialog
-for selecting a file name for saving data.
- * Argument ''p'' is the parent widget.
- * Argument ''c'' is the dialog caption.
- * Argument ''d'' is the initial directory shown in the dialog.
- * Argument ''f'' contains the filters separated by double semicolons.
- * Argument ''s'' contains the selected filter
- * Argument ''opt'' are the [[http://doc.trolltech.com/4.4/qfiledialog.html#Option-enum|file dialog options]].
-
-The function returns a ''qt.QString'' containing the selected file name
-and a ''qt.QString'' contaning the selected filter.
-
-==== qt.QFileDialog.new([parent.[caption,[dir,[filters]]]]) ====
-{{anchor:qfiledialog.new}}
-
-Function ''qt.QFileDialog.new'' returns a new file dialog object.
- * Argument ''parent'' is the parent widget
- * Argument ''caption'' is the dialog caption.
- * Argument ''dir'' is the initial directory shown in the dialog.
- * Argument ''filters'' contains the filters separated by double semicolons.
-
-When argument ''parent'' is ''nil'' or not specified,
-the new widget is owned by the Lua interpreter
-and is automatically destroyed when the garbage collector
-determines that it is no longer referenced.
-
-==== qfiledialog:directory() ====
-{{anchor:qfiledialog.directory}}
-
-Returns a ''qt.QString'' containing the path of the selected directory.
-
-==== qfiledialog:nameFilters() ====
-{{anchor:qfiledialog.nameFilters}}
-
-Returns a ''qt.QStringList'' containing the name filters.
-
-==== qfiledialog:selectedFiles() ====
-{{anchor:qfiledialog.selectedFiles}}
-
-Returns a ''qt.QStringList'' containing the selected files.
-
-==== qfiledialog:selectFile(fname) ====
-{{anchor:qfiledialog.selectFile}}
-
-Select file ''fname'' in the file dialog.
-
-==== qfiledialog:selectNameFilter(filter) ====
-{{anchor:qfiledialog.selectNameFilter}}
-
-Select name filter ''filter'' in the file dialog.
-
-==== qfiledialog:setDirectory(dirname) ====
-{{anchor:qfiledialog.setDirectory}}
-
-Set the file dialog directory to ''dirname''.
-
-==== qfiledialog:setNameFilters(filters) ====
-{{anchor:qfiledialog.setNameFilters}}
-
-Set the file dialog name filters to ''filters''.
-Argument ''filters'' may be a ''qt.QStringList''
-or a string containing the filters separated by
-two semicolons ''";;"''.
-
-==== qfiledialog:setOption(option, bool) ====
-{{anchor:qfiledialog.setOption}}
-
-Sets the specified
-[[http://doc.trolltech.com/4.5/qfiledialog.html#Option-enum|file dialog option]]
-to the boolean value ''bool''. Not available before Qt-4.5.
-
-==== qfiledialog:testOption(option) ====
-
-Returns the value of the specified
-[[http://doc.trolltech.com/4.5/qfiledialog.html#Option-enum|file dialog option]].
-Not available before Qt-4.5.
-
-===== qt.QFont =====
-{{anchor:qfont}}
-
-Qt class
-[[http://doc.trolltech.com/4.4/qfont.html|QFont]]
-represents the painter settings that determine the font(s)
-used to display text.
-
-
-==== qt.QFont(arg) ====
-{{anchor:qfont}}
-{{anchor:qfontfromtable}}
-
-Expression ''qt.QFont(arg)'' returns a new font object.
-Argument ''arg'' may be a string previously returned
-by [[#qfonttostring|qfont:tostring()]] or
-a table whose fields specify the desired font characteristics.
-The following fields are recognized, listed in order of priority:
-
- * String field ''family'' may contain a comma separated list of the desired font families.
-
- * Setting boolean field ''sans'' to ''true'' indicates a preference for sans serif font families such as "Helvetica". This is more portable than specifying a family.
-
- * Setting boolean field ''serif'' to ''true'' indicates a preference for serif font families such as "Times". This is more portable than specifying a family.
-
- * Setting boolean field ''typewriter'' to ''true'' indicates a preference for a fixed width font families such as "Courier". This is more portable than specifying a family.
-
- * Numerical field ''size'' specify the desired size of the font. The default size is 10 points.
-
- * Numerical fields ''pixelSize'' and ''pointSize'' also indicates the desired size of the font. Field ''pixelSize'' is an alias for ''size''. Field ''pointSize'' includes a correction factor corresponding to the actual resolution of the target device. When both are precised, ''pointSize'' takes precedence.
-
- * Numerical field ''weight'' defines the weight of the font. Weight 50 corresponds to a normal font and weight 75 corresponds to a bold font.
-
- * Numerical field ''stretch'' is a percentage applied to the width of all characters. Value 100 corresponds to a normal width. Value 150 increases all width by 50 percent.
-
- * Setting boolean field ''bold'' to ''true'' requests a bold font if the selected font family defines a bold variant.
-
- * Setting boolean field ''italic'' to ''true'' requests and italic font if the selected font family defines an italic or oblique variant.
-
- * Setting boolean field ''fixedPitch'' to ''true'' requests a fixed pitch font if the selected font family defines such a variant (rare).
-
- * Setting boolean field ''underline'' to ''true'' draws a line below all the character at a font-specified position.
-
- * Setting boolean field ''overline'' to ''true'' draws a line above all the character at a font-specified position.
-
- * Setting boolean field ''strikeOut'' to ''true'' draws a line that crosses the character at a font-specified position.
-
-Example:
-<file lua>
- 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")
-</file>
-
-
-==== qfont:totable() ====
-{{anchor:qfont.totable}}
-
-Expression ''qfont:totable()'' returns a table
-suitable for use with [[#qfontfromtable|qt.QFont(table)]].
-All the supported fields are populated.
-
-Example:
-<file lua>
- require 'qtwidget'
- f=qt.QFont{serif=true,size=12,bold=true}
- for k,v in pairs(f:totable()) do print(k,v) end
-</file>
-
-==== qfont:tostring() ====
-{{anchor:qfonttostring}}
-{{anchor:qfont.tostring}}
-
-Expression ''qfont:tostring()'' returns a string
-representation of the font settings that is
-suitable for storing in configuration files for instance.
-Use [[#qfontfromtable|qt.QFont(string)]] to
-reconstruct the corresponding font object.
-
-==== qfont:info() ====
-{{anchor:qfontinfo}}
-{{anchor:qfont.info}}
-
-Expression ''qfont:info()'' returns a table describing
-the actual font selected by the font matching algorithm
-when one uses ''qfont'' to display text on the screen.
-This table can be used as argument to
-function [[#qfontfromtable|qt.QFont()]]
-as it uses the same keys.
-This is achieved using the Qt class
-[[http://doc.trolltech.com/4.4/qfontinfo.html|QFontInfo]].
-Fields ''"underline"'', ''"overline"'', ''"strikeOut"'', and ''"stretch"''
-are copied verbatim from the ''qfont'' object.
-
-===== qt.QFontDialog =====
-{{anchor:qfontdialog}}
-
-Qt class
-[[http://doc.trolltech.com/4.4/qfontdialog.html|QFontDialog]]
-implements a dialog for selecting fonts.
-The recommended way to use this class is the static function ''getFont''.
-
-==== qt.QFontDialog.getFont([font],[parent, [caption]]) ====
-{{anchor:qfontdialog.getfont}}
-
-Pops up a dialog for selecting a font.
-All arguments are optional.
-Argument ''font'' is the initial font selection.
-Argument ''parent'' is the parent widget.
-Argument ''caption'' is the dialog window title.
-This function returns ''nil'' if the no font was selected.
-Otherwise it returns a qvariant of type [[#qfont|qt.QFont]].
-
-
-===== qt.QGradient =====
-{{anchor:qgradient}}
-
-Qt class
-[[http://doc.trolltech.com/4.4/qgradient.html|QGradient]]
-represents a color gradient for use in [[#qbrush|gradient brushes]].
-No specific Lua methods have been defined for this Qt variant class.
-
-
-===== qt.QIcon =====
-{{anchor:qicon}}
-
-Qt class
-[[http://doc.trolltech.com/4.4/qimage.html|QIcon]]
-provides scalable icons in different modes and states.
-
-==== qt.QIcon([arg]) ====
-{{anchor:qicon}}
-
-Returns a new icon.
-Argument ''arg'' can be a qt value of
-type [[#qimage|qt.QImage]]
-or [[#qpixmap|qt.QPixmap]].
-Alternatively, argument ''arg'' may be a
-file name that will be loaded on demand.
-
-
-===== qt.QImage =====
-{{anchor:qimage}}
-
-Qt class
-[[http://doc.trolltech.com/4.4/qimage.html|QImage]]
-represents a device independent off-screen image.
-Such images are represented in Lua
-as Qt variants of class ''qt.QImage''.
-
-==== qt.QImage(...) ====
-{{anchor:qimage}}
-
-There are several ways to construct a Qt variant of class ''qt.QImage''.
-
-** ''qt.QImage(w,h,monoflag)'' **
-
-Returns a new image of width ''w'' and height ''h''.
-The image is bitonal when the optional boolean flag ''monoflag''
-is ''true''. Otherwise the image is a 32 bits RGBA image.
-
-** ''qt.QImage(f,format)'' **
-
-Returns a new image obtained by reading the image file ''f''.
-Argument ''f'' can be a file name or a Lua file descriptor.
-The [[#qimageformats|file format]] is determined
-by the optional string ''format'' or by the file name extension.
-
-
-==== qimage:depth() ====
-{{anchor:qimage.depth}}
-
-Expression ''qimage:depth()'' returns the depth of the image ''qimage''.
-A depth of 1 indicates a bitonal image.
-A depth of 24 or 32 indicates a true color image.
-
-==== qimage:rect() ====
-{{anchor:qimage.rect}}
-
-Expression ''qimage:rect()'' returns a Qt variant of class
-[[..:qtcore:index#qrect|qt.QRect]] representing the
-boundaries of the image ''qimage''.
-
-==== qimage:save(f,[format]) ====
-{{anchor:qimage.save}}
-
-Expression ''qimage:save(f,format)'' saves the image data into file ''f''.
-Argument ''f'' can be a file name or a Lua file descriptor.
-The [[#qimageformats|file format]] is determined by the
-optional string ''format'' or by the file name extension.
-
-==== qimage:size() ====
-{{anchor:qimage.size}}
-
-Expression ''qimage:size()'' returns a Qt variant of class
-[[..:qtcore:index#qsize|qt.QSize]] representing the
-size of the image ''qimage''.
-
-==== qt.QImage.formats([string]) ====
-{{anchor:qimage.formats}}
-{{anchor:qimageformats}}
-
-Function ''qt.QImage.formats'' describes the
-supported formats for reading or saving files.
-The optional ''string'' argument must be a string
-starting with letter ''"r"'' or ''"w"'' to indicate if
-one is interested in the supported formats for reading or
-writing image files. When this letter is followed by letter ''"f"'',
-the function returns a string suitable for selecting name
-filters in a file dialog. Otherwise, the function
-returns a ''qt.QStringList'' with the supported formats.
-
-
-
-===== qt.QKeySequence =====
-{{anchor:qkeysequence}}
-
-Qt class
-[[http://doc.trolltech.com/4.4/qkeysequence.html|QKeySequence]]
-encapsulates a key sequence as used by shortcuts.
-
-==== qt.QKeySequence(string) ====
-{{anchor:qkeysequence}}
-
-Returns a Qt value of class ''qt.QKeySequence''
-associated with the key combination described in string ''string''.
-Up to four key codes may be entered by separating
-them with commas, e.g. ''"Alt+V,Ctrl+Down,A,Shift+Home"''.
-
-==== qkeysequence:tostring() ====
-{{anchor:qkeysequence.tostring}}
-
-Returns a string describing the keys in the key sequence.
-
-
-===== qt.QMainWindow =====
-{{anchor:qmainwindow}}
-
-Qt class
-[[http://doc.trolltech.com/4.4/qmainwindow.html|QMainWindow]]
-provides a main application window with menu, statusbar, toolbars
-and dockable widgets. This is a subclass of [[#qwidget|QWidget]].
-
-==== qt.QMainWindow([parent]) ====
-{{anchor:qmainwindow}}
-
-Expression ''qt.QMainWindow(parent)'' returns a new ''QMainWindow'' instance.
-The optional argument ''parent'' specifies the widget parent.
-When argument ''parent'' is ''nil'' or not specified,
-the new widget is owned by the Lua interpreter
-and is automatically destroyed when the garbage collector
-determines that it is no longer referenced.
-
-==== qmainwindow:centralWidget() ====
-{{anchor:qmainwindow.centralWidget}}
-
-Expression ''qmainwindow:centralWidget()'' returns the
-central widget managed by the main window.
-
-==== qmainwindow:menuBar() ====
-{{anchor:qmainwindow.menuBar}}
-
-Returns the main window's menu bar.
-This function creates and returns an empty menu bar
-if the menu bar does not exist yet.
-
-==== qmainwindow:setCentralWidget(qwidget) ====
-{{anchor:qmainwindow.setcentralwidget}}
-
-Sets the widget ''qwidget'' to be the main window's central widget.
-The main window takes ownership of the widget pointer and
-deletes it at the appropriate time.
-
-==== qmainwindow:setMenuBar(qmenubar) ====
-{{anchor:qmainwindow.setmenubar}}
-
-Sets the menu bar for the main window to ''qmenubar''.
-The main window takes ownership of the menu bar and
-deletes it at the appropriate time.
-
-==== qmainwindow:setStatusBar(qstatusbar) ====
-{{anchor:qmainwindow.setstatusbar}}
-
-Sets the status bar for the main window to ''qstatusbar''.
-The main window takes ownership of the status bar and
-deletes it at the appropriate time.
-
-==== qmainwindow:statusBar() ====
-{{anchor:qmainwindow.statusBar}}
-
-Returns the main window's status bar.
-This function creates and returns an empty status bar
-if the status bar does not exist yet.
-
-
-===== qt.QMenu =====
-{{anchor:qmenu}}
-
-Qt class
-[[http://doc.trolltech.com/4.4/qmenu.html|QMenu]]
-provides a menu widget for use in menu bars,
-context menus, and other popup menus.
-This is a subclass of [[#qwidget|qt.QWidget]].
-
-The most flexible way to populate a menu
-consists of first creating [[#qaction|qt.QAction]]
-objects for all the menu items.
-These objects can then be inserted
-into the menu using the method ''addAction'' defined by
-the superclass [[#qwidget|QWidget]].
-
-Function ''qmenu:addLuaAction'' provides a more convenient way
-to create menu items bound to specific lua functions.
-See [[#qmenubar|qt.QMenuBar]] for an example.
-
-==== qmenu:addLuaAction([icon,]text[,keys[,statustip]][,function]) ====
-{{anchor:qmenu.addLuaAction}}
-
-Creates a new [[#qaction|QtLuaAction]] owned by the menu
-and appends it to the menu as a new menu item.
-This function returns the newly created action.
-
- * Argument ''icon'' is an optional [[#qicon|qt.QIcon]] for the action.
- * Argument ''text'' specifies the text for the menu item.
- * Argument ''keys'' can be either a [[#qkeysequence|qt.QKeySequence]]specifying the menu item shortcut, or a string representing the shortcut key name.
- * Argument ''statustip'' is an optional string that is displayed in the statusbar when the menu item is highlighted.
-Finally argument ''function'' is a Lua function that is
-connected to the action signal ''triggered(bool)'' and
-therefore is called when the menu item is selected.
-
-==== qmenu:addMenu(newqmenu) ====
-{{anchor:qmenu.addMenu}}
-
-Adds the menu ''newqmenu'' as a submenu of the menu ''qmenu''
-and returns the corresponding action object.
-
-==== qmenu:addMenu([icon,] text) ====
-{{anchor:qmenu.addMenu}}
-
-Creates a new submenu with the specified ''icon'' and ''text''
-and adds it into the menu ''qmenu''. This function returns
-the new menu as an object of class ''qt.QMenu''.
-
-==== qmenu:addSeparator() ====
-{{anchor:qmenu.addSeparator}}
-
-Adds a separator into the menu
-and returns the corresponding action object.
-
-==== qmenu:clear() ====
-{{anchor:qmenu.clear}}
-
-Removes all the menu items.
-Actions owned by the menu and not shown
-in any other widget are deleted.
-
-==== qmenu:exec([qpoint[, defaultqaction]]) ====
-{{anchor:qmenu.exec}}
-
-Pops up the menu ''qmenu'' at position ''qpoint'' and returns
-the action object corresponding to the selected menu item.
-This function returns ''nil'' if no menu item was selected.
-Argument ''defaultqaction'' specifies which action is located
-below the mouse cursor when the menu is first shown.
-Argument ''qpoint'' defaults to ''qmenu.pos''.
-
-Note that actions added with ''qmenu:addLuaAction''
-are automatically disabled while Lua is running.
-Therefore such actions cannot be used with
-''qmenu:exec'' because they would all be disabled.
-
-==== qmenu:insertMenu(beforeqaction, newqmenu) ====
-{{anchor:qmenu.insertMenu}}
-
-Inserts the menu ''newqmenu'' as a submenu into the menu ''qmenu''
-and returns the corresponding action object.
-The submenu is inserted before action ''beforeqaction''
-or is appended when ''beforeqaction'' is null or invalid for this widget.
-
-==== qmenu:insertSeparator(beforeqaction) ====
-{{anchor:qmenu.insertSeparator}}
-
-Inserts a new separator before action ''beforeqaction''
-and returns the corresponding action object.
-
-==== qmenu:menuAction() ====
-{{anchor:qmenu.menuAction}}
-
-Returns the action associated with the menu ''qmenu''.
-
-===== qt,QMenuBar =====
-{{anchor:qmenubar}}
-
-Qt class
-[[http://doc.trolltech.com/4.4/qmenu.html|QMenuBar]]
-provides a horizontal menu bar for use in main windows.
-This is a subclass of [[#qwidget|qt.QWidget]].
-
-Example:
-<file lua>
- w === qt.QMainWindow()
- w:setCentralWidget(...) -- do something smart here
- menubar === w:menuBar()
- filemenu === menubar:addMenu("&File")
- filemenu:addLuaAction("&Open", "Ctrl+O", function() doOpen(w) end)
- filemenu:addLuaAction("&Close", "Ctrl+W", function() w:close() end)
- editmenu === menubar:addMenu("&Edit")
- editmenu:addLuaAction("&Cu&t", "Ctrl+X", function() doCut(w) end)
- editmenu:addLuaAction("&Copy", "Ctrl+C", function() doCopy(w) end)
- editmenu:addLuaAction("&Paste", "Ctrl+V", function() doPaste(w) end)
- w:show()
-</file>
-
-==== qmenubar:addMenu(qmenu) ====
-{{anchor:qmenubar.addMenu}}
-
-Adds the menu ''qmenu'' as a menu of the menubar ''qmenubar''
-and returns the corresponding action object.
-
-==== qmenubar:addMenu([icon,] text) ====
-{{anchor:qmenubar.addMenu}}
-
-Creates a new menu with the specified ''icon'' and ''text''
-and adds it into the menubar ''qmenubar''. This function returns
-the new menu as an object of class ''qt.QMenu''.
-
-==== qmenubar:clear() ====
-{{anchor:qmenubar.clear}}
-
-Removes all the menus and actions from the menu bar.
-Actions owned by the menu and not shown
-in any other widget are deleted.
-
-==== qmenubar:insertMenu(beforeqaction, qmenu) ====
-{{anchor:qmenubar.insertMenu}}
-
-Inserts the menu ''qmenu'' into the menu bar ''qmenubar''
-and returns the corresponding action object.
-The submenu is inserted before action ''beforeqaction''
-or is appended when ''beforeqaction'' is null or invalid for this widget.
-
-==== qmenubar:insertSeparator(beforeqaction) ====
-{{anchor:qmenubar.insertSeparator}}
-
-Inserts a new separator before action ''beforeqaction''
-and returns the corresponding action object.
-
-===== qt.QPainterPath =====
-{{anchor:qpainterpath}}
-
-Qt class
-[[http://doc.trolltech.com/4.4/qpainterpath.html|QPainterPath]]
-represents mathematical boundaries delimiting
-regions that can be painted using [[..:qtwidget:index#painterfill|painter:fill]]
-or delimited using [[..:qtwidget:index#painterstroke|painter:stroke]].
-No specific Lua methods have been defined for this Qt variant class.
-
-
-===== qt.QPixmap =====
-{{anchor:qpixmap}}
-
-Qt class
-[[http://doc.trolltech.com/4.4/qpixmap.html|QPixmap]]
-represents a server-side image containing device-dependent data.
-No specific Lua methods have been defined for this Qt variant class.
-
-
-===== qt.QPen =====
-{{anchor:qpen}}
-
-Qt class
-[[http://doc.trolltech.com/4.4/qpen.html|QPen]]
-represents the painter settings that determine how
-lines are drawn.
-
-==== qt.QPen(table) ====
-{{anchor:qpen}}
-{{anchor:qpenfromtable}}
-
-Expression ''qt.QPen(table)'' returns a pen whose settings
-are determined by the fields of table ''table''.
-The following fields are recognized:
-
- * Field ''style'' specifies the name of the [[http://doc.trolltech.com/4.4/qt.html#PenStyle-enum|pen style]]. The default style is ''SolidLine''.
-
- * Field ''brush'' contains a ''qt.QBrush'' value that defines the appearance of the painted areas.
-
- * Field ''color'' contains a ''qt.QColor'' value for the brush color. Setting this field is equivalent to setting field ''brush'' with a solid brush of the specified color. Field ''brush'' has precedence over this field.
-
- * Numerical field ''width'' contains the desired line width. A line width of zero indicates a cosmetic pen. This means that the pen width is always drawn one pixel wide, independent of the transformation on the painter.
-
- * Setting boolean field ''cosmetic'' to ''true'' indicates that the pen width has a constant width regardless of the transformation on the painter.
-
- * Field ''style'' specifies the name of the [[http://doc.trolltech.com/4.4/qt.html#PenStyle-enum|pen style]] which determines
-
- * Field ''joinStyle'' specifies the name of the [[http://doc.trolltech.com/4.4/qt.html#PenJoinStyle-enum|pen join style]] which determines how lines meet with different angles. The default join style is ''BevelJoin''.
-
- * Field ''capStyle'' specifies the name of the [[http://doc.trolltech.com/4.4/qt.html#PenCapStyle-enum|pen cap style]] which determines how lines end are drawn. The default cap style is ''SquareCap''.
-
- * Numerical field ''miterLimit'' determines how far a [[http://doc.trolltech.com/4.4/qpen.html#setMiterLimit|miter join]] can extend from the join point. This is used to reduce artifacts between line joins where the lines are close to parallel.
-
-
-==== qpen:totable() ====
-{{anchor:qpen.totable}}
-
-Expression ''qpen:totable()'' returns a table describing the pen.
-See the documentation of [[#qpenfromtable|qt.QPen(table)]]
-for a description of the table fields.
-
-
-===== qt.QTransform =====
-{{anchor:qtransform}}
-
-Qt class
-[[http://doc.trolltech.com/4.4/qtransform.html|QTransform]]
-represents a 2D transformation of a coordinate system.
-Transformation matrices are represented as Qt variants
-of class ''qt.QTransform''.
-
-==== qt.QTransform([table[,table]]) ====
-{{anchor:qtransform}}
-{{anchor:qtransformfromtable}}
-
-Expression ''qt.QTransform()'' constructs an identity transformation matrix.
-
-Expression ''qt.QTransform(table)'' constructs a transformation matrix
-whose matrix elements are initialized with the fields ''m11'', ''m12'', ''m13'',
-''m21'', ''m22'', ''m23'', ''m31'', ''m32'', and ''m33'' of table ''table''.
-
-Expression ''qt.QTransform(fquad,tquad)'' constructs a transformation matrix
-that maps the quad ''fquad'' to the quad ''tquad''.
-Both arguments ''fquad'' and ''tquad'' are table containing exactly four
-[[..:qtcore:index#qpoint|qt.QPointF]] representing the four corners of the quad.
-
-==== qtransform:totable() ====
-{{anchor:qtransform.totable}}
-
-Expression ''qtransform:totable()'' returns a table suitable
-for use with expression [[#qtransformfromtable|qt.QTransform(table)]].
-
-==== qtransform:scaled(sx,sy) ====
-{{anchor:qtransform.scaled}}
-
-Function ''qtransform:scaled'' returns a new transformation matrix
-representing a coordinate system whose axes have been
-scaled by coefficient ''sx'' and ''sy''.
-
-==== qtransform:translated(dx,dy) ====
-{{anchor:qtransform.translated}}
-
-Function ''qtransform:translated'' returns a new transformation matrix
-representing a coordinate system whose origin has been
-translated by ''dx'' units along the X axis and ''dy'' units along the Y axis.
-
-
-==== qtransform:sheared(cx,cy) ====
-{{anchor:qtransform.sheared}}
-
-Function ''qtransform:sheared'' returns a new transformation matrix
-representing a coordinate system that has been sheared using coefficients
-''cx'' horizontally and ''cy'' vertically.
-
-
-==== qtransform:rotated(angle,[axis,[unit]]) ====
-{{anchor:qtransform.rotated}}
-
-Function ''qtransform:rotated'' returns a new transformation matrix
-representing a coordinate system rotated by ''angle'' units around the origin.
-The optional string argument ''axis'' may be ''XAxis'', ''YAxis'', or ''ZAxis'' and
-defaults to ''ZAxis''. The optional string argument ''unit'' may
-be ''Degrees'' or ''Radians''
-and default to ''Degrees''.
-
-==== qtransform:inverted() ====
-{{anchor:qtransform.inverted}}
-
-Function ''qtransform:inverted'' returns
-the inverse transform of its argument
-or ''nil'' when it is not invertible.
-
-==== qtransform:map(...) ====
-{{anchor:qtransform.map}}
-
-Function ''qtransform:map'' applies
-a transformation to its argument and returns
-a new qvariant of the same type.
-The argument can be a ''QPoint'', ''QPointF'', ''QLine'', ''QLineF'',
-''QPolygon'', ''QPolygonF'', ''QRegion'', ''QPainterPath'',
-''QRect'', or ''QRectF''. When the argument is a rectangle,
-the function returns the bounding rectangle of the polygon
-representing the transformed rectangle.
-This function also take as argument to reals representing
-the coordinates of a point and return two reals
-representing the transformed coordinates.
-
-===== qt.QWidget =====
-{{anchor:qwidget}}
-
-Qt class
-[[http://doc.trolltech.com/4.4/qwidget.html|QWidget]]
-is the base class of all graphical interface components.
-All widgets inherit class ''qt.QWidget'' and
-its superclass [[..:qtcore:index#qobject|qt.QObject]].
-
-==== qt.QWidget([parent]) ====
-{{anchor:qwidget}}
-
-Expression ''qt.QWidget(parent)'' returns a new widget.
-The optional argument ''parent'' specifies the widget parent.
-New widgets are always created from the main thread using
-the [[..:qt:index#qt.qcall|thread hopping]] mechanism.
-
-When argument ''parent'' is ''nil'' or not specified,
-the new widget is owned by the Lua interpreter
-and is automatically destroyed when the garbage collector
-determines that it is no longer referenced.
-
-
-==== qwidget:actions() ====
-{{anchor:qwidget.actions}}
-
-Expression ''qwidget:actions()'' returns a
-qt value of class [[..:qtcore:index#qvariantlist|qt.QVariantList]]
-containing list of actions associated with this widget.
-
-==== qwidget:addAction(qaction) ====
-{{anchor:qwidget.addAction}}
-
-Appends action ''qaction'' to the
-list of actions associated with this widget.
-
-Example: creating a context menu
-<file lua>
- action1 === qt.QtLuaAction{text="Checkme", checkable=true,
- function(b) print("checked:", b) end}
- action2 === qt.QtLuaAction{text="Pickme",
- function() print("picked") end}
- w:addAction(action1)
- w:addAction(action2)
- w.contextMenuPolicy='ActionsContextMenu'
-</file>
-
-==== qwidget:insertAction(beforeqaction, qaction) ====
-{{anchor:qwidget.insertAction}}
-
-Insert action ==qaction== into the
-list actions associated with this widget.
-Argument ==beforeqaction== indicates at which position
-to insert the action. If ==beforeqaction== is omitted
-or invalid, the action is simply appended.
-
-==== qwidget:mapToGlobal(qpoint) ====
-{{anchor:qwidget.mapToGlobal}}
-
-Translates the widget coordinates ''qpoint'' to global screen coordinates.
-Both argument ''qpoint'' and the return value are Qt value of class
-[[..:qtcore:index#qpoint|qt.QPoint]].
-
-==== qwidget:mapFromGlobal(qpoint) ====
-{{anchor:qwidget.mapFromGlobal}}
-
-Translates the global screen coordinates ''qpoint'' to widget coordinates.
-Both argument ''qpoint'' and the return value are Qt value of class
-[[..:qtcore:index#qpoint|qt.QPoint]].
-
-
-==== qwidget:removeAction(qaction) ====
-{{anchor:qwidget.removeAction}}
-
-Removes action ''qaction'' from the
-list actions associated with this widget.
-
-
-==== qwidget:render([pointer]) ====
-{{anchor:qwidget.render}}
-
-When called without argument,
-this function draws the widget into an image
-and returns the image.
-
-The optional argument ''pointer'' can be a
-pointer to a ''QPainter'' or a ''QPaintDevice''
-where the widget should be rendered.
-Such pointers can be obtained using functions
-[[..:qtwidget:index#painterpainter|painter:painter]] or
-[[..:qtwidget:index#painterdevice|painter:device]].
-When such an argument is specified,
-nothing is returned.
-
-==== qwidget:setAttribute(widgetattribute,[value]) ====
-{{anchor:qwidget.setAttribute}}
-
-Sets the specified
-[[http://doc.trolltech.com/4.4/qt.html#WidgetAttribute-enum|widget attribute]]
-to boolean value ''value''.
-Some of these flags are used internally by Qt.
-Care is required.
-
-==== qwidget:setWindowFlag(windowflag,[value]) ====
-{{anchor:qwidget.setWindowFlag}}
-
-Sets the specified
-[[http://doc.trolltech.com/4.4/qt.html#WindowType-enum|window flag]]
-to boolean value ''value''.
-Flags indicating a window type
-are handled as exclusive flags.
-Setting these flags usually hides the window.
-You need to do call ''qwidget:show'' again.
-
-==== qwidget:testAttribute(widgetattribute) ====
-{{anchor:qwidget.testAttribute}}
-
-Returns a boolean indicating the value of the specified
-[[http://doc.trolltech.com/4.4/qt.html#WidgetAttribute-enum|widget attribute]].
-Flags indicating a window type
-are handled as exclusive flags.
-
-==== qwidget:testWindowFlag(windowflag) ====
-{{anchor:qwidget.testWindowFlag}}
-
-Returns a boolean indicating the value of the specified
-[[http://doc.trolltech.com/4.4/qt.html#WindowType-enum|window flag]].
-Flags indicating a window type
-are handled as exclusive flags.
-
-==== qwidget:window() ====
-{{anchor:qwidget.window}}
-
-Expression ''qwidget:window()'' returns the window for widget ''qwidget'',
-that is the next ancestor that is (or could be) displayed
-with a window frame.
-
-For instance the following code changes the
-title of the window containing widget ''qwidget''.
-<file lua>
- qwidget:window().windowTitle "New Title"
-</file>
-
-
-