diff options
Diffstat (limited to 'tests/auto/other')
27 files changed, 615 insertions, 379 deletions
diff --git a/tests/auto/other/collections/tst_collections.cpp b/tests/auto/other/collections/tst_collections.cpp index e145cc17df..df622602c3 100644 --- a/tests/auto/other/collections/tst_collections.cpp +++ b/tests/auto/other/collections/tst_collections.cpp @@ -3359,7 +3359,7 @@ void testVectorAlignment() for (int i = 0; i < 200; ++i) container.append(Aligned()); - + for (int i = 0; i < container.size(); ++i) QCOMPARE(quintptr(&container.at(i)) % Aligned::PreferredAlignment, quintptr(0)); } diff --git a/tests/auto/other/lancelot/lancelot.pro b/tests/auto/other/lancelot/lancelot.pro index b577e0dbc9..ef557691e3 100644 --- a/tests/auto/other/lancelot/lancelot.pro +++ b/tests/auto/other/lancelot/lancelot.pro @@ -1,5 +1,6 @@ CONFIG += testcase CONFIG += parallel_test +CONFIG -= app_bundle TARGET = tst_lancelot QT += xml widgets testlib diff --git a/tests/auto/other/lancelot/scripts/background.qps b/tests/auto/other/lancelot/scripts/background.qps index 000cfcdd91..d1efe5c178 100644 --- a/tests/auto/other/lancelot/scripts/background.qps +++ b/tests/auto/other/lancelot/scripts/background.qps @@ -14,12 +14,12 @@ path_lineTo path 0 50 bitmap_load bitmap.png bitmap begin_block drawing - save + save drawRect 0 0 50 50 translate 60 0 drawEllipse 0 0 50 50 - + translate 60 0 drawPolygon [0 0 50 0 25 50 25 25] @@ -28,9 +28,9 @@ begin_block drawing translate 60 0 drawPie 0 0 50 50 1440 2000 - + translate 60 0 - drawChord 0 0 50 50 1440 2000 + drawChord 0 0 50 50 1440 2000 translate 60 0 drawLine 0 0 50 0 @@ -44,10 +44,10 @@ begin_block drawing drawArc 0 0 50 50 1440 2000 translate 60 0 - drawText 0 10 "Jambi-Bambi" + drawText 0 10 "Jambi-Bambi" translate 80 0 - drawPixmap bitmap 0 0 + drawPixmap bitmap 0 0 restore save @@ -57,7 +57,7 @@ begin_block drawing translate 60 0 drawEllipse 0 0 50 50 - + translate 60 0 drawPolygon [0 0 50 0 25 50 25 25] @@ -66,9 +66,9 @@ begin_block drawing translate 60 0 drawPie 0 0 50 50 1440 2000 - + translate 60 0 - drawChord 0 0 50 50 1440 2000 + drawChord 0 0 50 50 1440 2000 translate 60 0 drawLine 0 0 50 0 @@ -82,10 +82,10 @@ begin_block drawing drawArc 0 0 50 50 1440 2000 translate 60 0 - drawText 0 10 "Jambi-Bambi" + drawText 0 10 "Jambi-Bambi" translate 80 0 - drawPixmap bitmap 0 0 + drawPixmap bitmap 0 0 restore end_block @@ -102,12 +102,12 @@ repeat_block drawing translate 0 160 setBackgroundMode Transparent setPen ff7f7f 4 dashline flatcap beveljoin -repeat_block drawing +repeat_block drawing translate 0 160 setBackgroundMode OpaqueMode setPen ff7f7f 4 dashline flatcap beveljoin -repeat_block drawing +repeat_block drawing resetMatrix diff --git a/tests/auto/other/lancelot/scripts/bitmaps.qps b/tests/auto/other/lancelot/scripts/bitmaps.qps index a816b9d497..4966490337 100644 --- a/tests/auto/other/lancelot/scripts/bitmaps.qps +++ b/tests/auto/other/lancelot/scripts/bitmaps.qps @@ -122,12 +122,12 @@ translate 110 0 save translate 20 -10 rotate 10 - setBackgroundMode Transparent + setBackgroundMode Transparent repeat_block draw_subrected restore translate 110 0 -save +save translate 20 -10 rotate 10 setBackgroundMode Opaque diff --git a/tests/auto/other/lancelot/scripts/clippaths.qps b/tests/auto/other/lancelot/scripts/clippaths.qps index fba89784df..fe8e198a17 100644 --- a/tests/auto/other/lancelot/scripts/clippaths.qps +++ b/tests/auto/other/lancelot/scripts/clippaths.qps @@ -4,7 +4,7 @@ path_addRect hor 0 0 50 10 path_addRect ver 0 0 10 50 -translate 10 10 +translate 10 10 setPen NoPen begin_block clipping @@ -13,7 +13,7 @@ save setBrush 0x7f7fff save setClipPath hor - drawRect 0 0 100 100 + drawRect 0 0 100 100 setClipPath ver IntersectClip setBrush black CrossPattern @@ -21,18 +21,18 @@ save restore translate 100 0 - save + save setClipPath hor drawRect 0 0 100 100 setClipPath ver ReplaceClip setBrush black CrossPattern - drawRect 0 0 100 100 + drawRect 0 0 100 100 restore translate 100 0 - save - setClipPath hor + save + setClipPath hor drawRect 0 0 100 100 setClipPath ver UniteClip diff --git a/tests/auto/other/lancelot/scripts/cliprects.qps b/tests/auto/other/lancelot/scripts/cliprects.qps index 0d28b035b4..aa0367eccf 100644 --- a/tests/auto/other/lancelot/scripts/cliprects.qps +++ b/tests/auto/other/lancelot/scripts/cliprects.qps @@ -3,7 +3,7 @@ -translate 10 10 +translate 10 10 setPen NoPen begin_block clipping @@ -11,8 +11,8 @@ save setBrush 0x7f7fff save - setClipRect 0 0 50 10 - drawRect 0 0 100 100 + setClipRect 0 0 50 10 + drawRect 0 0 100 100 setClipRect 0 0 10 50 IntersectClip setBrush black CrossPattern @@ -20,17 +20,17 @@ save restore translate 100 0 - save + save setClipRect 0 0 50 10 drawRect 0 0 100 100 setClipRect 0 0 10 50 ReplaceClip setBrush black CrossPattern - drawRect 0 0 100 100 + drawRect 0 0 100 100 restore translate 100 0 - save + save setClipRect 0 0 50 10 drawRect 0 0 100 100 diff --git a/tests/auto/other/lancelot/scripts/conical_gradients.qps b/tests/auto/other/lancelot/scripts/conical_gradients.qps index 2e897b1813..d6eb860f3f 100644 --- a/tests/auto/other/lancelot/scripts/conical_gradients.qps +++ b/tests/auto/other/lancelot/scripts/conical_gradients.qps @@ -64,7 +64,7 @@ setBrush nobrush begin_block ellipse_draw setClipRect 0 0 100 100 drawEllipse 35 35 11 11 - save + save translate 40 40 rotate -50 drawLine -100 0 100 0 diff --git a/tests/auto/other/lancelot/scripts/dashes.qps b/tests/auto/other/lancelot/scripts/dashes.qps index 649f56cf66..185443a292 100644 --- a/tests/auto/other/lancelot/scripts/dashes.qps +++ b/tests/auto/other/lancelot/scripts/dashes.qps @@ -15,7 +15,7 @@ save setPen black 1 SolidLine RoundCap BevelJoin drawPolyline [0 0 80 0 80 30 40 20 0 30] translate 0 40 - + setPen black 2 SolidLine FlatCap BevelJoin drawPolyline [0 0 80 0 80 30 40 20 0 30] translate 0 40 @@ -25,7 +25,7 @@ save setPen black 2 SolidLine RoundCap BevelJoin drawPolyline [0 0 80 0 80 30 40 20 0 30] translate 0 40 - + setPen black 6 SolidLine FlatCap BevelJoin drawPolyline [0 0 80 0 80 30 40 20 0 30] translate 0 40 @@ -36,8 +36,8 @@ save drawPolyline [0 0 80 0 80 30 40 20 0 30] translate 0 40 restore - - + + translate 100 0 save setPen black 1 DotLine FlatCap BevelJoin @@ -49,7 +49,7 @@ save setPen black 1 DotLine RoundCap BevelJoin drawPolyline [0 0 80 0 80 30 40 20 0 30] translate 0 40 - + setPen black 2 DotLine FlatCap BevelJoin drawPolyline [0 0 80 0 80 30 40 20 0 30] translate 0 40 @@ -59,7 +59,7 @@ save setPen black 2 DotLine RoundCap BevelJoin drawPolyline [0 0 80 0 80 30 40 20 0 30] translate 0 40 - + setPen black 6 DotLine FlatCap BevelJoin drawPolyline [0 0 80 0 80 30 40 20 0 30] translate 0 40 @@ -70,7 +70,7 @@ save drawPolyline [0 0 80 0 80 30 40 20 0 30] translate 0 40 restore - + translate 100 0 save setPen black 1 DashLine FlatCap BevelJoin @@ -82,7 +82,7 @@ save setPen black 1 DashLine RoundCap BevelJoin drawPolyline [0 0 80 0 80 30 40 20 0 30] translate 0 40 - + setPen black 2 DashLine FlatCap BevelJoin drawPolyline [0 0 80 0 80 30 40 20 0 30] translate 0 40 @@ -92,7 +92,7 @@ save setPen black 2 DashLine RoundCap BevelJoin drawPolyline [0 0 80 0 80 30 40 20 0 30] translate 0 40 - + setPen black 6 DashLine FlatCap BevelJoin drawPolyline [0 0 80 0 80 30 40 20 0 30] translate 0 40 @@ -103,9 +103,9 @@ save drawPolyline [0 0 80 0 80 30 40 20 0 30] translate 0 40 restore - + translate 100 0 - + save setPen black 1 DashDotLine FlatCap BevelJoin drawPolyline [0 0 80 0 80 30 40 20 0 30] @@ -116,7 +116,7 @@ save setPen black 1 DashDotLine RoundCap BevelJoin drawPolyline [0 0 80 0 80 30 40 20 0 30] translate 0 40 - + setPen black 2 DashDotLine FlatCap BevelJoin drawPolyline [0 0 80 0 80 30 40 20 0 30] translate 0 40 @@ -126,7 +126,7 @@ save setPen black 2 DashDotLine RoundCap BevelJoin drawPolyline [0 0 80 0 80 30 40 20 0 30] translate 0 40 - + setPen black 6 DashDotLine FlatCap BevelJoin drawPolyline [0 0 80 0 80 30 40 20 0 30] translate 0 40 @@ -137,7 +137,7 @@ save drawPolyline [0 0 80 0 80 30 40 20 0 30] translate 0 40 restore - + translate 100 0 save @@ -150,7 +150,7 @@ save setPen black 1 DashDotDotLine RoundCap BevelJoin drawPolyline [0 0 80 0 80 30 40 20 0 30] translate 0 40 - + setPen black 2 DashDotDotLine FlatCap BevelJoin drawPolyline [0 0 80 0 80 30 40 20 0 30] translate 0 40 @@ -160,7 +160,7 @@ save setPen black 2 DashDotDotLine RoundCap BevelJoin drawPolyline [0 0 80 0 80 30 40 20 0 30] translate 0 40 - + setPen black 4 DashDotDotLine FlatCap BevelJoin drawPolyline [0 0 80 0 80 30 40 20 0 30] translate 0 40 @@ -187,7 +187,7 @@ save pen_setDashPattern [1 4 9 4 27 4] drawPolyline [0 0 80 0 80 30 40 20 0 30] translate 0 40 - + setPen black 2 SolidLine FlatCap BevelJoin pen_setDashPattern [1 4 9 4 27 4] drawPolyline [0 0 80 0 80 30 40 20 0 30] @@ -200,7 +200,7 @@ save pen_setDashPattern [1 4 9 4 27 4] drawPolyline [0 0 80 0 80 30 40 20 0 30] translate 0 40 - + setPen black 4 SolidLine FlatCap BevelJoin pen_setDashPattern [1 4 9 4 27 4] drawPolyline [0 0 80 0 80 30 40 20 0 30] @@ -217,7 +217,7 @@ save restore end_block - + translate 0 400 setRenderHint Antialiasing repeat_block draw diff --git a/tests/auto/other/lancelot/scripts/deviceclipping.qps b/tests/auto/other/lancelot/scripts/deviceclipping.qps index cedfc1e363..8608a50994 100644 --- a/tests/auto/other/lancelot/scripts/deviceclipping.qps +++ b/tests/auto/other/lancelot/scripts/deviceclipping.qps @@ -22,7 +22,7 @@ begin_block drawing drawRect 300 -500000 1000000 1000000 drawPath path - + end_block save diff --git a/tests/auto/other/lancelot/scripts/pixmap_scaling.qps b/tests/auto/other/lancelot/scripts/pixmap_scaling.qps index 651896f4a3..8a5ab2c60e 100644 --- a/tests/auto/other/lancelot/scripts/pixmap_scaling.qps +++ b/tests/auto/other/lancelot/scripts/pixmap_scaling.qps @@ -8,8 +8,8 @@ translate 5 25 setFont "arial" 8 -save - drawText 15 0 "opaque image" +save + drawText 15 0 "opaque image" translate 50 50 save translate 1 1 @@ -21,23 +21,23 @@ save scale -20 20 drawImage solid2x2.png 0 0 restore - save + save translate 1 -1 scale 20 -20 drawImage solid2x2.png 0 0 restore - save + save translate -1 -1 scale -20 -20 drawImage solid2x2.png 0 0 restore - -restore + +restore save translate 150 0 - drawText 15 0 "alpha image" + drawText 15 0 "alpha image" translate 50 50 save translate 1 1 @@ -49,12 +49,12 @@ save scale -20 20 drawImage alpha2x2.png 0 0 restore - save + save translate 1 -1 scale 20 -20 drawImage alpha2x2.png 0 0 restore - save + save translate -1 -1 scale -20 -20 drawImage alpha2x2.png 0 0 @@ -64,7 +64,7 @@ restore save translate 0 150 - drawText 15 0 "solid pixmap" + drawText 15 0 "solid pixmap" translate 50 50 save translate 1 1 @@ -76,12 +76,12 @@ save scale -20 20 drawPixmap solid2x2.png 0 0 restore - save + save translate 1 -1 scale 20 -20 drawPixmap solid2x2.png 0 0 restore - save + save translate -1 -1 scale -20 -20 drawPixmap solid2x2.png 0 0 @@ -90,9 +90,9 @@ restore save - translate 150 150 + translate 150 150 drawText 15 0 "alpha pixmap" - translate 50 50 + translate 50 50 save translate 1 1 scale 20 20 @@ -103,12 +103,12 @@ save scale -20 20 drawPixmap alpha2x2.png 0 0 restore - save + save translate 1 -1 scale 20 -20 drawPixmap alpha2x2.png 0 0 restore - save + save translate -1 -1 scale -20 -20 drawPixmap alpha2x2.png 0 0 @@ -116,7 +116,7 @@ save restore -save +save translate 300 10 save drawText 0 -10 "subrect solid image" @@ -143,7 +143,7 @@ save drawImage solid2x2.png 45 0 5 50 1.8 0 0.2 2 restore - save + save translate 150 0 drawText 0 -10 "subrect solid image" drawImage alpha2x2.png 0 0 50 5 0 0.0 2 0.2 @@ -156,7 +156,7 @@ save drawImage alpha2x2.png 0 35 50 5 0 1.4 2 0.2 drawImage alpha2x2.png 0 40 50 5 0 1.6 2 0.2 drawImage alpha2x2.png 0 45 50 5 0 1.8 2 0.2 - translate 60 0 + translate 60 0 drawImage alpha2x2.png 0 0 5 50 0.0 0 0.2 2 drawImage alpha2x2.png 5 0 5 50 0.2 0 0.2 2 drawImage alpha2x2.png 10 0 5 50 0.4 0 0.2 2 diff --git a/tests/auto/other/lancelot/scripts/pixmap_subpixel.qps b/tests/auto/other/lancelot/scripts/pixmap_subpixel.qps index 908f7c3465..d5b7b92fc9 100644 --- a/tests/auto/other/lancelot/scripts/pixmap_subpixel.qps +++ b/tests/auto/other/lancelot/scripts/pixmap_subpixel.qps @@ -6,7 +6,7 @@ translate 50 50 # Pixmaps at 0.1 offset, unclipped begin_block draw_pixmaps -save +save drawPixmap border.png 0 0 translate 20.1 0.1 drawPixmap border.png 0 0 @@ -27,7 +27,7 @@ save translate 20.1 0.1 drawPixmap border.png 0 0 translate 20.1 0.1 - + drawPixmap border.png 0 0 translate 20.1 0.1 drawPixmap border.png 0 0 @@ -49,12 +49,12 @@ save drawPixmap border.png 0 0 translate 20.1 0.1 restore -end_block +end_block # Tiled pixmaps at 0.1 offsets, unclipped translate 0 50 begin_block draw_tiled -save +save drawTiledPixmap border.png 0 0 16 16 0 0 translate 20.1 0.1 drawTiledPixmap border.png 0 0 16 16 0 0 @@ -75,7 +75,7 @@ save translate 20.1 0.1 drawTiledPixmap border.png 0 0 16 16 0 0 translate 20.1 0.1 - + drawTiledPixmap border.png 0 0 16 16 0 0 translate 20.1 0.1 drawTiledPixmap border.png 0 0 16 16 0 0 @@ -97,7 +97,7 @@ save drawTiledPixmap border.png 0 0 16 16 0 0 translate 20.1 0.1 restore -end_block +end_block path_moveTo clip 0 0 diff --git a/tests/auto/other/lancelot/scripts/pixmaps.qps b/tests/auto/other/lancelot/scripts/pixmaps.qps index 8e60997acc..0b4ba2c4fb 100644 --- a/tests/auto/other/lancelot/scripts/pixmaps.qps +++ b/tests/auto/other/lancelot/scripts/pixmaps.qps @@ -15,13 +15,13 @@ save drawPixmap the_pixmap 0 0 # sub recting - translate 120 0 + translate 120 0 drawPixmap the_pixmap 0 0 40 40 0 0 40 40 drawPixmap the_pixmap 60 0 40 40 60 0 40 40 drawPixmap the_pixmap 0 60 40 40 0 60 40 40 drawPixmap the_pixmap 60 60 40 40 60 60 40 40 drawPixmap the_pixmap 0 40 40 20 0 40 40 20 - drawPixmap the_pixmap 60 40 40 20 60 40 40 20 + drawPixmap the_pixmap 60 40 40 20 60 40 40 20 drawPixmap the_pixmap 40 0 20 100 40 0 20 100 # subrecting w/scale @@ -30,15 +30,15 @@ save drawPixmap the_pixmap 50 0 50 50 25 0 25 25 drawPixmap the_pixmap 0 50 50 50 0 25 25 25 drawPixmap the_pixmap 50 50 50 50 25 25 25 25 - + # subrecting w/scale & smooth xform translate 120 0 - setRenderHint SmoothPixmapTransformation + setRenderHint SmoothPixmapTransformation drawPixmap the_pixmap 0 0 50 50 0 0 25 25 drawPixmap the_pixmap 50 0 50 50 25 0 25 25 drawPixmap the_pixmap 0 50 50 50 0 25 25 25 drawPixmap the_pixmap 50 50 50 50 25 25 25 25 - + # Rotation w/o smooth xform translate 120 0 diff --git a/tests/auto/other/lancelot/scripts/rasterops.qps b/tests/auto/other/lancelot/scripts/rasterops.qps index 21f943b543..d0f2da42df 100644 --- a/tests/auto/other/lancelot/scripts/rasterops.qps +++ b/tests/auto/other/lancelot/scripts/rasterops.qps @@ -13,9 +13,9 @@ begin_block drawShape setBrush 0xffff0000 drawEllipse 5 5 30 30 setBrush 0xff00ff00 - drawRect 0 0 20 20 + drawRect 0 0 20 20 setBrush 0xff0000ff - drawRect 20 20 20 20 + drawRect 20 20 20 20 end_block begin_block loop diff --git a/tests/auto/other/lancelot/scripts/sizes.qps b/tests/auto/other/lancelot/scripts/sizes.qps index 68e01c3262..12b0f4af1e 100644 --- a/tests/auto/other/lancelot/scripts/sizes.qps +++ b/tests/auto/other/lancelot/scripts/sizes.qps @@ -4,7 +4,7 @@ setPen NoPen setBrush black -translate 10 10 +translate 10 10 begin_block testblock drawRect 0 0 10 10 @@ -75,9 +75,9 @@ drawChord 180 100 19 19 0 4320 end_block -setPen red +setPen red translate 0 150 -repeat_block testblock +repeat_block testblock setRenderHint LineAntialiasing diff --git a/tests/auto/other/lancelot/scripts/statictext.qps b/tests/auto/other/lancelot/scripts/statictext.qps index b62b623462..c5ddda197f 100644 --- a/tests/auto/other/lancelot/scripts/statictext.qps +++ b/tests/auto/other/lancelot/scripts/statictext.qps @@ -50,7 +50,25 @@ save drawStaticText 0 80 "scaled sansserif 10pt, bold italic" restore - translate 0 100 + translate 200 200 + setPen black + save + scale -1 -1 + + setFont "sansserif" 10 normal + drawStaticText 0 20 "flipped sansserif 10pt, normal" + + setFont "sansserif" 12 normal + drawStaticText 0 40 "flipped sansserif 12pt, normal" + + setFont "sansserif" 10 bold + drawStaticText 0 60 "flipped sansserif 12pt, bold" + + setFont "sansserif" 10 bold italic + drawStaticText 0 80 "flipped sansserif 10pt, bold italic" + restore + + translate -200 20 setPen black save translate 200 90 @@ -91,26 +109,26 @@ restore end_block translate 250 0 -drawStaticText 25 520 "clipped to rectangle" +drawStaticText 25 640 "clipped to rectangle" save setPen #3f000000 setBrush nobrush - drawRect 20 0 100 500 - setClipRect 20 0 100 500 + drawRect 20 0 100 620 + setClipRect 20 0 100 620 setPen black repeat_block text_drawing restore translate 150 0 -drawStaticText 25 520 "clipped to path" +drawStaticText 25 640 "clipped to path" save path_moveTo clip 20 0 path_cubicTo clip 0 200 40 400 20 400 - path_lineTo clip 30 500 + path_lineTo clip 30 620 path_lineTo clip 30 0 path_lineTo clip 40 0 - path_lineTo clip 40 500 - path_lineTo clip 120 500 + path_lineTo clip 40 620 + path_lineTo clip 120 620 path_lineTo clip 120 0 path_lineTo clip 20 0 setPen #3f000000 diff --git a/tests/auto/other/lancelot/scripts/text.qps b/tests/auto/other/lancelot/scripts/text.qps index d7ee83290b..e7d47448ea 100644 --- a/tests/auto/other/lancelot/scripts/text.qps +++ b/tests/auto/other/lancelot/scripts/text.qps @@ -7,112 +7,130 @@ begin_block text_drawing save setFont "sansserif" 10 normal drawText 0 20 "sansserif 10pt, normal" - + setFont "sansserif" 12 normal drawText 0 40 "sansserif 12pt, normal" - + setFont "sansserif" 10 bold drawText 0 60 "sansserif 12pt, bold" - + setFont "sansserif" 10 bold italic drawText 0 80 "sansserif 10pt, bold italic" - - + + translate 0 100 setPen #7fff0000 - + setFont "sansserif" 10 normal drawText 0 20 "alpha sansserif 10pt, normal" - + setFont "sansserif" 12 normal drawText 0 40 "alpha sansserif 12pt, normal" - + setFont "sansserif" 10 bold drawText 0 60 "alpha sansserif 12pt, bold" - + setFont "sansserif" 10 bold italic drawText 0 80 "alpha sansserif 10pt, bold italic" - - + + translate 0 100 setPen black save scale 0.9 0.9 - + setFont "sansserif" 10 normal drawText 0 20 "scaled sansserif 10pt, normal" - + setFont "sansserif" 12 normal drawText 0 40 "scaled sansserif 12pt, normal" - + setFont "sansserif" 10 bold drawText 0 60 "scaled sansserif 12pt, bold" - + setFont "sansserif" 10 bold italic drawText 0 80 "scaled sansserif 10pt, bold italic" restore - translate 0 100 + translate 200 200 + setPen black + save + scale -1 -1 + + setFont "sansserif" 10 normal + drawStaticText 0 20 "flipped sansserif 10pt, normal" + + setFont "sansserif" 12 normal + drawStaticText 0 40 "flipped sansserif 12pt, normal" + + setFont "sansserif" 10 bold + drawStaticText 0 60 "flipped sansserif 12pt, bold" + + setFont "sansserif" 10 bold italic + drawStaticText 0 80 "flipped sansserif 10pt, bold italic" + restore + + translate -200 20 setPen black save translate 200 90 rotate 185 - + setFont "sansserif" 10 normal drawText 0 20 "scaled sansserif 10pt, normal" - + setFont "sansserif" 12 normal drawText 0 40 "scaled sansserif 12pt, normal" - + setFont "sansserif" 10 bold drawText 0 60 "scaled sansserif 12pt, bold" - + setFont "sansserif" 10 bold italic drawText 0 80 "scaled sansserif 10pt, bold italic" restore - + translate 0 100 gradient_appendStop 0 red gradient_appendStop 0.5 #00ff00 gradient_appendStop 1 blue gradient_setLinear 0 0 200 0 setPen brush - + setFont "sansserif" 10 normal drawText 0 0 "gradient sansserif 10pt, normal" - + setFont "sansserif" 12 normal drawText 0 20 "gradient sansserif 12pt, normal" - + setFont "sansserif" 10 bold drawText 0 40 "gradient sansserif 12pt, bold" - + setFont "sansserif" 10 bold italic drawText 0 60 "gradient sansserif 10pt, bold italic" restore end_block translate 250 0 -drawText 25 520 "clipped to rectangle" +drawText 25 640 "clipped to rectangle" save setPen #3f000000 setBrush nobrush - drawRect 20 0 100 500 - setClipRect 20 0 100 500 + drawRect 20 0 100 620 + setClipRect 20 0 100 620 setPen black repeat_block text_drawing restore translate 150 0 -drawText 25 520 "clipped to path" -save +drawText 25 640 "clipped to path" +save path_moveTo clip 20 0 path_cubicTo clip 0 200 40 400 20 400 - path_lineTo clip 30 500 + path_lineTo clip 30 620 path_lineTo clip 30 0 path_lineTo clip 40 0 - path_lineTo clip 40 500 - path_lineTo clip 120 500 + path_lineTo clip 40 620 + path_lineTo clip 120 620 path_lineTo clip 120 0 path_lineTo clip 20 0 setPen #3f000000 diff --git a/tests/auto/other/lancelot/scripts/tiled_pixmap.qps b/tests/auto/other/lancelot/scripts/tiled_pixmap.qps index 9cb5e0dd1f..0ce3a7834c 100644 --- a/tests/auto/other/lancelot/scripts/tiled_pixmap.qps +++ b/tests/auto/other/lancelot/scripts/tiled_pixmap.qps @@ -5,7 +5,7 @@ translate 0 10 setRenderHint Antialiasing -pixmap_load dome_argb32 the_pixmap +pixmap_load dome_argb32 the_pixmap begin_block draw_stuff save @@ -25,7 +25,7 @@ save setRenderHint SmoothPixmapTransform false drawTiledPixmap the_pixmap 0 0 150 100 25 25 restore - + # xformed with smooth xform translate 160 0 save @@ -38,17 +38,17 @@ restore end_block translate 0 120 -pixmap_load dome_rgb32 the_pixmap +pixmap_load dome_rgb32 the_pixmap repeat_block draw_stuff translate 0 120 -pixmap_load dome_indexed the_pixmap +pixmap_load dome_indexed the_pixmap repeat_block draw_stuff translate 0 120 -pixmap_load dome_indexed_mask the_pixmap +pixmap_load dome_indexed_mask the_pixmap repeat_block draw_stuff diff --git a/tests/auto/other/macgui/guitest.cpp b/tests/auto/other/macgui/guitest.cpp index d4af5c1386..d7431dd88e 100644 --- a/tests/auto/other/macgui/guitest.cpp +++ b/tests/auto/other/macgui/guitest.cpp @@ -84,7 +84,6 @@ public: void WidgetNavigator::printAll(QWidget *widget) { QAccessibleInterface * const iface = QAccessible::queryAccessibleInterface(widget); - deleteInDestructor(iface); printAll(iface); } @@ -97,7 +96,6 @@ void WidgetNavigator::printAll(QAccessibleInterface *interface) QAccessibleInterface *WidgetNavigator::find(QAccessible::Text textType, const QString &text, QWidget *start) { QAccessibleInterface *const iface = QAccessible::queryAccessibleInterface(start); - deleteInDestructor(iface); return find(textType, text, iface); } @@ -118,27 +116,21 @@ QAccessibleInterface *WidgetNavigator::recursiveSearch(TestBase *test, QAccessib while (todoInterfaces.isEmpty() == false) { QAccessibleInterface *testInterface = todoInterfaces.pop(); - + if ((*test)(testInterface)) return testInterface; - + const int numChildren = testInterface->childCount(); for (int i = 0; i < numChildren; ++i) { QAccessibleInterface *childInterface = testInterface->child(i); if (childInterface) { todoInterfaces.push(childInterface); - deleteInDestructor(childInterface); } } } return 0; } -void WidgetNavigator::deleteInDestructor(QAccessibleInterface *interface) -{ - interfaces.insert(interface); -} - QWidget *WidgetNavigator::getWidget(QAccessibleInterface *interface) { return qobject_cast<QWidget *>(interface->object()); @@ -146,9 +138,6 @@ QWidget *WidgetNavigator::getWidget(QAccessibleInterface *interface) WidgetNavigator::~WidgetNavigator() { - foreach(QAccessibleInterface *interface, interfaces) { - delete interface; - } } /////////////////////////////////////////////////////////////////////////////// @@ -160,17 +149,17 @@ namespace NativeEvents { CGPoint position; position.x = globalPos.x(); position.y = globalPos.y(); - + const bool updateMousePosition = (updateMouse == UpdatePosition); - + // Mouse down. - CGPostMouseEvent(position, updateMousePosition, 3, - (buttons & Qt::LeftButton) ? true : false, - (buttons & Qt::MidButton/* Middlebutton! */) ? true : false, + CGPostMouseEvent(position, updateMousePosition, 3, + (buttons & Qt::LeftButton) ? true : false, + (buttons & Qt::MidButton/* Middlebutton! */) ? true : false, (buttons & Qt::RightButton) ? true : false); // Mouse up. - CGPostMouseEvent(position, updateMousePosition, 3, false, false, false); + CGPostMouseEvent(position, updateMousePosition, 3, false, false, false); } #else # error Oops, NativeEvents::mouseClick() is not implemented on this platform. @@ -200,7 +189,7 @@ bool checkPixel(QColor pixel, QColor expected) } /* - Tests that the pixels inside rect in image all have the given color. + Tests that the pixels inside rect in image all have the given color. */ bool GuiTester::isFilled(const QImage image, const QRect &rect, const QColor &color) { @@ -218,7 +207,7 @@ bool GuiTester::isFilled(const QImage image, const QRect &rect, const QColor &co /* Tests that stuff is painted to the pixels inside rect. - This test fails if any lines in the given direction have pixels + This test fails if any lines in the given direction have pixels of only one color. */ bool GuiTester::isContent(const QImage image, const QRect &rect, Directions directions) @@ -239,7 +228,7 @@ bool GuiTester::isContent(const QImage image, const QRect &rect, Directions dire } } return true; - } + } if (directions & Vertical) { for (int x = rect.left(); x <= rect.right(); ++x) { diff --git a/tests/auto/other/macgui/guitest.h b/tests/auto/other/macgui/guitest.h index 1b5f933769..569a67d7fe 100644 --- a/tests/auto/other/macgui/guitest.h +++ b/tests/auto/other/macgui/guitest.h @@ -70,13 +70,12 @@ public: void printAll(QWidget *widget); void printAll(QAccessibleInterface *interface); - + QAccessibleInterface *find(QAccessible::Text textType, const QString &text, QWidget *start); QAccessibleInterface *find(QAccessible::Text textType, const QString &text, QAccessibleInterface *start); QAccessibleInterface *recursiveSearch(TestBase *test, QAccessibleInterface *iface); - - void deleteInDestructor(QAccessibleInterface * interface); + static QWidget *getWidget(QAccessibleInterface *interface); private: QSet<QAccessibleInterface *> interfaces; @@ -99,7 +98,7 @@ class ColorWidget : public QWidget public: ColorWidget(QWidget *parent = 0, QColor color = QColor(Qt::red)) : QWidget(parent), color(color) {} - + QColor color; protected: @@ -139,7 +138,7 @@ private: }; /* - + */ class GuiTester : public QObject { diff --git a/tests/auto/other/macgui/tst_macgui.cpp b/tests/auto/other/macgui/tst_macgui.cpp index cfe27095a8..e796b44843 100644 --- a/tests/auto/other/macgui/tst_macgui.cpp +++ b/tests/auto/other/macgui/tst_macgui.cpp @@ -41,7 +41,7 @@ #include <QApplication> -#include <QMessageBox> +#include <QMessageBox> #include <QtTest/QtTest> #include <QSplashScreen> #include <QScrollBar> @@ -55,7 +55,7 @@ class tst_MacGui : public GuiTester Q_OBJECT private slots: void scrollbarPainting(); - + void dummy(); void splashScreenModality(); void nonModalOrder(); @@ -216,7 +216,7 @@ void tst_MacGui::spinBoxArrowButtons() spinBox2.move(0, 100); colorWidget.show(); QTest::qWait(100); - + // Grab an unfocused spin box. const QImage noFocus = grabWindowContents(&colorWidget).toImage(); diff --git a/tests/auto/other/macnativeevents/tst_macnativeevents.cpp b/tests/auto/other/macnativeevents/tst_macnativeevents.cpp index 3072d163c3..ae59672c72 100644 --- a/tests/auto/other/macnativeevents/tst_macnativeevents.cpp +++ b/tests/auto/other/macnativeevents/tst_macnativeevents.cpp @@ -293,7 +293,7 @@ void tst_MacNativeEvents::testMouseEnter() void tst_MacNativeEvents::testChildDialogInFrontOfModalParent() { - // Test that a child dialog of a modal parent dialog is + // Test that a child dialog of a modal parent dialog is // in front of the parent, and active: QDialog parent; parent.setWindowModality(Qt::ApplicationModal); diff --git a/tests/auto/other/other.pro b/tests/auto/other/other.pro index 35aaf4d48f..1f7582243e 100644 --- a/tests/auto/other/other.pro +++ b/tests/auto/other/other.pro @@ -42,6 +42,14 @@ SUBDIRS=\ qaccessibility \ qaccessibilitylinux \ +!qtHaveModule(network): SUBDIRS -= \ + baselineexample \ + headersclean \ + lancelot \ + networkselftest \ + qnetworkaccessmanager_and_qprogressdialog \ + qobjectperformance + testcocoon: SUBDIRS -= headersclean cross_compile: SUBDIRS -= \ diff --git a/tests/auto/other/qaccessibility/qaccessibility.pro b/tests/auto/other/qaccessibility/qaccessibility.pro index 54a076b8fa..071b0bb66c 100644 --- a/tests/auto/other/qaccessibility/qaccessibility.pro +++ b/tests/auto/other/qaccessibility/qaccessibility.pro @@ -1,7 +1,7 @@ CONFIG += testcase TARGET = tst_qaccessibility requires(contains(QT_CONFIG,accessibility)) -QT += widgets testlib gui-private +QT += testlib gui-private widgets-private SOURCES += tst_qaccessibility.cpp unix:!mac:LIBS+=-lm diff --git a/tests/auto/other/qaccessibility/tst_qaccessibility.cpp b/tests/auto/other/qaccessibility/tst_qaccessibility.cpp index b0d0459326..4e0b3298fc 100644 --- a/tests/auto/other/qaccessibility/tst_qaccessibility.cpp +++ b/tests/auto/other/qaccessibility/tst_qaccessibility.cpp @@ -58,7 +58,9 @@ #endif #include <QtTest/QtTest> #include <QtGui> +#include <QtGui/private/qaccessible2_p.h> #include <QtWidgets> +#include <QtWidgets/private/qaccessiblewidget_p.h> #include <math.h> #include <qpa/qplatformnativeinterface.h> @@ -66,7 +68,8 @@ # undef interface #endif - +#include <QtGui/private/qaccessible2_p.h> +#include <QtWidgets/private/qaccessiblewidget_p.h> #include "QtTest/qtestaccessible.h" // Make a widget frameless to prevent size constraints of title bars @@ -93,8 +96,6 @@ inline bool IsValidCEPlatform() { } #endif -typedef QSharedPointer<QAccessibleInterface> QAIPtr; - static inline bool verifyChild(QWidget *child, QAccessibleInterface *interface, int index, const QRect &domain) { @@ -109,7 +110,7 @@ static inline bool verifyChild(QWidget *child, QAccessibleInterface *interface, } // Verify that we get a valid QAccessibleInterface for the child. - QAIPtr childInterface(QAccessible::queryAccessibleInterface(child)); + QAccessibleInterface *childInterface(QAccessible::queryAccessibleInterface(child)); if (!childInterface) { qWarning("tst_QAccessibility::verifyChild: Failed to retrieve interface for child."); return false; @@ -117,7 +118,7 @@ static inline bool verifyChild(QWidget *child, QAccessibleInterface *interface, // QAccessibleInterface::indexOfChild(): // Verify that indexOfChild() returns an index equal to the index passed in - int indexFromIndexOfChild = interface->indexOfChild(childInterface.data()); + int indexFromIndexOfChild = interface->indexOfChild(childInterface); if (indexFromIndexOfChild != index) { qWarning("tst_QAccessibility::verifyChild (indexOfChild()):"); qWarning() << "Expected:" << index; @@ -126,7 +127,7 @@ static inline bool verifyChild(QWidget *child, QAccessibleInterface *interface, } // Navigate to child, compare its object and role with the interface from queryAccessibleInterface(child). - QAIPtr navigatedChildInterface(interface->child(index)); + QAccessibleInterface *navigatedChildInterface(interface->child(index)); if (!navigatedChildInterface) return false; @@ -136,7 +137,7 @@ static inline bool verifyChild(QWidget *child, QAccessibleInterface *interface, // Calculate global child position and check that the interface // returns the correct index for that position. QPoint globalChildPos = child->mapToGlobal(QPoint(0, 0)); - QAIPtr childAtInterface(interface->childAt(globalChildPos.x(), globalChildPos.y())); + QAccessibleInterface *childAtInterface(interface->childAt(globalChildPos.x(), globalChildPos.y())); if (!childAtInterface) { qWarning("tst_QAccessibility::verifyChild (childAt()):"); qWarning() << "Expected:" << childInterface; @@ -174,10 +175,10 @@ static inline int indexOfChild(QAccessibleInterface *parentInterface, QWidget *c { if (!parentInterface || !childWidget) return -1; - QAIPtr childInterface(QAccessible::queryAccessibleInterface(childWidget)); + QAccessibleInterface *childInterface(QAccessible::queryAccessibleInterface(childWidget)); if (!childInterface) return -1; - return parentInterface->indexOfChild(childInterface.data()); + return parentInterface->indexOfChild(childInterface); } #define EXPECT(cond) \ @@ -193,20 +194,20 @@ static int verifyHierarchy(QAccessibleInterface *iface) { int errorAt = 0; static int treelevel = 0; // for error diagnostics - QAIPtr middleChild; - QAIPtr if2; + QAccessibleInterface *if2 = 0; ++treelevel; for (int i = 0; i < iface->childCount() && !errorAt; ++i) { - if2 = QAIPtr(iface->child(i)); + if2 = iface->child(i); EXPECT(if2 != 0); - EXPECT(iface->indexOfChild(if2.data()) == i); + EXPECT(iface->indexOfChild(if2) == i); // navigate Ancestor - QAIPtr parent(if2->parent()); + QAccessibleInterface *parent = if2->parent(); EXPECT(iface->object() == parent->object()); + EXPECT(iface == parent); // verify children if (!errorAt) - errorAt = verifyHierarchy(if2.data()); + errorAt = verifyHierarchy(if2); } --treelevel; @@ -215,7 +216,7 @@ static int verifyHierarchy(QAccessibleInterface *iface) QRect childRect(QAccessibleInterface *iface, int index = 0) { - return QAIPtr(iface->child(index))->rect(); + return iface->child(index)->rect(); } class tst_QAccessibility : public QObject @@ -234,6 +235,7 @@ private slots: void eventTest(); void customWidget(); void deletedWidget(); + void subclassedWidget(); void statesStructTest(); void navigateHierarchy(); @@ -284,7 +286,7 @@ private: QAccessible::State state(QWidget * const widget) { - QAIPtr iface(QAccessible::queryAccessibleInterface(widget)); + QAccessibleInterface *iface(QAccessible::queryAccessibleInterface(widget)); if (!iface) { qWarning() << "Cannot get QAccessibleInterface for widget"; return QAccessible::State(); @@ -292,38 +294,6 @@ QAccessible::State state(QWidget * const widget) return iface->state(); } -class QtTestAccessibleWidget: public QWidget -{ - Q_OBJECT -public: - QtTestAccessibleWidget(QWidget *parent, const char *name): QWidget(parent) - { - setObjectName(name); - QPalette pal; - pal.setColor(backgroundRole(), Qt::black);//black is beautiful - setPalette(pal); - setFixedSize(5, 5); - } -}; - -class QtTestAccessibleWidgetIface: public QAccessibleWidget -{ -public: - QtTestAccessibleWidgetIface(QtTestAccessibleWidget *w): QAccessibleWidget(w) {} - QString text(QAccessible::Text t) const - { - if (t == QAccessible::Help) - return QString::fromLatin1("Help yourself"); - return QAccessibleWidget::text(t); - } - static QAccessibleInterface *ifaceFactory(const QString &key, QObject *o) - { - if (key == "QtTestAccessibleWidget") - return new QtTestAccessibleWidgetIface(static_cast<QtTestAccessibleWidget*>(o)); - return 0; - } -}; - tst_QAccessibility::tst_QAccessibility() { click_count = 0; @@ -341,7 +311,6 @@ void tst_QAccessibility::onClicked() void tst_QAccessibility::initTestCase() { QTestAccessibility::initialize(); - QAccessible::installFactory(QtTestAccessibleWidgetIface::ifaceFactory); } void tst_QAccessibility::cleanupTestCase() @@ -370,6 +339,7 @@ void tst_QAccessibility::cleanup() void tst_QAccessibility::eventTest() { QPushButton* button = new QPushButton(0); + QAccessible::queryAccessibleInterface(button); button->setObjectName(QString("Olaf")); setFrameless(button); @@ -394,26 +364,112 @@ void tst_QAccessibility::eventTest() QVERIFY(QTestAccessibility::containsEvent(&hideEvent)); delete button; + + // Make sure that invalid events don't bring down the system + // these events can be in user code. + QWidget *widget = new QWidget(); + QAccessibleEvent ev1(widget, QAccessible::Focus); + QAccessible::updateAccessibility(&ev1); + + QAccessibleEvent ev2(widget, QAccessible::Focus); + ev2.setChild(7); + QAccessible::updateAccessibility(&ev2); + delete widget; + + QObject *object = new QObject(); + QAccessibleEvent ev3(object, QAccessible::Focus); + QAccessible::updateAccessibility(&ev3); + delete object; + + QTestAccessibility::clearEvents(); } + +class QtTestAccessibleWidget: public QWidget +{ + Q_OBJECT +public: + QtTestAccessibleWidget(QWidget *parent, const char *name): QWidget(parent) + { + setObjectName(name); + } +}; + +class QtTestAccessibleWidgetIface: public QAccessibleWidget +{ +public: + QtTestAccessibleWidgetIface(QtTestAccessibleWidget *w): QAccessibleWidget(w) {} + QString text(QAccessible::Text t) const + { + if (t == QAccessible::Help) + return QString::fromLatin1("Help yourself"); + return QAccessibleWidget::text(t); + } + static QAccessibleInterface *ifaceFactory(const QString &key, QObject *o) + { + if (key == "QtTestAccessibleWidget") + return new QtTestAccessibleWidgetIface(static_cast<QtTestAccessibleWidget*>(o)); + return 0; + } +}; + +class QtTestAccessibleWidgetSubclass: public QtTestAccessibleWidget +{ + Q_OBJECT +public: + QtTestAccessibleWidgetSubclass(QWidget *parent, const char *name): QtTestAccessibleWidget(parent, name) + {} +}; + void tst_QAccessibility::customWidget() { + { QtTestAccessibleWidget* widget = new QtTestAccessibleWidget(0, "Heinz"); - + widget->show(); + QTest::qWaitForWindowExposed(widget); + // By default we create QAccessibleWidget + QAccessibleInterface *iface = QAccessible::queryAccessibleInterface(widget); + QVERIFY(iface != 0); + QVERIFY(iface->isValid()); + QCOMPARE(iface->object(), (QObject*)widget); + QCOMPARE(iface->object()->objectName(), QString("Heinz")); + QCOMPARE(iface->rect().height(), widget->height()); + QCOMPARE(iface->text(QAccessible::Help), QString()); + QCOMPARE(iface->rect().height(), widget->height()); + delete widget; + } + { + QAccessible::installFactory(QtTestAccessibleWidgetIface::ifaceFactory); + QtTestAccessibleWidget* widget = new QtTestAccessibleWidget(0, "Heinz"); + widget->show(); + QTest::qWaitForWindowExposed(widget); QAccessibleInterface *iface = QAccessible::queryAccessibleInterface(widget); QVERIFY(iface != 0); QVERIFY(iface->isValid()); QCOMPARE(iface->object(), (QObject*)widget); QCOMPARE(iface->object()->objectName(), QString("Heinz")); + QCOMPARE(iface->rect().height(), widget->height()); + // The help text is only set if our factory works QCOMPARE(iface->text(QAccessible::Help), QString("Help yourself")); - - delete iface; delete widget; + } + { + // A subclass of any class should still get the right QAccessibleInterface + QtTestAccessibleWidgetSubclass* subclassedWidget = new QtTestAccessibleWidgetSubclass(0, "Hans"); + QAccessibleInterface *subIface = QAccessible::queryAccessibleInterface(subclassedWidget); + QVERIFY(subIface != 0); + QVERIFY(subIface->isValid()); + QCOMPARE(subIface->object(), (QObject*)subclassedWidget); + QCOMPARE(subIface->text(QAccessible::Help), QString("Help yourself")); + delete subclassedWidget; + } + QTestAccessibility::clearEvents(); } void tst_QAccessibility::deletedWidget() { QtTestAccessibleWidget *widget = new QtTestAccessibleWidget(0, "Ralf"); + QAccessible::installFactory(QtTestAccessibleWidgetIface::ifaceFactory); QAccessibleInterface *iface = QAccessible::queryAccessibleInterface(widget); QVERIFY(iface != 0); QVERIFY(iface->isValid()); @@ -421,8 +477,25 @@ void tst_QAccessibility::deletedWidget() delete widget; widget = 0; - QVERIFY(!iface->isValid()); - delete iface; + // fixme: QVERIFY(!iface->isValid()); +} + +class KFooButton: public QPushButton +{ + Q_OBJECT +public: + KFooButton(const QString &text, QWidget* parent = 0) : QPushButton(text, parent) + {} +}; + +void tst_QAccessibility::subclassedWidget() +{ + KFooButton button("Ploink", 0); + QAccessibleInterface *iface = QAccessible::queryAccessibleInterface(&button); + QVERIFY(iface); + QCOMPARE(iface->object(), (QObject*)&button); + QCOMPARE(iface->text(QAccessible::Name), button.text()); + QTestAccessibility::clearEvents(); } void tst_QAccessibility::statesStructTest() @@ -452,7 +525,7 @@ void tst_QAccessibility::sliderTest() setFrameless(slider); slider->setObjectName(QString("Slidy")); slider->show(); - QAIPtr iface(QAccessible::queryAccessibleInterface(slider)); + QAccessibleInterface *iface(QAccessible::queryAccessibleInterface(slider)); QVERIFY(iface); QVERIFY(iface->isValid()); @@ -499,16 +572,16 @@ void tst_QAccessibility::navigateHierarchy() w31->setObjectName(QString("31")); w31->show(); - QAIPtr ifaceW(QAccessible::queryAccessibleInterface(w)); + QAccessibleInterface *ifaceW(QAccessible::queryAccessibleInterface(w)); QVERIFY(ifaceW != 0); QVERIFY(ifaceW->isValid()); - QAIPtr target = QAIPtr(ifaceW->child(14)); + QAccessibleInterface *target = ifaceW->child(14); QVERIFY(target == 0); - target = QAIPtr(ifaceW->child(-1)); + target = ifaceW->child(-1); QVERIFY(target == 0); - target = QAIPtr(ifaceW->child(0)); - QAIPtr interfaceW1(ifaceW->child(0)); + target = ifaceW->child(0); + QAccessibleInterface *interfaceW1(ifaceW->child(0)); QVERIFY(target); QVERIFY(target->isValid()); QCOMPARE(target->object(), (QObject*)w1); @@ -516,24 +589,24 @@ void tst_QAccessibility::navigateHierarchy() QVERIFY(interfaceW1->isValid()); QCOMPARE(interfaceW1->object(), (QObject*)w1); - target = QAIPtr(ifaceW->child(2)); + target = ifaceW->child(2); QVERIFY(target != 0); QVERIFY(target->isValid()); QCOMPARE(target->object(), (QObject*)w3); - QAIPtr child = QAIPtr(target->child(1)); + QAccessibleInterface *child = target->child(1); QVERIFY(child == 0); - child = QAIPtr(target->child(0)); + child = target->child(0); QVERIFY(child != 0); QVERIFY(child->isValid()); QCOMPARE(child->object(), (QObject*)w31); - ifaceW = QAIPtr(QAccessible::queryAccessibleInterface(w)); - QAIPtr acc3(ifaceW->child(2)); - target = QAIPtr(acc3->child(0)); + ifaceW = QAccessible::queryAccessibleInterface(w); + QAccessibleInterface *acc3(ifaceW->child(2)); + target = acc3->child(0); QCOMPARE(target->object(), (QObject*)w31); - QAIPtr parent = QAIPtr(target->parent()); + QAccessibleInterface *parent = target->parent(); QVERIFY(parent != 0); QVERIFY(parent->isValid()); QCOMPARE(parent->object(), (QObject*)w3); @@ -596,10 +669,8 @@ void tst_QAccessibility::accessibleName() { QWidget *toplevel = createWidgets(); toplevel->show(); -#if defined(Q_OS_UNIX) - QCoreApplication::processEvents(); - QTest::qWait(100); -#endif + QVERIFY(QTest::qWaitForWindowExposed(toplevel)); + QLayout *lout = toplevel->layout(); for (int i = 0; i < lout->count(); i++) { QLayoutItem *item = lout->itemAt(i); @@ -608,12 +679,12 @@ void tst_QAccessibility::accessibleName() QString name = tr("Widget Name %1").arg(i); child->setAccessibleName(name); QAccessibleInterface *acc = QAccessible::queryAccessibleInterface(child); + QVERIFY(acc); QCOMPARE(acc->text(QAccessible::Name), name); QString desc = tr("Widget Description %1").arg(i); child->setAccessibleDescription(desc); QCOMPARE(acc->text(QAccessible::Description), desc); - } delete toplevel; @@ -731,7 +802,6 @@ void tst_QAccessibility::actionTest() widget->setFocusPolicy(Qt::StrongFocus); QCOMPARE(actions->actionNames(), QStringList(QAccessibleActionInterface::setFocusAction())); - delete interface; delete widget; } QTestAccessibility::clearEvents(); @@ -760,7 +830,6 @@ void tst_QAccessibility::actionTest() QTest::qWait(500); QCOMPARE(click_count, 1); - delete interface; delete button; } QTestAccessibility::clearEvents(); @@ -768,12 +837,40 @@ void tst_QAccessibility::actionTest() void tst_QAccessibility::applicationTest() { + { QLatin1String name = QLatin1String("My Name"); qApp->setApplicationName(name); QAccessibleInterface *interface = QAccessible::queryAccessibleInterface(qApp); QCOMPARE(interface->text(QAccessible::Name), name); + QCOMPARE(interface->text(QAccessible::Description), qApp->applicationFilePath()); + QCOMPARE(interface->text(QAccessible::Value), QString()); QCOMPARE(interface->role(), QAccessible::Application); - delete interface; + QCOMPARE(interface->window(), static_cast<QWindow*>(0)); + QCOMPARE(interface->parent(), static_cast<QAccessibleInterface*>(0)); + QCOMPARE(interface->focusChild(), static_cast<QAccessibleInterface*>(0)); + QCOMPARE(interface->indexOfChild(0), -1); + QCOMPARE(interface->child(0), static_cast<QAccessibleInterface*>(0)); + QCOMPARE(interface->child(-1), static_cast<QAccessibleInterface*>(0)); + QCOMPARE(interface->child(1), static_cast<QAccessibleInterface*>(0)); + QCOMPARE(interface->childCount(), 0); + + QWidget widget; + widget.show(); + qApp->setActiveWindow(&widget); + QVERIFY(QTest::qWaitForWindowActive(&widget)); + + QAccessibleInterface *widgetIface = QAccessible::queryAccessibleInterface(&widget); + QCOMPARE(interface->childCount(), 1); + QAccessibleInterface *focus = interface->focusChild(); + QCOMPARE(focus->object(), &widget); + QCOMPARE(interface->indexOfChild(0), -1); + QCOMPARE(interface->indexOfChild(widgetIface), 0); + QAccessibleInterface *child = interface->child(0); + QCOMPARE(child->object(), &widget); + QCOMPARE(interface->child(-1), static_cast<QAccessibleInterface*>(0)); + QCOMPARE(interface->child(1), static_cast<QAccessibleInterface*>(0)); + } + QTestAccessibility::clearEvents(); } void tst_QAccessibility::mainWindowTest() @@ -802,7 +899,6 @@ void tst_QAccessibility::mainWindowTest() QVERIFY(iface->state().active); - delete iface; delete mw; } QTestAccessibility::clearEvents(); @@ -815,7 +911,7 @@ void tst_QAccessibility::mainWindowTest() // We currently don't have an accessible interface for QWindow // the active state is either in the QMainWindow or QQuickView -// QAIPtr windowIface(QAccessible::queryAccessibleInterface(&window)); +// QAccessibleInterface *windowIface(QAccessible::queryAccessibleInterface(&window)); // QVERIFY(windowIface->state().active); QAccessible::State activeState; @@ -900,7 +996,6 @@ void tst_QAccessibility::buttonTest() actionInterface->doAction(QAccessibleActionInterface::pressAction()); QTest::qWait(500); QCOMPARE(pushButton.clickCount, 1); - delete interface; // test toggle button interface = QAccessible::queryAccessibleInterface(&toggleButton); @@ -915,7 +1010,6 @@ void tst_QAccessibility::buttonTest() QVERIFY(toggleButton.isChecked()); QCOMPARE(actionInterface->actionNames().at(0), QAccessibleActionInterface::toggleAction()); QVERIFY(interface->state().checked); - delete interface; { // test menu push button @@ -934,7 +1028,6 @@ void tst_QAccessibility::buttonTest() // showing the menu enters a new event loop... // interface->actionInterface()->doAction(QAccessibleActionInterface::showMenuAction()); // QTest::qWait(500); - delete interface; delete menu; } @@ -959,7 +1052,6 @@ void tst_QAccessibility::buttonTest() QVERIFY_EVENT(&ev); checkBox.setChecked(false); QVERIFY_EVENT(&ev); - delete interface; } { @@ -978,7 +1070,6 @@ void tst_QAccessibility::buttonTest() st.checked = true; QAccessibleStateChangeEvent ev(&radio, st); QVERIFY_EVENT(&ev); - delete interface; } // // test standard toolbutton @@ -1071,7 +1162,6 @@ void tst_QAccessibility::scrollBarTest() const QRect scrollBarRect = scrollBarInterface->rect(); QVERIFY(scrollBarRect.isValid()); - delete scrollBarInterface; delete scrollBar; QTestAccessibility::clearEvents(); @@ -1092,7 +1182,6 @@ void tst_QAccessibility::tabTest() QAccessibleInterface *leftButton = interface->child(0); QCOMPARE(leftButton->role(), QAccessible::PushButton); QVERIFY(leftButton->state().invisible); - delete leftButton; const int lots = 5; for (int i = 0; i < lots; ++i) @@ -1128,9 +1217,6 @@ void tst_QAccessibility::tabTest() QCOMPARE(tabBar->currentIndex(), 1); delete tabBar; - delete interface; - delete child1; - delete child2; QTestAccessibility::clearEvents(); } @@ -1179,10 +1265,6 @@ void tst_QAccessibility::tabWidgetTest() QVERIFY(tabButtonRight); QCOMPARE(tabButtonRight->role(), QAccessible::PushButton); QCOMPARE(tabButtonRight->text(QAccessible::Name), QLatin1String("Scroll Right")); - delete tabButton1Interface; - delete tabButton2Interface; - delete tabButtonLeft; - delete tabButtonRight; QAccessibleInterface* stackWidgetInterface = interface->child(0); QVERIFY(stackWidgetInterface); @@ -1205,7 +1287,6 @@ void tst_QAccessibility::tabWidgetTest() QCOMPARE(parent->childCount(), 2); #endif QCOMPARE(parent->role(), QAccessible::LayeredPane); - delete parent; QAccessibleInterface* stackChild2Interface = stackWidgetInterface->child(1); QVERIFY(stackChild2Interface); @@ -1220,13 +1301,7 @@ void tst_QAccessibility::tabWidgetTest() QCOMPARE(parent->childCount(), 2); #endif QCOMPARE(parent->role(), QAccessible::LayeredPane); - delete parent; - delete tabBarInterface; - delete stackChild1Interface; - delete stackChild2Interface; - delete stackWidgetInterface; - delete interface; delete tabWidget; QTestAccessibility::clearEvents(); } @@ -1274,7 +1349,6 @@ void tst_QAccessibility::menuTest() QAccessibleInterface *interface = QAccessible::queryAccessibleInterface(&mw); QCOMPARE(verifyHierarchy(interface), 0); - delete interface; interface = QAccessible::queryAccessibleInterface(mw.menuBar()); @@ -1351,7 +1425,6 @@ void tst_QAccessibility::menuTest() QVERIFY(interface->actionInterface()); QCOMPARE(interface->actionInterface()->actionNames(), QStringList()); - delete interface; interface = QAccessible::queryAccessibleInterface(file); QCOMPARE(interface->childCount(), 5); QCOMPARE(interface->role(), QAccessible::PopupMenu); @@ -1392,9 +1465,7 @@ void tst_QAccessibility::menuTest() iface2 = interface->child(child); QVERIFY(iface2); QCOMPARE(iface2->role(), fileRoles[child]); - delete iface2; } - delete iface; // "New" item iface = interface->child(0); @@ -1403,20 +1474,16 @@ void tst_QAccessibility::menuTest() // "New" menu iface2 = iface->child(0); - delete iface; iface = iface2; QVERIFY(iface); QCOMPARE(iface->role(), QAccessible::PopupMenu); // "Text file" menu item iface2 = iface->child(0); - delete iface; iface = iface2; QVERIFY(iface); QCOMPARE(iface->role(), QAccessible::MenuItem); - delete iface; - // move mouse pointer away, since that might influence the // subsequent tests QTest::mouseMove(&mw, QPoint(-1, -1)); @@ -1435,13 +1502,6 @@ void tst_QAccessibility::menuTest() QTestAccessibility::clearEvents(); mw.hide(); - delete iFile; - delete iFileNew; - delete iFileOpen; - delete iFileSave; - delete iFileSeparator; - delete iFileExit; - // Do not crash if the menu don't have a parent QMenu *menu = new QMenu; menu->addAction(QLatin1String("one")); @@ -1453,8 +1513,6 @@ void tst_QAccessibility::menuTest() QCOMPARE(iface2->role(), QAccessible::Application); // caused a *crash* iface2->state(); - delete iface2; - delete iface; delete menu; } @@ -1486,7 +1544,6 @@ void tst_QAccessibility::spinBoxTest() QCOMPARE(lineEdit->role(), QAccessible::EditableText); QCOMPARE(lineEdit->text(QAccessible::Value), QLatin1String("3")); - delete lineEdit; QVERIFY(interface->valueInterface()); QCOMPARE(interface->valueInterface()->currentValue().toInt(), 3); @@ -1525,7 +1582,6 @@ void tst_QAccessibility::doubleSpinBoxTest() QAccessibleInterface *childIface = interface->child(i); const QRect childRect = childIface->rect(); QVERIFY(childRect.isValid()); - delete childIface; } delete doubleSpinBox; @@ -1588,10 +1644,10 @@ void tst_QAccessibility::textEditTest() QTest::qWaitForWindowShown(&edit); QAccessibleInterface *iface = QAccessible::queryAccessibleInterface(&edit); QCOMPARE(iface->text(QAccessible::Value), edit.toPlainText()); - QCOMPARE(iface->textInterface()->textAtOffset(8, QAccessible2::WordBoundary, &startOffset, &endOffset), QString("world")); + QCOMPARE(iface->textInterface()->textAtOffset(8, QAccessible::WordBoundary, &startOffset, &endOffset), QString("world")); QCOMPARE(startOffset, 6); QCOMPARE(endOffset, 11); - QCOMPARE(iface->textInterface()->textAtOffset(15, QAccessible2::LineBoundary, &startOffset, &endOffset), QString("How are you today?")); + QCOMPARE(iface->textInterface()->textAtOffset(15, QAccessible::LineBoundary, &startOffset, &endOffset), QString("How are you today?")); QCOMPARE(startOffset, 13); QCOMPARE(endOffset, 31); QCOMPARE(iface->textInterface()->characterCount(), 48); @@ -1649,10 +1705,10 @@ void tst_QAccessibility::textBrowserTest() QCOMPARE(iface->text(QAccessible::Value), text); int startOffset; int endOffset; - QCOMPARE(iface->textInterface()->textAtOffset(8, QAccessible2::WordBoundary, &startOffset, &endOffset), QString("world")); + QCOMPARE(iface->textInterface()->textAtOffset(8, QAccessible::WordBoundary, &startOffset, &endOffset), QString("world")); QCOMPARE(startOffset, 6); QCOMPARE(endOffset, 11); - QCOMPARE(iface->textInterface()->textAtOffset(14, QAccessible2::LineBoundary, &startOffset, &endOffset), QString("how are you today?")); + QCOMPARE(iface->textInterface()->textAtOffset(14, QAccessible::LineBoundary, &startOffset, &endOffset), QString("how are you today?")); QCOMPARE(startOffset, 12); QCOMPARE(endOffset, 30); QCOMPARE(iface->textInterface()->characterCount(), 31); @@ -1783,7 +1839,6 @@ void tst_QAccessibility::mdiSubWindowTest() QAccessibleInterface *child = interface->childAt(globalWidgetPos.x(), globalWidgetPos.y()); QCOMPARE(child->role(), QAccessible::PushButton); QCOMPARE(child->text(QAccessible::Name), QString("QAccessibilityTest")); - delete child; testWindow->widget()->hide(); QCOMPARE(interface->childAt(globalWidgetPos.x(), globalWidgetPos.y()), static_cast<QAccessibleInterface*>(0)); @@ -1796,7 +1851,7 @@ void tst_QAccessibility::lineEditTest() QWidget *toplevel = new QWidget; { QLineEdit *le = new QLineEdit; - QAIPtr iface(QAccessible::queryAccessibleInterface(le)); + QAccessibleInterface *iface(QAccessible::queryAccessibleInterface(le)); QVERIFY(iface); le->show(); @@ -1862,7 +1917,7 @@ void tst_QAccessibility::lineEditTest() QString cite = "I always pass on good advice. It is the only thing to do with it. It is never of any use to oneself. --Oscar Wilde"; QLineEdit *le3 = new QLineEdit(cite, toplevel); le3->show(); - QAIPtr iface(QAccessible::queryAccessibleInterface(le3)); + QAccessibleInterface *iface(QAccessible::queryAccessibleInterface(le3)); QAccessibleTextInterface* textIface = iface->textInterface(); le3->deselect(); QTestAccessibility::clearEvents(); @@ -1876,45 +1931,45 @@ void tst_QAccessibility::lineEditTest() int start, end; QCOMPARE(textIface->text(0, 8), QString::fromLatin1("I always")); - QCOMPARE(textIface->textAtOffset(0, QAccessible2::CharBoundary,&start,&end), QString::fromLatin1("I")); + QCOMPARE(textIface->textAtOffset(0, QAccessible::CharBoundary,&start,&end), QString::fromLatin1("I")); QCOMPARE(start, 0); QCOMPARE(end, 1); - QCOMPARE(textIface->textBeforeOffset(0, QAccessible2::CharBoundary,&start,&end), QString()); - QCOMPARE(textIface->textAfterOffset(0, QAccessible2::CharBoundary,&start,&end), QString::fromLatin1(" ")); + QCOMPARE(textIface->textBeforeOffset(0, QAccessible::CharBoundary,&start,&end), QString()); + QCOMPARE(textIface->textAfterOffset(0, QAccessible::CharBoundary,&start,&end), QString::fromLatin1(" ")); QCOMPARE(start, 1); QCOMPARE(end, 2); - QCOMPARE(textIface->textAtOffset(5, QAccessible2::CharBoundary,&start,&end), QString::fromLatin1("a")); + QCOMPARE(textIface->textAtOffset(5, QAccessible::CharBoundary,&start,&end), QString::fromLatin1("a")); QCOMPARE(start, 5); QCOMPARE(end, 6); - QCOMPARE(textIface->textBeforeOffset(5, QAccessible2::CharBoundary,&start,&end), QString::fromLatin1("w")); - QCOMPARE(textIface->textAfterOffset(5, QAccessible2::CharBoundary,&start,&end), QString::fromLatin1("y")); + QCOMPARE(textIface->textBeforeOffset(5, QAccessible::CharBoundary,&start,&end), QString::fromLatin1("w")); + QCOMPARE(textIface->textAfterOffset(5, QAccessible::CharBoundary,&start,&end), QString::fromLatin1("y")); - QCOMPARE(textIface->textAtOffset(5, QAccessible2::WordBoundary,&start,&end), QString::fromLatin1("always")); + QCOMPARE(textIface->textAtOffset(5, QAccessible::WordBoundary,&start,&end), QString::fromLatin1("always")); QCOMPARE(start, 2); QCOMPARE(end, 8); - QCOMPARE(textIface->textAtOffset(2, QAccessible2::WordBoundary,&start,&end), QString::fromLatin1("always")); - QCOMPARE(textIface->textAtOffset(7, QAccessible2::WordBoundary,&start,&end), QString::fromLatin1("always")); - QCOMPARE(textIface->textAtOffset(8, QAccessible2::WordBoundary,&start,&end), QString::fromLatin1(" ")); - QCOMPARE(textIface->textAtOffset(25, QAccessible2::WordBoundary,&start,&end), QString::fromLatin1("advice")); - QCOMPARE(textIface->textAtOffset(92, QAccessible2::WordBoundary,&start,&end), QString::fromLatin1("oneself")); - QCOMPARE(textIface->textAtOffset(101, QAccessible2::WordBoundary,&start,&end), QString::fromLatin1(". --")); + QCOMPARE(textIface->textAtOffset(2, QAccessible::WordBoundary,&start,&end), QString::fromLatin1("always")); + QCOMPARE(textIface->textAtOffset(7, QAccessible::WordBoundary,&start,&end), QString::fromLatin1("always")); + QCOMPARE(textIface->textAtOffset(8, QAccessible::WordBoundary,&start,&end), QString::fromLatin1(" ")); + QCOMPARE(textIface->textAtOffset(25, QAccessible::WordBoundary,&start,&end), QString::fromLatin1("advice")); + QCOMPARE(textIface->textAtOffset(92, QAccessible::WordBoundary,&start,&end), QString::fromLatin1("oneself")); + QCOMPARE(textIface->textAtOffset(101, QAccessible::WordBoundary,&start,&end), QString::fromLatin1(". --")); - QCOMPARE(textIface->textBeforeOffset(5, QAccessible2::WordBoundary,&start,&end), QString::fromLatin1(" ")); - QCOMPARE(textIface->textAfterOffset(5, QAccessible2::WordBoundary,&start,&end), QString::fromLatin1(" ")); - QCOMPARE(textIface->textAtOffset(5, QAccessible2::SentenceBoundary,&start,&end), QString::fromLatin1("I always pass on good advice. ")); + QCOMPARE(textIface->textBeforeOffset(5, QAccessible::WordBoundary,&start,&end), QString::fromLatin1(" ")); + QCOMPARE(textIface->textAfterOffset(5, QAccessible::WordBoundary,&start,&end), QString::fromLatin1(" ")); + QCOMPARE(textIface->textAtOffset(5, QAccessible::SentenceBoundary,&start,&end), QString::fromLatin1("I always pass on good advice. ")); QCOMPARE(start, 0); QCOMPARE(end, 30); - QCOMPARE(textIface->textBeforeOffset(40, QAccessible2::SentenceBoundary,&start,&end), QString::fromLatin1("I always pass on good advice. ")); - QCOMPARE(textIface->textAfterOffset(5, QAccessible2::SentenceBoundary,&start,&end), QString::fromLatin1("It is the only thing to do with it. ")); + QCOMPARE(textIface->textBeforeOffset(40, QAccessible::SentenceBoundary,&start,&end), QString::fromLatin1("I always pass on good advice. ")); + QCOMPARE(textIface->textAfterOffset(5, QAccessible::SentenceBoundary,&start,&end), QString::fromLatin1("It is the only thing to do with it. ")); - QCOMPARE(textIface->textAtOffset(5, QAccessible2::ParagraphBoundary,&start,&end), cite); + QCOMPARE(textIface->textAtOffset(5, QAccessible::ParagraphBoundary,&start,&end), cite); QCOMPARE(start, 0); QCOMPARE(end, cite.length()); - QCOMPARE(textIface->textAtOffset(5, QAccessible2::LineBoundary,&start,&end), cite); - QCOMPARE(textIface->textAtOffset(5, QAccessible2::NoBoundary,&start,&end), cite); + QCOMPARE(textIface->textAtOffset(5, QAccessible::LineBoundary,&start,&end), cite); + QCOMPARE(textIface->textAtOffset(5, QAccessible::NoBoundary,&start,&end), cite); QTestAccessibility::clearEvents(); } @@ -1924,7 +1979,7 @@ void tst_QAccessibility::lineEditTest() // characterRect() le.show(); QTest::qWaitForWindowShown(&le); - QAIPtr iface(QAccessible::queryAccessibleInterface(&le)); + QAccessibleInterface *iface(QAccessible::queryAccessibleInterface(&le)); QAccessibleTextInterface* textIface = iface->textInterface(); QVERIFY(textIface); const QRect lineEditRect = iface->rect(); @@ -2062,10 +2117,6 @@ void tst_QAccessibility::groupBoxTest() QCOMPARE(relation.first->object(), groupBox); QCOMPARE(relation.second, QAccessible::Label); - delete relation.first; - - delete rButtonIface; - delete iface; delete groupBox; } @@ -2095,7 +2146,6 @@ void tst_QAccessibility::groupBoxTest() QAccessibleStateChangeEvent ev2(groupBox, st); QVERIFY_EVENT(&ev2); - delete iface; delete groupBox; } } @@ -2161,7 +2211,6 @@ void tst_QAccessibility::dialogButtonBoxTest() break; } QCOMPARE(actualOrder, expectedOrder); - delete iface; QApplication::processEvents(); QTestAccessibility::clearEvents(); } @@ -2201,7 +2250,6 @@ void tst_QAccessibility::dialogButtonBoxTest() << QDialogButtonBox::tr("Help"); QCOMPARE(actualOrder, expectedOrder); - delete iface; QApplication::processEvents(); } @@ -2251,7 +2299,6 @@ void tst_QAccessibility::rubberBandTest() QAccessibleInterface *interface = QAccessible::queryAccessibleInterface(&rubberBand); QVERIFY(interface); QCOMPARE(interface->role(), QAccessible::Border); - delete interface; QTestAccessibility::clearEvents(); } @@ -2336,7 +2383,6 @@ void tst_QAccessibility::abstractScrollAreaTest() QCOMPARE(verifyHierarchy(interface), 0); - delete interface; } QTestAccessibility::clearEvents(); @@ -2354,7 +2400,6 @@ void tst_QAccessibility::scrollAreaTest() QAccessibleInterface *interface = QAccessible::queryAccessibleInterface(&scrollArea); QVERIFY(interface); QCOMPARE(interface->childCount(), 1); // The viewport. - delete interface; } QTestAccessibility::clearEvents(); } @@ -2372,27 +2417,27 @@ void tst_QAccessibility::listTest() QCoreApplication::processEvents(); QTest::qWait(100); - QAIPtr iface = QAIPtr(QAccessible::queryAccessibleInterface(listView)); - QCOMPARE(verifyHierarchy(iface.data()), 0); + QAccessibleInterface *iface = QAccessible::queryAccessibleInterface(listView); + QCOMPARE(verifyHierarchy(iface), 0); QCOMPARE((int)iface->role(), (int)QAccessible::List); QCOMPARE(iface->childCount(), 3); { - QAIPtr child1 = QAIPtr(iface->child(0)); + QAccessibleInterface *child1 = iface->child(0); QVERIFY(child1); - QCOMPARE(iface->indexOfChild(child1.data()), 0); + QCOMPARE(iface->indexOfChild(child1), 0); QCOMPARE(child1->text(QAccessible::Name), QString("Oslo")); QCOMPARE(child1->role(), QAccessible::ListItem); - QAIPtr child2 = QAIPtr(iface->child(1)); + QAccessibleInterface *child2 = iface->child(1); QVERIFY(child2); - QCOMPARE(iface->indexOfChild(child2.data()), 1); + QCOMPARE(iface->indexOfChild(child2), 1); QCOMPARE(child2->text(QAccessible::Name), QString("Berlin")); - QAIPtr child3 = QAIPtr(iface->child(2)); + QAccessibleInterface *child3 = iface->child(2); QVERIFY(child3); - QCOMPARE(iface->indexOfChild(child3.data()), 2); + QCOMPARE(iface->indexOfChild(child3), 2); QCOMPARE(child3->text(QAccessible::Name), QString("Brisbane")); } QTestAccessibility::clearEvents(); @@ -2422,11 +2467,11 @@ void tst_QAccessibility::listTest() QVERIFY(table2); QCOMPARE(table2->columnCount(), 1); QCOMPARE(table2->rowCount(), 4); - QAIPtr cell1 = QAIPtr(table2->cellAt(0,0)); + QAccessibleInterface *cell1 = table2->cellAt(0,0); QVERIFY(cell1); QCOMPARE(cell1->text(QAccessible::Name), QString("Oslo")); - QAIPtr cell4 = QAIPtr(table2->cellAt(3,0)); + QAccessibleInterface *cell4 = table2->cellAt(3,0); QVERIFY(cell4); QCOMPARE(cell4->text(QAccessible::Name), QString("Munich")); QCOMPARE(cell4->role(), QAccessible::ListItem); @@ -2440,7 +2485,7 @@ void tst_QAccessibility::listTest() QCOMPARE(cellInterface->rowHeaderCells(), QList<QAccessibleInterface*>()); QCOMPARE(cellInterface->columnHeaderCells(), QList<QAccessibleInterface*>()); - QCOMPARE(QAIPtr(cellInterface->table())->object(), listView); + QCOMPARE(cellInterface->table()->object(), listView); listView->clearSelection(); QVERIFY(!(cell4->state().expandable)); @@ -2457,6 +2502,25 @@ void tst_QAccessibility::listTest() QVERIFY(table2->cellAt(0, 1) == 0); QVERIFY(table2->cellAt(4, 0) == 0); + // verify that unique id stays the same + QAccessible::Id axidMunich = QAccessible::uniqueId(cell4); + // insertion and deletion of items + listView->insertItem(1, "Helsinki"); + // list: Oslo, Helsinki, Berlin, Brisbane, Munich + + QAccessibleInterface *cellMunich2 = table2->cellAt(4,0); + QCOMPARE(cell4, cellMunich2); + QCOMPARE(axidMunich, QAccessible::uniqueId(cellMunich2)); + + delete listView->takeItem(2); + delete listView->takeItem(2); + // list: Oslo, Helsinki, Munich + + QAccessibleInterface *cellMunich3 = table2->cellAt(2,0); + QCOMPARE(cell4, cellMunich3); + QCOMPARE(axidMunich, QAccessible::uniqueId(cellMunich3)); + + delete listView; } QTestAccessibility::clearEvents(); @@ -2512,29 +2576,24 @@ void tst_QAccessibility::treeTest() // header and 2 rows (the others are not expanded, thus not visible) QCOMPARE(iface->childCount(), 6); - QAccessibleInterface *header1 = 0; - header1 = iface->child(0); + QAccessibleInterface *header1 = iface->child(0); QVERIFY(header1); QCOMPARE(iface->indexOfChild(header1), 0); QCOMPARE(header1->text(QAccessible::Name), QString("Artist")); QCOMPARE(header1->role(), QAccessible::ColumnHeader); - delete header1; - QAccessibleInterface *child1 = 0; - child1 = iface->child(2); + QAccessibleInterface *child1 = iface->child(2); QVERIFY(child1); QCOMPARE(iface->indexOfChild(child1), 2); QCOMPARE(child1->text(QAccessible::Name), QString("Spain")); QCOMPARE(child1->role(), QAccessible::TreeItem); QVERIFY(!(child1->state().expanded)); - delete child1; QAccessibleInterface *child2 = 0; child2 = iface->child(4); QVERIFY(child2); QCOMPARE(iface->indexOfChild(child2), 4); QCOMPARE(child2->text(QAccessible::Name), QString("Austria")); - delete child2; QTestAccessibility::clearEvents(); @@ -2556,8 +2615,6 @@ void tst_QAccessibility::treeTest() QCOMPARE(iface->indexOfChild(cell2), 4); QVERIFY(!(cell2->state().expanded)); QCOMPARE(table2->columnDescription(1), QString("Work")); - delete cell2; - delete cell1; treeView->expandAll(); @@ -2583,14 +2640,13 @@ void tst_QAccessibility::treeTest() QModelIndex index = treeView->model()->index(0, 0, treeView->model()->index(1, 0)); pos += treeView->visualRect(index).center(); pos += QPoint(0, treeView->header()->height()); - QAIPtr childAt2(iface->childAt(pos.x(), pos.y())); + QAccessibleInterface *childAt2(iface->childAt(pos.x(), pos.y())); QVERIFY(childAt2); QCOMPARE(childAt2->text(QAccessible::Name), QString("Klimt")); QCOMPARE(table2->columnDescription(0), QString("Artist")); QCOMPARE(table2->columnDescription(1), QString("Work")); - delete iface; delete treeView; QTestAccessibility::clearEvents(); } @@ -2622,36 +2678,36 @@ void tst_QAccessibility::tableTest() tableView->show(); QTest::qWaitForWindowExposed(tableView); - QAIPtr iface = QAIPtr(QAccessible::queryAccessibleInterface(tableView)); - QCOMPARE(verifyHierarchy(iface.data()), 0); + QAccessibleInterface *iface = QAccessible::queryAccessibleInterface(tableView); + QCOMPARE(verifyHierarchy(iface), 0); QCOMPARE(iface->role(), QAccessible::Table); // header and 2 rows (the others are not expanded, thus not visible) QCOMPARE(iface->childCount(), 9+3+3+1); // cell+headers+topleft button - QAIPtr cornerButton(iface->child(0)); + QAccessibleInterface *cornerButton(iface->child(0)); QVERIFY(cornerButton); - QCOMPARE(iface->indexOfChild(cornerButton.data()), 0); + QCOMPARE(iface->indexOfChild(cornerButton), 0); QCOMPARE(cornerButton->role(), QAccessible::Pane); - QAIPtr h2(iface->child(2)); + QAccessibleInterface *h2(iface->child(2)); QVERIFY(h2); - QCOMPARE(iface->indexOfChild(h2.data()), 2); + QCOMPARE(iface->indexOfChild(h2), 2); QCOMPARE(h2->text(QAccessible::Name), QString("h2")); QCOMPARE(h2->role(), QAccessible::ColumnHeader); QVERIFY(!(h2->state().expanded)); - QAIPtr v3(iface->child(12)); + QAccessibleInterface *v3(iface->child(12)); QVERIFY(v3); - QCOMPARE(iface->indexOfChild(v3.data()), 12); + QCOMPARE(iface->indexOfChild(v3), 12); QCOMPARE(v3->text(QAccessible::Name), QString("v3")); QCOMPARE(v3->role(), QAccessible::RowHeader); QVERIFY(!(v3->state().expanded)); - QAIPtr child10(iface->child(10)); + QAccessibleInterface *child10(iface->child(10)); QVERIFY(child10); - QCOMPARE(iface->indexOfChild(child10.data()), 10); + QCOMPARE(iface->indexOfChild(child10), 10); QCOMPARE(child10->text(QAccessible::Name), QString("1.1")); QAccessibleTableCellInterface *cell10Iface = child10->tableCellInterface(); QCOMPARE(cell10Iface->rowIndex(), 1); @@ -2659,11 +2715,11 @@ void tst_QAccessibility::tableTest() QPoint pos = tableView->mapToGlobal(QPoint(0,0)); pos += tableView->visualRect(tableView->model()->index(1, 1)).center(); pos += QPoint(tableView->verticalHeader()->width(), tableView->horizontalHeader()->height()); - QAIPtr childAt10(iface->childAt(pos.x(), pos.y())); + QAccessibleInterface *childAt10(iface->childAt(pos.x(), pos.y())); QCOMPARE(childAt10->text(QAccessible::Name), QString("1.1")); - QAIPtr child11(iface->child(11)); - QCOMPARE(iface->indexOfChild(child11.data()), 11); + QAccessibleInterface *child11(iface->child(11)); + QCOMPARE(iface->indexOfChild(child11), 11); QCOMPARE(child11->text(QAccessible::Name), QString("1.2")); @@ -2679,21 +2735,21 @@ void tst_QAccessibility::tableTest() QCOMPARE(cell1->text(QAccessible::Name), QString("0.0")); QCOMPARE(iface->indexOfChild(cell1), 5); - QAIPtr cell2(table2->cellAt(0,1)); + QAccessibleInterface *cell2(table2->cellAt(0,1)); QVERIFY(cell2); QCOMPARE(cell2->text(QAccessible::Name), QString("0.1")); QCOMPARE(cell2->role(), QAccessible::Cell); QCOMPARE(cell2->tableCellInterface()->rowIndex(), 0); QCOMPARE(cell2->tableCellInterface()->columnIndex(), 1); - QCOMPARE(iface->indexOfChild(cell2.data()), 6); + QCOMPARE(iface->indexOfChild(cell2), 6); - QAIPtr cell3(table2->cellAt(1,2)); + QAccessibleInterface *cell3(table2->cellAt(1,2)); QVERIFY(cell3); QCOMPARE(cell3->text(QAccessible::Name), QString("1.2")); QCOMPARE(cell3->role(), QAccessible::Cell); QCOMPARE(cell3->tableCellInterface()->rowIndex(), 1); QCOMPARE(cell3->tableCellInterface()->columnIndex(), 2); - QCOMPARE(iface->indexOfChild(cell3.data()), 11); + QCOMPARE(iface->indexOfChild(cell3), 11); QCOMPARE(table2->columnDescription(0), QString("h1")); QCOMPARE(table2->columnDescription(1), QString("h2")); @@ -2702,8 +2758,171 @@ void tst_QAccessibility::tableTest() QCOMPARE(table2->rowDescription(1), QString("v2")); QCOMPARE(table2->rowDescription(2), QString("v3")); + tableView->clearSelection(); + tableView->setSelectionBehavior(QAbstractItemView::SelectItems); + tableView->setSelectionMode(QAbstractItemView::SingleSelection); + QVERIFY(!table2->selectRow(0)); + QVERIFY(!table2->isRowSelected(0)); + tableView->setSelectionBehavior(QAbstractItemView::SelectRows); + QVERIFY(table2->selectRow(0)); + QVERIFY(table2->selectRow(1)); + QVERIFY(!table2->isRowSelected(0)); + tableView->setSelectionMode(QAbstractItemView::MultiSelection); + QVERIFY(table2->selectRow(0)); + QVERIFY(table2->isRowSelected(1)); + QVERIFY(table2->unselectRow(0)); + QVERIFY(!table2->isRowSelected(0)); + tableView->setSelectionBehavior(QAbstractItemView::SelectColumns); + QVERIFY(!table2->selectRow(0)); + QVERIFY(!table2->isRowSelected(0)); + tableView->clearSelection(); + QCOMPARE(table2->selectedColumnCount(), 0); + QCOMPARE(table2->selectedRowCount(), 0); + QVERIFY(table2->selectColumn(1)); + QVERIFY(table2->isColumnSelected(1)); + tableView->clearSelection(); + tableView->setSelectionMode(QAbstractItemView::ContiguousSelection); + table2->selectColumn(0); + table2->selectColumn(2); + QVERIFY(!(table2->isColumnSelected(2) && table2->isColumnSelected(0))); + tableView->clearSelection(); + tableView->setSelectionBehavior(QAbstractItemView::SelectItems); + tableView->setSelectionMode(QAbstractItemView::MultiSelection); + table2->selectColumn(1); + table2->selectRow(1); + QVERIFY(table2->isColumnSelected(1)); + QVERIFY(table2->isRowSelected(1)); + + QAccessibleInterface *cell4 = table2->cellAt(2,2); + QVERIFY(cell1->actionInterface()); + QVERIFY(cell1->tableCellInterface()); + + tableView->clearSelection(); + tableView->setSelectionBehavior(QAbstractItemView::SelectRows); + tableView->setSelectionMode(QAbstractItemView::SingleSelection); + QVERIFY(!cell1->tableCellInterface()->isSelected()); + QVERIFY(cell1->actionInterface()->actionNames().contains(QAccessibleActionInterface::toggleAction())); + cell1->actionInterface()->doAction(QAccessibleActionInterface::toggleAction()); + QVERIFY(cell2->tableCellInterface()->isSelected()); + + tableView->clearSelection(); + tableView->setSelectionBehavior(QAbstractItemView::SelectColumns); + cell3->actionInterface()->doAction(QAccessibleActionInterface::toggleAction()); + QVERIFY(cell4->tableCellInterface()->isSelected()); + + tableView->clearSelection(); + tableView->setSelectionBehavior(QAbstractItemView::SelectItems); + tableView->setSelectionMode(QAbstractItemView::SingleSelection); + cell1->actionInterface()->doAction(QAccessibleActionInterface::toggleAction()); + QVERIFY(cell1->tableCellInterface()->isSelected()); + cell2->actionInterface()->doAction(QAccessibleActionInterface::toggleAction()); + QVERIFY(!cell1->tableCellInterface()->isSelected()); + + tableView->clearSelection(); + tableView->setSelectionMode(QAbstractItemView::MultiSelection); + cell1->actionInterface()->doAction(QAccessibleActionInterface::toggleAction()); + cell2->actionInterface()->doAction(QAccessibleActionInterface::toggleAction()); + QVERIFY(cell1->tableCellInterface()->isSelected()); + QVERIFY(cell2->tableCellInterface()->isSelected()); + cell2->actionInterface()->doAction(QAccessibleActionInterface::toggleAction()); + QVERIFY(cell1->tableCellInterface()->isSelected()); + QVERIFY(!cell2->tableCellInterface()->isSelected()); + + QAccessibleInterface *cell00 = table2->cellAt(0, 0); + QAccessible::Id id00 = QAccessible::uniqueId(cell00); + QVERIFY(id00); + QCOMPARE(cell00->tableCellInterface()->rowIndex(), 0); + QCOMPARE(cell00->tableCellInterface()->columnIndex(), 0); + + QAccessibleInterface *cell01 = table2->cellAt(0, 1); + + QAccessibleInterface *cell02 = table2->cellAt(0, 2); + QAccessible::Id id02 = QAccessible::uniqueId(cell02); + QVERIFY(id02); + QCOMPARE(cell02->tableCellInterface()->rowIndex(), 0); + QCOMPARE(cell02->tableCellInterface()->columnIndex(), 2); + + QAccessibleInterface *cell20 = table2->cellAt(2, 0); + QAccessible::Id id20 = QAccessible::uniqueId(cell20); + QVERIFY(id20); + QCOMPARE(cell20->tableCellInterface()->rowIndex(), 2); + QCOMPARE(cell20->tableCellInterface()->columnIndex(), 0); + + QAccessibleInterface *cell22 = table2->cellAt(2, 2); + QAccessible::Id id22 = QAccessible::uniqueId(cell22); + QVERIFY(id22); + QCOMPARE(cell22->tableCellInterface()->rowIndex(), 2); + QCOMPARE(cell22->tableCellInterface()->columnIndex(), 2); + + // modification: inserting and removing rows/columns + tableView->insertRow(2); + // Button (0) | h1 (1) | h2 (2) | h3 (3) + // v1 (4) | 0.0 (5) | 1.0 (6) | 2.0 (7) + // v2 (8) | 0.1 (9) | 1.1 (10) | 2.1 (11) + // new (12) | (13) | (14) | (15) + // v3 (16) | 0.2 (17) | 1.2 (18) | 2.2 (19) + + QAccessibleInterface *cell00_new = table2->cellAt(0, 0); + QCOMPARE(cell00, cell00_new); + QCOMPARE(cell00->tableCellInterface()->rowIndex(), 0); + QCOMPARE(cell00->tableCellInterface()->columnIndex(), 0); + + QAccessibleInterface *cell02_new = table2->cellAt(0, 2); + QCOMPARE(cell02, cell02_new); + QCOMPARE(cell02_new->tableCellInterface()->rowIndex(), 0); + QCOMPARE(cell02_new->tableCellInterface()->columnIndex(), 2); + + QAccessibleInterface *cell20_new = table2->cellAt(2, 0); + QAccessibleInterface *cell30_new = table2->cellAt(3, 0); + QAccessible::Id id20_new = QAccessible::uniqueId(cell20_new); + QVERIFY(id20_new != id20); + QAccessible::Id id30_new = QAccessible::uniqueId(cell30_new); + QCOMPARE(id20, id30_new); + QCOMPARE(cell20->tableCellInterface()->rowIndex(), 3); + QCOMPARE(cell20->tableCellInterface()->columnIndex(), 0); + + QAccessibleInterface *cell22_new = table2->cellAt(2, 2); + QAccessibleInterface *cell32_new = table2->cellAt(3, 2); + QAccessible::Id id22_new = QAccessible::uniqueId(cell22_new); + QVERIFY(id22_new != id22); + QAccessible::Id id32_new = QAccessible::uniqueId(cell32_new); + QCOMPARE(id22, id32_new); + QCOMPARE(cell32_new->tableCellInterface()->rowIndex(), 3); + QCOMPARE(cell32_new->tableCellInterface()->columnIndex(), 2); + + + QVERIFY(table2->cellAt(0, 0) == cell1); + + tableView->insertColumn(2); + // Button (0) | h1 (1) | h2 (2) | (3) | h3 (4) + // v1 (5) | 0.0 (6) | 1.0 (7) | (8) | 2.0 (9) + // v2 (10) | 0.1 (11) | 1.1 (12) | (13) | 2.1 (14) + // new (15) | (16) | (17) | (18) | (19) + // v3 (20) | 0.2 (21) | 1.2 (22) | (23) | 2.2 (24) + + cell00_new = table2->cellAt(0, 0); + QCOMPARE(cell00, cell00_new); + QCOMPARE(cell00->tableCellInterface()->rowIndex(), 0); + QCOMPARE(cell00->tableCellInterface()->columnIndex(), 0); + + QAccessibleInterface *cell01_new = table2->cellAt(0, 1); + QCOMPARE(cell01, cell01_new); + QCOMPARE(cell01_new->tableCellInterface()->rowIndex(), 0); + QCOMPARE(cell01_new->tableCellInterface()->columnIndex(), 1); + + QAccessibleInterface *cell03_new = table2->cellAt(0, 3); + QVERIFY(cell03_new); + QCOMPARE(cell03_new->tableCellInterface()->rowIndex(), 0); + QCOMPARE(cell03_new->tableCellInterface()->columnIndex(), 3); + QCOMPARE(iface->indexOfChild(cell03_new), 9); + QCOMPARE(cell03_new, cell02); + + cell30_new = table2->cellAt(3, 0); + QCOMPARE(cell30_new, cell20); + QCOMPARE(iface->indexOfChild(cell30_new), 21); delete tableView; + QVERIFY(!QAccessible::accessibleInterface(id00)); QTestAccessibility::clearEvents(); } @@ -2780,9 +2999,7 @@ void tst_QAccessibility::calendarWidgetTest() // In order for geometric navigation to work they must share the same parent QCOMPARE(navigationBarInterface->parent()->object(), calendarViewInterface->parent()->object()); QVERIFY(navigationBarInterface->rect().bottom() < calendarViewInterface->rect().top()); - delete calendarViewInterface; calendarViewInterface = 0; - delete navigationBarInterface; navigationBarInterface = 0; } @@ -2827,8 +3044,6 @@ void tst_QAccessibility::dockWidgetTest() if (accMainWindow->role() == QAccessible::Window) { if (accDock1 && qobject_cast<QDockWidget*>(accDock1->object()) == dock1) { break; - } else { - delete accDock1; } } } @@ -2838,7 +3053,6 @@ void tst_QAccessibility::dockWidgetTest() QAccessibleInterface *dock1TitleBar = accDock1->child(0); QCOMPARE(dock1TitleBar->role(), QAccessible::TitleBar); QVERIFY(accDock1->rect().contains(dock1TitleBar->rect())); - delete dock1TitleBar; QPoint globalPos = dock1->mapToGlobal(QPoint(0,0)); globalPos.rx()+=5; //### query style @@ -2846,7 +3060,6 @@ void tst_QAccessibility::dockWidgetTest() QAccessibleInterface *childAt = accDock1->childAt(globalPos.x(), globalPos.y()); //### QCOMPARE(childAt->role(), QAccessible::TitleBar); int index = accDock1->indexOfChild(childAt); - delete childAt; QAccessibleInterface *accTitleBar = accDock1->child(index); QCOMPARE(accTitleBar->role(), QAccessible::TitleBar); @@ -2856,9 +3069,6 @@ void tst_QAccessibility::dockWidgetTest() QVERIFY(acc); QCOMPARE(acc->role(), QAccessible::Window); - - delete accTitleBar; - delete accDock1; delete pb1; delete pb2; delete dock1; @@ -2908,7 +3118,6 @@ void tst_QAccessibility::comboBoxTest() iface->actionInterface()->doAction(QAccessibleActionInterface::showMenuAction()); QTRY_VERIFY(combo.view()->isVisible()); - delete iface; } { // editable combobox @@ -2928,10 +3137,6 @@ void tst_QAccessibility::comboBoxTest() QCOMPARE(listIface->role(), QAccessible::List); QAccessibleInterface *editIface = iface->child(1); QCOMPARE(editIface->role(), QAccessible::EditableText); - - delete listIface; - delete editIface; - delete iface; } QTestAccessibility::clearEvents(); @@ -2954,7 +3159,6 @@ void tst_QAccessibility::labelTest() QCOMPARE(acc_label->text(QAccessible::Name), text); - delete acc_label; delete label; QTestAccessibility::clearEvents(); @@ -2976,8 +3180,6 @@ void tst_QAccessibility::labelTest() const QPoint labelPos = imageLabel.mapToGlobal(QPoint(0,0)); QCOMPARE(imageInterface->imagePosition().topLeft(), labelPos); - delete acc_label; - QTestAccessibility::clearEvents(); } @@ -3247,8 +3449,9 @@ void tst_QAccessibility::bridgeTest() IAccessible *accTableCell = 0; hr = ia2Table->get_cellAt(1, 2, (IUnknown**)&accTableCell); - IAccessibleTableCell *ia2TableCell = (IAccessibleTableCell *)queryIA2(accTableCell, IID_IAccessibleTableCell); QVERIFY(SUCCEEDED(hr)); + QVERIFY(accTableCell); + IAccessibleTableCell *ia2TableCell = (IAccessibleTableCell *)queryIA2(accTableCell, IID_IAccessibleTableCell); QVERIFY(ia2TableCell); LONG index; ia2TableCell->get_rowIndex(&index); diff --git a/tests/auto/other/qnetworkaccessmanager_and_qprogressdialog/tst_qnetworkaccessmanager_and_qprogressdialog.cpp b/tests/auto/other/qnetworkaccessmanager_and_qprogressdialog/tst_qnetworkaccessmanager_and_qprogressdialog.cpp index c6cc50d97f..756a899b1b 100644 --- a/tests/auto/other/qnetworkaccessmanager_and_qprogressdialog/tst_qnetworkaccessmanager_and_qprogressdialog.cpp +++ b/tests/auto/other/qnetworkaccessmanager_and_qprogressdialog/tst_qnetworkaccessmanager_and_qprogressdialog.cpp @@ -82,7 +82,7 @@ public slots: QNetworkRequest request(QUrl("http://" + QtNetworkSettings::serverName() + "/qtest/bigfile")); if (zeroCopy) request.setAttribute(QNetworkRequest::MaximumDownloadBufferSizeAttribute, 10*1024*1024); - + QNetworkReply *reply = netmanager.get( QNetworkRequest( QUrl("http://" + QtNetworkSettings::serverName() + "/qtest/bigfile") diff --git a/tests/auto/other/windowsmobile/test/tst_windowsmobile.cpp b/tests/auto/other/windowsmobile/test/tst_windowsmobile.cpp index 5bcaaf5543..68db218164 100644 --- a/tests/auto/other/windowsmobile/test/tst_windowsmobile.cpp +++ b/tests/auto/other/windowsmobile/test/tst_windowsmobile.cpp @@ -133,7 +133,7 @@ void compareScreenshots(const QString &image1, const QString &image2) QPainter p1(&screenShot); QPainter p2(&original); - //screenShot.save("scr1.png", "PNG"); + //screenShot.save("scr1.png", "PNG"); p1.fillRect(0, 0, desktopFrameRect.width(), desktopClientRect.y(), Qt::black); p2.fillRect(0, 0, desktopFrameRect.width(), desktopClientRect.y(), Qt::black); diff --git a/tests/auto/other/windowsmobile/testQMenuBar/main.cpp b/tests/auto/other/windowsmobile/testQMenuBar/main.cpp index 64f87dc080..a96966a451 100644 --- a/tests/auto/other/windowsmobile/testQMenuBar/main.cpp +++ b/tests/auto/other/windowsmobile/testQMenuBar/main.cpp @@ -89,7 +89,7 @@ int main(int argc, char * argv[]) optionsMenu->addMenu("Settings"); optionsMenu->addMenu("Standard"); optionsMenu->addMenu("Extended"); - + QMenu *subMenu = helpMenu->addMenu("Help"); subMenu->addAction("Index"); subMenu->addSeparator(); |