equal
deleted
inserted
replaced
1255 \sa fillRule() |
1255 \sa fillRule() |
1256 */ |
1256 */ |
1257 void QPainterPath::setFillRule(Qt::FillRule fillRule) |
1257 void QPainterPath::setFillRule(Qt::FillRule fillRule) |
1258 { |
1258 { |
1259 ensureData(); |
1259 ensureData(); |
|
1260 if (d_func()->fillRule == fillRule) |
|
1261 return; |
1260 detach(); |
1262 detach(); |
1261 |
1263 |
1262 d_func()->fillRule = fillRule; |
1264 d_func()->fillRule = fillRule; |
1263 } |
1265 } |
1264 |
1266 |
1910 |
1912 |
1911 switch (e.type) { |
1913 switch (e.type) { |
1912 |
1914 |
1913 case QPainterPath::MoveToElement: |
1915 case QPainterPath::MoveToElement: |
1914 if (i > 0 |
1916 if (i > 0 |
1915 && qFuzzyCompare(last_pt.x(), last_start.y()) |
1917 && qFuzzyCompare(last_pt.x(), last_start.x()) |
1916 && qFuzzyCompare(last_pt.y(), last_start.y()) |
1918 && qFuzzyCompare(last_pt.y(), last_start.y()) |
1917 && qt_painterpath_isect_line_rect(last_pt.x(), last_pt.y(), |
1919 && qt_painterpath_isect_line_rect(last_pt.x(), last_pt.y(), |
1918 last_start.x(), last_start.y(), rect)) |
1920 last_start.x(), last_start.y(), rect)) |
1919 return true; |
1921 return true; |
1920 last_start = last_pt = e; |
1922 last_start = last_pt = e; |
2303 \relates QPainterPath |
2305 \relates QPainterPath |
2304 |
2306 |
2305 Writes the given painter \a path to the given \a stream, and |
2307 Writes the given painter \a path to the given \a stream, and |
2306 returns a reference to the \a stream. |
2308 returns a reference to the \a stream. |
2307 |
2309 |
2308 \sa {Format of the QDataStream Operators} |
2310 \sa {Serializing Qt Data Types} |
2309 */ |
2311 */ |
2310 QDataStream &operator<<(QDataStream &s, const QPainterPath &p) |
2312 QDataStream &operator<<(QDataStream &s, const QPainterPath &p) |
2311 { |
2313 { |
2312 if (p.isEmpty()) { |
2314 if (p.isEmpty()) { |
2313 s << 0; |
2315 s << 0; |
2330 \relates QPainterPath |
2332 \relates QPainterPath |
2331 |
2333 |
2332 Reads a painter path from the given \a stream into the specified \a path, |
2334 Reads a painter path from the given \a stream into the specified \a path, |
2333 and returns a reference to the \a stream. |
2335 and returns a reference to the \a stream. |
2334 |
2336 |
2335 \sa {Format of the QDataStream Operators} |
2337 \sa {Serializing Qt Data Types} |
2336 */ |
2338 */ |
2337 QDataStream &operator>>(QDataStream &s, QPainterPath &p) |
2339 QDataStream &operator>>(QDataStream &s, QPainterPath &p) |
2338 { |
2340 { |
2339 int size; |
2341 int size; |
2340 s >> size; |
2342 s >> size; |
3163 |
3165 |
3164 Returns a path which is the union of this path's fill area and \a p's fill area. |
3166 Returns a path which is the union of this path's fill area and \a p's fill area. |
3165 |
3167 |
3166 Set operations on paths will treat the paths as areas. Non-closed |
3168 Set operations on paths will treat the paths as areas. Non-closed |
3167 paths will be treated as implicitly closed. |
3169 paths will be treated as implicitly closed. |
|
3170 Bezier curves may be flattened to line segments due to numerical instability of |
|
3171 doing bezier curve intersections. |
3168 |
3172 |
3169 \sa intersected(), subtracted() |
3173 \sa intersected(), subtracted() |
3170 */ |
3174 */ |
3171 QPainterPath QPainterPath::united(const QPainterPath &p) const |
3175 QPainterPath QPainterPath::united(const QPainterPath &p) const |
3172 { |
3176 { |
3178 |
3182 |
3179 /*! |
3183 /*! |
3180 \since 4.3 |
3184 \since 4.3 |
3181 |
3185 |
3182 Returns a path which is the intersection of this path's fill area and \a p's fill area. |
3186 Returns a path which is the intersection of this path's fill area and \a p's fill area. |
|
3187 Bezier curves may be flattened to line segments due to numerical instability of |
|
3188 doing bezier curve intersections. |
3183 */ |
3189 */ |
3184 QPainterPath QPainterPath::intersected(const QPainterPath &p) const |
3190 QPainterPath QPainterPath::intersected(const QPainterPath &p) const |
3185 { |
3191 { |
3186 if (isEmpty() || p.isEmpty()) |
3192 if (isEmpty() || p.isEmpty()) |
3187 return QPainterPath(); |
3193 return QPainterPath(); |
3194 |
3200 |
3195 Returns a path which is \a p's fill area subtracted from this path's fill area. |
3201 Returns a path which is \a p's fill area subtracted from this path's fill area. |
3196 |
3202 |
3197 Set operations on paths will treat the paths as areas. Non-closed |
3203 Set operations on paths will treat the paths as areas. Non-closed |
3198 paths will be treated as implicitly closed. |
3204 paths will be treated as implicitly closed. |
3199 |
3205 Bezier curves may be flattened to line segments due to numerical instability of |
|
3206 doing bezier curve intersections. |
3200 */ |
3207 */ |
3201 QPainterPath QPainterPath::subtracted(const QPainterPath &p) const |
3208 QPainterPath QPainterPath::subtracted(const QPainterPath &p) const |
3202 { |
3209 { |
3203 if (isEmpty() || p.isEmpty()) |
3210 if (isEmpty() || p.isEmpty()) |
3204 return *this; |
3211 return *this; |
3223 \since 4.4 |
3230 \since 4.4 |
3224 |
3231 |
3225 Returns a simplified version of this path. This implies merging all subpaths that intersect, |
3232 Returns a simplified version of this path. This implies merging all subpaths that intersect, |
3226 and returning a path containing no intersecting edges. Consecutive parallel lines will also |
3233 and returning a path containing no intersecting edges. Consecutive parallel lines will also |
3227 be merged. The simplified path will always use the default fill rule, Qt::OddEvenFill. |
3234 be merged. The simplified path will always use the default fill rule, Qt::OddEvenFill. |
|
3235 Bezier curves may be flattened to line segments due to numerical instability of |
|
3236 doing bezier curve intersections. |
3228 */ |
3237 */ |
3229 QPainterPath QPainterPath::simplified() const |
3238 QPainterPath QPainterPath::simplified() const |
3230 { |
3239 { |
3231 if(isEmpty()) |
3240 if(isEmpty()) |
3232 return *this; |
3241 return *this; |