Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Q
qt-creator
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Tobias Hunger
qt-creator
Commits
a9a99225
Commit
a9a99225
authored
14 years ago
by
Christiaan Janssen
Browse files
Options
Downloads
Patches
Plain Diff
QmlInspector: Added pause and step animations option
Reviewed-by: Lasse Holmstedt
parent
ebc305b0
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/tools/qml/qmlobserver/qmlruntime.cpp
+28
-2
28 additions, 2 deletions
src/tools/qml/qmlobserver/qmlruntime.cpp
src/tools/qml/qmlobserver/qmlruntime.h
+7
-1
7 additions, 1 deletion
src/tools/qml/qmlobserver/qmlruntime.h
with
35 additions
and
3 deletions
src/tools/qml/qmlobserver/qmlruntime.cpp
+
28
−
2
View file @
a9a99225
...
...
@@ -98,6 +98,7 @@
#include
<QMutexLocker>
#include
"proxysettings.h"
#include
"deviceorientation.h"
#include
<QInputDialog>
#ifdef GL_SUPPORTED
#include
<QGLWidget>
...
...
@@ -770,10 +771,16 @@ void QDeclarativeViewer::createMenu()
speedAction
->
setData
(
10.0
f
);
playSpeedMenuActions
->
addAction
(
speedAction
);
pauseAnimationsAction
=
playSpeedMenu
->
addAction
(
tr
(
"Pause"
),
this
,
SLOT
(
pau
seAnimations
(
bool
)));
pauseAnimationsAction
=
playSpeedMenu
->
addAction
(
tr
(
"Pause"
),
this
,
SLOT
(
se
t
Animations
Paused
(
bool
)));
pauseAnimationsAction
->
setCheckable
(
true
);
pauseAnimationsAction
->
setShortcut
(
QKeySequence
(
"Ctrl+."
));
animationStepAction
=
playSpeedMenu
->
addAction
(
tr
(
"Pause and step"
),
this
,
SLOT
(
stepAnimations
()));
animationStepAction
->
setShortcut
(
QKeySequence
(
"Ctrl+,"
));
animationSetStepAction
=
playSpeedMenu
->
addAction
(
tr
(
"Set step"
),
this
,
SLOT
(
setAnimationStep
()));
m_stepSize
=
40
;
QAction
*
playSpeedAction
=
new
QAction
(
tr
(
"Animations"
),
this
);
playSpeedAction
->
setMenu
(
playSpeedMenu
);
...
...
@@ -1002,7 +1009,7 @@ void QDeclarativeViewer::toggleRecording()
setRecording
(
recording
);
}
void
QDeclarativeViewer
::
pau
seAnimations
(
bool
enable
)
void
QDeclarativeViewer
::
se
t
Animations
Paused
(
bool
enable
)
{
if
(
enable
)
{
setAnimationSpeed
(
0.0
);
...
...
@@ -1011,6 +1018,25 @@ void QDeclarativeViewer::pauseAnimations(bool enable)
}
}
void
QDeclarativeViewer
::
pauseAnimations
()
{
pauseAnimationsAction
->
setChecked
(
true
);
setAnimationsPaused
(
true
);
}
void
QDeclarativeViewer
::
stepAnimations
()
{
setAnimationSpeed
(
1.0
);
QTimer
::
singleShot
(
m_stepSize
,
this
,
SLOT
(
pauseAnimations
()));
}
void
QDeclarativeViewer
::
setAnimationStep
()
{
bool
ok
;
int
stepSize
=
QInputDialog
::
getInt
(
this
,
tr
(
"Set animation step duration"
),
tr
(
"Step duration (ms):"
),
m_stepSize
,
20
,
10000
,
1
,
&
ok
);
if
(
ok
)
m_stepSize
=
stepSize
;
}
void
QDeclarativeViewer
::
changeAnimationSpeed
()
{
QAction
*
action
=
qobject_cast
<
QAction
*>
(
sender
());
...
...
This diff is collapsed.
Click to expand it.
src/tools/qml/qmlobserver/qmlruntime.h
+
7
−
1
View file @
a9a99225
...
...
@@ -131,7 +131,10 @@ public slots:
void
proxySettingsChanged
();
void
rotateOrientation
();
void
statusChanged
();
void
pauseAnimations
(
bool
);
void
setAnimationsPaused
(
bool
);
void
pauseAnimations
();
void
stepAnimations
();
void
setAnimationStep
();
void
changeAnimationSpeed
();
void
launch
(
const
QString
&
);
...
...
@@ -193,7 +196,10 @@ private:
bool
convertAvailable
;
float
animationSpeed
;
int
m_stepSize
;
QAction
*
pauseAnimationsAction
;
QAction
*
animationStepAction
;
QAction
*
animationSetStepAction
;
QActionGroup
*
orientation
;
QAction
*
showWarningsWindow
;
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment