Mercurial > projects > qtd
annotate generator/typesystem_gui-java.java @ 3:323efbe5c2f7
native wrap of QLine and QLineF, fixes in opEquals, updated QPainter to the use of native structs
author | eldar |
---|---|
date | Wed, 13 May 2009 17:34:40 +0000 |
parents | e78566595089 |
children | 374a61671448 |
rev | line source |
---|---|
1 | 1 /**************************************************************************** |
2 ** | |
3 ** Copyright (C) 1992-2008 Nokia. All rights reserved. | |
4 ** | |
5 ** This file is part of Qt Jambi. | |
6 ** | |
7 ** * Commercial Usage | |
8 * Licensees holding valid Qt Commercial licenses may use this file in | |
9 * accordance with the Qt Commercial License Agreement provided with the | |
10 * Software or, alternatively, in accordance with the terms contained in | |
11 * a written agreement between you and Nokia. | |
12 * | |
13 * | |
14 * GNU General Public License Usage | |
15 * Alternatively, this file may be used under the terms of the GNU | |
16 * General Public License versions 2.0 or 3.0 as published by the Free | |
17 * Software Foundation and appearing in the file LICENSE.GPL included in | |
18 * the packaging of this file. Please review the following information | |
19 * to ensure GNU General Public Licensing requirements will be met: | |
20 * http://www.fsf.org/licensing/licenses/info/GPLv2.html and | |
21 * http://www.gnu.org/copyleft/gpl.html. In addition, as a special | |
22 * exception, Nokia gives you certain additional rights. These rights | |
23 * are described in the Nokia Qt GPL Exception version 1.2, included in | |
24 * the file GPL_EXCEPTION.txt in this package. | |
25 * | |
26 * Qt for Windows(R) Licensees | |
27 * As a special exception, Nokia, as the sole copyright holder for Qt | |
28 * Designer, grants users of the Qt/Eclipse Integration plug-in the | |
29 * right for the Qt/Eclipse Integration to link to functionality | |
30 * provided by Qt Designer and its related libraries. | |
31 * | |
32 * | |
33 * If you are unsure which license is appropriate for your use, please | |
34 * contact the sales department at qt-sales@nokia.com. | |
35 | |
36 ** | |
37 ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE | |
38 ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. | |
39 ** | |
40 ****************************************************************************/ | |
41 | |
42 package generator; | |
43 | |
44 import qt.QNativePointer; | |
45 import qt.QtBlockedSlot; | |
46 import qt.core.QPoint; | |
47 import qt.core.QPointF; | |
48 import qt.gui.*; | |
49 | |
50 class QIconEngineV2___ extends QIconEngineV2 { | |
51 public QIconEngineV2 clone() { | |
52 return null; | |
53 } | |
54 }// class | |
55 | |
56 class QTransform___ extends QTransform { | |
57 | |
58 public final QTransform multiply(double d) { | |
59 operator_multiply_assign(d); | |
60 return this; | |
61 } | |
62 | |
63 public final QTransform multiply(QTransform matrix) { | |
64 operator_multiply_assign(matrix); | |
65 return this; | |
66 } | |
67 | |
68 public final QTransform add(double d) { | |
69 operator_add_assign(d); | |
70 return this; | |
71 } | |
72 | |
73 public final QTransform divide(double d) { | |
74 operator_divide_assign(d); | |
75 return this; | |
76 } | |
77 | |
78 public final QTransform subtract(double d) { | |
79 operator_subtract_assign(d); | |
80 return this; | |
81 } | |
82 | |
83 /** | |
84 * Returns an inverted copy of this transformation. | |
85 * | |
86 * @return The inverse of the transformation. | |
87 * @throws IllegalArgumentException | |
88 * If this transformation is not invertible. | |
89 */ | |
90 /* public final QTransform inverted() { | |
91 QNativePointer ok = new QNativePointer(QNativePointer.Type.Boolean); | |
92 QTransform returned = inverted(ok); | |
93 if (!ok.booleanValue()) | |
94 throw new IllegalArgumentException("Transformation is not invertible"); | |
95 return returned; | |
96 } | |
97 */ | |
98 /** | |
99 * Creates a transformation mapping one arbitrary quad into another. | |
100 * | |
101 * @return The transformation. | |
102 * @throws IllegalArgumentException | |
103 * If this transformation is not possible. | |
104 */ | |
105 /* public static final QTransform quadToQuad(QPolygonF from, QPolygonF to) { | |
106 QTransform res = new QTransform(); | |
107 QNativePointer resPointer = res.nativePointer(); | |
108 if (quadToQuadPrivate(from, to, resPointer)) { | |
109 return res; | |
110 } else | |
111 throw new IllegalArgumentException("Transformation is not possible"); | |
112 } | |
113 */ | |
114 /** | |
115 * Creates a transformation that maps a quad to a unit square. | |
116 * | |
117 * @return The transformation. | |
118 * @throws IllegalArgumentException If this transformation is not possible. | |
119 */ | |
120 /* public static final QTransform quadToSquare(QPolygonF quad) { | |
121 QTransform res = new QTransform(); | |
122 QNativePointer resPointer = res.nativePointer(); | |
123 if (quadToSquarePrivate(quad, resPointer)) { | |
124 return res; | |
125 } else | |
126 throw new IllegalArgumentException("Transformation is not possible"); | |
127 } | |
128 */ | |
129 /** | |
130 * Creates a transformation that maps a unit square to a the given quad. | |
131 * | |
132 * @return The transformation. | |
133 * @throws IllegalArgumentException | |
134 * If this transformation is not possible. | |
135 */ | |
136 /* public static final QTransform squareToQuad(QPolygonF quad) { | |
137 QTransform res = new QTransform(); | |
138 QNativePointer resPointer = res.nativePointer(); | |
139 if (squareToQuadPrivate(quad, resPointer)) { | |
140 return res; | |
141 } else | |
142 throw new IllegalArgumentException("Transformation is not possible"); | |
143 } | |
144 */ | |
145 }// class | |
146 | |
147 class QBitmap___ extends QBitmap { | |
148 /* | |
149 public QBitmap(String fileName, String format) { | |
150 this(fileName, format == null ? null : qt.QNativePointer.createCharPointer(format)); | |
151 } | |
152 | |
153 public QBitmap(String fileName) { | |
154 this(fileName, (String) null); | |
155 } | |
156 | |
157 public static QBitmap fromData(qt.core.QSize size, byte bits[], QImage.Format monoFormat) { | |
158 return fromData(size, qt.internal.QtJambiInternal.byteArrayToNativePointer(bits), monoFormat); | |
159 } | |
160 | |
161 public static QBitmap fromData(qt.core.QSize size, byte bits[]) { | |
162 return fromData(size, bits, QImage.Format.Format_MonoLSB); | |
163 } | |
164 */ | |
165 }// class | |
166 | |
167 class QPolygon___ extends QPolygon { | |
168 /* | |
169 private native void add_private(long nid, int x, int y); | |
170 | |
171 @QtBlockedSlot | |
172 public final QPolygon add(int x, int y) { | |
173 add_private(nativeId(), x, y); | |
174 return this; | |
175 } | |
176 | |
177 @QtBlockedSlot | |
178 public final QPolygon add(QPoint pt) { | |
179 add_private(nativeId(), pt.x(), pt.y()); | |
180 return this; | |
181 } | |
182 | |
183 @QtBlockedSlot | |
184 public final QPolygon add(QPolygon p) { | |
185 int size = p.size(); | |
186 long nid = nativeId(); | |
187 for (int i = 0; i < size; ++i) { | |
188 QPoint pt = p.at(i); | |
189 add_private(nid, pt.x(), pt.y()); | |
190 } | |
191 return this; | |
192 } | |
193 */ | |
194 }// class | |
195 | |
196 class QPolygonF___ extends QPolygonF { | |
197 /* | |
198 private native void add_private(long nid, double x, double y); | |
199 | |
200 @QtBlockedSlot | |
201 public final QPolygonF add(double x, double y) { | |
202 add_private(nativeId(), x, y); | |
203 return this; | |
204 } | |
205 | |
206 @QtBlockedSlot | |
207 public final QPolygonF add(QPointF pt) { | |
208 add_private(nativeId(), pt.x(), pt.y()); | |
209 return this; | |
210 } | |
211 | |
212 @QtBlockedSlot | |
213 public final QPolygonF add(QPolygonF p) { | |
214 int size = p.size(); | |
215 long nid = nativeId(); | |
216 for (int i = 0; i < size; ++i) { | |
217 QPointF pt = p.at(i); | |
218 add_private(nid, pt.x(), pt.y()); | |
219 } | |
220 return this; | |
221 } | |
222 */ | |
223 }// class | |
224 | |
225 class QTreeWidgetItemIterator___ extends QTreeWidgetItemIterator { | |
226 @QtBlockedSlot | |
227 public final void next(int i) { | |
228 operator_add_assign(i); | |
229 } | |
230 | |
231 @QtBlockedSlot | |
232 public final void previous(int i) { | |
233 operator_subtract_assign(i); | |
234 } | |
235 | |
236 @QtBlockedSlot | |
237 public final void next() { | |
238 operator_increment(); | |
239 } | |
240 | |
241 @QtBlockedSlot | |
242 public final void previous() { | |
243 operator_decrement(); | |
244 } | |
245 | |
246 @QtBlockedSlot | |
247 public final QTreeWidgetItem current() { | |
248 return operator_multiply(); | |
249 } | |
250 }// class | |
251 | |
252 class QTextCursor___ extends QTextCursor { | |
253 /* public final QTableArea selectedTableCells() { | |
254 QNativePointer firstRow = new QNativePointer(QNativePointer.Type.Int); | |
255 QNativePointer numRows = new QNativePointer(QNativePointer.Type.Int); | |
256 QNativePointer firstColumn = new QNativePointer(QNativePointer.Type.Int); | |
257 QNativePointer numColumns = new QNativePointer(QNativePointer.Type.Int); | |
258 | |
259 selectedTableCells(firstRow, numRows, firstColumn, numColumns); | |
260 | |
261 return new QTableArea(firstRow.intValue(), firstColumn.intValue(), numRows.intValue(), numColumns.intValue()); | |
262 }*/ | |
263 }// class | |
264 | |
265 class QComboBox___ extends QComboBox { | |
266 | |
267 }// class | |
268 | |
269 class QMatrix___ extends QMatrix { | |
270 /** | |
271 * Returns an inverted copy of this matrix. | |
272 * | |
273 * @return The inverse of the matrix. | |
274 * @throws IllegalArgumentException | |
275 * If this matrix is not invertible. | |
276 */ | |
277 /* public final QMatrix inverted() { | |
278 QNativePointer ok = new QNativePointer(QNativePointer.Type.Boolean); | |
279 QMatrix returned = inverted(ok); | |
280 if (!ok.booleanValue()) | |
281 throw new IllegalArgumentException("Matrix is not invertible"); | |
282 return returned; | |
283 } | |
284 | |
285 @QtBlockedSlot | |
286 public final QMatrix multiply(QMatrix other) { | |
287 operator_multiply_assign(other); | |
288 return this; | |
289 } | |
290 | |
291 @QtBlockedSlot | |
292 public final QMatrix multiplied(QMatrix other) { | |
293 return operator_multiply(other); | |
294 } | |
295 */ | |
296 }// class | |
297 | |
298 class QImage___ extends QImage { | |
299 private import qt.qtd.Str; | |
300 | |
301 public this(in string[] xpm) { | |
302 this(toStringzArray(xpm)); | |
303 } | |
304 /* | |
305 public final byte[] copyOfBytes() { | |
306 QNativePointer bits = bits(); | |
307 byte bytes[] = new byte[numBytes()]; | |
308 for (int i = 0; i < bytes.length; ++i) | |
309 bytes[i] = bits.byteAt(i); | |
310 return bytes; | |
311 } | |
312 */ | |
313 public this(ubyte[] data, int width, int height, Format format) { | |
314 this(data.ptr, width, height, format); | |
315 } | |
316 | |
317 public this(string fileName, string format = null) { | |
318 this(fileName, format == null ? null : toStringz(format)); | |
319 } | |
320 }// class | |
321 | |
322 class QPen___ extends QPen { | |
323 /* | |
324 public QPen(QColor color, double width, qt.core.Qt.PenStyle s, qt.core.Qt.PenCapStyle c, qt.core.Qt.PenJoinStyle j) { | |
325 this(new QBrush(color), width, s, c, j); | |
326 } | |
327 | |
328 public QPen(QColor color, double width, qt.core.Qt.PenStyle s, qt.core.Qt.PenCapStyle c) { | |
329 this(new QBrush(color), width, s, c); | |
330 } | |
331 | |
332 public QPen(QColor color, double width, qt.core.Qt.PenStyle s) { | |
333 this(new QBrush(color), width, s); | |
334 } | |
335 | |
336 public QPen(QColor color, double width) { | |
337 this(new QBrush(color), width); | |
338 } | |
339 | |
340 public static final QPen NoPen = new QPen(qt.core.Qt.PenStyle.NoPen); | |
341 */ | |
342 }// class | |
343 | |
344 class QColor___ extends QColor { | |
345 static this() { | |
346 White = new QColor(Qt.GlobalColor.white); | |
347 Black = new QColor(Qt.GlobalColor.black); | |
348 Red = new QColor(Qt.GlobalColor.red); | |
349 DarkRed = new QColor(Qt.GlobalColor.darkRed); | |
350 Green = new QColor(Qt.GlobalColor.green); | |
351 DarkGreen = new QColor(Qt.GlobalColor.darkGreen); | |
352 Blue = new QColor(Qt.GlobalColor.blue); | |
353 DarkBlue = new QColor(Qt.GlobalColor.darkBlue); | |
354 Cyan = new QColor(Qt.GlobalColor.cyan); | |
355 DarkCyan = new QColor(Qt.GlobalColor.darkCyan); | |
356 Magenta = new QColor(Qt.GlobalColor.magenta); | |
357 DarkMagenta = new QColor(Qt.GlobalColor.darkMagenta); | |
358 Yellow = new QColor(Qt.GlobalColor.yellow); | |
359 DarkYellow = new QColor(Qt.GlobalColor.darkYellow); | |
360 Gray = new QColor(Qt.GlobalColor.gray); | |
361 DarkGray = new QColor(Qt.GlobalColor.darkGray); | |
362 LightGray = new QColor(Qt.GlobalColor.lightGray); | |
363 Transparent = new QColor(Qt.GlobalColor.transparent); | |
364 Color0 = new QColor(Qt.GlobalColor.color0); | |
365 Color1 = new QColor(Qt.GlobalColor.color1); | |
366 } | |
367 | |
368 public static const QColor White; | |
369 public static const QColor Black; | |
370 public static const QColor Red; | |
371 public static const QColor DarkRed; | |
372 public static const QColor Green; | |
373 public static const QColor DarkGreen; | |
374 public static const QColor Blue; | |
375 public static const QColor DarkBlue; | |
376 public static const QColor Cyan; | |
377 public static const QColor DarkCyan; | |
378 public static const QColor Magenta; | |
379 public static const QColor DarkMagenta; | |
380 public static const QColor Yellow; | |
381 public static const QColor DarkYellow; | |
382 public static const QColor Gray; | |
383 public static const QColor DarkGray; | |
384 public static const QColor LightGray; | |
385 public static const QColor Transparent; | |
386 public static const QColor Color0; | |
387 public static const QColor Color1; | |
388 | |
389 }// class | |
390 | |
391 class QTextLine___ extends QTextLine { | |
392 | |
393 public final void draw(QPainter painter, QPointF position) { | |
394 draw(painter, position, null); | |
395 } | |
396 | |
397 }// class | |
398 | |
399 class QKeySequence___ extends QKeySequence { | |
400 /* | |
401 @QtBlockedSlot | |
402 public final int toInt() { | |
403 return operator_cast_int(); | |
404 } | |
405 | |
406 @QtBlockedSlot | |
407 public final int at(int i) { | |
408 return operator_subscript(i); | |
409 } | |
410 */ | |
411 }// class | |
412 | |
413 class QPicture___ extends QPicture { | |
414 /* | |
415 public final boolean load(QIODevice dev) { | |
416 return load(dev, (QNativePointer) null); | |
417 } | |
418 | |
419 public final boolean load(String fileName) { | |
420 return load(fileName, (qt.QNativePointer) null); | |
421 } | |
422 | |
423 public final boolean save(QIODevice dev) { | |
424 return save(dev, (qt.QNativePointer) null); | |
425 } | |
426 | |
427 public final boolean save(String fileName) { | |
428 return save(fileName, (qt.QNativePointer) null); | |
429 } | |
430 | |
431 public final byte[] data() { | |
432 QNativePointer npData = data_private(); | |
433 if (npData == null) | |
434 return null; | |
435 byte returned[] = new byte[size()]; | |
436 for (int i = 0; i < returned.length; ++i) | |
437 returned[i] = npData.byteAt(i); | |
438 return returned; | |
439 } | |
440 */ | |
441 }// class | |
442 | |
443 class QRegion___ extends QRegion { | |
444 /* | |
445 public void setRects(qt.core.QRect[] rects) { | |
446 setRects(qt.core.QRect.nativePointerArray(rects), rects.length); | |
447 } | |
448 */ | |
449 }// class | |
450 | |
451 class QPolygon___ extends QPolygon { | |
452 | |
453 }// class | |
454 | |
455 class QPolygonF___ extends QPolygonF { | |
456 | |
457 }// class | |
458 | |
459 class QTextFrame_iterator___ extends QTextFrame_iterator { | |
460 | |
461 public final void opPostInc() { | |
462 operator_increment(); | |
463 } | |
464 | |
465 public final void opPostDec() { | |
466 operator_decrement(); | |
467 } | |
468 | |
469 }// class | |
470 | |
471 class QTextBlock_iterator___ extends QTextBlock_iterator { | |
472 | |
473 public final void opPostInc() { | |
474 operator_increment(); | |
475 } | |
476 | |
477 public final void opPostDec() { | |
478 operator_decrement(); | |
479 } | |
480 | |
481 }// class | |
482 | |
483 class QPixmap___ extends QPixmap { | |
484 | |
485 private import qt.qtd.Str; | |
486 | |
487 public this(in string[] xpm) { | |
488 this(toStringzArray(xpm)); | |
489 } | |
490 | |
491 public this(string fileName, string format = null, int flags = Qt.ImageConversionFlag.AutoColor) { | |
492 this(fileName, toStringz(format), flags); | |
493 } | |
494 | |
495 /* | |
496 public this(string fileName, string format = null, Qt.ImageConversionFlags flags = Qt.ImageConversionFlag.AutoColor) { | |
497 this(fileName, toStringz(format), flags); | |
498 } | |
499 */ | |
500 | |
501 public final bool load(string fileName, string format, int flags = Qt.ImageConversionFlag.AutoColor) { | |
502 return load(fileName, toStringz(format), flags); | |
503 } | |
504 /* | |
505 public final bool load(string fileName, string format = null, Qt.ImageConversionFlags flags = Qt.ImageConversionFlag.AutoColor) { | |
506 return load(fileName, toStringz(format), flags); | |
507 } | |
508 */ | |
509 /* | |
510 public final bool loadFromData(ubyte[] data, string format, int flags = Qt.ImageConversionFlag.AutoColor) { | |
511 return loadFromData(data.ptr, data.length, toStringz(format), flags); | |
512 } | |
513 | |
514 public final bool loadFromData(ubyte[] data, string format = null, Qt.ImageConversionFlags flags = Qt.ImageConversionFlag.AutoColor) { | |
515 return loadFromData(qdata.ptr, data.length, toStringz(format), flags); | |
516 } | |
517 */ | |
518 | |
519 public final bool loadFromData(QByteArray data, string format, int flags = Qt.ImageConversionFlag.AutoColor) { | |
520 return loadFromData(data, toStringz(format), flags); | |
521 } | |
522 | |
523 /* public final bool loadFromData(QByteArray data, string format = null, Qt.ImageConversionFlags flags = Qt.ImageConversionFlag.AutoColor) { | |
524 return loadFromData(data, toStringz(format), flags); | |
525 } | |
526 */ | |
527 | |
528 public final bool save(string fileName, string format, int quality = -1) { | |
529 return private_save(fileName, toStringz(format), quality); | |
530 } | |
531 | |
532 public final bool save(QIODevice dev, string format, int quality = -1) { | |
533 return private_save(dev, toStringz(format), quality); | |
534 } | |
535 }// class | |
536 | |
537 class QItemSelection___ extends QItemSelection { | |
538 | |
539 public static void split(QItemSelectionRange range, QItemSelectionRange other, QItemSelection result) { | |
540 qt.QNativePointer np = result.nativePointer(); | |
541 split(range, other, np); | |
542 } | |
543 | |
544 }// class | |
545 | |
546 class QPainterPath_Element___ extends QPainterPath_Element { | |
547 /* | |
548 @QtBlockedSlot | |
549 public final qt.core.QPointF toPoint() { | |
550 return operator_cast_QPointF(); | |
551 } | |
552 */ | |
553 }// class | |
554 | |
555 class QBrush___ extends QBrush { | |
556 /* | |
557 public static final QBrush NoBrush = new QBrush(qt.core.Qt.BrushStyle.NoBrush); | |
558 */ | |
559 }// class | |
560 | |
561 class QAbstractItemView___ extends QAbstractItemView { | |
562 | |
563 private QAbstractItemDelegate[int] __rcDelegatesForColumns; | |
564 private QAbstractItemDelegate[int] __rcDelegatesForRows; | |
565 | |
566 }// class | |
567 | |
568 class QAccessibleTableInterface___ extends QAccessibleTableInterface { | |
569 | |
570 public static class CellAtIndex extends QTableArea { | |
571 public CellAtIndex(int row, int column, int rowSpan, int columnSpan, boolean isSelected) { | |
572 super(row, column, rowSpan, columnSpan); | |
573 this.isSelected = isSelected; | |
574 } | |
575 | |
576 public boolean isSelected; | |
577 } | |
578 | |
579 }// class | |
580 | |
581 class QAccessibleInterface___ extends QAccessibleInterface { | |
582 | |
583 public static class Target { | |
584 public Target(int childIndex, QAccessibleInterface target) { | |
585 this.childIndex = childIndex; | |
586 this.target = target; | |
587 } | |
588 | |
589 public QAccessibleInterface target; | |
590 public int childIndex; | |
591 } | |
592 | |
593 }// class | |
594 | |
595 class QDesktopServices___ extends QDesktopServices { | |
596 | |
597 private static java.util.Hashtable<String, InternalUrlHandler> __rcUrlHandlers = new java.util.Hashtable<String, InternalUrlHandler>(); | |
598 | |
599 public static interface UrlHandler { | |
600 public void handleUrl(qt.core.QUrl url); | |
601 } | |
602 | |
603 private static class InternalUrlHandler extends qt.core.QObject { | |
604 | |
605 private UrlHandler urlHandler; | |
606 | |
607 private InternalUrlHandler(UrlHandler urlHandler) { | |
608 this.urlHandler = urlHandler; | |
609 } | |
610 | |
611 private void handleUrl(qt.core.QUrl url) { | |
612 urlHandler.handleUrl(url); | |
613 } | |
614 | |
615 } | |
616 | |
617 public static void setUrlHandler(String scheme, UrlHandler urlHandler) { | |
618 InternalUrlHandler receiver = urlHandler != null ? new InternalUrlHandler(urlHandler) : null; | |
619 | |
620 if (receiver == null) | |
621 __rcUrlHandlers.remove(scheme); | |
622 else | |
623 __rcUrlHandlers.put(scheme, receiver); | |
624 setUrlHandler(scheme, receiver, QNativePointer.createCharPointer("handleUrl")); | |
625 } | |
626 | |
627 }// class | |
628 | |
629 class QWizardPage___ extends QWizardPage { | |
630 | |
631 protected final void registerField(String name, QWidget widget) { | |
632 registerField(name, widget, (qt.QNativePointer) null, (qt.QNativePointer) null); | |
633 } | |
634 | |
635 protected final void registerField(String name, QWidget widget, String property) { | |
636 registerField(name, widget, QNativePointer.createCharPointer(property), null); | |
637 } | |
638 | |
639 /** | |
640 * Creates a field called <code>name</code> associated with the given | |
641 * property of the given widget. From then on, that property becomes | |
642 * accessible using <code>field()</code> and <code>setField()</code>. | |
643 * Fields are global to the entire wizard and make it easy for any single | |
644 * page to access information stored by another page, without having to put | |
645 * all the logic in <code>QWizard</code> or having the pages know | |
646 * explicitly about each other. If name ends with an asterisk (*), the field | |
647 * is a mandatory field. When a page has mandatory fields, the Next and/or | |
648 * Finish buttons are enabled only when all mandatory fields are filled. | |
649 * This requires a <code>changedSignal</code> to be specified, to tell | |
650 * QWizard to recheck the value stored by the mandatory field. | |
651 * | |
652 * QWizard knows the most common Qt widgets. For these (or their | |
653 * subclasses), you don't need to specify a <code>property</code> or a | |
654 * <code>changedSignal</code>. The table below lists these widgets: | |
655 * | |
656 * <code>QAbstractButton</code> (for which the relevant property is the | |
657 * <code>checked</code> property), <code>QAbstractSlider</code> (the | |
658 * <code>value</code> property), <code>QComboBox</code> (<code>currentIndex</code> | |
659 * property), <code>QDateTimeEdit</code>(<code>dateTime</code> | |
660 * property), <code>QLineEdit</code>(<code>text</code> property), | |
661 * <code>QListWidget</code>(<code>currentRow</code> property), or | |
662 * <code>QSpinBox</code>(<code>value</code> property). | |
663 * | |
664 * @param name | |
665 * The name which will be used to access the field. Names ending | |
666 * with an asterisk signify mandatory fields. | |
667 * @param widget | |
668 * The widget whose property will be accessed using this field. | |
669 * @param property | |
670 * The name of the property associated with the field. | |
671 * @param changedSignal | |
672 * The name of a signal which is emitted when the associated | |
673 * property's value changes. | |
674 * | |
675 * @see qt.gui.QWizardPage#field | |
676 * @see qt.gui.QWizardPage#setField | |
677 */ | |
678 protected final void registerField(String name, QWidget widget, String property, String changedSignal) { | |
679 String signalSignature = qt.internal.MetaObjectTools.cppSignalSignature(widget, changedSignal); | |
680 if (signalSignature.length() == 0) | |
681 throw new QNoSuchSignalException("Signal '" + changedSignal | |
682 + "' does not exist or has argument types that cannot be converted to Qt Jambi or java.lang types."); | |
683 registerField(name, widget, qt.QNativePointer.createCharPointer(property), qt.QNativePointer | |
684 .createCharPointer(qt.internal.QtJambiInternal.SignalPrefix + signalSignature)); | |
685 } | |
686 | |
687 }// class | |
688 | |
689 class QFontDialog___ extends QFontDialog { | |
690 | |
691 public static final class Result { | |
692 public Result(QFont font, boolean ok) { | |
693 this.font = font; | |
694 this.ok = ok; | |
695 } | |
696 | |
697 public QFont font; | |
698 public boolean ok; | |
699 } | |
700 | |
701 }// class | |
702 | |
703 class QMenu___ extends QMenu { | |
704 /* | |
705 protected final void initStyleOption(qt.gui.QStyleOptionMenuItem option, QAction action) { | |
706 initStyleOption(option.nativePointer(), action); | |
707 } | |
708 */ | |
709 alias QWidget.addAction addAction; | |
710 }// class | |
711 | |
712 class QMenuBar___ extends QMenuBar { | |
713 | |
714 | |
715 }// class | |
716 | |
717 class QToolBar___ extends QToolBar { | |
718 /* | |
719 protected final void initStyleOption(qt.gui.QStyleOptionMenuItem option, QAction action) { | |
720 initStyleOption(option.nativePointer(), action); | |
721 } | |
722 */ | |
723 alias QWidget.addAction addAction; | |
724 }// class | |
725 | |
726 class QPixmapCache___ extends QPixmapCache { | |
727 | |
728 public static boolean find(String key, QPixmap pm) { | |
729 return find(key, pm.nativePointer()); | |
730 } | |
731 | |
732 }// class | |
733 | |
734 class QShortcut___ extends QShortcut { | |
735 | |
736 public QShortcut(QKeySequence key, QWidget parent) { | |
737 this(key, parent, null, null, qt.core.Qt.ShortcutContext.WindowShortcut); | |
738 } | |
739 | |
740 public QShortcut(QKeySequence key, QWidget parent, qt.core.Qt.ShortcutContext context) { | |
741 this(key, parent, null, null, context); | |
742 } | |
743 | |
744 }// class | |
745 | |
746 class QValidator___ extends QValidator { | |
747 | |
748 public static class QValidationData { | |
749 public QValidationData(String input, int pos) { | |
750 string = input; | |
751 position = pos; | |
752 } | |
753 | |
754 public String string; | |
755 public int position; | |
756 } | |
757 | |
758 }// class | |
759 | |
760 class QAbstractButton___ extends QAbstractButton { | |
761 | |
762 /** | |
763 * Sets the shortcut to the key sequence for the given key string. For | |
764 * example "Ctrl+O" gives CTRL+'O'. The strings "Ctrl", "Shift", "Alt" and | |
765 * "Meta" are recognized, as well as their translated equivalents in the | |
766 * "QShortcut" context (using QObject::tr()). Up to four key codes may be | |
767 * entered by separating them with commas, e.g. "Alt+X,Ctrl+S,Q". | |
768 * | |
769 * @param key | |
770 * The description of the key sequence. Typically used with tr() | |
771 * so key sequences can be locale aware. | |
772 */ | |
773 public final void setShortcut(string key) { | |
774 setShortcut(new QKeySequence(key)); | |
775 } | |
776 | |
777 /** | |
778 * Sets the shortcut to the key sequence for the given key. The result will | |
779 * depend on the currently running platform. The key sequence will be based | |
780 * on the first element in the list of key bindings for the key. | |
781 * | |
782 * @param key | |
783 * The key for which to select a key sequence | |
784 */ | |
785 public final void setShortcut(QKeySequence.StandardKey key) { | |
786 setShortcut(new QKeySequence(key)); | |
787 } | |
788 | |
789 }// class | |
790 | |
791 class QStyle___ extends QStyle { | |
792 /* | |
793 @QtBlockedSlot | |
794 public final int combinedLayoutSpacing(QSizePolicy.ControlTypes controls1, QSizePolicy.ControlTypes controls2, | |
795 qt.core.Qt.Orientation orientation, QStyleOption option, QWidget widget) { | |
796 return combinedLayoutSpacing(controls1, controls2, orientation, option == null ? null : option.nativePointer(), widget); | |
797 } | |
798 | |
799 @QtBlockedSlot | |
800 public final int combinedLayoutSpacing(QSizePolicy.ControlTypes controls1, QSizePolicy.ControlTypes controls2, | |
801 qt.core.Qt.Orientation orientation, QStyleOption option) { | |
802 return combinedLayoutSpacing(controls1, controls2, orientation, option, null); | |
803 } | |
804 | |
805 @QtBlockedSlot | |
806 public final int combinedLayoutSpacing(QSizePolicy.ControlTypes controls1, QSizePolicy.ControlTypes controls2, | |
807 qt.core.Qt.Orientation orientation) { | |
808 return combinedLayoutSpacing(controls1, controls2, orientation, null); | |
809 } | |
810 | |
811 @QtBlockedSlot | |
812 public final int layoutSpacing(QSizePolicy.ControlType control1, QSizePolicy.ControlType control2, qt.core.Qt.Orientation orientation, | |
813 QStyleOption option, QWidget widget) { | |
814 return layoutSpacing(control1, control2, orientation, option == null ? null : option.nativePointer(), widget); | |
815 } | |
816 | |
817 @QtBlockedSlot | |
818 public final int layoutSpacing(QSizePolicy.ControlType control1, QSizePolicy.ControlType control2, qt.core.Qt.Orientation orientation, | |
819 QStyleOption option) { | |
820 return layoutSpacing(control1, control2, orientation, option, null); | |
821 } | |
822 | |
823 @QtBlockedSlot | |
824 public final int layoutSpacing(QSizePolicy.ControlType control1, QSizePolicy.ControlType control2, qt.core.Qt.Orientation orientation) { | |
825 return layoutSpacing(control1, control2, orientation, null); | |
826 } | |
827 */ | |
828 }// class | |
829 | |
830 class QLayout___ extends QLayout { | |
831 /* | |
832 @QtBlockedSlot | |
833 public final QContentsMargins getContentsMargins() { | |
834 QNativePointer left = new QNativePointer(QNativePointer.Type.Int); | |
835 QNativePointer top = new QNativePointer(QNativePointer.Type.Int); | |
836 QNativePointer right = new QNativePointer(QNativePointer.Type.Int); | |
837 QNativePointer bottom = new QNativePointer(QNativePointer.Type.Int); | |
838 | |
839 getContentsMargins(left, top, right, bottom); | |
840 return new QContentsMargins(left.intValue(), top.intValue(), right.intValue(), bottom.intValue()); | |
841 } | |
842 | |
843 @QtBlockedSlot | |
844 public final void setContentsMargins(QContentsMargins margins) { | |
845 setContentsMargins(margins.left, margins.top, margins.right, margins.bottom); | |
846 } | |
847 */ | |
848 }// class | |
849 | |
850 class QGridLayout___ extends QGridLayout { | |
851 /* | |
852 public final QTableArea getItemPosition(int index) { | |
853 QNativePointer row = new QNativePointer(QNativePointer.Type.Int); | |
854 QNativePointer column = new QNativePointer(QNativePointer.Type.Int); | |
855 QNativePointer rowSpan = new QNativePointer(QNativePointer.Type.Int); | |
856 QNativePointer columnSpan = new QNativePointer(QNativePointer.Type.Int); | |
857 | |
858 getItemPosition(index, row, column, rowSpan, columnSpan); | |
859 | |
860 return new QTableArea(row.intValue(), column.intValue(), rowSpan.intValue(), columnSpan.intValue()); | |
861 } | |
862 */ | |
863 }// class | |
864 | |
865 class QWidget___ extends QWidget { | |
866 /* | |
867 private native static void __qt_QMessageBox_setWindowTitle(long native_id, String windowTitle); | |
868 | |
869 private native static void __qt_QMessageBox_setWindowModality(long native_id, int modality); | |
870 | |
871 @QtBlockedSlot | |
872 public final QContentsMargins getContentsMargins() { | |
873 QNativePointer left = new QNativePointer(QNativePointer.Type.Int); | |
874 QNativePointer top = new QNativePointer(QNativePointer.Type.Int); | |
875 QNativePointer right = new QNativePointer(QNativePointer.Type.Int); | |
876 QNativePointer bottom = new QNativePointer(QNativePointer.Type.Int); | |
877 | |
878 getContentsMargins(left, top, right, bottom); | |
879 return new QContentsMargins(left.intValue(), top.intValue(), right.intValue(), bottom.intValue()); | |
880 } | |
881 | |
882 @QtBlockedSlot | |
883 public final void setContentsMargins(QContentsMargins margins) { | |
884 setContentsMargins(margins.left, margins.top, margins.right, margins.bottom); | |
885 } | |
886 */ | |
887 }// class | |
888 | |
889 class QFileDialog___ extends QFileDialog { | |
890 | |
891 public static string getOpenFileName(QWidget _parent, string caption = null, string dir = null, string filter = null) { | |
892 string res; | |
893 string _selectedFilter = ""; | |
894 qtd_QFileDialog_getOpenFileName_QWidget_string_string_string_nativepointerstring_Options(&res, _parent is null ? null : _parent.nativeId, caption.ptr, caption.length, dir.ptr, dir.length, filter.ptr, filter.length, _selectedFilter.ptr, _selectedFilter.length, 0); | |
895 return res; | |
896 } | |
897 | |
898 public static string getSaveFileName(QWidget _parent, string caption = null, string dir = null, string filter = null) { | |
899 string res; | |
900 string _selectedFilter = ""; | |
901 qtd_QFileDialog_getSaveFileName_QWidget_string_string_string_nativepointerstring_Options(&res, _parent is null ? null : _parent.nativeId, caption.ptr, caption.length, dir.ptr, dir.length, filter.ptr, filter.length, _selectedFilter.ptr, _selectedFilter.length, 0); | |
902 return res; | |
903 } | |
904 | |
905 public static class Filter { | |
906 public this(string filter) { | |
907 this.filter = filter; | |
908 } | |
909 | |
910 public string filter; | |
911 public string selectedFilter = ""; | |
912 } | |
913 | |
914 }// class | |
915 | |
916 class QTabBar___ extends QTabBar { | |
917 | |
918 public final void initStyleOption(QStyleOptionTab option, int tabIndex) { | |
919 initStyleOption(option.nativePointer(), tabIndex); | |
920 } | |
921 | |
922 }// class | |
923 | |
924 class QClipboard___ extends QClipboard { | |
925 /* | |
926 public static class Text { | |
927 public String text; | |
928 public String subtype; | |
929 } | |
930 | |
931 public final Text text(String subtype, Mode mode) { | |
932 QNativePointer np = new QNativePointer(QNativePointer.Type.String); | |
933 np.setStringValue(subtype != null ? subtype : ""); | |
934 | |
935 Text returned = new Text(); | |
936 returned.text = text(np, mode); | |
937 returned.subtype = np.stringValue(); | |
938 return returned; | |
939 } | |
940 | |
941 public final Text text(String subtype) { | |
942 return text(subtype, Mode.Clipboard); | |
943 } | |
944 */ | |
945 }// class | |
946 | |
947 class QAbstractScrollArea___ extends QAbstractScrollArea { | |
948 /* | |
949 public QPaintEngine paintEngine() { | |
950 throw new RuntimeException("Cannot open a painter directly on a QAbstractScrollArea, open QPainter on its viewport instead..."); | |
951 } | |
952 */ | |
953 }// class | |
954 | |
955 class QTextDocument___ extends QTextDocument { | |
956 | |
957 public final void redo(QTextCursor cursor) { | |
958 redo(cursor.nativePointer()); | |
959 } | |
960 | |
961 public final void undo(QTextCursor cursor) { | |
962 undo(cursor.nativePointer()); | |
963 } | |
964 | |
965 }// class | |
966 | |
967 class QSplitter___ extends QSplitter { | |
968 | |
969 public struct Range { | |
970 public static Range opCall(int min, int max) { | |
971 Range rng; | |
972 rng.minimum = min; | |
973 rng.maximum = max; | |
974 return rng; | |
975 } | |
976 | |
977 public int minimum; | |
978 public int maximum; | |
979 } | |
980 | |
981 public final Range getRange(int index) { | |
982 int* min; | |
983 int* max; | |
984 | |
985 getRange(index, min, max); | |
986 | |
987 return Range(*min, *max); | |
988 } | |
989 | |
990 }// class | |
991 | |
992 class QAction___ extends QAction { | |
993 | |
994 public final void setShortcut(string key) { | |
995 setShortcut(new QKeySequence(key)); | |
996 } | |
997 /* | |
998 private QActionGroup __rcActionGroup = null; | |
999 */ | |
1000 /** | |
1001 * Sets the shortcut to the key sequence for the given key string. For | |
1002 * example "Ctrl+O" gives CTRL+'O'. The strings "Ctrl", "Shift", "Alt" and | |
1003 * "Meta" are recognized, as well as their translated equivalents in the | |
1004 * "QShortcut" context (using QObject::tr()). Up to four key codes may be | |
1005 * entered by separating them with commas, e.g. "Alt+X,Ctrl+S,Q". | |
1006 * | |
1007 * @param key | |
1008 * The description of the key sequence. Typically used with tr() | |
1009 * so key sequences can be locale aware. | |
1010 */ | |
1011 /* public final void setShortcut(String key) { | |
1012 setShortcut(new QKeySequence(key)); | |
1013 } | |
1014 */ | |
1015 /** | |
1016 * Sets the shortcut to the key sequence for the given key. The result will | |
1017 * depend on the currently running platform. The key sequence will be based | |
1018 * on the first element in the list of key bindings for the key. | |
1019 * | |
1020 * @param key | |
1021 * The key for which to select a key sequence | |
1022 */ | |
1023 /* public final void setShortcut(QKeySequence.StandardKey key) { | |
1024 setShortcut(new QKeySequence(key)); | |
1025 } | |
1026 | |
1027 public final void setIcon(QPixmap pm) { | |
1028 setIcon(new QIcon(pm)); | |
1029 } | |
1030 */ | |
1031 }// class | |
1032 | |
1033 class QPainter___ extends QPainter { | |
1034 | |
1035 public final void setBrush(QColor color) { | |
1036 setBrush(new QBrush(color)); | |
1037 } | |
1038 | |
1039 public final void setBrush(QGradient gradient) { | |
1040 setBrush(new QBrush(gradient)); | |
1041 } | |
1042 | |
1043 public final void setBrush(QPixmap pm) { | |
1044 setBrush(new QBrush(pm)); | |
1045 } | |
1046 | |
1047 public final void drawConvexPolygon(QPoint[] points) { | |
1048 qtd_QPainter_drawConvexPolygon_nativepointerQPoint_int(nativeId, points.ptr, points.length); | |
1049 } | |
1050 | |
1051 public final void drawConvexPolygon(QPointF[] points) { | |
1052 qtd_QPainter_drawConvexPolygon_nativepointerQPointF_int(nativeId, points.ptr, points.length); | |
1053 } | |
3
323efbe5c2f7
native wrap of QLine and QLineF, fixes in opEquals, updated QPainter to the use of native structs
eldar
parents:
1
diff
changeset
|
1054 |
323efbe5c2f7
native wrap of QLine and QLineF, fixes in opEquals, updated QPainter to the use of native structs
eldar
parents:
1
diff
changeset
|
1055 public final void drawLines(QLine[] lines) { |
323efbe5c2f7
native wrap of QLine and QLineF, fixes in opEquals, updated QPainter to the use of native structs
eldar
parents:
1
diff
changeset
|
1056 qtd_QPainter_drawLines_nativepointerQLine_int(nativeId, lines.ptr, lines.length); |
323efbe5c2f7
native wrap of QLine and QLineF, fixes in opEquals, updated QPainter to the use of native structs
eldar
parents:
1
diff
changeset
|
1057 } |
323efbe5c2f7
native wrap of QLine and QLineF, fixes in opEquals, updated QPainter to the use of native structs
eldar
parents:
1
diff
changeset
|
1058 |
323efbe5c2f7
native wrap of QLine and QLineF, fixes in opEquals, updated QPainter to the use of native structs
eldar
parents:
1
diff
changeset
|
1059 public final void drawLines(QLineF[] lines) { |
323efbe5c2f7
native wrap of QLine and QLineF, fixes in opEquals, updated QPainter to the use of native structs
eldar
parents:
1
diff
changeset
|
1060 qtd_QPainter_drawLines_nativepointerQLineF_int(nativeId, lines.ptr, lines.length); |
323efbe5c2f7
native wrap of QLine and QLineF, fixes in opEquals, updated QPainter to the use of native structs
eldar
parents:
1
diff
changeset
|
1061 } |
323efbe5c2f7
native wrap of QLine and QLineF, fixes in opEquals, updated QPainter to the use of native structs
eldar
parents:
1
diff
changeset
|
1062 |
323efbe5c2f7
native wrap of QLine and QLineF, fixes in opEquals, updated QPainter to the use of native structs
eldar
parents:
1
diff
changeset
|
1063 public final void drawPolygon(QPoint[] points, Qt_FillRule fillRule = Qt_FillRule.OddEvenFill) { |
323efbe5c2f7
native wrap of QLine and QLineF, fixes in opEquals, updated QPainter to the use of native structs
eldar
parents:
1
diff
changeset
|
1064 qtd_QPainter_drawPolygon_nativepointerQPoint_int_FillRule(nativeId, points.ptr, points.length, fillRule); |
323efbe5c2f7
native wrap of QLine and QLineF, fixes in opEquals, updated QPainter to the use of native structs
eldar
parents:
1
diff
changeset
|
1065 } |
323efbe5c2f7
native wrap of QLine and QLineF, fixes in opEquals, updated QPainter to the use of native structs
eldar
parents:
1
diff
changeset
|
1066 |
323efbe5c2f7
native wrap of QLine and QLineF, fixes in opEquals, updated QPainter to the use of native structs
eldar
parents:
1
diff
changeset
|
1067 public final void drawPolygon(QPointF[] points, Qt_FillRule fillRule = Qt_FillRule.OddEvenFill) { |
323efbe5c2f7
native wrap of QLine and QLineF, fixes in opEquals, updated QPainter to the use of native structs
eldar
parents:
1
diff
changeset
|
1068 qtd_QPainter_drawPolygon_nativepointerQPointF_int_FillRule(nativeId, points.ptr, points.length, fillRule); |
323efbe5c2f7
native wrap of QLine and QLineF, fixes in opEquals, updated QPainter to the use of native structs
eldar
parents:
1
diff
changeset
|
1069 } |
323efbe5c2f7
native wrap of QLine and QLineF, fixes in opEquals, updated QPainter to the use of native structs
eldar
parents:
1
diff
changeset
|
1070 |
323efbe5c2f7
native wrap of QLine and QLineF, fixes in opEquals, updated QPainter to the use of native structs
eldar
parents:
1
diff
changeset
|
1071 public final void drawPolyline(QPoint[] points) { |
323efbe5c2f7
native wrap of QLine and QLineF, fixes in opEquals, updated QPainter to the use of native structs
eldar
parents:
1
diff
changeset
|
1072 qtd_QPainter_drawPolyline_nativepointerQPoint_int(nativeId, points.ptr, points.length); |
323efbe5c2f7
native wrap of QLine and QLineF, fixes in opEquals, updated QPainter to the use of native structs
eldar
parents:
1
diff
changeset
|
1073 } |
323efbe5c2f7
native wrap of QLine and QLineF, fixes in opEquals, updated QPainter to the use of native structs
eldar
parents:
1
diff
changeset
|
1074 |
323efbe5c2f7
native wrap of QLine and QLineF, fixes in opEquals, updated QPainter to the use of native structs
eldar
parents:
1
diff
changeset
|
1075 public final void drawPolyline(QPointF[] points) { |
323efbe5c2f7
native wrap of QLine and QLineF, fixes in opEquals, updated QPainter to the use of native structs
eldar
parents:
1
diff
changeset
|
1076 qtd_QPainter_drawPolyline_nativepointerQPointF_int(nativeId, points.ptr, points.length); |
323efbe5c2f7
native wrap of QLine and QLineF, fixes in opEquals, updated QPainter to the use of native structs
eldar
parents:
1
diff
changeset
|
1077 } |
323efbe5c2f7
native wrap of QLine and QLineF, fixes in opEquals, updated QPainter to the use of native structs
eldar
parents:
1
diff
changeset
|
1078 |
323efbe5c2f7
native wrap of QLine and QLineF, fixes in opEquals, updated QPainter to the use of native structs
eldar
parents:
1
diff
changeset
|
1079 public final void drawPoints(QPoint[] points) { |
323efbe5c2f7
native wrap of QLine and QLineF, fixes in opEquals, updated QPainter to the use of native structs
eldar
parents:
1
diff
changeset
|
1080 qtd_QPainter_drawPoints_nativepointerQPoint_int(nativeId, points.ptr, points.length); |
323efbe5c2f7
native wrap of QLine and QLineF, fixes in opEquals, updated QPainter to the use of native structs
eldar
parents:
1
diff
changeset
|
1081 } |
323efbe5c2f7
native wrap of QLine and QLineF, fixes in opEquals, updated QPainter to the use of native structs
eldar
parents:
1
diff
changeset
|
1082 |
323efbe5c2f7
native wrap of QLine and QLineF, fixes in opEquals, updated QPainter to the use of native structs
eldar
parents:
1
diff
changeset
|
1083 public final void drawPoints(QPointF[] points) { |
323efbe5c2f7
native wrap of QLine and QLineF, fixes in opEquals, updated QPainter to the use of native structs
eldar
parents:
1
diff
changeset
|
1084 qtd_QPainter_drawPoints_nativepointerQPointF_int(nativeId, points.ptr, points.length); |
323efbe5c2f7
native wrap of QLine and QLineF, fixes in opEquals, updated QPainter to the use of native structs
eldar
parents:
1
diff
changeset
|
1085 } |
323efbe5c2f7
native wrap of QLine and QLineF, fixes in opEquals, updated QPainter to the use of native structs
eldar
parents:
1
diff
changeset
|
1086 |
1 | 1087 /* |
1088 public static QPaintDeviceInterface redirected(QPaintDeviceInterface device, qt.core.QPoint offset) { | |
1089 return redirected(device, offset == null ? null : offset.nativePointer()); | |
1090 } | |
1091 | |
1092 public QPainter(QWidget widget) { | |
1093 this(); | |
1094 begin(widget); | |
1095 } | |
1096 | |
1097 public boolean begin(QWidget widget) { // can't be final because of QStylePainter | |
1098 return qt.QtJambiGuiInternal.beginPaint(widget, this); | |
1099 } | |
1100 | |
1101 private static java.util.Stack<QPaintDeviceInterface> __rcRedirections = new java.util.Stack<QPaintDeviceInterface>(); | |
1102 */ | |
1103 }// class | |
1104 | |
1105 class QApplication___ extends QApplication { | |
1106 | |
1107 this(in string[] args) | |
1108 { | |
1109 // if (m_instance != null) | |
1110 // throw new RuntimeException("QCoreApplication can only be initialized once"); | |
1111 | |
1112 argc = args.length; | |
1113 argv = toStringzArray(args); | |
1114 this(&argc, argv); | |
1115 | |
1116 // m_instance.aboutToQuit.connect(m_instance, "disposeOfMyself()"); | |
1117 } | |
1118 | |
1119 private int argc; | |
1120 private char **argv; | |
1121 | |
1122 /* public static QApplication instance() { | |
1123 if (type() != Type.Tty) | |
1124 return (QApplication) qt.core.QCoreApplication.instance(); | |
1125 return null; | |
1126 } | |
1127 | |
1128 public QApplication(String args[]) { | |
1129 this(argc(args), argv(args)); | |
1130 } | |
1131 | |
1132 public static void setFont(QFont font) { | |
1133 setFont(font, null); | |
1134 } | |
1135 | |
1136 public static void setPalette(QPalette palette) { | |
1137 setPalette(palette, null); | |
1138 } | |
1139 | |
1140 public static QCursor overrideCursor() { | |
1141 QNativePointer np = overrideCursor_private(); | |
1142 return np == null ? null : QCursor.fromNativePointer(np); | |
1143 } | |
1144 */ | |
1145 }// class | |
1146 | |
1147 class QFormLayout___ extends QFormLayout { | |
1148 | |
1149 /** | |
1150 * Retrieves the row and role (column) of the item at the specified index. | |
1151 * If index is out of bounds, -1 is returned in place of the row. | |
1152 * | |
1153 * @param index The index of the item for which to retrieve the position. | |
1154 * @return A pair of an int (row of item) and an ItemRole (role of the item.) | |
1155 **/ | |
1156 /* @QtBlockedSlot | |
1157 public final qt.QPair<Integer, ItemRole> getItemPosition(int index) { | |
1158 qt.QNativePointer row = new qt.QNativePointer(qt.QNativePointer.Type.Int); | |
1159 qt.QNativePointer role = new qt.QNativePointer(qt.QNativePointer.Type.Int); | |
1160 | |
1161 getItemPosition(index, row, role); | |
1162 | |
1163 return new qt.QPair<Integer, ItemRole>(row.intValue(), ItemRole.resolve(role.intValue())); | |
1164 } | |
1165 */ | |
1166 /** | |
1167 * Retrieves the row and role (column) of the specified child layout. | |
1168 * If the layout is not in the form layout, -1 is returned in place of the row. | |
1169 * | |
1170 * @param layout The layout for which to retrieve the position. | |
1171 * @return A pair of an int (row of item) and an ItemRole (role of the item.) | |
1172 */ | |
1173 /* @QtBlockedSlot | |
1174 public final qt.QPair<Integer, ItemRole> getLayoutPosition(QLayout layout) { | |
1175 qt.QNativePointer row = new qt.QNativePointer(qt.QNativePointer.Type.Int); | |
1176 qt.QNativePointer role = new qt.QNativePointer(qt.QNativePointer.Type.Int); | |
1177 | |
1178 getLayoutPosition(layout, row, role); | |
1179 | |
1180 return new qt.QPair<Integer, ItemRole>(row.intValue(), ItemRole.resolve(role.intValue())); | |
1181 } | |
1182 */ | |
1183 /** | |
1184 * Retrieves the row and role (column) of the specified widget in the layout. | |
1185 * If the widget is not in the form layout, -1 is returned in place of the row. | |
1186 * | |
1187 * @param widget The widget for which to retrieve the position. | |
1188 * @return A pair of an int (row of item) and an ItemRole (role of the item.) | |
1189 */ | |
1190 /* @QtBlockedSlot | |
1191 public final qt.QPair<Integer, ItemRole> getWidgetPosition(QWidget widget) { | |
1192 qt.QNativePointer row = new qt.QNativePointer(qt.QNativePointer.Type.Int); | |
1193 qt.QNativePointer role = new qt.QNativePointer(qt.QNativePointer.Type.Int); | |
1194 | |
1195 getWidgetPosition(widget, row, role); | |
1196 | |
1197 return new qt.QPair<Integer, ItemRole>(row.intValue(), ItemRole.resolve(role.intValue())); | |
1198 } | |
1199 */ | |
1200 /** | |
1201 * Sets the item in the given row for the given role to item, extending the layout with empty rows if necessary. | |
1202 * If the cell is already occupied, the item is not inserted and a IllegalArgumentException is thrown. | |
1203 */ | |
1204 /* @QtBlockedSlot | |
1205 public final void setItem(int row, ItemRole role, QLayoutItem item) { | |
1206 if (itemAt(row, role) == null) | |
1207 setItem_private(row, role, item); | |
1208 else | |
1209 throw new IllegalArgumentException("Cell in form layout is already occupied"); | |
1210 } | |
1211 */ | |
1212 }// class | |
1213 | |
1214 class Subclass_of_QGraphicsLayoutItem___ extends QGraphicsLayoutItem { | |
1215 /* | |
1216 @QtBlockedSlot | |
1217 public final QMarginsF getContentsMargins() { | |
1218 QNativePointer left = new QNativePointer(QNativePointer.Type.Double); | |
1219 QNativePointer top = new QNativePointer(QNativePointer.Type.Double); | |
1220 QNativePointer right = new QNativePointer(QNativePointer.Type.Double); | |
1221 QNativePointer bottom = new QNativePointer(QNativePointer.Type.Double); | |
1222 | |
1223 getContentsMargins(left, top, right, bottom); | |
1224 return new QMarginsF(left.doubleValue(), top.doubleValue(), right.doubleValue(), bottom.doubleValue()); | |
1225 }*/ | |
1226 }// class | |
1227 | |
1228 class QGraphicsWidget___ extends QGraphicsWidget { | |
1229 | |
1230 /* | |
1231 * Gets the widget's window frame margins. | |
1232 * | |
1233 * @returns An object containing the margins in left, right, top and bottom coordinates. | |
1234 | |
1235 @QtBlockedSlot | |
1236 public final QMarginsF getWindowFrameMargins() { | |
1237 QNativePointer left = new QNativePointer(QNativePointer.Type.Double); | |
1238 QNativePointer top = new QNativePointer(QNativePointer.Type.Double); | |
1239 QNativePointer right = new QNativePointer(QNativePointer.Type.Double); | |
1240 QNativePointer bottom = new QNativePointer(QNativePointer.Type.Double); | |
1241 | |
1242 getWindowFrameMargins(left, top, right, bottom); | |
1243 return new QMarginsF(left.doubleValue(), top.doubleValue(), right.doubleValue(), bottom.doubleValue()); | |
1244 } | |
1245 */ | |
1246 | |
1247 }// class | |
1248 | |
1249 class QPrinter___ extends QPrinter { | |
1250 | |
1251 /** | |
1252 * Returns the page margins for this printer. | |
1253 * The unit of the returned margins are specified with the unit parameter. | |
1254 * This function was introduced in Qt 4.4. | |
1255 * | |
1256 * @param unit Specifies the unit of the returned margins. | |
1257 * @return The page margins for this printer. | |
1258 */ | |
1259 /* public final QMarginsF getPageMargins(QPrinter.Unit unit) { | |
1260 QNativePointer left = new QNativePointer(QNativePointer.Type.Double); | |
1261 QNativePointer top = new QNativePointer(QNativePointer.Type.Double); | |
1262 QNativePointer right = new QNativePointer(QNativePointer.Type.Double); | |
1263 QNativePointer bottom = new QNativePointer(QNativePointer.Type.Double); | |
1264 | |
1265 getPageMargins(left, top, right, bottom, unit); | |
1266 return new QMarginsF(left.doubleValue(), top.doubleValue(), right.doubleValue(), bottom.doubleValue()); | |
1267 }*/ | |
1268 | |
1269 }// class | |
1270 | |
1271 class QListWidget___ extends QListWidget { | |
1272 | |
1273 /** | |
1274 * Inserts items with the text labels at the end of the list widget. | |
1275 * | |
1276 * @param labels The collection of labels for the new items. | |
1277 */ | |
1278 public final void addItems(string[] labels) { | |
1279 foreach (label; labels) | |
1280 addItem(label); | |
1281 } | |
1282 | |
1283 /** | |
1284 * This is an overloaded member function, provided for convenience. | |
1285 * Inserts an item with the text label in the list widget at the position given by row. | |
1286 * | |
1287 * @param row The position in which to insert the new item. | |
1288 * @param label The text of the new item. | |
1289 */ | |
1290 public final void insertItem(int row, string label) { | |
1291 insertItem(row, new QListWidgetItem(label, this)); | |
1292 } | |
1293 | |
1294 /** | |
1295 * Inserts items from the list of labels into the list, starting at the given row. | |
1296 * | |
1297 * @param row The position in which to insert the new items. | |
1298 * @param labels The collection of labels for the new items. | |
1299 */ | |
1300 public final void insertItems(int row, string[] labels) { | |
1301 foreach (label; labels) | |
1302 insertItem(row++, label); | |
1303 } | |
1304 }// class | |
1305 | |
1306 | |
1307 class QGraphicsScene___ extends QGraphicsScene { | |
1308 /** | |
1309 * Equivalent to addEllipse(rect, null, null) | |
1310 */ | |
1311 /*public final QGraphicsEllipseItem addEllipse(qt.core.QRectF rect) | |
1312 { | |
1313 return addEllipse(rect, null); | |
1314 }*/ | |
1315 | |
1316 /** | |
1317 * Equivalent to addEllipse(rect, pen, null) | |
1318 */ | |
1319 /* public final QGraphicsEllipseItem addEllipse(qt.core.QRectF rect, QPen pen) | |
1320 { | |
1321 return addEllipse(rect, pen, null); | |
1322 }*/ | |
1323 | |
1324 | |
1325 /** | |
1326 * Creates and adds an ellipse item to the scene, and returns the item | |
1327 * reference. The geometry of the ellipse is defined by rect, and its pen | |
1328 * and brush are initialized to pen and brush. | |
1329 * | |
1330 * Note that the item's geometry is provided in item coordinates, and its | |
1331 * position is initialized to (0, 0). | |
1332 * | |
1333 * If the item is visible (i.e., QGraphicsItem::isVisible() returns true), | |
1334 * QGraphicsScene will emit changed() once control goes back to the event | |
1335 * loop. | |
1336 * | |
1337 * @param rect The bounding rectangle of the ellipse. | |
1338 * @param pen The pen for the resulting QGraphicsEllipseItem. | |
1339 * @param brush The brush for the resulting QGraphicsEllipseItem. | |
1340 * @return The resulting item. | |
1341 */ | |
1342 /* public final QGraphicsEllipseItem addEllipse(qt.core.QRectF rect, QPen pen, QBrush brush) | |
1343 { | |
1344 return addEllipse(rect.x(), rect.y(), rect.width(), rect.height(), pen, brush); | |
1345 }*/ | |
1346 | |
1347 /** | |
1348 * Equivalent to addEllipse(x, y, w, h, null, null) | |
1349 */ | |
1350 /* public final QGraphicsEllipseItem addEllipse(double x, double y, double w, double h) { | |
1351 return addEllipse(x, y, w, h, null); | |
1352 }*/ | |
1353 | |
1354 /** | |
1355 * Equivalent to addEllipse(x, y, w, h, pen, null) | |
1356 */ | |
1357 /* public final QGraphicsEllipseItem addEllipse(double x, double y, double w, double h, QPen pen) | |
1358 { | |
1359 return addEllipse(x, y, w, h, pen, null); | |
1360 }*/ | |
1361 | |
1362 /** | |
1363 * Creates and adds an ellipse item to the scene, and returns the item | |
1364 * reference. The geometry of the ellipse is defined by x, y, w, h, and its pen | |
1365 * and brush are initialized to pen and brush. | |
1366 * | |
1367 * Note that the item's geometry is provided in item coordinates, and its | |
1368 * position is initialized to (0, 0). | |
1369 * | |
1370 * If the item is visible (i.e., QGraphicsItem.isVisible() returns true), | |
1371 * QGraphicsScene will emit changed once control goes back to the event | |
1372 * loop. | |
1373 * | |
1374 * @param x The left horizontal coordinate of the ellipse's bounding rectangle. | |
1375 * @param y The top vertical coordinate of the ellipse's bounding rectangle. | |
1376 * @param w The width of the ellipse's bounding rectangle. | |
1377 * @param h The height of the ellipse's bounding rectangle. | |
1378 * @param pen The pen for the resulting QGraphicsEllipseItem. | |
1379 * @param brush The brush for the resulting QGraphicsEllipseItem. | |
1380 * @return The resulting item. | |
1381 */ | |
1382 /* public final QGraphicsEllipseItem addEllipse(double x, double y, double w, double h, QPen pen, QBrush brush) | |
1383 { | |
1384 QGraphicsEllipseItem item = new QGraphicsEllipseItem(x, y, w, h); | |
1385 item.setPen(pen); | |
1386 item.setBrush(brush); | |
1387 | |
1388 addItem(item); | |
1389 | |
1390 return item; | |
1391 }*/ | |
1392 | |
1393 /** | |
1394 * Equivalent to addLine(line, null) | |
1395 */ | |
1396 /* public final QGraphicsLineItem addLine(QLineF line) { | |
1397 return addLine(line, null); | |
1398 }*/ | |
1399 | |
1400 /** | |
1401 * Creates and adds a line item to the scene, and returns the item | |
1402 * reference. The geometry of the line is defined by line, and its pen | |
1403 * is initialized to pen. | |
1404 * | |
1405 * Note that the item's geometry is provided in item coordinates, and its | |
1406 * position is initialized to (0, 0). | |
1407 * | |
1408 * If the item is visible (i.e., QGraphicsItem.isVisible() returns true), | |
1409 * QGraphicsScene will emit changed once control goes back to the event | |
1410 * loop. | |
1411 * | |
1412 * @param line The definition of the line. | |
1413 * @param pen The pen with which to draw the line. | |
1414 * @return The resulting item. | |
1415 */ | |
1416 /* public final QGraphicsLineItem addLine(QLineF line, QPen pen) | |
1417 { | |
1418 return addLine(line.x1(), line.y1(), line.x2(), line.y2(), pen); | |
1419 }*/ | |
1420 | |
1421 /** | |
1422 * Equivalent to addLine(x1, y1, x2, y2, null) | |
1423 */ | |
1424 /* public final QGraphicsLineItem addLine(double x1, double y1, double x2, double y2) { | |
1425 return addLine(x1, y1, x2, y2, null); | |
1426 }*/ | |
1427 | |
1428 /** | |
1429 * Creates and adds a line item to the scene, and returns the item | |
1430 * reference. The geometry of the line is defined by x1, y1, x2, y2, and its pen | |
1431 * is initialized to pen. | |
1432 * | |
1433 * Note that the item's geometry is provided in item coordinates, and its | |
1434 * position is initialized to (0, 0). | |
1435 * | |
1436 * If the item is visible (i.e., QGraphicsItem.isVisible() returns true), | |
1437 * QGraphicsScene will emit changed once control goes back to the event | |
1438 * loop. | |
1439 * | |
1440 * @param x1 The first horizontal coordinate of the line. | |
1441 * @param y1 The first vertical coordinate of the line. | |
1442 * @param x2 The second horizontal coordinate of the line. | |
1443 * @param y2 The second vertical coordinate of the line. | |
1444 * @param pen The pen with which to draw the line. | |
1445 * @return The resulting item. | |
1446 */ | |
1447 /* public final QGraphicsLineItem addLine(double x1, double y1, double x2, double y2, QPen pen) | |
1448 { | |
1449 QGraphicsLineItem item = new QGraphicsLineItem(x1, y1, x2, y2); | |
1450 item.setPen(pen); | |
1451 | |
1452 addItem(item); | |
1453 | |
1454 return item; | |
1455 }*/ | |
1456 | |
1457 | |
1458 /** | |
1459 * Equivalent to addPath(path, null, null) | |
1460 */ | |
1461 /*public final QGraphicsPathItem addPath(QPainterPath path) { | |
1462 return addPath(path, null); | |
1463 }*/ | |
1464 | |
1465 /** | |
1466 * Equivalent to addPath(path, pen, null) | |
1467 */ | |
1468 /*public final QGraphicsPathItem addPath(QPainterPath path, QPen pen) | |
1469 { | |
1470 return addPath(path, pen, null); | |
1471 }*/ | |
1472 /** | |
1473 * Creates and adds a path item to the scene, and returns the item | |
1474 * reference. The geometry of the path is defined by path, and its pen and | |
1475 * brush are initialized to pen and brush. | |
1476 * | |
1477 * Note that the item's geometry is provided in item coordinates, and its | |
1478 * position is initialized to (0, 0). | |
1479 * | |
1480 * If the item is visible (i.e., QGraphicsItem.isVisible() returns true), | |
1481 * QGraphicsScene will emit changed once control goes back to the event | |
1482 * loop. | |
1483 * | |
1484 * @param path The definition of the path. | |
1485 * @param pen The pen for drawing the path. | |
1486 * @param brush The brush for drawing the path. | |
1487 * @return The resulting item. | |
1488 */ | |
1489 /* public final QGraphicsPathItem addPath(QPainterPath path, QPen pen, QBrush brush) | |
1490 { | |
1491 QGraphicsPathItem item = new QGraphicsPathItem(path); | |
1492 item.setPen(pen); | |
1493 item.setBrush(brush); | |
1494 | |
1495 addItem(item); | |
1496 | |
1497 return item; | |
1498 }*/ | |
1499 | |
1500 /** | |
1501 * Creates and adds a pixmap item to the scene, and returns the item | |
1502 * reference. The pixmap is defined by pixmap. | |
1503 * | |
1504 * Note that the item's geometry is provided in item coordinates, and its | |
1505 * position is initialized to (0, 0). | |
1506 * | |
1507 * If the item is visible (i.e., QGraphicsItem.isVisible() returns true), | |
1508 * QGraphicsScene will emit changed once control goes back to the event | |
1509 * loop. | |
1510 * | |
1511 * @param pixmap The pixmap for which to create a graphics item. | |
1512 * @return The resulting item. | |
1513 */ | |
1514 /* public final QGraphicsPixmapItem addPixmap(QPixmap pixmap) | |
1515 { | |
1516 QGraphicsPixmapItem item = new QGraphicsPixmapItem(pixmap); | |
1517 | |
1518 addItem(item); | |
1519 | |
1520 return item; | |
1521 }*/ | |
1522 | |
1523 /** | |
1524 * Equivalent to addPolygon(polygon, null, null) | |
1525 */ | |
1526 /* public final QGraphicsPolygonItem addPolygon(QPolygonF polygon) { | |
1527 return addPolygon(polygon, null); | |
1528 }*/ | |
1529 | |
1530 /** | |
1531 * Equivalent to addPolygon(polygon, pen, null) | |
1532 */ | |
1533 /* public final QGraphicsPolygonItem addPolygon(QPolygonF polygon, QPen pen) { | |
1534 return addPolygon(polygon, pen, null); | |
1535 }*/ | |
1536 | |
1537 /** | |
1538 * Creates and adds a polygon item to the scene, and returns the item | |
1539 * reference. The polygon is defined by polygon, and its pen and | |
1540 * brush are initialized to pen and brush. | |
1541 * | |
1542 * Note that the item's geometry is provided in item coordinates, and its | |
1543 * position is initialized to (0, 0). | |
1544 * | |
1545 * If the item is visible (i.e., QGraphicsItem.isVisible() returns true), | |
1546 * QGraphicsScene will emit changed once control goes back to the event | |
1547 * loop. | |
1548 * | |
1549 * @param polygon The definition of the polygon. | |
1550 * @param pen The pen with which to draw the polygon. | |
1551 * @param brush The brush with which to draw the polygon. | |
1552 * @return The resulting item. | |
1553 */ | |
1554 /* public final QGraphicsPolygonItem addPolygon(QPolygonF polygon, QPen pen, QBrush brush) | |
1555 { | |
1556 QGraphicsPolygonItem item = new QGraphicsPolygonItem(polygon); | |
1557 item.setPen(pen); | |
1558 item.setBrush(brush); | |
1559 | |
1560 addItem(item); | |
1561 | |
1562 return item; | |
1563 }*/ | |
1564 | |
1565 /** | |
1566 * Equivalent to addRect(rect, null, null) | |
1567 */ | |
1568 /* public final QGraphicsRectItem addRect(qt.core.QRectF rect) { | |
1569 return addRect(rect, null); | |
1570 }*/ | |
1571 | |
1572 /** | |
1573 * Equivalent to addRect(rect, pen, null) | |
1574 */ | |
1575 /* public final QGraphicsRectItem addRect(qt.core.QRectF rect, QPen pen) | |
1576 { | |
1577 return addRect(rect, pen, null); | |
1578 }*/ | |
1579 | |
1580 /** | |
1581 * Creates and adds a rectangle item to the scene, and returns the item | |
1582 * reference. The geometry of the rectangle is defined by rect, and its pen | |
1583 * and brush are initialized to pen and brush. | |
1584 * | |
1585 * Note that the item's geometry is provided in item coordinates, and its | |
1586 * position is initialized to (0, 0). For example, if a QRect(50, 50, 100, | |
1587 * 100) is added, its top-left corner will be at (50, 50) relative to the | |
1588 * origin in the item's coordinate system. | |
1589 * | |
1590 * If the item is visible (i.e., QGraphicsItem.isVisible() returns true), | |
1591 * QGraphicsScene will emit changed once control goes back to the event | |
1592 * loop. | |
1593 * | |
1594 * @param rect The definition of the rectangle. | |
1595 * @param pen The pen with which to draw the rectangle. | |
1596 * @param brush The brush with which to draw the rectangle. | |
1597 * @return The resulting item. | |
1598 */ | |
1599 /* public final QGraphicsRectItem addRect(qt.core.QRectF rect, QPen pen, QBrush brush) | |
1600 { | |
1601 return addRect(rect.x(), rect.y(), rect.width(), rect.height(), pen, brush); | |
1602 }*/ | |
1603 | |
1604 /** | |
1605 * Equivalent to addRect(x, y, w, h, null, null) | |
1606 */ | |
1607 /* public final QGraphicsRectItem addRect(double x, double y, double w, double h) { | |
1608 return addRect(x, y, w, h, null); | |
1609 }*/ | |
1610 | |
1611 /** | |
1612 * Equivalent to addRect(x, y, w, h, pen, null) | |
1613 */ | |
1614 /* public final QGraphicsRectItem addRect(double x, double y, double w, double h, QPen pen) { | |
1615 return addRect(x, y, w, h, pen, null); | |
1616 }*/ | |
1617 | |
1618 /** | |
1619 * Creates and adds a rectangle item to the scene, and returns the item | |
1620 * reference. The geometry of the rectangle is defined by x, y, w, h, and its pen | |
1621 * and brush are initialized to pen and brush. | |
1622 * | |
1623 * Note that the item's geometry is provided in item coordinates, and its | |
1624 * position is initialized to (0, 0). | |
1625 * | |
1626 * If the item is visible (i.e., QGraphicsItem.isVisible() returns true), | |
1627 * QGraphicsScene will emit changed once control goes back to the event | |
1628 * loop. | |
1629 * | |
1630 * @param x The left horizontal coordinate of the rectangle. | |
1631 * @param y The top vertical coordinate of the rectangle. | |
1632 * @param w The width of the rectangle. | |
1633 * @param h The height of the rectangle. | |
1634 * @param pen The pen with which to draw the rectangle. | |
1635 * @param brush The brush with which to draw the rectangle. | |
1636 * @return The resulting item. | |
1637 */ | |
1638 /* public final QGraphicsRectItem addRect(double x, double y, double w, double h, QPen pen, QBrush brush) | |
1639 { | |
1640 QGraphicsRectItem item = new QGraphicsRectItem(x, y, w, h); | |
1641 item.setPen(pen); | |
1642 item.setBrush(brush); | |
1643 | |
1644 addItem(item); | |
1645 | |
1646 return item; | |
1647 }*/ | |
1648 | |
1649 /** | |
1650 * Equivalent to addSimpleText(text, null) | |
1651 */ | |
1652 /*public final QGraphicsSimpleTextItem addSimpleText(String text) { | |
1653 return addSimpleText(text, null); | |
1654 }*/ | |
1655 | |
1656 /** | |
1657 * Creates and adds a QGraphicsSimpleTextItem to the scene, and returns the | |
1658 * item reference. The text string is initialized to text, and its font is | |
1659 * initialized to font. | |
1660 * | |
1661 * The item's position is initialized to (0, 0). | |
1662 * | |
1663 * If the item is visible (i.e., QGraphicsItem.isVisible() returns true), | |
1664 * QGraphicsScene will emit changed once control goes back to the event | |
1665 * loop. | |
1666 * | |
1667 * @param text The text to add to the scene. | |
1668 * @param font The font to use for displaying the text. | |
1669 * @return The resulting item. | |
1670 */ | |
1671 /* public final QGraphicsSimpleTextItem addSimpleText(String text, QFont font) | |
1672 { | |
1673 QGraphicsSimpleTextItem item = new QGraphicsSimpleTextItem(text); | |
1674 item.setFont(font); | |
1675 | |
1676 addItem(item); | |
1677 | |
1678 return item; | |
1679 }*/ | |
1680 | |
1681 /** | |
1682 * Equivalent to addText(text, null) | |
1683 */ | |
1684 /* public final QGraphicsTextItem addText(String text) { | |
1685 return addText(text, null); | |
1686 }*/ | |
1687 | |
1688 /** | |
1689 * Creates and adds a text item to the scene, and returns the item | |
1690 * reference. The text string is initialized to text, and its font | |
1691 * is initialized to font. | |
1692 * | |
1693 * The item's position is initialized to (0, 0). | |
1694 * | |
1695 * If the item is visible (i.e., QGraphicsItem.isVisible() returns true), | |
1696 * QGraphicsScene will emit changed once control goes back to the event | |
1697 * loop. | |
1698 * | |
1699 * @param text The text to add to the scene. | |
1700 * @param font The font to use for displaying the text. | |
1701 * @return The resulting item. | |
1702 */ | |
1703 /* public final QGraphicsTextItem addText(String text, QFont font) | |
1704 { | |
1705 QGraphicsTextItem item = new QGraphicsTextItem(text); | |
1706 item.setFont(font); | |
1707 | |
1708 addItem(item); | |
1709 | |
1710 return item; | |
1711 }*/ | |
1712 | |
1713 }// class |