Embellishment::Embellishment( const PitchList *pitchList, const QPen *pen ) :MelodySymbol(pitchList, pen) { m_pitchList = pitchList; m_pen = pen; m_preceedPitch = 0; m_followPitch = 0; m_alternative = Embellishment::Regular; m_embellishTop = m_pitchList->baseLine()-m_pitchList->lineHeight()*2.5; m_graceHeight = pitchList->lineHeight() * 0.5; m_contextMenuActions = new QList<QAction *>; m_svgRenderer = new QSvgRenderer(QString(":/mainwindow/images/melody_notes_and_flags.svg"), this); QString item("melody_fill"); m_graceRect = getBoundsForId(item, 0.0, m_graceHeight ); item = "melody_fill_line"; m_graceWithLineRect = getBoundsForId(item, 0.0, m_graceHeight); item = "flag3_up"; m_flagRect = getBoundsForId(item, m_graceRect.width()*0.8); m_graceWidth = m_graceRect.width(); m_graceSpace = m_graceWidth / 4; m_spaceForLine = m_graceWithLineRect.width() - m_graceRect.width(); m_neighborsOk = false; updateBoundingRect(); /*! @todo Caching is done by every Item itself. Use QPixmapCache. */ setCacheMode(QGraphicsItem::DeviceCoordinateCache); setFlags( QGraphicsItem::ItemIsFocusable | QGraphicsItem::ItemIsSelectable); }
void MirrorGraphicsEffect::setReflectionOffset(float value) { if(_reflectionOffset != value){ _reflectionOffset = value; updateBoundingRect(); // we have to call this function to inform everybody who interested that boundings of control has changed } }
/*! Store a path command in the command list \sa QPaintEngine::drawPath() */ void QwtGraphic::drawPath( const QPainterPath &path ) { const QPainter *painter = paintEngine()->painter(); if ( painter == NULL ) return; d_data->commands += QwtPainterCommand( path ); if ( !path.isEmpty() ) { const QPainterPath scaledPath = painter->transform().map( path ); QRectF pointRect = scaledPath.boundingRect(); QRectF boundingRect = pointRect; if ( painter->pen().style() != Qt::NoPen && painter->pen().brush().style() != Qt::NoBrush ) { boundingRect = qwtStrokedPathRect( painter, path ); } updateControlPointRect( pointRect ); updateBoundingRect( boundingRect ); d_data->pathInfos += PathInfo( pointRect, boundingRect, qwtHasScalablePen( painter ) ); } }
void QgsAnnotationItem::setFrameSize( QSizeF size ) { QSizeF frameSize = minimumFrameSize().expandedTo( size ); //don't allow frame sizes below minimum mFrameSize = frameSize; updateBoundingRect(); updateBalloon(); }
void BrushItem::setTileRegion(const QRegion ®ion) { if (mTileRegion == region) return; mTileRegion = region; updateBoundingRect(); }
void QgsComposerShape::setSceneRect( const QRectF& rectangle ) { // Reimplemented from QgsComposerItem as we need to call updateBoundingRect after the shape's size changes QgsComposerItem::setSceneRect( rectangle ); updateBoundingRect(); update(); }
void VlcQmlVideoObject::paint(QPainter *painter) { lock(); if( _frame.inited ) { if (!_graphicsPainter) _graphicsPainter = new GlslPainter; Q_ASSERT(_graphicsPainter); if (!_gotSize || _frameSize.isNull()) { // TODO: do scaling ourselfs? _gotSize = true; _frameSize = QSize(_frame.width, _frame.height); updateBoundingRect(); } if (!_paintedOnce) { painter->fillRect(_boundingRect, Qt::black); _paintedOnce = true; } else { Q_ASSERT(_graphicsPainter); _graphicsPainter->setFrame(&_frame); if (!_graphicsPainter->inited()) _graphicsPainter->init(); _graphicsPainter->paint(painter, _boundingRect, this); } } unlock(); }
void ImageMarker::setRect(int x, int y, int w, int h) { if (d_pos == QPoint(x, y) && d_size == QSize(w, h)) return; d_pos = QPoint(x, y); d_size = QSize(w, h); updateBoundingRect(); }
void QgsMapCanvasAnnotationItem::updatePosition() { if ( !mAnnotation ) return; if ( mAnnotation->hasFixedMapPosition() ) { QgsCoordinateTransform t( mAnnotation->mapPositionCrs(), mMapCanvas->mapSettings().destinationCrs(), QgsProject::instance() ); QgsPointXY coord = mAnnotation->mapPosition(); try { coord = t.transform( coord ); } catch ( QgsCsException & ) {} setPos( toCanvasCoordinates( coord ) ); } else { //relative position double x = mAnnotation->relativePosition().x() * mMapCanvas->width(); double y = mAnnotation->relativePosition().y() * mMapCanvas->height(); setPos( x, y ); } updateBoundingRect(); }
void QgsLayoutItemGroup::resetBoundingRect() { mBoundingRectangle = QRectF(); for ( QgsLayoutItem *item : qgis::as_const( mItems ) ) { updateBoundingRect( item ); } }
void VlcQmlVideoObject::geometryChanged(const QRectF &newGeometry, const QRectF &oldGeometry) { _geometry = newGeometry; updateBoundingRect(); QQuickPaintedItem::geometryChanged(newGeometry, oldGeometry); }
void QgsComposerShape::refreshSymbol() { mMaxSymbolBleed = QgsSymbolLayerUtils::estimateMaxSymbolBleed( mShapeStyleSymbol ); updateBoundingRect(); update(); emit frameChanged(); }
void ScaleItem::setZoom(int z) { prepareGeometryChange(); _zoom = z; computeScale(); updateBoundingRect(); update(); }
void ScaleItem::setUnits(enum Units units) { prepareGeometryChange(); _units = units; computeScale(); updateBoundingRect(); update(); }
void ScaleItem::setZoom(int z, qreal lat) { prepareGeometryChange(); _zoom = z; _lat = lat; computeScale(); updateBoundingRect(); update(); }
void BrushItem::setMapEditor(MapEditor *editor) { if (mMapEditor == editor) return; mMapEditor = editor; setTilelayer(0); updateBoundingRect(); }
void SliderInfoItem::setSide(Side side) { if (side == _side) return; prepareGeometryChange(); _side = side; updateBoundingRect(); }
void QGraphicsDropShadowEffect::setBlurRadius(qreal blurRadius) { Q_D(QGraphicsDropShadowEffect); if (qFuzzyCompare(d->filter->blurRadius(), blurRadius)) return; d->filter->setBlurRadius(blurRadius); updateBoundingRect(); emit blurRadiusChanged(blurRadius); }
void QGraphicsBlurEffect::setBlurRadius(qreal radius) { Q_D(QGraphicsBlurEffect); if (qFuzzyCompare(d->filter->radius(), radius)) return; d->filter->setRadius(radius); updateBoundingRect(); emit blurRadiusChanged(radius); }
void QgsComposerShape::refreshSymbol() { QgsRenderContext rc = QgsComposerUtils::createRenderContextForMap( mComposition->referenceMap(), nullptr, mComposition->printResolution() ); mMaxSymbolBleed = ( 25.4 / mComposition->printResolution() ) * QgsSymbolLayerUtils::estimateMaxSymbolBleed( mShapeStyleSymbol, rc ); updateBoundingRect(); update(); emit frameChanged(); }
void ShadowEffect::setBlurRadius(qreal value) { if (qFuzzyCompare(m_blurRadius, value)) { return; } m_blurRadius = value; m_shadow = QImage(); updateBoundingRect(); blurRadiusChanged(m_blurRadius); }
void ShadowEffect::setYOffset(qreal value) { if (qFuzzyCompare(m_yOffset, value)) { return; } m_yOffset = value; m_shadow = QImage(); updateBoundingRect(); yOffsetChanged(m_yOffset); }
void QGraphicsDropShadowEffect::setOffset(const QPointF &offset) { Q_D(QGraphicsDropShadowEffect); if (d->filter->offset() == offset) return; d->filter->setOffset(offset); updateBoundingRect(); emit offsetChanged(offset); }
void QgsComposerShape::setSceneRect( const QRectF& rectangle ) { // Reimplemented from QgsComposerItem as we need to call updateBoundingRect after the shape's size changes //update rect for data defined size and position QRectF evaluatedRect = evalItemRect( rectangle ); QgsComposerItem::setSceneRect( evaluatedRect ); updateBoundingRect(); update(); }
void ImageMarker::setOrigin(const QPoint &p) { d_pos = p; if (!plot()) return; setXValue(plot()->invTransform(xAxis(), p.x())); setYValue(plot()->invTransform(yAxis(), p.y())); d_size = size(); updateBoundingRect(); }
void QgsLayoutItemShape::refreshSymbol() { if ( layout() ) { QgsRenderContext rc = QgsLayoutUtils::createRenderContextForLayout( layout(), nullptr, layout()->renderContext().dpi() ); mMaxSymbolBleed = ( 25.4 / layout()->renderContext().dpi() ) * QgsSymbolLayerUtils::estimateMaxSymbolBleed( mShapeStyleSymbol.get(), rc ); } updateBoundingRect(); update(); emit frameChanged(); }
void BrushItem::setTilelayerPosition(const QPoint &pos) { if (!mTilelayer) return; const QPoint oldPosition(mTilelayer->x(), mTilelayer->y()); if (oldPosition == pos) return; mTileRegion.translate(pos - oldPosition); mTilelayer->setX(pos.x()); mTilelayer->setY(pos.y()); updateBoundingRect(); }
/*! Store a image command in the command list \sa QPaintEngine::drawPixmap() */ void QwtGraphic::drawPixmap( const QRectF &rect, const QPixmap &pixmap, const QRectF &subRect ) { const QPainter *painter = paintEngine()->painter(); if ( painter == NULL ) return; d_data->commands += QwtPainterCommand( rect, pixmap, subRect ); const QRectF r = painter->transform().mapRect( rect ); updateControlPointRect( r ); updateBoundingRect( r ); }
/*! Store a image command in the command list \sa QPaintEngine::drawImage() */ void QwtGraphic::drawImage( const QRectF &rect, const QImage &image, const QRectF &subRect, Qt::ImageConversionFlags flags) { const QPainter *painter = paintEngine()->painter(); if ( painter == NULL ) return; d_data->commands += QwtPainterCommand( rect, image, subRect, flags ); const QRectF r = painter->transform().mapRect( rect ); updateControlPointRect( r ); updateBoundingRect( r ); }
void BrushItem::setTilelayer(const Tilelayer *tilelayer) { delete mTilelayer; if (tilelayer) { mTilelayer = static_cast<Tilelayer*>(tilelayer->clone()); mTileRegion = mTilelayer->region(); } else { mTilelayer = 0; mTileRegion = QRegion(); } updateBoundingRect(); update(); }