Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Marco Bubke
flatpak-qt-creator
Commits
812af85d
Commit
812af85d
authored
Aug 19, 2010
by
Olivier Goffart
Browse files
qmlobserver: avoid to stream objects too often.
Limit to once every 5 seconds
parent
0b09a59e
Changes
2
Hide whitespace changes
Inline
Side-by-side
share/qtcreator/qmljsdebugger/qdeclarativedesignview.cpp
View file @
812af85d
...
...
@@ -53,7 +53,6 @@
namespace
QmlViewer
{
const
int
SceneChangeUpdateInterval
=
5000
;
const
int
MaxSceneChangedTimerRestartCount
=
15
;
Q_GLOBAL_STATIC
(
QDeclarativeDesignDebugServer
,
qmlDesignDebugServer
)
...
...
@@ -62,8 +61,7 @@ QDeclarativeDesignViewPrivate::QDeclarativeDesignViewPrivate(QDeclarativeDesignV
designModeBehavior
(
false
),
executionPaused
(
false
),
slowdownFactor
(
1.0
f
),
toolbar
(
0
),
sceneChangedTimerRestartCount
(
0
)
toolbar
(
0
)
{
sceneChangedTimer
.
setInterval
(
SceneChangeUpdateInterval
);
sceneChangedTimer
.
setSingleShot
(
true
);
...
...
@@ -536,18 +534,13 @@ void QDeclarativeDesignViewPrivate::_q_sceneChanged(const QList<QRectF> & /*area
if
(
designModeBehavior
)
return
;
sceneChangedTimerRestartCount
++
;
if
(
sceneChangedTimerRestartCount
==
MaxSceneChangedTimerRestartCount
)
{
_q_checkSceneItemCount
();
}
sceneChangedTimer
.
start
();
if
(
!
sceneChangedTimer
.
isActive
())
sceneChangedTimer
.
start
();
}
void
QDeclarativeDesignViewPrivate
::
_q_checkSceneItemCount
()
{
bool
hasNewItems
=
hasNewGraphicsObjects
(
q
->
rootObject
());
sceneChangedTimerRestartCount
=
0
;
if
(
hasNewItems
)
{
qmlDesignDebugServer
()
->
sceneItemCountChanged
();
...
...
@@ -675,7 +668,6 @@ void QDeclarativeDesignViewPrivate::_q_onStatusChanged(QDeclarativeView::Status
{
if
(
status
==
QDeclarativeView
::
Ready
)
{
if
(
q
->
rootObject
())
{
sceneChangedTimerRestartCount
=
0
;
hasNewGraphicsObjects
(
q
->
rootObject
());
if
(
subcomponentEditorTool
->
contextIndex
()
!=
-
1
)
subcomponentEditorTool
->
clear
();
...
...
share/qtcreator/qmljsdebugger/qdeclarativedesignview_p.h
View file @
812af85d
...
...
@@ -83,7 +83,6 @@ public:
qreal
slowdownFactor
;
QmlToolbar
*
toolbar
;
int
sceneChangedTimerRestartCount
;
QTimer
sceneChangedTimer
;
QSet
<
QGraphicsObject
*>
sceneGraphicsObjects
;
...
...
Write
Preview
Supports
Markdown
0%
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!
Cancel
Please
register
or
sign in
to comment