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

qtide.md « doc - github.com/torch/qtlua.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: de71a2b1b325946f8b9c1e9e0c7f623f628535a3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
<a name="qtide.dok"></a>
# 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. 


<a name="qtide.functions."></a>
## Functions ##
<a name="qtidefunctions"></a>

<a name="qtide.editor"></a>
### qtide.editor([filename]) ###

Called without argument, this function returns a 
text editor object of class [QLuaEditor](#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 `editor`_n_ 
and are accessible by name in the `qt` package.


<a name="qtide.doeditor"></a>
### 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`.)


<a name="qtide.browser"></a>
### qtide.browser([url]) ###

This function opens a web browser for URL `url`.
The web browser is a widget of class [QLuaBrowser](#qluabrowser).
This is the function called by the IDE when one
requests the help index.


<a name="qtide.inspector"></a>
### qtide.inspector(...) ###

Not yet implemented


<a name="qtide.preferences"></a>
### qtide.preferences() ###

Not yet implemented


<a name="qtide.start"></a>
### qtide.start([style]) ###
<a name="qtidestart"></a>

Starts the QLua Integrated Development Environment (IDE)
and ensure that the main window is visible.
This function is called implicitly 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.


<a name="qtide.setup"></a>
### qtide.setup([style]) ###
<a name="qtidesetup"></a>

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


<a name="qtclasses"></a>
## Qt Classes ##

<a name="qluaide"></a>
### qt.QLuaIde ###

Object `qt.qLuaIde` represents the global state of the IDE.
This is the unique instance of class `qt.QLuaIde`
which inherits [qt.QObject](qt.md#qobject).
Most of its capabilities are conveniently
accessible using the functions defined
by the [package ''qtide](#qtidefunctions).

<a name="qluaide.editOnError"></a>
#### 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](#qtidestart) sets it to `true`.

<a name="qluaide.windows"></a>
#### qt.qLuaIde:windows() ####

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

<a name="qluaide.windowNames"></a>
#### qt.qLuaIde:windowNames() ####

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

<a name="qluaide.activeWindow"></a>
#### qt.qLuaIde:activeWindow() ####

<a name="qluaide.editor"></a>
#### qt.qLuaIde:editor([fname]) ####

<a name="qluaide.browser"></a>
#### qt.qLuaIde:browser([url]) ####

<a name="qluaide.inspector"></a>
#### qt.qLuaIde:inspector() ####

<a name="qluaide.recentFiles"></a>
#### qt.qLuaIde:recentFiles() ####

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

<a name="qluaide.addRecentFile"></a>
#### qt.qLuaIde:addRecentFile(fname) ####

<a name="qluaide.clearRecentFiles"></a>
#### qt.qLuaIde:clearRecentFiles() ####

<a name="qluaide.activateWidget"></a>
#### qt.qLuaIde:activateWidget(qwidget) ####

<a name="qluaide.activateConsole"></a>
#### qt.qLuaIde:activateConsole() ####

<a name="qluaide.messageBox"></a>
#### qt.qLuaIde:messageBox(title,message,buttons,[defbutton,[icon]]) ####

<a name="qluaide.hasAction"></a>
#### qt.qLuaIde:hasAction(name) ####

<a name="qluaide.stdAction"></a>
#### qt.qLuaIde:stdAction(name) ####

<a name="qluaide.prefsRequested"></a>
#### [qt.QLuaIde signal] prefsRequested(qwidget) ####

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

<a name="qluaide.helpRequested"></a>
#### [qt.QLuaIde signal] helpRequested(qwidget) ####

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



<a name="qluamainwindow"></a>
### qt.QLuaMainWindow ###

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

<a name="qluamainwindow.clearStatusMessage"></a>
#### qluamainwindow:clearStatusMessage() ####

<a name="qluamainwindow.showStatusMessage"></a>
#### qluamainwindow:showStatusMessage(string,[timeout]) ####

<a name="qluamainwindow.hasAction"></a>
#### qluamainwindow:hasAction(name) ####

<a name="qluamainwindow.stdAction"></a>
#### qluamainwindow:stdAction(name) ####

<a name="qluamainwindow.doXXXX"></a>
#### qluamainwindow:doXXXX() ####

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


<a name="qluaeditor"></a>
### qt.QLuaEditor ###

This subclass of [qt.QLuaMainWindow](#qluamainwindow)
implements the QLua editor windows using 
an instance of [qt.QLuaTextEdit](#qluatextedit)
as its main widget.

<a name="qluaeditor.widget"></a>
#### qluaeditor:widget() ####

Expression `qluaeditor:widget()` returns the
[qt.QLuaTextEdit](#qluatextedit)
object that underlies the editor window.

<a name="qluaeditor.fileName"></a>
#### qluaeditor.fileName ####

This property contains the name of the file being edited.

<a name="qluaeditor.readFile"></a>
#### qluaeditor:readFile(string) ####

<a name="qluaeditor.writeFile"></a>
#### qluaeditor:writeFile(string) ####


<a name="qluabrowser"></a>
### qt.QLuaBrowser ###

This subclass of [qt.QLuaMainWindow](#qluamainwindow)
implements the QLua web browser windows using the Qt WebKit interface.


<a name="qluabrowser.url"></a>
#### qluabrowser.url ####

This property contains a qt variant 
of type [qt.QUrl](qt.md#qurl) 
representing the URL displayed by the browser.

<a name="qluabrowser.html"></a>
#### qluabrowser.html ####

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

<a name="qluasdimain"></a>
### qt.QLuaSdiMain ###

This subclass of [qt.QLuaMainWindow](#qluamainwindow)
implements the QLua console window.
Expression `qt.qLuaSdiMain` returns the single console
window when such a window exists.

<a name="qluasdimain.consoleWidget"></a>
#### qt.qLuaSdiMain:consoleWidget() ####

Returns the object of class 
[qt.QLuaTextEdit](#qluaconsolewidget)
implementing the part of the main console
where the user can edit and submit lua strings.

<a name="qluasdimain.editorWidget"></a>
#### qt.qLuaSdiMain:editorWidget() ####

Returns the object of class 
[qt.QLuaTextEdit](#qluatextedit)
implementing the part of the main console
where the Lua output is shown.


<a name="qluamdimain"></a>
### qt.QLuaMdiMain ###

This subclass of [qt.QLuaMainWindow](#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.

<a name="qluamdimain.tabMode"></a>
#### qt.qLuaMdiMain.tabMode ####

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

<a name="qluamdimain.clientClass"></a>
#### 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.

<a name="qluamdimain.adoptAll"></a>
#### qt.qLuaMdiMain:adoptAll() ####

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

<a name="qluamdimain.adopt"></a>
#### qt.qLuaMdiMain:adopt(qwidget) ####

<a name="qluamdimain.activate"></a>
#### qt.qLuaMdiMain:activate(qwidget) ####

<a name="qluatextedit"></a>
### qt.QLuaTextEdit ###

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

<a name="qluatextedit.showLineNumbers"></a>
#### qluatextedit.showLineNumbers ####

<a name="qluatextedit.autoComplete"></a>
#### qluatextedit.autoComplete ####

<a name="qluatextedit.autoIndent"></a>
#### qluatextedit.autoIndent ####

<a name="qluatextedit.autoHighlight"></a>
#### qluatextedit.autoHighlight ####

<a name="qluatextedit.autoMatch"></a>
#### qluatextedit.autoMatch ####

<a name="qluatextedit.tabExpand"></a>
#### qluatextedit.tabExpand ####

<a name="qluatextedit.tabSize"></a>
#### qluatextedit.tabSize ####

<a name="qluatextedit.setEditorMode"></a>
#### qluatextedit:setEditorMode(suffix) ####

<a name="qluatextedit.readFile"></a>
#### qluatextedit:readFile(fname) ####

<a name="qluatextedit.writeFile"></a>
#### qluatextedit:writeFile(fname) ####

<a name="qluatextedit.showLine"></a>
#### qluatextedit:showLine(lineno) ####

<a name="qluaconsolewidget"></a>
### qt.QLuaConsoleWidget ###

Class `QLuaConsoleWidget` is a subclass of 
[qt.QLuaTextEdit](#qluatextedit)
that captures and display the lua output.

<a name="qluaconsolewidget.printTimings"></a>
#### qluaconsolewidget.printTimings ####

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

<a name="qluaconsolewidget.addOutput"></a>
#### 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"`.

<a name="qluaconsolewidget.moveToEnd"></a>
#### qluaconsolewidget:moveToEnd() ####

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

<a name="qtobjects"></a>
## Qt Objects ##

<a name="qtqluaide"></a>
### qt.qLuaIde ###

Expression `qt.qLuaIde` refers to the unique instance
of class [qt.QLuaIde](#qluaide).
This instance is created when package `qtide` is loaded.


<a name="qtqluasdimain"></a>
### qt.qLuaSdiMain ###

Expression `qt.qLuaSdiMain` refers to the unique instance of 
class [qt.QLuaSdiMain](#qluasdimain),
created by function [qtide.start()](#qtidestart).


<a name="qtqluamdimain"></a>
### qt.qLuaMdiMain ###

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