author | mickeyl <mickeyl> | 2005-02-19 16:07:58 (UTC) |
---|---|---|
committer | mickeyl <mickeyl> | 2005-02-19 16:07:58 (UTC) |
commit | b7bf9c7acdc010eb30bc246372efb0d1b394166a (patch) (unidiff) | |
tree | 8dde116603cd8ddf439a881fc4a1d8f413af617b /qt/qt-2.3.8.patch/qte238-iconviewspeed.patch | |
parent | 298d0d244ca724405ca0651775ed61a22ce7a5ae (diff) | |
download | opie-b7bf9c7acdc010eb30bc246372efb0d1b394166a.zip opie-b7bf9c7acdc010eb30bc246372efb0d1b394166a.tar.gz opie-b7bf9c7acdc010eb30bc246372efb0d1b394166a.tar.bz2 |
hello qte2.3.10 patches
bye bye old patches
Diffstat (limited to 'qt/qt-2.3.8.patch/qte238-iconviewspeed.patch') (more/less context) (ignore whitespace changes)
-rw-r--r-- | qt/qt-2.3.8.patch/qte238-iconviewspeed.patch | 145 |
1 files changed, 0 insertions, 145 deletions
diff --git a/qt/qt-2.3.8.patch/qte238-iconviewspeed.patch b/qt/qt-2.3.8.patch/qte238-iconviewspeed.patch deleted file mode 100644 index 3351bbb..0000000 --- a/qt/qt-2.3.8.patch/qte238-iconviewspeed.patch +++ b/dev/null | |||
@@ -1,145 +0,0 @@ | |||
1 | Speed up patches backported from | ||
2 | |||
3 | http://robotics.dei.unipd.it/~koral/KDE/kflicker.html | ||
4 | |||
5 | and | ||
6 | |||
7 | http://lists.kde.org/?l=kde-optimize&m=105382164111363&w=2 (complete thread) | ||
8 | |||
9 | |||
10 | |||
11 | |||
12 | |||
13 | |||
14 | |||
15 | diff -ur qt-2.3.8-old/src/iconview/qiconview.cpp qt-2.3.8/src/iconview/qiconview.cpp | ||
16 | --- qt-2.3.8-old/src/iconview/qiconview.cpp2004-07-22 01:07:46.000000000 +0200 | ||
17 | +++ qt-2.3.8/src/iconview/qiconview.cpp2004-07-23 19:13:09.000000000 +0200 | ||
18 | @@ -224,6 +224,7 @@ | ||
19 | QIconView::SelectionMode selectionMode; | ||
20 | QIconViewItem *currentItem, *tmpCurrentItem, *highlightedItem, *startDragItem, *pressedItem, *selectAnchor; | ||
21 | QRect *rubber; | ||
22 | + QPixmap *backBuffer; | ||
23 | QTimer *scrollTimer, *adjustTimer, *updateTimer, *inputTimer, | ||
24 | *fullRedrawTimer; | ||
25 | int rastX, rastY, spacing; | ||
26 | @@ -2267,6 +2268,7 @@ | ||
27 | d->currentItem = 0; | ||
28 | d->highlightedItem = 0; | ||
29 | d->rubber = 0; | ||
30 | + d->backBuffer = 0; | ||
31 | d->scrollTimer = 0; | ||
32 | d->startDragItem = 0; | ||
33 | d->tmpCurrentItem = 0; | ||
34 | @@ -2415,6 +2417,8 @@ | ||
35 | delete item; | ||
36 | item = tmp; | ||
37 | } | ||
38 | + delete d->backBuffer; | ||
39 | + d->backBuffer = 0; | ||
40 | delete d->fm; | ||
41 | d->fm = 0; | ||
42 | #ifndef QT_NO_TOOLTIP | ||
43 | @@ -2881,6 +2885,48 @@ | ||
44 | } | ||
45 | |||
46 | /*! | ||
47 | + This function grabs all paintevents that otherwise would have been | ||
48 | + processed by the QScrollView::viewportPaintEvent(). Here we use a | ||
49 | + doublebuffer to reduce 'on-paint' flickering on QIconView | ||
50 | + (and of course its childs). | ||
51 | + | ||
52 | + \sa QScrollView::viewportPaintEvent(), QIconView::drawContents() | ||
53 | +*/ | ||
54 | + | ||
55 | +void QIconView::bufferedPaintEvent( QPaintEvent* pe ) | ||
56 | +{ | ||
57 | + QWidget* vp = viewport(); | ||
58 | + QRect r = pe->rect() & vp->rect(); | ||
59 | + int ex = r.x() + contentsX(); | ||
60 | + int ey = r.y() + contentsY(); | ||
61 | + int ew = r.width(); | ||
62 | + int eh = r.height(); | ||
63 | + | ||
64 | + if ( !d->backBuffer ) | ||
65 | +d->backBuffer = new QPixmap(vp->size()); | ||
66 | + if ( d->backBuffer->size() != vp->size() ) { | ||
67 | +//Resize function (with hysteesis). Uses a good compromise between memory | ||
68 | +//consumption and speed (number) of resizes. | ||
69 | + float newWidth = (float)vp->width(); | ||
70 | +float newHeight = (float)vp->height(); | ||
71 | +if ( newWidth > d->backBuffer->width() || newHeight > d->backBuffer->height() ) | ||
72 | +{ | ||
73 | + newWidth *= 1.1892; | ||
74 | + newHeight *= 1.1892; | ||
75 | + d->backBuffer->resize( (int)newWidth, (int)newHeight ); | ||
76 | +} else if ( 1.5*newWidth < d->backBuffer->width() || 1.5*newHeight < d->backBuffer->height() ) | ||
77 | + d->backBuffer->resize( (int)newWidth, (int)newHeight ); | ||
78 | + } | ||
79 | + | ||
80 | + QPainter p; | ||
81 | + p.begin(d->backBuffer, vp); | ||
82 | + drawContentsOffset(&p, contentsX(), contentsY(), ex, ey, ew, eh); | ||
83 | + p.end(); | ||
84 | + bitBlt(vp, r.x(), r.y(), d->backBuffer, r.x(), r.y(), ew, eh); | ||
85 | +} | ||
86 | + | ||
87 | +/*! | ||
88 | + | ||
89 | \reimp | ||
90 | */ | ||
91 | |||
92 | @@ -4937,7 +4983,7 @@ | ||
93 | if ( !d->rubber ) | ||
94 | drawDragShapes( d->oldDragPos ); | ||
95 | } | ||
96 | - viewportPaintEvent( (QPaintEvent*)e ); | ||
97 | + bufferedPaintEvent ((QPaintEvent*)e ); | ||
98 | if ( d->dragging ) { | ||
99 | if ( !d->rubber ) | ||
100 | drawDragShapes( d->oldDragPos ); | ||
101 | @@ -5374,11 +5420,19 @@ | ||
102 | return; | ||
103 | |||
104 | if ( item->d->container1 && d->firstContainer ) { | ||
105 | -item->d->container1->items.removeRef( item ); | ||
106 | + //Special-case checking of the last item, since this may be | ||
107 | + //called a few times for the same item. | ||
108 | + if (item->d->container1->items.last() == item) | ||
109 | + item->d->container1->items.removeLast(); | ||
110 | + else | ||
111 | + item->d->container1->items.removeRef( item ); | ||
112 | } | ||
113 | item->d->container1 = 0; | ||
114 | if ( item->d->container2 && d->firstContainer ) { | ||
115 | -item->d->container2->items.removeRef( item ); | ||
116 | + if (item->d->container2->items.last() == item) | ||
117 | + item->d->container2->items.removeLast(); | ||
118 | + else | ||
119 | + item->d->container2->items.removeRef( item ); | ||
120 | } | ||
121 | item->d->container2 = 0; | ||
122 | |||
123 | diff -ur qt-2.3.8-old/src/iconview/qiconview.h qt-2.3.8/src/iconview/qiconview.h | ||
124 | --- qt-2.3.8-old/src/iconview/qiconview.h2004-07-22 01:07:46.000000000 +0200 | ||
125 | +++ qt-2.3.8/src/iconview/qiconview.h2004-07-23 19:13:09.000000000 +0200 | ||
126 | @@ -444,6 +444,7 @@ | ||
127 | virtual void contentsDropEvent( QDropEvent *e ); | ||
128 | #endif | ||
129 | |||
130 | + void bufferedPaintEvent( QPaintEvent* ); | ||
131 | virtual void resizeEvent( QResizeEvent* e ); | ||
132 | virtual void keyPressEvent( QKeyEvent *e ); | ||
133 | virtual void focusInEvent( QFocusEvent *e ); | ||
134 | --- qt-2.3.8-old/src/widgets/qscrollview.cpp2004-07-22 01:07:44.000000000 +0200 | ||
135 | +++ qt-2.3.8/src/widgets/qscrollview.cpp2004-07-23 19:21:06.000000000 +0200 | ||
136 | @@ -1280,6 +1280,9 @@ | ||
137 | case QEvent::LayoutHint: | ||
138 | d->autoResizeHint(this); | ||
139 | break; | ||
140 | +case QEvent::WindowActivate: | ||
141 | +case QEvent::WindowDeactivate: | ||
142 | + return TRUE; | ||
143 | default: | ||
144 | break; | ||
145 | } | ||