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/Hide/Remove 'QML Connections' runtime warning

Disable/Hide/Remove 'QML Connections' runtime warning

Scheduled Pinned Locked Moved Solved QML and Qt Quick
3 Posts 2 Posters 1.4k 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.
  • A Offline
    A Offline
    aran
    wrote on last edited by aran
    #1

    Hi everybody,

    Since the recent upgrade to Qt 5.15 I now get numerous runtime warnings for some QML code I'm maintaining:

    QML Connections: Implicitly defined onFoo properties in Connections are deprecated. Use this syntax instead: function onFoo(<arguments>) { ... }
    

    I understand that in Qt 5.15 one can switch to a new syntax here to get rid of this warning, but I can't do that as the code needs to be compatible with some older versions as well. This warning is, however, polluting the output on the command line, which is simply unacceptable (at least in my use case, though I'm sure I'm not alone with this opinion).

    Is there any way to remove/hide/disable this warning?
    Any help would be greatly appreciated!

    Thanks,
    aran

    Edit:
    Here's a very simple example illustrating this dilemma:

    import QtQuick 2.0
    
    Rectangle {
        id: page
        width: 300; height: 200
        color: "red"
        MouseArea {
            id: m
            anchors.fill: parent
        }
        Connections {
            target: m
            onClicked: 
                console.log("old syntax")
        }
        Connections {
            target: m
            function onClicked(mouse) {
                console.log("new syntax")
            }
        }
    }
    

    When run the above code (e.g., with qmlscene) under Qt 5.15, I get the above mentioned warning, and a click returns both log messages. When run on a system with an older Qt version I don't get any warning and a click only returns "old syntax".

    1 Reply Last reply
    0
    • A Offline
      A Offline
      aran
      wrote on last edited by aran
      #2

      Oh, nevermind, should have done a better job searching this forum, it already was answered here before:

      In Qt 5.15.1 there will be a way to disable this, see here: https://codereview.qt-project.org/c/qt/qtdeclarative/+/293011

      Aleksey_KA 1 Reply Last reply
      0
      • A aran

        Oh, nevermind, should have done a better job searching this forum, it already was answered here before:

        In Qt 5.15.1 there will be a way to disable this, see here: https://codereview.qt-project.org/c/qt/qtdeclarative/+/293011

        Aleksey_KA Offline
        Aleksey_KA Offline
        Aleksey_K
        wrote on last edited by
        #3

        @aran said in Disable/Hide/Remove 'QML Connections' runtime warning:

        Oh, nevermind, should have done a better job searching this forum, it already was answered here before:

        Where is the link where it was answered? How to disable only 1 category?

        1 Reply Last reply
        0

        • Login

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