|
Lines 211-216
Link Here
|
| 211 |
QIconViewItem *currentItem, *tmpCurrentItem, *highlightedItem, |
211 |
QIconViewItem *currentItem, *tmpCurrentItem, *highlightedItem, |
| 212 |
*startDragItem, *pressedItem, *selectAnchor, *renamingItem; |
212 |
*startDragItem, *pressedItem, *selectAnchor, *renamingItem; |
| 213 |
QRect *rubber; |
213 |
QRect *rubber; |
|
|
214 |
QPixmap *backBuffer; |
| 214 |
QTimer *scrollTimer, *adjustTimer, *updateTimer, *inputTimer, |
215 |
QTimer *scrollTimer, *adjustTimer, *updateTimer, *inputTimer, |
| 215 |
*fullRedrawTimer; |
216 |
*fullRedrawTimer; |
| 216 |
int rastX, rastY, spacing; |
217 |
int rastX, rastY, spacing; |
|
Lines 2731-2736
Link Here
|
| 2731 |
d->currentItem = 0; |
2732 |
d->currentItem = 0; |
| 2732 |
d->highlightedItem = 0; |
2733 |
d->highlightedItem = 0; |
| 2733 |
d->rubber = 0; |
2734 |
d->rubber = 0; |
|
|
2735 |
d->backBuffer = 0; |
| 2734 |
d->scrollTimer = 0; |
2736 |
d->scrollTimer = 0; |
| 2735 |
d->startDragItem = 0; |
2737 |
d->startDragItem = 0; |
| 2736 |
d->tmpCurrentItem = 0; |
2738 |
d->tmpCurrentItem = 0; |
|
Lines 2883-2888
Link Here
|
| 2883 |
delete item; |
2885 |
delete item; |
| 2884 |
item = tmp; |
2886 |
item = tmp; |
| 2885 |
} |
2887 |
} |
|
|
2888 |
delete d->backBuffer; |
| 2889 |
d->backBuffer = 0; |
| 2886 |
delete d->fm; |
2890 |
delete d->fm; |
| 2887 |
d->fm = 0; |
2891 |
d->fm = 0; |
| 2888 |
#ifndef QT_NO_TOOLTIP |
2892 |
#ifndef QT_NO_TOOLTIP |
|
Lines 4845-4850
Link Here
|
| 4845 |
#endif |
4849 |
#endif |
| 4846 |
|
4850 |
|
| 4847 |
/*! |
4851 |
/*! |
|
|
4852 |
This function grabs all paintevents that otherwise would have been |
| 4853 |
processed by the QScrollView::viewportPaintEvent(). Here we use a |
| 4854 |
doublebuffer to reduce 'on-paint' flickering on QIconView |
| 4855 |
(and of course its childs). |
| 4856 |
|
| 4857 |
\sa QScrollView::viewportPaintEvent(), QIconView::drawContents() |
| 4858 |
*/ |
| 4859 |
|
| 4860 |
void QIconView::bufferedPaintEvent( QPaintEvent* pe ) |
| 4861 |
{ |
| 4862 |
QWidget* vp = viewport(); |
| 4863 |
QRect r = pe->rect() & vp->rect(); |
| 4864 |
int ex = r.x() + contentsX(); |
| 4865 |
int ey = r.y() + contentsY(); |
| 4866 |
int ew = r.width(); |
| 4867 |
int eh = r.height(); |
| 4868 |
|
| 4869 |
if ( !d->backBuffer ) |
| 4870 |
d->backBuffer = new QPixmap(vp->size()); |
| 4871 |
if ( d->backBuffer->size() != vp->size() ) { |
| 4872 |
//Resize function (with hysteesis). Uses a good compromise between memory |
| 4873 |
//consumption and speed (number) of resizes. |
| 4874 |
float newWidth = (float)vp->width(); |
| 4875 |
float newHeight = (float)vp->height(); |
| 4876 |
if ( newWidth > d->backBuffer->width() || newHeight > d->backBuffer->height() ) |
| 4877 |
{ |
| 4878 |
newWidth *= 1.1892; |
| 4879 |
newHeight *= 1.1892; |
| 4880 |
d->backBuffer->resize( (int)newWidth, (int)newHeight ); |
| 4881 |
} else if ( 1.5*newWidth < d->backBuffer->width() || 1.5*newHeight < d->backBuffer->height() ) |
| 4882 |
d->backBuffer->resize( (int)newWidth, (int)newHeight ); |
| 4883 |
} |
| 4884 |
|
| 4885 |
QPainter p; |
| 4886 |
p.begin(d->backBuffer, vp); |
| 4887 |
drawContentsOffset(&p, contentsX(), contentsY(), ex, ey, ew, eh); |
| 4888 |
p.end(); |
| 4889 |
bitBlt(vp, r.x(), r.y(), d->backBuffer, r.x(), r.y(), ew, eh); |
| 4890 |
} |
| 4891 |
|
| 4892 |
/*! |
| 4848 |
\reimp |
4893 |
\reimp |
| 4849 |
*/ |
4894 |
*/ |
| 4850 |
|
4895 |
|
|
Lines 5627-5633
Link Here
|
| 5627 |
if ( !d->rubber ) |
5676 |
if ( !d->rubber ) |
| 5628 |
drawDragShapes( d->oldDragPos ); |
5677 |
drawDragShapes( d->oldDragPos ); |
| 5629 |
} |
5678 |
} |
| 5630 |
viewportPaintEvent( (QPaintEvent*)e ); |
5679 |
bufferedPaintEvent( (QPaintEvent*)e ); |
| 5631 |
if ( d->dragging ) { |
5680 |
if ( d->dragging ) { |
| 5632 |
if ( !d->rubber ) |
5681 |
if ( !d->rubber ) |
| 5633 |
drawDragShapes( d->oldDragPos ); |
5682 |
drawDragShapes( d->oldDragPos ); |