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. [Solved] Ubuntu qt components installation error
Forum Updated to NodeBB v4.3 + New Features

[Solved] Ubuntu qt components installation error

Scheduled Pinned Locked Moved QML and Qt Quick
10 Posts 4 Posters 6.8k 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.
  • R Offline
    R Offline
    rferrazz
    wrote on last edited by
    #1

    I've tried to install ubuntu qt components on archlinux, i've created a build script and it builds fine, basically it builds like this:
    @
    qmake-qt5 -r ubuntu-sdk.pro
    make --quiet
    make INSTALL_ROOT=${pkgdir} install
    @

    the package builds fine and installs the component library under /usr/lib/qt5/imports/Ubuntu/Components/
    i've tried this sample application under qtcreator
    @
    import QtQuick 2.0
    import Ubuntu.Components 0.1

    Rectangle {
    id: root
    width: units.gu(60)
    height: units.gu(80)
    color: "lightgray"

    property real margins: units.gu(2)
    property real buttonWidth: units.gu(9)
    
    Label {
       id: title
       ItemStyle.class: "title"
       text: i18n.tr("Currency Converter")
       height: contentHeight + root.margins
       anchors {
           left: parent.left
           right: parent.right
           top: parent.top
       }
    }
    

    }
    @
    but when i run the application it says the following

    @Starting external tool '/usr/lib/qt5/bin/qmlscene' /home/riccardo/Programmi/Prova/qml/Prova/main.qml
    file:///home/riccardo/Programmi/Prova/qml/Prova/main.qml:2 module "Ubuntu.Components" is not installed@

    Why? What's the mistake? And why qtcreator doesn't underline the import statement?
    Any hints will be appreciated!

    1 Reply Last reply
    0
    • C Offline
      C Offline
      chrisadams
      wrote on last edited by
      #2

      Try exporting QML_IMPORT_TRACE=1 in your environment, and see what output you get. It seems like the import path is incorrect (QML2_IMPORT_PATH should be /usr/lib/qt5/imports/ by default).

      Cheers,
      Chris.

      1 Reply Last reply
      0
      • R Offline
        R Offline
        rferrazz
        wrote on last edited by
        #3

        it turns out that the default import paths are /usr/lib/qt5/qml and /usr/lib/qt5/bin, doing
        @export QML2_IMPORT_PATH=/usr/lib/qt5/imports@
        fixed the problem!

        Thank you!

        1 Reply Last reply
        0
        • S Offline
          S Offline
          shullw
          wrote on last edited by
          #4

          I bet I will face this type of stuff soon as well. I just wanted to thank you for posting the answer you figured out on your own. You might want to mark it as [Solved] as well. Good sleuthing.

          A QML Purest Point of View!

          1 Reply Last reply
          0
          • R Offline
            R Offline
            rferrazz
            wrote on last edited by
            #5

            Marked, i've found that in the project files there's an install path variable initialized like this:
            @installPath = $$[QT_INSTALL_IMPORTS]/$$replace(uri, \., /)@
            and changing QT_INSTALL_IMPORTS to QT_INSTALL_QML provides a radical solution to the problem

            So what is correct to use to install qml components? QT_INSTALL_QML (in my system /usr/lib/qt5/qml) or QT_INSTALL_IMPORTS ?

            1 Reply Last reply
            0
            • T Offline
              T Offline
              thuai
              wrote on last edited by
              #6

              Hi, referrazz

              I have the same problem with you!

              but set environment variable "QML2_IMPORT_PATH", this way can't work.

              export QML2_IMPORT_PATH=/usr/lib/qt5/imports

              QT_INSTALL_PREFIX:/home/thuai/local/Qt5.0.0/5.0.0/gcc_64
              QT_INSTALL_ARCHDATA:/home/thuai/local/Qt5.0.0/5.0.0/gcc_64
              QT_INSTALL_DATA:/home/thuai/local/Qt5.0.0/5.0.0/gcc_64/
              QT_INSTALL_DOCS:/home/thuai/local/Qt5.0.0/5.0.0/gcc_64/doc
              QT_INSTALL_HEADERS:/home/thuai/local/Qt5.0.0/5.0.0/gcc_64/include
              QT_INSTALL_LIBS:/home/thuai/local/Qt5.0.0/5.0.0/gcc_64/lib
              QT_INSTALL_LIBEXECS:/home/thuai/local/Qt5.0.0/5.0.0/gcc_64/libexec
              QT_INSTALL_BINS:/home/thuai/local/Qt5.0.0/5.0.0/gcc_64/bin
              QT_INSTALL_TESTS:/home/thuai/local/Qt5.0.0/5.0.0/gcc_64/tests
              QT_INSTALL_PLUGINS:/home/thuai/local/Qt5.0.0/5.0.0/gcc_64/plugins
              QT_INSTALL_IMPORTS:/home/thuai/local/Qt5.0.0/5.0.0/gcc_64/imports
              QT_INSTALL_QML:/home/thuai/local/Qt5.0.0/5.0.0/gcc_64/qml
              QT_INSTALL_TRANSLATIONS:/home/thuai/local/Qt5.0.0/5.0.0/gcc_64/translations
              QT_INSTALL_CONFIGURATION:/etc/xdg
              QT_INSTALL_EXAMPLES:/home/thuai/local/Qt5.0.0/5.0.0/gcc_64/examples
              QT_INSTALL_DEMOS:/home/thuai/local/Qt5.0.0/5.0.0/gcc_64/examples
              QT_HOST_PREFIX:/home/thuai/local/Qt5.0.0/5.0.0/gcc_64
              QT_HOST_DATA:/home/thuai/local/Qt5.0.0/5.0.0/gcc_64
              QT_HOST_BINS:/home/thuai/local/Qt5.0.0/5.0.0/gcc_64/bin
              QMAKE_SPEC:linux-g++-64
              QMAKE_XSPEC:linux-g++-64
              QMAKE_VERSION:3.0
              QT_VERSION:5.0.0

              Can you give me some help?

              Thks!

              1 Reply Last reply
              0
              • R Offline
                R Offline
                rferrazz
                wrote on last edited by
                #7

                where are your components installed? you have qt5 in your home directory so QML2_IMPORT_PATH should be /home/thuai/local/Qt5.0.0/5.0.0/gcc_64/imports or /home/thuai/local/Qt5.0.0/5.0.0/gcc_64/qml

                1 Reply Last reply
                0
                • T Offline
                  T Offline
                  thuai
                  wrote on last edited by
                  #8

                  Hi rferrazz,

                  Thks for your replying!

                  I tried QML2_IMPORT_PATH=/home/thuai/local/Qt5.0.0/gcc_64/imports or /home/thuai/local/Qt5.0.0/gcc_64/qml.

                  Both can not work!

                  I install Qt5 and Ubuntu UI toolkit according this website http://developer.ubuntu.com/get-started/gomobile/#step-write-app
                  Acording this article, Ubuntu UI toolkit can not be recognized by QtCreator

                  So i reinstall Qt5 and Ubuntu Components according to http://askubuntu.com/questions/236012/cant-install-qt-components-ubuntu-because-im-using-full-release-of-qt-5-0-0

                  After reinstall Qt5 and Ubuntu Components.

                  "import Ubuntu.Components 0.1" is resolved.

                  And label element is recognized but the ItemStyle attribute isn't.

                  Do you meet the problem about ItemStyle?

                  Thks!

                  1 Reply Last reply
                  0
                  • R Offline
                    R Offline
                    rferrazz
                    wrote on last edited by
                    #9

                    the syntax checker don't recognize it but it works correctly

                    1 Reply Last reply
                    0
                    • T Offline
                      T Offline
                      thuai
                      wrote on last edited by
                      #10

                      You are right.
                      It's syntax check.

                      Thank you!

                      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