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. Mixing Qt with Cocoa/MacOS X specific code
Forum Update on Monday, May 27th 2025

Mixing Qt with Cocoa/MacOS X specific code

Scheduled Pinned Locked Moved General and Desktop
3 Posts 2 Posters 2.9k 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.
  • D Offline
    D Offline
    DerekDomino
    wrote on 16 Jan 2012, 17:17 last edited by
    #1

    Hello,

    I'm fresh with Qt on Windows since 1 week and never developed with Xcode/Cocoa.

    The problem is the following: the behavior of the developed Qt application is not the same with Windows and Mac OS X, so I would need to tweak the code by adding a couple of Cocoa's lines of code when compiling the project on MacOS X. Since Cocoa is in Objective-C and not the main code application, do you have any idea or references pointing how to do that?

    Cheers

    1 Reply Last reply
    0
    • G Offline
      G Offline
      goetz
      wrote on 16 Jan 2012, 22:31 last edited by
      #2

      Many of the Objective C API can be used with C/C++ bindings in regular C. Also, Objective C++ should be usable within regular C++.

      As a last restort you can put your Objective C code into a separate source file and call the methods from C++.

      http://www.catb.org/~esr/faqs/smart-questions.html

      1 Reply Last reply
      0
      • D Offline
        D Offline
        DerekDomino
        wrote on 19 Jan 2012, 16:10 last edited by
        #3

        Thanks Volker, I'll do this way and keep this thread updated.

        1 Reply Last reply
        0

        1/3

        16 Jan 2012, 17:17

        • Login

        • Login or register to search.
        1 out of 3
        • First post
          1/3
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • Users
        • Groups
        • Search
        • Get Qt Extensions
        • Unsolved