forked from qt-creator/qt-creator
qmlpreview: fix crash
Change-Id: Id1b9d8c070539e8935e2d7492f6a8c2567739e00 Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
This commit is contained in:
@@ -40,9 +40,6 @@ QmlPreviewConnectionManager::QmlPreviewConnectionManager(QObject *parent) :
|
||||
QmlDebug::QmlDebugConnectionManager(parent)
|
||||
{
|
||||
setTarget(nullptr);
|
||||
m_createDebugTranslationClientMethod = [](QmlDebug::QmlDebugConnection *connection) {
|
||||
return std::make_unique<QmlPreview::QmlDebugTranslationClient>(connection);
|
||||
};
|
||||
}
|
||||
|
||||
QmlPreviewConnectionManager::~QmlPreviewConnectionManager() = default;
|
||||
|
@@ -105,6 +105,13 @@ static void defaultFpsHandler(quint16 frames[8])
|
||||
Core::MessageManager::writeSilently(QString::fromLatin1("QML preview: %1 fps").arg(frames[0]));
|
||||
}
|
||||
|
||||
static std::unique_ptr<QmlDebugTranslationClient> defaultCreateDebugTranslationClientMethod(QmlDebug::QmlDebugConnection *connection)
|
||||
{
|
||||
auto client = std::make_unique<QmlPreview::QmlDebugTranslationClient>(connection);
|
||||
return client;
|
||||
};
|
||||
|
||||
|
||||
class QmlPreviewPluginPrivate : public QObject
|
||||
{
|
||||
public:
|
||||
@@ -198,6 +205,7 @@ QmlPreviewPluginPrivate::QmlPreviewPluginPrivate(QmlPreviewPlugin *parent)
|
||||
m_fileLoader = &defaultFileLoader;
|
||||
m_fileClassifer = &defaultFileClassifier;
|
||||
m_fpsHandler = &defaultFpsHandler;
|
||||
m_createDebugTranslationClientMethod = &defaultCreateDebugTranslationClientMethod;
|
||||
|
||||
Core::ActionContainer *menu = Core::ActionManager::actionContainer(
|
||||
Constants::M_BUILDPROJECT);
|
||||
|
Reference in New Issue
Block a user