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. How to fix "Missing QML.Element class info for XXX"?
Forum Updated to NodeBB v4.3 + New Features

How to fix "Missing QML.Element class info for XXX"?

Scheduled Pinned Locked Moved Unsolved QML and Qt Quick
4 Posts 2 Posters 52 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.
  • O Offline
    O Offline
    odelaune
    wrote last edited by
    #1

    Hello, I am discovering the QML world. What I would like to do is to add this example inside a more general application, i.e. this example would be one widget among others.

    So I have defined a QQuickWidget inside which I try to load the example.
    Here is the related code that is located in the constructor of my main widget (a little bit adapted from the one given in the example)

    #ifdef Q_OS_WIN
      QString extraImportPath(QStringLiteral("%1/../../../../%2"));
    #else
      QString extraImportPath(QStringLiteral("%1/../../../%2"));
    #endif
      ui->graphQuickWidget->engine()->addImportPath(
          extraImportPath.arg(QGuiApplication::applicationDirPath(), QString::fromLatin1("qml")));
      //! [2]
      QQmlContext *context = ui->graphQuickWidget->engine()->rootContext();
      context->setContextProperty("myGraph", m_myGraph);
      ui->graphQuickWidget->setSource(QUrl("HMI/qml/components/graphFrequencies/main.qml"));
      ui->graphQuickWidget->setResizeMode(QQuickWidget::SizeRootObjectToView);
    

    My problem is that when I run my program, I get several messages that are followed by a crash

    Missing QML.Element class info for QAbstractAxis
    Missing QML.Element class info for QAreaSeries
    Missing QML.Element class info for QBarCategoryAxis
    Missing QML.Element class info for QBarModelMapper
    Missing QML.Element class info for QBarSeries
    Missing QML.Element class info for QBarSet
    Missing QML.Element class info for QDateTimeAxis
    Missing QML.Element class info for QLineSeries
    Missing QML.Element class info for QPieModelMapper
    Missing QML.Element class info for QPieSeries
    Missing QML.Element class info for QPieSlice
    Missing QML.Element class info for QScatterSeries
    Missing QML.Element class info for QSplineSeries
    Missing QML.Element class info for QValueAxis
    Missing QML.Element class info for QXYModelMapper
    Missing QML.Element class info for QXYSeries

    I do not know how to solve this problem. Do you have any advice for me?

    1 Reply Last reply
    0
    • GrecKoG Offline
      GrecKoG Offline
      GrecKo
      Qt Champions 2018
      wrote last edited by
      #2

      What is causing the crash? Try to run your program with a debugger.

      1 Reply Last reply
      0
      • O Offline
        O Offline
        odelaune
        wrote last edited by odelaune
        #3

        The crash is caused by the line seriesList: myGraph.pieSeries in main.qml

        More precisely, the debugguer says me that the problem happens in the QGraphsView::insertSeries (internal method) because the QGraphsView object is nullptr.

        So far, here is my understanding. All the "Missing QML.Element" messages are displayed when I add the line import QtGraphs in main.qml. Because it seems that nothing is loaded correctly, the GraphsView is not created which finally provokes the crash.

        So I guess that if I fix the "Missing QML.Element" messages, everything will work fine.

        1 Reply Last reply
        0
        • GrecKoG Offline
          GrecKoG Offline
          GrecKo
          Qt Champions 2018
          wrote last edited by
          #4

          Are you using a QGuiApplication or a QApplication? You should be using the latter.

          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