From 246910ba84986d1b77e2cca00eb374124bcaf7cf Mon Sep 17 00:00:00 2001 From: scorpio810 Date: Thu, 20 Mar 2014 11:56:06 +0000 Subject: [PATCH] Basic shapes crossrefitem: update to cosmetic changes git-svn-id: svn+ssh://svn.tuxfamily.org/svnroot/qet/qet/trunk@2939 bfdf4180-ca20-0410-9c96-a3a8aa849046 --- sources/qetgraphicsitem/crossrefitem.cpp | 13 ++++++------- sources/qetgraphicsitem/qetshapeitem.cpp | 7 +------ 2 files changed, 7 insertions(+), 13 deletions(-) diff --git a/sources/qetgraphicsitem/crossrefitem.cpp b/sources/qetgraphicsitem/crossrefitem.cpp index fd7006923..b2f925a7f 100644 --- a/sources/qetgraphicsitem/crossrefitem.cpp +++ b/sources/qetgraphicsitem/crossrefitem.cpp @@ -53,12 +53,8 @@ void CrossRefItem::updateLabel() { //init the painter QPainter qp(&drawing_); QPen pen_; - -#ifdef Q_WS_WIN - pen_.setWidth(1); -#elif Q_WS_MAC - pen_.setWidth(0.5); -#endif + pen_.setWidthF(0.5); + pen_.setCosmetic(true); qp.setPen(pen_); //calcul the size @@ -156,7 +152,9 @@ void CrossRefItem::paint(QPainter *painter, const QStyleOptionGraphicsItem *opti painter->save(); QPen t(Qt::black); t.setStyle(Qt::DashLine); + t.setCosmetic(true); painter -> setPen(t); + painter -> setRenderHint(QPainter::Antialiasing, false); painter->drawRect(boundingRect()); painter->restore(); } @@ -238,7 +236,8 @@ void CrossRefItem::fillCrossRef(QPainter *painter) { else if (state == "NC") NC_list << elmt; } - painter->setFont(QETApp::diagramTextsFont(6)); + painter -> setFont(QETApp::diagramTextsFont(4)); + painter -> setRenderHint(QPainter::Antialiasing, false); //fill the NO QString contact_str; foreach (Element *elmt, NO_list) { diff --git a/sources/qetgraphicsitem/qetshapeitem.cpp b/sources/qetgraphicsitem/qetshapeitem.cpp index 9dac33778..c7d2f04b7 100644 --- a/sources/qetgraphicsitem/qetshapeitem.cpp +++ b/sources/qetgraphicsitem/qetshapeitem.cpp @@ -104,12 +104,7 @@ void QetShapeItem::paint(QPainter *painter, const QStyleOptionGraphicsItem *opti painter -> setRenderHint(QPainter::Antialiasing, false); QRectF rec = boundingRect(); QPen pen(Qt::black); - -#ifdef Q_WS_WIN - pen.setWidth(1); -#elif Q_WS_MAC - pen.setWidth(0.5); -#endif + pen.setWidthF(0.5); if (isSelected()) pen.setColor(Qt::red);