kspread
kspread_pen.cc00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020 #include "kspread_pen.h"
00021
00022 #include <KoTextZoomHandler.h>
00023
00024 KSpreadPen::KSpreadPen()
00025 : QPen()
00026 {
00027 m_pointWidth = 1.0;
00028 }
00029
00030 KSpreadPen::KSpreadPen(const QColor& _color, double _pointWidth, Qt::PenStyle _style)
00031 : QPen()
00032 {
00033 setColor(_color);
00034 setPointWidth(_pointWidth);
00035 setStyle(_style);
00036 }
00037
00038 KSpreadPen::KSpreadPen(const QColor& _color)
00039 : QPen(_color)
00040 {
00041 m_pointWidth = 1.0;
00042 }
00043
00044 KSpreadPen::~KSpreadPen()
00045 {
00046 }
00047
00048 bool KSpreadPen::operator==( const KSpreadPen &p ) const
00049 {
00050 return color() == p.color() && style() == p.style() && m_pointWidth == p.pointWidth();
00051 }
00052
00053 bool KSpreadPen::operator!=( const KSpreadPen &p ) const
00054 {
00055 return color() != p.color() || style() != p.style() || m_pointWidth != p.pointWidth();
00056 }
00057
00058 void KSpreadPen::setPointWidth(double w)
00059 {
00060 m_pointWidth = w;
00061 }
00062
00063 QPen KSpreadPen::zoomedPen(KoZoomHandler* zoomHandler)
00064 {
00065 QPen pen = *this;
00066 pen.setWidth(zoomHandler->zoomItY(m_pointWidth));
00067
00068 return pen;
00069 }
|