Hi
I found a bug in the handling of column removal by headerview.
I found also the code error that give that mishandling.
The case :
3 columns, say A, B, C.
Move column C to first place. -> C,A,B.
Then remove column A -> Boom. Normally should get C,B

the current code :
Qt Code:
  1. for (int l = logicalLast; l >= logicalFirst; --l) {
  2. int visual = visualIndices.at(l);
  3. int size = sections.at(visual + 1).position - sections.at(visual).position;
  4. for (int v = 0; v < sections.count(); ++v) {
  5. if (logicalIndex(v) > l)
  6. --(logicalIndices[v]);
  7. if (v > visual) {
  8. sections[v].position -= size;
  9. int logical = logicalIndex(v);
  10. --(visualIndices[logical]);
  11. }
  12. }
  13. sections.remove(visual);
  14. hiddenSectionSize.remove(l);
  15.  
  16. logicalIndices.remove(visual);
  17. visualIndices.remove(l);
To copy to clipboard, switch view to plain text mode 
line 9/10 use value that line 7 may have changed.
it should be (80% sure ) :
Qt Code:
  1. for (int l = logicalLast; l >= logicalFirst; --l) {
  2. int visual = visualIndices.at(l);
  3. int size = sections.at(visual + 1).position - sections.at(visual).position;
  4. for (int v = 0; v < sections.count(); ++v) {
  5. int logical = logicalIndex(v);
  6. if (logicalIndex(v) > l)
  7. --(logicalIndices[v]);
  8. if (v > visual) {
  9. sections[v].position -= size;
  10. --(visualIndices[logical]);
  11. }
  12. }
  13. sections.remove(visual);
  14. hiddenSectionSize.remove(l);
  15.  
  16. logicalIndices.remove(visual);
  17. visualIndices.remove(l);
To copy to clipboard, switch view to plain text mode 

What is the quickest way to get an official fix for that ?

I'm trying to recollect how to recompile Qt here
(I have already done it for 4.1.2)

Thanks.