Unsolved I want to apply the cine of series image inside my project?
-
I have a series of image loaded inside the viewport. Now, I want to take a button and when i click the button all the slices of series changing to FPS(frame per second). I dont have enough idea abot how to do this.
I will used this code for move slider infinite time:-connect is used for tranfering the signal when button is pressed.
connect(this->ui->m_cine, SIGNAL(pressed()), this, SLOT(AnimatedSlider()));
this Function is the working function infinite loop:-
void QtVTKRenderWindows::AnimatedSlider() { QPropertyAnimation *animation = new QPropertyAnimation(slider, "sliderPosition"); animation->setDuration(1000); animation->setStartValue(slider->minimum()); animation->setEndValue(slider->maximum()); animation->setEasingCurve(QEasingCurve::OutCubic); animation->setLoopCount(-1); animation->start(); }
But i am getting problem like when i set the loop count to -1. It will goes to finite time
Any help is considerable
Thank you -
Hi,
One thing that is not good is that you are creating a new animation each time you call AnimatedSlider. You should likely create it once and only update its parameter and start it in AnimatedSlider.
-
This post is deleted! -
@SGaist Slider is moving but the problem is coming is once the slider reached to maximum point. then it will be stop .But i want to set the slider like that once it will reached to maximum point then again slider comes to the initial point.
-
So you should use something like:
animation->setKeyValueAt(0, slider->minimum()); animation->setKeyValueAt(0.5, slider->maximum()); animation->setKeyValueAt(1, slider->minimum());
and remove the
setStartValue
andsetEndValue
calls. -
@SGaist i am getting the slider movement.. open more problem comes is .. when i will moving the cine in loop by increasing the slider one by oen but it will be move not one by one. How to fix this
-
I don't understand that statement. Can you rephrase it or show an example of what is happening ?
-
@SGaist On button click slider move like cine play . but every slice of image not show .Like it will skip slice of image .
I am taking the trigger signal when the moveconnect(sliter, SIGNAL(valueChanged(int)), SLOT(slider_Event(int)));
And i am invoking the signal here.when the slider is move from one slice to another slice.
void QtVTKRenderWindows::slider_Event(int index) { int pos =slider->sliderPosition(); RadSpaViewer->m_VtkImageSlicing(pos, 2); }
this function is work for displaying the next slice
m_VtkImageSlicing(sliderposition,sliderNumber)
-
Is the slider max value accurate ?
-
@SGaist yes we are taking the series minimum and maximum value and fixed it here
animation->setStartValue(minimumSliderValue); animation->setEndValue(maximumSliderValue);
-
What are these values ?
-
@SGaist Series minimum value is (minimumSliderValue) and maximum value is (maximumSliderValue) . Like total how many slice are there inside the series. For example series has 52 slices then minimumSliderValue = 0, and maximumSliderValue = 52.
-
Did you set the singleStep to 1 ?
Also, did you check the value you receiving in that slot ?