File: qgraphicsitem.sip

package info (click to toggle)
python-qt4 4.9.3-4
  • links: PTS, VCS
  • area: main
  • in suites: wheezy
  • size: 34,432 kB
  • sloc: python: 34,126; cpp: 11,938; xml: 290; makefile: 223; php: 27
file content (1136 lines) | stat: -rw-r--r-- 35,587 bytes parent folder | download
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
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
// qgraphicsitem.sip generated by MetaSIP on Sun Jun 24 12:29:12 2012
//
// This file is part of the QtGui Python extension module.
//
// Copyright (c) 2012 Riverbank Computing Limited <info@riverbankcomputing.com>
// 
// This file is part of PyQt.
// 
// This file may be used under the terms of the GNU General Public
// License versions 2.0 or 3.0 as published by the Free Software
// Foundation and appearing in the files LICENSE.GPL2 and LICENSE.GPL3
// included in the packaging of this file.  Alternatively you may (at
// your option) use any later version of the GNU General Public
// License if such license has been publicly approved by Riverbank
// Computing Limited (or its successors, if any) and the KDE Free Qt
// Foundation. In addition, as a special exception, Riverbank gives you
// certain additional rights. These rights are described in the Riverbank
// GPL Exception version 1.1, which can be found in the file
// GPL_EXCEPTION.txt in this package.
// 
// If you are unsure which license is appropriate for your use, please
// contact the sales department at sales@riverbankcomputing.com.
// 
// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.


%If (Qt_4_2_0 -)
%ModuleCode
#include <qgraphicsitem.h>
%End
%End

%If (Qt_4_2_0 -)

class QGraphicsItem /Supertype=sip.wrapper/
{
%TypeHeaderCode
#include <qgraphicsitem.h>
%End

%ConvertToSubClassCode
    switch (sipCpp->type())
    {
    case 2:
        sipType = sipType_QGraphicsPathItem;
        break;
    
    case 3:
        sipType = sipType_QGraphicsRectItem;
        break;
    
    case 4:
        sipType = sipType_QGraphicsEllipseItem;
        break;
    
    case 5:
        sipType = sipType_QGraphicsPolygonItem;
        break;
    
    case 6:
        sipType = sipType_QGraphicsLineItem;
        break;
    
    case 7:
        sipType = sipType_QGraphicsPixmapItem;
        break;
    
    case 8:
        // We need to explicitly cast because of the multiple inheritance.
        *sipCppRet = static_cast<QGraphicsTextItem *>(sipCpp);
        sipType = sipType_QGraphicsTextItem;
        break;
    
    case 9:
        sipType = sipType_QGraphicsSimpleTextItem;
        break;
    
    case 10:
        sipType = sipType_QGraphicsItemGroup;
        break;
    
    #if QT_VERSION >= 0x040400
    case 11:
        // We need to explicitly cast because of the multiple inheritance.
        *sipCppRet = static_cast<QGraphicsWidget *>(sipCpp);
        sipType = sipType_QGraphicsWidget;
        break;
    
    case 12:
        // We need to explicitly cast because of the multiple inheritance.
        *sipCppRet = static_cast<QGraphicsProxyWidget *>(sipCpp);
        sipType = sipType_QGraphicsProxyWidget;
        break;
    #endif
    
    default:
        sipType = 0;
    }
%End

public:
%If (Qt_4_4_0 -)

    enum CacheMode
    {
        NoCache,
        ItemCoordinateCache,
        DeviceCoordinateCache,
    };

%End

    enum GraphicsItemChange
    {
        ItemPositionChange,
        ItemMatrixChange,
        ItemVisibleChange,
        ItemEnabledChange,
        ItemSelectedChange,
        ItemParentChange,
        ItemChildAddedChange,
        ItemChildRemovedChange,
%If (Qt_4_3_0 -)
        ItemTransformChange,
%End
%If (Qt_4_3_0 -)
        ItemPositionHasChanged,
%End
%If (Qt_4_3_0 -)
        ItemTransformHasChanged,
%End
%If (Qt_4_3_0 -)
        ItemSceneChange,
%End
%If (Qt_4_4_0 -)
        ItemVisibleHasChanged,
%End
%If (Qt_4_4_0 -)
        ItemEnabledHasChanged,
%End
%If (Qt_4_4_0 -)
        ItemSelectedHasChanged,
%End
%If (Qt_4_4_0 -)
        ItemParentHasChanged,
%End
%If (Qt_4_4_0 -)
        ItemSceneHasChanged,
%End
%If (Qt_4_4_0 -)
        ItemCursorChange,
%End
%If (Qt_4_4_0 -)
        ItemCursorHasChanged,
%End
%If (Qt_4_4_0 -)
        ItemToolTipChange,
%End
%If (Qt_4_4_0 -)
        ItemToolTipHasChanged,
%End
%If (Qt_4_4_0 -)
        ItemFlagsChange,
%End
%If (Qt_4_4_0 -)
        ItemFlagsHaveChanged,
%End
%If (Qt_4_4_0 -)
        ItemZValueChange,
%End
%If (Qt_4_4_0 -)
        ItemZValueHasChanged,
%End
%If (Qt_4_5_0 -)
        ItemOpacityChange,
%End
%If (Qt_4_5_0 -)
        ItemOpacityHasChanged,
%End
%If (Qt_4_6_0 -)
        ItemScenePositionHasChanged,
%End
%If (Qt_4_7_0 -)
        ItemRotationChange,
%End
%If (Qt_4_7_0 -)
        ItemRotationHasChanged,
%End
%If (Qt_4_7_0 -)
        ItemScaleChange,
%End
%If (Qt_4_7_0 -)
        ItemScaleHasChanged,
%End
%If (Qt_4_7_0 -)
        ItemTransformOriginPointChange,
%End
%If (Qt_4_7_0 -)
        ItemTransformOriginPointHasChanged,
%End
    };

    enum GraphicsItemFlag
    {
        ItemIsMovable,
        ItemIsSelectable,
        ItemIsFocusable,
%If (Qt_4_3_0 -)
        ItemClipsToShape,
%End
%If (Qt_4_3_0 -)
        ItemClipsChildrenToShape,
%End
%If (Qt_4_3_0 -)
        ItemIgnoresTransformations,
%End
%If (Qt_4_5_0 -)
        ItemIgnoresParentOpacity,
%End
%If (Qt_4_5_0 -)
        ItemDoesntPropagateOpacityToChildren,
%End
%If (Qt_4_5_0 -)
        ItemStacksBehindParent,
%End
%If (Qt_4_6_0 -)
        ItemUsesExtendedStyleOption,
%End
%If (Qt_4_6_0 -)
        ItemHasNoContents,
%End
%If (Qt_4_6_0 -)
        ItemSendsGeometryChanges,
%End
%If (Qt_4_6_0 -)
        ItemAcceptsInputMethod,
%End
%If (Qt_4_6_0 -)
        ItemNegativeZStacksBehindParent,
%End
%If (Qt_4_6_0 -)
        ItemIsPanel,
%End
%If (Qt_4_6_0 -)
        ItemSendsScenePositionChanges,
%End
    };

    typedef QFlags<QGraphicsItem::GraphicsItemFlag> GraphicsItemFlags;
    QGraphicsItem(QGraphicsItem *parent /TransferThis/ = 0, QGraphicsScene *scene /TransferThis/ = 0);
    virtual ~QGraphicsItem();
    QGraphicsScene *scene() const;
    QGraphicsItem *parentItem() const;
    QGraphicsItem *topLevelItem() const;
    void setParentItem(QGraphicsItem *parent /TransferThis/);
%If (- Qt_4_6_0)
    QList<QGraphicsItem*> children() const;
%End
    QGraphicsItemGroup *group() const;
    void setGroup(QGraphicsItemGroup *group /KeepReference/);
    QFlags<QGraphicsItem::GraphicsItemFlag> flags() const;
    void setFlag(QGraphicsItem::GraphicsItemFlag flag, bool enabled = true);
    void setFlags(QFlags<QGraphicsItem::GraphicsItemFlag> flags);
    QString toolTip() const;
    void setToolTip(const QString &toolTip);
    QCursor cursor() const;
    void setCursor(const QCursor &cursor);
    bool hasCursor() const;
    void unsetCursor();
    bool isVisible() const;
    void setVisible(bool visible);
    void hide();
    void show();
    bool isEnabled() const;
    void setEnabled(bool enabled);
    bool isSelected() const;
    void setSelected(bool selected);
    bool acceptDrops() const;
    void setAcceptDrops(bool on);
    Qt::MouseButtons acceptedMouseButtons() const;
    void setAcceptedMouseButtons(Qt::MouseButtons buttons);
    bool acceptsHoverEvents() const;
    void setAcceptsHoverEvents(bool enabled);
    bool handlesChildEvents() const;
    void setHandlesChildEvents(bool enabled);
    bool hasFocus() const;
    void setFocus(Qt::FocusReason focusReason = Qt::OtherFocusReason);
    void clearFocus();
    QPointF pos() const;
    qreal x() const;
    qreal y() const;
    QPointF scenePos() const;
    void setPos(const QPointF &pos);
    void moveBy(qreal dx, qreal dy);
    void ensureVisible(const QRectF &rect = QRectF(), int xMargin = 50, int yMargin = 50);
    QMatrix matrix() const;
    QMatrix sceneMatrix() const;
    void setMatrix(const QMatrix &matrix, bool combine = false);
    void resetMatrix();
    void rotate(qreal angle);
    void scale(qreal sx, qreal sy);
    void shear(qreal sh, qreal sv);
    void translate(qreal dx, qreal dy);
    virtual void advance(int phase);
    qreal zValue() const;
    void setZValue(qreal z);
    virtual QRectF boundingRect() const = 0;
    QRectF childrenBoundingRect() const;
    QRectF sceneBoundingRect() const;
    virtual QPainterPath shape() const;
    virtual bool contains(const QPointF &point) const;
    virtual bool collidesWithItem(const QGraphicsItem *other, Qt::ItemSelectionMode mode = Qt::IntersectsItemShape) const;
    virtual bool collidesWithPath(const QPainterPath &path, Qt::ItemSelectionMode mode = Qt::IntersectsItemShape) const;
    QList<QGraphicsItem*> collidingItems(Qt::ItemSelectionMode mode = Qt::IntersectsItemShape) const;
    bool isObscured() const;
    virtual bool isObscuredBy(const QGraphicsItem *item) const;
    virtual QPainterPath opaqueArea() const;
    virtual void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget = 0) = 0;
    void update(const QRectF &rect = QRectF());
    QPointF mapToItem(const QGraphicsItem *item, const QPointF &point) const;
    QPointF mapToParent(const QPointF &point) const;
    QPointF mapToScene(const QPointF &point) const;
    QPolygonF mapToItem(const QGraphicsItem *item, const QRectF &rect) const;
    QPolygonF mapToParent(const QRectF &rect) const;
    QPolygonF mapToScene(const QRectF &rect) const;
    QPolygonF mapToItem(const QGraphicsItem *item, const QPolygonF &polygon) const;
    QPolygonF mapToParent(const QPolygonF &polygon) const;
    QPolygonF mapToScene(const QPolygonF &polygon) const;
    QPainterPath mapToItem(const QGraphicsItem *item, const QPainterPath &path) const;
    QPainterPath mapToParent(const QPainterPath &path) const;
    QPainterPath mapToScene(const QPainterPath &path) const;
    QPointF mapFromItem(const QGraphicsItem *item, const QPointF &point) const;
    QPointF mapFromParent(const QPointF &point) const;
    QPointF mapFromScene(const QPointF &point) const;
    QPolygonF mapFromItem(const QGraphicsItem *item, const QRectF &rect) const;
    QPolygonF mapFromParent(const QRectF &rect) const;
    QPolygonF mapFromScene(const QRectF &rect) const;
    QPolygonF mapFromItem(const QGraphicsItem *item, const QPolygonF &polygon) const;
    QPolygonF mapFromParent(const QPolygonF &polygon) const;
    QPolygonF mapFromScene(const QPolygonF &polygon) const;
    QPainterPath mapFromItem(const QGraphicsItem *item, const QPainterPath &path) const;
    QPainterPath mapFromParent(const QPainterPath &path) const;
    QPainterPath mapFromScene(const QPainterPath &path) const;
    bool isAncestorOf(const QGraphicsItem *child) const;
    QVariant data(int key) const;
    void setData(int key, const QVariant &value);
%If (- Qt_5_0_0)

    enum
    {
        UserType,
    };

%End
    virtual int type() const;
    void installSceneEventFilter(QGraphicsItem *filterItem);
    void removeSceneEventFilter(QGraphicsItem *filterItem);

protected:
    virtual void contextMenuEvent(QGraphicsSceneContextMenuEvent *event);
    virtual void dragEnterEvent(QGraphicsSceneDragDropEvent *event);
    virtual void dragLeaveEvent(QGraphicsSceneDragDropEvent *event);
    virtual void dragMoveEvent(QGraphicsSceneDragDropEvent *event);
    virtual void dropEvent(QGraphicsSceneDragDropEvent *event);
    virtual void focusInEvent(QFocusEvent *event);
    virtual void focusOutEvent(QFocusEvent *event);
    virtual void hoverEnterEvent(QGraphicsSceneHoverEvent *event);
    virtual void hoverLeaveEvent(QGraphicsSceneHoverEvent *event);
    virtual void hoverMoveEvent(QGraphicsSceneHoverEvent *event);
    virtual void inputMethodEvent(QInputMethodEvent *event);
    virtual QVariant inputMethodQuery(Qt::InputMethodQuery query) const;
    virtual QVariant itemChange(QGraphicsItem::GraphicsItemChange change, const QVariant &value);
    virtual void keyPressEvent(QKeyEvent *event);
    virtual void keyReleaseEvent(QKeyEvent *event);
    virtual void mouseDoubleClickEvent(QGraphicsSceneMouseEvent *event);
    virtual void mouseMoveEvent(QGraphicsSceneMouseEvent *event);
    virtual void mousePressEvent(QGraphicsSceneMouseEvent *event);
    virtual void mouseReleaseEvent(QGraphicsSceneMouseEvent *event);
    void prepareGeometryChange();
    virtual bool sceneEvent(QEvent *event);
    virtual bool sceneEventFilter(QGraphicsItem *watched, QEvent *event);
    virtual void wheelEvent(QGraphicsSceneWheelEvent *event);

public:
    void setPos(qreal ax, qreal ay);
    void ensureVisible(qreal x, qreal y, qreal w, qreal h, int xMargin = 50, int yMargin = 50);
    void update(qreal ax, qreal ay, qreal width, qreal height);
    QPointF mapToItem(const QGraphicsItem *item, qreal ax, qreal ay) const;
    QPointF mapToParent(qreal ax, qreal ay) const;
    QPointF mapToScene(qreal ax, qreal ay) const;
    QPointF mapFromItem(const QGraphicsItem *item, qreal ax, qreal ay) const;
    QPointF mapFromParent(qreal ax, qreal ay) const;
    QPointF mapFromScene(qreal ax, qreal ay) const;
%If (Qt_4_3_0 -)
    QTransform transform() const;
%End
%If (Qt_4_3_0 -)
    QTransform sceneTransform() const;
%End
%If (Qt_4_3_0 -)
    QTransform deviceTransform(const QTransform &viewportTransform) const;
%End
%If (Qt_4_3_0 -)
    void setTransform(const QTransform &matrix, bool combine = false);
%End
%If (Qt_4_3_0 -)
    void resetTransform();
%End
%If (Qt_4_3_0 -)
    bool isObscured(const QRectF &rect) const;
%End
%If (Qt_4_3_0 -)
    bool isObscured(qreal ax, qreal ay, qreal w, qreal h) const;
%End
%If (Qt_4_3_0 -)
    QPolygonF mapToItem(const QGraphicsItem *item, qreal ax, qreal ay, qreal w, qreal h) const;
%End
%If (Qt_4_3_0 -)
    QPolygonF mapToParent(qreal ax, qreal ay, qreal w, qreal h) const;
%End
%If (Qt_4_3_0 -)
    QPolygonF mapToScene(qreal ax, qreal ay, qreal w, qreal h) const;
%End
%If (Qt_4_3_0 -)
    QPolygonF mapFromItem(const QGraphicsItem *item, qreal ax, qreal ay, qreal w, qreal h) const;
%End
%If (Qt_4_3_0 -)
    QPolygonF mapFromParent(qreal ax, qreal ay, qreal w, qreal h) const;
%End
%If (Qt_4_3_0 -)
    QPolygonF mapFromScene(qreal ax, qreal ay, qreal w, qreal h) const;
%End
%If (Qt_4_4_0 -)
    QGraphicsWidget *parentWidget() const;
%End
%If (Qt_4_4_0 -)
    QGraphicsWidget *topLevelWidget() const;
%End
%If (Qt_4_4_0 -)
    QGraphicsWidget *window() const;
%End
%If (Qt_4_4_0 -)
    QList<QGraphicsItem*> childItems() const;
%End
%If (Qt_4_4_0 -)
    bool isWidget() const;
%End
%If (Qt_4_4_0 -)
    bool isWindow() const;
%End
%If (Qt_4_4_0 -)
    QGraphicsItem::CacheMode cacheMode() const;
%End
%If (Qt_4_4_0 -)
    void setCacheMode(QGraphicsItem::CacheMode mode, const QSize &logicalCacheSize = QSize());
%End
%If (Qt_4_4_0 -)
    bool isVisibleTo(const QGraphicsItem *parent) const;
%End
%If (Qt_4_4_0 -)
    bool acceptHoverEvents() const;
%End
%If (Qt_4_4_0 -)
    void setAcceptHoverEvents(bool enabled);
%End
%If (Qt_4_4_0 -)
    void grabMouse();
%End
%If (Qt_4_4_0 -)
    void ungrabMouse();
%End
%If (Qt_4_4_0 -)
    void grabKeyboard();
%End
%If (Qt_4_4_0 -)
    void ungrabKeyboard();
%End
%If (Qt_4_4_0 -)
    QRegion boundingRegion(const QTransform &itemToDeviceTransform) const;
%End
%If (Qt_4_4_0 -)
    qreal boundingRegionGranularity() const;
%End
%If (Qt_4_4_0 -)
    void setBoundingRegionGranularity(qreal granularity);
%End
%If (Qt_4_4_0 -)
    void scroll(qreal dx, qreal dy, const QRectF &rect = QRectF());
%End
%If (Qt_4_4_0 -)
    QGraphicsItem *commonAncestorItem(const QGraphicsItem *other) const;
%End
%If (Qt_4_4_0 -)
    bool isUnderMouse() const;
%End
%If (Qt_4_5_0 -)
    qreal opacity() const;
%End
%If (Qt_4_5_0 -)
    qreal effectiveOpacity() const;
%End
%If (Qt_4_5_0 -)
    void setOpacity(qreal opacity);
%End
%If (Qt_4_5_0 -)
    QTransform itemTransform(const QGraphicsItem *other, bool *ok = 0) const;
%End
%If (Qt_4_5_0 -)
    bool isClipped() const;
%End
%If (Qt_4_5_0 -)
    QPainterPath clipPath() const;
%End
%If (Qt_4_5_0 -)
    QRectF mapRectToItem(const QGraphicsItem *item, const QRectF &rect) const;
%End
%If (Qt_4_5_0 -)
    QRectF mapRectToParent(const QRectF &rect) const;
%End
%If (Qt_4_5_0 -)
    QRectF mapRectToScene(const QRectF &rect) const;
%End
%If (Qt_4_5_0 -)
    QRectF mapRectFromItem(const QGraphicsItem *item, const QRectF &rect) const;
%End
%If (Qt_4_5_0 -)
    QRectF mapRectFromParent(const QRectF &rect) const;
%End
%If (Qt_4_5_0 -)
    QRectF mapRectFromScene(const QRectF &rect) const;
%End
%If (Qt_4_5_0 -)
    QRectF mapRectToItem(const QGraphicsItem *item, qreal ax, qreal ay, qreal w, qreal h) const;
%End
%If (Qt_4_5_0 -)
    QRectF mapRectToParent(qreal ax, qreal ay, qreal w, qreal h) const;
%End
%If (Qt_4_5_0 -)
    QRectF mapRectToScene(qreal ax, qreal ay, qreal w, qreal h) const;
%End
%If (Qt_4_5_0 -)
    QRectF mapRectFromItem(const QGraphicsItem *item, qreal ax, qreal ay, qreal w, qreal h) const;
%End
%If (Qt_4_5_0 -)
    QRectF mapRectFromParent(qreal ax, qreal ay, qreal w, qreal h) const;
%End
%If (Qt_4_5_0 -)
    QRectF mapRectFromScene(qreal ax, qreal ay, qreal w, qreal h) const;
%End
%If (Qt_4_6_0 -)

    enum PanelModality
    {
        NonModal,
        PanelModal,
        SceneModal,
    };

%End
%If (Qt_4_6_0 -)
    QGraphicsObject *parentObject() const;
%End
%If (Qt_4_6_0 -)
    QGraphicsItem *panel() const;
%End
%If (Qt_4_6_0 -)
    bool isPanel() const;
%End
%If (Qt_4_6_0 -)
    QGraphicsObject *toGraphicsObject();
%End
%If (Qt_4_6_0 -)
    QGraphicsItem::PanelModality panelModality() const;
%End
%If (Qt_4_6_0 -)
    void setPanelModality(QGraphicsItem::PanelModality panelModality);
%End
%If (Qt_4_6_0 -)
    bool isBlockedByModalPanel(QGraphicsItem **blockingPanel /Out/ = 0) const;
%End
%If (Qt_4_6_0 -)
    QGraphicsEffect *graphicsEffect() const;
%End
%If (Qt_4_6_0 -)
    void setGraphicsEffect(QGraphicsEffect *effect /Transfer/);
%End
%If (Qt_4_6_0 -)
    bool acceptTouchEvents() const;
%End
%If (Qt_4_6_0 -)
    void setAcceptTouchEvents(bool enabled);
%End
%If (Qt_4_6_0 -)
    bool filtersChildEvents() const;
%End
%If (Qt_4_6_0 -)
    void setFiltersChildEvents(bool enabled);
%End
%If (Qt_4_6_0 -)
    bool isActive() const;
%End
%If (Qt_4_6_0 -)
    void setActive(bool active);
%End
%If (Qt_4_6_0 -)
    QGraphicsItem *focusProxy() const;
%End
%If (Qt_4_6_0 -)
    void setFocusProxy(QGraphicsItem *item /KeepReference/);
%End
%If (Qt_4_6_0 -)
    QGraphicsItem *focusItem() const;
%End
%If (Qt_4_6_0 -)
    void setX(qreal x);
%End
%If (Qt_4_6_0 -)
    void setY(qreal y);
%End
%If (Qt_4_6_0 -)
    void setRotation(qreal angle);
%End
%If (Qt_4_6_0 -)
    qreal rotation() const;
%End
%If (Qt_4_6_0 -)
    void setScale(qreal scale);
%End
%If (Qt_4_6_0 -)
    qreal scale() const;
%End
%If (Qt_4_6_0 -)
    QList<QGraphicsTransform*> transformations() const;
%End
%If (Qt_4_6_0 -)
    void setTransformations(const QList<QGraphicsTransform*> &transformations /KeepReference/);
%End
%If (Qt_4_6_0 -)
    QPointF transformOriginPoint() const;
%End
%If (Qt_4_6_0 -)
    void setTransformOriginPoint(const QPointF &origin);
%End
%If (Qt_4_6_0 -)
    void setTransformOriginPoint(qreal ax, qreal ay);
%End
%If (Qt_4_6_0 -)
    void stackBefore(const QGraphicsItem *sibling);
%End
%If (Qt_4_6_0 -)
    Qt::InputMethodHints inputMethodHints() const;
%End
%If (Qt_4_6_0 -)
    void setInputMethodHints(Qt::InputMethodHints hints);
%End

protected:
%If (Qt_4_7_0 -)
    void updateMicroFocus();
%End

private:
    QGraphicsItem(const QGraphicsItem &);
};

%End
%If (Qt_4_2_0 -)
QFlags<QGraphicsItem::GraphicsItemFlag> operator|(QGraphicsItem::GraphicsItemFlag f1, QFlags<QGraphicsItem::GraphicsItemFlag> f2);
%End
%If (Qt_4_2_0 -)

class QAbstractGraphicsShapeItem : QGraphicsItem
{
%TypeHeaderCode
#include <qgraphicsitem.h>
%End

public:
    QAbstractGraphicsShapeItem(QGraphicsItem *parent /TransferThis/ = 0, QGraphicsScene *scene /TransferThis/ = 0);
    virtual ~QAbstractGraphicsShapeItem();
    QPen pen() const;
    void setPen(const QPen &pen);
    QBrush brush() const;
    void setBrush(const QBrush &brush);
    virtual bool isObscuredBy(const QGraphicsItem *item) const;
    virtual QPainterPath opaqueArea() const;

private:
    QAbstractGraphicsShapeItem(const QAbstractGraphicsShapeItem &);
};

%End
%If (Qt_4_2_0 -)

class QGraphicsPathItem : QAbstractGraphicsShapeItem
{
%TypeHeaderCode
#include <qgraphicsitem.h>
%End

public:
    QGraphicsPathItem(QGraphicsItem *parent /TransferThis/ = 0, QGraphicsScene *scene /TransferThis/ = 0);
    QGraphicsPathItem(const QPainterPath &path, QGraphicsItem *parent /TransferThis/ = 0, QGraphicsScene *scene /TransferThis/ = 0);
    virtual ~QGraphicsPathItem();
    QPainterPath path() const;
    void setPath(const QPainterPath &path);
    virtual QRectF boundingRect() const;
    virtual QPainterPath shape() const;
    virtual bool contains(const QPointF &point) const;
    virtual void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget = 0);
    virtual bool isObscuredBy(const QGraphicsItem *item) const;
    virtual QPainterPath opaqueArea() const;
    virtual int type() const;

private:
    QGraphicsPathItem(const QGraphicsPathItem &);
};

%End
%If (Qt_4_2_0 -)

class QGraphicsRectItem : QAbstractGraphicsShapeItem
{
%TypeHeaderCode
#include <qgraphicsitem.h>
%End

public:
    QGraphicsRectItem(QGraphicsItem *parent /TransferThis/ = 0, QGraphicsScene *scene /TransferThis/ = 0);
    QGraphicsRectItem(const QRectF &rect, QGraphicsItem *parent /TransferThis/ = 0, QGraphicsScene *scene /TransferThis/ = 0);
    QGraphicsRectItem(qreal x, qreal y, qreal w, qreal h, QGraphicsItem *parent /TransferThis/ = 0, QGraphicsScene *scene /TransferThis/ = 0);
    virtual ~QGraphicsRectItem();
    QRectF rect() const;
    void setRect(const QRectF &rect);
    void setRect(qreal ax, qreal ay, qreal w, qreal h);
    virtual QRectF boundingRect() const;
    virtual QPainterPath shape() const;
    virtual bool contains(const QPointF &point) const;
    virtual void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget = 0);
    virtual bool isObscuredBy(const QGraphicsItem *item) const;
    virtual QPainterPath opaqueArea() const;
    virtual int type() const;

private:
    QGraphicsRectItem(const QGraphicsRectItem &);
};

%End
%If (Qt_4_2_0 -)

class QGraphicsEllipseItem : QAbstractGraphicsShapeItem
{
%TypeHeaderCode
#include <qgraphicsitem.h>
%End

public:
    QGraphicsEllipseItem(QGraphicsItem *parent /TransferThis/ = 0, QGraphicsScene *scene /TransferThis/ = 0);
    QGraphicsEllipseItem(const QRectF &rect, QGraphicsItem *parent /TransferThis/ = 0, QGraphicsScene *scene /TransferThis/ = 0);
    QGraphicsEllipseItem(qreal x, qreal y, qreal w, qreal h, QGraphicsItem *parent /TransferThis/ = 0, QGraphicsScene *scene /TransferThis/ = 0);
    virtual ~QGraphicsEllipseItem();
    QRectF rect() const;
    void setRect(const QRectF &rect);
    void setRect(qreal ax, qreal ay, qreal w, qreal h);
    int startAngle() const;
    void setStartAngle(int angle);
    int spanAngle() const;
    void setSpanAngle(int angle);
    virtual QRectF boundingRect() const;
    virtual QPainterPath shape() const;
    virtual bool contains(const QPointF &point) const;
    virtual void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget = 0);
    virtual bool isObscuredBy(const QGraphicsItem *item) const;
    virtual QPainterPath opaqueArea() const;
    virtual int type() const;

private:
    QGraphicsEllipseItem(const QGraphicsEllipseItem &);
};

%End
%If (Qt_4_2_0 -)

class QGraphicsPolygonItem : QAbstractGraphicsShapeItem
{
%TypeHeaderCode
#include <qgraphicsitem.h>
%End

public:
    QGraphicsPolygonItem(QGraphicsItem *parent /TransferThis/ = 0, QGraphicsScene *scene /TransferThis/ = 0);
    QGraphicsPolygonItem(const QPolygonF &polygon, QGraphicsItem *parent /TransferThis/ = 0, QGraphicsScene *scene /TransferThis/ = 0);
    virtual ~QGraphicsPolygonItem();
    QPolygonF polygon() const;
    void setPolygon(const QPolygonF &polygon);
    Qt::FillRule fillRule() const;
    void setFillRule(Qt::FillRule rule);
    virtual QRectF boundingRect() const;
    virtual QPainterPath shape() const;
    virtual bool contains(const QPointF &point) const;
    virtual void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget = 0);
    virtual bool isObscuredBy(const QGraphicsItem *item) const;
    virtual QPainterPath opaqueArea() const;
    virtual int type() const;

private:
    QGraphicsPolygonItem(const QGraphicsPolygonItem &);
};

%End
%If (Qt_4_2_0 -)

class QGraphicsLineItem : QGraphicsItem
{
%TypeHeaderCode
#include <qgraphicsitem.h>
%End

public:
    QGraphicsLineItem(QGraphicsItem *parent /TransferThis/ = 0, QGraphicsScene *scene /TransferThis/ = 0);
    QGraphicsLineItem(const QLineF &line, QGraphicsItem *parent /TransferThis/ = 0, QGraphicsScene *scene /TransferThis/ = 0);
    QGraphicsLineItem(qreal x1, qreal y1, qreal x2, qreal y2, QGraphicsItem *parent /TransferThis/ = 0, QGraphicsScene *scene /TransferThis/ = 0);
    virtual ~QGraphicsLineItem();
    QPen pen() const;
    void setPen(const QPen &pen);
    QLineF line() const;
    void setLine(const QLineF &line);
    void setLine(qreal x1, qreal y1, qreal x2, qreal y2);
    virtual QRectF boundingRect() const;
    virtual QPainterPath shape() const;
    virtual bool contains(const QPointF &point) const;
    virtual void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget = 0);
    virtual bool isObscuredBy(const QGraphicsItem *item) const;
    virtual QPainterPath opaqueArea() const;
    virtual int type() const;

private:
    QGraphicsLineItem(const QGraphicsLineItem &);
};

%End
%If (Qt_4_2_0 -)

class QGraphicsPixmapItem : QGraphicsItem
{
%TypeHeaderCode
#include <qgraphicsitem.h>
%End

public:
    enum ShapeMode
    {
        MaskShape,
        BoundingRectShape,
        HeuristicMaskShape,
    };

    QGraphicsPixmapItem(QGraphicsItem *parent /TransferThis/ = 0, QGraphicsScene *scene /TransferThis/ = 0);
    QGraphicsPixmapItem(const QPixmap &pixmap, QGraphicsItem *parent /TransferThis/ = 0, QGraphicsScene *scene /TransferThis/ = 0);
    virtual ~QGraphicsPixmapItem();
    QPixmap pixmap() const;
    void setPixmap(const QPixmap &pixmap);
    Qt::TransformationMode transformationMode() const;
    void setTransformationMode(Qt::TransformationMode mode);
    QPointF offset() const;
    void setOffset(const QPointF &offset);
%If (Qt_4_3_0 -)
    void setOffset(qreal ax, qreal ay);
%End
    virtual QRectF boundingRect() const;
    virtual QPainterPath shape() const;
    virtual bool contains(const QPointF &point) const;
    virtual void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget);
    virtual bool isObscuredBy(const QGraphicsItem *item) const;
    virtual QPainterPath opaqueArea() const;
    virtual int type() const;
    QGraphicsPixmapItem::ShapeMode shapeMode() const;
    void setShapeMode(QGraphicsPixmapItem::ShapeMode mode);

private:
    QGraphicsPixmapItem(const QGraphicsPixmapItem &);
};

%End
%If (Qt_4_2_0 - Qt_4_6_0)

class QGraphicsTextItem : QObject, QGraphicsItem
{
%TypeHeaderCode
#include <qgraphicsitem.h>
%End

public:
    QGraphicsTextItem(QGraphicsItem *parent /TransferThis/ = 0, QGraphicsScene *scene /TransferThis/ = 0);
    QGraphicsTextItem(const QString &text, QGraphicsItem *parent /TransferThis/ = 0, QGraphicsScene *scene /TransferThis/ = 0);
    virtual ~QGraphicsTextItem();
    QString toHtml() const;
    void setHtml(const QString &html);
    QString toPlainText() const;
    void setPlainText(const QString &text);
    QFont font() const;
    void setFont(const QFont &font);
    void setDefaultTextColor(const QColor &c);
    QColor defaultTextColor() const;
    virtual QRectF boundingRect() const;
    virtual QPainterPath shape() const;
    virtual bool contains(const QPointF &point) const;
    virtual void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget);
    virtual bool isObscuredBy(const QGraphicsItem *item) const;
    virtual QPainterPath opaqueArea() const;
    virtual int type() const;
    void setTextWidth(qreal width);
    qreal textWidth() const;
    void adjustSize();
    void setDocument(QTextDocument *document /KeepReference/);
    QTextDocument *document() const;
    void setTextInteractionFlags(Qt::TextInteractionFlags flags);
    Qt::TextInteractionFlags textInteractionFlags() const;
    void setOpenExternalLinks(bool open);
    bool openExternalLinks() const;
    void setTextCursor(const QTextCursor &cursor);
    QTextCursor textCursor() const;

signals:
    void linkActivated(const QString &);
    void linkHovered(const QString &);

protected:
    virtual bool sceneEvent(QEvent *event);
    virtual void mousePressEvent(QGraphicsSceneMouseEvent *event);
    virtual void mouseMoveEvent(QGraphicsSceneMouseEvent *event);
    virtual void mouseReleaseEvent(QGraphicsSceneMouseEvent *event);
    virtual void mouseDoubleClickEvent(QGraphicsSceneMouseEvent *event);
    virtual void contextMenuEvent(QGraphicsSceneContextMenuEvent *event);
    virtual void keyPressEvent(QKeyEvent *event);
    virtual void keyReleaseEvent(QKeyEvent *event);
    virtual void focusInEvent(QFocusEvent *event);
    virtual void focusOutEvent(QFocusEvent *event);
    virtual void dragEnterEvent(QGraphicsSceneDragDropEvent *event);
    virtual void dragLeaveEvent(QGraphicsSceneDragDropEvent *event);
    virtual void dragMoveEvent(QGraphicsSceneDragDropEvent *event);
    virtual void dropEvent(QGraphicsSceneDragDropEvent *event);
    virtual void inputMethodEvent(QInputMethodEvent *event);
    virtual void hoverEnterEvent(QGraphicsSceneHoverEvent *event);
    virtual void hoverMoveEvent(QGraphicsSceneHoverEvent *event);
    virtual void hoverLeaveEvent(QGraphicsSceneHoverEvent *event);
    virtual QVariant inputMethodQuery(Qt::InputMethodQuery query) const;

public:
%If (Qt_4_5_0 -)
    void setTabChangesFocus(bool b);
%End
%If (Qt_4_5_0 -)
    bool tabChangesFocus() const;
%End

private:
    QGraphicsTextItem(const QGraphicsTextItem &);
};

%End
%If (Qt_4_2_0 -)

class QGraphicsSimpleTextItem : QAbstractGraphicsShapeItem
{
%TypeHeaderCode
#include <qgraphicsitem.h>
%End

public:
    QGraphicsSimpleTextItem(QGraphicsItem *parent /TransferThis/ = 0, QGraphicsScene *scene /TransferThis/ = 0);
    QGraphicsSimpleTextItem(const QString &text, QGraphicsItem *parent /TransferThis/ = 0, QGraphicsScene *scene /TransferThis/ = 0);
    virtual ~QGraphicsSimpleTextItem();
    void setText(const QString &text);
    QString text() const;
    void setFont(const QFont &font);
    QFont font() const;
    virtual QRectF boundingRect() const;
    virtual QPainterPath shape() const;
    virtual bool contains(const QPointF &point) const;
    virtual void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget);
    virtual bool isObscuredBy(const QGraphicsItem *item) const;
    virtual QPainterPath opaqueArea() const;
    virtual int type() const;

private:
    QGraphicsSimpleTextItem(const QGraphicsSimpleTextItem &);
};

%End
%If (Qt_4_2_0 -)

class QGraphicsItemGroup : QGraphicsItem
{
%TypeHeaderCode
#include <qgraphicsitem.h>
%End

public:
    QGraphicsItemGroup(QGraphicsItem *parent /TransferThis/ = 0, QGraphicsScene *scene /TransferThis/ = 0);
    virtual ~QGraphicsItemGroup();
    void addToGroup(QGraphicsItem *item /Transfer/);
    void removeFromGroup(QGraphicsItem *item /GetWrapper/);
%MethodCode
        sipCpp->removeFromGroup(a0);
        
        // The item will be passed to the group's parent if there is one.  If not,
        // transfer ownership back to Python.
        if (sipCpp->parentItem())
            sipTransferTo(a0Wrapper, sipGetPyObject(sipCpp->parentItem(), sipType_QGraphicsItem));
        else
            sipTransferBack(a0Wrapper);
%End

    virtual QRectF boundingRect() const;
    virtual void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget = 0);
    virtual bool isObscuredBy(const QGraphicsItem *item) const;
    virtual QPainterPath opaqueArea() const;
    virtual int type() const;

private:
    QGraphicsItemGroup(const QGraphicsItemGroup &);
};

%End
%If (Qt_4_6_0 -)

class QGraphicsObject : QObject, QGraphicsItem
{
%TypeHeaderCode
#include <qgraphicsitem.h>
%End

public:
    QGraphicsObject(QGraphicsItem *parent /TransferThis/ = 0);
    void grabGesture(Qt::GestureType type, Qt::GestureFlags flags = Qt::GestureFlags(0));
    void ungrabGesture(Qt::GestureType type);

signals:
    void parentChanged();
    void opacityChanged();
    void visibleChanged();
    void enabledChanged();
    void xChanged();
    void yChanged();
    void zChanged();
    void rotationChanged();
    void scaleChanged();

protected slots:
%If (Qt_4_7_0 -)
    void updateMicroFocus();
%End
};

%End
%If (Qt_4_6_0 -)

class QGraphicsTextItem : QGraphicsObject
{
%TypeHeaderCode
#include <qgraphicsitem.h>
%End

public:
    QGraphicsTextItem(QGraphicsItem *parent /TransferThis/ = 0, QGraphicsScene *scene /TransferThis/ = 0);
    QGraphicsTextItem(const QString &text, QGraphicsItem *parent /TransferThis/ = 0, QGraphicsScene *scene /TransferThis/ = 0);
    virtual ~QGraphicsTextItem();
    QString toHtml() const;
    void setHtml(const QString &html);
    QString toPlainText() const;
    void setPlainText(const QString &text);
    QFont font() const;
    void setFont(const QFont &font);
    void setDefaultTextColor(const QColor &c);
    QColor defaultTextColor() const;
    virtual QRectF boundingRect() const;
    virtual QPainterPath shape() const;
    virtual bool contains(const QPointF &point) const;
    virtual void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget);
    virtual bool isObscuredBy(const QGraphicsItem *item) const;
    virtual QPainterPath opaqueArea() const;
    virtual int type() const;
    void setTextWidth(qreal width);
    qreal textWidth() const;
    void adjustSize();
    void setDocument(QTextDocument *document /KeepReference/);
    QTextDocument *document() const;
    void setTextInteractionFlags(Qt::TextInteractionFlags flags);
    Qt::TextInteractionFlags textInteractionFlags() const;
    void setTabChangesFocus(bool b);
    bool tabChangesFocus() const;
    void setOpenExternalLinks(bool open);
    bool openExternalLinks() const;
    void setTextCursor(const QTextCursor &cursor);
    QTextCursor textCursor() const;

signals:
    void linkActivated(const QString &);
    void linkHovered(const QString &);

protected:
    virtual bool sceneEvent(QEvent *event);
    virtual void mousePressEvent(QGraphicsSceneMouseEvent *event);
    virtual void mouseMoveEvent(QGraphicsSceneMouseEvent *event);
    virtual void mouseReleaseEvent(QGraphicsSceneMouseEvent *event);
    virtual void mouseDoubleClickEvent(QGraphicsSceneMouseEvent *event);
    virtual void contextMenuEvent(QGraphicsSceneContextMenuEvent *event);
    virtual void keyPressEvent(QKeyEvent *event);
    virtual void keyReleaseEvent(QKeyEvent *event);
    virtual void focusInEvent(QFocusEvent *event);
    virtual void focusOutEvent(QFocusEvent *event);
    virtual void dragEnterEvent(QGraphicsSceneDragDropEvent *event);
    virtual void dragLeaveEvent(QGraphicsSceneDragDropEvent *event);
    virtual void dragMoveEvent(QGraphicsSceneDragDropEvent *event);
    virtual void dropEvent(QGraphicsSceneDragDropEvent *event);
    virtual void inputMethodEvent(QInputMethodEvent *event);
    virtual void hoverEnterEvent(QGraphicsSceneHoverEvent *event);
    virtual void hoverMoveEvent(QGraphicsSceneHoverEvent *event);
    virtual void hoverLeaveEvent(QGraphicsSceneHoverEvent *event);
    virtual QVariant inputMethodQuery(Qt::InputMethodQuery query) const;

private:
    QGraphicsTextItem(const QGraphicsTextItem &);
};

%End

%ModuleCode
#if QT_VERSION >= 0x040400
// These are needed by the %ConvertToSubClassCode.
#include <qgraphicsproxywidget.h>
#include <qgraphicswidget.h>
#endif
%End