Windows Programming

Started by
13 comments, last by Glass_Knife 9 years, 7 months ago

For example, on a OSX your menu bar is at the top of the screen and child windows float freely, whereas in Windows the menu bar is at the top of the main window with child windows constrained to the parent window's bounds (for an MDI program). Another example is that OSX uses a "Quit" menu option to leave a program, whereas Windows will use "Exit".

And Qt, if you let it, will abstract those kinds of native differences (at least in theory! I'm a Windows-only user, so far).

"QMenuBar on Mac OS X is a wrapper for using the system-wide menu bar. If you have multiple menu bars in one dialog the outermost menu bar (normally inside a widget with widget flag Qt::Window) will be used for the system-wide menu bar."

On OSX, the Qt filemenus do use OSX's top-of-the-screen (instead of top-of-the-window) position, and Qt abstracts common keyboard shortcuts (if you want it to) to use the platform-specific menu spellings and shortcuts, and the platform-specific layouts of buttons. For example:

msgbox2.png

(Windows interfaces have the preferred option on the left, and the 'cancel' option on the right. Macs put extra space between 'Don't save' and 'Cancel')

It's probably not perfect, but your code should be able to compile fine (I've never done it before) on Linux, OSX, and Windows, and then you'll probably have to spend some time tweaking things a little bit with #ifdefs, but hopefully not much!

Oh, and LGPL ftw! As long as you dynamically link to the libraries (and share any modifications to the libraries themselves), you can use Qt in commercial code.

You'll have to talk to a programmer who actually release things cross-platform to get more details about the abstractions and any difficulties they run into. smile.png

Advertisement


(or you can waste hours nitpicking your interface to make it look "cooler" like I do, instead of getting actual work done. ).

Guilty! tongue.png

And that's why I don't program UI's. haha. I always seem to spend all my time making the UI's look cool or saying "Ooo, look at this cool new feature! My GUI needs this" instead of actually making it useful. haha.

For example, on a OSX your menu bar is at the top of the screen and child windows float freely, whereas in Windows the menu bar is at the top of the main window with child windows constrained to the parent window's bounds (for an MDI program). Another example is that OSX uses a "Quit" menu option to leave a program, whereas Windows will use "Exit".

And Qt, if you let it, will abstract those kinds of native differences (at least in theory! I'm a Windows-only user, so far).

"QMenuBar on Mac OS X is a wrapper for using the system-wide menu bar. If you have multiple menu bars in one dialog the outermost menu bar (normally inside a widget with widget flag Qt::Window) will be used for the system-wide menu bar."

On OSX, the Qt filemenus do use OSX's top-of-the-screen (instead of top-of-the-window) position, and Qt abstracts common keyboard shortcuts (if you want it to) to use the platform-specific menu spellings and shortcuts, and the platform-specific layouts of buttons. For example:

msgbox2.png

(Windows interfaces have the preferred option on the left, and the 'cancel' option on the right. Macs put extra space between 'Don't save' and 'Cancel')

It's probably not perfect, but your code should be able to compile fine (I've never done it before) on Linux, OSX, and Windows, and then you'll probably have to spend some time tweaking things a little bit with #ifdefs, but hopefully not much!

Oh, and LGPL ftw! As long as you dynamically link to the libraries (and share any modifications to the libraries themselves), you can use Qt in commercial code.

You'll have to talk to a programmer who actually release things cross-platform to get more details about the abstractions and any difficulties they run into. smile.png

Personally i havn't had any problems with cross platform pure QT apps (Windows, Linux, i havn't tried on Mac yet), it just works as long as you stick to the QT libraries for everything. (It is a really awesome framework and QTCreator is probably the best free IDE on the market (imo it even beats VS Express since VS Express lacks plugin support)

[size="1"]I don't suffer from insanity, I'm enjoying every minute of it.
The voices in my head may not be real, but they have some good ideas!
That's pretty cool that Qt handles some of that.

And I wasn't implying that it wouldn't compile or work, just that different platforms have different UI... "rules" that can be hard for a library to enforce from a generic layout.

Heck, not even OSs keep the same rules version-to-version. And some companies love to break the OS design guidelines cause it's "cool"... *cough*internet browsers*cough*.

Next time I'm making a C++ editor or something like that I'm going to give this stuff a try.

I think, therefore I am. I think? - "George Carlin"
My Website: Indie Game Programming

My Twitter: https://twitter.com/indieprogram

My Book: http://amzn.com/1305076532

This topic is closed to new replies.

Advertisement