QML Quick Fixes

Apply the following types of quick fixes to QML code:

  • Rename IDs
  • Split initializers
  • Move a QML type into a separate file to reuse it in other .qml files

The following table summarizes the quick fixes for QML code. The action is available when the cursor is in the position described in the Activation column.

Quick FixDescriptionActivation
Move Component into Separate FileMoves a QML type into a separate file. Give the new component a name and select whether properties are set for the new component or for the original one.

QML type name.
Split InitializerReformats a one-line type into a multi-line type. For example, rewrites
Item { x: 10; y: 20; width: 10 }

as

Item {
    x: 10;
    y: 20;
    width: 10
}
QML type property
Wrap Component in LoaderWraps the type in a Component type and loads it dynamically in a Loader type. This is usually done to improve startup time.QML type name
Add a message suppression commentPrepends the line with an annotation comment that stops the message from being generated.Error, warning or hint from static analysis

See also Apply quick fixes, Rename symbols, Exclude files from to-do lists, Find symbols, Specify settings for quick fixes, Quick Fixes, and C++ Quick Fixes.

Copyright © The Qt Company Ltd. and other contributors. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.