Go to the
documentation of this file.
00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041
00042 #ifndef QPEN_H
00043 #define QPEN_H
00044
00045 #include <QtGui/qcolor.h>
00046 #include <QtGui/qbrush.h>
00047
00048 QT_BEGIN_HEADER
00049
00050 QT_BEGIN_NAMESPACE
00051
00052 QT_MODULE(Gui)
00053
00054 class QVariant;
00055 class QPenPrivate;
00056 class QBrush;
00057 class QPen;
00058
00059 #ifndef QT_NO_DATASTREAM
00060 Q_GUI_EXPORT QDataStream &operator<<(QDataStream &, const QPen &);
00061 Q_GUI_EXPORT QDataStream &operator>>(QDataStream &, QPen &);
00062 #endif
00063
00064 class Q_GUI_EXPORT QPen
00065 {
00066 public:
00067 QPen();
00068 QPen(Qt::PenStyle);
00069 QPen(const QColor &color);
00070 QPen(const QBrush &brush, qreal width, Qt::PenStyle s = Qt::SolidLine,
00071 Qt::PenCapStyle c = Qt::SquareCap, Qt::PenJoinStyle j = Qt::BevelJoin);
00072 QPen(const QPen &pen);
00073
00074 ~QPen();
00075
00076 QPen &operator=(const QPen &pen);
00077
00078 Qt::PenStyle style() const;
00079 void setStyle(Qt::PenStyle);
00080
00081 QVector<qreal> dashPattern() const;
00082 void setDashPattern(const QVector<qreal> &pattern);
00083
00084 qreal dashOffset() const;
00085 void setDashOffset(qreal doffset);
00086
00087 qreal miterLimit() const;
00088 void setMiterLimit(qreal limit);
00089
00090 qreal widthF() const;
00091 void setWidthF(qreal width);
00092
00093 int width() const;
00094 void setWidth(int width);
00095
00096 QColor color() const;
00097 void setColor(const QColor &color);
00098
00099 QBrush brush() const;
00100 void setBrush(const QBrush &brush);
00101
00102 bool isSolid() const;
00103
00104 Qt::PenCapStyle capStyle() const;
00105 void setCapStyle(Qt::PenCapStyle pcs);
00106
00107 Qt::PenJoinStyle joinStyle() const;
00108 void setJoinStyle(Qt::PenJoinStyle pcs);
00109
00110 bool isCosmetic() const;
00111 void setCosmetic(bool cosmetic);
00112
00113 bool operator==(const QPen &p) const;
00114 inline bool operator!=(const QPen &p) const { return !(operator==(p)); }
00115 operator QVariant() const;
00116
00117 bool isDetached();
00118 private:
00119 friend Q_GUI_EXPORT QDataStream &operator>>(QDataStream &, QPen &);
00120 friend Q_GUI_EXPORT QDataStream &operator<<(QDataStream &, const QPen &);
00121
00122 void detach();
00123 class QPenPrivate *d;
00124
00125 public:
00126 typedef QPenPrivate * DataPtr;
00127 inline DataPtr &data_ptr() { return d; }
00128 };
00129 Q_DECLARE_TYPEINFO(QPen, Q_MOVABLE_TYPE);
00130 Q_DECLARE_SHARED(QPen)
00131
00132 #ifndef QT_NO_DEBUG_STREAM
00133 Q_GUI_EXPORT QDebug operator<<(QDebug, const QPen &);
00134 #endif
00135
00136 QT_END_NAMESPACE
00137
00138 QT_END_HEADER
00139
00140 #endif // QPEN_H