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. Porting a Windows application to Mavericks.
Forum Updated to NodeBB v4.3 + New Features

Porting a Windows application to Mavericks.

Scheduled Pinned Locked Moved General and Desktop
3 Posts 3 Posters 1.0k 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
    coderqueen
    wrote on last edited by
    #1

    I am currently working on a project wherein an automatic update tool notifies the user of new product releases, bug fixes etc. This software is working on Windows but now I need to port in to Macintosh to make it cross-platform. The entire code has been written in Qt but has been written in Windows native C++. By that I mean, that a large number of Windows API calls have been made along with a batch file.
    Obviously, because of that the code wouldn't compile on C++ even if Qt is cross-platform. I understand there is no line-to-line conversion for Windows API to Mac. I am clueless on how to begin. Do I need to write those commands in Objective C and then add it into the Qt pro file or refactor the entire Windows code. Help and guidance would be appreciated.

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

      Hi and welcome to devnet,

      The first thing you should do is write down what each windows native API does and if they make sense on OS X. Depending on the API you may be able to use OS X C APIs or have to write some Objective-C/C++. You'll indeed have to refactor your code to separate native code. You have generally two options here:

      Use ifdefs

      Use a separate file for the platform specific part e.g. myclass_win.cpp myclass_osx.cpp

      Hope it helps

      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
      • A Offline
        A Offline
        andrep
        wrote on last edited by
        #3
        1. Rewrite as much as possible of the Windows specific code by cross-platform code, using the C++ Standard Library and/or Qt. For the rest, see SGaist's 1 and 2.
        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