833 |
833 |
834 bool QPen::operator==(const QPen &p) const |
834 bool QPen::operator==(const QPen &p) const |
835 { |
835 { |
836 QPenData *dd = static_cast<QPenData *>(d); |
836 QPenData *dd = static_cast<QPenData *>(d); |
837 QPenData *pdd = static_cast<QPenData *>(p.d); |
837 QPenData *pdd = static_cast<QPenData *>(p.d); |
838 return (p.d == d) || (p.d->style == d->style |
838 return (p.d == d) |
839 && p.d->capStyle == d->capStyle |
839 || (p.d->style == d->style |
840 && p.d->joinStyle == d->joinStyle |
840 && p.d->capStyle == d->capStyle |
841 && p.d->width == d->width |
841 && p.d->joinStyle == d->joinStyle |
842 && pdd->miterLimit == dd->miterLimit |
842 && p.d->width == d->width |
843 && (d->style != Qt::CustomDashLine |
843 && pdd->miterLimit == dd->miterLimit |
844 || (qFuzzyCompare(pdd->dashOffset, dd->dashOffset) && |
844 && (d->style != Qt::CustomDashLine |
845 pdd->dashPattern == dd->dashPattern)) |
845 || (qFuzzyCompare(pdd->dashOffset, dd->dashOffset) && |
846 && p.d->brush == d->brush |
846 pdd->dashPattern == dd->dashPattern)) |
847 && pdd->cosmetic == dd->cosmetic); |
847 && p.d->brush == d->brush |
|
848 && pdd->cosmetic == dd->cosmetic); |
848 } |
849 } |
849 |
850 |
850 |
851 |
851 /*! |
852 /*! |
852 \fn bool QPen::isDetached() |
853 \fn bool QPen::isDetached() |
981 |
982 |
982 #ifndef QT_NO_DEBUG_STREAM |
983 #ifndef QT_NO_DEBUG_STREAM |
983 QDebug operator<<(QDebug dbg, const QPen &p) |
984 QDebug operator<<(QDebug dbg, const QPen &p) |
984 { |
985 { |
985 #ifndef Q_BROKEN_DEBUG_STREAM |
986 #ifndef Q_BROKEN_DEBUG_STREAM |
|
987 const char *PEN_STYLES[] = { |
|
988 "NoPen", |
|
989 "SolidLine", |
|
990 "DashLine", |
|
991 "DotLine", |
|
992 "DashDotLine", |
|
993 "DashDotDotLine", |
|
994 "CustomDashLine" |
|
995 }; |
|
996 |
986 dbg.nospace() << "QPen(" << p.width() << ',' << p.brush() |
997 dbg.nospace() << "QPen(" << p.width() << ',' << p.brush() |
987 << ',' << int(p.style()) << ',' << int(p.capStyle()) |
998 << ',' << PEN_STYLES[p.style()] << ',' << int(p.capStyle()) |
988 << ',' << int(p.joinStyle()) << ',' << p.dashPattern() |
999 << ',' << int(p.joinStyle()) << ',' << p.dashPattern() |
989 << ',' << p.dashOffset() |
1000 << ',' << p.dashOffset() |
990 << ',' << p.miterLimit() << ')'; |
1001 << ',' << p.miterLimit() << ')'; |
991 return dbg.space(); |
1002 return dbg.space(); |
992 #else |
1003 #else |