From 64f1241f6419ca5e8e26a84db1e2f055f9919d1e Mon Sep 17 00:00:00 2001 From: Stephen Kelly Date: Mon, 3 May 2010 12:43:26 +0200 Subject: Add diagrams for illustrating the process of moving rows. --- doc/src/diagrams/modelview-move-rows-1.sk | 271 +++++++++++++++++++++ doc/src/diagrams/modelview-move-rows-2.sk | 271 +++++++++++++++++++++ doc/src/diagrams/modelview-move-rows-3.sk | 137 +++++++++++ doc/src/diagrams/modelview-move-rows-4.sk | 137 +++++++++++ .../code/src_corelib_kernel_qabstractitemmodel.cpp | 20 ++ src/corelib/kernel/qabstractitemmodel.cpp | 56 +++++ 6 files changed, 892 insertions(+) create mode 100644 doc/src/diagrams/modelview-move-rows-1.sk create mode 100644 doc/src/diagrams/modelview-move-rows-2.sk create mode 100644 doc/src/diagrams/modelview-move-rows-3.sk create mode 100644 doc/src/diagrams/modelview-move-rows-4.sk diff --git a/doc/src/diagrams/modelview-move-rows-1.sk b/doc/src/diagrams/modelview-move-rows-1.sk new file mode 100644 index 0000000..3679dc7 --- /dev/null +++ b/doc/src/diagrams/modelview-move-rows-1.sk @@ -0,0 +1,271 @@ +##Sketch 1 2 +document() +layout('A4',0) +layer('Layer 1',1,1,0,0,(0,0,0)) +fp((1,1,1)) +lw(1) +ld((5, 5)) +r(30,0,0,-30,220,515) +fp((1,1,1)) +lw(1) +r(30,0,0,-30,220,665) +fp((1,1,1)) +lw(1) +r(30,0,0,-30,415.038,664.044) +fp((1,1,1)) +lw(1) +r(30,0,0,-30,219.351,425.18) +fp((1,1,1)) +lw(1) +r(30,0,0,-30,414.389,337.792) +fp((1,1,1)) +lw(1) +r(30,0,0,-30,220,605) +fp((1,1,1)) +lw(1) +r(30,0,0,-30,415.038,515.177) +fp((1,1,1)) +lw(1) +r(30,0,0,-30,220,575) +fp((1,1,1)) +lw(1) +r(30,0,0,-30,415.038,485.177) +fp((0.753,0.753,1)) +lw(1) +r(30,0,0,-30,277.5,575) +fp((0.753,0.753,1)) +lw(1) +r(30,0,0,-30,219.351,335.18) +fp((0.753,0.753,1)) +lw(1) +r(30,0,0,-30,414.389,574.044) +fp((1,1,1)) +lw(1) +r(30,0,0,-30,220,545) +fp((1,1,1)) +lw(1) +r(30.6087,0,0,-30,218.435,305.442) +fp((1,1,1)) +lw(1) +r(31.2174,0,0,-30,414.082,306.92) +fp((1,1,1)) +lw(1) +r(30,0,0,-30,415.038,455.177) +fp((1,1,1)) +lw(1) +r(30,0,0,-30,220,635) +fp((1,1,1)) +lw(1) +r(30,0,0,-30,415.038,545.177) +fp((1,1,1)) +lw(1) +r(30,0,0,-30,220,695) +fp((1,1,1)) +lw(1) +r(30,0,0,-30,415.038,694.044) +fp((1,1,1)) +lw(1) +r(30,0,0,-30,219.351,455.18) +fp((1,1,1)) +lw(1) +r(30,0,0,-30,414.389,367.792) +fp((0.753,0.753,1)) +lw(1) +r(30,0,0,-30,277.5,605) +fp((0.753,0.753,1)) +lw(1) +r(30,0,0,-30,219.351,365.18) +fp((0.753,0.753,1)) +lw(1) +r(30,0,0,-30,414.389,604.044) +fp((0.753,0.753,1)) +lw(1) +r(30,0,0,-30,277.5,635) +fp((0.753,0.753,1)) +lw(1) +r(30,0,0,-30,219.351,395.18) +fp((0.753,0.753,1)) +lw(1) +r(30,0,0,-30,414.389,634.044) +le() +lw(1) +r(165,0,0,-230,210,705) +fp((0,0,0)) +le() +lw(1) +Fn('Helvetica') +Fs(20) +txt('0',(229.44,673.14)) +fp((0,0,0)) +le() +lw(1) +Fn('Helvetica') +Fs(20) +txt('0',(424.478,672.184)) +fp((0,0,0)) +le() +lw(1) +Fn('Helvetica') +Fs(20) +txt('0',(228.791,433.32)) +fp((0,0,0)) +le() +lw(1) +Fn('Helvetica') +Fs(20) +txt('0',(423.829,345.932)) +fp((0,0,0)) +le() +lw(1) +Fn('Helvetica') +Fs(20) +txt('1',(229.44,643.14)) +fp((0,0,0)) +le() +lw(1) +Fn('Helvetica') +Fs(20) +txt('1',(424.478,642.184)) +fp((0,0,0)) +le() +lw(1) +Fn('Helvetica') +Fs(20) +txt('1',(228.791,403.32)) +fp((0,0,0)) +le() +lw(1) +Fn('Helvetica') +Fs(20) +txt('1',(423.829,315.932)) +fp((0,0,0)) +le() +lw(1) +Fn('Helvetica') +Fs(20) +txt('2',(229.44,613.14)) +fp((0.503,0.503,0.503)) +le() +lw(1) +Fn('Helvetica') +Fs(20) +txt('2',(424.478,523.317)) +fp((0,0,0)) +le() +lw(1) +Fn('Helvetica') +Fs(20) +txt('2',(286.94,613.14)) +fp((0,0,0)) +le() +lw(1) +Fn('Helvetica') +Fs(20) +txt('2',(228.791,373.32)) +fp((0,0,0)) +le() +lw(1) +Fn('Helvetica') +Fs(20) +txt('2',(423.829,612.184)) +fp((0,0,0)) +le() +lw(1) +Fn('Helvetica') +Fs(20) +txt('3',(229.44,583.14)) +fp((0.503,0.503,0.503)) +le() +lw(1) +Fn('Helvetica') +Fs(20) +txt('3',(424.478,493.317)) +fp((0,0,0)) +le() +lw(1) +Fn('Helvetica') +Fs(20) +txt('3',(286.94,583.14)) +fp((0,0,0)) +le() +lw(1) +Fn('Helvetica') +Fs(20) +txt('3',(228.791,343.32)) +fp((0,0,0)) +le() +lw(1) +Fn('Helvetica') +Fs(20) +txt('3',(423.829,582.184)) +fp((0,0,0)) +le() +lw(1) +Fn('Helvetica') +Fs(20) +txt('4',(229.44,553.14)) +fp((0.503,0.503,0.503)) +le() +lw(1) +Fn('Helvetica') +Fs(20) +txt('4',(424.478,463.317)) +fp((0,0,0)) +le() +lw(1) +Fn('Helvetica') +Fs(20) +txt('4',(286.94,553.14)) +fp((0,0,0)) +le() +lw(1) +Fn('Helvetica') +Fs(20) +txt('4',(228.791,313.32)) +fp((0,0,0)) +le() +lw(1) +Fn('Helvetica') +Fs(20) +txt('4',(423.829,552.184)) +fp((0,0,0)) +le() +lw(1) +Fn('Helvetica') +Fs(20) +txt('5',(229.44,523.14)) +fp((0,0,0)) +le() +lw(1) +Fn('Helvetica') +Fs(20) +txt('5',(228.484,283.582)) +fp((0.503,0.503,0.503)) +le() +lw(1) +Fn('Helvetica') +Fs(20) +txt('5',(423.522,285.06)) +fp((0.503,0.503,0.503)) +le() +lw(1) +Fn('Helvetica') +Fs(20) +txt('5',(424.478,433.317)) +lw(1.5) +la2(([(-4.0, 3.0), (2.0, 0.0), (-4.0, -3.0), (-4.0, 3.0)], 1)) +b() +bs(275,635,0) +bs(255,635,0) +lw(1.5) +la2(([(-4.0, 3.0), (2.0, 0.0), (-4.0, -3.0), (-4.0, 3.0)], 1)) +b() +bs(294.508,380.772,0) +bs(293.986,545.115,0) +lw(1.5) +la2(([(-4.0, 3.0), (2.0, 0.0), (-4.0, -3.0), (-4.0, 3.0)], 1)) +b() +bs(249.466,380.772,0) +bs(291.551,380.772,0) +guidelayer('Guide Lines',1,0,0,1,(0,0,1)) +grid((0,0,2.5,2.5),1,(0,0,1),'Grid') diff --git a/doc/src/diagrams/modelview-move-rows-2.sk b/doc/src/diagrams/modelview-move-rows-2.sk new file mode 100644 index 0000000..c453a78 --- /dev/null +++ b/doc/src/diagrams/modelview-move-rows-2.sk @@ -0,0 +1,271 @@ +##Sketch 1 2 +document() +layout('A4',0) +layer('Layer 1',1,1,0,0,(0,0,0)) +fp((1,1,1)) +lw(1) +ld((5, 5)) +r(30,0,0,-30,220,515) +fp((1,1,1)) +lw(1) +r(30,0,0,-30,220,665) +fp((1,1,1)) +lw(1) +r(30,0,0,-30,415.038,664.044) +fp((1,1,1)) +lw(1) +r(30,0,0,-30,219.351,425.18) +fp((1,1,1)) +lw(1) +r(30,0,0,-30,414.389,337.792) +fp((1,1,1)) +lw(1) +r(30,0,0,-30,220,605) +fp((1,1,1)) +lw(1) +r(30,0,0,-30,415,605) +fp((1,1,1)) +lw(1) +r(30,0,0,-30,220,575) +fp((1,1,1)) +lw(1) +r(30,0,0,-30,415,575) +fp((0.753,0.753,1)) +lw(1) +r(30,0,0,-30,275,455) +fp((0.753,0.753,1)) +lw(1) +r(30,0,0,-30,219.351,335.18) +fp((0.753,0.753,1)) +lw(1) +r(30,0,0,-30,415,455) +fp((1,1,1)) +lw(1) +r(30,0,0,-30,220,545) +fp((1,1,1)) +lw(1) +r(30,0,0,-30,415,545) +fp((1,1,1)) +lw(1) +r(30.6087,0,0,-30,218.435,305.442) +fp((1,1,1)) +lw(1) +r(31.2174,0,0,-30,414.082,306.92) +fp((1,1,1)) +lw(1) +r(30,0,0,-30,220,635) +fp((1,1,1)) +lw(1) +r(30,0,0,-30,415,635) +fp((1,1,1)) +lw(1) +r(30,0,0,-30,220,695) +fp((1,1,1)) +lw(1) +r(30,0,0,-30,415.038,694.044) +fp((1,1,1)) +lw(1) +r(30,0,0,-30,219.351,455.18) +fp((1,1,1)) +lw(1) +r(30,0,0,-30,414.389,367.792) +fp((0.753,0.753,1)) +lw(1) +r(30,0,0,-30,275,485) +fp((0.753,0.753,1)) +lw(1) +r(30,0,0,-30,219.351,365.18) +fp((0.753,0.753,1)) +lw(1) +r(30,0,0,-30,415,485) +fp((0.753,0.753,1)) +lw(1) +r(30,0,0,-30,275,515) +fp((0.753,0.753,1)) +lw(1) +r(30,0,0,-30,219.351,395.18) +fp((0.753,0.753,1)) +lw(1) +r(30,0,0,-30,415,515) +le() +lw(1) +r(165,0,0,-230,210,705) +fp((0,0,0)) +le() +lw(1) +Fn('Helvetica') +Fs(20) +txt('0',(229.44,673.14)) +fp((0,0,0)) +le() +lw(1) +Fn('Helvetica') +Fs(20) +txt('0',(424.478,672.184)) +fp((0,0,0)) +le() +lw(1) +Fn('Helvetica') +Fs(20) +txt('0',(228.791,433.32)) +fp((0,0,0)) +le() +lw(1) +Fn('Helvetica') +Fs(20) +txt('0',(423.829,345.932)) +fp((0,0,0)) +le() +lw(1) +Fn('Helvetica') +Fs(20) +txt('1',(229.44,643.14)) +fp((0,0,0)) +le() +lw(1) +Fn('Helvetica') +Fs(20) +txt('1',(424.478,642.184)) +fp((0,0,0)) +le() +lw(1) +Fn('Helvetica') +Fs(20) +txt('1',(228.791,403.32)) +fp((0,0,0)) +le() +lw(1) +Fn('Helvetica') +Fs(20) +txt('1',(423.829,315.932)) +fp((0,0,0)) +le() +lw(1) +Fn('Helvetica') +Fs(20) +txt('2',(229.44,613.14)) +fp((0,0,0)) +le() +lw(1) +Fn('Helvetica') +Fs(20) +txt('2',(424.44,613.14)) +fp((0,0,0)) +le() +lw(1) +Fn('Helvetica') +Fs(20) +txt('2',(284.44,493.14)) +fp((0,0,0)) +le() +lw(1) +Fn('Helvetica') +Fs(20) +txt('2',(228.791,373.32)) +fp((0,0,0)) +le() +lw(1) +Fn('Helvetica') +Fs(20) +txt('2',(424.44,493.14)) +fp((0,0,0)) +le() +lw(1) +Fn('Helvetica') +Fs(20) +txt('3',(229.44,583.14)) +fp((0,0,0)) +le() +lw(1) +Fn('Helvetica') +Fs(20) +txt('3',(424.44,583.14)) +fp((0,0,0)) +le() +lw(1) +Fn('Helvetica') +Fs(20) +txt('3',(284.44,463.14)) +fp((0,0,0)) +le() +lw(1) +Fn('Helvetica') +Fs(20) +txt('3',(228.791,343.32)) +fp((0,0,0)) +le() +lw(1) +Fn('Helvetica') +Fs(20) +txt('3',(424.44,463.14)) +fp((0,0,0)) +le() +lw(1) +Fn('Helvetica') +Fs(20) +txt('4',(229.44,553.14)) +fp((0,0,0)) +le() +lw(1) +Fn('Helvetica') +Fs(20) +txt('4',(424.44,553.14)) +fp((0,0,0)) +le() +lw(1) +Fn('Helvetica') +Fs(20) +txt('4',(284.44,433.14)) +fp((0,0,0)) +le() +lw(1) +Fn('Helvetica') +Fs(20) +txt('4',(228.791,313.32)) +fp((0,0,0)) +le() +lw(1) +Fn('Helvetica') +Fs(20) +txt('4',(424.44,433.14)) +fp((0,0,0)) +le() +lw(1) +Fn('Helvetica') +Fs(20) +txt('5',(229.44,523.14)) +fp((0,0,0)) +le() +lw(1) +Fn('Helvetica') +Fs(20) +txt('5',(424.44,523.14)) +fp((0,0,0)) +le() +lw(1) +Fn('Helvetica') +Fs(20) +txt('5',(228.484,283.582)) +fp((0.503,0.503,0.503)) +le() +lw(1) +Fn('Helvetica') +Fs(20) +txt('5',(423.522,285.06)) +lw(1.5) +la2(([(-4.0, 3.0), (2.0, 0.0), (-4.0, -3.0), (-4.0, 3.0)], 1)) +b() +bs(272.5,515,0) +bs(252.5,515,0) +lw(1.5) +la2(([(-4.0, 3.0), (2.0, 0.0), (-4.0, -3.0), (-4.0, 3.0)], 1)) +b() +bs(294.508,380.772,0) +bs(295,425,0) +lw(1.5) +la2(([(-4.0, 3.0), (2.0, 0.0), (-4.0, -3.0), (-4.0, 3.0)], 1)) +b() +bs(249.466,380.772,0) +bs(291.551,380.772,0) +guidelayer('Guide Lines',1,0,0,1,(0,0,1)) +grid((0,0,2.5,2.5),1,(0,0,1),'Grid') diff --git a/doc/src/diagrams/modelview-move-rows-3.sk b/doc/src/diagrams/modelview-move-rows-3.sk new file mode 100644 index 0000000..d320900 --- /dev/null +++ b/doc/src/diagrams/modelview-move-rows-3.sk @@ -0,0 +1,137 @@ +##Sketch 1 2 +document() +layout('A4',0) +layer('Layer 1',1,1,0,0,(0,0,0)) +fp((1,1,1)) +lw(1) +r(30,0,0,-30,219.351,425.18) +fp((1,1,1)) +lw(1) +r(30,0,0,-30,345.913,400) +lw(1) +r(30,0,0,-30,219.351,335.18) +lw(1) +r(30,0,0,-30,345.916,339.739) +fp((1,1,1)) +lw(1) +r(30.6087,0,0,-30,218.435,305.442) +fp((1,1,1)) +lw(1) +r(30.6087,0,0,-30,345,310) +fp((1,1,1)) +lw(1) +r(30,0,0,-30,219.351,455.18) +fp((1,1,1)) +lw(1) +r(30,0,0,-30,345.913,430) +lw(1) +r(30,0,0,-30,219.351,365.18) +lw(1) +r(30,0,0,-30,345.916,369.739) +fp((0.753,0.753,1)) +lw(1) +r(30,0,0,-30,272.5,455) +fp((0.753,0.753,1)) +lw(1) +r(30,0,0,-30,345,460) +fp((0.753,0.753,1)) +lw(1) +r(30,0,0,-30,219.351,395.18) +le() +lw(1) +r(165,0,0,-230,210,705) +fp((0,0,0)) +le() +lw(1) +Fn('Helvetica') +Fs(20) +txt('0',(228.791,433.32)) +fp((0.503,0.503,0.503)) +le() +lw(1) +Fn('Helvetica') +Fs(20) +txt('0',(355.353,408.14)) +fp((0,0,0)) +le() +lw(1) +Fn('Helvetica') +Fs(20) +txt('1',(228.791,403.32)) +fp((0.503,0.503,0.503)) +le() +lw(1) +Fn('Helvetica') +Fs(20) +txt('1',(355.353,378.14)) +fp((0,0,0)) +le() +lw(1) +Fn('Helvetica') +Fs(20) +txt('2',(281.94,433.14)) +fp((0,0,0)) +le() +lw(1) +Fn('Helvetica') +Fs(20) +txt('2',(354.44,438.14)) +fp((0,0,0)) +le() +lw(1) +Fn('Helvetica') +Fs(20) +txt('2',(228.791,373.32)) +fp((0,0,0)) +le() +lw(1) +Fn('Helvetica') +Fs(20) +txt('3',(228.791,343.32)) +fp((0,0,0)) +le() +lw(1) +Fn('Helvetica') +Fs(20) +txt('3',(355.356,347.879)) +fp((0,0,0)) +le() +lw(1) +Fn('Helvetica') +Fs(20) +txt('4',(228.791,313.32)) +fp((0,0,0)) +le() +lw(1) +Fn('Helvetica') +Fs(20) +txt('4',(355.356,317.879)) +fp((0,0,0)) +le() +lw(1) +Fn('Helvetica') +Fs(20) +txt('5',(228.484,283.582)) +fp((0,0,0)) +le() +lw(1) +Fn('Helvetica') +Fs(20) +txt('5',(355.049,288.14)) +lw(1.5) +la2(([(-4.0, 3.0), (2.0, 0.0), (-4.0, -3.0), (-4.0, 3.0)], 1)) +b() +bs(270,455,0) +bs(250,455,0) +lw(1.5) +la2(([(-4.0, 3.0), (2.0, 0.0), (-4.0, -3.0), (-4.0, 3.0)], 1)) +b() +bs(294.508,380.772,0) +bs(295,425,0) +lw(1.5) +la2(([(-4.0, 3.0), (2.0, 0.0), (-4.0, -3.0), (-4.0, 3.0)], 1)) +b() +bs(249.466,380.772,0) +bs(291.551,380.772,0) +guidelayer('Guide Lines',1,0,0,1,(0,0,1)) +grid((0,0,2.5,2.5),1,(0,0,1),'Grid') diff --git a/doc/src/diagrams/modelview-move-rows-4.sk b/doc/src/diagrams/modelview-move-rows-4.sk new file mode 100644 index 0000000..a8a1157 --- /dev/null +++ b/doc/src/diagrams/modelview-move-rows-4.sk @@ -0,0 +1,137 @@ +##Sketch 1 2 +document() +layout('A4',0) +layer('Layer 1',1,1,0,0,(0,0,0)) +fp((1,1,1)) +lw(1) +r(30,0,0,-30,219.351,425.18) +fp((1,1,1)) +lw(1) +r(30,0,0,-30,345,430) +lw(1) +r(30,0,0,-30,219.351,335.18) +lw(1) +r(30,0,0,-30,345,339.739) +fp((1,1,1)) +lw(1) +r(30.6087,0,0,-30,218.435,305.442) +fp((1,1,1)) +lw(1) +r(30.6087,0,0,-30,344.084,310) +fp((1,1,1)) +lw(1) +r(30,0,0,-30,219.351,455.18) +fp((1,1,1)) +lw(1) +r(30,0,0,-30,345,460) +lw(1) +r(30,0,0,-30,219.351,365.18) +lw(1) +r(30,0,0,-30,345,400) +fp((0.753,0.753,1)) +lw(1) +r(30,0,0,-30,272.5,335) +fp((0.753,0.753,1)) +lw(1) +r(30,0,0,-30,345,370) +fp((0.753,0.753,1)) +lw(1) +r(30,0,0,-30,219.351,395.18) +le() +lw(1) +r(165,0,0,-230,210,705) +fp((0,0,0)) +le() +lw(1) +Fn('Helvetica') +Fs(20) +txt('0',(228.791,433.32)) +fp((0,0,0)) +le() +lw(1) +Fn('Helvetica') +Fs(20) +txt('0',(354.44,438.14)) +fp((0,0,0)) +le() +lw(1) +Fn('Helvetica') +Fs(20) +txt('1',(228.791,403.32)) +fp((0,0,0)) +le() +lw(1) +Fn('Helvetica') +Fs(20) +txt('1',(354.44,408.14)) +fp((0,0,0)) +le() +lw(1) +Fn('Helvetica') +Fs(20) +txt('2',(281.94,313.14)) +fp((0,0,0)) +le() +lw(1) +Fn('Helvetica') +Fs(20) +txt('2',(354.44,348.14)) +fp((0,0,0)) +le() +lw(1) +Fn('Helvetica') +Fs(20) +txt('2',(228.791,373.32)) +fp((0,0,0)) +le() +lw(1) +Fn('Helvetica') +Fs(20) +txt('3',(228.791,343.32)) +fp((0.503,0.503,0.503)) +le() +lw(1) +Fn('Helvetica') +Fs(20) +txt('3',(354.44,378.14)) +fp((0,0,0)) +le() +lw(1) +Fn('Helvetica') +Fs(20) +txt('4',(228.791,313.32)) +fp((0,0,0)) +le() +lw(1) +Fn('Helvetica') +Fs(20) +txt('4',(354.44,317.879)) +fp((0,0,0)) +le() +lw(1) +Fn('Helvetica') +Fs(20) +txt('5',(228.484,283.582)) +fp((0,0,0)) +le() +lw(1) +Fn('Helvetica') +Fs(20) +txt('5',(354.133,288.14)) +lw(1.5) +la2(([(-4.0, 3.0), (2.0, 0.0), (-4.0, -3.0), (-4.0, 3.0)], 1)) +b() +bs(270,335,0) +bs(250,335,0) +lw(1.5) +la2(([(-4.0, 3.0), (2.0, 0.0), (-4.0, -3.0), (-4.0, 3.0)], 1)) +b() +bs(294.508,380.772,0) +bs(295,335,0) +lw(1.5) +la2(([(-4.0, 3.0), (2.0, 0.0), (-4.0, -3.0), (-4.0, 3.0)], 1)) +b() +bs(249.466,380.772,0) +bs(291.551,380.772,0) +guidelayer('Guide Lines',1,0,0,1,(0,0,1)) +grid((0,0,2.5,2.5),1,(0,0,1),'Grid') diff --git a/doc/src/snippets/code/src_corelib_kernel_qabstractitemmodel.cpp b/doc/src/snippets/code/src_corelib_kernel_qabstractitemmodel.cpp index 22ea240..e3ad483 100644 --- a/doc/src/snippets/code/src_corelib_kernel_qabstractitemmodel.cpp +++ b/doc/src/snippets/code/src_corelib_kernel_qabstractitemmodel.cpp @@ -67,3 +67,23 @@ beginInsertColumns(parent, 6, 8); //! [5] beginRemoveColumns(parent, 4, 6); //! [5] + + +//! [6] +beginMoveRows(sourceParent, 2, 4, destinationParent, 2); +//! [6] + + +//! [7] +beginMoveRows(sourceParent, 2, 4, destinationParent, 6); +//! [7] + + +//! [8] +beginMoveRows(parent, 2, 2, parent, 0); +//! [8] + + +//! [9] +beginMoveRows(parent, 2, 2, parent, 4); +//! [9] diff --git a/src/corelib/kernel/qabstractitemmodel.cpp b/src/corelib/kernel/qabstractitemmodel.cpp index b0503be..3660a3c 100644 --- a/src/corelib/kernel/qabstractitemmodel.cpp +++ b/src/corelib/kernel/qabstractitemmodel.cpp @@ -2530,6 +2530,62 @@ bool QAbstractItemModelPrivate::allowMove(const QModelIndex &srcParent, int star condition is true, in which case you should abort your move operation. + \table 80% + \row + \o \inlineimage modelview-move-rows-1.png Moving rows to another parent + \o Specify the first and last row numbers for the span of rows in + the source parent you want to move in the model. Also specify + the row in the destination parent to move the span to. + + For example, as shown in the diagram, we move three rows from + row 2 to 4 in the source, so \a sourceFirst is 2 and \a sourceLast is 4. + We move those items to above row 2 in the destination, so \a destinationRow is 2. + + \snippet doc/src/snippets/code/src_corelib_kernel_qabstractitemmodel.cpp 6 + + This moves the three rows rows 2, 3, and 4 in the source to become 2, 3 and 4 in + the destination. Other affected siblings are displaced accordingly. + \row + \o \inlineimage modelview-move-rows-2.png Moving rows to append to another parent + \o To append rows to another parent, move them to after the last row. + + For example, as shown in the diagram, we move three rows to a + collection of 6 existing rows (ending in row 5), so \a destinationStart is 6: + + \snippet doc/src/snippets/code/src_corelib_kernel_qabstractitemmodel.cpp 7 + + This moves the target rows to the end of the target parent as 6, 7 and 8. + \row + \o \inlineimage modelview-move-rows-3.png Moving rows in the same parent up + \o To move rows within the same parent, specify the row to move them to. + + For example, as shown in the diagram, we move one item from row 2 to row 0, + so \a sourceFirst and \a sourceLast are 2 and \a destinationChild is 0. + + \snippet doc/src/snippets/code/src_corelib_kernel_qabstractitemmodel.cpp 8 + + Note that other rows may be displaced accordingly. Note also that when moving + items within the same parent you should not attempt invalid or no-op moves. In + the above example, item 2 is at row 2 before the move, so it can not be moved + to row 2 (where it is already) or row 3 (no-op as row 3 means above row 3, where + it is already) + + \row + \o \inlineimage modelview-move-rows-4.png Moving rows in the same parent down + \o To move rows within the same parent, specify the row to move them to. + + For example, as shown in the diagram, we move one item from row 2 to row 4, + so \a sourceFirst and \a sourceLast are 2 and \a destinationChild is 4. + + \snippet doc/src/snippets/code/src_corelib_kernel_qabstractitemmodel.cpp 9 + + Note that other rows may be displaced accordingly. + \endtable + + \note This function emits the rowsAboutToBeInserted() signal which + connected views (or proxies) must handle before the data is inserted. + Otherwise, the views may end up in an invalid state. + \sa endMoveRows() \since 4.6 -- cgit v0.12 From 855bbe53b69fa12a9daec49e6326a6bbe4483342 Mon Sep 17 00:00:00 2001 From: David Boddie Date: Tue, 4 May 2010 15:00:10 +0200 Subject: Doc: Fixed up the diagrams, aligning items with a grid. Reviewed-by: Trust Me --- doc/src/diagrams/modelview-move-rows-1.sk | 62 +++++++++++++++---------------- doc/src/diagrams/modelview-move-rows-2.sk | 46 +++++++++++------------ doc/src/diagrams/modelview-move-rows-3.sk | 54 +++++++++++++-------------- doc/src/diagrams/modelview-move-rows-4.sk | 40 ++++++++++---------- 4 files changed, 101 insertions(+), 101 deletions(-) diff --git a/doc/src/diagrams/modelview-move-rows-1.sk b/doc/src/diagrams/modelview-move-rows-1.sk index 3679dc7..dc90cfb 100644 --- a/doc/src/diagrams/modelview-move-rows-1.sk +++ b/doc/src/diagrams/modelview-move-rows-1.sk @@ -14,10 +14,10 @@ lw(1) r(30,0,0,-30,415.038,664.044) fp((1,1,1)) lw(1) -r(30,0,0,-30,219.351,425.18) +r(30,0,0,-30,220,425) fp((1,1,1)) lw(1) -r(30,0,0,-30,414.389,337.792) +r(30,0,0,-30,415,337.5) fp((1,1,1)) lw(1) r(30,0,0,-30,220,605) @@ -35,19 +35,19 @@ lw(1) r(30,0,0,-30,277.5,575) fp((0.753,0.753,1)) lw(1) -r(30,0,0,-30,219.351,335.18) +r(30,0,0,-30,220,335) fp((0.753,0.753,1)) lw(1) -r(30,0,0,-30,414.389,574.044) +r(30,0,0,-30,415,575) fp((1,1,1)) lw(1) r(30,0,0,-30,220,545) fp((1,1,1)) lw(1) -r(30.6087,0,0,-30,218.435,305.442) +r(30,0,0,-30.262,220,305.262) fp((1,1,1)) lw(1) -r(31.2174,0,0,-30,414.082,306.92) +r(30,0,0,-30,415,307.5) fp((1,1,1)) lw(1) r(30,0,0,-30,415.038,455.177) @@ -62,31 +62,31 @@ lw(1) r(30,0,0,-30,220,695) fp((1,1,1)) lw(1) -r(30,0,0,-30,415.038,694.044) +r(30,0,0,-30.956,415.038,695) fp((1,1,1)) lw(1) -r(30,0,0,-30,219.351,455.18) +r(30,0,0,-30,220,455) fp((1,1,1)) lw(1) -r(30,0,0,-30,414.389,367.792) +r(30,0,0,-30,415,367.5) fp((0.753,0.753,1)) lw(1) r(30,0,0,-30,277.5,605) fp((0.753,0.753,1)) lw(1) -r(30,0,0,-30,219.351,365.18) +r(30,0,0,-30,220,365) fp((0.753,0.753,1)) lw(1) -r(30,0,0,-30,414.389,604.044) +r(30,0,0,-30,415,605) fp((0.753,0.753,1)) lw(1) r(30,0,0,-30,277.5,635) fp((0.753,0.753,1)) lw(1) -r(30,0,0,-30,219.351,395.18) +r(30,0,0,-30,220,395) fp((0.753,0.753,1)) lw(1) -r(30,0,0,-30,414.389,634.044) +r(30,0,0,-30,415,635) le() lw(1) r(165,0,0,-230,210,705) @@ -107,13 +107,13 @@ le() lw(1) Fn('Helvetica') Fs(20) -txt('0',(228.791,433.32)) +txt('0',(229.44,433.14)) fp((0,0,0)) le() lw(1) Fn('Helvetica') Fs(20) -txt('0',(423.829,345.932)) +txt('0',(424.44,345.64)) fp((0,0,0)) le() lw(1) @@ -131,13 +131,13 @@ le() lw(1) Fn('Helvetica') Fs(20) -txt('1',(228.791,403.32)) +txt('1',(229.44,403.14)) fp((0,0,0)) le() lw(1) Fn('Helvetica') Fs(20) -txt('1',(423.829,315.932)) +txt('1',(424.44,315.64)) fp((0,0,0)) le() lw(1) @@ -161,13 +161,13 @@ le() lw(1) Fn('Helvetica') Fs(20) -txt('2',(228.791,373.32)) +txt('2',(229.44,373.14)) fp((0,0,0)) le() lw(1) Fn('Helvetica') Fs(20) -txt('2',(423.829,612.184)) +txt('2',(424.44,613.14)) fp((0,0,0)) le() lw(1) @@ -191,13 +191,13 @@ le() lw(1) Fn('Helvetica') Fs(20) -txt('3',(228.791,343.32)) +txt('3',(229.44,343.14)) fp((0,0,0)) le() lw(1) Fn('Helvetica') Fs(20) -txt('3',(423.829,582.184)) +txt('3',(424.44,583.14)) fp((0,0,0)) le() lw(1) @@ -221,13 +221,13 @@ le() lw(1) Fn('Helvetica') Fs(20) -txt('4',(228.791,313.32)) +txt('4',(229.44,313.14)) fp((0,0,0)) le() lw(1) Fn('Helvetica') Fs(20) -txt('4',(423.829,552.184)) +txt('4',(424.44,553.14)) fp((0,0,0)) le() lw(1) @@ -239,13 +239,13 @@ le() lw(1) Fn('Helvetica') Fs(20) -txt('5',(228.484,283.582)) +txt('5',(229.133,283.402)) fp((0.503,0.503,0.503)) le() lw(1) Fn('Helvetica') Fs(20) -txt('5',(423.522,285.06)) +txt('5',(424.44,285.64)) fp((0.503,0.503,0.503)) le() lw(1) @@ -255,17 +255,17 @@ txt('5',(424.478,433.317)) lw(1.5) la2(([(-4.0, 3.0), (2.0, 0.0), (-4.0, -3.0), (-4.0, 3.0)], 1)) b() -bs(275,635,0) -bs(255,635,0) +bs(277.5,635,0) +bs(252.5,635,0) lw(1.5) la2(([(-4.0, 3.0), (2.0, 0.0), (-4.0, -3.0), (-4.0, 3.0)], 1)) b() -bs(294.508,380.772,0) -bs(293.986,545.115,0) +bs(292.5,380,0) +bs(292.5,542.5,0) lw(1.5) la2(([(-4.0, 3.0), (2.0, 0.0), (-4.0, -3.0), (-4.0, 3.0)], 1)) b() -bs(249.466,380.772,0) -bs(291.551,380.772,0) +bs(250,380,0) +bs(290,380,0) guidelayer('Guide Lines',1,0,0,1,(0,0,1)) grid((0,0,2.5,2.5),1,(0,0,1),'Grid') diff --git a/doc/src/diagrams/modelview-move-rows-2.sk b/doc/src/diagrams/modelview-move-rows-2.sk index c453a78..7ddb95e 100644 --- a/doc/src/diagrams/modelview-move-rows-2.sk +++ b/doc/src/diagrams/modelview-move-rows-2.sk @@ -14,10 +14,10 @@ lw(1) r(30,0,0,-30,415.038,664.044) fp((1,1,1)) lw(1) -r(30,0,0,-30,219.351,425.18) +r(30,0,0,-30,220,425) fp((1,1,1)) lw(1) -r(30,0,0,-30,414.389,337.792) +r(30,0,0,-30,415,337.5) fp((1,1,1)) lw(1) r(30,0,0,-30,220,605) @@ -35,7 +35,7 @@ lw(1) r(30,0,0,-30,275,455) fp((0.753,0.753,1)) lw(1) -r(30,0,0,-30,219.351,335.18) +r(30,0,0,-30,220,335) fp((0.753,0.753,1)) lw(1) r(30,0,0,-30,415,455) @@ -47,10 +47,10 @@ lw(1) r(30,0,0,-30,415,545) fp((1,1,1)) lw(1) -r(30.6087,0,0,-30,218.435,305.442) +r(29.6927,0,0,-30,220,305.262) fp((1,1,1)) lw(1) -r(31.2174,0,0,-30,414.082,306.92) +r(30,0,0,-30,415,307.5) fp((1,1,1)) lw(1) r(30,0,0,-30,220,635) @@ -65,16 +65,16 @@ lw(1) r(30,0,0,-30,415.038,694.044) fp((1,1,1)) lw(1) -r(30,0,0,-30,219.351,455.18) +r(30,0,0,-30,220,455) fp((1,1,1)) lw(1) -r(30,0,0,-30,414.389,367.792) +r(30,0,0,-30,415,367.5) fp((0.753,0.753,1)) lw(1) r(30,0,0,-30,275,485) fp((0.753,0.753,1)) lw(1) -r(30,0,0,-30,219.351,365.18) +r(30,0,0,-30,220,365) fp((0.753,0.753,1)) lw(1) r(30,0,0,-30,415,485) @@ -83,7 +83,7 @@ lw(1) r(30,0,0,-30,275,515) fp((0.753,0.753,1)) lw(1) -r(30,0,0,-30,219.351,395.18) +r(30,0,0,-30,220,395) fp((0.753,0.753,1)) lw(1) r(30,0,0,-30,415,515) @@ -107,13 +107,13 @@ le() lw(1) Fn('Helvetica') Fs(20) -txt('0',(228.791,433.32)) +txt('0',(229.44,433.14)) fp((0,0,0)) le() lw(1) Fn('Helvetica') Fs(20) -txt('0',(423.829,345.932)) +txt('0',(424.44,345.64)) fp((0,0,0)) le() lw(1) @@ -131,13 +131,13 @@ le() lw(1) Fn('Helvetica') Fs(20) -txt('1',(228.791,403.32)) +txt('1',(229.44,403.14)) fp((0,0,0)) le() lw(1) Fn('Helvetica') Fs(20) -txt('1',(423.829,315.932)) +txt('1',(424.44,315.64)) fp((0,0,0)) le() lw(1) @@ -161,7 +161,7 @@ le() lw(1) Fn('Helvetica') Fs(20) -txt('2',(228.791,373.32)) +txt('2',(229.44,373.14)) fp((0,0,0)) le() lw(1) @@ -191,7 +191,7 @@ le() lw(1) Fn('Helvetica') Fs(20) -txt('3',(228.791,343.32)) +txt('3',(229.44,343.14)) fp((0,0,0)) le() lw(1) @@ -221,7 +221,7 @@ le() lw(1) Fn('Helvetica') Fs(20) -txt('4',(228.791,313.32)) +txt('4',(229.44,313.14)) fp((0,0,0)) le() lw(1) @@ -245,27 +245,27 @@ le() lw(1) Fn('Helvetica') Fs(20) -txt('5',(228.484,283.582)) +txt('5',(229.133,283.402)) fp((0.503,0.503,0.503)) le() lw(1) Fn('Helvetica') Fs(20) -txt('5',(423.522,285.06)) +txt('5',(424.44,285.64)) lw(1.5) la2(([(-4.0, 3.0), (2.0, 0.0), (-4.0, -3.0), (-4.0, 3.0)], 1)) b() -bs(272.5,515,0) +bs(275,515,0) bs(252.5,515,0) lw(1.5) la2(([(-4.0, 3.0), (2.0, 0.0), (-4.0, -3.0), (-4.0, 3.0)], 1)) b() -bs(294.508,380.772,0) -bs(295,425,0) +bs(292.5,380,0) +bs(292.5,422.5,0) lw(1.5) la2(([(-4.0, 3.0), (2.0, 0.0), (-4.0, -3.0), (-4.0, 3.0)], 1)) b() -bs(249.466,380.772,0) -bs(291.551,380.772,0) +bs(250,380,0) +bs(290,380,0) guidelayer('Guide Lines',1,0,0,1,(0,0,1)) grid((0,0,2.5,2.5),1,(0,0,1),'Grid') diff --git a/doc/src/diagrams/modelview-move-rows-3.sk b/doc/src/diagrams/modelview-move-rows-3.sk index d320900..33a9ad1 100644 --- a/doc/src/diagrams/modelview-move-rows-3.sk +++ b/doc/src/diagrams/modelview-move-rows-3.sk @@ -4,30 +4,30 @@ layout('A4',0) layer('Layer 1',1,1,0,0,(0,0,0)) fp((1,1,1)) lw(1) -r(30,0,0,-30,219.351,425.18) +r(30,0,0,-30,220,425) fp((1,1,1)) lw(1) -r(30,0,0,-30,345.913,400) +r(30,0,0,-30,344.997,400) lw(1) -r(30,0,0,-30,219.351,335.18) +r(30,0,0,-30,220,335) lw(1) -r(30,0,0,-30,345.916,339.739) +r(30,0,0,-30,345,339.739) fp((1,1,1)) lw(1) -r(30.6087,0,0,-30,218.435,305.442) +r(30,0,0,-30,220,305.262) fp((1,1,1)) lw(1) -r(30.6087,0,0,-30,345,310) +r(30,0,0,-30,345,310) fp((1,1,1)) lw(1) -r(30,0,0,-30,219.351,455.18) +r(30,0,0,-30,220,455) fp((1,1,1)) lw(1) -r(30,0,0,-30,345.913,430) +r(30,0,0,-30,344.997,430) lw(1) -r(30,0,0,-30,219.351,365.18) +r(30,0,0,-30,220,365) lw(1) -r(30,0,0,-30,345.916,369.739) +r(30,0,0,-30,345,369.739) fp((0.753,0.753,1)) lw(1) r(30,0,0,-30,272.5,455) @@ -36,7 +36,7 @@ lw(1) r(30,0,0,-30,345,460) fp((0.753,0.753,1)) lw(1) -r(30,0,0,-30,219.351,395.18) +r(30,0,0,-30,220,395) le() lw(1) r(165,0,0,-230,210,705) @@ -45,25 +45,25 @@ le() lw(1) Fn('Helvetica') Fs(20) -txt('0',(228.791,433.32)) +txt('0',(229.44,433.14)) fp((0.503,0.503,0.503)) le() lw(1) Fn('Helvetica') Fs(20) -txt('0',(355.353,408.14)) +txt('0',(354.437,408.14)) fp((0,0,0)) le() lw(1) Fn('Helvetica') Fs(20) -txt('1',(228.791,403.32)) +txt('1',(229.44,403.14)) fp((0.503,0.503,0.503)) le() lw(1) Fn('Helvetica') Fs(20) -txt('1',(355.353,378.14)) +txt('1',(354.437,378.14)) fp((0,0,0)) le() lw(1) @@ -81,37 +81,37 @@ le() lw(1) Fn('Helvetica') Fs(20) -txt('2',(228.791,373.32)) +txt('2',(229.44,373.14)) fp((0,0,0)) le() lw(1) Fn('Helvetica') Fs(20) -txt('3',(228.791,343.32)) +txt('3',(229.44,343.14)) fp((0,0,0)) le() lw(1) Fn('Helvetica') Fs(20) -txt('3',(355.356,347.879)) +txt('3',(354.44,347.879)) fp((0,0,0)) le() lw(1) Fn('Helvetica') Fs(20) -txt('4',(228.791,313.32)) +txt('4',(229.44,313.14)) fp((0,0,0)) le() lw(1) Fn('Helvetica') Fs(20) -txt('4',(355.356,317.879)) +txt('4',(354.44,317.879)) fp((0,0,0)) le() lw(1) Fn('Helvetica') Fs(20) -txt('5',(228.484,283.582)) +txt('5',(229.133,283.402)) fp((0,0,0)) le() lw(1) @@ -121,17 +121,17 @@ txt('5',(355.049,288.14)) lw(1.5) la2(([(-4.0, 3.0), (2.0, 0.0), (-4.0, -3.0), (-4.0, 3.0)], 1)) b() -bs(270,455,0) -bs(250,455,0) +bs(272.5,455,0) +bs(252.5,455,0) lw(1.5) la2(([(-4.0, 3.0), (2.0, 0.0), (-4.0, -3.0), (-4.0, 3.0)], 1)) b() -bs(294.508,380.772,0) -bs(295,425,0) +bs(287.5,380,0) +bs(287.5,422.5,0) lw(1.5) la2(([(-4.0, 3.0), (2.0, 0.0), (-4.0, -3.0), (-4.0, 3.0)], 1)) b() -bs(249.466,380.772,0) -bs(291.551,380.772,0) +bs(250,380,0) +bs(285,380,0) guidelayer('Guide Lines',1,0,0,1,(0,0,1)) grid((0,0,2.5,2.5),1,(0,0,1),'Grid') diff --git a/doc/src/diagrams/modelview-move-rows-4.sk b/doc/src/diagrams/modelview-move-rows-4.sk index a8a1157..0531749 100644 --- a/doc/src/diagrams/modelview-move-rows-4.sk +++ b/doc/src/diagrams/modelview-move-rows-4.sk @@ -4,28 +4,28 @@ layout('A4',0) layer('Layer 1',1,1,0,0,(0,0,0)) fp((1,1,1)) lw(1) -r(30,0,0,-30,219.351,425.18) +r(30,0,0,-30,220,425) fp((1,1,1)) lw(1) r(30,0,0,-30,345,430) lw(1) -r(30,0,0,-30,219.351,335.18) +r(30,0,0,-30,220,335.18) lw(1) r(30,0,0,-30,345,339.739) fp((1,1,1)) lw(1) -r(30.6087,0,0,-30,218.435,305.442) +r(30,0,0,-30.442,220,305.442) fp((1,1,1)) lw(1) -r(30.6087,0,0,-30,344.084,310) +r(30,0,0,-30,345,310) fp((1,1,1)) lw(1) -r(30,0,0,-30,219.351,455.18) +r(30,0,0,-30,220,455) fp((1,1,1)) lw(1) r(30,0,0,-30,345,460) lw(1) -r(30,0,0,-30,219.351,365.18) +r(30,0,0,-30,220,365) lw(1) r(30,0,0,-30,345,400) fp((0.753,0.753,1)) @@ -36,7 +36,7 @@ lw(1) r(30,0,0,-30,345,370) fp((0.753,0.753,1)) lw(1) -r(30,0,0,-30,219.351,395.18) +r(30,0,0,-30,220,395) le() lw(1) r(165,0,0,-230,210,705) @@ -45,7 +45,7 @@ le() lw(1) Fn('Helvetica') Fs(20) -txt('0',(228.791,433.32)) +txt('0',(229.44,433.14)) fp((0,0,0)) le() lw(1) @@ -57,7 +57,7 @@ le() lw(1) Fn('Helvetica') Fs(20) -txt('1',(228.791,403.32)) +txt('1',(229.44,403.14)) fp((0,0,0)) le() lw(1) @@ -81,13 +81,13 @@ le() lw(1) Fn('Helvetica') Fs(20) -txt('2',(228.791,373.32)) +txt('2',(229.44,373.14)) fp((0,0,0)) le() lw(1) Fn('Helvetica') Fs(20) -txt('3',(228.791,343.32)) +txt('3',(229.44,343.14)) fp((0.503,0.503,0.503)) le() lw(1) @@ -99,7 +99,7 @@ le() lw(1) Fn('Helvetica') Fs(20) -txt('4',(228.791,313.32)) +txt('4',(229.44,313.14)) fp((0,0,0)) le() lw(1) @@ -111,27 +111,27 @@ le() lw(1) Fn('Helvetica') Fs(20) -txt('5',(228.484,283.582)) +txt('5',(229.44,283.582)) fp((0,0,0)) le() lw(1) Fn('Helvetica') Fs(20) -txt('5',(354.133,288.14)) +txt('5',(354.44,288.14)) lw(1.5) la2(([(-4.0, 3.0), (2.0, 0.0), (-4.0, -3.0), (-4.0, 3.0)], 1)) b() -bs(270,335,0) -bs(250,335,0) +bs(272.5,335,0) +bs(252.5,335,0) lw(1.5) la2(([(-4.0, 3.0), (2.0, 0.0), (-4.0, -3.0), (-4.0, 3.0)], 1)) b() -bs(294.508,380.772,0) -bs(295,335,0) +bs(287.5,380,0) +bs(287.5,337.5,0) lw(1.5) la2(([(-4.0, 3.0), (2.0, 0.0), (-4.0, -3.0), (-4.0, 3.0)], 1)) b() -bs(249.466,380.772,0) -bs(291.551,380.772,0) +bs(250,380,0) +bs(285,380,0) guidelayer('Guide Lines',1,0,0,1,(0,0,1)) grid((0,0,2.5,2.5),1,(0,0,1),'Grid') -- cgit v0.12 From d52cc1ded5f30a6da0d11b9c3f7de66b2d3e9ee9 Mon Sep 17 00:00:00 2001 From: Jens Bache-Wiig Date: Tue, 4 May 2010 15:14:56 +0200 Subject: Fix rtl issues with sliders in GTK style Sliders that draw groove decorations did not invert appearance correctly in vertical or rtl cases. With this fix we will flip the rectangles of the respective decorations and tell gtk if we are using an rtl widget or not. Task-number: QTBUG-8986 Reviewed-yb: thorbjorn --- src/gui/styles/qgtkstyle.cpp | 23 ++++++++++++++++------- 1 file changed, 16 insertions(+), 7 deletions(-) diff --git a/src/gui/styles/qgtkstyle.cpp b/src/gui/styles/qgtkstyle.cpp index e3ca8b2..0988fd8 100644 --- a/src/gui/styles/qgtkstyle.cpp +++ b/src/gui/styles/qgtkstyle.cpp @@ -1937,14 +1937,11 @@ void QGtkStyle::drawComplexControl(ComplexControl control, const QStyleOptionCom QRect groove = proxy()->subControlRect(CC_Slider, option, SC_SliderGroove, widget); QRect handle = proxy()->subControlRect(CC_Slider, option, SC_SliderHandle, widget); - QRect ticks = proxy()->subControlRect(CC_Slider, option, SC_SliderTickmarks, widget); bool horizontal = slider->orientation == Qt::Horizontal; bool ticksAbove = slider->tickPosition & QSlider::TicksAbove; bool ticksBelow = slider->tickPosition & QSlider::TicksBelow; - QColor activeHighlight = option->palette.color(QPalette::Normal, QPalette::Highlight); - QPixmap cache; QBrush oldBrush = painter->brush(); QPen oldPen = painter->pen(); @@ -1953,6 +1950,8 @@ void QGtkStyle::drawComplexControl(ComplexControl control, const QStyleOptionCom QColor highlightAlpha(Qt::white); highlightAlpha.setAlpha(80); + QGtkStylePrivate::gtk_widget_set_direction(hScaleWidget, slider->upsideDown ? + GTK_TEXT_DIR_RTL : GTK_TEXT_DIR_LTR); GtkWidget *scaleWidget = horizontal ? hScaleWidget : vScaleWidget; style = scaleWidget->style; @@ -1986,11 +1985,21 @@ void QGtkStyle::drawComplexControl(ComplexControl control, const QStyleOptionCom QRect lowerGroove = grooveRect; if (horizontal) { - upperGroove.setLeft(handle.center().x()); - lowerGroove.setRight(handle.center().x()); + if (slider->upsideDown) { + lowerGroove.setLeft(handle.center().x()); + upperGroove.setRight(handle.center().x()); + } else { + upperGroove.setLeft(handle.center().x()); + lowerGroove.setRight(handle.center().x()); + } } else { - upperGroove.setBottom(handle.center().y()); - lowerGroove.setTop(handle.center().y()); + if (!slider->upsideDown) { + lowerGroove.setBottom(handle.center().y()); + upperGroove.setTop(handle.center().y()); + } else { + upperGroove.setBottom(handle.center().y()); + lowerGroove.setTop(handle.center().y()); + } } gtkPainter.paintBox( scaleWidget, "trough-upper", upperGroove, state, -- cgit v0.12