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. VS 2010 + Qt Quick App.
Forum Updated to NodeBB v4.3 + New Features

VS 2010 + Qt Quick App.

Scheduled Pinned Locked Moved QML and Qt Quick
3 Posts 3 Posters 4.1k 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.
  • H Offline
    H Offline
    Hornsj2
    wrote on last edited by
    #1

    I'm sure this has been asked before but since I can't find it I get to ask it again!

    What is the recommended method for creating Qt Quick applications in Visual Studio?

    If I include the QDeclarative module in the project and write the code in an identical way as it is written in Qt Creator I am able to get a window to pop up.

    However, when I try to set a QUrl to read a QML file it either can't find it or has a file case mismatch. I have tried embedding into .qrc files as well.

    Here's the workaround so far: I create a Qt Quick application in Creator and then convert the project to a Visual Studio solution using the Qt Add-In.

    Anyone know of a reason why this would be the case?

    1 Reply Last reply
    0
    • A Offline
      A Offline
      Aleskey78
      wrote on last edited by
      #2

      I'm using VS2008 but have the same.
      With a project structure like this:

      @ProjectFolder

      • main.cpp
      • qml
        • main.qml@

      I have to specify the path to main.qml as:
      viewer.setMainQmlFile(QLatin1String("qml/main.qml")); //in VS2008
      and
      viewer.setMainQmlFile(QLatin1String("qml/qml/main.qml")); //in QtCreator

      I think it's because of "Shadow build" and parameters in .pro file:
      folder_01.source = qml
      folder_01.target = qml

      you can change folder_01.target = .
      then "qml/main.qml" will work for both.

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

        Use

        @qmake -tp vc@ on your .pro file.

        This will make proper .sln file to be loaded in Visual Studio.

        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