forked from qt-creator/qt-creator
QmlObserver: Add 'show app on top' switch to creator + qmlobserver
This is convenient especially in the observer mode. Reviewed-by: Christiaan Janssen
This commit is contained in:
@@ -68,6 +68,8 @@ public:
|
|||||||
void setAnimationSpeed(qreal slowdownFactor);
|
void setAnimationSpeed(qreal slowdownFactor);
|
||||||
void setCurrentTool(QmlJSDebugger::Constants::DesignTool toolId);
|
void setCurrentTool(QmlJSDebugger::Constants::DesignTool toolId);
|
||||||
void reloaded();
|
void reloaded();
|
||||||
|
void setShowAppOnTop(bool showAppOnTop);
|
||||||
|
|
||||||
QString idStringForObject(QObject *obj) const;
|
QString idStringForObject(QObject *obj) const;
|
||||||
|
|
||||||
void sendMessage(const QByteArray &message);
|
void sendMessage(const QByteArray &message);
|
||||||
@@ -81,6 +83,7 @@ Q_SIGNALS:
|
|||||||
|
|
||||||
void currentObjectsChanged(const QList<QObject*> &objects);
|
void currentObjectsChanged(const QList<QObject*> &objects);
|
||||||
void designModeBehaviorChanged(bool inDesignMode);
|
void designModeBehaviorChanged(bool inDesignMode);
|
||||||
|
void showAppOnTopChanged(bool showAppOnTop);
|
||||||
void reloadRequested();
|
void reloadRequested();
|
||||||
void selectToolRequested();
|
void selectToolRequested();
|
||||||
void selectMarqueeToolRequested();
|
void selectMarqueeToolRequested();
|
||||||
|
|||||||
@@ -61,10 +61,14 @@ public:
|
|||||||
static QString idStringForObject(QObject *obj);
|
static QString idStringForObject(QObject *obj);
|
||||||
QRectF adjustToScreenBoundaries(const QRectF &boundingRectInSceneSpace);
|
QRectF adjustToScreenBoundaries(const QRectF &boundingRectInSceneSpace);
|
||||||
|
|
||||||
|
bool showAppOnTop() const;
|
||||||
|
|
||||||
public Q_SLOTS:
|
public Q_SLOTS:
|
||||||
void setDesignModeBehavior(bool value);
|
void setDesignModeBehavior(bool value);
|
||||||
bool designModeBehavior();
|
bool designModeBehavior();
|
||||||
|
|
||||||
|
void setShowAppOnTop(bool appOnTop);
|
||||||
|
|
||||||
void changeAnimationSpeed(qreal slowdownFactor);
|
void changeAnimationSpeed(qreal slowdownFactor);
|
||||||
void continueExecution(qreal slowdownFactor = 1.0f);
|
void continueExecution(qreal slowdownFactor = 1.0f);
|
||||||
void pauseExecution();
|
void pauseExecution();
|
||||||
@@ -73,6 +77,7 @@ public Q_SLOTS:
|
|||||||
|
|
||||||
Q_SIGNALS:
|
Q_SIGNALS:
|
||||||
void designModeBehaviorChanged(bool inDesignMode);
|
void designModeBehaviorChanged(bool inDesignMode);
|
||||||
|
void showAppOnTopChanged(bool showAppOnTop);
|
||||||
void reloadRequested();
|
void reloadRequested();
|
||||||
void marqueeSelectToolActivated();
|
void marqueeSelectToolActivated();
|
||||||
void selectToolActivated();
|
void selectToolActivated();
|
||||||
|
|||||||
@@ -110,6 +110,10 @@ void QDeclarativeObserverService::messageReceived(const QByteArray &message)
|
|||||||
bool inDesignMode;
|
bool inDesignMode;
|
||||||
ds >> inDesignMode;
|
ds >> inDesignMode;
|
||||||
emit designModeBehaviorChanged(inDesignMode);
|
emit designModeBehaviorChanged(inDesignMode);
|
||||||
|
} else if (type == "SHOW_APP_ON_TOP") {
|
||||||
|
bool showOnTop;
|
||||||
|
ds >> showOnTop;
|
||||||
|
emit showAppOnTopChanged(showOnTop);
|
||||||
} else if (type == "CREATE_OBJECT") {
|
} else if (type == "CREATE_OBJECT") {
|
||||||
QString qml;
|
QString qml;
|
||||||
int parentId;
|
int parentId;
|
||||||
@@ -207,6 +211,16 @@ void QDeclarativeObserverService::reloaded()
|
|||||||
sendMessage(message);
|
sendMessage(message);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void QDeclarativeObserverService::setShowAppOnTop(bool showAppOnTop)
|
||||||
|
{
|
||||||
|
QByteArray message;
|
||||||
|
QDataStream ds(&message, QIODevice::WriteOnly);
|
||||||
|
|
||||||
|
ds << QByteArray("SHOW_APP_ON_TOP") << showAppOnTop;
|
||||||
|
|
||||||
|
sendMessage(message);
|
||||||
|
}
|
||||||
|
|
||||||
void QDeclarativeObserverService::selectedColorChanged(const QColor &color)
|
void QDeclarativeObserverService::selectedColorChanged(const QColor &color)
|
||||||
{
|
{
|
||||||
QByteArray message;
|
QByteArray message;
|
||||||
|
|||||||
@@ -57,6 +57,7 @@ const int SceneChangeUpdateInterval = 5000;
|
|||||||
QDeclarativeViewObserverPrivate::QDeclarativeViewObserverPrivate(QDeclarativeViewObserver *q) :
|
QDeclarativeViewObserverPrivate::QDeclarativeViewObserverPrivate(QDeclarativeViewObserver *q) :
|
||||||
q(q),
|
q(q),
|
||||||
designModeBehavior(false),
|
designModeBehavior(false),
|
||||||
|
showAppOnTop(false),
|
||||||
executionPaused(false),
|
executionPaused(false),
|
||||||
slowdownFactor(1.0f),
|
slowdownFactor(1.0f),
|
||||||
toolbar(0)
|
toolbar(0)
|
||||||
@@ -87,6 +88,8 @@ QDeclarativeViewObserver::QDeclarativeViewObserver(QDeclarativeView *view, QObje
|
|||||||
data->debugService = QDeclarativeObserverService::instance();
|
data->debugService = QDeclarativeObserverService::instance();
|
||||||
connect(data->debugService, SIGNAL(designModeBehaviorChanged(bool)),
|
connect(data->debugService, SIGNAL(designModeBehaviorChanged(bool)),
|
||||||
SLOT(setDesignModeBehavior(bool)));
|
SLOT(setDesignModeBehavior(bool)));
|
||||||
|
connect(data->debugService, SIGNAL(showAppOnTopChanged(bool)),
|
||||||
|
SLOT(setShowAppOnTop(bool)));
|
||||||
connect(data->debugService, SIGNAL(reloadRequested()), SLOT(_q_reloadView()));
|
connect(data->debugService, SIGNAL(reloadRequested()), SLOT(_q_reloadView()));
|
||||||
connect(data->debugService, SIGNAL(currentObjectsChanged(QList<QObject*>)),
|
connect(data->debugService, SIGNAL(currentObjectsChanged(QList<QObject*>)),
|
||||||
SLOT(_q_onCurrentObjectsChanged(QList<QObject*>)));
|
SLOT(_q_onCurrentObjectsChanged(QList<QObject*>)));
|
||||||
@@ -475,6 +478,33 @@ bool QDeclarativeViewObserver::designModeBehavior()
|
|||||||
return data->designModeBehavior;
|
return data->designModeBehavior;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool QDeclarativeViewObserver::showAppOnTop() const
|
||||||
|
{
|
||||||
|
return data->showAppOnTop;
|
||||||
|
}
|
||||||
|
|
||||||
|
void QDeclarativeViewObserver::setShowAppOnTop(bool appOnTop)
|
||||||
|
{
|
||||||
|
if (data->view) {
|
||||||
|
QWidget *rootWidget = data->view;
|
||||||
|
while (rootWidget->parentWidget())
|
||||||
|
rootWidget = rootWidget->parentWidget();
|
||||||
|
Qt::WindowFlags flags = rootWidget->windowFlags();
|
||||||
|
if (appOnTop) {
|
||||||
|
flags |= Qt::WindowStaysOnTopHint;
|
||||||
|
} else {
|
||||||
|
flags &= ~Qt::WindowStaysOnTopHint;
|
||||||
|
}
|
||||||
|
rootWidget->setWindowFlags(flags);
|
||||||
|
rootWidget->show();
|
||||||
|
}
|
||||||
|
|
||||||
|
data->showAppOnTop = appOnTop;
|
||||||
|
data->debugService->setShowAppOnTop(appOnTop);
|
||||||
|
|
||||||
|
emit showAppOnTopChanged(appOnTop);
|
||||||
|
}
|
||||||
|
|
||||||
void QDeclarativeViewObserverPrivate::changeTool(Constants::DesignTool tool,
|
void QDeclarativeViewObserverPrivate::changeTool(Constants::DesignTool tool,
|
||||||
Constants::ToolFlags /*flags*/)
|
Constants::ToolFlags /*flags*/)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -83,6 +83,7 @@ public:
|
|||||||
BoundingRectHighlighter *boundingRectHighlighter;
|
BoundingRectHighlighter *boundingRectHighlighter;
|
||||||
|
|
||||||
bool designModeBehavior;
|
bool designModeBehavior;
|
||||||
|
bool showAppOnTop;
|
||||||
|
|
||||||
bool executionPaused;
|
bool executionPaused;
|
||||||
qreal slowdownFactor;
|
qreal slowdownFactor;
|
||||||
|
|||||||
@@ -422,6 +422,7 @@ int main(int argc, char ** argv)
|
|||||||
viewer->enableExperimentalGestures();
|
viewer->enableExperimentalGestures();
|
||||||
|
|
||||||
viewer->setDesignModeBehavior(designModeBehavior);
|
viewer->setDesignModeBehavior(designModeBehavior);
|
||||||
|
viewer->setStayOnTop(stayOnTop);
|
||||||
|
|
||||||
foreach (QString lib, imports)
|
foreach (QString lib, imports)
|
||||||
viewer->addLibraryPath(lib);
|
viewer->addLibraryPath(lib);
|
||||||
|
|||||||
@@ -755,6 +755,13 @@ void QDeclarativeViewer::createMenu()
|
|||||||
connect(observer, SIGNAL(designModeBehaviorChanged(bool)), designModeBehaviorAction, SLOT(setChecked(bool)));
|
connect(observer, SIGNAL(designModeBehaviorChanged(bool)), designModeBehaviorAction, SLOT(setChecked(bool)));
|
||||||
connect(QmlJSDebugger::QDeclarativeObserverService::instance(), SIGNAL(debuggingClientChanged(bool)), designModeBehaviorAction, SLOT(setEnabled(bool)));
|
connect(QmlJSDebugger::QDeclarativeObserverService::instance(), SIGNAL(debuggingClientChanged(bool)), designModeBehaviorAction, SLOT(setEnabled(bool)));
|
||||||
|
|
||||||
|
appOnTopAction = new QAction(tr("Keep Window on Top"), this);
|
||||||
|
appOnTopAction->setCheckable(true);
|
||||||
|
appOnTopAction->setChecked(observer->showAppOnTop());
|
||||||
|
|
||||||
|
connect(appOnTopAction, SIGNAL(triggered(bool)), observer, SLOT(setShowAppOnTop(bool)));
|
||||||
|
connect(observer, SIGNAL(showAppOnTopChanged(bool)), appOnTopAction, SLOT(setChecked(bool)));
|
||||||
|
|
||||||
QAction *proxyAction = new QAction(tr("HTTP &Proxy..."), this);
|
QAction *proxyAction = new QAction(tr("HTTP &Proxy..."), this);
|
||||||
connect(proxyAction, SIGNAL(triggered()), this, SLOT(showProxySettings()));
|
connect(proxyAction, SIGNAL(triggered()), this, SLOT(showProxySettings()));
|
||||||
|
|
||||||
@@ -825,6 +832,7 @@ void QDeclarativeViewer::createMenu()
|
|||||||
debugMenu->addAction(playSpeedAction);
|
debugMenu->addAction(playSpeedAction);
|
||||||
debugMenu->addAction(showWarningsWindow);
|
debugMenu->addAction(showWarningsWindow);
|
||||||
debugMenu->addAction(designModeBehaviorAction);
|
debugMenu->addAction(designModeBehaviorAction);
|
||||||
|
debugMenu->addAction(appOnTopAction);
|
||||||
#endif // ! Q_OS_SYMBIAN
|
#endif // ! Q_OS_SYMBIAN
|
||||||
|
|
||||||
QMenu *settingsMenu = menu->addMenu(tr("S&ettings"));
|
QMenu *settingsMenu = menu->addMenu(tr("S&ettings"));
|
||||||
@@ -1487,6 +1495,11 @@ void QDeclarativeViewer::setSizeToView(bool sizeToView)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void QDeclarativeViewer::setStayOnTop(bool stayOnTop)
|
||||||
|
{
|
||||||
|
appOnTopAction->setChecked(stayOnTop);
|
||||||
|
}
|
||||||
|
|
||||||
void QDeclarativeViewer::setAnimationSpeed(float f)
|
void QDeclarativeViewer::setAnimationSpeed(float f)
|
||||||
{
|
{
|
||||||
QDeclarativeDebugHelper::setAnimationSlowDownFactor(f);
|
QDeclarativeDebugHelper::setAnimationSlowDownFactor(f);
|
||||||
|
|||||||
@@ -107,6 +107,7 @@ public:
|
|||||||
void setUseGL(bool use);
|
void setUseGL(bool use);
|
||||||
void setUseNativeFileBrowser(bool);
|
void setUseNativeFileBrowser(bool);
|
||||||
void setSizeToView(bool sizeToView);
|
void setSizeToView(bool sizeToView);
|
||||||
|
void setStayOnTop(bool stayOnTop);
|
||||||
|
|
||||||
QDeclarativeView *view() const;
|
QDeclarativeView *view() const;
|
||||||
LoggerWidget *warningsWidget() const;
|
LoggerWidget *warningsWidget() const;
|
||||||
@@ -201,6 +202,7 @@ private:
|
|||||||
QActionGroup *orientation;
|
QActionGroup *orientation;
|
||||||
QAction *showWarningsWindow;
|
QAction *showWarningsWindow;
|
||||||
QAction *designModeBehaviorAction;
|
QAction *designModeBehaviorAction;
|
||||||
|
QAction *appOnTopAction;
|
||||||
|
|
||||||
QString m_script;
|
QString m_script;
|
||||||
ScriptOptions m_scriptOptions;
|
ScriptOptions m_scriptOptions;
|
||||||
|
|||||||
BIN
src/plugins/qmljsinspector/images/app-on-top.png
Normal file
BIN
src/plugins/qmljsinspector/images/app-on-top.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 2.8 KiB |
@@ -65,6 +65,7 @@ QmlInspectorToolbar::QmlInspectorToolbar(QObject *parent) :
|
|||||||
m_selectAction(0),
|
m_selectAction(0),
|
||||||
m_zoomAction(0),
|
m_zoomAction(0),
|
||||||
m_colorPickerAction(0),
|
m_colorPickerAction(0),
|
||||||
|
m_showAppOnTopAction(0),
|
||||||
m_defaultAnimSpeedAction(0),
|
m_defaultAnimSpeedAction(0),
|
||||||
m_halfAnimSpeedAction(0),
|
m_halfAnimSpeedAction(0),
|
||||||
m_fourthAnimSpeedAction(0),
|
m_fourthAnimSpeedAction(0),
|
||||||
@@ -86,6 +87,7 @@ QmlInspectorToolbar::QmlInspectorToolbar(QObject *parent) :
|
|||||||
void QmlInspectorToolbar::setEnabled(bool value)
|
void QmlInspectorToolbar::setEnabled(bool value)
|
||||||
{
|
{
|
||||||
m_fromQmlAction->setEnabled(value);
|
m_fromQmlAction->setEnabled(value);
|
||||||
|
m_showAppOnTopAction->setEnabled(value);
|
||||||
m_observerModeAction->setEnabled(value);
|
m_observerModeAction->setEnabled(value);
|
||||||
m_playAction->setEnabled(value);
|
m_playAction->setEnabled(value);
|
||||||
m_selectAction->setEnabled(value);
|
m_selectAction->setEnabled(value);
|
||||||
@@ -166,6 +168,13 @@ void QmlInspectorToolbar::setDesignModeBehavior(bool inDesignMode)
|
|||||||
m_emitSignals = true;
|
m_emitSignals = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void QmlInspectorToolbar::setShowAppOnTop(bool showAppOnTop)
|
||||||
|
{
|
||||||
|
m_emitSignals = false;
|
||||||
|
m_showAppOnTopAction->setChecked(showAppOnTop);
|
||||||
|
m_emitSignals = true;
|
||||||
|
}
|
||||||
|
|
||||||
void QmlInspectorToolbar::createActions(const Core::Context &context)
|
void QmlInspectorToolbar::createActions(const Core::Context &context)
|
||||||
{
|
{
|
||||||
Core::ICore *core = Core::ICore::instance();
|
Core::ICore *core = Core::ICore::instance();
|
||||||
@@ -174,6 +183,9 @@ void QmlInspectorToolbar::createActions(const Core::Context &context)
|
|||||||
m_fromQmlAction =
|
m_fromQmlAction =
|
||||||
new QAction(QIcon(QLatin1String(":/qml/images/from-qml-small.png")),
|
new QAction(QIcon(QLatin1String(":/qml/images/from-qml-small.png")),
|
||||||
tr("Apply Changes on Save"), this);
|
tr("Apply Changes on Save"), this);
|
||||||
|
m_showAppOnTopAction =
|
||||||
|
new QAction(QIcon(QLatin1String(":/qml/images/app-on-top.png")),
|
||||||
|
tr("Show application on top"), this);
|
||||||
m_observerModeAction =
|
m_observerModeAction =
|
||||||
new QAction(QIcon(QLatin1String(":/qml/images/observermode.png")),
|
new QAction(QIcon(QLatin1String(":/qml/images/observermode.png")),
|
||||||
tr("Observer Mode"), this);
|
tr("Observer Mode"), this);
|
||||||
@@ -191,6 +203,8 @@ void QmlInspectorToolbar::createActions(const Core::Context &context)
|
|||||||
|
|
||||||
m_fromQmlAction->setCheckable(true);
|
m_fromQmlAction->setCheckable(true);
|
||||||
m_fromQmlAction->setChecked(true);
|
m_fromQmlAction->setChecked(true);
|
||||||
|
m_showAppOnTopAction->setCheckable(true);
|
||||||
|
m_showAppOnTopAction->setChecked(false);
|
||||||
m_observerModeAction->setCheckable(true);
|
m_observerModeAction->setCheckable(true);
|
||||||
m_observerModeAction->setChecked(false);
|
m_observerModeAction->setChecked(false);
|
||||||
m_selectAction->setCheckable(true);
|
m_selectAction->setCheckable(true);
|
||||||
@@ -203,6 +217,8 @@ void QmlInspectorToolbar::createActions(const Core::Context &context)
|
|||||||
am->registerAction(m_zoomAction, QmlJSInspector::Constants::ZOOM_ACTION, context);
|
am->registerAction(m_zoomAction, QmlJSInspector::Constants::ZOOM_ACTION, context);
|
||||||
am->registerAction(m_colorPickerAction, QmlJSInspector::Constants::COLOR_PICKER_ACTION, context);
|
am->registerAction(m_colorPickerAction, QmlJSInspector::Constants::COLOR_PICKER_ACTION, context);
|
||||||
am->registerAction(m_fromQmlAction, QmlJSInspector::Constants::FROM_QML_ACTION, context);
|
am->registerAction(m_fromQmlAction, QmlJSInspector::Constants::FROM_QML_ACTION, context);
|
||||||
|
am->registerAction(m_showAppOnTopAction,
|
||||||
|
QmlJSInspector::Constants::SHOW_APP_ON_TOP_ACTION, context);
|
||||||
|
|
||||||
m_barWidget = new Utils::StyledBar;
|
m_barWidget = new Utils::StyledBar;
|
||||||
m_barWidget->setSingleRow(true);
|
m_barWidget->setSingleRow(true);
|
||||||
@@ -250,6 +266,9 @@ void QmlInspectorToolbar::createActions(const Core::Context &context)
|
|||||||
|
|
||||||
configBarLayout->addWidget(
|
configBarLayout->addWidget(
|
||||||
createToolButton(am->command(QmlJSInspector::Constants::FROM_QML_ACTION)->action()));
|
createToolButton(am->command(QmlJSInspector::Constants::FROM_QML_ACTION)->action()));
|
||||||
|
configBarLayout->addWidget(
|
||||||
|
createToolButton(
|
||||||
|
am->command(QmlJSInspector::Constants::SHOW_APP_ON_TOP_ACTION)->action()));
|
||||||
configBarLayout->addSpacing(10);
|
configBarLayout->addSpacing(10);
|
||||||
|
|
||||||
configBarLayout->addWidget(
|
configBarLayout->addWidget(
|
||||||
@@ -277,6 +296,7 @@ void QmlInspectorToolbar::createActions(const Core::Context &context)
|
|||||||
setEnabled(false);
|
setEnabled(false);
|
||||||
|
|
||||||
connect(m_fromQmlAction, SIGNAL(triggered()), SLOT(activateFromQml()));
|
connect(m_fromQmlAction, SIGNAL(triggered()), SLOT(activateFromQml()));
|
||||||
|
connect(m_showAppOnTopAction, SIGNAL(triggered()), SLOT(showAppOnTopClick()));
|
||||||
connect(m_observerModeAction, SIGNAL(triggered()), SLOT(activateDesignModeOnClick()));
|
connect(m_observerModeAction, SIGNAL(triggered()), SLOT(activateDesignModeOnClick()));
|
||||||
connect(m_playAction, SIGNAL(triggered()), SLOT(activatePlayOnClick()));
|
connect(m_playAction, SIGNAL(triggered()), SLOT(activatePlayOnClick()));
|
||||||
connect(m_colorPickerAction, SIGNAL(triggered()), SLOT(activateColorPickerOnClick()));
|
connect(m_colorPickerAction, SIGNAL(triggered()), SLOT(activateColorPickerOnClick()));
|
||||||
@@ -404,6 +424,12 @@ void QmlInspectorToolbar::activateZoomOnClick()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void QmlInspectorToolbar::showAppOnTopClick()
|
||||||
|
{
|
||||||
|
if (m_emitSignals)
|
||||||
|
emit showAppOnTopSelected(m_showAppOnTopAction->isChecked());
|
||||||
|
}
|
||||||
|
|
||||||
void QmlInspectorToolbar::setSelectedColor(const QColor &color)
|
void QmlInspectorToolbar::setSelectedColor(const QColor &color)
|
||||||
{
|
{
|
||||||
m_colorBox->setColor(color);
|
m_colorBox->setColor(color);
|
||||||
|
|||||||
@@ -80,6 +80,7 @@ public slots:
|
|||||||
void activateZoomTool();
|
void activateZoomTool();
|
||||||
void setAnimationSpeed(qreal slowdownFactor);
|
void setAnimationSpeed(qreal slowdownFactor);
|
||||||
void setDesignModeBehavior(bool inDesignMode);
|
void setDesignModeBehavior(bool inDesignMode);
|
||||||
|
void setShowAppOnTop(bool showAppOnTop);
|
||||||
void setSelectedColor(const QColor &color);
|
void setSelectedColor(const QColor &color);
|
||||||
|
|
||||||
signals:
|
signals:
|
||||||
@@ -91,6 +92,7 @@ signals:
|
|||||||
void selectToolSelected();
|
void selectToolSelected();
|
||||||
void zoomToolSelected();
|
void zoomToolSelected();
|
||||||
|
|
||||||
|
void showAppOnTopSelected(bool isChecked);
|
||||||
void animationSpeedChanged(qreal slowdownFactor = 1.0f);
|
void animationSpeedChanged(qreal slowdownFactor = 1.0f);
|
||||||
|
|
||||||
private slots:
|
private slots:
|
||||||
@@ -100,6 +102,8 @@ private slots:
|
|||||||
void activateSelectToolOnClick();
|
void activateSelectToolOnClick();
|
||||||
void activateZoomOnClick();
|
void activateZoomOnClick();
|
||||||
|
|
||||||
|
void showAppOnTopClick();
|
||||||
|
|
||||||
void changeToDefaultAnimSpeed();
|
void changeToDefaultAnimSpeed();
|
||||||
void changeToHalfAnimSpeed();
|
void changeToHalfAnimSpeed();
|
||||||
void changeToFourthAnimSpeed();
|
void changeToFourthAnimSpeed();
|
||||||
@@ -119,6 +123,8 @@ private:
|
|||||||
QAction *m_zoomAction;
|
QAction *m_zoomAction;
|
||||||
QAction *m_colorPickerAction;
|
QAction *m_colorPickerAction;
|
||||||
|
|
||||||
|
QAction *m_showAppOnTopAction;
|
||||||
|
|
||||||
QAction *m_defaultAnimSpeedAction;
|
QAction *m_defaultAnimSpeedAction;
|
||||||
QAction *m_halfAnimSpeedAction;
|
QAction *m_halfAnimSpeedAction;
|
||||||
QAction *m_fourthAnimSpeedAction;
|
QAction *m_fourthAnimSpeedAction;
|
||||||
|
|||||||
@@ -89,6 +89,8 @@ void ClientProxy::connectToServer()
|
|||||||
SIGNAL(animationSpeedChanged(qreal)));
|
SIGNAL(animationSpeedChanged(qreal)));
|
||||||
connect(m_observerClient, SIGNAL(designModeBehaviorChanged(bool)),
|
connect(m_observerClient, SIGNAL(designModeBehaviorChanged(bool)),
|
||||||
SIGNAL(designModeBehaviorChanged(bool)));
|
SIGNAL(designModeBehaviorChanged(bool)));
|
||||||
|
connect(m_observerClient, SIGNAL(showAppOnTopChanged(bool)),
|
||||||
|
SIGNAL(showAppOnTopChanged(bool)));
|
||||||
connect(m_observerClient, SIGNAL(reloaded()), this,
|
connect(m_observerClient, SIGNAL(reloaded()), this,
|
||||||
SIGNAL(serverReloaded()));
|
SIGNAL(serverReloaded()));
|
||||||
connect(m_observerClient, SIGNAL(selectedColorChanged(QColor)),
|
connect(m_observerClient, SIGNAL(selectedColorChanged(QColor)),
|
||||||
@@ -484,6 +486,12 @@ void ClientProxy::changeToSelectMarqueeTool()
|
|||||||
m_observerClient->changeToSelectMarqueeTool();
|
m_observerClient->changeToSelectMarqueeTool();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void ClientProxy::showAppOnTop(bool showOnTop)
|
||||||
|
{
|
||||||
|
if (isConnected())
|
||||||
|
m_observerClient->showAppOnTop(showOnTop);
|
||||||
|
}
|
||||||
|
|
||||||
void ClientProxy::createQmlObject(const QString &qmlText, int parentDebugId,
|
void ClientProxy::createQmlObject(const QString &qmlText, int parentDebugId,
|
||||||
const QStringList &imports, const QString &filename)
|
const QStringList &imports, const QString &filename)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -100,6 +100,7 @@ signals:
|
|||||||
void zoomToolActivated();
|
void zoomToolActivated();
|
||||||
void animationSpeedChanged(qreal slowdownFactor);
|
void animationSpeedChanged(qreal slowdownFactor);
|
||||||
void designModeBehaviorChanged(bool inDesignMode);
|
void designModeBehaviorChanged(bool inDesignMode);
|
||||||
|
void showAppOnTopChanged(bool showAppOnTop);
|
||||||
void serverReloaded();
|
void serverReloaded();
|
||||||
void selectedColorChanged(const QColor &color);
|
void selectedColorChanged(const QColor &color);
|
||||||
void contextPathUpdated(const QStringList &contextPath);
|
void contextPathUpdated(const QStringList &contextPath);
|
||||||
@@ -115,6 +116,7 @@ public slots:
|
|||||||
void changeToZoomTool();
|
void changeToZoomTool();
|
||||||
void changeToSelectTool();
|
void changeToSelectTool();
|
||||||
void changeToSelectMarqueeTool();
|
void changeToSelectMarqueeTool();
|
||||||
|
void showAppOnTop(bool showOnTop);
|
||||||
void createQmlObject(const QString &qmlText, int parentDebugId,
|
void createQmlObject(const QString &qmlText, int parentDebugId,
|
||||||
const QStringList &imports, const QString &filename = QString());
|
const QStringList &imports, const QString &filename = QString());
|
||||||
void destroyQmlObject(int debugId);
|
void destroyQmlObject(int debugId);
|
||||||
|
|||||||
@@ -768,9 +768,9 @@ void InspectorUi::setupToolbar(bool doConnect)
|
|||||||
m_clientProxy, SLOT(changeToSelectTool()));
|
m_clientProxy, SLOT(changeToSelectTool()));
|
||||||
connect(m_toolbar, SIGNAL(applyChangesFromQmlFileTriggered(bool)),
|
connect(m_toolbar, SIGNAL(applyChangesFromQmlFileTriggered(bool)),
|
||||||
this, SLOT(setApplyChangesToQmlObserver(bool)));
|
this, SLOT(setApplyChangesToQmlObserver(bool)));
|
||||||
|
connect(m_toolbar, SIGNAL(showAppOnTopSelected(bool)),
|
||||||
|
m_clientProxy, SLOT(showAppOnTop(bool)));
|
||||||
|
|
||||||
connect(this, SIGNAL(livePreviewActivated(bool)),
|
|
||||||
m_toolbar, SLOT(setLivePreviewChecked(bool)));
|
|
||||||
connect(m_clientProxy, SIGNAL(colorPickerActivated()),
|
connect(m_clientProxy, SIGNAL(colorPickerActivated()),
|
||||||
m_toolbar, SLOT(activateColorPicker()));
|
m_toolbar, SLOT(activateColorPicker()));
|
||||||
connect(m_clientProxy, SIGNAL(selectToolActivated()),
|
connect(m_clientProxy, SIGNAL(selectToolActivated()),
|
||||||
@@ -779,6 +779,8 @@ void InspectorUi::setupToolbar(bool doConnect)
|
|||||||
m_toolbar, SLOT(activateZoomTool()));
|
m_toolbar, SLOT(activateZoomTool()));
|
||||||
connect(m_clientProxy, SIGNAL(designModeBehaviorChanged(bool)),
|
connect(m_clientProxy, SIGNAL(designModeBehaviorChanged(bool)),
|
||||||
m_toolbar, SLOT(setDesignModeBehavior(bool)));
|
m_toolbar, SLOT(setDesignModeBehavior(bool)));
|
||||||
|
connect(m_clientProxy, SIGNAL(showAppOnTopChanged(bool)),
|
||||||
|
m_toolbar, SLOT(setShowAppOnTop(bool)));
|
||||||
connect(m_clientProxy, SIGNAL(selectedColorChanged(QColor)),
|
connect(m_clientProxy, SIGNAL(selectedColorChanged(QColor)),
|
||||||
m_toolbar, SLOT(setSelectedColor(QColor)));
|
m_toolbar, SLOT(setSelectedColor(QColor)));
|
||||||
|
|
||||||
@@ -804,9 +806,9 @@ void InspectorUi::setupToolbar(bool doConnect)
|
|||||||
m_clientProxy, SLOT(changeToSelectTool()));
|
m_clientProxy, SLOT(changeToSelectTool()));
|
||||||
disconnect(m_toolbar, SIGNAL(applyChangesFromQmlFileTriggered(bool)),
|
disconnect(m_toolbar, SIGNAL(applyChangesFromQmlFileTriggered(bool)),
|
||||||
this, SLOT(setApplyChangesToQmlObserver(bool)));
|
this, SLOT(setApplyChangesToQmlObserver(bool)));
|
||||||
|
disconnect(m_toolbar, SIGNAL(showAppOnTopSelected(bool)),
|
||||||
|
m_clientProxy, SLOT(showAppOnTop(bool)));
|
||||||
|
|
||||||
disconnect(this, SIGNAL(livePreviewActivated(bool)),
|
|
||||||
m_toolbar, SLOT(setLivePreviewChecked(bool)));
|
|
||||||
disconnect(m_clientProxy, SIGNAL(colorPickerActivated()),
|
disconnect(m_clientProxy, SIGNAL(colorPickerActivated()),
|
||||||
m_toolbar, SLOT(activateColorPicker()));
|
m_toolbar, SLOT(activateColorPicker()));
|
||||||
disconnect(m_clientProxy, SIGNAL(selectToolActivated()),
|
disconnect(m_clientProxy, SIGNAL(selectToolActivated()),
|
||||||
@@ -815,6 +817,8 @@ void InspectorUi::setupToolbar(bool doConnect)
|
|||||||
m_toolbar, SLOT(activateZoomTool()));
|
m_toolbar, SLOT(activateZoomTool()));
|
||||||
disconnect(m_clientProxy, SIGNAL(designModeBehaviorChanged(bool)),
|
disconnect(m_clientProxy, SIGNAL(designModeBehaviorChanged(bool)),
|
||||||
m_toolbar, SLOT(setDesignModeBehavior(bool)));
|
m_toolbar, SLOT(setDesignModeBehavior(bool)));
|
||||||
|
disconnect(m_clientProxy, SIGNAL(showAppOnTopChanged(bool)),
|
||||||
|
m_toolbar, SLOT(setShowAppOnTop(bool)));
|
||||||
disconnect(m_clientProxy, SIGNAL(selectedColorChanged(QColor)),
|
disconnect(m_clientProxy, SIGNAL(selectedColorChanged(QColor)),
|
||||||
m_toolbar, SLOT(setSelectedColor(QColor)));
|
m_toolbar, SLOT(setSelectedColor(QColor)));
|
||||||
|
|
||||||
|
|||||||
@@ -19,5 +19,6 @@
|
|||||||
<file>images/select-marquee-small.png</file>
|
<file>images/select-marquee-small.png</file>
|
||||||
<file>images/color-picker-small-hicontrast.png</file>
|
<file>images/color-picker-small-hicontrast.png</file>
|
||||||
<file>images/observermode.png</file>
|
<file>images/observermode.png</file>
|
||||||
|
<file>images/app-on-top.png</file>
|
||||||
</qresource>
|
</qresource>
|
||||||
</RCC>
|
</RCC>
|
||||||
|
|||||||
@@ -50,6 +50,7 @@ const char * const ZOOM_ACTION = "QmlInspector.Zoom";
|
|||||||
const char * const COLOR_PICKER_ACTION = "QmlInspector.ColorPicker";
|
const char * const COLOR_PICKER_ACTION = "QmlInspector.ColorPicker";
|
||||||
const char * const TO_QML_ACTION = "QmlInspector.ToQml";
|
const char * const TO_QML_ACTION = "QmlInspector.ToQml";
|
||||||
const char * const FROM_QML_ACTION = "QmlInspector.FromQml";
|
const char * const FROM_QML_ACTION = "QmlInspector.FromQml";
|
||||||
|
const char * const SHOW_APP_ON_TOP_ACTION = "QmlInspector.ShowAppOnTop";
|
||||||
|
|
||||||
// settings
|
// settings
|
||||||
const char * const S_QML_INSPECTOR = "QML.Inspector";
|
const char * const S_QML_INSPECTOR = "QML.Inspector";
|
||||||
|
|||||||
@@ -107,6 +107,10 @@ void QmlJSObserverClient::messageReceived(const QByteArray &message)
|
|||||||
bool inDesignMode;
|
bool inDesignMode;
|
||||||
ds >> inDesignMode;
|
ds >> inDesignMode;
|
||||||
emit designModeBehaviorChanged(inDesignMode);
|
emit designModeBehaviorChanged(inDesignMode);
|
||||||
|
} else if (type == "SHOW_APP_ON_TOP") {
|
||||||
|
bool showAppOnTop;
|
||||||
|
ds >> showAppOnTop;
|
||||||
|
emit showAppOnTopChanged(showAppOnTop);
|
||||||
} else if (type == "RELOADED") {
|
} else if (type == "RELOADED") {
|
||||||
emit reloaded();
|
emit reloaded();
|
||||||
} else if (type == "COLOR_CHANGED") {
|
} else if (type == "COLOR_CHANGED") {
|
||||||
@@ -337,6 +341,23 @@ void QmlJSObserverClient::changeToZoomTool()
|
|||||||
sendMessage(message);
|
sendMessage(message);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void QmlJSObserverClient::showAppOnTop(bool showOnTop)
|
||||||
|
{
|
||||||
|
if (!m_connection || !m_connection->isConnected())
|
||||||
|
return;
|
||||||
|
|
||||||
|
QByteArray message;
|
||||||
|
QDataStream ds(&message, QIODevice::WriteOnly);
|
||||||
|
|
||||||
|
ds << QByteArray("SHOW_APP_ON_TOP")
|
||||||
|
<< showOnTop;
|
||||||
|
|
||||||
|
if (debug)
|
||||||
|
qDebug() << "QmlJSObserverClient: Sending" <<"SHOWONTOP" << showOnTop;
|
||||||
|
|
||||||
|
sendMessage(message);
|
||||||
|
}
|
||||||
|
|
||||||
void QmlJSObserverClient::createQmlObject(const QString &qmlText, int parentDebugId,
|
void QmlJSObserverClient::createQmlObject(const QString &qmlText, int parentDebugId,
|
||||||
const QStringList &imports, const QString &filename)
|
const QStringList &imports, const QString &filename)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -62,6 +62,7 @@ public:
|
|||||||
void changeToSelectTool();
|
void changeToSelectTool();
|
||||||
void changeToSelectMarqueeTool();
|
void changeToSelectMarqueeTool();
|
||||||
void changeToZoomTool();
|
void changeToZoomTool();
|
||||||
|
void showAppOnTop(bool showOnTop);
|
||||||
|
|
||||||
void createQmlObject(const QString &qmlText, int parentDebugId,
|
void createQmlObject(const QString &qmlText, int parentDebugId,
|
||||||
const QStringList &imports, const QString &filename);
|
const QStringList &imports, const QString &filename);
|
||||||
@@ -90,6 +91,7 @@ signals:
|
|||||||
void zoomToolActivated();
|
void zoomToolActivated();
|
||||||
void animationSpeedChanged(qreal slowdownFactor);
|
void animationSpeedChanged(qreal slowdownFactor);
|
||||||
void designModeBehaviorChanged(bool inDesignMode);
|
void designModeBehaviorChanged(bool inDesignMode);
|
||||||
|
void showAppOnTopChanged(bool showAppOnTop);
|
||||||
void reloaded(); // the server has reloaded the document
|
void reloaded(); // the server has reloaded the document
|
||||||
void contextPathUpdated(const QStringList &path);
|
void contextPathUpdated(const QStringList &path);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user