Results 1 to 4 of 4

Thread: Qt's Cross-Platform Functionality

  1. #1
    Join Date
    Oct 2008
    Posts
    29
    Thanks
    1
    Qt products
    Qt4
    Platforms
    Windows

    Default Qt's Cross-Platform Functionality

    I don't really understand how QT has achieved cross platform functionality. My guess is that they've had to re-write the underlying code for each new platform. Is that correct? Or am I missing a big piece of the picture?

  2. #2
    Join Date
    Nov 2008
    Posts
    142
    Thanks
    3
    Thanked 20 Times in 20 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: Qt's Cross-Platform Functionality

    There is a certain set of APIs exposed by any platform to enable developers to write applications for that platform, for example window handling, network/file access, event handling etc. Qt acts as a layer on top of these APIs, providing it's own API to programmers. Ideally, programmers using Qt should never get in touch with the platform's actual API, so all it takes for a Qt application to be run on a different platform would be a recompile on that platform.

    So, you are right They have to rewrite the underlying code for every new platform.

  3. #3
    Join Date
    Oct 2008
    Posts
    29
    Thanks
    1
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Qt's Cross-Platform Functionality

    Cool, thanks.

  4. #4
    Join Date
    Mar 2006
    Location
    Mountain View, California
    Posts
    489
    Thanks
    3
    Thanked 74 Times in 54 Posts
    Qt products
    Qt3 Qt4 Qt/Embedded
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: Qt's Cross-Platform Functionality

    I believe there are only a dozen files that are platform specific, out of hundreds. In terms of the GUI, there is low level code to draw windows, process events, etc. Everything else is built on top of that. For example, to draw a button on the screen, it will use Windows GDI, or OSX Quartz, or X11 Xlib. I don't know about Quartz, but GDI and Xlib have very similar drawing concepts (pens, brushes, contexts, etc).

Similar Threads

  1. QT Creator, cross platform program.
    By kazek3018 in forum Newbie
    Replies: 8
    Last Post: 21st December 2008, 00:13
  2. Cross platform advice
    By tntcoda in forum Installation and Deployment
    Replies: 1
    Last Post: 15th October 2008, 18:58
  3. Crash handler on Win32
    By niko in forum Qt Programming
    Replies: 3
    Last Post: 12th November 2007, 20:41
  4. Weird Cross Platform Printing Problems
    By igor in forum Qt Programming
    Replies: 7
    Last Post: 7th August 2007, 17:25
  5. Cross compile QT/X11 for platform xscale-elf
    By nmkarvekar in forum Installation and Deployment
    Replies: 0
    Last Post: 19th May 2006, 08:20

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.