Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Tobias Hunger
qt-creator
Commits
3e919302
Commit
3e919302
authored
Aug 03, 2010
by
Lasse Holmstedt
Browse files
Qml JS Debugger: Change context path from Creator's crumble path
parent
5f7969d0
Changes
15
Hide whitespace changes
Inline
Side-by-side
src/libs/qmljsdebugger/editor/subcomponenteditortool.cpp
View file @
3e919302
...
...
@@ -111,6 +111,7 @@ void SubcomponentEditorTool::animate()
m_animTimer
->
stop
();
m_mask
->
setOpacity
(
0
);
popContext
();
emit
contextPathChanged
(
m_path
);
}
}
...
...
@@ -235,6 +236,7 @@ void SubcomponentEditorTool::aboutToPopContext()
{
if
(
m_currentContext
.
size
()
>
2
)
{
popContext
();
emit
contextPathChanged
(
m_path
);
}
else
{
m_animIncrement
=
-
0.05
f
;
m_animTimer
->
start
();
...
...
@@ -302,6 +304,8 @@ QGraphicsObject *SubcomponentEditorTool::setContext(int contextIndex)
while
(
m_currentContext
.
size
()
-
1
>
contextIndex
)
{
popContext
();
}
emit
contextPathChanged
(
m_path
);
return
m_currentContext
.
top
();
}
...
...
src/libs/qmljsdebugger/editor/subcomponenteditortool.h
View file @
3e919302
...
...
@@ -45,7 +45,7 @@ public:
void
setCurrentItem
(
QGraphicsItem
*
contextObject
);
void
pushContext
(
QGraphicsObject
*
contextItem
);
QGraphicsObject
*
popContext
();
QGraphicsObject
*
currentRootItem
()
const
;
QGraphicsObject
*
setContext
(
int
contextIndex
);
int
contextIndex
()
const
;
...
...
@@ -66,6 +66,7 @@ private slots:
void
refresh
();
private:
QGraphicsObject
*
popContext
();
void
aboutToPopContext
();
private:
...
...
src/libs/qmljsdebugger/include/qdeclarativedesigndebugserver.h
View file @
3e919302
...
...
@@ -90,6 +90,8 @@ Q_SIGNALS:
// 1 < x < 16 = slowdown by some factor
void
animationSpeedChangeRequested
(
qreal
speedFactor
);
void
contextPathIndexChanged
(
int
contextPathIndex
);
protected:
virtual
void
messageReceived
(
const
QByteArray
&
);
...
...
src/libs/qmljsdebugger/include/qdeclarativedesignview.h
View file @
3e919302
...
...
@@ -107,6 +107,7 @@ private:
Q_PRIVATE_SLOT
(
d_func
(),
void
_q_changeToMarqueeSelectTool
())
Q_PRIVATE_SLOT
(
d_func
(),
void
_q_changeToZoomTool
())
Q_PRIVATE_SLOT
(
d_func
(),
void
_q_changeToColorPickerTool
())
Q_PRIVATE_SLOT
(
d_func
(),
void
_q_changeContextPathIndex
(
int
index
))
inline
QDeclarativeDesignViewPrivate
*
d_func
()
{
return
data
.
data
();
}
QScopedPointer
<
QDeclarativeDesignViewPrivate
>
data
;
...
...
src/libs/qmljsdebugger/qdeclarativedesigndebugserver.cpp
View file @
3e919302
...
...
@@ -79,6 +79,10 @@ void QDeclarativeDesignDebugServer::messageReceived(const QByteArray &message)
m_stringIdForObjectId
.
insert
(
itemDebugId
,
itemIdString
);
}
}
else
if
(
type
==
"SET_CONTEXT_PATH_IDX"
)
{
int
contextPathIndex
;
ds
>>
contextPathIndex
;
emit
contextPathIndexChanged
(
contextPathIndex
);
}
}
...
...
src/libs/qmljsdebugger/qdeclarativedesignview.cpp
View file @
3e919302
...
...
@@ -94,7 +94,7 @@ QDeclarativeDesignView::QDeclarativeDesignView(QWidget *parent) :
connect
(
qmlDesignDebugServer
(),
SIGNAL
(
objectCreationRequested
(
QString
,
QObject
*
,
QStringList
,
QString
)),
SLOT
(
_q_createQmlObject
(
QString
,
QObject
*
,
QStringList
,
QString
)));
connect
(
qmlDesignDebugServer
(),
SIGNAL
(
contextPathIndexChanged
(
int
)),
SLOT
(
_q_changeContextPathIndex
(
int
)));
connect
(
this
,
SIGNAL
(
statusChanged
(
QDeclarativeView
::
Status
)),
SLOT
(
_q_onStatusChanged
(
QDeclarativeView
::
Status
)));
connect
(
data
->
colorPickerTool
,
SIGNAL
(
selectedColorChanged
(
QColor
)),
SIGNAL
(
selectedColorChanged
(
QColor
)));
...
...
@@ -513,6 +513,11 @@ void QDeclarativeDesignViewPrivate::_q_changeToColorPickerTool()
qmlDesignDebugServer
()
->
setCurrentTool
(
Constants
::
ColorPickerMode
);
}
void
QDeclarativeDesignViewPrivate
::
_q_changeContextPathIndex
(
int
index
)
{
subcomponentEditorTool
->
setContext
(
index
);
}
void
QDeclarativeDesignView
::
changeAnimationSpeed
(
qreal
slowdownFactor
)
{
data
->
slowdownFactor
=
slowdownFactor
;
...
...
src/libs/qmljsdebugger/qdeclarativedesignview_p.h
View file @
3e919302
...
...
@@ -122,6 +122,7 @@ public:
void
_q_changeToMarqueeSelectTool
();
void
_q_changeToZoomTool
();
void
_q_changeToColorPickerTool
();
void
_q_changeContextPathIndex
(
int
index
);
static
QDeclarativeDesignViewPrivate
*
get
(
QDeclarativeDesignView
*
v
)
{
return
v
->
d_func
();
}
};
...
...
src/plugins/qmljsinspector/qmljsclientproxy.cpp
View file @
3e919302
...
...
@@ -462,12 +462,18 @@ void ClientProxy::createQmlObject(const QString &qmlText, int parentDebugId,
m_designClient
->
createQmlObject
(
qmlText
,
parentDebugId
,
imports
,
filename
);
}
void
QmlJSInspector
::
Internal
::
ClientProxy
::
destroyQmlObject
(
int
debugId
)
void
ClientProxy
::
destroyQmlObject
(
int
debugId
)
{
if
(
isDesignClientConnected
())
m_designClient
->
destroyQmlObject
(
debugId
);
}
void
ClientProxy
::
setContextPathIndex
(
int
contextIndex
)
{
if
(
isDesignClientConnected
())
m_designClient
->
setContextPathIndex
(
contextIndex
);
}
bool
ClientProxy
::
isDesignClientConnected
()
const
{
...
...
src/plugins/qmljsinspector/qmljsclientproxy.h
View file @
3e919302
...
...
@@ -108,6 +108,7 @@ public slots:
void
createQmlObject
(
const
QString
&
qmlText
,
int
parentDebugId
,
const
QStringList
&
imports
,
const
QString
&
filename
=
QString
());
void
destroyQmlObject
(
int
debugId
);
void
setContextPathIndex
(
int
contextIndex
);
private
slots
:
void
contextChanged
();
...
...
src/plugins/qmljsinspector/qmljscontextcrumblepath.cpp
View file @
3e919302
...
...
@@ -31,5 +31,10 @@ void ContextCrumblePath::updateContextPath(const QStringList &path)
}
}
bool
ContextCrumblePath
::
isEmpty
()
const
{
return
m_isEmpty
;
}
}
// namespace Internal
}
// namespace QmlJSInspector
src/plugins/qmljsinspector/qmljscontextcrumblepath.h
View file @
3e919302
...
...
@@ -13,6 +13,7 @@ class ContextCrumblePath : public Utils::CrumblePath
public:
ContextCrumblePath
(
QWidget
*
parent
=
0
);
virtual
~
ContextCrumblePath
();
bool
isEmpty
()
const
;
public
slots
:
void
updateContextPath
(
const
QStringList
&
path
);
...
...
src/plugins/qmljsinspector/qmljsdesigndebugclient.cpp
View file @
3e919302
...
...
@@ -167,6 +167,18 @@ void QmlJSDesignDebugClient::setObjectIdList(const QList<QDeclarativeDebugObject
sendMessage
(
message
);
}
void
QmlJSDesignDebugClient
::
setContextPathIndex
(
int
contextPathIndex
)
{
if
(
!
m_connection
||
!
m_connection
->
isConnected
())
return
;
QByteArray
message
;
QDataStream
ds
(
&
message
,
QIODevice
::
WriteOnly
);
ds
<<
QByteArray
(
"SET_CONTEXT_PATH_IDX"
)
<<
contextPathIndex
;
sendMessage
(
message
);
}
void
QmlJSDesignDebugClient
::
reloadViewer
()
{
...
...
src/plugins/qmljsinspector/qmljsdesigndebugclient.h
View file @
3e919302
...
...
@@ -75,6 +75,8 @@ public:
// ### Qt 4.8: remove if we can have access to qdeclarativecontextdata or id's
void
setObjectIdList
(
const
QList
<
QDeclarativeDebugObjectReference
>
&
objectRoots
);
void
setContextPathIndex
(
int
contextPathIndex
);
signals:
void
currentObjectsChanged
(
const
QList
<
int
>
&
debugIds
);
void
selectedColorChanged
(
const
QColor
&
color
);
...
...
src/plugins/qmljsinspector/qmljsinspector.cpp
View file @
3e919302
...
...
@@ -635,6 +635,7 @@ void Inspector::createDockWidgets()
{
m_crumblePath
=
new
ContextCrumblePath
;
m_crumblePath
->
setWindowTitle
(
"Context Path"
);
connect
(
m_crumblePath
,
SIGNAL
(
elementClicked
(
int
)),
SLOT
(
crumblePathElementClicked
(
int
)));
Debugger
::
DebuggerUISwitcher
*
uiSwitcher
=
Debugger
::
DebuggerUISwitcher
::
instance
();
m_crumblePathDock
=
uiSwitcher
->
createDockWidget
(
QmlJSInspector
::
Constants
::
LANG_QML
,
m_crumblePath
,
Qt
::
BottomDockWidgetArea
);
...
...
@@ -643,6 +644,13 @@ void Inspector::createDockWidgets()
connect
(
m_clientProxy
,
SIGNAL
(
contextPathUpdated
(
QStringList
)),
m_crumblePath
,
SLOT
(
updateContextPath
(
QStringList
)));
}
void
Inspector
::
crumblePathElementClicked
(
int
pathIndex
)
{
if
(
m_clientProxy
->
isConnected
()
&&
!
m_crumblePath
->
isEmpty
())
{
m_clientProxy
->
setContextPathIndex
(
pathIndex
);
}
}
bool
Inspector
::
showExperimentalWarning
()
{
return
m_showExperimentalWarning
;
...
...
src/plugins/qmljsinspector/qmljsinspector.h
View file @
3e919302
...
...
@@ -133,7 +133,7 @@ private slots:
void
createPreviewForEditor
(
Core
::
IEditor
*
newEditor
);
void
disableLivePreview
();
void
crumblePathElementClicked
(
int
);
private:
Debugger
::
DebuggerRunControl
*
createDebuggerRunControl
(
ProjectExplorer
::
RunConfiguration
*
runConfig
,
const
QString
&
executableFile
=
QString
(),
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a 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