QmlDesigner: Adapt to C++ 17 [[maybe_unused]]

It has the advantage to to move the attribute to the declaration instead
of using a workaround.

Change-Id: I08b712f146a0625d0367657c31d6c1e5f7caec41
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
This commit is contained in:
Marco Bubke
2022-07-07 18:04:18 +02:00
committed by Tim Jenssen
parent 67324512e9
commit 9faf6d0826
71 changed files with 220 additions and 396 deletions

View File

@@ -103,9 +103,8 @@ instanceInformationsChanged(const QMultiHash<ModelNode, InformationName> &inform
handleMaybeDone();
}
void AssetExporterView::instancesPreviewImageChanged(const QVector<ModelNode> &nodeList)
void AssetExporterView::instancesPreviewImageChanged([[maybe_unused]] const QVector<ModelNode> &nodeList)
{
Q_UNUSED(nodeList);
emit previewChanged();
}

View File

@@ -56,9 +56,8 @@ bool QmlDesigner::ItemNodeDumper::isExportable() const
return lineage().contains("QtQuick.Item");
}
QJsonObject QmlDesigner::ItemNodeDumper::json(QmlDesigner::Component &component) const
QJsonObject QmlDesigner::ItemNodeDumper::json([[maybe_unused]] QmlDesigner::Component &component) const
{
Q_UNUSED(component);
const QmlObjectNode &qmlObjectNode = objectNode();
QJsonObject jsonObject;

View File

@@ -71,9 +71,8 @@ bool TextNodeDumper::isExportable() const
});
}
QJsonObject TextNodeDumper::json(Component &component) const
QJsonObject TextNodeDumper::json([[maybe_unused]] Component &component) const
{
Q_UNUSED(component);
QJsonObject jsonObject = ItemNodeDumper::json(component);
QJsonObject textDetails;

View File

@@ -107,9 +107,10 @@ void AnnotationListModel::fillModel()
}
}
QModelIndex AnnotationListModel::index(int row, int column, const QModelIndex &parent) const
QModelIndex AnnotationListModel::index(int row,
int column,
[[maybe_unused]] const QModelIndex &parent) const
{
Q_UNUSED(parent)
return createIndex(row, column);
}

View File

@@ -83,9 +83,8 @@ QCompleter *CommentDelegate::completer() const
void CommentDelegate::updateEditorGeometry(QWidget *editor,
const QStyleOptionViewItem &option,
const QModelIndex &index) const
[[maybe_unused]] const QModelIndex &index) const
{
Q_UNUSED(index)
editor->setGeometry(option.rect);
}
@@ -102,12 +101,9 @@ CommentTitleDelegate::CommentTitleDelegate(QObject *parent)
CommentTitleDelegate::~CommentTitleDelegate() {}
QWidget *CommentTitleDelegate::createEditor(QWidget *parent,
const QStyleOptionViewItem &option,
const QModelIndex &index) const
[[maybe_unused]] const QStyleOptionViewItem &option,
[[maybe_unused]] const QModelIndex &index) const
{
Q_UNUSED(option)
Q_UNUSED(index)
auto *editor = new QComboBox(parent);
editor->setEditable(true);
editor->setCompleter(completer());

View File

@@ -70,10 +70,8 @@ bool AssetsLibraryDirsModel::setData(const QModelIndex &index, const QVariant &v
return false;
}
int AssetsLibraryDirsModel::rowCount(const QModelIndex &parent) const
int AssetsLibraryDirsModel::rowCount([[maybe_unused]] const QModelIndex &parent) const
{
Q_UNUSED(parent)
return m_dirs.size();
}

View File

@@ -57,10 +57,8 @@ QVariant AssetsLibraryFilesModel::data(const QModelIndex &index, int role) const
return {};
}
int AssetsLibraryFilesModel::rowCount(const QModelIndex &parent) const
int AssetsLibraryFilesModel::rowCount([[maybe_unused]] const QModelIndex &parent) const
{
Q_UNUSED(parent)
return m_files.size();
}

View File

@@ -283,10 +283,8 @@ QVariant AssetsLibraryModel::data(const QModelIndex &index, int role) const
return {};
}
int AssetsLibraryModel::rowCount(const QModelIndex &parent) const
int AssetsLibraryModel::rowCount([[maybe_unused]] const QModelIndex &parent) const
{
Q_UNUSED(parent)
return 1;
}

View File

@@ -139,8 +139,9 @@ AssetsLibraryWidget::AssetsLibraryWidget(AsynchronousImageCache &asynchronousFon
// If project directory contents change, or one of the asset files is modified, we must
// reconstruct the model to update the icons
connect(m_fileSystemWatcher, &Utils::FileSystemWatcher::directoryChanged, [this](const QString & changedDirPath) {
Q_UNUSED(changedDirPath)
connect(m_fileSystemWatcher,
&Utils::FileSystemWatcher::directoryChanged,
[this]([[maybe_unused]] const QString &changedDirPath) {
m_assetCompressionTimer.start();
});

View File

@@ -229,10 +229,8 @@ void ActionEditorDialog::setAllConnections(const QList<ConnectionOption> &connec
m_lock = false;
}
void ActionEditorDialog::updateComboBoxes(int index, ComboBox type)
void ActionEditorDialog::updateComboBoxes([[maybe_unused]] int index, ComboBox type)
{
Q_UNUSED(index)
const int currentType = m_comboBoxType->currentIndex();
const int currentStack = m_stackedLayout->currentIndex();
bool typeChanged = false;

View File

@@ -99,9 +99,8 @@ bool BindingEditorWidget::event(QEvent *event)
}
TextEditor::AssistInterface *BindingEditorWidget::createAssistInterface(
TextEditor::AssistKind assistKind, TextEditor::AssistReason assistReason) const
[[maybe_unused]] TextEditor::AssistKind assistKind, TextEditor::AssistReason assistReason) const
{
Q_UNUSED(assistKind)
return new QmlJSEditor::QmlJSCompletionAssistInterface(
textCursor(), Utils::FilePath(),
assistReason, qmljsdocument->semanticInfo());

View File

@@ -53,39 +53,34 @@ bool ConnectionVisitor::visit(QmlJS::AST::NumericLiteral *ast)
return true;
}
bool ConnectionVisitor::visit(QmlJS::AST::TrueLiteral *ast)
bool ConnectionVisitor::visit([[maybe_unused]] QmlJS::AST::TrueLiteral *ast)
{
Q_UNUSED(ast)
m_expression.append(qMakePair(QmlJS::AST::Node::Kind::Kind_TrueLiteral, QString("true")));
return true;
}
bool ConnectionVisitor::visit(QmlJS::AST::FalseLiteral *ast)
bool ConnectionVisitor::visit([[maybe_unused]] QmlJS::AST::FalseLiteral *ast)
{
Q_UNUSED(ast)
m_expression.append(qMakePair(QmlJS::AST::Node::Kind::Kind_FalseLiteral, QString("false")));
return true;
}
bool ConnectionVisitor::visit(QmlJS::AST::BinaryExpression *ast)
bool ConnectionVisitor::visit([[maybe_unused]] QmlJS::AST::BinaryExpression *ast)
{
Q_UNUSED(ast)
m_expression.append(qMakePair(QmlJS::AST::Node::Kind::Kind_BinaryExpression,
QString()));
return true;
}
bool ConnectionVisitor::visit(QmlJS::AST::CallExpression *ast)
bool ConnectionVisitor::visit([[maybe_unused]] QmlJS::AST::CallExpression *ast)
{
Q_UNUSED(ast)
m_expression.append(qMakePair(QmlJS::AST::Node::Kind::Kind_CallExpression,
QString()));
return true;
}
bool ConnectionVisitor::visit(QmlJS::AST::ArgumentList *ast)
bool ConnectionVisitor::visit([[maybe_unused]] QmlJS::AST::ArgumentList *ast)
{
Q_UNUSED(ast)
m_expression.append(qMakePair(QmlJS::AST::Node::Kind::Kind_ArgumentList,
QString()));
return true;

View File

@@ -77,12 +77,10 @@ void SignalListDelegate::paint(QPainter *painter,
}
bool SignalListDelegate::editorEvent(QEvent *event,
QAbstractItemModel *model,
[[maybe_unused]] QAbstractItemModel *model,
const QStyleOptionViewItem &option,
const QModelIndex &index)
{
Q_UNUSED(model)
if (index.column() == SignalListModel::ButtonColumn
&& event->type() == QEvent::MouseButtonRelease) {
QMouseEvent *mouseEvent = static_cast<QMouseEvent *>(event);

View File

@@ -40,7 +40,7 @@ public:
DefaultAction(const QString &description);
// virtual function instead of slot
virtual void actionTriggered(bool enable) { Q_UNUSED(enable) }
virtual void actionTriggered([[maybe_unused]] bool enable) {}
void setSelectionContext(const SelectionContext &selectionContext);
protected:

View File

@@ -48,10 +48,10 @@ static Utils::FilePath iconPath()
"qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/images/");
}
QPixmap QmlDesignerIconProvider::requestPixmap(const QString &id, QSize *size, const QSize &requestedSize)
QPixmap QmlDesignerIconProvider::requestPixmap(const QString &id,
QSize *size,
[[maybe_unused]] const QSize &requestedSize)
{
Q_UNUSED(requestedSize)
QPixmap result = getPixmap(id);
if (size)

View File

@@ -125,11 +125,10 @@ QString Theme::replaceCssColors(const QString &input)
void Theme::setupTheme(QQmlEngine *engine)
{
static const int typeIndex = qmlRegisterSingletonType<Theme>(
[[maybe_unused]] static const int typeIndex = qmlRegisterSingletonType<Theme>(
"QtQuickDesignerTheme", 1, 0, "Theme", [](QQmlEngine *, QJSEngine *) {
return new Theme(Utils::creatorTheme(), nullptr);
});
Q_UNUSED(typeIndex)
engine->addImageProvider(QLatin1String("icons"), new QmlDesignerIconProvider());
}

View File

@@ -99,9 +99,8 @@ void BindingModel::bindingRemoved(const BindingProperty &bindingProperty)
m_handleDataChanged = true;
}
void BindingModel::selectionChanged(const QList<ModelNode> &selectedNodes)
void BindingModel::selectionChanged([[maybe_unused]] const QList<ModelNode> &selectedNodes)
{
Q_UNUSED(selectedNodes)
m_handleDataChanged = false;
resetModel();
m_handleDataChanged = true;

View File

@@ -176,12 +176,10 @@ void ConnectionView::selectedNodesChanged(const QList<ModelNode> & selectedNodeL
emit connectionViewWidget()->setEnabledAddButton(selectedNodeList.count() == 1);
}
void ConnectionView::auxiliaryDataChanged(const ModelNode &node,
void ConnectionView::auxiliaryDataChanged([[maybe_unused]] const ModelNode &node,
const PropertyName &name,
const QVariant &data)
{
Q_UNUSED(node)
// Check if the auxiliary data is actually the locked property or if it is unlocked
if (name != QmlDesigner::lockedProperty || !data.toBool())
return;

View File

@@ -281,9 +281,8 @@ void DynamicPropertiesModel::bindingRemoved(const BindingProperty &bindingProper
m_handleDataChanged = true;
}
void DynamicPropertiesModel::selectionChanged(const QList<ModelNode> &selectedNodes)
void DynamicPropertiesModel::selectionChanged([[maybe_unused]] const QList<ModelNode> &selectedNodes)
{
Q_UNUSED(selectedNodes)
m_handleDataChanged = false;
resetModel();
m_handleDataChanged = true;

View File

@@ -40,13 +40,12 @@
namespace QmlDesigner {
CurveEditorView::CurveEditorView(QObject *parent)
CurveEditorView::CurveEditorView([[maybe_unused]] QObject *parent)
: AbstractView(parent)
, m_block(false)
, m_model(new CurveEditorModel())
, m_editor(new CurveEditor(m_model))
{
Q_UNUSED(parent);
connect(m_model, &CurveEditorModel::commitCurrentFrame, this, &CurveEditorView::commitCurrentFrame);
connect(m_model, &CurveEditorModel::commitStartFrame, this, &CurveEditorView::commitStartFrame);
connect(m_model, &CurveEditorModel::commitEndFrame, this, &CurveEditorView::commitEndFrame);
@@ -92,13 +91,10 @@ bool dirtyfiesView(const ModelNode &node)
|| QmlTimelineKeyframeGroup::isValidQmlTimelineKeyframeGroup(node);
}
void CurveEditorView::nodeRemoved(const ModelNode &removedNode,
void CurveEditorView::nodeRemoved([[maybe_unused]] const ModelNode &removedNode,
const NodeAbstractProperty &parentProperty,
PropertyChangeFlags propertyChange)
[[maybe_unused]] PropertyChangeFlags propertyChange)
{
Q_UNUSED(removedNode);
Q_UNUSED(propertyChange);
if (!parentProperty.isValid())
return;
@@ -110,16 +106,11 @@ void CurveEditorView::nodeRemoved(const ModelNode &removedNode,
m_model->reset({});
}
void CurveEditorView::nodeReparented(const ModelNode &node,
const NodeAbstractProperty &newPropertyParent,
const NodeAbstractProperty &oldPropertyParent,
PropertyChangeFlags propertyChange)
void CurveEditorView::nodeReparented([[maybe_unused]] const ModelNode &node,
[[maybe_unused]] const NodeAbstractProperty &newPropertyParent,
[[maybe_unused]] const NodeAbstractProperty &oldPropertyParent,
[[maybe_unused]] PropertyChangeFlags propertyChange)
{
Q_UNUSED(node);
Q_UNUSED(newPropertyParent);
Q_UNUSED(oldPropertyParent);
Q_UNUSED(propertyChange);
ModelNode parent = newPropertyParent.parentModelNode();
if (newPropertyParent.isValid() && dirtyfiesView(parent))
updateKeyframes();
@@ -144,10 +135,9 @@ void CurveEditorView::auxiliaryDataChanged(const ModelNode &node,
}
}
void CurveEditorView::instancePropertyChanged(const QList<QPair<ModelNode, PropertyName>> &propertyList)
void CurveEditorView::instancePropertyChanged(
[[maybe_unused]] const QList<QPair<ModelNode, PropertyName>> &propertyList)
{
Q_UNUSED(propertyList);
if (auto timeline = activeTimeline(); timeline.isValid()) {
auto timelineNode = timeline.modelNode();
@@ -168,12 +158,9 @@ void CurveEditorView::instancePropertyChanged(const QList<QPair<ModelNode, Prope
}
}
void CurveEditorView::variantPropertiesChanged(const QList<VariantProperty> &propertyList,
PropertyChangeFlags propertyChange)
void CurveEditorView::variantPropertiesChanged([[maybe_unused]] const QList<VariantProperty> &propertyList,
[[maybe_unused]] PropertyChangeFlags propertyChange)
{
Q_UNUSED(propertyList);
Q_UNUSED(propertyChange);
for (const auto &property : propertyList) {
if ((property.name() == "frame" || property.name() == "value")
&& property.parentModelNode().type() == "QtQuick.Timeline.Keyframe"
@@ -186,12 +173,9 @@ void CurveEditorView::variantPropertiesChanged(const QList<VariantProperty> &pro
}
}
void CurveEditorView::bindingPropertiesChanged(const QList<BindingProperty> &propertyList,
PropertyChangeFlags propertyChange)
void CurveEditorView::bindingPropertiesChanged([[maybe_unused]] const QList<BindingProperty> &propertyList,
[[maybe_unused]] PropertyChangeFlags propertyChange)
{
Q_UNUSED(propertyList);
Q_UNUSED(propertyChange);
for (const auto &property : propertyList) {
if (property.name() == "easing.bezierCurve") {
updateKeyframes();
@@ -199,10 +183,8 @@ void CurveEditorView::bindingPropertiesChanged(const QList<BindingProperty> &pro
}
}
void CurveEditorView::propertiesRemoved(const QList<AbstractProperty> &propertyList)
void CurveEditorView::propertiesRemoved([[maybe_unused]] const QList<AbstractProperty> &propertyList)
{
Q_UNUSED(propertyList);
for (const auto &property : propertyList) {
if (property.name() == "keyframes" && property.parentModelNode().isValid()) {
ModelNode parent = property.parentModelNode();

View File

@@ -257,7 +257,7 @@ void GraphicsScene::removeCurveItem(unsigned int id)
}
if (tmp) {
Q_UNUSED(m_curves.removeOne(tmp));
m_curves.removeOne(tmp);
delete tmp;
}

View File

@@ -119,14 +119,13 @@ void HandleItem::underMouseCallback()
gscene->handleUnderMouse(this);
}
void HandleItem::paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget)
void HandleItem::paint(QPainter *painter,
[[maybe_unused]] const QStyleOptionGraphicsItem *option,
[[maybe_unused]] QWidget *widget)
{
if (locked())
return;
Q_UNUSED(option)
Q_UNUSED(widget)
QColor handleColor(selected() ? m_style.selectionColor : m_style.color);
if (activated())

View File

@@ -66,11 +66,10 @@ QRectF KeyframeItem::boundingRect() const
return QRectF(topLeft, -topLeft);
}
void KeyframeItem::paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget)
void KeyframeItem::paint(QPainter *painter,
[[maybe_unused]] const QStyleOptionGraphicsItem *option,
[[maybe_unused]] QWidget *widget)
{
Q_UNUSED(option)
Q_UNUSED(widget)
QColor mainColor = selected() ? m_style.selectionColor : m_style.color;
QColor borderColor = isUnified() ? m_style.unifiedColor : m_style.splitColor;

View File

@@ -147,9 +147,8 @@ void Playhead::mouseMoveOutOfBounds(GraphicsView *view)
m_timer.start();
}
void Playhead::mouseRelease(GraphicsView *view)
void Playhead::mouseRelease([[maybe_unused]] GraphicsView *view)
{
Q_UNUSED(view);
m_moving = false;
}

View File

@@ -121,10 +121,9 @@ void SelectionModel::selectPaths(const std::vector<TreeItem::Path> &selection)
}
}
void SelectionModel::changeSelection(const QItemSelection &selected, const QItemSelection &deselected)
void SelectionModel::changeSelection([[maybe_unused]] const QItemSelection &selected,
[[maybe_unused]] const QItemSelection &deselected)
{
Q_UNUSED(selected)
Q_UNUSED(deselected)
emit curvesSelected();
}

View File

@@ -123,10 +123,8 @@ void Selector::mouseMove(QMouseEvent *event,
}
}
void Selector::mouseRelease(QMouseEvent *event, GraphicsScene *scene)
void Selector::mouseRelease([[maybe_unused]] QMouseEvent *event, GraphicsScene *scene)
{
Q_UNUSED(event)
applyPreSelection(scene);
m_shortcut = Shortcut();

View File

@@ -182,9 +182,8 @@ int TreeModel::rowCount(const QModelIndex &parent) const
return parentItem->rowCount();
}
int TreeModel::columnCount(const QModelIndex &parent) const
int TreeModel::columnCount([[maybe_unused]] const QModelIndex &parent) const
{
Q_UNUSED(parent)
return m_root->columnCount();
}

View File

@@ -263,12 +263,13 @@ void TreeItem::setPinned(bool pinned)
m_pinned = pinned;
}
NodeTreeItem::NodeTreeItem(const QString &name, const QIcon &icon, const std::vector<QString> &parentIds)
NodeTreeItem::NodeTreeItem(const QString &name,
[[maybe_unused]] const QIcon &icon,
const std::vector<QString> &parentIds)
: TreeItem(name)
, m_icon(icon)
, m_parentIds(parentIds)
{
Q_UNUSED(icon)
}
NodeTreeItem *NodeTreeItem::asNodeItem()

View File

@@ -522,9 +522,8 @@ void DebugView::currentStateChanged(const ModelNode &/*node*/)
}
void DebugView::nodeOrderChanged(const NodeListProperty &listProperty)
void DebugView::nodeOrderChanged([[maybe_unused]] const NodeListProperty &listProperty)
{
Q_UNUSED(listProperty)
if (isDebugViewEnabled()) {
QTextStream message;
QString string;

View File

@@ -93,9 +93,8 @@ QByteArray Edit3DAction::category() const
return QByteArray();
}
bool Edit3DAction::isVisible(const SelectionContext &selectionContext) const
bool Edit3DAction::isVisible([[maybe_unused]] const SelectionContext &selectionContext) const
{
Q_UNUSED(selectionContext)
return true;
}

View File

@@ -142,10 +142,8 @@ void Edit3DCanvas::keyReleaseEvent(QKeyEvent *e)
QWidget::keyReleaseEvent(e);
}
void Edit3DCanvas::paintEvent(QPaintEvent *e)
void Edit3DCanvas::paintEvent([[maybe_unused]] QPaintEvent *e)
{
Q_UNUSED(e)
QWidget::paintEvent(e);
QPainter painter(this);

View File

@@ -85,10 +85,9 @@ Edit3DWidget *Edit3DView::edit3DWidget() const
return m_edit3DWidget.data();
}
void Edit3DView::selectedNodesChanged(const QList<ModelNode> &selectedNodeList, const QList<ModelNode> &lastSelectedNodeList)
void Edit3DView::selectedNodesChanged([[maybe_unused]] const QList<ModelNode> &selectedNodeList,
[[maybe_unused]] const QList<ModelNode> &lastSelectedNodeList)
{
Q_UNUSED(selectedNodeList)
Q_UNUSED(lastSelectedNodeList)
SelectionContext selectionContext(this);
selectionContext.setUpdateMode(SelectionContext::UpdateMode::Fast);
if (m_alignCamerasAction)
@@ -219,22 +218,17 @@ void Edit3DView::modelAboutToBeDetached(Model *model)
AbstractView::modelAboutToBeDetached(model);
}
void Edit3DView::importsChanged(const QList<Import> &addedImports,
const QList<Import> &removedImports)
void Edit3DView::importsChanged([[maybe_unused]] const QList<Import> &addedImports,
[[maybe_unused]] const QList<Import> &removedImports)
{
Q_UNUSED(addedImports)
Q_UNUSED(removedImports)
checkImports();
}
void Edit3DView::customNotification(const AbstractView *view, const QString &identifier,
const QList<ModelNode> &nodeList, const QList<QVariant> &data)
void Edit3DView::customNotification([[maybe_unused]] const AbstractView *view,
const QString &identifier,
[[maybe_unused]] const QList<ModelNode> &nodeList,
[[maybe_unused]] const QList<QVariant> &data)
{
Q_UNUSED(view)
Q_UNUSED(nodeList)
Q_UNUSED(data)
if (identifier == "asset_import_update")
resetPuppet();
}

View File

@@ -221,9 +221,8 @@ void Edit3DWidget::showBackgroundColorMenu(bool show, const QPoint &pos)
m_backgroundColorMenu->close();
}
void Edit3DWidget::linkActivated(const QString &link)
void Edit3DWidget::linkActivated([[maybe_unused]] const QString &link)
{
Q_UNUSED(link)
if (m_view)
m_view->addQuick3DImport();
}

View File

@@ -145,9 +145,8 @@ void EventListDialog::initialize(EventList &events)
m_table->setColumnHidden(EventListModel::connectColumn, true);
}
void EventListDialog::closeEvent(QCloseEvent *event)
void EventListDialog::closeEvent([[maybe_unused]] QCloseEvent *event)
{
Q_UNUSED(event);
if (auto *view = EventList::nodeListView())
view->reset();
}

View File

@@ -130,7 +130,7 @@ bool NodeListView::removeEventIds(int nodeId, const QStringList &eventIds)
if (auto node = compatibleModelNode(nodeId); node.isValid()) {
QStringList events = eventIdsFromVariant(node.variantProperty("eventIds").value());
for (auto &&remove : eventIds)
Q_UNUSED(events.removeOne(remove));
events.removeOne(remove);
return setEventIds(node, events);
}
@@ -227,7 +227,7 @@ bool setEventIdsInModelNode(AbstractView *view, const ModelNode &node, const QSt
}
} else {
QStringList copy(events);
Q_UNUSED(copy.removeDuplicates());
copy.removeDuplicates();
QString value = events.join(", ");
return view->executeInTransaction("NodeListView::setEventIds", [=]() {
node.variantProperty("eventIds").setValue(value);

View File

@@ -2075,10 +2075,10 @@ void FormEditorFlowDecisionItem::updateGeometry()
setTransform(QTransform::fromTranslate(pos.x(), pos.y()));
}
void FormEditorFlowDecisionItem::paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget)
void FormEditorFlowDecisionItem::paint(QPainter *painter,
[[maybe_unused]] const QStyleOptionGraphicsItem *option,
[[maybe_unused]] QWidget *widget)
{
Q_UNUSED(option)
Q_UNUSED(widget)
if (!painter->isActive())
return;
@@ -2215,9 +2215,8 @@ void FormEditorFlowDecisionItem::paint(QPainter *painter, const QStyleOptionGrap
painter->restore();
}
bool FormEditorFlowDecisionItem::flowHitTest(const QPointF &point) const
bool FormEditorFlowDecisionItem::flowHitTest([[maybe_unused]] const QPointF &point) const
{
Q_UNUSED(point)
return true;
}
@@ -2244,12 +2243,9 @@ QPointF FormEditor3dPreview::instancePosition() const
}
void FormEditor3dPreview::paint(QPainter *painter,
const QStyleOptionGraphicsItem *option,
QWidget *widget)
[[maybe_unused]] const QStyleOptionGraphicsItem *option,
[[maybe_unused]] QWidget *widget)
{
Q_UNUSED(option)
Q_UNUSED(widget)
if (!painter->isActive())
return;

View File

@@ -350,9 +350,9 @@ void FormEditorView::nodeReparented(const ModelNode &node, const NodeAbstractPro
addOrRemoveFormEditorItem(node);
}
void FormEditorView::nodeSourceChanged(const ModelNode &node, const QString &newNodeSource)
void FormEditorView::nodeSourceChanged(const ModelNode &node,
[[maybe_unused]] const QString &newNodeSource)
{
Q_UNUSED(newNodeSource)
addOrRemoveFormEditorItem(node);
}
@@ -416,10 +416,10 @@ void FormEditorView::selectedNodesChanged(const QList<ModelNode> &selectedNodeLi
}
}
void FormEditorView::variantPropertiesChanged(const QList<VariantProperty> &propertyList,
AbstractView::PropertyChangeFlags propertyChange)
void FormEditorView::variantPropertiesChanged(
const QList<VariantProperty> &propertyList,
[[maybe_unused]] AbstractView::PropertyChangeFlags propertyChange)
{
Q_UNUSED(propertyChange)
for (const VariantProperty &property : propertyList) {
QmlVisualNode node(property.parentModelNode());
if (node.isFlowTransition() || node.isFlowDecision()) {
@@ -431,10 +431,10 @@ void FormEditorView::variantPropertiesChanged(const QList<VariantProperty> &prop
}
}
void FormEditorView::bindingPropertiesChanged(const QList<BindingProperty> &propertyList,
AbstractView::PropertyChangeFlags propertyChange)
void FormEditorView::bindingPropertiesChanged(
const QList<BindingProperty> &propertyList,
[[maybe_unused]] AbstractView::PropertyChangeFlags propertyChange)
{
Q_UNUSED(propertyChange)
for (const BindingProperty &property : propertyList) {
QmlVisualNode node(property.parentModelNode());
if (node.isFlowTransition()) {

View File

@@ -55,9 +55,8 @@ SeekerSlider::SeekerSlider(QWidget *parentWidget)
setProperty("panelwidget_singlerow", true);
}
void SeekerSlider::paintEvent(QPaintEvent *event)
void SeekerSlider::paintEvent([[maybe_unused]] QPaintEvent *event)
{
Q_UNUSED(event)
QPainter painter(this);
{
QStyleOptionToolBar option;

View File

@@ -138,10 +138,9 @@ void ItemLibraryAssetImporter::addInfo(const QString &infoMsg, const QString &sr
emit infoReported(infoMsg, srcPath);
}
void ItemLibraryAssetImporter::importProcessFinished(int exitCode, QProcess::ExitStatus exitStatus)
void ItemLibraryAssetImporter::importProcessFinished([[maybe_unused]] int exitCode,
QProcess::ExitStatus exitStatus)
{
Q_UNUSED(exitCode)
m_puppetProcess.reset();
if (m_parseData.contains(m_currentImportId)) {
@@ -184,11 +183,9 @@ void ItemLibraryAssetImporter::importProcessFinished(int exitCode, QProcess::Exi
}
}
void ItemLibraryAssetImporter::iconProcessFinished(int exitCode, QProcess::ExitStatus exitStatus)
void ItemLibraryAssetImporter::iconProcessFinished([[maybe_unused]] int exitCode,
[[maybe_unused]] QProcess::ExitStatus exitStatus)
{
Q_UNUSED(exitCode)
Q_UNUSED(exitStatus)
m_puppetProcess.reset();
int finishedCount = m_parseData.size() - m_puppetQueue.size();

View File

@@ -142,10 +142,8 @@ void MaterialBrowserView::modelAboutToBeDetached(Model *model)
}
void MaterialBrowserView::selectedNodesChanged(const QList<ModelNode> &selectedNodeList,
const QList<ModelNode> &lastSelectedNodeList)
[[maybe_unused]] const QList<ModelNode> &lastSelectedNodeList)
{
Q_UNUSED(lastSelectedNodeList)
ModelNode selectedModel;
for (const ModelNode &node : selectedNodeList) {
@@ -185,10 +183,8 @@ void MaterialBrowserView::modelNodePreviewPixmapChanged(const ModelNode &node, c
}
void MaterialBrowserView::variantPropertiesChanged(const QList<VariantProperty> &propertyList,
PropertyChangeFlags propertyChange)
[[maybe_unused]] PropertyChangeFlags propertyChange)
{
Q_UNUSED(propertyChange)
for (const VariantProperty &property : propertyList) {
ModelNode node(property.parentModelNode());
@@ -200,10 +196,8 @@ void MaterialBrowserView::variantPropertiesChanged(const QList<VariantProperty>
void MaterialBrowserView::nodeReparented(const ModelNode &node,
const NodeAbstractProperty &newPropertyParent,
const NodeAbstractProperty &oldPropertyParent,
PropertyChangeFlags propertyChange)
[[maybe_unused]] PropertyChangeFlags propertyChange)
{
Q_UNUSED(propertyChange)
if (!isMaterial(node))
return;
@@ -241,24 +235,19 @@ void MaterialBrowserView::nodeAboutToBeRemoved(const ModelNode &removedNode)
m_widget->materialBrowserModel()->removeMaterial(removedNode);
}
void MaterialBrowserView::nodeRemoved(const ModelNode &removedNode,
void MaterialBrowserView::nodeRemoved([[maybe_unused]] const ModelNode &removedNode,
const NodeAbstractProperty &parentProperty,
PropertyChangeFlags propertyChange)
[[maybe_unused]] PropertyChangeFlags propertyChange)
{
Q_UNUSED(removedNode)
Q_UNUSED(propertyChange)
if (parentProperty.parentModelNode().id() != Constants::MATERIAL_LIB_ID)
return;
m_widget->materialBrowserModel()->updateSelectedMaterial();
}
void MaterialBrowserView::importsChanged(const QList<Import> &addedImports, const QList<Import> &removedImports)
void MaterialBrowserView::importsChanged([[maybe_unused]] const QList<Import> &addedImports,
[[maybe_unused]] const QList<Import> &removedImports)
{
Q_UNUSED(addedImports)
Q_UNUSED(removedImports)
bool hasQuick3DImport = model()->hasImport("QtQuick3D");
if (hasQuick3DImport == m_hasQuick3DImport)
@@ -270,11 +259,11 @@ void MaterialBrowserView::importsChanged(const QList<Import> &addedImports, cons
refreshModel(false);
}
void MaterialBrowserView::customNotification(const AbstractView *view, const QString &identifier,
const QList<ModelNode> &nodeList, const QList<QVariant> &data)
void MaterialBrowserView::customNotification(const AbstractView *view,
const QString &identifier,
const QList<ModelNode> &nodeList,
[[maybe_unused]] const QList<QVariant> &data)
{
Q_UNUSED(data)
if (view == this)
return;

View File

@@ -78,10 +78,10 @@ public:
m_pixmaps.insert(node.internalId(), pixmap);
}
QPixmap requestPixmap(const QString &id, QSize *size, const QSize &requestedSize) override
QPixmap requestPixmap(const QString &id,
QSize *size,
[[maybe_unused]] const QSize &requestedSize) override
{
Q_UNUSED(requestedSize)
static QPixmap defaultPreview = QPixmap::fromImage(QImage(":/materialeditor/images/defaultmaterialpreview.png"));
QPixmap pixmap{150, 150};

View File

@@ -73,10 +73,10 @@ public:
m_previewPixmap = pixmap;
}
QPixmap requestPixmap(const QString &id, QSize *size, const QSize &requestedSize) override
QPixmap requestPixmap(const QString &id,
QSize *size,
[[maybe_unused]] const QSize &requestedSize) override
{
Q_UNUSED(requestedSize)
static QPixmap defaultPreview = QPixmap::fromImage(QImage(":/materialeditor/images/defaultmaterialpreview.png"));
QPixmap pixmap{150, 150};

View File

@@ -656,10 +656,8 @@ WidgetInfo MaterialEditorView::widgetInfo()
}
void MaterialEditorView::selectedNodesChanged(const QList<ModelNode> &selectedNodeList,
const QList<ModelNode> &lastSelectedNodeList)
[[maybe_unused]] const QList<ModelNode> &lastSelectedNodeList)
{
Q_UNUSED(lastSelectedNodeList)
m_selectedModels.clear();
for (const ModelNode &node : selectedNodeList) {
@@ -717,11 +715,9 @@ void MaterialEditorView::modelNodePreviewPixmapChanged(const ModelNode &node, co
m_qmlBackEnd->updateMaterialPreview(pixmap);
}
void MaterialEditorView::importsChanged(const QList<Import> &addedImports, const QList<Import> &removedImports)
void MaterialEditorView::importsChanged([[maybe_unused]] const QList<Import> &addedImports,
[[maybe_unused]] const QList<Import> &removedImports)
{
Q_UNUSED(addedImports)
Q_UNUSED(removedImports)
m_hasQuick3DImport = model()->hasImport("QtQuick3D");
m_qmlBackEnd->contextObject()->setHasQuick3DImport(m_hasQuick3DImport);
@@ -779,11 +775,11 @@ void MaterialEditorView::duplicateMaterial(const ModelNode &material)
});
}
void MaterialEditorView::customNotification(const AbstractView *view, const QString &identifier,
const QList<ModelNode> &nodeList, const QList<QVariant> &data)
void MaterialEditorView::customNotification([[maybe_unused]] const AbstractView *view,
const QString &identifier,
const QList<ModelNode> &nodeList,
const QList<QVariant> &data)
{
Q_UNUSED(view)
if (identifier == "selected_material_changed") {
m_selectedMaterial = nodeList.first();
QTimer::singleShot(0, this, &MaterialEditorView::resetView);

View File

@@ -132,10 +132,10 @@ ChooseFromPropertyListDialog::ChooseFromPropertyListDialog(const QStringList &pr
m_selectedProperty = item->isSelected() ? item->data(Qt::DisplayRole).toByteArray() : QByteArray();
});
connect(m_ui->listProps, &QListWidget::itemDoubleClicked, this, [this](QListWidgetItem *item) {
Q_UNUSED(item)
QDialog::accept();
});
connect(m_ui->listProps,
&QListWidget::itemDoubleClicked,
this,
[this]([[maybe_unused]] QListWidgetItem *item) { QDialog::accept(); });
fillList(propNames);
}

View File

@@ -282,9 +282,10 @@ void NameItemDelegate::setEditorData(QWidget *editor, const QModelIndex &index)
lineEdit->setText(value);
}
void NameItemDelegate::setModelData(QWidget *editor, QAbstractItemModel *model, const QModelIndex &index) const
void NameItemDelegate::setModelData(QWidget *editor,
[[maybe_unused]] QAbstractItemModel *model,
const QModelIndex &index) const
{
Q_UNUSED(model)
auto lineEdit = static_cast<QLineEdit*>(editor);
setId(index, lineEdit->text());
lineEdit->clearFocus();

View File

@@ -293,13 +293,11 @@ void NavigatorView::dragEnded()
m_widget->update();
}
void NavigatorView::customNotification(const AbstractView *view, const QString &identifier,
const QList<ModelNode> &nodeList, const QList<QVariant> &data)
void NavigatorView::customNotification([[maybe_unused]] const AbstractView *view,
const QString &identifier,
[[maybe_unused]] const QList<ModelNode> &nodeList,
[[maybe_unused]] const QList<QVariant> &data)
{
Q_UNUSED(view)
Q_UNUSED(nodeList)
Q_UNUSED(data)
if (identifier == "asset_import_update")
m_currentModelInterface->notifyIconsChanged();
}
@@ -405,11 +403,9 @@ void NavigatorView::nodeTypeChanged(const ModelNode &modelNode, const TypeName &
}
void NavigatorView::auxiliaryDataChanged(const ModelNode &modelNode,
const PropertyName &name,
const QVariant &data)
[[maybe_unused]] const PropertyName &name,
[[maybe_unused]] const QVariant &data)
{
Q_UNUSED(name)
Q_UNUSED(data)
m_currentModelInterface->notifyDataChanged(modelNode);
}

View File

@@ -206,11 +206,10 @@ const QStringList &ColorPaletteBackend::currentPaletteColors() const
void ColorPaletteBackend::registerDeclarativeType()
{
static const int typeIndex = qmlRegisterSingletonType<ColorPaletteBackend>(
[[maybe_unused]] static const int typeIndex = qmlRegisterSingletonType<ColorPaletteBackend>(
"QtQuickDesignerColorPalette", 1, 0, "ColorPaletteBackend", [](QQmlEngine *, QJSEngine *) {
return new ColorPaletteBackend();
});
Q_UNUSED(typeIndex)
}
void ColorPaletteBackend::showDialog(QColor color)

View File

@@ -544,10 +544,10 @@ void StatesEditorView::nodeOrderChanged(const NodeListProperty &listProperty)
resetModel();
}
void StatesEditorView::bindingPropertiesChanged(const QList<BindingProperty> &propertyList, AbstractView::PropertyChangeFlags propertyChange)
void StatesEditorView::bindingPropertiesChanged(
const QList<BindingProperty> &propertyList,
[[maybe_unused]] AbstractView::PropertyChangeFlags propertyChange)
{
Q_UNUSED(propertyChange)
for (const BindingProperty &property : propertyList) {
if (property.name() == "when" && QmlModelState::isValidQmlModelState(property.parentModelNode()))
resetModel();

View File

@@ -88,11 +88,7 @@ public:
virtual void invalidateScrollbar() = 0;
virtual qreal snap(qreal frame, bool snapToPlayhead = true)
{
Q_UNUSED(snapToPlayhead);
return frame;
}
virtual qreal snap(qreal frame, [[maybe_unused]] bool snapToPlayhead = true) { return frame; }
QGraphicsView *graphicsView() const;
QGraphicsView *rulerView() const;

View File

@@ -65,11 +65,9 @@ TimelineMoveTool::TimelineMoveTool(AbstractScrollGraphicsScene *scene, TimelineT
: TimelineAbstractTool(scene, delegate)
{}
void TimelineMoveTool::mousePressEvent(TimelineMovableAbstractItem *item,
void TimelineMoveTool::mousePressEvent([[maybe_unused]] TimelineMovableAbstractItem *item,
QGraphicsSceneMouseEvent *event)
{
Q_UNUSED(item)
if (currentItem() && currentItem()->isLocked())
return;
@@ -95,11 +93,9 @@ void TimelineMoveTool::mousePressEvent(TimelineMovableAbstractItem *item,
}
}
void TimelineMoveTool::mouseMoveEvent(TimelineMovableAbstractItem *item,
void TimelineMoveTool::mouseMoveEvent([[maybe_unused]] TimelineMovableAbstractItem *item,
QGraphicsSceneMouseEvent *event)
{
Q_UNUSED(item)
if (!currentItem())
return;
@@ -151,11 +147,9 @@ void TimelineMoveTool::mouseMoveEvent(TimelineMovableAbstractItem *item,
}
}
void TimelineMoveTool::mouseReleaseEvent(TimelineMovableAbstractItem *item,
void TimelineMoveTool::mouseReleaseEvent([[maybe_unused]] TimelineMovableAbstractItem *item,
QGraphicsSceneMouseEvent *event)
{
Q_UNUSED(item)
if (auto *current = currentItem()) {
if (current->asTimelineFrameHandle()) {
double mousePos = event->scenePos().x();
@@ -197,21 +191,13 @@ void TimelineMoveTool::mouseReleaseEvent(TimelineMovableAbstractItem *item,
}
}
void TimelineMoveTool::mouseDoubleClickEvent(TimelineMovableAbstractItem *item,
QGraphicsSceneMouseEvent *event)
void TimelineMoveTool::mouseDoubleClickEvent([[maybe_unused]] TimelineMovableAbstractItem *item,
[[maybe_unused]] QGraphicsSceneMouseEvent *event)
{
Q_UNUSED(item)
Q_UNUSED(event)
}
void TimelineMoveTool::keyPressEvent(QKeyEvent *keyEvent)
{
Q_UNUSED(keyEvent)
}
void TimelineMoveTool::keyPressEvent([[maybe_unused]] QKeyEvent *keyEvent) {}
void TimelineMoveTool::keyReleaseEvent(QKeyEvent *keyEvent)
{
Q_UNUSED(keyEvent)
}
void TimelineMoveTool::keyReleaseEvent([[maybe_unused]] QKeyEvent *keyEvent) {}
} // namespace QmlDesigner

View File

@@ -1002,11 +1002,10 @@ void TimelineBarItem::scrollOffsetChanged()
sectionItem()->invalidateBar();
}
void TimelineBarItem::paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget)
void TimelineBarItem::paint(QPainter *painter,
[[maybe_unused]] const QStyleOptionGraphicsItem *option,
[[maybe_unused]] QWidget *widget)
{
Q_UNUSED(option)
Q_UNUSED(widget)
QColor brushColorSelected = Theme::getColor(Theme::QmlDesigner_HighlightColor);
QColor brushColor = Theme::getColor(Theme::QmlDesigner_HighlightColor).darker(120);
const QColor indicatorColor = Theme::getColor(Theme::PanelTextColorLight);

View File

@@ -67,21 +67,16 @@ SelectionMode TimelineSelectionTool::selectionMode(QGraphicsSceneMouseEvent *eve
return SelectionMode::New;
}
void TimelineSelectionTool::mousePressEvent(TimelineMovableAbstractItem *item,
QGraphicsSceneMouseEvent *event)
void TimelineSelectionTool::mousePressEvent([[maybe_unused]] TimelineMovableAbstractItem *item,
[[maybe_unused]] QGraphicsSceneMouseEvent *event)
{
Q_UNUSED(item)
Q_UNUSED(event)
if (event->buttons() == Qt::LeftButton && selectionMode(event) == SelectionMode::New)
deselect();
}
void TimelineSelectionTool::mouseMoveEvent(TimelineMovableAbstractItem *item,
void TimelineSelectionTool::mouseMoveEvent([[maybe_unused]] TimelineMovableAbstractItem *item,
QGraphicsSceneMouseEvent *event)
{
Q_UNUSED(item)
if (event->buttons() == Qt::LeftButton) {
auto endPoint = event->scenePos();
@@ -103,36 +98,26 @@ void TimelineSelectionTool::mouseMoveEvent(TimelineMovableAbstractItem *item,
}
}
void TimelineSelectionTool::mouseReleaseEvent(TimelineMovableAbstractItem *item,
void TimelineSelectionTool::mouseReleaseEvent([[maybe_unused]] TimelineMovableAbstractItem *item,
QGraphicsSceneMouseEvent *event)
{
Q_UNUSED(item)
commitSelection(selectionMode(event));
reset();
}
void TimelineSelectionTool::mouseDoubleClickEvent(TimelineMovableAbstractItem *item,
QGraphicsSceneMouseEvent *event)
[[maybe_unused]] QGraphicsSceneMouseEvent *event)
{
Q_UNUSED(event)
if (item)
item->itemDoubleClicked();
reset();
}
void TimelineSelectionTool::keyPressEvent(QKeyEvent *keyEvent)
{
Q_UNUSED(keyEvent)
}
void TimelineSelectionTool::keyPressEvent([[maybe_unused]] QKeyEvent *keyEvent) {}
void TimelineSelectionTool::keyReleaseEvent(QKeyEvent *keyEvent)
{
Q_UNUSED(keyEvent)
}
void TimelineSelectionTool::keyReleaseEvent([[maybe_unused]] QKeyEvent *keyEvent) {}
void TimelineSelectionTool::deselect()
{

View File

@@ -496,10 +496,8 @@ void TimelineToolBar::setupCurrentFrameValidator()
m_lastFrame->text().toInt());
}
void TimelineToolBar::resizeEvent(QResizeEvent *event)
void TimelineToolBar::resizeEvent([[maybe_unused]] QResizeEvent *event)
{
Q_UNUSED(event)
int width = 0;
QWidget *spacer = nullptr;
for (auto *object : qAsConst(m_grp)) {

View File

@@ -222,9 +222,8 @@ void TimelineView::variantPropertiesChanged(const QList<VariantProperty> &proper
}
void TimelineView::bindingPropertiesChanged(const QList<BindingProperty> &propertyList,
AbstractView::PropertyChangeFlags propertyChange)
[[maybe_unused]] AbstractView::PropertyChangeFlags propertyChange)
{
Q_UNUSED(propertyChange)
for (const auto &property : propertyList) {
if (property.name() == "easing.bezierCurve") {
updateAnimationCurveEditor();
@@ -465,11 +464,9 @@ void TimelineView::setTimelineRecording(bool value)
void TimelineView::customNotification(const AbstractView * /*view*/,
const QString &identifier,
const QList<ModelNode> &nodeList,
const QList<QVariant> &data)
[[maybe_unused]] const QList<ModelNode> &nodeList,
[[maybe_unused]] const QList<QVariant> &data)
{
Q_UNUSED(nodeList)
Q_UNUSED(data)
if (identifier == QStringLiteral("reset QmlPuppet")) {
QmlTimeline timeline = widget()->graphicsScene()->currentTimeline();
if (timeline.isValid())

View File

@@ -296,8 +296,8 @@ TimelineWidget::TimelineWidget(TimelineView *view)
};
connect(graphicsScene()->layoutRuler(), &TimelineRulerSectionItem::playbackLoopValuesChanged, updatePlaybackLoopValues);
auto setPlaybackState = [this](QAbstractAnimation::State newState, QAbstractAnimation::State oldState) {
Q_UNUSED(oldState)
auto setPlaybackState = [this](QAbstractAnimation::State newState,
[[maybe_unused]] QAbstractAnimation::State oldState) {
m_toolbar->setPlayState(newState == QAbstractAnimation::State::Running);
};
connect(m_playbackAnimation, &QVariantAnimation::stateChanged, setPlaybackState);
@@ -616,10 +616,8 @@ void TimelineWidget::setFocus()
m_graphicsView->setFocus();
}
void TimelineWidget::showEvent(QShowEvent *event)
void TimelineWidget::showEvent([[maybe_unused]] QShowEvent *event)
{
Q_UNUSED(event)
int zoom = m_toolbar->scaleFactor();
m_timelineView->setEnabled(true);

View File

@@ -626,12 +626,9 @@ void TransitionEditorBarItem::scrollOffsetChanged()
}
void TransitionEditorBarItem::paint(QPainter *painter,
const QStyleOptionGraphicsItem *option,
QWidget *widget)
[[maybe_unused]] const QStyleOptionGraphicsItem *option,
[[maybe_unused]] QWidget *widget)
{
Q_UNUSED(option)
Q_UNUSED(widget)
QColor brushColor = Theme::getColor(Theme::QmlDesigner_HighlightColor);
QColor brushColorSection = Theme::getColor(Theme::QmlDesigner_HighlightColor).darker(120);
QColor penColor = Theme::getColor(Theme::QmlDesigner_HighlightColor).lighter(140);

View File

@@ -312,10 +312,8 @@ void TransitionEditorToolBar::addSpacing(int width)
addWidget(widget);
}
void TransitionEditorToolBar::resizeEvent(QResizeEvent *event)
void TransitionEditorToolBar::resizeEvent([[maybe_unused]] QResizeEvent *event)
{
Q_UNUSED(event)
int width = 0;
QWidget *spacer = nullptr;
for (auto *object : qAsConst(m_grp)) {

View File

@@ -415,10 +415,8 @@ void TransitionEditorWidget::setupScrollbar(int min, int max, int current)
m_scrollbar->blockSignals(b);
}
void TransitionEditorWidget::showEvent(QShowEvent *event)
void TransitionEditorWidget::showEvent([[maybe_unused]] QShowEvent *event)
{
Q_UNUSED(event)
m_transitionEditorView->setEnabled(true);
if (m_transitionEditorView->model())

View File

@@ -175,9 +175,8 @@ QString Exception::description() const
/*!
Shows message in a message box.
*/
void Exception::showException(const QString &title) const
void Exception::showException([[maybe_unused]] const QString &title) const
{
Q_UNUSED(title)
#ifndef QMLDESIGNER_TEST
QString composedTitle = title.isEmpty() ? QCoreApplication::translate("QmlDesigner", "Error")
: title;

View File

@@ -38,9 +38,8 @@ namespace QmlDesigner {
void BaseConnectionManager::setUp(NodeInstanceServerInterface *nodeInstanceServer,
const QString &,
ProjectExplorer::Target *,
AbstractView *view)
[[maybe_unused]] AbstractView *view)
{
Q_UNUSED(view)
m_nodeInstanceServer = nodeInstanceServer;
m_isActive = true;
}

View File

@@ -449,7 +449,7 @@ QString PuppetCreator::defaultPuppetFallbackDirectory()
return Core::ICore::libexecPath().toString();
}
QString PuppetCreator::qmlPuppetFallbackDirectory(const DesignerSettings &settings)
QString PuppetCreator::qmlPuppetFallbackDirectory([[maybe_unused]] const DesignerSettings &settings)
{
#ifndef QMLDESIGNER_TEST
QString puppetFallbackDirectory = settings.value(
@@ -458,7 +458,6 @@ QString PuppetCreator::qmlPuppetFallbackDirectory(const DesignerSettings &settin
return defaultPuppetFallbackDirectory();
return puppetFallbackDirectory;
#else
Q_UNUSED(settings)
return QString();
#endif
}

View File

@@ -87,9 +87,9 @@ void MetaInfoReader::setQualifcation(const TypeName &qualification)
m_qualication = qualification;
}
void MetaInfoReader::elementStart(const QString &name, const QmlJS::SourceLocation &nameLocation)
void MetaInfoReader::elementStart(const QString &name,
[[maybe_unused]] const QmlJS::SourceLocation &nameLocation)
{
Q_UNUSED(nameLocation)
switch (parserState()) {
case ParsingDocument: setParserState(readDocument(name)); break;
case ParsingMetaInfo: setParserState(readMetaInfoRootElement(name)); break;
@@ -130,12 +130,10 @@ void MetaInfoReader::elementEnd()
}
void MetaInfoReader::propertyDefinition(const QString &name,
const QmlJS::SourceLocation &nameLocation,
[[maybe_unused]] const QmlJS::SourceLocation &nameLocation,
const QVariant &value,
const QmlJS::SourceLocation &valueLocation)
[[maybe_unused]] const QmlJS::SourceLocation &valueLocation)
{
Q_UNUSED(nameLocation)
Q_UNUSED(valueLocation)
switch (parserState()) {
case ParsingType: readTypeProperty(name, value); break;
case ParsingImports: readImportsProperty(name, value); break;

View File

@@ -80,9 +80,8 @@ InternalNode::Pointer InternalNodeProperty::node() const
return m_node;
}
void InternalNodeProperty::remove(const InternalNode::Pointer &node)
void InternalNodeProperty::remove([[maybe_unused]] const InternalNode::Pointer &node)
{
Q_UNUSED(node)
Q_ASSERT(m_node == node);
m_node.clear();

View File

@@ -348,7 +348,7 @@ bool QmlItemNode::modelIsResizable() const
&& !modelIsInLayout();
}
static bool isMcuRotationAllowed(QString itemName, bool hasChildren)
static bool isMcuRotationAllowed([[maybe_unused]] QString itemName, [[maybe_unused]] bool hasChildren)
{
#ifndef QMLDESIGNER_TEST
const QString propName = "rotation";
@@ -370,9 +370,6 @@ static bool isMcuRotationAllowed(QString itemName, bool hasChildren)
if (manager.bannedProperties().contains(propName))
return false;
}
#else
Q_UNUSED(itemName)
Q_UNUSED(hasChildren)
#endif
return true;

View File

@@ -635,7 +635,7 @@ QVariant QmlObjectNode::instanceValue(const ModelNode &modelNode, const Property
return modelNode.view()->nodeInstanceView()->instanceForModelNode(modelNode).property(name);
}
QString QmlObjectNode::generateTranslatableText(const QString &text)
QString QmlObjectNode::generateTranslatableText([[maybe_unused]] const QString &text)
{
#ifndef QMLDESIGNER_TEST
@@ -653,7 +653,6 @@ QString QmlObjectNode::generateTranslatableText(const QString &text)
}
return QString(QStringLiteral("qsTr(\"%1\")")).arg(text);
#else
Q_UNUSED(text)
return QString();
#endif
}
@@ -824,9 +823,8 @@ QmlObjectNode *QmlObjectNode::getQmlObjectNodeOfCorrectType(const ModelNode &mod
return new QmlObjectNode(modelNode);
}
bool QmlObjectNode::isBlocked(const PropertyName &propName) const
bool QmlObjectNode::isBlocked([[maybe_unused]] const PropertyName &propName) const
{
Q_UNUSED(propName)
return false;
}

View File

@@ -249,11 +249,8 @@ void RewriteActionCompressor::compressPropertyActions(QList<RewriteAction *> &ac
if (RemovePropertyRewriteAction *removeAction = action->asRemovePropertyRewriteAction()) {
const AbstractProperty property = removeAction->property();
if (AddPropertyRewriteAction *addAction = addedProperties.value(property, 0)) {
Q_UNUSED(addAction)
} else {
if (AddPropertyRewriteAction *addAction = addedProperties.value(property, 0); !addAction)
removedProperties.insert(property, action);
}
} else if (ChangePropertyRewriteAction *changeAction = action->asChangePropertyRewriteAction()) {
const AbstractProperty property = changeAction->property();

View File

@@ -1744,68 +1744,58 @@ QStringList TextToModelMerger::syncGroupedProperties(ModelNode &modelNode,
return props;
}
void ModelValidator::modelMissesImport(const QmlDesigner::Import &import)
void ModelValidator::modelMissesImport([[maybe_unused]] const QmlDesigner::Import &import)
{
Q_UNUSED(import)
Q_ASSERT(m_merger->view()->model()->imports().contains(import));
}
void ModelValidator::importAbsentInQMl(const QmlDesigner::Import &import)
void ModelValidator::importAbsentInQMl([[maybe_unused]] const QmlDesigner::Import &import)
{
Q_UNUSED(import)
Q_ASSERT(! m_merger->view()->model()->imports().contains(import));
}
void ModelValidator::bindingExpressionsDiffer(BindingProperty &modelProperty,
const QString &javascript,
const TypeName &astType)
void ModelValidator::bindingExpressionsDiffer([[maybe_unused]] BindingProperty &modelProperty,
[[maybe_unused]] const QString &javascript,
[[maybe_unused]] const TypeName &astType)
{
Q_UNUSED(modelProperty)
Q_UNUSED(javascript)
Q_UNUSED(astType)
Q_ASSERT(compareJavaScriptExpression(modelProperty.expression(), javascript));
Q_ASSERT(modelProperty.dynamicTypeName() == astType);
Q_ASSERT(0);
}
void ModelValidator::shouldBeBindingProperty(AbstractProperty &modelProperty,
void ModelValidator::shouldBeBindingProperty([[maybe_unused]] AbstractProperty &modelProperty,
const QString & /*javascript*/,
const TypeName & /*astType*/)
{
Q_UNUSED(modelProperty)
Q_ASSERT(modelProperty.isBindingProperty());
Q_ASSERT(0);
}
void ModelValidator::signalHandlerSourceDiffer(SignalHandlerProperty &modelProperty, const QString &javascript)
void ModelValidator::signalHandlerSourceDiffer([[maybe_unused]] SignalHandlerProperty &modelProperty,
[[maybe_unused]] const QString &javascript)
{
Q_UNUSED(modelProperty)
Q_UNUSED(javascript)
QTC_ASSERT(compareJavaScriptExpression(modelProperty.source(), javascript), return);
}
void ModelValidator::shouldBeSignalHandlerProperty(AbstractProperty &modelProperty, const QString & /*javascript*/)
void ModelValidator::shouldBeSignalHandlerProperty([[maybe_unused]] AbstractProperty &modelProperty,
const QString & /*javascript*/)
{
Q_UNUSED(modelProperty)
Q_ASSERT(modelProperty.isSignalHandlerProperty());
Q_ASSERT(0);
}
void ModelValidator::shouldBeNodeListProperty(AbstractProperty &modelProperty,
void ModelValidator::shouldBeNodeListProperty([[maybe_unused]] AbstractProperty &modelProperty,
const QList<AST::UiObjectMember *> /*arrayMembers*/,
ReadingContext * /*context*/)
{
Q_UNUSED(modelProperty)
Q_ASSERT(modelProperty.isNodeListProperty());
Q_ASSERT(0);
}
void ModelValidator::variantValuesDiffer(VariantProperty &modelProperty, const QVariant &qmlVariantValue, const TypeName &dynamicTypeName)
void ModelValidator::variantValuesDiffer([[maybe_unused]] VariantProperty &modelProperty,
[[maybe_unused]] const QVariant &qmlVariantValue,
[[maybe_unused]] const TypeName &dynamicTypeName)
{
Q_UNUSED(modelProperty)
Q_UNUSED(qmlVariantValue)
Q_UNUSED(dynamicTypeName)
QTC_ASSERT(modelProperty.isDynamic() == !dynamicTypeName.isEmpty(), return);
if (modelProperty.isDynamic()) {
QTC_ASSERT(modelProperty.dynamicTypeName() == dynamicTypeName, return);
@@ -1817,15 +1807,15 @@ void ModelValidator::variantValuesDiffer(VariantProperty &modelProperty, const Q
QTC_ASSERT(0, return);
}
void ModelValidator::shouldBeVariantProperty(AbstractProperty &modelProperty, const QVariant &/*qmlVariantValue*/, const TypeName &/*dynamicTypeName*/)
void ModelValidator::shouldBeVariantProperty([[maybe_unused]] AbstractProperty &modelProperty,
const QVariant & /*qmlVariantValue*/,
const TypeName & /*dynamicTypeName*/)
{
Q_UNUSED(modelProperty)
Q_ASSERT(modelProperty.isVariantProperty());
Q_ASSERT(0);
}
void ModelValidator::shouldBeNodeProperty(AbstractProperty &modelProperty,
void ModelValidator::shouldBeNodeProperty([[maybe_unused]] AbstractProperty &modelProperty,
const TypeName & /*typeName*/,
int /*majorVersion*/,
int /*minorVersion*/,
@@ -1833,16 +1823,12 @@ void ModelValidator::shouldBeNodeProperty(AbstractProperty &modelProperty,
const TypeName & /*dynamicPropertyType */,
ReadingContext * /*context*/)
{
Q_UNUSED(modelProperty)
Q_ASSERT(modelProperty.isNodeProperty());
Q_ASSERT(0);
}
void ModelValidator::modelNodeAbsentFromQml(ModelNode &modelNode)
void ModelValidator::modelNodeAbsentFromQml([[maybe_unused]] ModelNode &modelNode)
{
Q_UNUSED(modelNode)
Q_ASSERT(!modelNode.isValid());
Q_ASSERT(0);
}
@@ -1856,18 +1842,13 @@ ModelNode ModelValidator::listPropertyMissingModelNode(NodeListProperty &/*model
}
void ModelValidator::typeDiffers(bool /*isRootNode*/,
ModelNode &modelNode,
const TypeName &typeName,
int majorVersion,
int minorVersion,
[[maybe_unused]] ModelNode &modelNode,
[[maybe_unused]] const TypeName &typeName,
[[maybe_unused]] int majorVersion,
[[maybe_unused]] int minorVersion,
QmlJS::AST::UiObjectMember * /*astNode*/,
ReadingContext * /*context*/)
{
Q_UNUSED(modelNode)
Q_UNUSED(typeName)
Q_UNUSED(minorVersion)
Q_UNUSED(majorVersion)
QTC_ASSERT(modelNode.type() == typeName, return);
if (modelNode.majorVersion() != majorVersion) {
@@ -1885,19 +1866,15 @@ void ModelValidator::typeDiffers(bool /*isRootNode*/,
QTC_ASSERT(0, return);
}
void ModelValidator::propertyAbsentFromQml(AbstractProperty &modelProperty)
void ModelValidator::propertyAbsentFromQml([[maybe_unused]] AbstractProperty &modelProperty)
{
Q_UNUSED(modelProperty)
Q_ASSERT(!modelProperty.isValid());
Q_ASSERT(0);
}
void ModelValidator::idsDiffer(ModelNode &modelNode, const QString &qmlId)
void ModelValidator::idsDiffer([[maybe_unused]] ModelNode &modelNode,
[[maybe_unused]] const QString &qmlId)
{
Q_UNUSED(modelNode)
Q_UNUSED(qmlId)
QTC_ASSERT(modelNode.id() == qmlId, return);
QTC_ASSERT(0, return);
}

View File

@@ -2057,11 +2057,9 @@ private:
table.initialize(database);
}
void createTypesAndePropertyDeclarationsTables(Database &database,
const Sqlite::Column &foreignModuleIdColumn)
void createTypesAndePropertyDeclarationsTables(
Database &database, [[maybe_unused]] const Sqlite::Column &foreignModuleIdColumn)
{
Q_UNUSED(foreignModuleIdColumn)
Sqlite::Table typesTable;
typesTable.setUseIfNotExists(true);
typesTable.setName("types");

View File

@@ -107,8 +107,8 @@ void RewriterTransaction::commit()
if (m_activeIdentifier) {
qDebug() << "Commit RewriterTransaction:" << m_identifier << m_identifierNumber;
bool success = m_identifierList.removeOne(m_identifier + QByteArrayLiteral("-") + QByteArray::number(m_identifierNumber));
Q_UNUSED(success)
[[maybe_unused]] bool success = m_identifierList.removeOne(
m_identifier + QByteArrayLiteral("-") + QByteArray::number(m_identifierNumber));
Q_ASSERT(success);
}
}

View File

@@ -427,9 +427,10 @@ void DesignModeWidget::setup()
workspaceComboBox->setCurrentText(m_dockManager->activeWorkspace());
});
connect(m_dockManager, &ADS::DockManager::workspaceLoaded, workspaceComboBox, &QComboBox::setCurrentText);
connect(workspaceComboBox, QOverload<int>::of(&QComboBox::activated),
m_dockManager, [this, workspaceComboBox] (int index) {
Q_UNUSED(index)
connect(workspaceComboBox,
QOverload<int>::of(&QComboBox::activated),
m_dockManager,
[this, workspaceComboBox]([[maybe_unused]] int index) {
m_dockManager->openWorkspace(workspaceComboBox->currentText());
});

View File

@@ -51,9 +51,8 @@ void RichTextEditorDialog::setFormEditorItem(FormEditorItem* formEditorItem)
m_formEditorItem = formEditorItem;
}
void RichTextEditorDialog::onTextChanged(QString text)
void RichTextEditorDialog::onTextChanged([[maybe_unused]] QString text)
{
Q_UNUSED(text);
// TODO: try adding following and make it react faster
// setTextToFormEditorItem(text);
}