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. onEnabledChanged in Connections object

onEnabledChanged in Connections object

Scheduled Pinned Locked Moved Solved QML and Qt Quick
2 Posts 1 Posters 403 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.
  • B Offline
    B Offline
    Bob64
    wrote on last edited by
    #1

    Having just upgraded to Qt 5.15, I am faced with a bunch of warnings about how my connections are defined in my Connections objects:

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

    Fair enough - I have seen this before when trying out my code in newer versions of Qt than I was officially using at the time. I therefore changed:

    Connections {
        target: control
        onEnabledChanged: { ... }
    }
    

    to

    Connections {
        target: control
        function onEnabledChanged() { ... }
    }
    

    But now I get an error:

    ... Duplicate method name: invalid override of property change signal or superclass signal
    

    The reason being, I presume, that Connections has its own enabled property and an onEnabledChanged function is defined on it.

    How do I resolve this?

    B 1 Reply Last reply
    0
    • B Bob64

      Having just upgraded to Qt 5.15, I am faced with a bunch of warnings about how my connections are defined in my Connections objects:

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

      Fair enough - I have seen this before when trying out my code in newer versions of Qt than I was officially using at the time. I therefore changed:

      Connections {
          target: control
          onEnabledChanged: { ... }
      }
      

      to

      Connections {
          target: control
          function onEnabledChanged() { ... }
      }
      

      But now I get an error:

      ... Duplicate method name: invalid override of property change signal or superclass signal
      

      The reason being, I presume, that Connections has its own enabled property and an onEnabledChanged function is defined on it.

      How do I resolve this?

      B Offline
      B Offline
      Bob64
      wrote on last edited by
      #2

      Found it in this bug report: https://bugreports.qt.io/browse/QTBUG-84746

      It seems that the "fix" is to define a property alias to enabled in the target component. Not nice, but it seems to work.

      I'll leave this for a while before marking as solved to see if there are any better solutions.

      1 Reply Last reply
      0
      • B Bob64 has marked this topic as solved on

      • Login

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