本文整理汇总了C++中QTimeLine::setUpdateInterval方法的典型用法代码示例。如果您正苦于以下问题:C++ QTimeLine::setUpdateInterval方法的具体用法?C++ QTimeLine::setUpdateInterval怎么用?C++ QTimeLine::setUpdateInterval使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类QTimeLine
的用法示例。
在下文中一共展示了QTimeLine::setUpdateInterval方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: startAnimation
void EditorView::startAnimation(char const *slot)
{
QTimeLine *anim = new QTimeLine(zoomAnimationTimes * zoomAnimationInterval, this);
anim->setUpdateInterval(zoomAnimationInterval);
connect(anim, SIGNAL(valueChanged(qreal)), this, slot);
connect(anim, SIGNAL(finished()), this, SLOT(animFinished()));
anim->start();
}
示例2: animationStart
void LinkDialogProcessorGraphicsItem::animationStart() {
animateExpansion_ = 0.1f;
QTimeLine* anim = new QTimeLine(50, this);
anim->setUpdateInterval(20);
connect(anim, SIGNAL(valueChanged(qreal)), SLOT(animate(qreal)));
connect(anim, SIGNAL(finished()), SLOT(animationEnd()));
anim->start();
}
示例3: wheelAction
void LinkDialogGraphicsScene::wheelAction(float offset) {
currentScrollSteps_ = offset;
QTimeLine* anim = new QTimeLine(750, this);
anim->setUpdateInterval(20);
connect(anim, SIGNAL(valueChanged(qreal)), SLOT(executeTimeLine(qreal)));
connect(anim, SIGNAL(finished()), SLOT(terminateTimeLine()));
anim->start();
}
示例4: wheelEvent
void MyQGraphicsView::wheelEvent ( QWheelEvent * event )
{
int numDegrees = event->delta() / 8;
int numSteps = numDegrees / 15; // see QWheelEvent documentation
_numScheduledScalings += numSteps;
if (_numScheduledScalings * numSteps < 0) // if user moved the wheel in another direction, we reset previously scheduled scalings
_numScheduledScalings = numSteps;
QTimeLine *anim = new QTimeLine(350, this);
anim->setUpdateInterval(50);
connect(anim, SIGNAL(valueChanged(qreal)), SLOT(scalingTime(qreal)));
connect(anim, SIGNAL(finished()), SLOT(animFinished()));
anim->start();
}
示例5: zoom
void PathologyViewer::zoom(float numSteps) {
if (!_img) {
return;
}
_numScheduledScalings += numSteps;
if (_numScheduledScalings * numSteps < 0) {
_numScheduledScalings = numSteps;
}
QTimeLine *anim = new QTimeLine(300, this);
anim->setUpdateInterval(5);
connect(anim, SIGNAL(valueChanged(qreal)), SLOT(scalingTime(qreal)));
connect(anim, SIGNAL(finished()), SLOT(zoomFinished()));
anim->start();
}
示例6: UpDateStrategy
void GraphBase::UpDateStrategy(QString strategyName)
{
//存入原来的位置
this->mAnimationStartPosition.clear();
for (NodeBase *node : mNodes)
{
node->setFlag(QGraphicsItem::ItemSendsScenePositionChanges, false);
mAnimationStartPosition.push_back(node->scenePos());
}
if (strategyName == "Circular")
{
vtkSmartPointer<vtkCircularLayoutStrategy> circularStrategy
= vtkSmartPointer<vtkCircularLayoutStrategy>::New();
mStoredLayout->SetLayoutStrategy(circularStrategy);
}
if (strategyName == "ForceDirected")
{
vtkSmartPointer<vtkForceDirectedLayoutStrategy> forceStrategy
= vtkSmartPointer<vtkForceDirectedLayoutStrategy>::New();
mStoredLayout->SetLayoutStrategy(forceStrategy);
}
if (strategyName == "Fast2D")
{
vtkSmartPointer<vtkFast2DLayoutStrategy> fastStrategy
= vtkSmartPointer<vtkFast2DLayoutStrategy>::New();
mStoredLayout->SetLayoutStrategy(fastStrategy);
}
mStoredLayout->Update();
mOutPutGraph = mStoredLayout->GetOutput();
UpdateEndPosition(strategyName);
QTimeLine *animation = new QTimeLine();
animation->setUpdateInterval(50);
connect(animation, SIGNAL(valueChanged(qreal)), this, SLOT(OnAnimation(qreal)));
connect(animation, SIGNAL(finished()), this, SLOT(OnAnimationEnd()));
animation->start();
}
示例7: wheelEvent
//cppcheck-suppress unusedFunction
void VMainGraphicsView::wheelEvent(QWheelEvent *event)
{
int numSteps = event->delta() / 8 / 15; // see QWheelEvent documentation
_numScheduledScalings += numSteps;
if (_numScheduledScalings * numSteps < 0)
{ // if user moved the wheel in another direction, we reset
_numScheduledScalings = numSteps; // previously scheduled scalings
}
QTimeLine *anim = new QTimeLine(300, this);
anim->setUpdateInterval(20);
if (QApplication::keyboardModifiers() == Qt::ControlModifier)
{// If you press CTRL this code will be executed
connect(anim, &QTimeLine::valueChanged, this, &VMainGraphicsView::scalingTime);
}
else
{
connect(anim, &QTimeLine::valueChanged, this, &VMainGraphicsView::scrollingTime);
}
connect(anim, &QTimeLine::finished, this, &VMainGraphicsView::animFinished);
anim->start();
}
示例8: keyPressEvent
void PointSetAnnotationTool::keyPressEvent(QKeyEvent *event) {
if (event->key() == Qt::Key::Key_Escape) {
cancelAnnotation();
}
else if (event->key() == Qt::Key::Key_Delete && event->modifiers() == Qt::ShiftModifier) {
if (_generating) {
cancelAnnotation();
}
else {
QSet<QtAnnotation*> selectedAnnotations = _annotationPlugin->getSelectedAnnotations();
for (QSet<QtAnnotation*>::iterator it = selectedAnnotations.begin(); it != selectedAnnotations.end(); ++it) {
_annotationPlugin->deleteAnnotation(*it);
}
}
}
else if (event->key() == Qt::Key::Key_Delete) {
if (_generating) {
if (_annotationPlugin->getGeneratedAnnotation()->getAnnotation()->getCoordinates().size() < 2) {
cancelAnnotation();
}
else {
_annotationPlugin->getGeneratedAnnotation()->removeCoordinate(-1);
if (!_annotationPlugin->getGeneratedAnnotation()->getAnnotation()->getCoordinates().empty()) {
Point prev = _annotationPlugin->getGeneratedAnnotation()->getAnnotation()->getCoordinate(-1);
_last = Point(prev.getX() * _viewer->getSceneScale(), prev.getY() * _viewer->getSceneScale());
}
}
}
else if (_annotationPlugin->getActiveAnnotation()) {
if (_annotationPlugin->getActiveAnnotation()->getAnnotation()->getCoordinates().size() <= 1) {
_annotationPlugin->deleteAnnotation(_annotationPlugin->getActiveAnnotation());
}
else if (_annotationPlugin->getActiveAnnotation()->getActiveSeedPoint() > -1) {
int activeSeedPoint = _annotationPlugin->getActiveAnnotation()->getActiveSeedPoint();
_annotationPlugin->getActiveAnnotation()->removeCoordinate(activeSeedPoint);
if (activeSeedPoint - 1 >= 0) {
_annotationPlugin->getActiveAnnotation()->setActiveSeedPoint(activeSeedPoint - 1);
}
else {
_annotationPlugin->getActiveAnnotation()->setActiveSeedPoint(_annotationPlugin->getActiveAnnotation()->getAnnotation()->getCoordinates().size() - 1);
}
}
else if (_annotationPlugin->getActiveAnnotation()) {
_annotationPlugin->getActiveAnnotation()->removeCoordinate(-1);
}
}
}
else if (event->key() == Qt::Key::Key_Z) {
if (_annotationPlugin->getActiveAnnotation()) {
QTimeLine * anim = new QTimeLine(500);
_start_zoom = _viewer->mapToScene(_viewer->viewport()->rect()).boundingRect();
_end_zoom = _annotationPlugin->getActiveAnnotation()->mapToScene(_annotationPlugin->getActiveAnnotation()->boundingRect()).boundingRect();
anim->setFrameRange(0, 100);
anim->setUpdateInterval(5);
connect(anim, SIGNAL(valueChanged(qreal)), SLOT(zoomToAnnotation(qreal)));
connect(anim, SIGNAL(finished()), SLOT(zoomToAnnotationFinished()));
anim->start();
}
}
}