| 932 | } |
| 933 | |
| 934 | void RDHeaderView::currentChanged(const QModelIndex ¤t, const QModelIndex &old) |
| 935 | { |
| 936 | if(!m_customSizing) |
| 937 | return QHeaderView::currentChanged(current, old); |
| 938 | |
| 939 | // not optimal at all |
| 940 | if(current != old) |
| 941 | { |
| 942 | QRect r = viewport()->rect(); |
| 943 | |
| 944 | if(old.isValid()) |
| 945 | { |
| 946 | QRect rect = r; |
| 947 | |
| 948 | if(orientation() == Qt::Horizontal) |
| 949 | { |
| 950 | rect.setLeft(sectionViewportPosition(old.column())); |
| 951 | rect.setWidth(sectionSize(old.column())); |
| 952 | } |
| 953 | else |
| 954 | { |
| 955 | rect.setTop(sectionViewportPosition(old.column())); |
| 956 | rect.setHeight(sectionSize(old.column())); |
| 957 | } |
| 958 | |
| 959 | viewport()->update(rect); |
| 960 | } |
| 961 | |
| 962 | if(current.isValid()) |
| 963 | { |
| 964 | QRect rect = r; |
| 965 | |
| 966 | if(orientation() == Qt::Horizontal) |
| 967 | { |
| 968 | rect.setLeft(sectionViewportPosition(current.column())); |
| 969 | rect.setWidth(sectionSize(current.column())); |
| 970 | } |
| 971 | else |
| 972 | { |
| 973 | rect.setTop(sectionViewportPosition(current.column())); |
| 974 | rect.setHeight(sectionSize(current.column())); |
| 975 | } |
| 976 | |
| 977 | viewport()->update(rect); |
| 978 | } |
| 979 | } |
| 980 | } |
| 981 | |
| 982 | void RDHeaderView::updateGeometries() |
| 983 | { |