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. Use QtQuick 1 in Qt5
Forum Updated to NodeBB v4.3 + New Features

Use QtQuick 1 in Qt5

Scheduled Pinned Locked Moved Unsolved QML and Qt Quick
10 Posts 4 Posters 3.4k Views 2 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
    minamz
    wrote on last edited by
    #1

    Hi
    I have a qml file which imports QtQuick 1.0. It was ok in Qt 4.8 but after porting to qt5.7 it does not work.
    Remember that I don't want to use QtQuick 2. Is there any solution for my problem?
    my code is:
    QQuickView *view = new QQuickView;
    view->setSource(QUrl::fromLocalFile("D:/test/myQml.qml"));
    view->show();

    1 Reply Last reply
    0
    • dheerendraD Offline
      dheerendraD Offline
      dheerendra
      Qt Champions 2022
      wrote on last edited by dheerendra
      #2

      You need to use Qt Declarative module for this. This module is removed from Qt 5. 7 and is available as addon-module. You need to use Qt Quick 1.1 in your import statement. Refer to the following guide for more information http://doc.qt.io/qt-5/portingguide.html

      Dheerendra
      @Community Service
      Certified Qt Specialist
      http://www.pthinks.com

      1 Reply Last reply
      3
      • M Offline
        M Offline
        minamz
        wrote on last edited by
        #3

        Thanks for your quick reply but where can I download Qt Declarative addon-module?

        1 Reply Last reply
        0
        • SGaistS Offline
          SGaistS Offline
          SGaist
          Lifetime Qt Champion
          wrote on last edited by
          #4

          Hi,

          You can clone the module on code.qt.io.

          Interested in AI ? www.idiap.ch
          Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

          1 Reply Last reply
          0
          • M Offline
            M Offline
            minamz
            wrote on last edited by
            #5

            Hi
            I got qtquick1 from code.qt.io. I compiled it with visual studio 2015 and Qt5.7 but now I have the following errors. Would you please help me with these compile errors?
            1>.moc\Release\moc_qdeclarativeanchors_p.cpp(360): error C2027: use of undefined type 'QDeclarativeAnchorLine'
            1> c:\qtquick1-dev\src\declarative.moc\release../../graphicsitems/qdeclarativeanchors_p.h(50): note: see declaration of 'QDeclarativeAnchorLine'
            1>.moc\Release\moc_qdeclarativeanchors_p.cpp(360): error C2582: 'operator =' function is unavailable in 'QDeclarativeAnchorLine'
            1>.moc\Release\moc_qdeclarativeanchors_p.cpp(361): error C2027: use of undefined type 'QDeclarativeAnchorLine'
            1> c:\qtquick1-dev\src\declarative.moc\release../../graphicsitems/qdeclarativeanchors_p.h(50): note: see declaration of 'QDeclarativeAnchorLine'
            1>.moc\Release\moc_qdeclarativeanchors_p.cpp(361): error C2582: 'operator =' function is unavailable in 'QDeclarativeAnchorLine'
            1>.moc\Release\moc_qdeclarativeanchors_p.cpp(362): error C2027: use of undefined type 'QDeclarativeAnchorLine'
            1> c:\qtquick1-dev\src\declarative.moc\release../../graphicsitems/qdeclarativeanchors_p.h(50): note: see declaration of 'QDeclarativeAnchorLine'
            1>.moc\Release\moc_qdeclarativeanchors_p.cpp(362): error C2582: 'operator =' function is unavailable in 'QDeclarativeAnchorLine'
            1>.moc\Release\moc_qdeclarativeanchors_p.cpp(363): error C2027: use of undefined type 'QDeclarativeAnchorLine'
            1> c:\qtquick1-dev\src\declarative.moc\release../../graphicsitems/qdeclarativeanchors_p.h(50): note: see declaration of 'QDeclarativeAnchorLine'
            1>.moc\Release\moc_qdeclarativeanchors_p.cpp(363): error C2582: 'operator =' function is unavailable in 'QDeclarativeAnchorLine'
            1>.moc\Release\moc_qdeclarativeanchors_p.cpp(364): error C2027: use of undefined type 'QDeclarativeAnchorLine'
            1> c:\qtquick1-dev\src\declarative.moc\release../../graphicsitems/qdeclarativeanchors_p.h(50): note: see declaration of 'QDeclarativeAnchorLine'
            1>.moc\Release\moc_qdeclarativeanchors_p.cpp(364): error C2582: 'operator =' function is unavailable in 'QDeclarativeAnchorLine'
            1>.moc\Release\moc_qdeclarativeanchors_p.cpp(365): error C2027: use of undefined type 'QDeclarativeAnchorLine'
            1> c:\qtquick1-dev\src\declarative.moc\release../../graphicsitems/qdeclarativeanchors_p.h(50): note: see declaration of 'QDeclarativeAnchorLine'
            1>.moc\Release\moc_qdeclarativeanchors_p.cpp(365): error C2582: 'operator =' function is unavailable in 'QDeclarativeAnchorLine'
            1>.moc\Release\moc_qdeclarativeanchors_p.cpp(366): error C2027: use of undefined type 'QDeclarativeAnchorLine'
            1> c:\qtquick1-dev\src\declarative.moc\release../../graphicsitems/qdeclarativeanchors_p.h(50): note: see declaration of 'QDeclarativeAnchorLine'
            1>.moc\Release\moc_qdeclarativeanchors_p.cpp(366): error C2582: 'operator =' function is unavailable in 'QDeclarativeAnchorLine'
            1> moc_qdeclarativeflickable_p_p.cpp
            1> moc_qdeclarativegraphicswidget_p.cpp
            1>.moc\Release\moc_qdeclarativegraphicswidget_p.cpp(87): error C2027: use of undefined type 'QDeclarativeAnchorLine'
            1> c:\qtquick1-dev\src\declarative.moc\release../../graphicsitems/qdeclarativegraphicswidget_p.h(44): note: see declaration of 'QDeclarativeAnchorLine'
            1>.moc\Release\moc_qdeclarativegraphicswidget_p.cpp(87): error C2582: 'operator =' function is unavailable in 'QDeclarativeAnchorLine'
            1>.moc\Release\moc_qdeclarativegraphicswidget_p.cpp(88): error C2027: use of undefined type 'QDeclarativeAnchorLine'
            1> c:\qtquick1-dev\src\declarative.moc\release../../graphicsitems/qdeclarativegraphicswidget_p.h(44): note: see declaration of 'QDeclarativeAnchorLine'
            1>.moc\Release\moc_qdeclarativegraphicswidget_p.cpp(88): error C2582: 'operator =' function is unavailable in 'QDeclarativeAnchorLine'
            1>.moc\Release\moc_qdeclarativegraphicswidget_p.cpp(89): error C2027: use of undefined type 'QDeclarativeAnchorLine'
            1> c:\qtquick1-dev\src\declarative.moc\release../../graphicsitems/qdeclarativegraphicswidget_p.h(44): note: see declaration of 'QDeclarativeAnchorLine'
            1>.moc\Release\moc_qdeclarativegraphicswidget_p.cpp(89): error C2582: 'operator =' function is unavailable in 'QDeclarativeAnchorLine'
            1>.moc\Release\moc_qdeclarativegraphicswidget_p.cpp(90): error C2027: use of undefined type 'QDeclarativeAnchorLine'
            1> c:\qtquick1-dev\src\declarative.moc\release../../graphicsitems/qdeclarativegraphicswidget_p.h(44): note: see declaration of 'QDeclarativeAnchorLine'
            1>.moc\Release\moc_qdeclarativegraphicswidget_p.cpp(90): error C2582: 'operator =' function is unavailable in 'QDeclarativeAnchorLine'
            1>.moc\Release\moc_qdeclarativegraphicswidget_p.cpp(91): error C2027: use of undefined type 'QDeclarativeAnchorLine'
            1> c:\qtquick1-dev\src\declarative.moc\release../../graphicsitems/qdeclarativegraphicswidget_p.h(44): note: see declaration of 'QDeclarativeAnchorLine'
            1>.moc\Release\moc_qdeclarativegraphicswidget_p.cpp(91): error C2582: 'operator =' function is unavailable in 'QDeclarativeAnchorLine'
            1>.moc\Release\moc_qdeclarativegraphicswidget_p.cpp(92): error C2027: use of undefined type 'QDeclarativeAnchorLine'
            1> c:\qtquick1-dev\src\declarative.moc\release../../graphicsitems/qdeclarativegraphicswidget_p.h(44): note: see declaration of 'QDeclarativeAnchorLine'
            1>.moc\Release\moc_qdeclarativegraphicswidget_p.cpp(92): error C2582: 'operator =' function is unavailable in 'QDeclarativeAnchorLine'
            1> moc_qdeclarativeitem_p.cpp

            1 Reply Last reply
            0
            • SGaistS Offline
              SGaistS Offline
              SGaist
              Lifetime Qt Champion
              wrote on last edited by
              #6

              How did you manage the project ? Did you open it with Qt Creator ?

              Interested in AI ? www.idiap.ch
              Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

              M 2 Replies Last reply
              0
              • SGaistS SGaist

                How did you manage the project ? Did you open it with Qt Creator ?

                M Offline
                M Offline
                minamz
                wrote on last edited by
                #7

                @SGaist
                No I compiled it with visual studio.

                1 Reply Last reply
                0
                • SGaistS SGaist

                  How did you manage the project ? Did you open it with Qt Creator ?

                  M Offline
                  M Offline
                  minamz
                  wrote on last edited by
                  #8

                  @SGaist
                  I tried to compile it with Qt Creator and I get this errors:

                  ..\declarative\graphicsitems\qdeclarativeitem.h(60): Error: Undefined interface

                  1 Reply Last reply
                  0
                  • SGaistS Offline
                    SGaistS Offline
                    SGaist
                    Lifetime Qt Champion
                    wrote on last edited by
                    #9

                    Did you do it from a clean state ?

                    Interested in AI ? www.idiap.ch
                    Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

                    1 Reply Last reply
                    0
                    • frederikF Offline
                      frederikF Offline
                      frederik
                      wrote on last edited by
                      #10

                      Make sure have the right branch in your clone of the qtquick1 module checked out. If that doesn't help, then I'd assume that the module needs fixing. In that case please submit fixes through code-review or report a bug on bugreports.qt.io. Note that Qt Quick 1 is deprecated and we strongly recommend against using it in new projects.

                      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