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. Integration of iOS frameworks in Qt Creator (Qt, QML)
Forum Updated to NodeBB v4.3 + New Features

Integration of iOS frameworks in Qt Creator (Qt, QML)

Scheduled Pinned Locked Moved Mobile and Embedded
8 Posts 3 Posters 3.7k 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.
  • C Offline
    C Offline
    cochleas.devel
    wrote on last edited by
    #1

    Hi all,

    does anyone knows if frameworks like UIKit or iAd can be integrated in Qt Creator?
    I want to use them in a Qml app.

    Thanx,
    Cochleas

    1 Reply Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi,

      What do you mean by integrated in Qt Creator ? Write your software to use Apple's frameworks ?

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      0
      • C Offline
        C Offline
        cochleas.devel
        wrote on last edited by
        #3

        Yes. For example add in the *.pro file something to include the frameword, e.g.g the iAd.framework and then in the *.h and *.cpp file
        to include the header and use the class objects.

        Even in the qml it would be interesting...

        1 Reply Last reply
        0
        • GianlucaG Offline
          GianlucaG Offline
          Gianluca
          wrote on last edited by
          #4

          I use iOS frameworks in Qt projects and it's very easy ... but you cannot use them from .cpp files because they are objective-C classes, so you have to add a .mm file to the project.
          And for use them in QML it's very easy: create a QObject subclass, implement it into an .mm file where you wrap any method you like of the framework and register the QObject for use it in QML.

          In .pro files I use the following directive:
          @

          This flag is necessary otherwise you get an link error

          I open a bug reports for that

          QMAKE_LFLAGS += -F/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks

          Add the framework you need

          LIBS += -framework AdSupport -framework StoreKit

          the objective sources should be put in this variable

          OBJECTIVE_SOURCES += backend_ios.mm
          @

          1 Reply Last reply
          0
          • SGaistS Offline
            SGaistS Offline
            SGaist
            Lifetime Qt Champion
            wrote on last edited by
            #5

            Then the quickest is to take a look at QtMacExtras, you'll see how it's setup to work with frameworks.

            You can't write Objective-C/C++ in qml files. You'll have to create a derived QObject class that you will use to call native functions/methods/etc...

            Interested in AI ? www.idiap.ch
            Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

            1 Reply Last reply
            0
            • C Offline
              C Offline
              cochleas.devel
              wrote on last edited by
              #6

              Thank you guys!!!
              I will check these and come back if I have still problems...

              Thanks a lot!

              1 Reply Last reply
              0
              • C Offline
                C Offline
                cochleas.devel
                wrote on last edited by
                #7

                Hi Gianluca and SGaist,

                as I am new into this field I would need some more help:

                To Gianluca:
                Could you please post an example of such a subclass implementation in the *.mm file? Also what I have to put in the backend_ios.mm?

                To SGaist:
                Could you also please post an example of creating a derived class?

                Thanks in advance for your guidance!

                1 Reply Last reply
                0
                • SGaistS Offline
                  SGaistS Offline
                  SGaist
                  Lifetime Qt Champion
                  wrote on last edited by
                  #8

                  Take a look at the QtMacExtras module and the cocoa platform plugins, they show it nicely

                  Interested in AI ? www.idiap.ch
                  Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

                  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