3 # Patch managed by http://www.holgerschurig.de/patcher.html
6 --- qwt-4.2.0rc1/include/qwt_global.h~qt2-fix
7 +++ qwt-4.2.0rc1/include/qwt_global.h
13 +#if QT_VERSION < 0x030000
14 // Use old QArray instead of QMemArray
15 #define QWT_NO_MEMARRAY
19 // #define QWT_NO_STL // disable Standard Template Library based classes
22 +#if QT_VERSION < 0x030000
23 // tmake does not produce the missing -GX flag for exception handling
26 --- qwt-4.2.0rc1/include/qwt_picker.h~qt2-fix
27 +++ qwt-4.2.0rc1/include/qwt_picker.h
29 Q_PROPERTY(ResizeMode resizeMode READ resizeMode WRITE setResizeMode)
30 Q_PROPERTY(bool isEnabled READ isEnabled WRITE setEnabled)
32 -#if QT_VERSION >= 300
33 +#if QT_VERSION >= 0x030000
34 // Unfortunately moc is not aware of #ifdefs. To enable the QPen
35 // attributes as properties uncomment the following lines.
37 --- qwt-4.2.0rc1/src/qwt_text.cpp~qt2-fix
38 +++ qwt-4.2.0rc1/src/qwt_text.cpp
41 void QwtRichText::setFont(const QFont &font)
43 -#if QT_VERSION >= 300
44 +#if QT_VERSION >= 0x030000
45 d_doc->setDefaultFont(font);
47 QwtText::setFont(font);
50 int QwtRichText::heightForWidth(int width) const
53 +#if QT_VERSION < 0x030000
54 const QFont defaultFont = QFont::defaultFont();
55 QFont::setDefaultFont(font());
58 const QwtLayoutMetrics metrics(QwtPainter::metricsMap());
59 const int height = metrics.heightForWidth(*d_doc, width);
62 +#if QT_VERSION < 0x030000
63 QFont::setDefaultFont(defaultFont);
69 painter->setPen(color());
71 +#if QT_VERSION < 0x030000
72 const QFont defaultFont = QFont::defaultFont();
73 QFont::setDefaultFont(font());
77 QwtPainter::drawSimpleRichText(painter, rect, alignment(), *d_doc);
80 +#if QT_VERSION < 0x030000
81 QFont::setDefaultFont(defaultFont);
86 QRect QwtRichText::boundingRect(QPainter *painter) const
89 +#if QT_VERSION < 0x030000
90 const QFont defaultFont = QFont::defaultFont();
91 QFont::setDefaultFont(font());
94 const QwtLayoutMetrics metrics(QwtPainter::metricsMap());
95 const QRect rect = metrics.boundingRect(*d_doc, alignment(), painter);
98 +#if QT_VERSION < 0x030000
99 QFont::setDefaultFont(defaultFont);
105 // By default QwtSimpleRichText is Qt::AlignLeft
106 -#if QT_VERSION >= 300
107 +#if QT_VERSION >= 0x030000
108 if (align & Qt::AlignJustify)
110 rich.prepend("<div align=\"justify\">");
111 --- qwt-4.2.0rc1/src/qwt_push_button.cpp~qt2-fix
112 +++ qwt-4.2.0rc1/src/qwt_push_button.cpp
114 !(d_button->alignment() & Qt::AlignCenter))
116 const QRect contentsRect =
117 -#if QT_VERSION >= 300
118 +#if QT_VERSION >= 0x030000
119 d_button->style().subRect(
120 QStyle::SR_PushButtonContents, d_button);
123 // Many styles move the label right/down
124 // when the button is down.
126 -#if QT_VERSION >= 300
127 +#if QT_VERSION >= 0x030000
128 const QRect &r = *((QRect *)param[0].rect);
130 const QRect r(*param[0].point, param[1].pixmap->size());
134 d_button->style().drawItem(painter,
135 -#if QT_VERSION >= 300
136 +#if QT_VERSION >= 0x030000
139 pixRect.x(), pixRect.y(),
141 // We save the position of the icon. We need it later
142 // to align the label pixmap. Hope that there are no styles
143 // that paint the pixmap before the icon.
144 -#if QT_VERSION < 300
145 +#if QT_VERSION < 0x030000
146 d_iconRect = QRect(*param[0].point, param[1].pixmap->size());
148 d_iconRect = *param[0].rect;
151 QPainter picPainter(&paintFilter);
153 -#if QT_VERSION >= 300
154 +#if QT_VERSION >= 0x030000
155 // When painting to QPicture the dotted line of the focus rect is
156 // set to solid. ( 06.08.2003 )
157 // So we don´t set the Style_HasFocus flag and paint the focus rect
160 paintFilter.play(painter);
162 -#if QT_VERSION >= 300
163 +#if QT_VERSION >= 0x030000
166 // Paint the focus rect on top of the button label.
167 --- qwt-4.2.0rc1/src/qwt_layout_metrics.cpp~qt2-fix
168 +++ qwt-4.2.0rc1/src/qwt_layout_metrics.cpp
170 QRect QwtMetricsMap::translate(
171 const QWMatrix &m, const QRect &rect)
173 -#if QT_VERSION < 300
174 +#if QT_VERSION < 0x030000
175 return m.map(rect.normalize());
177 return m.mapRect(rect);
179 QPointArray QwtMetricsMap::translate(
180 const QWMatrix &m, const QPointArray &pa)
182 -#if QT_VERSION < 300
183 +#if QT_VERSION < 0x030000
187 --- qwt-4.2.0rc1/src/qwt_slider.cpp~qt2-fix
188 +++ qwt-4.2.0rc1/src/qwt_slider.cpp
191 const QRect rect = d_sliderRect;
193 -#if QT_VERSION < 300
194 +#if QT_VERSION < 0x030000
195 style().drawFocusRect(painter, rect, colorGroup());
197 style().drawPrimitive(QStyle::PE_FocusRect, painter,
198 --- qwt-4.2.0rc1/src/qwt_counter.cpp~qt2-fix
199 +++ qwt-4.2.0rc1/src/qwt_counter.cpp
201 // QLineEdit::minimumSizeHint is for one char. Subtracting
202 // the size for the char we get all the margins, frames ...
204 -#if QT_VERSION < 300
205 +#if QT_VERSION < 0x030000
206 w += d_valueEdit->minimumSizeHint().width() - fm.maxWidth();
208 w += 2 * d_valueEdit->frameWidth() +
209 --- qwt-4.2.0rc1/src/qwt_paint
211 --- qwt-4.2.0rc1/src/qwt_painter.cpp~qt2-fix
212 +++ qwt-4.2.0rc1/src/qwt_painter.cpp
215 cg.setColor(QColorGroup::Text, painter->pen().color());
217 -#if QT_VERSION < 300
218 +#if QT_VERSION < 0x030000
219 const QFont defaultFont = QFont::defaultFont();
220 QFont::setDefaultFont(painter->font());
224 text.draw(painter, scaledRect.x(), y, scaledRect, cg);
226 -#if QT_VERSION < 300
227 +#if QT_VERSION < 0x030000
228 QFont::setDefaultFont(defaultFont);
231 --- qwt-4.2.0rc1/src/qwt_dial.cpp~qt2-fix
232 +++ qwt-4.2.0rc1/src/qwt_dial.cpp
234 // because round objects doesn´t cover all pixels.
236 QRect br = boundingRect();
237 -#if QT_VERSION < 300
238 +#if QT_VERSION < 0x030000
240 // Qt-230-NC draws ellipses not as nicely as Qt-2.3.x on X Windows
241 br.setTop(br.top()-1);
242 @@ -1044,7 +1044,7 @@
246 -#if QT_VERSION >= 300
247 +#if QT_VERSION >= 0x030000
251 @@ -1078,7 +1078,7 @@
252 setValue(maxValue());
255 -#if QT_VERSION >= 300
256 +#if QT_VERSION >= 0x030000
260 --- qwt-4.2.0rc1/src/qwt_knob.cpp~qt2-fix
261 +++ qwt-4.2.0rc1/src/qwt_knob.cpp
266 -#if QT_VERSION < 300
267 +#if QT_VERSION < 0x030000
268 style().drawFocusRect(painter, r, colorGroup());
270 style().drawPrimitive(QStyle::PE_FocusRect, painter,
271 --- qwt-4.2.0rc1/src/qwt_arrbtn.cpp~qt2-fix
272 +++ qwt-4.2.0rc1/src/qwt_arrbtn.cpp
274 QRect QwtArrowButton::labelRect() const
277 -#if QT_VERSION < 300
278 +#if QT_VERSION < 0x030000
279 style().buttonRect(rect().x(), rect().y(),
280 rect().width(), rect().height());
286 -#if QT_VERSION < 300
287 +#if QT_VERSION < 0x030000
288 style().getButtonShift(ph, pv);
290 ph = style().pixelMetric(
295 -#if QT_VERSION >= 300
296 +#if QT_VERSION >= 0x030000
299 const QRect focusRect =
301 if ( d_arrowType == Qt::UpArrow || d_arrowType == Qt::DownArrow )
304 -#if QT_VERSION < 300
305 +#if QT_VERSION < 0x030000
306 int bm = style().buttonMargin() - 1;
307 sz += QSize(2 * bm, 2 * bm);
309 --- qwt-4.2.0rc1/src/qwt_wheel.cpp~qt2-fix
310 +++ qwt-4.2.0rc1/src/qwt_wheel.cpp
315 -#if QT_VERSION < 300
316 +#if QT_VERSION < 0x030000
317 style().drawFocusRect(painter, r, colorGroup());
319 style().drawPrimitive(QStyle::PE_FocusRect, painter,
320 --- qwt-4.2.0rc1/src/qwt_plot_canvas.cpp~qt2-fix
321 +++ qwt-4.2.0rc1/src/qwt_plot_canvas.cpp
324 void QwtPlotCanvas::drawFocusIndicator(QPainter *painter, const QRect &rect)
326 -#if QT_VERSION < 300
327 +#if QT_VERSION < 0x030000
328 style().drawFocusRect(painter, rect, colorGroup());
330 style().drawPrimitive(QStyle::PE_FocusRect, painter,
331 --- qwt-4.2.0rc1/src/qwt_sldbase.cpp~qt2-fix
332 +++ qwt-4.2.0rc1/src/qwt_sldbase.cpp
337 -#if QT_VERSION >= 300
338 +#if QT_VERSION >= 0x030000
346 -#if QT_VERSION >= 300
347 +#if QT_VERSION >= 0x030000
355 -#if QT_VERSION >= 300
356 +#if QT_VERSION >= 0x030000
364 -#if QT_VERSION >= 300
365 +#if QT_VERSION >= 0x030000
373 -#if QT_VERSION >= 300
374 +#if QT_VERSION >= 0x030000
382 -#if QT_VERSION >= 300
383 +#if QT_VERSION >= 0x030000
387 --- qwt-4.2.0rc1/examples/realtime_plot/scrollbar.cpp~qt2-fix
388 +++ qwt-4.2.0rc1/examples/realtime_plot/scrollbar.cpp
390 int ScrollBar::extent() const
393 -#if QT_VERSION >= 300
394 +#if QT_VERSION >= 0x030000
395 dim = style().pixelMetric(QStyle::PM_ScrollBarExtent, this);
397 const QSize sz = style().scrollBarExtent();
398 --- qwt-4.2.0rc1/examples/event_filter/colorbar.cpp~qt2-fix
399 +++ qwt-4.2.0rc1/examples/event_filter/colorbar.cpp
401 const QRgb rgb = pm.convertToImage().pixel(e->x(), e->y());
403 emit selected(QColor(rgb));
404 -#if QT_VERSION >= 300
405 +#if QT_VERSION >= 0x030000