Ignore:
Timestamp:
Feb 11, 2010, 11:19:06 PM (15 years ago)
Author:
Dmitry A. Kuminov
Message:

trunk: Merged in qt 4.6.1 sources.

Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk

  • trunk/src/gui/painting/qpolygon.cpp

    r2 r561  
    22**
    33** 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)
    56**
    67** This file is part of the QtGui module of the Qt Toolkit.
     
    2122** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
    2223**
    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.
    2727**
    2828** GNU General Public License Usage
     
    3434** met: http://www.gnu.org/copyleft/gpl.html.
    3535**
    36 ** If you are unsure which license is appropriate for your use, please
    37 ** 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.
    3838** $QT_END_LICENSE$
    3939**
     
    9292    \reentrant
    9393
    94     \ingroup multimedia
     94    \ingroup painting
    9595    \ingroup shared
    9696
     
    209209/*!
    210210    Translates all points in the polygon by (\a{dx}, \a{dy}).
     211
     212    \sa translated()
    211213*/
    212214
    213215void QPolygon::translate(int dx, int dy)
    214216{
     217    if (dx == 0 && dy == 0)
     218        return;
     219
    215220    register QPoint *p = data();
    216221    register int i = size();
     
    227232
    228233    Translates all points in the polygon by the given \a offset.
    229 */
    230 
     234
     235    \sa translated()
     236*/
     237
     238/*!
     239    Returns a copy of the polygon that is translated by (\a{dx}, \a{dy}).
     240
     241    \since 4.6
     242    \sa translate()
     243*/
     244QPolygon QPolygon::translated(int dx, int dy) const
     245{
     246    QPolygon copy(*this);
     247    copy.translate(dx, dy);
     248    return copy;
     249}
     250
     251/*!
     252    \fn void QPolygon::translated(const QPoint &offset) const
     253    \overload
     254    \since 4.6
     255
     256    Returns a copy of the polygon that is translated by the given \a offset.
     257
     258    \sa translate()
     259*/
    231260
    232261/*!
     
    461490
    462491    \reentrant
    463     \ingroup multimedia
     492    \ingroup painting
    464493    \ingroup shared
    465494
     
    566595/*!
    567596    Translate all points in the polygon by the given \a offset.
     597
     598    \sa translated()
    568599*/
    569600
    570601void QPolygonF::translate(const QPointF &offset)
    571602{
     603    if (offset.isNull())
     604        return;
     605
    572606    register QPointF *p = data();
    573607    register int i = size();
     
    583617
    584618    Translates all points in the polygon by (\a{dx}, \a{dy}).
     619
     620    \sa translated()
     621*/
     622
     623/*!
     624    Returns a copy of the polygon that is translated by the given \a offset.
     625
     626    \since 4.6
     627    \sa translate()
     628*/
     629QPolygonF QPolygonF::translated(const QPointF &offset) const
     630{
     631    QPolygonF copy(*this);
     632    copy.translate(offset);
     633    return copy;
     634}
     635
     636/*!
     637    \fn void QPolygonF::translated(qreal dx, qreal dy) const
     638    \overload
     639    \since 4.6
     640
     641    Returns a copy of the polygon that is translated by (\a{dx}, \a{dy}).
     642
     643    \sa translate()
    585644*/
    586645
     
    684743    return s >> v;
    685744}
    686 #endif
     745#endif // QT_NO_DATASTREAM
    687746
    688747/*****************************************************************************
Note: See TracChangeset for help on using the changeset viewer.