Skip to content

Commit

Permalink
Some 馃拝
Browse files Browse the repository at this point in the history
  • Loading branch information
m-kuhn committed Oct 15, 2018
1 parent 09ee755 commit 62b9f60
Showing 1 changed file with 26 additions and 12 deletions.
38 changes: 26 additions & 12 deletions src/app/qgsgeometryvalidationdock.cpp
Expand Up @@ -48,7 +48,7 @@ QgsGeometryValidationDock::QgsGeometryValidationDock( const QString &title, QgsM
mFeatureRubberband->setWidth( scaleFactor ); mFeatureRubberband->setWidth( scaleFactor );
mFeatureRubberband->setStrokeColor( QColor( 100, 255, 100, 100 ) ); mFeatureRubberband->setStrokeColor( QColor( 100, 255, 100, 100 ) );


mErrorRubberband->setColor( QColor( 180, 250, 180, 100 ) ); mErrorRubberband->setColor( QColor( "#ffee58ff" ) );
mErrorRubberband->setWidth( scaleFactor ); mErrorRubberband->setWidth( scaleFactor );


mErrorLocationRubberband->setIcon( QgsRubberBand::ICON_X ); mErrorLocationRubberband->setIcon( QgsRubberBand::ICON_X );
Expand Down Expand Up @@ -193,22 +193,36 @@ void QgsGeometryValidationDock::showHighlight( const QModelIndex &current )


mFeatureRubberband->setToGeometry( featureGeometry ); mFeatureRubberband->setToGeometry( featureGeometry );



QPropertyAnimation *featureAnimation = new QPropertyAnimation( mFeatureRubberband, "fillColor" );
QPropertyAnimation *animation = new QPropertyAnimation( mFeatureRubberband, "fillColor" ); featureAnimation->setEasingCurve( QEasingCurve::OutQuad );
animation->setEasingCurve( QEasingCurve::OutQuad ); connect( featureAnimation, &QPropertyAnimation::finished, featureAnimation, &QPropertyAnimation::deleteLater );
connect( animation, &QPropertyAnimation::finished, animation, &QPropertyAnimation::deleteLater ); connect( featureAnimation, &QPropertyAnimation::valueChanged, this, [this]
connect( animation, &QPropertyAnimation::valueChanged, this, [this]
{ {
mFeatureRubberband->update(); mFeatureRubberband->update();
} ); } );


animation->setDuration( 2000 ); featureAnimation->setDuration( 2000 );
animation->setStartValue( QColor( 100, 255, 100, 255 ) ); featureAnimation->setStartValue( QColor( 100, 255, 100, 255 ) );
animation->setEndValue( QColor( 100, 255, 100, 0 ) ); featureAnimation->setEndValue( QColor( 100, 255, 100, 0 ) );

featureAnimation->start();

mErrorRubberband->setToGeometry( errorGeometry );

QPropertyAnimation *errorAnimation = new QPropertyAnimation( mErrorRubberband, "fillColor" );
errorAnimation->setEasingCurve( QEasingCurve::OutQuad );
connect( errorAnimation, &QPropertyAnimation::finished, featureAnimation, &QPropertyAnimation::deleteLater );
connect( errorAnimation, &QPropertyAnimation::valueChanged, this, [this]
{
mErrorRubberband->update();
} );

errorAnimation->setStartValue( QColor( "#ffee58ff" ) );
errorAnimation->setEndValue( QColor( "#ffee5800" ) );


animation->start(); errorAnimation->setDuration( 2000 );
errorAnimation->start();


// mErrorRubberband->setToGeometry( errorGeometry ); mErrorLocationRubberband->setToGeometry( QgsGeometry( qgis::make_unique<QgsPoint>( locationGeometry ) ) );
mErrorLocationRubberband->setToGeometry( QgsGeometry( new QgsPoint( locationGeometry ) ) );
} }
} }

0 comments on commit 62b9f60

Please sign in to comment.