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. QtCreator error: "legend" does not have members (M17)
Forum Updated to NodeBB v4.3 + New Features

QtCreator error: "legend" does not have members (M17)

Scheduled Pinned Locked Moved Unsolved QML and Qt Quick
4 Posts 4 Posters 2.5k Views 1 Watching
  • 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.
  • peteispoP Offline
    peteispoP Offline
    peteispo
    wrote on last edited by peteispo
    #1

    Using ChartView in QtCreator, I want to hide the default legends for the series I add to a chart so that I can display my own custom legend. For example, I have a ChartView with id "chartMilestones", so I put in the QML file

        chartMilestones.legend.visible: false
    

    but QtCreator underlines the word legend in red and displays the error

    "legend" does not have members (M17)
    

    The code seems to do what I want when it's run, without complaining, but the Design view doesn't work with this error in the QML. It also appears that I can set the visibility in a JavaScript function without an error.

    Is there something I need to add to avoid the error markers?

    1 Reply Last reply
    1
    • B Offline
      B Offline
      bnetz
      wrote on last edited by
      #2

      Hello!
      I run into the same thing:
      0_1521789031035_8e6f15b7-d22f-4e0a-ac06-265b4e6cdb9e-image.png
      But setting myChartView.legend.visible: falsedoes the trick and the legend gets hidden, the designer cant be used after that.
      Did you find it out how to hide the legend without the error message?

      1 Reply Last reply
      1
      • I Offline
        I Offline
        igor_stravinsky
        wrote on last edited by
        #3

        Just adding a "me too" for this bug.

        I'm also getting a "Non-existent attached object" bug on the line of code that sets the legend's visibility. Perhaps that's related, but that causes an error in the QML compilation...

        1 Reply Last reply
        0
        • kkoehneK Offline
          kkoehneK Offline
          kkoehne
          Moderators
          wrote on last edited by
          #4

          This is also tracked in https://bugreports.qt.io/browse/QTBUG-68470 . Please follow up from there.

          Director R&D, The Qt Company

          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