Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Unsolved

    Update: Forum Guidelines & Code of Conduct


    Qt World Summit: Early-Bird Tickets

    Solved Migrating Qt 4.8 to Qt 5.8, QtDeclarative

    General and Desktop
    3
    6
    99
    Loading More Posts
    • 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.
    • SPlatten
      SPlatten last edited by

      I'm porting a Qt 4.8 project to Qt 5.8, I've been using:

      https://wiki.qt.io/Transition_from_Qt_4.x_to_Qt5

      I am not getting:

      C1083: Cannot open include file: 'QDeclarativeItem': No such file or directory
      C2678: binary '+': no operator found which takes a left-hand operand of type 'QUuid' (or there is no acceptable conversion)

      I don't believe the two are related, but any help is greatly appreciated.

      Kind Regards,
      Sy

      jsulm 1 Reply Last reply Reply Quote 0
      • B
        Bonnie @SPlatten last edited by Bonnie

        @SPlatten I think it should be

        inline QString id() const { return faultID().toString() + m_location; }
        inline QUuid faultID() const { return m_faultID; }
        
        1 Reply Last reply Reply Quote 3
        • jsulm
          jsulm Lifetime Qt Champion @SPlatten last edited by

          @SPlatten As explained here: https://doc.qt.io/qt-5/qtquick-porting-qt5.html
          replace QDeclarativeItem with QQuickItem.

          Regarding second error: please post the code where it happens.

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

          1 Reply Last reply Reply Quote 2
          • SPlatten
            SPlatten last edited by SPlatten

            @jsulm , thank you.

            The C2678 is in a file called activefaultitem.h on the line:

            inline QString id() const { return faultID() + m_location; }  // <- This is the highlighted error
            inline QUuid faultID() const { return m_faultID.toString(); }
            
            QUuid m_faultID;
            QString m_location;
            

            Kind Regards,
            Sy

            jsulm B 2 Replies Last reply Reply Quote 0
            • jsulm
              jsulm Lifetime Qt Champion @SPlatten last edited by

              @SPlatten said in Migrating Qt 4.8 to Qt 5.8, QtDeclarative:

              faultID()

              I guess this returns a QUuid?
              Change it to

              inline QString id() const { return faultID() + QUuid(m_location); }
              

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

              1 Reply Last reply Reply Quote 2
              • SPlatten
                SPlatten last edited by SPlatten

                The same error is reported on the same line. Is it actually because the return type is a QString an the faultID() does not return a QString?

                Kind Regards,
                Sy

                1 Reply Last reply Reply Quote 0
                • B
                  Bonnie @SPlatten last edited by Bonnie

                  @SPlatten I think it should be

                  inline QString id() const { return faultID().toString() + m_location; }
                  inline QUuid faultID() const { return m_faultID; }
                  
                  1 Reply Last reply Reply Quote 3
                  • First post
                    Last post