Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Mobile and Embedded
  4. [solved] iOS - Qt4iOS - mobility (problem of mine)
Forum Updated to NodeBB v4.3 + New Features

[solved] iOS - Qt4iOS - mobility (problem of mine)

Scheduled Pinned Locked Moved Mobile and Embedded
4 Posts 2 Posters 2.2k 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.
  • F Offline
    F Offline
    favoritas37
    wrote on last edited by
    #1

    To begin with i will start by congratulating Qt4iOS for the latest update!

    The problem that i am having which unfortunately i can't solve it on my own is the following:

    I am using the latest version of Qt4iOS with the iOS plugin, using XCode 4.5 and targeting a iPod Touch (4th generation) with software version 6.0

    I am porting an application which makes use of the sensors of the phone. Till now i am able to compile successfully the application, deploy and run it. But when i try to start any sensor, it just fails to do it returning false from the start function of any sensor.

    Apart from that i have updated the "Required device capabilities" in the .plist to include the accelerometer etc. but still now luck.

    And a second question, is the QDesktopServices::openUrl able to open and show an image that is locally stored lets say at the /Documents folder of the application? Opening a http Url works fine but any call to file:// content fails.

    Any idea?

    Thank you very much in advance!

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

      As iOS applications need to be linked statically, you will need to statically link any plugins to your application as well as the Qt libraries.

      In order to instantiate the 'sensors' plugin you'll need to put the following in your application's source code:

      #if defined( Q_OS_IOS )
      #include <QtPlugin>
      Q_IMPORT_PLUGIN(QIosSensorPlugin)
      #endif

      1 Reply Last reply
      0
      • C Offline
        C Offline
        CuteiOS
        wrote on last edited by
        #3

        The QDesktopServices::openUrl() method uses iOS system calls to open a document. As whichever application (Safari, Preview etc.) needs to have access to the part of the file system a local file is stored in, it won't be able to open files in your application's 'sandbox'. You will need to store the file in a 'public' folder (like /private/var/mobile/media), although Apple is unlikely to approve an application that writes files outside of its 'sandbox'.

        1 Reply Last reply
        0
        • F Offline
          F Offline
          favoritas37
          wrote on last edited by
          #4

          Thank you very much for your help!

          Everything works quite fine now :)

          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