void Pixmap::setPixmap(const QPixmap &pixmap){ this->pixmap = pixmap; prepareGeometryChange(); }
void QAttribute::Repaint() { prepareGeometryChange(); update(boundingRect()); }
void setSizeChanged(const IntSize& newSize) { prepareGeometryChange(); m_size = newSize; }
void ConstraintView::setHeight(double height) { prepareGeometryChange(); m_height = height; }
void Label::setText(const QString& text) { m_textItem->setText(text); prepareGeometryChange(); }
void GraphicsPolyLineItem::setPolyLine(const PolyLine &polyLine) { prepareGeometryChange(); m_polyLine = polyLine; }
void ConstraintView::setDefaultWidth(double width) { prepareGeometryChange(); m_defaultWidth = width; }
void ShaderNodeUI::publicPrepareGeometryChange() { prepareGeometryChange(); }
void ShaderConnectionUI::publicPrepareGeometryChange() { prepareGeometryChange(); }
void SGI_Symbol::updateCacheAndRepaint() noexcept { prepareGeometryChange(); mBoundingRect = QRectF(); mShape = QPainterPath(); mShape.setFillRule(Qt::WindingFill); // cross rect QRectF crossRect(-4, -4, 8, 8); mBoundingRect = mBoundingRect.united(crossRect); mShape.addRect(crossRect); // polygons for (const Polygon& polygon : mLibSymbol.getPolygons()) { // query polygon path and line width QPainterPath polygonPath = polygon.getPath().toQPainterPathPx(); qreal w = polygon.getLineWidth()->toPx() / 2; // update bounding rectangle mBoundingRect = mBoundingRect.united(polygonPath.boundingRect().adjusted(-w, -w, w, w)); // update shape if (polygon.isGrabArea()) { QPainterPathStroker stroker; stroker.setCapStyle(Qt::RoundCap); stroker.setJoinStyle(Qt::RoundJoin); stroker.setWidth(2 * w); // add polygon area mShape = mShape.united(polygonPath); // add stroke area mShape = mShape.united(stroker.createStroke(polygonPath)); } } // circles for (const Circle& circle : mLibSymbol.getCircles()) { // get circle radius, including compensation for the stroke width qreal w = circle.getLineWidth()->toPx() / 2; qreal r = circle.getDiameter()->toPx() / 2 + w; // get the bounding rectangle for the circle QPointF center = circle.getCenter().toPxQPointF(); QRectF boundingRect = QRectF(QPointF(center.x() - r, center.y() - r), QSizeF(r * 2, r * 2)); // update bounding rectangle mBoundingRect = mBoundingRect.united(boundingRect); // update shape if (circle.isGrabArea()) { mShape.addEllipse(circle.getCenter().toPxQPointF(), r, r); } } // texts mCachedTextProperties.clear(); for (const Text& text : mLibSymbol.getTexts()) { // create static text properties CachedTextProperties_t props; // get the text to display props.text = AttributeSubstitutor::substitute(text.getText(), &mSymbol); // calculate font metrics props.fontPixelSize = qCeil(text.getHeight()->toPx()); mFont.setPixelSize(props.fontPixelSize); QFontMetricsF metrics(mFont); props.scaleFactor = text.getHeight()->toPx() / metrics.height(); props.textRect = metrics.boundingRect( QRectF(), text.getAlign().toQtAlign() | Qt::TextDontClip, props.text); QRectF scaledTextRect = QRectF(props.textRect.topLeft() * props.scaleFactor, props.textRect.bottomRight() * props.scaleFactor); // check rotation Angle absAngle = text.getRotation() + mSymbol.getRotation(); absAngle.mapTo180deg(); props.mirrored = mSymbol.getMirrored(); if (!props.mirrored) props.rotate180 = (absAngle <= -Angle::deg90() || absAngle > Angle::deg90()); else props.rotate180 = (absAngle < -Angle::deg90() || absAngle >= Angle::deg90()); // calculate text position scaledTextRect.translate(text.getPosition().toPxQPointF()); // text alignment if (props.rotate180) props.flags = text.getAlign().mirrored().toQtAlign(); else props.flags = text.getAlign().toQtAlign(); // calculate text bounding rect mBoundingRect = mBoundingRect.united(scaledTextRect); props.textRect = QRectF(scaledTextRect.topLeft() / props.scaleFactor, scaledTextRect.bottomRight() / props.scaleFactor); if (props.rotate180) { props.textRect = QRectF(-props.textRect.x(), -props.textRect.y(), -props.textRect.width(), -props.textRect.height()) .normalized(); } // save properties mCachedTextProperties.insert(&text, props); } update(); }
void PolyQtAnnotation::finish() { prepareGeometryChange(); _closed = true; onCoordinatesChanged(); }
// setting functions void Node::setText(const QString &new_text) { prepareGeometryChange(); // for resize event to be raised text = new_text; update(); }
void FootprintPreviewGraphicsItem::updateCacheAndRepaint() noexcept { prepareGeometryChange(); mBoundingRect = QRectF(); mShape = QPainterPath(); mShape.setFillRule(Qt::WindingFill); // cross rect QRectF crossRect(-4, -4, 8, 8); mBoundingRect = mBoundingRect.united(crossRect); mShape.addRect(crossRect); // polygons for (int i = 0; i < mFootprint.getPolygonCount(); i++) { const Polygon* polygon = mFootprint.getPolygon(i); Q_ASSERT(polygon); if (!polygon) continue; QPainterPath polygonPath = polygon->toQPainterPathPx(); qreal w = polygon->getLineWidth().toPx() / 2; mBoundingRect = mBoundingRect.united(polygonPath.boundingRect().adjusted(-w, -w, w, w)); if (polygon->isGrabArea()) mShape = mShape.united(polygonPath); } // texts mCachedTextProperties.clear(); for (int i = 0; i < mFootprint.getTextCount(); i++) { const Text* text = mFootprint.getText(i); Q_ASSERT(text); if (!text) continue; // create static text properties CachedTextProperties_t props; // get the text to display props.text = text->getText(); replaceVariablesWithAttributes(props.text, false); // calculate font metrics mFont.setPointSizeF(text->getHeight().toPx()); QFontMetricsF metrics(mFont); props.fontSize = text->getHeight().toPx()*0.8*text->getHeight().toPx()/metrics.height(); mFont.setPointSizeF(props.fontSize); metrics = QFontMetricsF(mFont); props.textRect = metrics.boundingRect(QRectF(), text->getAlign().toQtAlign() | Qt::TextDontClip, props.text); // check rotation Angle absAngle = text->getRotation() + Angle::fromDeg(rotation()); absAngle.mapTo180deg(); props.rotate180 = (absAngle <= -Angle::deg90() || absAngle > Angle::deg90()); // calculate text position qreal dx, dy; if (text->getAlign().getV() == VAlign::top()) dy = text->getPosition().toPxQPointF().y()-props.textRect.top(); else if (text->getAlign().getV() == VAlign::bottom()) dy = text->getPosition().toPxQPointF().y()-props.textRect.bottom(); else dy = text->getPosition().toPxQPointF().y()-(props.textRect.top()+props.textRect.bottom())/2; if (text->getAlign().getH() == HAlign::left()) dx = text->getPosition().toPxQPointF().x()-props.textRect.left(); else if (text->getAlign().getH() == HAlign::right()) dx = text->getPosition().toPxQPointF().x()-props.textRect.right(); else dx = text->getPosition().toPxQPointF().x()-(props.textRect.left()+props.textRect.right())/2; // text alignment if (props.rotate180) { props.align = 0; if (text->getAlign().getV() == VAlign::top()) props.align |= Qt::AlignBottom; if (text->getAlign().getV() == VAlign::center()) props.align |= Qt::AlignVCenter; if (text->getAlign().getV() == VAlign::bottom()) props.align |= Qt::AlignTop; if (text->getAlign().getH() == HAlign::left()) props.align |= Qt::AlignRight; if (text->getAlign().getH() == HAlign::center()) props.align |= Qt::AlignHCenter; if (text->getAlign().getH() == HAlign::right()) props.align |= Qt::AlignLeft; } else props.align = text->getAlign().toQtAlign(); // calculate text bounding rect props.textRect = props.textRect.translated(dx, dy).normalized(); mBoundingRect = mBoundingRect.united(props.textRect); if (props.rotate180) { props.textRect = QRectF(-props.textRect.x(), -props.textRect.y(), -props.textRect.width(), -props.textRect.height()).normalized(); } // save properties mCachedTextProperties.insert(text, props); } update(); }
void AbstractScrollArea::scrollContentsBy(qreal dx, qreal dy) { Q_UNUSED(dx) Q_UNUSED(dy) prepareGeometryChange(); }
void StickMan::childPositionChanged() { prepareGeometryChange(); }
void OverlayUser::updateLayout() { QPixmap pm; if (scene()) uiSize = iroundf(scene()->sceneRect().height() + 0.5); prepareGeometryChange(); for (int i=0;i<4;++i) qgpiName[i]->setPixmap(pm); qgpiAvatar->setPixmap(pm); qgpiChannel->setPixmap(pm); { QImageReader qir(QLatin1String("skin:muted_self.svg")); QSize sz = qir.size(); sz.scale(SCALESIZE(MutedDeafened), Qt::KeepAspectRatio); qir.setScaledSize(sz); qgpiMuted->setPixmap(QPixmap::fromImage(qir.read())); } { QImageReader qir(QLatin1String("skin:deafened_self.svg")); QSize sz = qir.size(); sz.scale(SCALESIZE(MutedDeafened), Qt::KeepAspectRatio); qir.setScaledSize(sz); qgpiDeafened->setPixmap(QPixmap::fromImage(qir.read())); } qgpiMuted->setPos(alignedPosition(scaledRect(os->qrfMutedDeafened, uiSize * os->fZoom), qgpiMuted->boundingRect(), os->qaMutedDeafened)); qgpiMuted->setZValue(1.0f); qgpiMuted->setOpacity(os->fMutedDeafened); qgpiDeafened->setPos(alignedPosition(scaledRect(os->qrfMutedDeafened, uiSize * os->fZoom), qgpiDeafened->boundingRect(), os->qaMutedDeafened)); qgpiDeafened->setZValue(1.0f); qgpiDeafened->setOpacity(os->fMutedDeafened); qgpiAvatar->setPos(0.0f, 0.0f); qgpiAvatar->setOpacity(os->fAvatar); for (int i=0;i<4;++i) { qgpiName[i]->setPos(0.0f, 0.0f); qgpiName[i]->setZValue(2.0f); qgpiName[i]->setOpacity(os->fUserName); } qgpiChannel->setPos(0.0f, 0.0f); qgpiChannel->setZValue(3.0f); qgpiChannel->setOpacity(os->fChannel); QRectF childrenBounds = os->qrfAvatar | os->qrfChannel | os->qrfMutedDeafened | os->qrfUserName; bool haspen = (os->qcBoxPen != os->qcBoxFill) && (! qFuzzyCompare(os->qcBoxPen.alphaF(), static_cast<qreal>(0.0f))); qreal pw = haspen ? qMax<qreal>(1.0f, os->fBoxPenWidth * uiSize * os->fZoom) : 0.0f; qreal pad = os->fBoxPad * uiSize * os->fZoom; QPainterPath pp; pp.addRoundedRect(childrenBounds.x() * uiSize * os->fZoom + -pw / 2.0f - pad, childrenBounds.y() * uiSize * os->fZoom + -pw / 2.0f - pad, childrenBounds.width() * uiSize * os->fZoom + pw + 2.0f * pad, childrenBounds.height() * uiSize * os->fZoom + pw + 2.0f * pad, 2.0f * pw, 2.0f * pw); qgpiBox->setPath(pp); qgpiBox->setPos(0.0f, 0.0f); qgpiBox->setZValue(-1.0f); qgpiBox->setPen(haspen ? QPen(os->qcBoxPen, pw) : Qt::NoPen); qgpiBox->setBrush(qFuzzyCompare(os->qcBoxFill.alphaF(), static_cast<qreal>(0.0f)) ? Qt::NoBrush : os->qcBoxFill); qgpiBox->setOpacity(1.0f); if (! cuUser) { switch (tsColor) { case Settings::Passive: qsName = Overlay::tr("Silent"); break; case Settings::Talking: qsName = Overlay::tr("Talking"); break; case Settings::Whispering: qsName = Overlay::tr("Whisper"); break; case Settings::Shouting: qsName = Overlay::tr("Shout"); break; } } }
void GraphicEventItem::change(){ prepareGeometryChange(); }
void BlackEdgeTextItem::setSkip(int skip){ this->skip = skip; prepareGeometryChange(); Config.setValue("CardEditor/" + objectName() + "Skip", skip); }
void HandZone::updateOrientation() { prepareGeometryChange(); reorganizeCards(); }
void BlackEdgeTextItem::setText(const QString &text){ this->text = text; prepareGeometryChange(); Config.setValue("CardEditor/" + objectName() + "Text", text); }
void ConstraintView::setMinWidth(double min) { prepareGeometryChange(); m_minWidth = min; }
void BlackEdgeTextItem::setFont(const QFont &font){ this->font = font; prepareGeometryChange(); Config.setValue("CardEditor/" + objectName() + "Font", font); }
void DhQGraphicsItemGroup::DvhprepareGeometryChange() { return prepareGeometryChange(); }
//! //! Updates the path end points according to the positions of start and end //! nodes. //! void ConnectionGraphicsItem::updatePath () { prepareGeometryChange(); // calculate positions of the end points QPointF startPoint = m_startPoint; QPointF endPoint = m_endPoint; if (m_startNodeItem) startPoint += m_startNodeItem->pos(); if (m_endNodeItem) endPoint += m_endNodeItem->pos(); // calculate the rectangles to help calculating the positions of the node's anchor points const qreal offset = 10; QRectF baseAnchorRect = QRectF(-offset, -offset, 2 * offset, 2 * offset); QRectF startAnchorRect = baseAnchorRect.translated(startPoint); QRectF endAnchorRect = baseAnchorRect.translated(endPoint); if (m_startNodeItem) startAnchorRect = m_startNodeItem->rect().adjusted(-offset, -offset, offset, offset).translated(m_startNodeItem->pos()); if (m_endNodeItem) endAnchorRect = m_endNodeItem->rect().adjusted(-offset, -offset, offset, offset).translated(m_endNodeItem->pos()); // // Diagram of anchor points for start and end nodes: // // x x sU2, sU1 eU1, eU2 x x // ,----, ,----, // | | | | // | | | | // | x| x sP, sO eO, eP x |x | // '----' '----' // x x sL2, sL1 eL1, eL2 x x // QPointF sP = startPoint; QPointF sO = QPointF(startAnchorRect.right(), startPoint.y()); QPointF sU1 = startAnchorRect.topRight(); QPointF sU2 = startAnchorRect.topLeft(); QPointF sL1 = startAnchorRect.bottomRight(); QPointF sL2 = startAnchorRect.bottomLeft(); QPointF eP = endPoint; QPointF eO = QPointF(endAnchorRect.left(), endPoint.y()); QPointF eU1 = endAnchorRect.topLeft(); QPointF eU2 = endAnchorRect.topRight(); QPointF eL1 = endAnchorRect.bottomLeft(); QPointF eL2 = endAnchorRect.bottomRight(); // declare path segments QList<QPointF> startPoints; QPainterPath cubicPath; QList<QPointF> endPoints; // construct the path segments if (eO.x() < sO.x() && eU2.x() > sL2.x() && eU2.y() < sL2.y() && eL2.y() > sU2.y()) { //> case 1V: elements very close to each other startPoints << sP << sO; QPointF offsetVector = QPointF(0, 0.75 * (eO.y() - sO.y())); cubicPath.moveTo(sO); cubicPath.cubicTo(sO + offsetVector, eO - offsetVector, eO); endPoints << eO << eP; } else if (eO.x() >= sO.x()) { //> case 1H: end node is right of start node startPoints << sP << sO; QPointF offsetVector = QPointF(0.75 * (eO.x() - sO.x()), 0); cubicPath.moveTo(sO); cubicPath.cubicTo(sO + offsetVector, eO - offsetVector, eO); endPoints << eO << eP; } else if (eU1.y() >= sL1.y()) { //> case 2LV startPoints << sP << sO << sL1; QPointF offsetVector = QPointF(0, 0.75 * (eU1.y() - sL1.y())); cubicPath.moveTo(sL1); cubicPath.cubicTo(sL1 + offsetVector, eU1 - offsetVector, eU1); endPoints << eU1 << eO << eP; } else if (eL1.y() <= sU1.y()) { //> case 2UV startPoints << sP << sO << sU1; QPointF offsetVector = QPointF(0, 0.75 * (eL1.y() - sU1.y())); cubicPath.moveTo(sU1); cubicPath.cubicTo(sU1 + offsetVector, eL1 - offsetVector, eL1); endPoints << eL1 << eO << eP; } else if (eP.y() >= sP.y()) { //> case 3L startPoints << sP << sO << sL1 << sL2; QPointF offsetVector = QPointF(0.75 * (eU2.x() - sL2.x()), 0); cubicPath.moveTo(sL2); cubicPath.cubicTo(sL2 + offsetVector, eU2 - offsetVector, eU2); endPoints << eU2 << eU1 << eO << eP; } else { //> case 3U startPoints << sP << sO << sU1 << sU2; QPointF offsetVector = QPointF(0.75 * (eL2.x() - sU2.x()), 0); cubicPath.moveTo(sU2); cubicPath.cubicTo(sU2 + offsetVector, eL2 - offsetVector, eL2); endPoints << eL2 << eL1 << eO << eP; } // build the main path from the path segments m_mainPath = QPainterPath(); for (int i = 0; i < startPoints.size(); ++i) if (i == 0) m_mainPath.moveTo(startPoints[0]); else m_mainPath.lineTo(startPoints[i]); m_mainPath.addPath(cubicPath); for (int i = 0; i < endPoints.size(); ++i) if (i == 0) m_mainPath.moveTo(endPoints[0]); else m_mainPath.lineTo(endPoints[i]); // create the shadow path as a copy of the main path m_shadowPath = QPainterPath(m_mainPath); // move the path elements of the shadow path one pixel down and to the right for (int i = 1; i < m_shadowPath.elementCount(); ++i) { QPainterPath::Element element = m_shadowPath.elementAt(i); m_shadowPath.setElementPositionAt(i, element.x + 1, element.y + 1); } // get the center point for the arrow and the angle at that point static const qreal t = 0.5; QPointF arrowPoint = cubicPath.pointAtPercent(t); qreal angle = cubicPath.angleAtPercent(t) * Pi / 180; // calculate the polygon for the arrow head qreal pathLengthFraction = m_mainPath.length() / 10; static const qreal maxArrowSize = 10; qreal arrowSize = pathLengthFraction < maxArrowSize ? pathLengthFraction : maxArrowSize; QPointF arrowPoint1 = arrowPoint - QPointF(arrowSize * sin(angle - Pi / 2), arrowSize * cos(angle - Pi / 2)); QPointF arrowPoint2 = arrowPoint - QPointF(arrowSize * sin(angle + Pi / 3), arrowSize * cos(angle + Pi / 3)); QPointF arrowPoint3 = arrowPoint - QPointF(arrowSize * sin(angle + Pi - Pi / 3), arrowSize * cos(angle + Pi - Pi / 3)); m_arrowHeadPolygon.clear(); m_arrowHeadPolygon << arrowPoint1 << arrowPoint2 << arrowPoint3; // repaint the graphics item update(); }
void MeasureGraphicsItem::setRect(const QRectF& rect) { prepareGeometryChange(); m_rect = rect; update(); }
void PlayerCardBox::chooseCard(const QString &reason, const ClientPlayer *player, const QString &flags, bool handcardVisible, Card::HandlingMethod method, const QList<int> &disabledIds) { nameRects.clear(); rowCount = 0; intervalsBetweenAreas = -1; intervalsBetweenRows = 0; maxCardsInOneRow = 0; this->player = player; this->title = tr("%1: please choose %2's card").arg(reason).arg(ClientInstance->getPlayerName(player->objectName())); this->flags = flags; bool handcard = false; bool equip = false; bool judging = false; if (flags.contains(handcardFlag) && !player->isKongcheng()) { updateNumbers(player->getHandcardNum()); handcard = true; } if (flags.contains(equipmentFlag) && player->hasEquip()) { updateNumbers(player->getEquips().length()); equip = true; } if (flags.contains(judgingFlag) && !player->getJudgingArea().isEmpty()) { updateNumbers(player->getJudgingArea().length()); judging = true; } int max = maxCardsInOneRow; int maxNumber = maxCardNumberInOneRow; maxCardsInOneRow = qMin(max, maxNumber); prepareGeometryChange(); moveToCenter(); show(); this->handcardVisible = handcardVisible; this->method = method; this->disabledIds = disabledIds; const int startX = verticalBlankWidth + placeNameAreaWidth + intervalBetweenNameAndCard; int index = 0; if (handcard) { if (Self == player || handcardVisible) { arrangeCards(player->getHandcards(), QPoint(startX, nameRects.at(index).y())); } else { const int handcardNumber = player->getHandcardNum(); CardList cards; for(int i = 0; i < handcardNumber; ++ i) cards << NULL; arrangeCards(cards, QPoint(startX, nameRects.at(index).y())); } ++ index; } if (equip) { arrangeCards(player->getEquips(), QPoint(startX, nameRects.at(index).y())); ++ index; } if (judging) arrangeCards(player->getJudgingArea(), QPoint(startX, nameRects.at(index).y())); if (ServerInfo.OperationTimeout != 0) { if (!progressBar) { progressBar = new QSanCommandProgressBar(); progressBar->setMaximumWidth(qMin(boundingRect().width() - 16, (qreal) 150)); progressBar->setMaximumHeight(12); progressBar->setTimerEnabled(true); progressBarItem = new QGraphicsProxyWidget(this); progressBarItem->setWidget(progressBar); progressBarItem->setPos(boundingRect().center().x() - progressBarItem->boundingRect().width() / 2, boundingRect().height() - 20); connect(progressBar, SIGNAL(timedOut()), this, SLOT(reply())); } progressBar->setCountdown(QSanProtocol::S_COMMAND_CHOOSE_CARD); progressBar->show(); } }
void EventKnownItem::setEvent(const QJsonObject& event, const QJsonObject& settings) { prepareGeometryChange(); mData = event; // ---------------------------------------------- // Update item position and selection // ---------------------------------------------- setSelected(mData[STATE_IS_SELECTED].toBool()); setPos(mData[STATE_ITEM_X].toDouble(), mData[STATE_ITEM_Y].toDouble()); // ---------------------------------------------- // Check if item should be greyed out // ---------------------------------------------- //updateGreyedOut(); // ---------------------------------------------- // Recreate thumb // ---------------------------------------------- double tmin = settings[STATE_SETTINGS_TMIN].toDouble(); double tmax = settings[STATE_SETTINGS_TMAX].toDouble(); double step = settings[STATE_SETTINGS_STEP].toDouble(); EventKnown bound = EventKnown::fromJson(event); bound.updateValues(tmin, tmax, step); /*QRectF rect = boundingRect(); double side = 40.f; double top = 25.f; QRectF thumbRect(rect.x() + side, rect.y() + top + mEltsMargin + mTitleHeight, rect.width() - 2*side, mThumbH);*/ GraphView* graph = new GraphView(); //graph->setFixedSize(thumbRect.width(), thumbRect.height()); graph->setFixedSize(200, 50); graph->setMargins(0, 0, 0, 0); graph->setRangeX(tmin, tmax); graph->setCurrentX(tmin, tmax); graph->setRangeY(0, 1.1f); graph->showXAxisArrow(false); graph->showXAxisTicks(false); graph->showXAxisSubTicks(false); graph->showXAxisValues(false); graph->showYAxisArrow(false); graph->showYAxisTicks(false); graph->showYAxisSubTicks(false); graph->showYAxisValues(false); graph->setXAxisMode(GraphView::eHidden); graph->setYAxisMode(GraphView::eHidden); GraphCurve curve; curve.mData = normalize_map(bound.mValues); curve.mName = "Bound"; curve.mPen = QPen(Painting::mainColorLight, 2.f); curve.mBrush = Painting::mainColorLight; curve.mIsRectFromZero = true; curve.mIsHisto = (bound.knownType() == EventKnown::eUniform); graph->addCurve(curve); graph->setFormatFunctX(DateUtils::convertToAppSettingsFormatStr); graph->mLegendX = DateUtils::getAppSettingsFormat(); mThumb = QPixmap(graph->size()); graph->render(&mThumb); delete graph; // ---------------------------------------------- // Repaint based on mEvent // ---------------------------------------------- update(); }
void QSanSelectableItem::setPixmap(const QPixmap &pixmap) { _m_mainPixmap = pixmap; prepareGeometryChange(); }
void MarkerLineItem::sceneRectChanged(const QRectF &rect) { prepareGeometryChange(); _boundingRect.setWidth(rect.width()); }
void DeckViewCardContainer::setWidth(qreal _width) { prepareGeometryChange(); width = _width; update(); }