// qpen.sip generated by MetaSIP on Fri Sep 28 17:07:47 2007 // // This file is part of the QtGui Python extension module. // // Copyright (c) 2007 // Phil Thompson // // This file is part of PyQt. // // This copy of PyQt is free software; you can redistribute it and/or modify it // under the terms of the GNU General Public License version 2 as published by // the Free Software Foundation and appearing in the file LICENSE included in the // packaging of this file. // // PyQt is supplied in the hope that it will be useful, but WITHOUT ANY // WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS // FOR A PARTICULAR PURPOSE. See the GNU General Public License for more // details. // // You should have received a copy of the GNU General Public License along with // PyQt; see the file LICENSE. If not, write to the Free Software Foundation, // Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. %ModuleCode #include %End class QPen { %TypeHeaderCode #include %End %ConvertToTypeCode // SIP doesn't support automatic type convertors so we explicitly allow a // QColor to be used whenever a QPen is expected. if (sipIsErr == NULL) return (sipCanConvertToInstance(sipPy, sipClass_QPen, SIP_NO_CONVERTORS) || sipCanConvertToInstance(sipPy, sipClass_QColor, 0)); if (sipCanConvertToInstance(sipPy, sipClass_QPen, SIP_NO_CONVERTORS)) { *sipCppPtr = reinterpret_cast(sipConvertToInstance(sipPy, sipClass_QPen, sipTransferObj, SIP_NO_CONVERTORS, 0, sipIsErr)); return 0; } int state; QColor *c = reinterpret_cast(sipConvertToInstance(sipPy, sipClass_QColor, 0, 0, &state, sipIsErr)); if (*sipIsErr) { sipReleaseInstance(c, sipClass_QColor, state); return 0; } *sipCppPtr = new QPen(*c); sipReleaseInstance(c, sipClass_QColor, state); return sipGetState(sipTransferObj); %End public: QPen(); QPen(Qt::PenStyle); QPen(const QColor &color); QPen(const QBrush &brush, qreal width, Qt::PenStyle s = Qt::SolidLine, Qt::PenCapStyle c = Qt::SquareCap, Qt::PenJoinStyle j = Qt::BevelJoin); QPen(const QPen &pen); QPen(const QVariant &variant) /NoDerived/; %MethodCode sipCpp = new QPen(qVariantValue(*a0)); %End ~QPen(); Qt::PenStyle style() const; void setStyle(Qt::PenStyle); qreal widthF() const; void setWidthF(qreal width); int width() const; void setWidth(int width); QColor color() const; void setColor(const QColor &color); QBrush brush() const; void setBrush(const QBrush &brush); bool isSolid() const; Qt::PenCapStyle capStyle() const; void setCapStyle(Qt::PenCapStyle pcs); Qt::PenJoinStyle joinStyle() const; void setJoinStyle(Qt::PenJoinStyle pcs); QVector dashPattern() const; void setDashPattern(const QVector &pattern); qreal miterLimit() const; void setMiterLimit(qreal limit); bool operator==(const QPen &p) const; bool operator!=(const QPen &p) const; operator QVariant() const; %If (Qt_4_3_0 -) qreal dashOffset() const; %End %If (Qt_4_3_0 -) void setDashOffset(qreal doffset); %End %If (Qt_4_3_0 -) bool isCosmetic() const; %End %If (Qt_4_3_0 -) void setCosmetic(bool cosmetic); %End }; QDataStream &operator<<(QDataStream &, const QPen & /Constrained/); QDataStream &operator>>(QDataStream &, QPen & /Constrained/); %If (Qt_4_3_0 -) void qSwap(QPen &value1, QPen &value2); %End