QmlDesigner: Use LoggingCategory in ImageContainer

Change-Id: Ibdce399fc2df19883d6ffd12e9441c58d46035ec
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
This commit is contained in:
Thomas Hartmann
2022-02-23 17:35:51 +01:00
parent 787bbfaf1c
commit ee4757a8e8

View File

@@ -28,6 +28,7 @@
#include "sharedmemory.h" #include "sharedmemory.h"
#include <QCache> #include <QCache>
#include <QDebug> #include <QDebug>
#include <QLoggingCategory>
#include <cstring> #include <cstring>
@@ -36,6 +37,8 @@
#define QTC_ASSERT_STRING(cond) qDebug("SOFT ASSERT: \"" cond"\" in file " __FILE__ ", line " QTC_ASSERT_STRINGIFY(__LINE__)) #define QTC_ASSERT_STRING(cond) qDebug("SOFT ASSERT: \"" cond"\" in file " __FILE__ ", line " QTC_ASSERT_STRINGIFY(__LINE__))
#define QTC_ASSERT(cond, action) if (cond) {} else { QTC_ASSERT_STRING(#cond); action; } do {} while (0) #define QTC_ASSERT(cond, action) if (cond) {} else { QTC_ASSERT_STRING(#cond); action; } do {} while (0)
static Q_LOGGING_CATEGORY(imageContainerDebug, "qtc.imagecontainer.debug", QtDebugMsg)
namespace QmlDesigner { namespace QmlDesigner {
// using cache as a container which deletes sharedmemory pointers at process exit // using cache as a container which deletes sharedmemory pointers at process exit
@@ -202,7 +205,7 @@ static void readSharedMemory(qint32 key, ImageContainer &container)
image.setDevicePixelRatio(pixelRatio); image.setDevicePixelRatio(pixelRatio);
if (image.isNull()) if (image.isNull())
qDebug() << Q_FUNC_INFO << "Not able to create image:" << imageWidth << imageHeight << imageFormat; qCInfo(imageContainerDebug()) << Q_FUNC_INFO << "Not able to create image:" << imageWidth << imageHeight << imageFormat;
else else
std::memcpy(image.bits(), reinterpret_cast<const qint32*>(sharedMemory.constData()) + 6, byteCount); std::memcpy(image.bits(), reinterpret_cast<const qint32*>(sharedMemory.constData()) + 6, byteCount);