Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. QT5 & Swift dance together ... Super its run ... Many thanks
QtWS25 Last Chance

QT5 & Swift dance together ... Super its run ... Many thanks

Scheduled Pinned Locked Moved Solved General and Desktop
swiftmacosxframework
9 Posts 3 Posters 7.4k Views
  • 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.
  • P Offline
    P Offline
    patrik08
    wrote on 9 Aug 2017, 13:08 last edited by patrik08 8 Sept 2017, 13:09
    #1

    I solved my Swift TrayIcon search ... is here other having Swift experience?
    https://github.com/msorvig/qt-and-swift

    You do not make a library but just a framework and mixed your swift code & nice mac access to system.

    C++ and Swift interop is possible, but not at the level of Objective C++, where for example Objective C objects can be used from C++ code.

    in main.cpp

    #define EXPORT attribute((visibility("default")))
    extern "C" EXPORT NSView *createQtApplicationView();

    let qtView = createQtApplicationView()
    contentView.addSubview(qtView)

    export your app widget and all together apps editor i made…
    all action from console i prefer, is not need to load a 3GB Xcode editor
    cd SandboxDir
    git clone https://github.com/msorvig/qt-and-swift.git
    cd QtApplication // dir
    qmake & make
    // after steep by step
    macdeployqt QtApplication.framework -deploy-framework
    install_name_tool -add_rpath @loader_path/../../Frameworks/ QtApplication.framework/Contents/PlugIns/platforms/libqcocoa.dylib
    cd QtAndSwift // dir
    xcodebuild -project QtAndSwift.xcodeproj -configuration "Release"

    0_1502284151474_danceswift.png

    M 1 Reply Last reply 9 Aug 2017, 13:11
    1
    • P patrik08
      9 Aug 2017, 13:08

      I solved my Swift TrayIcon search ... is here other having Swift experience?
      https://github.com/msorvig/qt-and-swift

      You do not make a library but just a framework and mixed your swift code & nice mac access to system.

      C++ and Swift interop is possible, but not at the level of Objective C++, where for example Objective C objects can be used from C++ code.

      in main.cpp

      #define EXPORT attribute((visibility("default")))
      extern "C" EXPORT NSView *createQtApplicationView();

      let qtView = createQtApplicationView()
      contentView.addSubview(qtView)

      export your app widget and all together apps editor i made…
      all action from console i prefer, is not need to load a 3GB Xcode editor
      cd SandboxDir
      git clone https://github.com/msorvig/qt-and-swift.git
      cd QtApplication // dir
      qmake & make
      // after steep by step
      macdeployqt QtApplication.framework -deploy-framework
      install_name_tool -add_rpath @loader_path/../../Frameworks/ QtApplication.framework/Contents/PlugIns/platforms/libqcocoa.dylib
      cd QtAndSwift // dir
      xcodebuild -project QtAndSwift.xcodeproj -configuration "Release"

      0_1502284151474_danceswift.png

      M Offline
      M Offline
      mrjj
      Lifetime Qt Champion
      wrote on 9 Aug 2017, 13:11 last edited by
      #2

      @patrik08
      Cool :)
      Thx for sharing.

      1 Reply Last reply
      2
      • P Offline
        P Offline
        patrik08
        wrote on 9 Aug 2017, 13:15 last edited by
        #3

        Many tanks for doc to forum... button.. :-)
        is here a way to edit post in a little bigger window.. i can only see 4 line text ... i dont have a 6000 pix screen... only 1500 or so...

        M 1 Reply Last reply 9 Aug 2017, 21:23
        0
        • P patrik08
          9 Aug 2017, 13:15

          Many tanks for doc to forum... button.. :-)
          is here a way to edit post in a little bigger window.. i can only see 4 line text ... i dont have a 6000 pix screen... only 1500 or so...

          M Offline
          M Offline
          mrjj
          Lifetime Qt Champion
          wrote on 9 Aug 2017, 21:23 last edited by mrjj 8 Sept 2017, 21:24
          #4

          @patrik08
          What window do you talk about ? :)

          1 Reply Last reply
          0
          • P Offline
            P Offline
            patrik08
            wrote on 10 Aug 2017, 08:07 last edited by
            #5

            here this...0_1502352428522_pupu.png

            M 1 Reply Last reply 10 Aug 2017, 08:14
            0
            • P patrik08
              10 Aug 2017, 08:07

              here this...0_1502352428522_pupu.png

              M Offline
              M Offline
              mrjj
              Lifetime Qt Champion
              wrote on 10 Aug 2017, 08:14 last edited by
              #6

              @patrik08
              Well its the width of screen /2 sort of.

              You can try the alt text

              1 Reply Last reply
              1
              • P Offline
                P Offline
                patrik08
                wrote on 10 Aug 2017, 13:58 last edited by
                #7

                oh tank .... button & icon say .... not so mach..

                Usability-Test <>

                1 Reply Last reply
                0
                • M Offline
                  M Offline
                  mrjj
                  Lifetime Qt Champion
                  wrote on 10 Aug 2017, 15:29 last edited by
                  #8

                  well it doesn't give much in width anyway, just height.

                  1 Reply Last reply
                  0
                  • S Offline
                    S Offline
                    SherifOmran
                    wrote on 7 Aug 2019, 03:04 last edited by SherifOmran 8 Jul 2019, 03:08
                    #9

                    @patrik08 : I am trying to mix normal QT application with Swift code in order to load the receipt of purchasing an app from app store as requested in this, since you have good experience with Swift and QT C++ code, i would appreciate if you provide an example for this case to the tracker. Thanks alot

                    https://bugreports.qt.io/browse/QTBUG-76665
                    
                    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