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

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 last edited by patrik08
    #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

    mrjjM 1 Reply Last reply
    1
    • P patrik08

      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

      mrjjM Offline
      mrjjM Offline
      mrjj
      Lifetime Qt Champion
      wrote on last edited by
      #2

      @patrik08
      Cool :)
      Thx for sharing.

      1 Reply Last reply
      2
      • P Offline
        P Offline
        patrik08
        wrote on 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...

        mrjjM 1 Reply Last reply
        0
        • P patrik08

          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...

          mrjjM Offline
          mrjjM Offline
          mrjj
          Lifetime Qt Champion
          wrote on last edited by mrjj
          #4

          @patrik08
          What window do you talk about ? :)

          1 Reply Last reply
          0
          • P Offline
            P Offline
            patrik08
            wrote on last edited by
            #5

            here this...0_1502352428522_pupu.png

            mrjjM 1 Reply Last reply
            0
            • P patrik08

              here this...0_1502352428522_pupu.png

              mrjjM Offline
              mrjjM Offline
              mrjj
              Lifetime Qt Champion
              wrote on 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 last edited by
                #7

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

                Usability-Test <>

                1 Reply Last reply
                0
                • mrjjM Offline
                  mrjjM Offline
                  mrjj
                  Lifetime Qt Champion
                  wrote on 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 last edited by SherifOmran
                    #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