Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. QML and Qt Quick
  4. Disable specific qml compiler warnings (f.e. [import]) or mark an area in .qml file

Disable specific qml compiler warnings (f.e. [import]) or mark an area in .qml file

Scheduled Pinned Locked Moved Unsolved QML and Qt Quick
3 Posts 2 Posters 129 Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • M Offline
    M Offline
    majorRonk
    wrote on 17 Mar 2025, 12:48 last edited by majorRonk
    #1

    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"

    1 Reply Last reply
    0
    • K Offline
      K Offline
      KH-219Design
      wrote on 19 Mar 2025, 15:17 last edited by
      #2

      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.

      www.219design.com
      Software | Electrical | Mechanical | Product Design

      1 Reply Last reply
      1
      • M Offline
        M Offline
        majorRonk
        wrote on 24 Mar 2025, 09:47 last edited by majorRonk
        #3

        @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-warnings

        I will try that too, but i guess there is nothing like this for compiler warnings.

        1 Reply Last reply
        0

        2/3

        19 Mar 2025, 15:17

        • Login

        • Login or register to search.
        2 out of 3
        • First post
          2/3
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • Users
        • Groups
        • Search
        • Get Qt Extensions
        • Unsolved