diff options
author | Martin Smith <msmith@trolltech.com> | 2010-05-04 13:33:43 (GMT) |
---|---|---|
committer | Martin Smith <msmith@trolltech.com> | 2010-05-04 13:33:43 (GMT) |
commit | b92f81172071e78156562d76c9d8ae6e8d3e16c5 (patch) | |
tree | e7539da8d625edce056b57e5f2f27d3e414344de | |
parent | 409ced7dc098438e185b9a6db6b3f53b1472839d (diff) | |
parent | d52cc1ded5f30a6da0d11b9c3f7de66b2d3e9ee9 (diff) | |
download | Qt-b92f81172071e78156562d76c9d8ae6e8d3e16c5.zip Qt-b92f81172071e78156562d76c9d8ae6e8d3e16c5.tar.gz Qt-b92f81172071e78156562d76c9d8ae6e8d3e16c5.tar.bz2 |
Merge branch '4.7' of git@scm.dev.nokia.troll.no:qt/oslo-staging-1 into 4.7
-rw-r--r-- | doc/src/diagrams/modelview-move-rows-1.sk | 271 | ||||
-rw-r--r-- | doc/src/diagrams/modelview-move-rows-2.sk | 271 | ||||
-rw-r--r-- | doc/src/diagrams/modelview-move-rows-3.sk | 137 | ||||
-rw-r--r-- | doc/src/diagrams/modelview-move-rows-4.sk | 137 | ||||
-rw-r--r-- | doc/src/snippets/code/src_corelib_kernel_qabstractitemmodel.cpp | 20 | ||||
-rw-r--r-- | src/corelib/kernel/qabstractitemmodel.cpp | 56 | ||||
-rw-r--r-- | src/gui/styles/qgtkstyle.cpp | 23 |
7 files changed, 908 insertions, 7 deletions
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..dc90cfb --- /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,220,425) +fp((1,1,1)) +lw(1) +r(30,0,0,-30,415,337.5) +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,220,335) +fp((0.753,0.753,1)) +lw(1) +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,0,0,-30.262,220,305.262) +fp((1,1,1)) +lw(1) +r(30,0,0,-30,415,307.5) +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.956,415.038,695) +fp((1,1,1)) +lw(1) +r(30,0,0,-30,220,455) +fp((1,1,1)) +lw(1) +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,220,365) +fp((0.753,0.753,1)) +lw(1) +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,220,395) +fp((0.753,0.753,1)) +lw(1) +r(30,0,0,-30,415,635) +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',(229.44,433.14)) +fp((0,0,0)) +le() +lw(1) +Fn('Helvetica') +Fs(20) +txt('0',(424.44,345.64)) +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',(229.44,403.14)) +fp((0,0,0)) +le() +lw(1) +Fn('Helvetica') +Fs(20) +txt('1',(424.44,315.64)) +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',(229.44,373.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('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',(229.44,343.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('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',(229.44,313.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('5',(229.44,523.14)) +fp((0,0,0)) +le() +lw(1) +Fn('Helvetica') +Fs(20) +txt('5',(229.133,283.402)) +fp((0.503,0.503,0.503)) +le() +lw(1) +Fn('Helvetica') +Fs(20) +txt('5',(424.44,285.64)) +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(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(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(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 new file mode 100644 index 0000000..7ddb95e --- /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,220,425) +fp((1,1,1)) +lw(1) +r(30,0,0,-30,415,337.5) +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,220,335) +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(29.6927,0,0,-30,220,305.262) +fp((1,1,1)) +lw(1) +r(30,0,0,-30,415,307.5) +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,220,455) +fp((1,1,1)) +lw(1) +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,220,365) +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,220,395) +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',(229.44,433.14)) +fp((0,0,0)) +le() +lw(1) +Fn('Helvetica') +Fs(20) +txt('0',(424.44,345.64)) +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',(229.44,403.14)) +fp((0,0,0)) +le() +lw(1) +Fn('Helvetica') +Fs(20) +txt('1',(424.44,315.64)) +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',(229.44,373.14)) +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',(229.44,343.14)) +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',(229.44,313.14)) +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',(229.133,283.402)) +fp((0.503,0.503,0.503)) +le() +lw(1) +Fn('Helvetica') +Fs(20) +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(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(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(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 new file mode 100644 index 0000000..33a9ad1 --- /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,220,425) +fp((1,1,1)) +lw(1) +r(30,0,0,-30,344.997,400) +lw(1) +r(30,0,0,-30,220,335) +lw(1) +r(30,0,0,-30,345,339.739) +fp((1,1,1)) +lw(1) +r(30,0,0,-30,220,305.262) +fp((1,1,1)) +lw(1) +r(30,0,0,-30,345,310) +fp((1,1,1)) +lw(1) +r(30,0,0,-30,220,455) +fp((1,1,1)) +lw(1) +r(30,0,0,-30,344.997,430) +lw(1) +r(30,0,0,-30,220,365) +lw(1) +r(30,0,0,-30,345,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,220,395) +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,433.14)) +fp((0.503,0.503,0.503)) +le() +lw(1) +Fn('Helvetica') +Fs(20) +txt('0',(354.437,408.14)) +fp((0,0,0)) +le() +lw(1) +Fn('Helvetica') +Fs(20) +txt('1',(229.44,403.14)) +fp((0.503,0.503,0.503)) +le() +lw(1) +Fn('Helvetica') +Fs(20) +txt('1',(354.437,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',(229.44,373.14)) +fp((0,0,0)) +le() +lw(1) +Fn('Helvetica') +Fs(20) +txt('3',(229.44,343.14)) +fp((0,0,0)) +le() +lw(1) +Fn('Helvetica') +Fs(20) +txt('3',(354.44,347.879)) +fp((0,0,0)) +le() +lw(1) +Fn('Helvetica') +Fs(20) +txt('4',(229.44,313.14)) +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',(229.133,283.402)) +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(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(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(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 new file mode 100644 index 0000000..0531749 --- /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,220,425) +fp((1,1,1)) +lw(1) +r(30,0,0,-30,345,430) +lw(1) +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,0,0,-30.442,220,305.442) +fp((1,1,1)) +lw(1) +r(30,0,0,-30,345,310) +fp((1,1,1)) +lw(1) +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,220,365) +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,220,395) +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,433.14)) +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',(229.44,403.14)) +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',(229.44,373.14)) +fp((0,0,0)) +le() +lw(1) +Fn('Helvetica') +Fs(20) +txt('3',(229.44,343.14)) +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',(229.44,313.14)) +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',(229.44,283.582)) +fp((0,0,0)) +le() +lw(1) +Fn('Helvetica') +Fs(20) +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(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(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(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/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 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, |