QtIde Package Reference Manual

A package implementing the QLua Integrated Development Environment (IDE), including the text editor, the object inspector, the help browser, and the lua graphical console.

This package is not complete because it is under heavy development.

Functions

qtide.editor([filename])

Called without argument, this function returns a text editor object of class QLuaEditor. Otherwise it returns an editor for the file filename, possibly creating a new editor window. It pops a message box and returns nil if the file filename does not exist or cannot be loaded.

Open editors have object names of the form editorn and are accessible by name in the qt package.

qtide.doeditor(qluaeditor)

This function executes the chunk of Lua code corresponding to the text present in the editor qluaeditor. This is the function called by the IDE when one selects the menu entry "Load Lua File" from an editor whose contents is not associated with a file or has been modified (otherwise one can use the standard Lua function dofile.)

qtide.browser([url])

This function opens a web browser for URL url. The web browser is a widget of class QLuaBrowser. This is the function called by the IDE when one requests the help index.

qtide.inspector(...)

Not yet implemented

qtide.preferences()

Not yet implemented

qtide.start([style])

Starts the QLua Integrated Development Environment (IDE) and ensure that the main window is visible. This function is called implicitely when program qlua is executed with option -ide.

The optional argument style is a string specifying the default IDE style.
When this argument is not specified the last used style is assumed. The recognized IDE styles are:

  • "sdi" for an IDE with multiple main windows,
  • "mdi" for an IDE with subwindows in the style of Windows,
  • "tab" groups all editors into a single tabbed window.
  • "tab2" groups all editors and the console into a single tabbed window.

qtide.setup([style])

This function is called by qtide.start() to setup the IDE style. You can call it directly if you want to organize QLua editors and windows without creating a graphic console.

Qt Classes

qt.QLuaIde

Object qt.qLuaIde represetns the global state of the IDE. This is the unique instance of class qt.QLuaIde which inherits qt.QObject. Most of its capabilities are conveniently accessible using the functions defined by the package ''qtide.

qt.qLuaIde.editOnError

When a Lua error occurs, this boolean property specifies whether editors are automatically opened on the location of the error. This property is false by default Function qtide.start sets it to true.

qt.qLuaIde:windows()

Returns a variant of type qt.QObjectList containing all the main windows managed by the IDE.

qt.qLuaIde:windowNames()

Returns a variant of type qt.QStringList containing the names of all the main windows managed by the IDE.

qt.qLuaIde:activeWindow()

qt.qLuaIde:editor([fname])

qt.qLuaIde:browser([url])

qt.qLuaIde:inspector()

qt.qLuaIde:recentFiles()

Returns a variant of type qt.QStringList containing the file names appearing in the "Open Recent Files" menu.

qt.qLuaIde:addRecentFile(fname)

qt.qLuaIde:clearRecentFiles()

qt.qLuaIde:activateWidget(qwidget)

qt.qLuaIde:activateConsole()

qt.qLuaIde:messageBox(title,message,buttons,[defbutton,[icon]])

qt.qLuaIde:hasAction(name)

qt.qLuaIde:stdAction(name)

[qt.QLuaIde signal] prefsRequested(qwidget)

This signal is emitted when the "Preferences" menu is selected.

[qt.QLuaIde signal] helpRequested(qwidget)

This signal is emitted when the "Help Index" menu is selected.

qt.QLuaMainWindow

This subclass of QMainWindow implements common functionalities shared by all main windows defined by the qtide package.

qluamainwindow:clearStatusMessage()

qluamainwindow:showStatusMessage(string,[timeout])

qluamainwindow:hasAction(name)

qluamainwindow:stdAction(name)

qluamainwindow:doXXXX()

Methods whose name start with do implement the functions accessible from the menus and toolbar icons in various subclasses of qt.QLuaMainWindow.

qt.QLuaEditor

This subclass of qt.QLuaMainWindow implements the QLua editor windows using an instance of qt.QLuaTextEdit as its main widget.

qluaeditor:widget()

Expression qluaeditor:widget() returns the qt.QLuaTextEdit object that underlies the editor window.

qluaeditor.fileName

This property contains the name of the file being edited.

qluaeditor:readFile(string)

qluaeditor:writeFile(string)

qt.QLuaBrowser

This subclass of qt.QLuaMainWindow implements the QLua web browser windows using the Qt WebKit interface.

qluabrowser.url

This property contains a qt variant of type qt.QUrl representing the URL displayed by the browser.

qluabrowser.html

This property contains a qt variant of type QString representing the HTML text displayed by the browser.

qt.QLuaSdiMain

This subclass of qt.QLuaMainWindow implements the QLua console window. Expression qt.qLuaSdiMain returns the single console window when such a window exists.

qt.qLuaSdiMain:consoleWidget()

Returns the object of class qt.QLuaTextEdit implementing the part of the main console where the user can edit and submit lua strings.

qt.qLuaSdiMain:editorWidget()

Returns the object of class qt.QLuaTextEdit implementing the part of the main console where the Lua output is shown.

qt.QLuaMdiMain

This subclass of qt.QLuaMainWindow aggregates selected windows into a single main window to implement the IDE styles. Expression qt.qLuaMdiMain returns the single main window when such a window exists.

qt.qLuaMdiMain.tabMode

The boolean property qt.qLuaMdiMain.tabMode indicates whether the aggregated windows are displayed using tabs or using a multiple document interface.

qt.qLuaMdiMain.clientClass

The string property qt.qLuaMdiMain.clientClass contains the name of a class. All new main windows inheriting this class are then managed by the single main window.

qt.qLuaMdiMain:adoptAll()

Collects all main windows that are subclasses of qt.qLuaMdiMain.clientClass and aggregates them into the mdi main window.

qt.qLuaMdiMain:adopt(qwidget)

qt.qLuaMdiMain:activate(qwidget)

qt.QLuaTextEdit

Class QLuaTextEdit is a text editor widget derived from QPlainTextEdit with support for line numbers, find dialog, replace dialog, and printing.

qluatextedit.showLineNumbers

qluatextedit.autoComplete

qluatextedit.autoIndent

qluatextedit.autoHighlight

qluatextedit.autoMatch

qluatextedit.tabExpand

qluatextedit.tabSize

qluatextedit:setEditorMode(suffix)

qluatextedit:readFile(fname)

qluatextedit:writeFile(fname)

qluatextedit:showLine(lineno)

qt.QLuaConsoleWidget

Class QLuaConsoleWidget is a subclass of qt.QLuaTextEdit that captures and display the lua output.

qluaconsolewidget.printTimings

Boolean property that indicates whether the console displays the running time of each command.

qluaconsolewidget:addOutput(text,[format])

Adds text to the console window. Argument format is a string specifying the text format. Possible values are "default", "quote", and "comment".

qluaconsolewidget:moveToEnd()

Shows the bottom of the text displayed in the console window.

Qt Objects

qt.qLuaIde

Expression qt.qLuaIde refers to the unique instance of class qt.QLuaIde. This instance is created when package qtide is loaded.

qt.qLuaSdiMain

Expression qt.qLuaSdiMain refers to the unique instance of class qt.QLuaSdiMain, created by function qtide.start().

qt.qLuaMdiMain

Expression qt.qLuaMdiMain refers to the unique instance of class qt.QLuaMdiMain created by function qtide.setup(). There is no such object when the IDE runs in SDI mode.