Changeset 561 for trunk/src/gui/painting/qpen.cpp
- Timestamp:
- Feb 11, 2010, 11:19:06 PM (15 years ago)
- Location:
- trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk
-
Property svn:mergeinfo
set to (toggle deleted branches)
/branches/vendor/nokia/qt/4.6.1 merged eligible /branches/vendor/nokia/qt/current merged eligible /branches/vendor/trolltech/qt/current 3-149
-
Property svn:mergeinfo
set to (toggle deleted branches)
-
trunk/src/gui/painting/qpen.cpp
r2 r561 2 2 ** 3 3 ** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). 4 ** Contact: Qt Software Information (qt-info@nokia.com) 4 ** All rights reserved. 5 ** Contact: Nokia Corporation (qt-info@nokia.com) 5 6 ** 6 7 ** This file is part of the QtGui module of the Qt Toolkit. … … 21 22 ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. 22 23 ** 23 ** In addition, as a special exception, Nokia gives you certain 24 ** additional rights. These rights are described in the Nokia Qt LGPL 25 ** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this 26 ** package. 24 ** In addition, as a special exception, Nokia gives you certain additional 25 ** rights. These rights are described in the Nokia Qt LGPL Exception 26 ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. 27 27 ** 28 28 ** GNU General Public License Usage … … 34 34 ** met: http://www.gnu.org/copyleft/gpl.html. 35 35 ** 36 ** If you are unsure which license is appropriate for your use, please37 ** contact the sales department at qt-sales@nokia.com.36 ** If you have questions regarding the use of this file, please contact 37 ** Nokia at qt-info@nokia.com. 38 38 ** $QT_END_LICENSE$ 39 39 ** … … 53 53 /*! 54 54 \class QPen 55 \ingroup multimedia55 \ingroup painting 56 56 \ingroup shared 57 \mainclass 57 58 58 59 59 \brief The QPen class defines how a QPainter should draw lines and outlines … … 412 412 converts the style of the pen to Qt::CustomDashLine. 413 413 414 \note This function resets the dash offset to zero. 415 414 416 \sa style(), {QPen#Pen Style}{Pen Style} 415 417 */ … … 421 423 detach(); 422 424 d->style = s; 423 static_cast<QPenData *>(d)->dashPattern.clear(); 425 QPenData *dd = static_cast<QPenData *>(d); 426 dd->dashPattern.clear(); 427 dd->dashOffset = 0; 424 428 } 425 429 … … 463 467 implicitly converts the style of the pen to Qt::CustomDashLine. 464 468 465 The pattern must be specified as an even number of entries where466 the entries 1, 3, 5... are the dashes and 2, 4, 6... are the469 The pattern must be specified as an even number of positive entries 470 where the entries 1, 3, 5... are the dashes and 2, 4, 6... are the 467 471 spaces. For example: 468 472 … … 539 543 return; 540 544 detach(); 541 static_cast<QPenData *>(d)->dashOffset = offset; 542 d->style = Qt::CustomDashLine; 545 QPenData *dd = static_cast<QPenData *>(d); 546 dd->dashOffset = offset; 547 if (d->style != Qt::CustomDashLine) { 548 dd->dashPattern = dashPattern(); 549 d->style = Qt::CustomDashLine; 550 } 543 551 } 544 552 … … 828 836 QPenData *dd = static_cast<QPenData *>(d); 829 837 QPenData *pdd = static_cast<QPenData *>(p.d); 830 return (p.d == d) || (p.d->style == d->style 831 && p.d->capStyle == d->capStyle 832 && p.d->joinStyle == d->joinStyle 833 && p.d->width == d->width 834 && pdd->miterLimit == dd->miterLimit 835 && (d->style != Qt::CustomDashLine 836 || (qFuzzyCompare(pdd->dashOffset, dd->dashOffset) && 837 pdd->dashPattern == dd->dashPattern)) 838 && p.d->brush == d->brush 839 && pdd->cosmetic == dd->cosmetic); 838 return (p.d == d) 839 || (p.d->style == d->style 840 && p.d->capStyle == d->capStyle 841 && p.d->joinStyle == d->joinStyle 842 && p.d->width == d->width 843 && pdd->miterLimit == dd->miterLimit 844 && (d->style != Qt::CustomDashLine 845 || (qFuzzyCompare(pdd->dashOffset, dd->dashOffset) && 846 pdd->dashPattern == dd->dashPattern)) 847 && p.d->brush == d->brush 848 && pdd->cosmetic == dd->cosmetic); 840 849 } 841 850 … … 976 985 { 977 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 978 997 dbg.nospace() << "QPen(" << p.width() << ',' << p.brush() 979 << ',' << int(p.style())<< ',' << int(p.capStyle())998 << ',' << PEN_STYLES[p.style()] << ',' << int(p.capStyle()) 980 999 << ',' << int(p.joinStyle()) << ',' << p.dashPattern() 981 << ","<< p.dashOffset()1000 << ',' << p.dashOffset() 982 1001 << ',' << p.miterLimit() << ')'; 983 1002 return dbg.space();
Note:
See TracChangeset
for help on using the changeset viewer.