QmlDesigner: Make category function pointer const

Otherwise MSVC unlike GCC or CLang cannot remove the function call for a
disabled category.

Change-Id: I2cbf9173d7d99988ff761dbeb1fbf48923b15a6b
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
This commit is contained in:
Marco Bubke
2025-06-01 13:30:59 +02:00
parent 41895d9fa7
commit cdc0a2c9b4
84 changed files with 84 additions and 84 deletions

View File

@@ -7,7 +7,7 @@
namespace QmlDesigner {
static auto category = FormEditorTracing::category;
static const auto category = FormEditorTracing::category;
AbstractCustomTool::AbstractCustomTool()
: AbstractFormEditorTool(nullptr)

View File

@@ -19,7 +19,7 @@
namespace QmlDesigner {
static auto category = FormEditorTracing::category;
static const auto category = FormEditorTracing::category;
AbstractFormEditorTool::AbstractFormEditorTool(FormEditorView *editorView) : m_view(editorView)
{

View File

@@ -12,7 +12,7 @@
namespace QmlDesigner {
static auto category = FormEditorTracing::category;
static const auto category = FormEditorTracing::category;
AnchorIndicator::AnchorIndicator(LayerItem *layerItem)
: m_layerItem(layerItem)

View File

@@ -13,7 +13,7 @@ const int AngleDegree = 16;
namespace QmlDesigner {
static auto category = FormEditorTracing::category;
static const auto category = FormEditorTracing::category;
AnchorIndicatorGraphicsItem::AnchorIndicatorGraphicsItem(QGraphicsItem *parent) :
QGraphicsObject(parent)

View File

@@ -16,7 +16,7 @@
namespace QmlDesigner {
static auto category = FormEditorTracing::category;
static const auto category = FormEditorTracing::category;
BackgroundAction::BackgroundAction(QObject *parent) :
QWidgetAction(parent)

View File

@@ -10,7 +10,7 @@
namespace QmlDesigner {
static auto category = FormEditorTracing::category;
static const auto category = FormEditorTracing::category;
BindingIndicator::BindingIndicator(LayerItem *layerItem)
: m_layerItem(layerItem)

View File

@@ -8,7 +8,7 @@
namespace QmlDesigner {
static auto category = FormEditorTracing::category;
static const auto category = FormEditorTracing::category;
BindingIndicatorGraphicsItem::BindingIndicatorGraphicsItem(QGraphicsItem *parent) :
QGraphicsObject(parent)

View File

@@ -12,7 +12,7 @@
namespace QmlDesigner {
static auto category = FormEditorTracing::category;
static const auto category = FormEditorTracing::category;
ControlElement::ControlElement(LayerItem *layerItem)
: m_controlShape(new QGraphicsRectItem(layerItem))

View File

@@ -30,7 +30,7 @@ static Q_LOGGING_CATEGORY(dragToolInfo, "qtc.qmldesigner.formeditor", QtWarningM
namespace QmlDesigner {
static auto category = FormEditorTracing::category;
static const auto category = FormEditorTracing::category;
DragTool::DragTool(FormEditorView *editorView)
: AbstractFormEditorTool(editorView),

View File

@@ -24,7 +24,7 @@
namespace QmlDesigner {
const int penWidth = 2;
static auto category = FormEditorTracing::category;
static const auto category = FormEditorTracing::category;
FormEditorAnnotationIcon::FormEditorAnnotationIcon(const ModelNode &modelNode, QGraphicsItem *parent)
: QGraphicsObject(parent)

View File

@@ -23,7 +23,7 @@
namespace QmlDesigner {
static auto category = FormEditorTracing::category;
static const auto category = FormEditorTracing::category;
FormEditorGraphicsView::FormEditorGraphicsView(QWidget *parent)
: QGraphicsView(parent)

View File

@@ -36,7 +36,7 @@ namespace QmlDesigner {
using NanotraceHR::keyValue;
static auto category = FormEditorTracing::category;
static const auto category = FormEditorTracing::category;
const int flowBlockSize = 200;
const int blockRadius = 18;

View File

@@ -33,7 +33,7 @@ namespace QmlDesigner {
using NanotraceHR::keyValue;
static auto category = FormEditorTracing::category;
static const auto category = FormEditorTracing::category;
FormEditorScene::FormEditorScene(FormEditorWidget *view, FormEditorView *editorView)
: QGraphicsScene()

View File

@@ -15,7 +15,7 @@
namespace QmlDesigner {
static auto category = FormEditorTracing::category;
static const auto category = FormEditorTracing::category;
const int toolButtonSize = 14;

View File

@@ -49,7 +49,7 @@ using NanotraceHR::keyValue;
namespace {
constexpr AuxiliaryDataKeyView autoSizeProperty{AuxiliaryDataType::Temporary, "autoSize"};
auto category = FormEditorTracing::category;
const auto category = FormEditorTracing::category;
}
FormEditorView::FormEditorView(ExternalDependenciesInterface &externalDependencies)

View File

@@ -51,7 +51,7 @@ namespace {
constexpr AuxiliaryDataKeyView formeditorZoomProperty{AuxiliaryDataType::NodeInstancePropertyOverwrite,
"formeditorZoom"};
auto category = FormEditorTracing::category;
const auto category = FormEditorTracing::category;
}
FormEditorWidget::FormEditorWidget(FormEditorView *view)

View File

@@ -12,7 +12,7 @@
namespace QmlDesigner {
static auto category = FormEditorTracing::category;
static const auto category = FormEditorTracing::category;
LayerItem::LayerItem(FormEditorScene* scene)
{

View File

@@ -9,7 +9,7 @@
namespace QmlDesigner {
static auto category = FormEditorTracing::category;
static const auto category = FormEditorTracing::category;
LineEditAction::LineEditAction(const QString &placeHolderText, QObject *parent) :
QWidgetAction(parent),

View File

@@ -25,7 +25,7 @@ static Q_LOGGING_CATEGORY(moveManipulatorInfo, "qtc.qmldesigner.formeditor", QtW
namespace QmlDesigner {
static auto category = FormEditorTracing::category;
static const auto category = FormEditorTracing::category;
MoveManipulator::MoveManipulator(LayerItem *layerItem, FormEditorView *view)
: m_layerItem(layerItem),

View File

@@ -20,7 +20,7 @@
namespace QmlDesigner {
static auto category = FormEditorTracing::category;
static const auto category = FormEditorTracing::category;
MoveTool::MoveTool(FormEditorView *editorView)
: AbstractFormEditorTool(editorView)

View File

@@ -10,7 +10,7 @@
namespace QmlDesigner {
static auto category = FormEditorTracing::category;
static const auto category = FormEditorTracing::category;
double sum(const QList<double> & list)
{

View File

@@ -13,7 +13,7 @@
namespace QmlDesigner {
static auto category = FormEditorTracing::category;
static const auto category = FormEditorTracing::category;
class ResizeControllerData
{

View File

@@ -9,7 +9,7 @@
namespace QmlDesigner {
static auto category = FormEditorTracing::category;
static const auto category = FormEditorTracing::category;
ResizeHandleItem::ResizeHandleItem(QGraphicsItem *parent, const ResizeController &resizeController)
: QGraphicsItem(parent),

View File

@@ -8,7 +8,7 @@
namespace QmlDesigner {
static auto category = FormEditorTracing::category;
static const auto category = FormEditorTracing::category;
ResizeIndicator::ResizeIndicator(LayerItem *layerItem)
: m_layerItem(layerItem)

View File

@@ -16,7 +16,7 @@
namespace QmlDesigner {
static auto category = FormEditorTracing::category;
static const auto category = FormEditorTracing::category;
ResizeManipulator::ResizeManipulator(LayerItem *layerItem, FormEditorView *view)
: m_view(view),

View File

@@ -16,7 +16,7 @@
namespace QmlDesigner {
static auto category = FormEditorTracing::category;
static const auto category = FormEditorTracing::category;
ResizeTool::ResizeTool(FormEditorView *editorView)
: AbstractFormEditorTool(editorView)

View File

@@ -16,7 +16,7 @@
namespace QmlDesigner {
static auto category = FormEditorTracing::category;
static const auto category = FormEditorTracing::category;
class RotationControllerData
{

View File

@@ -9,7 +9,7 @@
namespace QmlDesigner {
static auto category = FormEditorTracing::category;
static const auto category = FormEditorTracing::category;
RotationHandleItem::RotationHandleItem(QGraphicsItem *parent, const RotationController &rotationController)
: QGraphicsItem(parent)

View File

@@ -12,7 +12,7 @@
namespace QmlDesigner {
static auto category = FormEditorTracing::category;
static const auto category = FormEditorTracing::category;
RotationIndicator::RotationIndicator(LayerItem *layerItem)
: m_layerItem(layerItem)

View File

@@ -18,7 +18,7 @@
namespace QmlDesigner {
static auto category = FormEditorTracing::category;
static const auto category = FormEditorTracing::category;
RotationManipulator::RotationManipulator(LayerItem *layerItem, FormEditorView *view)
: m_view(view)

View File

@@ -16,7 +16,7 @@
namespace QmlDesigner {
static auto category = FormEditorTracing::category;
static const auto category = FormEditorTracing::category;
RotationTool::RotationTool(FormEditorView *editorView)
: AbstractFormEditorTool(editorView)

View File

@@ -10,7 +10,7 @@
namespace QmlDesigner {
static auto category = FormEditorTracing::category;
static const auto category = FormEditorTracing::category;
RubberBandSelectionManipulator::RubberBandSelectionManipulator(LayerItem *layerItem, FormEditorView *editorView)
: m_selectionRectangleElement(layerItem),

View File

@@ -8,7 +8,7 @@
namespace QmlDesigner {
static auto category = FormEditorTracing::category;
static const auto category = FormEditorTracing::category;
ScaleItem::ScaleItem(LayerItem *layerItem, ScaleIndicator *indicator)
: QGraphicsRectItem(layerItem),

View File

@@ -6,7 +6,7 @@
namespace QmlDesigner {
static auto category = FormEditorTracing::category;
static const auto category = FormEditorTracing::category;
ScaleManipulator::ScaleManipulator(LayerItem *layerItem, FormEditorItem *formEditorItem)
: m_layerItem(layerItem),

View File

@@ -14,7 +14,7 @@
namespace QmlDesigner {
static auto category = FormEditorTracing::category;
static const auto category = FormEditorTracing::category;
SeekerSlider::SeekerSlider(QWidget *parent)
: QSlider(parent)

View File

@@ -22,7 +22,7 @@
namespace QmlDesigner {
static auto category = FormEditorTracing::category;
static const auto category = FormEditorTracing::category;
SelectionIndicator::SelectionIndicator(LayerItem *layerItem)
: m_layerItem(layerItem)

View File

@@ -11,7 +11,7 @@
namespace QmlDesigner {
static auto category = FormEditorTracing::category;
static const auto category = FormEditorTracing::category;
SelectionRectangle::SelectionRectangle(LayerItem *layerItem)
: m_controlShape(new QGraphicsRectItem(layerItem)),

View File

@@ -20,7 +20,7 @@
namespace QmlDesigner {
static auto category = FormEditorTracing::category;
static const auto category = FormEditorTracing::category;
const int s_startDragDistance = 20;
const int s_startDragTime = 50;

View File

@@ -11,7 +11,7 @@
namespace QmlDesigner {
static auto category = FormEditorTracing::category;
static const auto category = FormEditorTracing::category;
SingleSelectionManipulator::SingleSelectionManipulator(FormEditorView *editorView)
: m_editorView(editorView),

View File

@@ -16,7 +16,7 @@
namespace QmlDesigner {
static auto category = FormEditorTracing::category;
static const auto category = FormEditorTracing::category;
Snapper::Snapper()
: m_containerFormEditorItem(nullptr),

View File

@@ -10,7 +10,7 @@
#include <QtDebug>
namespace QmlDesigner {
static auto category = FormEditorTracing::category;
static const auto category = FormEditorTracing::category;
SnappingLineCreator::SnappingLineCreator(FormEditorItem *formEditorItem)
: m_formEditorItem(formEditorItem),

View File

@@ -15,7 +15,7 @@
namespace QmlDesigner {
static auto category = FormEditorTracing::category;
static const auto category = FormEditorTracing::category;
ToolBox::ToolBox(QWidget *parentWidget)
: Utils::StyledBar(parentWidget)

View File

@@ -36,7 +36,7 @@
namespace QmlDesigner {
static auto category = FormEditorTracing::category;
static const auto category = FormEditorTracing::category;
static bool isTransitionSource(const ModelNode &node)
{

View File

@@ -12,7 +12,7 @@
namespace QmlDesigner {
static auto category = FormEditorTracing::category;
static const auto category = FormEditorTracing::category;
View3DTool::View3DTool()
: QObject(), AbstractCustomTool()

View File

@@ -16,7 +16,7 @@
namespace QmlDesigner {
static auto category = ItemLibraryTracing::category;
static const auto category = ItemLibraryTracing::category;
ItemLibraryAddImportModel::ItemLibraryAddImportModel(QObject *parent)
: QAbstractListModel(parent)

View File

@@ -16,7 +16,7 @@
namespace QmlDesigner {
static auto category = ItemLibraryTracing::category;
static const auto category = ItemLibraryTracing::category;
ItemLibraryCategoriesModel::ItemLibraryCategoriesModel(QObject *parent) :
QAbstractListModel(parent)

View File

@@ -11,7 +11,7 @@
namespace QmlDesigner {
static auto category = ItemLibraryTracing::category;
static const auto category = ItemLibraryTracing::category;
ItemLibraryCategory::ItemLibraryCategory(const QString &groupName, QObject *parent)
: QObject(parent),

View File

@@ -15,7 +15,7 @@
namespace QmlDesigner {
static auto category = ItemLibraryTracing::category;
static const auto category = ItemLibraryTracing::category;
QQuickImageResponse *ItemLibraryIconImageProvider::requestImageResponse(const QString &id,
const QSize &)

View File

@@ -9,7 +9,7 @@
namespace QmlDesigner {
static auto category = ItemLibraryTracing::category;
static const auto category = ItemLibraryTracing::category;
namespace Internal {

View File

@@ -7,7 +7,7 @@
namespace QmlDesigner {
static auto category = ItemLibraryTracing::category;
static const auto category = ItemLibraryTracing::category;
ItemLibraryImport::ItemLibraryImport(const Import &import, QObject *parent, SectionType sectionType)
: QObject(parent),

View File

@@ -8,7 +8,7 @@
namespace QmlDesigner {
static auto category = ItemLibraryTracing::category;
static const auto category = ItemLibraryTracing::category;
ItemLibraryItem::ItemLibraryItem(const ItemLibraryEntry &itemLibraryEntry, bool isUsable, QObject *parent)
: QObject(parent)

View File

@@ -11,7 +11,7 @@
namespace QmlDesigner {
static auto category = ItemLibraryTracing::category;
static const auto category = ItemLibraryTracing::category;
ItemLibraryItemsModel::ItemLibraryItemsModel(QObject *parent) :
QAbstractListModel(parent)

View File

@@ -30,7 +30,7 @@
namespace QmlDesigner {
static auto category = ItemLibraryTracing::category;
static const auto category = ItemLibraryTracing::category;
// sectionName can be an import url or a category name
void ItemLibraryModel::saveExpandedState(bool expanded, const QString &sectionName)

View File

@@ -26,7 +26,7 @@
namespace QmlDesigner {
static auto category = ItemLibraryTracing::category;
static const auto category = ItemLibraryTracing::category;
ItemLibraryView::ItemLibraryView(AsynchronousImageCache &imageCache,
ExternalDependenciesInterface &externalDependencies)

View File

@@ -66,7 +66,7 @@
namespace QmlDesigner {
static auto category = ItemLibraryTracing::category;
static const auto category = ItemLibraryTracing::category;
static QString propertyEditorResourcesPath()
{

View File

@@ -11,7 +11,7 @@
namespace QmlDesigner {
static auto category = NavigatorTracing::category;
static const auto category = NavigatorTracing::category;
// This will filter and return possible properties that the given type can be bound to
ChooseFromPropertyListFilter::ChooseFromPropertyListFilter(const NodeMetaInfo &insertInfo,

View File

@@ -23,7 +23,7 @@
namespace QmlDesigner {
static auto category = NavigatorTracing::category;
static const auto category = NavigatorTracing::category;
IconCheckboxItemDelegate::IconCheckboxItemDelegate(QObject *parent, const QIcon &icon)
: QStyledItemDelegate(parent),

View File

@@ -31,7 +31,7 @@
namespace QmlDesigner {
static auto category = NavigatorTracing::category;
static const auto category = NavigatorTracing::category;
int NameItemDelegate::iconOffset = 0;

View File

@@ -17,7 +17,7 @@
namespace QmlDesigner {
static auto category = NavigatorTracing::category;
static const auto category = NavigatorTracing::category;
LineEdit::LineEdit(QWidget *parent)
: QLineEdit(parent)

View File

@@ -57,7 +57,7 @@
namespace QmlDesigner {
static auto category = NavigatorTracing::category;
static const auto category = NavigatorTracing::category;
static QList<ModelNode> modelNodesFromMimeData(const QMimeData *mimeData, AbstractView *view)
{

View File

@@ -33,7 +33,7 @@ namespace QmlDesigner {
namespace {
auto category = NavigatorTracing::category;
const auto category = NavigatorTracing::category;
// This style basically allows us to span the entire row
// including the arrow indicators which would otherwise not be

View File

@@ -30,7 +30,7 @@ using namespace Core;
namespace QmlDesigner {
static auto category = NavigatorTracing::category;
static const auto category = NavigatorTracing::category;
NavigatorWidget::NavigatorWidget(NavigatorView *view)
: m_treeView(new NavigatorTreeView)

View File

@@ -12,7 +12,7 @@
namespace QmlDesigner {
static auto category = NavigatorTracing::category;
static const auto category = NavigatorTracing::category;
PreviewToolTip::PreviewToolTip(QWidget *parent)
: QWidget(parent)

View File

@@ -25,7 +25,7 @@ using namespace Utils;
namespace QmlDesigner {
static auto category = PropertyEditorTracing::category;
static const auto category = PropertyEditorTracing::category;
AlignDistribute::AlignDistribute(QObject *parent)
: QObject(parent)

View File

@@ -23,7 +23,7 @@ namespace QmlDesigner {
QPointer<ColorPaletteBackend> ColorPaletteBackend::m_instance = nullptr;
static auto category = PropertyEditorTracing::category;
static const auto category = PropertyEditorTracing::category;
ColorPaletteBackend::ColorPaletteBackend()
: m_currentPalette()

View File

@@ -12,7 +12,7 @@
namespace QmlDesigner {
static auto category = PropertyEditorTracing::category;
static const auto category = PropertyEditorTracing::category;
/*!
* \internal

View File

@@ -7,7 +7,7 @@
namespace QmlDesigner {
static auto category = PropertyEditorTracing::category;
static const auto category = PropertyEditorTracing::category;
DesignerPropertyMap::DesignerPropertyMap(QObject *parent) : QQmlPropertyMap(parent)
{

View File

@@ -46,7 +46,7 @@
namespace QmlDesigner {
static auto category = PropertyEditorTracing::category;
static const auto category = PropertyEditorTracing::category;
static const int propertyNameRole = Qt::UserRole + 1;
static const int propertyTypeRole = Qt::UserRole + 2;

View File

@@ -51,7 +51,7 @@ enum {
namespace QmlDesigner {
static auto category = PropertyEditorTracing::category;
static const auto category = PropertyEditorTracing::category;
constexpr QStringView quick3dImport{u"QtQuick3D"};

View File

@@ -10,7 +10,7 @@
namespace QmlDesigner {
static auto category = PropertyEditorTracing::category;
static const auto category = PropertyEditorTracing::category;
PropertyEditorWidget::PropertyEditorWidget(QWidget *parent) : QStackedWidget(parent)
{

View File

@@ -39,7 +39,7 @@ namespace {
using NanotraceHR::keyValue;
using Storage::ModuleKind;
auto category = ModelTracing::category;
const auto category = ModelTracing::category;
struct TypeDescription
{

View File

@@ -22,7 +22,7 @@ namespace QmlDesigner {
using namespace QmlDesigner::Internal;
using NanotraceHR::keyValue;
static auto category = ModelTracing::category;
static const auto category = ModelTracing::category;
/*!
\class QmlDesigner::ModelNode

View File

@@ -5,7 +5,7 @@
namespace QmlDesigner {
static auto category = ModelTracing::category;
static const auto category = ModelTracing::category;
AnchorLine::AnchorLine()
: m_qmlItemNode(QmlItemNode())

View File

@@ -16,7 +16,7 @@ namespace QmlDesigner {
using NanotraceHR::keyValue;
static auto category = ModelTracing::category;
static const auto category = ModelTracing::category;
bool Qml3DNode::isValid(SL sl) const
{

View File

@@ -11,7 +11,7 @@ namespace QmlDesigner {
using NanotraceHR::keyValue;
static auto category = ModelTracing::category;
static const auto category = ModelTracing::category;
static PropertyName lineTypeToString(AnchorLineType lineType)
{

View File

@@ -13,7 +13,7 @@ namespace QmlDesigner {
using NanotraceHR::keyValue;
static auto category = ModelTracing::category;
static const auto category = ModelTracing::category;
ModelNode QmlModelStateOperation::target(SL sl) const
{

View File

@@ -11,7 +11,7 @@ namespace QmlDesigner {
using NanotraceHR::keyValue;
static auto category = ModelTracing::category;
static const auto category = ModelTracing::category;
bool QmlConnections::isValid(SL sl) const
{

View File

@@ -30,7 +30,7 @@ namespace QmlDesigner {
using NanotraceHR::keyValue;
static auto category = ModelTracing::category;
static const auto category = ModelTracing::category;
bool QmlItemNode::isItemOrWindow(const ModelNode &modelNode, SL sl)
{

View File

@@ -8,7 +8,7 @@ namespace QmlDesigner {
using NanotraceHR::keyValue;
static auto category = ModelTracing::category;
static const auto category = ModelTracing::category;
AbstractView *QmlModelNodeFacade::view() const
{

View File

@@ -31,7 +31,7 @@ namespace QmlDesigner {
using NanotraceHR::keyValue;
static auto category = ModelTracing::category;
static const auto category = ModelTracing::category;
void QmlObjectNode::setVariantProperty(PropertyNameView name, const QVariant &value, SL sl)
{

View File

@@ -17,7 +17,7 @@ namespace QmlDesigner {
using NanotraceHR::keyValue;
static auto category = ModelTracing::category;
static const auto category = ModelTracing::category;
QmlPropertyChanges QmlModelState::propertyChanges(const ModelNode &node, SL sl)
{

View File

@@ -19,7 +19,7 @@ namespace QmlDesigner {
using NanotraceHR::keyValue;
static auto category = ModelTracing::category;
static const auto category = ModelTracing::category;
bool QmlTimeline::isValid(SL sl) const
{

View File

@@ -20,7 +20,7 @@ namespace QmlDesigner {
using NanotraceHR::keyValue;
static auto category = ModelTracing::category;
static const auto category = ModelTracing::category;
bool QmlTimelineKeyframeGroup::isValid(SL sl) const
{

View File

@@ -31,7 +31,7 @@ namespace QmlDesigner {
using NanotraceHR::keyValue;
static auto category = ModelTracing::category;
static const auto category = ModelTracing::category;
static char imagePlaceHolder[] = "qrc:/qtquickplugin/images/template_image.png";