Results 1 to 10 of 10

Thread: QML's import does not work

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Jan 2006
    Location
    Ljubljana
    Posts
    687
    Thanks
    111
    Thanked 4 Times in 4 Posts
    Qt products
    Qt5 Qt/Embedded
    Platforms
    MacOS X Unix/X11 Windows Android

    Default Re: QML's import does not work

    Now the code finds component, but at runtime the file cannot be found:
    Starting D:\xxxxx\xxxxx\Software\fsaInteractor\bin\x86\debu g\debug\fsaInteractor.exe...
    QML debugging is enabled. Only use this in a safe environment.
    QQmlApplicationEngine failed to load component
    qrc:/FsaQmlMain:36 Type FsaComponents.FsaMenuItem unavailable
    qrc:/components/FsaMenuItem.qml:-1 File not found
    Here is qml.qrc file listing:
    Qt Code:
    1. <RCC>
    2. <qresource lang="English" prefix="/">
    3. <file alias="FsaQmlMain">main.qml</file>
    4. </qresource>
    5. <qresource lang="English" prefix="/components">
    6. <file alias="FsaQmlMenuItem">components/FsaMenuItem.qml</file>
    7. </qresource>
    8. </RCC>
    To copy to clipboard, switch view to plain text mode 
    and here is directory listing:
    dirStructure.jpg

    Why the file is not being found?

    Sincerely,
    Marko
    Qt 5.3 Opensource & Creator 3.1.2

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,368
    Thanks
    3
    Thanked 5,018 Times in 4,794 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: QML's import does not work

    Because you have aliased its name.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  3. The following user says thank you to wysota for this useful post:

    MarkoSan (8th September 2014)

  4. #3
    Join Date
    Jan 2006
    Location
    Graz, Austria
    Posts
    8,416
    Thanks
    37
    Thanked 1,544 Times in 1,494 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: QML's import does not work

    Try to specify the URL for your main QML file as "qrc:///main.qml" instead of "qrc:/main.qml"

    Cheers,
    _

  5. #4
    Join Date
    Jan 2006
    Location
    Ljubljana
    Posts
    687
    Thanks
    111
    Thanked 4 Times in 4 Posts
    Qt products
    Qt5 Qt/Embedded
    Platforms
    MacOS X Unix/X11 Windows Android

    Default Re: QML's import does not work

    Quote Originally Posted by anda_skoa View Post
    Try to specify the URL for your main QML file as "qrc:///main.qml" instead of "qrc:/main.qml"

    Cheers,
    _
    But it is not the problem in main.qml (main.qml works fine), it is problem in the one of imported elements, FsaMenuItem.qml.
    Qt 5.3 Opensource & Creator 3.1.2

  6. #5
    Join Date
    Jan 2006
    Location
    Graz, Austria
    Posts
    8,416
    Thanks
    37
    Thanked 1,544 Times in 1,494 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: QML's import does not work

    Quote Originally Posted by MarkoSan View Post
    But it is not the problem in main.qml (main.qml works fine), it is problem in the one of imported elements, FsaMenuItem.qml.
    Yes, that was obivous.
    Nevertheless can the base URL affect resolution of subsequent URLs

    Cheers,
    _

Similar Threads

  1. Cannot import my graph
    By Stanfillirenfro in forum Qt Programming
    Replies: 2
    Last Post: 26th April 2014, 21:41
  2. Qt 4.5 import stylesheet
    By dcoppenb in forum Qt Programming
    Replies: 0
    Last Post: 7th March 2013, 12:47
  3. How to import qss into another qss file
    By bedbuffer in forum Newbie
    Replies: 1
    Last Post: 4th April 2011, 11:22
  4. import pdf in a QGraphicsView
    By tilsitt in forum Qt Programming
    Replies: 1
    Last Post: 25th March 2011, 16:18
  5. How do i import and use a DLL like Skype4COM.dll in Qt4?
    By fernando in forum Qt Programming
    Replies: 3
    Last Post: 8th May 2010, 07:22

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Qt is a trademark of The Qt Company.