Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Installation and Deployment
  4. Qt Creator can't find QML file
Forum Updated to NodeBB v4.3 + New Features

Qt Creator can't find QML file

Scheduled Pinned Locked Moved Installation and Deployment
2 Posts 2 Posters 1.5k 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.
  • S Offline
    S Offline
    SteveG
    wrote on last edited by
    #1

    I'm running Qt Creator 2.8.1 on windows 8 and have QtTestClient.pro, main.cpp and main.qml files in the QtTestClient project directory. The build succeeds but running with msvc++ (or minGW) fails with the error

    @
    file:///C:/Projects/build-QtTestClient-Desktop_Qt_5_1_1_MSVC2012_64bit-Release/main.qml:-1 File not found
    @

    QtTestClient.pro contains

    @
    QT += qml quick

    SOURCES += main.cpp
    TARGET = QtTestClient

    OTHER_FILES +=
    main.qml
    @

    and main.cpp contains the statement

    @
    component.loadUrl(QUrl::fromLocalFile("main.qml"));
    @

    Any assistance would be appreciated.

    1 Reply Last reply
    0
    • M Offline
      M Offline
      Mammamia
      wrote on last edited by
      #2

      Its always better to use Resource file to store and access all your QML files. Then you dont need to worry about the file path...

      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