For example someone told me that Qt is a portable library for developing GUIs that keeps the appearance the same across platforms.
For example someone told me that Qt is a portable library for developing GUIs that keeps the appearance the same across platforms.
I disagree. I think "portable" is about being able to rebuild your C/C++ source code unmodified on a different platform/OS. E.g. don't use Windows-only library functions, don't assume pointers are 32 bits, etc.
Qt is cross platform -- it's supported on loads of platforms, architectures and operating systems. You *would* have to recompile the binaries if you moved between platforms though.
This is a very useful thing!Originally Posted by Qt website
The only realistic way you can get around platform dependencies is to run on top of a virtual machine -- like Java does. That has its own problems (large runtime needed, debatable performance (I say Java programs perform horribly - but Java zeolots have assured me that I'm imagining it)).
Not exactly. For example, the standard "open file" common dialog looks different between platforms. Last time I used Qt (about 7 years ago) it seemed to be a bit ranodm as to whether you'd end up with an OS standard file open dialog or a Qt non-OS-specific one. I'll consider this problem "fixed" if they now always use the OS dialog -- so identical GUI isn't always a good thing IMO.Originally Posted by c_weed
Qt provides a bunch of other stuff too like threading and socket support - other things it's good to have a cross platform version of.
I'm not sure I agree with your definition of portability, but never mind. Assuming Qt to be "cross platform," what it does enable is portable GUI programs. The clients who use Qt gain portability by using it -- you *can* just recompile on another platform, at least if you're using Qt the right way and not making non-portable assumptions of your own.
The same can be said of the C library itself. It is not itself portable (its whole purpose being to interface to an arbitrary OS), but it enables portability in the programs which use it.
At some point all code which does anything useful to human beings has to interface with something that isn't standardized. The question is at what layer that interface occurs.
Code://try //{ if (a) do { f( b); } while(1); else do { f(!b); } while(1); //}
Mmmm! A guy a few years back nearly convinced me that Java was faster than native code - he was just so determined. Then I went back to my desk and started Eclipse, and... no. To be fair though it might be wonderful to program in - I've never done anything "real" in it.
Fair enough -- I think it's debatable. The source of all truth Wikipedia says that a "portable application" is one that can be moved between systems, and "software portability" is the ability to recompile.
Qt is definitely the latter, but as you say, so is the C library.
Indeed, well put!Assuming Qt to be "cross platform," what it does enable is portable GUI programs. The clients who use Qt gain portability by using it -- you *can* just recompile on another platform, at least if you're using Qt the right way and not making non-portable assumptions of your own.
The same can be said of the C library itself. It is not itself portable (its whole purpose being to interface to an arbitrary OS), but it enables portability in the programs which use it.
At some point all code which does anything useful to human beings has to interface with something that isn't standardized. The question is at what layer that interface occurs.
So in a sense if the objective is to make a GUI that appears the same on all OSs Java may be the better option than using Qt?