Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. International
  3. German
  4. deprecated Warnungen mit Qt 5.15.2
Forum Updated to NodeBB v4.3 + New Features

deprecated Warnungen mit Qt 5.15.2

Scheduled Pinned Locked Moved Solved German
4 Posts 2 Posters 941 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.
  • M Offline
    M Offline
    msauer75
    wrote on last edited by
    #1

    Hallo zusammen,
    bisher habe ich für mein Projekt Qt 5.12 verwendet. Nachdem ich jetzt auf Qt 5.15.2 gewechselt habe bekomme ich jede Menge deprecated Warnungen.

    /home/martin/Entwicklung/qt/qt_gc_cmake/lib-datad/source/dropdown.cpp: In member function ‘QQmlListProperty<lib::datad::DropDownValue> lib::datad::DropDown::GetValues()’:
    /home/martin/Entwicklung/qt/qt_gc_cmake/lib-datad/source/dropdown.cpp:52:59: warning: ‘QQmlListProperty<T>::QQmlListProperty(QObject*, QList<T*>&) [with T = lib::datad::DropDownValue]’ is deprecated: Use constructor taking QList pointer, and gain improved performance [-Wdeprecated-declarations]
       52 |     return QQmlListProperty<DropDownValue>(this, d->Values);
          |                                                           ^
    In file included from /opt/Extern/Entwicklung/Qt/5.15.2/gcc_64/include/QtQml/QQmlListProperty:1,
                     from /home/martin/Entwicklung/qt/qt_gc_cmake/lib-datad/source/dropdown.h:5,
                     from /home/martin/Entwicklung/qt/qt_gc_cmake/lib-datad/source/dropdown.cpp:1:
    /opt/Extern/Entwicklung/Qt/5.15.2/gcc_64/include/QtQml/qqmllist.h:69:5: note: declared here
       69 |     QQmlListProperty(QObject *o, QList<T *> &list)
          |     ^~~~~~~~~~~~~~~~
    

    Der Code dazu sie so aus:

    QQmlListProperty<DropDownValue> DropDown::GetValues(void)
    {
        Q_D(DropDown);
        return QQmlListProperty<DropDownValue>(this, d->Values);
    }
    

    Sollte man hier etwas machen und wenn ja wie. Die Sache mit dem "use constructor" sagt mir nämlich nichts.

    Danke für Eure Hilfe.
    gruss
    martin

    jsulmJ 1 Reply Last reply
    0
    • M msauer75

      Hallo zusammen,
      bisher habe ich für mein Projekt Qt 5.12 verwendet. Nachdem ich jetzt auf Qt 5.15.2 gewechselt habe bekomme ich jede Menge deprecated Warnungen.

      /home/martin/Entwicklung/qt/qt_gc_cmake/lib-datad/source/dropdown.cpp: In member function ‘QQmlListProperty<lib::datad::DropDownValue> lib::datad::DropDown::GetValues()’:
      /home/martin/Entwicklung/qt/qt_gc_cmake/lib-datad/source/dropdown.cpp:52:59: warning: ‘QQmlListProperty<T>::QQmlListProperty(QObject*, QList<T*>&) [with T = lib::datad::DropDownValue]’ is deprecated: Use constructor taking QList pointer, and gain improved performance [-Wdeprecated-declarations]
         52 |     return QQmlListProperty<DropDownValue>(this, d->Values);
            |                                                           ^
      In file included from /opt/Extern/Entwicklung/Qt/5.15.2/gcc_64/include/QtQml/QQmlListProperty:1,
                       from /home/martin/Entwicklung/qt/qt_gc_cmake/lib-datad/source/dropdown.h:5,
                       from /home/martin/Entwicklung/qt/qt_gc_cmake/lib-datad/source/dropdown.cpp:1:
      /opt/Extern/Entwicklung/Qt/5.15.2/gcc_64/include/QtQml/qqmllist.h:69:5: note: declared here
         69 |     QQmlListProperty(QObject *o, QList<T *> &list)
            |     ^~~~~~~~~~~~~~~~
      

      Der Code dazu sie so aus:

      QQmlListProperty<DropDownValue> DropDown::GetValues(void)
      {
          Q_D(DropDown);
          return QQmlListProperty<DropDownValue>(this, d->Values);
      }
      

      Sollte man hier etwas machen und wenn ja wie. Die Sache mit dem "use constructor" sagt mir nämlich nichts.

      Danke für Eure Hilfe.
      gruss
      martin

      jsulmJ Offline
      jsulmJ Offline
      jsulm
      Lifetime Qt Champion
      wrote on last edited by
      #2

      @msauer75 said in deprecated Warnungen mit Qt 5.15.2:

      Die Sache mit dem "use constructor" sagt mir nämlich nichts

      Siehe Dokumentation: https://doc.qt.io/qt-5/qqmllistproperty.html#QQmlListProperty-2
      Wahrscheinlich reicht:

      return QQmlListProperty<DropDownValue>(this, &(d->Values));
      

      https://forum.qt.io/topic/113070/qt-code-of-conduct

      M 1 Reply Last reply
      1
      • jsulmJ jsulm

        @msauer75 said in deprecated Warnungen mit Qt 5.15.2:

        Die Sache mit dem "use constructor" sagt mir nämlich nichts

        Siehe Dokumentation: https://doc.qt.io/qt-5/qqmllistproperty.html#QQmlListProperty-2
        Wahrscheinlich reicht:

        return QQmlListProperty<DropDownValue>(this, &(d->Values));
        
        M Offline
        M Offline
        msauer75
        wrote on last edited by
        #3

        @jsulm Danke für den Hinweis mit dem & hat es funktioniert.

        Mit dem & Übergebe ich doch eine Referenz auf das Objekt? Oder was mache ich da?

        jsulmJ 1 Reply Last reply
        0
        • M msauer75

          @jsulm Danke für den Hinweis mit dem & hat es funktioniert.

          Mit dem & Übergebe ich doch eine Referenz auf das Objekt? Oder was mache ich da?

          jsulmJ Offline
          jsulmJ Offline
          jsulm
          Lifetime Qt Champion
          wrote on last edited by
          #4

          @msauer75 said in deprecated Warnungen mit Qt 5.15.2:

          Mit dem & Übergebe ich doch eine Referenz auf das Objekt?

          Nein, einen Pointer (C++ Basics).

          https://forum.qt.io/topic/113070/qt-code-of-conduct

          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