Extensões do C++: Exemplo de provedor de imagens

Como carregar imagens no QML usando o QQuickImageProvider.

Este exemplo mostra como usar o QQuickImageProvider para fornecer imagens aos itens “ Image ” do QML e como empacotá-lo em um QQmlEngineExtensionPlugin, que é detectado e carregado em tempo de execução. O plug-in passa então a ser um componente reutilizável que pode ser instalado em um local válido para todo o sistema, para uso por vários aplicativos.

Dois blocos de cor identificados como amarelo e vermelho, gerados pelo provedor de imagens

Projeto de exemplo em @code.qt.io

© 2026 The Qt Company Ltd. 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.