forked from qt-creator/qt-creator
added mode buttons to custom qml viewer and qmljsinspector toolbar
This commit is contained in:
committed by
Olivier Goffart
parent
c53a0337b6
commit
2f8dc2833b
@@ -93,6 +93,10 @@ void QmlJSDesignDebugClient::messageReceived(const QByteArray &message)
|
||||
qreal slowdownFactor;
|
||||
ds >> slowdownFactor;
|
||||
emit animationSpeedChanged(slowdownFactor);
|
||||
} else if (type == "SET_DESIGN_MODE") {
|
||||
bool inDesignMode;
|
||||
ds >> inDesignMode;
|
||||
emit designModeBehaviorChanged(inDesignMode);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -126,6 +130,20 @@ void QmlJSDesignDebugClient::reloadViewer()
|
||||
sendMessage(message);
|
||||
}
|
||||
|
||||
void QmlJSDesignDebugClient::setDesignModeBehavior(bool inDesignMode)
|
||||
{
|
||||
if (!m_connection || !m_connection->isConnected())
|
||||
return;
|
||||
|
||||
QByteArray message;
|
||||
QDataStream ds(&message, QIODevice::WriteOnly);
|
||||
|
||||
ds << QByteArray("SET_DESIGN_MODE")
|
||||
<< inDesignMode;
|
||||
|
||||
sendMessage(message);
|
||||
}
|
||||
|
||||
void QmlJSDesignDebugClient::setAnimationSpeed(qreal slowdownFactor)
|
||||
{
|
||||
if (!m_connection || !m_connection->isConnected())
|
||||
|
||||
Reference in New Issue
Block a user