Disable specific qml compiler warnings (f.e. [import]) or mark an area in .qml file
-
We are using Qt 6.5.2 with runtime style selection (qtquickcontrols2.conf) and get tons if warning regarding
import QtQuick.Controls
Warnings occurred while importing module "QtQuick.Controls": [import]
Warning: QtQuick.Controls uses optional imports which are not supported. Some types might not be found. [import]Is it possible to silence specific warning types like [import] but show the rest?
How about mark a specific area inside .qml? Something like "// qmlc disable" -
I was going to say that I have been following a request ticket for such a thing, but it turns out that my watched ticket was in regards to selectively disabling formatting of QML, not selectively disabling warnings. https://bugreports.qt.io/browse/QTBUG-97796
It might be worth opening a ticket for your idea at https://bugreports.qt.io.
I didn't see anything similar while browsing through the QMLC category: https://bugreports.qt.io/issues/?jql=project %3D QTBUG AND component %3D "QML%3A Compiler" ORDER BY updatedDate
The bug tracker apparently has ticket types of: "Improvement", "New Feature", or "Suggestion". Opening such a ticket could have the (fortunate) side effect of someone telling you this is already possible.
-
@KH-219Design
Thanks i will try that.I also saw that in another thread you mentioned, that its possible to write your own QtMessageHandler and filter qml warnings.
https://forum.qt.io/topic/151653/is-there-any-way-to-suppress-qml-warningsI will try that too, but i guess there is nothing like this for compiler warnings.