Beta
×

Welcome to the Slashdot Beta site -- learn more here. Use the link in the footer or click here to return to the Classic version of Slashdot.

Thank you!

Before you choose to head back to the Classic look of the site, we'd appreciate it if you share your thoughts on the Beta; your feedback is what drives our ongoing development.

Beta is different and we value you taking the time to try it out. Please take a look at the changes we've made in Beta and  learn more about it. Thanks for reading, and for making the site better!

Cross-Platform Development For Windows and OS X

kdawson posted more than 7 years ago | from the two-birds dept.

198

An anonymous reader writes to let us know about an article in RegDeveloper detailing the use of Qt, Trolltech's cross-platform C++ toolkit, for development across Windows and Mac OS X. From the article: "QT not only goes across desktops but onto embedded devices as well. So any app you write with Qt will port to an embedded device with a frame buffer running Trolltech's embedded version of QT, called QtopiaCore."

cancel ×

198 comments

Sorry! There are no comments related to the filter you selected.

And this is news? (-1, Troll)

BluhDeBluh (805090) | more than 7 years ago | (#16919646)

I thought everyone knew about Trolltech's Qt ever since the whole KDE/GNOME nonsense. Is there some news disguised here that I missed from the summary? (Yeah, like I'm gonna read TFA)

Re:And this is news? (1)

FunkyELF (609131) | more than 7 years ago | (#16919778)

It sure is news. It is OSNews. They posted this a little while ago too.

Re:And this is news? (3, Informative)

1iar_parad0x (676662) | more than 7 years ago | (#16919952)

It's not a news article, it's more of an overview for programmers. Actually, it's pretty well written, just not a 'headline'. Incidentally, I hadn't heard about the KDE/GNOME stuff until recently. I only ran across Qt when I was looking for an OSS (or just free) RAD tool.

Re:And this is news? (1)

LubosD (909058) | more than 7 years ago | (#16921222)

May I know why do you call KDE/GNOME a nonsense?

Re:And this is news? (2, Funny)

ErroneousBee (611028) | more than 7 years ago | (#16921728)

He probably was referring to the KDE/Gnome flamewars that erupt on slashdot occassionaly. Evenyone knows those arguments are nonsense as Gnome is clearly inferior to KDE in every respect, apart from its gname.

Re:And this is news? (2, Insightful)

Anonymous Coward | more than 7 years ago | (#16923456)

You, sir, just made the most insightful post ever on this blog. I have long held the opinion that anyone who thinks Gnome is better than KDE is suffering from an almost-incurable mental illness and is thoroughly deranged. I once suffered from the mental illness known as "thinking Gnome is superior" but I have since switched to KDE and got cured.

If you are a Gnome user, have no fear. The cure of your illness does not hurt. Simply install KDE, and don't worry, as long as you keep your Gtk libraries around, all those wonderful Gnome apps will still run. Granted, you will still suffer from brain-dead file dialogs designed for people with all of the intelligence of mucous, but you will be well on your way toward stable mental health.

wxWindows (5, Funny)

also-rr (980579) | more than 7 years ago | (#16919676)

I have been doing cross platform development with wxWindows and I have to say it makes it easy. So far I have an application which crashes with exactly the same fault* on Windows, OSX *and* Linux! You just can't buy productivity like that with commercial development frameworks. *Error 5: Developer is an idiot who hasn't programmed much since the BBC Master was cutting edge technology.

Re:wxWindows (1)

PrescriptionWarning (932687) | more than 7 years ago | (#16919716)

I rather prefer Error -1: Array index out of Bounds, programmer forgot to check array size first, what a schmuck :(

Re:wxWindows (1)

also-rr (980579) | more than 7 years ago | (#16919720)

That should have been...

I have been doing cross platform development with wxWindows and I have to say it makes it easy. So far I have an application which crashes with exactly the same fault* on Windows, OSX and Linux! You just can't buy productivity like that with commercial development frameworks.

*Error 5: Developer is an idiot who hasn't programmed much since the BBC Master was cutting edge technology.


Nothing like proving a point the hard way eh... can't even do crippled HTML right first time.

Re:wxWindows (1)

fistfullast33l (819270) | more than 7 years ago | (#16920602)

HTML, meet also-rr. also-rr, meet HTML. HTML, apparently also-rr hasn't coded since the BBC Master was cutting edge technology. Also-rr, HTML has been an internet programmer's staple since 1993.

Re:wxWindows (1)

Shawn is an Asshole (845769) | more than 7 years ago | (#16920248)

It's been called wxWidgets for a few years now. Microsoft made them change the name, but they did pay for their new domains.

I do like wxWidgets and have done a good amount of development in it (C++ and Perl). It's really worth learning if you need to support more than one platform.

Qtopia? (1, Funny)

Anonymous Coward | more than 7 years ago | (#16919706)

How Qt.

Isn't that what YellowBox is for? (3, Interesting)

parvenu74 (310712) | more than 7 years ago | (#16919734)

There are the persistent rumors that the YellowBox technology from NextSTEP is still alive and well on the Apple Campus, and is just waiting for The Steve to give the "And one more thing..." signal for it to come back into the light. But whom does that help, exactly?

Re:Isn't that what YellowBox is for? (2, Informative)

WillAdams (45638) | more than 7 years ago | (#16919814)

Well,there is GNUstep. http://www.gnustep.org/ [gnustep.org]

At least one commercial app for Mac OS X is using it to get a Windows version, Nova Mind:

http://www.nova-mind.com/ [nova-mind.com]

William
(who is still pretty miffed that Apple had to cave in to Adobe and Microsoft et. al., so that instead of Rhapsody w/ Yellow Box, we got Mac OS X w/ Carbon --- I'd give my interest in Hell to get back all the time I've wasted at work using foetid Carbon apps)

Re:Isn't that what YellowBox is for? (1)

TheRaven64 (641858) | more than 7 years ago | (#16923106)

GNUstep, while a great system to work with on *NIX, is still quite immature on Windows. The problem is that most of the core developers use a combination of Linux/BSD/Solaris and Mac OS X; very few of them have Windows programming experience. It pretty much works these days, I believe there is even a patch that attaches the menu bar to windows in the broken Windows sytle, and there is a Windows style available for Camaelon.

Re:Isn't that what YellowBox is for? (1)

R3d M3rcury (871886) | more than 7 years ago | (#16922346)

There are the persistent rumors that the YellowBox technology from NextSTEP is still alive and well on the Apple Campus, and is just waiting for The Steve to give the "And one more thing..." signal for it to come back into the light.
I'm not convinced that it will happen.

First, there are better "least common denominator" approaches than YellowBox and the industry has already chosen Java. So YellowBox doesn't really give you any advantages.

Second, it adds more hassles for Apple to keep it compatible with Windows. Why should Apple bother with this? Remember that Apple doesn't make any money off it's development tools, so where's the advantage? I suppose that developers would buy Macs to develop on instead of Windows machines, but Mac developers already do this.

Finally, Apple uses Cocoa as an "easy" way to roll out access to Mac OS X features to developers. How is Apple going to roll out, say, Spotlight support to Mac developers if Windows doesn't support it. You would essentially end up with two flavors of Cocoa--least common denominator Cocoa to run in Mac OS X and Windows and "full on" Mac OS X.

So, in the end, you end up with YellowBox costing Apple money in development time with next to no benefit for Apple (unless they sold YellowBox for money). I'm not sure why Apple would choose to do this.

Re:Isn't that what YellowBox is for? (1)

TheRaven64 (641858) | more than 7 years ago | (#16923186)

You would essentially end up with two flavors of Cocoa--least common denominator Cocoa to run in Mac OS X and Windows and "full on" Mac OS X.

In a way, you already do. OpenStep is an open specification on which Cocoa is based. If you develop to OpenStep, you can write code that works on OS X and GNUstep (and the Solaris implementation, if you can find a copy). Cocoa and GNUstep both support some extensions to the specification (including some Cocoa extensions ported to GNUstep). You'll find that OpenStep is a fairly complete API; a lot of applications don't need anything beyond it. It's also quite easy to separate code that goes beyond the base specifications into categories and not compile them on whatever platform doesn't support them.

Re:Isn't that what YellowBox is for? (1)

R3d M3rcury (871886) | more than 7 years ago | (#16923590)

...and that's fine. But the concept that Apple is going to do this or actively support developers doing this is wishful thinking.

First things first (3, Informative)

Anonymous Coward | more than 7 years ago | (#16919810)

Its Qt and not QT which means Quicktime.

Re:First things first (3, Funny)

enigma9 (812497) | more than 7 years ago | (#16921570)

It is QuickTime, not Quicktime.

My pedantry is bigger than yours.

new book on QT development (0)

Anonymous Coward | more than 7 years ago | (#16919812)

It looks like Apress is publishing a new QT book next year -- Foundations of QT Development. That's kinda cool. It's not up on their website yet, but there's some info on amazon http://www.amazon.com/Foundations-Qt-Development-J ohan-Thelin/dp/1590598318/sr=11-1/qid=1164053202/r ef=sr_11_1/104-1082812-6109546 [amazon.com]

Title (0)

Anonymous Coward | more than 7 years ago | (#16919834)

Cross platform development for windows and OSX

What do windows or OSX have to do with this? Cross platform means exactly that and there are more platforms than these.

Re:Title (1)

Ruby Wednesday (979168) | more than 7 years ago | (#16919914)

Err... It works with X11, too (seeing as how KDE is based on it, and all...)

well.. (3, Insightful)

ADRA (37398) | more than 7 years ago | (#16919838)

I'll be the first to admit that I'm not very partial to QT, but the title of the article is horribly named. The title implies that the body encompases a general approach to cross-platform development. It doesn't. The article is about "Cross-platform QT development". More importantly, no alternatives are mentioned. The entire development piece is about using QT based technologies to tackel the cross-platform problem. All of this is well and great, but don't sell the article as -the- solution when its a very specific howto implement X for problem Y.

Better alternative (3, Informative)

DraconPern (521756) | more than 7 years ago | (#16919898)

This is blatant slashvertisement. Qt's controls are all emulated, it's like using Java Swing when you can use SWT instead. Further more, it requires you to use non-standard c++ syntax together with a 'qt preprocessor'. The better choice is wxWidgets [wxwidgets.org] . It supports platforms, more compilers, has native controls, and it is open source.

Re:Better alternative (1)

Shawn is an Asshole (845769) | more than 7 years ago | (#16920014)

QT4 is opensource under the GPL. The commercial license is a bit rediculous, though.

Re:Better alternative (3, Informative)

molnarcs (675885) | more than 7 years ago | (#16920218)

The commercial license is a bit rediculous, though.

Why? It seems pretty popular (Adobe, Skype, Google, Opera, etc..) Trolltech's modell is an excellent example of how you can make money on free software. QT - free for free software development, pay for it if you develop commercial software. Which means they have a good revenue stream to pay some of the best coders on earth to enhance QT, which in term, serves the community (being the basis of some of the best free software apps, like scribus for instance). Nice. (oh, and as a bonus, those who pay also get some of the best support services in the industry - check trolltech's customer satisfaction :))

Re:Better alternative (1)

stuuf (587464) | more than 7 years ago | (#16920950)

Actually, it's "free for GPL free software development, pay for proprietary or non-GPL free software." And that's only for Qt 4. Before that, it was "pay even if you're writing GPL software for windows." Compared to the wxWidgets and GTK+, which use the LGPL, it is ridiculous.

Re:Better alternative (1)

Shawn is an Asshole (845769) | more than 7 years ago | (#16921000)

I said it's redicious becuase of this [trolltech.com] :


License Pricing (per developer)

One Platform
Console Edition: $1780
Desktop Light Edition: $1990
Desktop Edition: $3300

Two Platforms
Console Edition: $2670
Desktop Light Edition: $2990
Desktop Edition: $4950

Three Platforms
Console Edition: $3560
Desktop Light Edition: $3980
Desktop Edition: $6600


That's much higher than even Visual Studio. wxWidgets is $0 and is under the LGPL. DialogBlocks (gui builder for wxWidgets) is $70/developer and can be used on as many computers as the developer uses.

Re:Better alternative (2, Insightful)

molnarcs (675885) | more than 7 years ago | (#16922020)

Still don't see your point - the price is determined by the market. If they can sell it for that much, and at the same time, they can be vastly more popular than wxWidgets (they have LOTS of customers, even though they provide a fully GPL version), that means that the pricing is just right, not ridiculous ;)) QT is simply so good, that people are willing to pay that much for it (and the support you get, which I heard is excellent).

Re:Better alternative (1)

Angostura (703910) | more than 7 years ago | (#16922592)

It's ridiculous.

Re:Better alternative (1)

Jeremi (14640) | more than 7 years ago | (#16922946)

It's ridiculous.


If you are paying for it out of your own pocket, then yes, it's really expensive. However, I expect most programmers get their employer to buy it for them -- a few thousand dollars isn't such a big deal for a company (even a small one... it's comparable to buying an extra developer's workstation or two), and given the amount of developer time it saves (a decent computer programmer's billable hours are not cheap!), I think the licenses usually pay for themselves fairly quickly. Which is why so many companies buy licenses, despite the price.

Re:Better alternative (0)

Anonymous Coward | more than 7 years ago | (#16923130)

There is nothing wrong with Qt, but what won me over to wxWidgets is that it supports more platforms and is more economical if I want to go commercial (hey we all have to eat!). Also, it seems to me that wxWidgets based apps run faster than Qt based apps, but I haven't done any real analysis of this.

Re:Better alternative (1)

metamatic (202216) | more than 7 years ago | (#16922086)

One ridiculous part of the QT commercial license is that you can't buy it for existing open source applications.

In other words, if you've written something as open source using Qt under GPL, and now want to make a commercial version of your product, you can't.

Re:Better alternative (1)

Jeremi (14640) | more than 7 years ago | (#16922992)

In other words, if you've written something as open source using Qt under GPL, and now want to make a commercial version of your product, you can't.


That doesn't sound right to me. Assuming you own the copyright to your code, you can do whatever you like with it -- it doesn't matter whether you previously released your code under the GPL or not, it's your code. You own it, and neither TrollTech nor anybody else can tell you what you can or can't do with it.


Now if you are merely licensing somebody else's GPL'd code, things might be a little different...

Re:Better alternative (1)

kimvette (919543) | more than 7 years ago | (#16923498)

metamatic is right, go read the license.

It's been 19 seconds since you hit 'reply'.

Re:Better alternative (1)

oohshiny (998054) | more than 7 years ago | (#16922648)

Trolltech's modell is an excellent example of how you can make money on free software.

Imagine every piece of software on Linux were to adopt Troll Tech's model: $2k/developer for the commercial exception for the C library, another $2k/developer for the math library, another $1k/developer for XML libraries, another $4k/developer for the kernel. Where do you think Linux would be today?

Both GNU and Linux have deliberately adopted licensing policies that permit commercial usage. Troll Tech is unfairly taking advantage of the situation. If Troll Tech's model caught on, Linux would be in deep trouble. And, in fact, on PDAs and cell phones, Troll Tech is probably one of the major reasons why Linux hasn't caught on that much there.

Yeah, so you're right: Troll Tech is an excellent example of how you can make money on free software--by unfairly taking advantage of the free commercial usage exceptions of other open source contributors.

(A further problem with Qt is that it's not an open source project, it's a proprietary project that happens to be released under an open source license.)

Re:Better alternative (0)

Anonymous Coward | more than 7 years ago | (#16922888)

And, in fact, on PDAs and cell phones, Troll Tech is probably one of the major reasons why Linux hasn't caught on that much there.


Wait, you are saying that because Trolltech is offering a product that is based on Linux for PDAs, Linux has not taken off there?

Wow, you are so messed up. So if there would be no product by Trolltech, everybody would walk around using their bash on cellphones? What hinders anybody else to bring a phone Linux product to market? <exageration-on>Is Trolltech standing behind their backs with big baseball bats?</exageration-off>

Troll Tech is an excellent example of how you can make money on free software--by unfairly taking advantage of the free commercial usage exceptions of other open source contributors.


Hmm...where does Trolltech take advantage of "other open source contributers" on Windows and MacOs?

Re:Better alternative (1)

Jeremi (14640) | more than 7 years ago | (#16923138)

Imagine every piece of software on Linux were to adopt Troll Tech's model: $2k/developer for the commercial exception for the C library, another $2k/developer for the math library, another $1k/developer for XML libraries, another $4k/developer for the kernel. Where do you think Linux would be today?


I imagine a lot more software would be GPL'd, since a lot more developers wouldn't want to pay those fees and would therefore avoid them by GPL'ing their software.


Troll Tech is unfairly taking advantage of the situation


Troll Tech isn't unfairly taking advantage of anything. They wrote their code, and they wrote it well. They've put tens of thousands of man-hours into it. They've hired the best people. They came out with a high quality product, and they released with terms that are more liberal and OSS-friendly than just about any other commercial product in existence. You are welcome to accept their terms, or reject them -- nobody is forcing you to develop with Qt if you don't like their license. Feel free to use wxWidgets or Java or Win32 or whatever you like. Nobody owes you free software. Sheesh.

Re:Better alternative (1)

Jerry (6400) | more than 7 years ago | (#16922424)

QT4 is opensource under the GPL. The commercial license is a bit rediculous, though.


How is the commercial license ridiculous? I just renewed my commercial license for a single user, two platform copy, for only $830, and find it a bargain when one considers how quick AND good the support is.
http://www.trolltech.com/products/qt/licenses/pric ing [trolltech.com]

QT's "signal & slots" technology is much more powerful and easier to implement than traditional callback functions.

I tried wxWindows when it was part of Boa-Constructor. I found Boa very enjoyable to use, but development on it seemed too slow and combine that with the fact that wxWindows requires gtk+ and other libs with specific version numbers for the version of wxWindows that I was using. Keeping them synchronized became a pain. I found DevC++ and MinGW equally pains.

Compare that with QT, which supplies the UI designer, the API doc (Assistant), the Meta-Object-Compiler (moc), the User-Interface-Compiler (uic), qmake and other utilities, all of them at the same version and installed from the same tar or exe. The tools are a joy to use.

On Windows I use MS VC2003 as my dev tool and on Linux I use Kate, believe it or not. It's easier to program in Linux than Windows because Kate is MUCH easier to use then MS VC2003, and compiling the SAME app under Linux is 10 times faster than under Windows using nmake. I use compiler defines to automatically select code specific to either Oracle or PostgreSQL, or for Win_32 or Linux, so I don't have to make code changes to compile the same app under either platform or backend.

I never wrote a C++ app before I used QT4 to write one of our major in-house apps. Learning both at the same time was made considerably easier because of QT4. As a former VFP6 coder I found that once I became familiar with the QT API, Signals & Slots, and the other QT tools, development in QT4 is comparable with VFP6. Very easy, quick and enjoyable. Compate to the VFP6 apps I replace, the QT versions were several times faster. It didn't hurt that I was using Oracle as the back end, either.

Re:Better alternative (1)

Ruby Wednesday (979168) | more than 7 years ago | (#16920126)

How does it use non-standard C++?

Also, it might just be me, but wx apps always seem to look a bit off compared to 'native' ones (in GTK, at least).

There's also ease of use. In my experience, Qt is much easier to work with than wx (although that's subjective)

Re:Better alternative (1, Informative)

Anonymous Coward | more than 7 years ago | (#16920458)

You use Qt but you've never seen moc mangle the non-C++ code into something usable?

Re:Better alternative (1)

Yokaze (70883) | more than 7 years ago | (#16920898)

Bogus. It is standard C++ and compiles as such. Qt simply introduces some "keywords", which are either macros or empty defines and therefor interpreted or stripped by any standard preprocessor. moc interpretes those keywords and generates another (standard-conform) C++-file. You are free to write that generated code by hand, but I'd rather not.

Re:Better alternative (0)

Anonymous Coward | more than 7 years ago | (#16920228)

And why would you use SWT instead of Swing?

Re:Better alternative (1)

molnarcs (675885) | more than 7 years ago | (#16920288)

This is blatant slashvertisement. Qt's controls are all emulated, it's like using Java Swing when you can use SWT instead. Further more, it requires you to use non-standard c++ syntax together with a 'qt preprocessor'. The better choice is wxWidgets. It supports platforms, more compilers, has native controls, and it is open source.

Informative? Well, this comment could have been a lot shorter: qt suxxz, wxwidgets rulez :))

Oh, and tell me, where are the wxWidgets killer apps?

QT - Adobe, Opera, Skype, Google uses QT, not to mention free software apps (KDE and its rather huge application stack), amarok, Scribus, Koffice, etc. Yeah, good luck convincing those folks developing these apps that they made a bad choice :)))

Re:Better alternative (0)

Anonymous Coward | more than 7 years ago | (#16921260)

Oh, and tell me, where are the wxWidgets killer apps?

I don't know, it's not very widely used, but you may possibly have heard of a little program called BitTorrent. Apparently it was really easy to write because of wxWidgets. (Qt wasn't an option at the time because the Windows version was not free.)

Re:Better alternative (0)

Anonymous Coward | more than 7 years ago | (#16922050)

wxWidgets apps? Plenty. Look here

http://www.wxwidgets.org/about/screensh.htm [wxwidgets.org]

Qt's widgets are NOT emulated (0)

Anonymous Coward | more than 7 years ago | (#16920706)

As with newer versions of Swing, if a widget in a given configuration can be displayed natively, it is. This is true of Windows and Mac OS where theming and frequent UI changes required it. Widgets are only emulated if their configuration cannot be drawn using the underlying native type, or if you've sub-classed them (something not possible under wxWindows).

If you look up Java 6, you'll see Swing controls blending in perfectly with Vistas environment: this is because Swing, like Qt, uses the native controls as much as possible. Indeed, it's ironic that you mention SWT as an example of a native-looking widget-set, given that it is looking increasingly non-native, with its fanciful tab bars being the most obvious example.

--
Bryan

Re:Better alternative (4, Insightful)

Kjella (173770) | more than 7 years ago | (#16920832)

This is blatant slashvertisement.

For an OSS product. We seem to get a lot of those around here

Qt's controls are all emulated, it's like using Java Swing when you can use SWT instead.

Well, they don't look emulated or feel emulated, unlike java. But hey, I'm sure there's some technical reason you're right and noone cares.

Further more, it requires you to use non-standard c++ syntax together with a 'qt preprocessor'.

Yep. Which is what permits it to use a signal-slot mechanism which spanks wxWidgets and any other C++ system out there. No more crashes due to dangling pointers, yay!

The better choice is wxWidgets. It supports platforms, more compilers, has native controls, and it is open source.

Qt supports plenty platforms, plenty compilers, much better UI design tools and it's open source. I could mention it's a much better library too, but now you're just embarassing yourself.

Re:Better alternative (3, Informative)

tonigonenstein (912347) | more than 7 years ago | (#16921944)

Yep. Which is what permits it to use a signal-slot mechanism which spanks wxWidgets and any other C++ system out there. No more crashes due to dangling pointers, yay!
libsigc++ [sourceforge.net] (used in gtkmm) gives you typesafe slots/signals in ISO C++, no need to invent your own language. (No granted this wasn't possible at the time QT was originally designed).

Re:Better alternative (1)

Jerry (6400) | more than 7 years ago | (#16922524)

Yet another library that has to be synchronized with the version of wxWidgets you have to use. Just hope they coordinate them so that you aren't waiting months for one or the other to catch up, or that you don't get into finger pointing wars when one lib says your problem is someone else's fault.

Re:Better alternative (1)

Anonymous Coward | more than 7 years ago | (#16922470)

I'm using PyQt for a large system at work, so I feel at least somewhat qualified to comment on this.

Well, they don't look emulated or feel emulated, unlike java. But hey, I'm sure there's some technical reason you're right and noone cares.

They *look* OK, but they still feel emulated to me. I'm using a PyQt app on WinXP and they don't act *quite* right. For example, the resize-grip in the corner of a window, for native windows, stops you from dragging it behind the taskbar (just like if you grab the edge of a window), but for PyQt resize-grips it doesn't. There are a dozen other little things like this that it gets wrong -- espcecially for complex widgets like tree views. No single one is horrible, but together they give the impression of being not-quite-native. (And when you run into one that your testers declare a showstopper, it takes forever to come up with a workaround to make Qt act more native.)

Yep. Which is what permits it to use a signal-slot mechanism which spanks wxWidgets and any other C++ system out there. No more crashes due to dangling pointers, yay!

Qt actually has two event systems: some things you can only get to via the "signal-slot" mechanism (which Qt advocates seem to think is oh so revolutionary, which it's not), and some you can only get to by subclassing, and there seems to be no rhyme or reason for what gets what. (Did the user click? Use a signal. Did the user drag? Subclass.)

Of course, with bindings and an HLL, you don't get crashes with any toolkit, but Qt's dueling event systems are still a PITA.

Qt supports plenty platforms, plenty compilers, much better UI design tools and it's open source.

"Better UI design tools"? I've heard nothing but bad things about them, even from the most hardcore Qt advocates.

Many toolkits (Aqua, Gtk+, wxWidgets, etc.) let you use a layout tool to design your UI, and then save it as a resource, and load it from whatever language you're using.

Qt lets you use a layout tool to design your UI, and then export source code that you're not supposed to touch (and which is virtually impossible to read). To use it, you're supposed to import and subclass it. If you change the .ui file, you have to re-run the script to regenerate the source file again. You can't use the .ui file directly at runtime.

I have not heard any reasons why this two-step process should be better than the one-step process that everybody else uses. Even the Qt fans here think it's dumb.

I could mention it's a much better library too, but now you're just embarassing yourself.

You can say whatever you want, but having used all three big ones (Gtk+, wxWidgets, and Qt) on large projects, none is better in all areas, and Qt is worse in most. The only people who think any criticism of Qt is "embarassing yourself" are Qt fanatics.

Re:Better alternative (1)

Caesar Tjalbo (1010523) | more than 7 years ago | (#16923344)

I use PyQt too, I like it in general.
Qt lets you use a layout tool to design your UI, and then export source code that you're not supposed to touch (and which is virtually impossible to read). To use it, you're supposed to import and subclass it. If you change the .ui file, you have to re-run the script to regenerate the source file again. You can't use the .ui file directly at runtime.
Yes. I've written some CLI 'tools' for code generation-and-then-add-some-missing-lines. It's a pity it has to work this way, although it does work.

Re:Better alternative (1)

pherthyl (445706) | more than 7 years ago | (#16923422)

Like you, I have also worked with all three of those toolkits (Gtk+, wxWidgets, and Qt), and had quite the opposite experience. Granted I was working from C++, so maybe there are some PyQt bugs that I'm not seeing.

I agree that Qt apps don't look quite 100% native, but it's so close that I bet most users wont notice. Think about how many toolkits are in use on Windows already. Every second app rolls their own, so users are accustomed to little differences.

GTK I can't use, because it looks and behaves horribly on Windows, which is one of our primary targets, and thus is right out.

wxWidgets would have been a contender, but last time I tried it, I found a bug (in the Timer) within a few hours of learning it. Now it may have just been bad luck, but finding a bug that quickly indicates to me that actual serious use would uncover a lot more. Also I can't stand the horrible MFC style message maps for events. Maybe if they get rid of that I'll give it another look.

"Better UI design tools"? I've heard nothing but bad things about them, even from the most hardcore Qt advocates.

Personally, I like Designer. It does the job for me, and I like the way of generating code from the UI file. I always thought loading an XML file for the UI at runtime was a waste of time. In 99% of the cases, you won't be changing the UI at runtime, so why load it every time? It adds overhead both in terms of load time, and in terms of you having to have a full featured XML parser included with your program. It makes much more sense to compile the UI to code. Qt 4.2 allows you to theme your UI with stylesheets at runtime if you really want to.

I don't understand your complaint about the event system either. For custom widgets you always use the inheritance method. Whether that is to handle a click, or to handle a drag event. There is no inconsistency there. If you want to get an event from another object, you use the signal/slot method for obvious reasons. There is no overlap between the two.

Re:Better alternative (2, Insightful)

pherthyl (445706) | more than 7 years ago | (#16923470)

One other thing. Toolkits like Qt and wxWidgets are complex beasts with lots of corner cases that can screw things up. It takes a lot of testing to get it right. That's another reason I choose Qt over wxWidgets. Qt gets hammered on by the KDE project all the time. Millions of lines of code and just about every type of app you can imagine. What is wxWidgets used in? I can only think of Audacity and VLC, neither of which has a particularly good UI.

Re:Better alternative (1)

oohshiny (998054) | more than 7 years ago | (#16922794)

For an OSS product. We seem to get a lot of those around here

Qt is not an "OSS product"; it's a commercial product that happens also to be released under an open source license. That's a big difference.

For example, it's not possible to fork Qt and compete with the original. That means, among other things, that Troll Tech has full control over where Qt is going and there's not a damned thing anybody can do about that. Furthermore, unlike OSS projects, licensees of Qt end up having to pay for contributions that third parties make to Qt.

Re:Better alternative (1)

Jeremi (14640) | more than 7 years ago | (#16922902)

For example, it's not possible to fork Qt and compete with the original.


Who is stopping you? Qt is licensed under the GPL, so fork away.


(If your objection is that your forked product will have to be under the GPL also, which would make it harder for you to sell it... well, tough titties. Write your own damn GUI library if that bothers you)

Re:Better alternative (2, Informative)

J.R. Random (801334) | more than 7 years ago | (#16923170)

Qt is not an "OSS product"; it's a commercial product that happens also to be released under an open source license. That's a big difference.

QT is distributed under the GPL. That means it can be forked like any other GPLed software. As with any GPLed software, if you write software based upon it your own software must also be GPLed. Commercial users who don't want to GPL their code can buy licenses for the unfree version, since QT is dual licensed. This gives you more choices than you would have if it were only available under the GPL, yet strangely people who have no problem with GPLed software are always bitching about Trolltech's licensing options.

Re:Better alternative (1)

Yokaze (70883) | more than 7 years ago | (#16921514)

> Qt's controls are all emulated, it's like using Java Swing when you can use SWT instead.

So? If Swing were as fast as native widgets (which in my experience Qt widgets are), and integrate in the native OS desktop as any other application (dito), would there even be SWT?

Another advantage of wxWidgets is its ease porting from MFC due to its similarity.


BEGIN_EVENT_TABLE(MyFrame, wxFrame)
    EVT_MENU(ID_Quit, MyFrame::OnQuit)
    EVT_MENU(ID_About, MyFrame::OnAbout)
END_EVENT_TABLE()

I rest my case.

Re:Better alternative (1, Funny)

Anonymous Coward | more than 7 years ago | (#16922278)

>Another advantage of wxWidgets is its ease porting from MFC due to its similarity.

That statement by itself is good enough of a reason to discard wxWidgets as a possible alternative for cross-platform development.

Re:Better alternative (0)

Anonymous Coward | more than 7 years ago | (#16922876)

That statement by itself is good enough of a reason to discard wxWidgets as a possible alternative for cross-platform development.

In fact, Qt-like signal handling is fully supported in wxWidgets, and without the need for Qt's non-standard C++ constructs.

Re:Better alternative (1)

TheRaven64 (641858) | more than 7 years ago | (#16923246)

If Swing were as fast as native widgets (which in my experience Qt widgets are), and integrate in the native OS desktop as any other application (dito), would there even be SWT?

I take it you've never used Qt applications on OS X. They stick out like a sore thumb. Until Qt 4, they didn't even use the same shortcut keys for skipping words / lines in text boxes as every other OS X application. I'd take a Swing app over a Qt app on OS X any day.

What about the GUIs? (2, Informative)

Yvan256 (722131) | more than 7 years ago | (#16919918)

If you use these things, do the programs look native to the operating system or do they look like Java?

I mean, one of the reason I don't use Firefox on OS X is because the form widgets look like crap (i.e. look like Windows).

Re:What about the GUIs? (3, Informative)

molnarcs (675885) | more than 7 years ago | (#16920138)

They work like native apps (check the comments below the article), and as far as I know, they can use native widgets as well. Skype and Opera are also written in QT (the interface) - do they look like native enough on windows or MacOS X? I've seen the windows versions of these only, they look like... well, windows programs (so consistency is not a problem, they just blend in fine the rest of the application stack on windows ;))

Re:What about the GUIs? (1)

cyber-dragon.net (899244) | more than 7 years ago | (#16921436)

Opera at least has a "native" look mode which works wonderfully on OS X and Windows. I have not tried skype on windows so cannot comment but on Mac it blends in well.

Opera, and skype I beleive but am not sure, also offer "skins" one of which for opera will make it look the same on MacOS or Windows. I imagine any of the other skins would come out the same as well. I usualy stick to "native" mode on both though as I am a fan of a consistant UI.

They look native, but they don't behave native. (1)

smurfsurf (892933) | more than 7 years ago | (#16921646)

Opera does not behave like a native application in OS X, unfortunately. E.g. you cannot drag text or images from a webpage (and you miss all the Cocoa goodness). Might be something Opera borked up though.

Re:What about the GUIs? (1)

iJed (594606) | more than 7 years ago | (#16922396)

Actually Skype on the Mac is a Cocoa application. You can look inside the application package and view all the content .nib files very easily. I've yet to see a QT interface on the Mac looking native.

Re:What about the GUIs? (1)

pherthyl (445706) | more than 7 years ago | (#16923510)

Actually that's not true. They are only written in Qt on Linux. Opera actually made their own widget set on Windows (so much for consistency) and Skype uses Delphi on Windows. As someone else mentioned, skype uses Cocoa on OS X. No idea about what Opera does there.

Re:What about the GUIs? (2, Informative)

Ruby Wednesday (979168) | more than 7 years ago | (#16920196)

They use the native widgets. Aqua on OS X, and Luna (or whatever) on WinXP. (this is why these 2 themes only work on their respective platforms)

Re:What about the GUIs? (1)

Vexorian (959249) | more than 7 years ago | (#16920388)

Could swear there was a MacOSX firefox theme around.

Anyways, wxwidgets (not wxwindows like some are still calling them) make truly cross platform GUI applications, with the OS native GUI! It is great to use Code::Blocks in windows and then use the same IDE to open the project on Linux. The only problem is that wxwidgets is kind of a huge library, which hardly has support from linux distros (I've seen things like SDL always included in distros, but wxwidgets must be downloaded) . In windows the problem is worse because it makes your exe distribution a lot bigger so it is still only cool for big projects.

Re:What about the GUIs? (4, Informative)

Mercano (826132) | more than 7 years ago | (#16920476)

If you use these things, do the programs look native to the operating system or do they look like Java?
Java apps should look like native apps, at least, if the developer thinks they should. Its not to hard. Either use AWT for your GUI which will use native widgets (though shoots for the least common denominator at times), or use swing and have it emulate native controls (more or less) by calling UIManager.setLookAndFeel( UIManager.getSystemLookAndFeelClassName() ); early on in your code. Granted, neither is perfect, but they don't stick out like swings default (why?) Metal look and feel.

Don't Waste Unnecssary Resources (-1, Troll)

Anonymous Coward | more than 7 years ago | (#16919970)

There is no reason to waste development time on native OS X apps now that Macs can run Windows at boot or in parallel. We stopped all Mac versions of our product and are having Mac users run it under Window on their machines. Almost all of our users run Windows on their machines and the few that don't aren't worth the massive hassle it would take to support them.

Cold, but software development is expensive.

Re:Don't Waste Unnecssary Resources (1)

bluekanoodle (672900) | more than 7 years ago | (#16920042)

Wait for it.....

3,2,1... Go!

Re:Don't Waste Unnecssary Resources (0)

Anonymous Coward | more than 7 years ago | (#16920168)

Software development is expensive? So are Windows licenses you frigtard. Tell ya what, bundle a copy of XP with your app so I can run it and we'll talk. Oh, and send me an Intel iMac to replace my G5 and we'll talk. Errr...nevermind ya friggin troll, you can keep your stupid POS with the terrible UI, lack of Mac integration (AppleScript, QuickTime, iLife, Dashboard, etc etc.)

Re:Don't Waste Unnecssary Resources (0, Troll)

lpcustom (579886) | more than 7 years ago | (#16920170)

I'm sure they all rush at the opportunity to install Windows on their $2000 Mac. Thanks for your help in assuring Microsoft keeps it's strong hold on the market. Hopefully they are giving you a commission.

Re:Don't Waste Unnecssary Resources (0)

Anonymous Coward | more than 7 years ago | (#16920400)

Maybe that's a sound business decision for your company, but it isn't universally true. If I were a Mac user, given two similar products with one that was only for Windows and one available for the Mac, all other things equal, I'd pick the Mac version. Less hassle.

For some companies, the extra advantage of having a Mac version might outweigh the development costs, especially if you have a high sales volume. Also, if you've written everything reasonably cross-platform, then the additional testing, packaging, and support may only be a small fraction of the development costs compared to creating the core product.

Re:Don't Waste Unnecssary Resources (2, Interesting)

MightyMartian (840721) | more than 7 years ago | (#16920414)

So I gather you guys sell Windows licenses as well, right? Or are you advocating your customers commit acts of piracy just because you're too cheap and/or incompetent to do a little leg work to recompile for OSX.

Re:Don't Waste Unnecssary Resources (1)

everphilski (877346) | more than 7 years ago | (#16920684)

Assuming its a multi-thousand dollar product (hell, a several hundred dollar product) a legit copy of XP is rounding error ... this makes business sense for niche programs.

Have a point (4, Interesting)

willy_me (212994) | more than 7 years ago | (#16920868)

While everyone here appears to think that this is a troll, he actually has a point. Depending on the market it could be the best solution. However, if there is enough demand a competitor could release a MacOS version and steal your clients. And not just the MacOS clients. A company of say 100 with 2 Macs could decide to go with your competitor because of those two lousy Macs... Or a company thinking that someday they might want a Mac would have that much more incentive to avoid your product.

I read a blog about the business decisions behind the upcoming Mac port of IBM Notes (or do they still call it Lotus Notes?) Anyway, the comment was that Macs make up only 1% of the market but carry 99% of the weight. (Probably a slight exaggeration on their part.) When I say weight I'm referring to making purchasing decisions. They're a very vocal group and the decision to make a *good* native version of Notes was not based on Mac numbers but on the influence that those few Mac users wielded. Moral of the story, don't dismiss Macs just because only a few of your clients have them.

Willy

wxWidgets instead of Qt (0)

Anonymous Coward | more than 7 years ago | (#16920034)

For when you need to make money and 2500$ per seat per platform licenses hurt.

Anyone hear of a language called Java? (0)

Anonymous Coward | more than 7 years ago | (#16920056)

I think it is made by a company called sun and is supposed to be cross platform?

Pfffft, what do I know...

Re:Anyone hear of a language called Java? (-1, Flamebait)

Anonymous Coward | more than 7 years ago | (#16920260)

If you want your users to suffer slow class load times and wait for the initial JIT compiles when code is first executed, then go ahead and use Java. If you want shoddy imitation file choosers (that don't support sorting in details view, don't support the dropdown of possible filename completions, and close the window instead of CDing to typed-in directory name upon pressing enter), then Swing is an especially good choice.

If you have a heart you won't subject your users to Java GUI apps.

For Pete's sake, use wxWidgets (-1, Flamebait)

Anonymous Coward | more than 7 years ago | (#16920368)

Well, I guess that if you come from the world .NET and C#, cross-platform developement with Qt
might seem like a revelation.

For everybody else, stop wasting your time and use wxWidgets. It will give you a fairly unified
environment on the API side and a native look-and-feel at the other side using whatever toolkit is native
on the platform. It also supports more language bindings (Python for protoptyping works a treat).

I don't know about embedded devices, but then I guess your hand will be forced but all sorts of constrains
anyway.

Why use Qt? (0)

Anonymous Coward | more than 7 years ago | (#16920572)

Why use Qt with its horrible licensing issues for commercial software creation when you can use a better solution like REALbasic [realbasic.com] ?

Re:Why use Qt? (2)

Jerry (6400) | more than 7 years ago | (#16922554)

When I tried RealBasic 1.0 their demo tutorial produced code which crashed.
IF they can't be sure their first release is reliable, what does that say about their quality control and testing?
End of lesson. End of RB, for me.

GNUstep (2, Informative)

stivi (534158) | more than 7 years ago | (#16920826)

GNUstep [gnustep.org]

  • majority of Cocoa classes implemented
  • can use OS X NIB files (user interface)
  • uses Objective C - OS X "native" language
  • can be used on MS Windows, Linux or other systems with UNIX taste as well
AFAIR, there was a project going on that will even convert your X Code files into GNUmakefiles that can be used directly on MS Windows, or at least someone was planning to do that. Contact the lists mentioned on their homepage for more information.

See also: GNUstep and Cocoa [gnustep.org]

Re:GNUstep (0)

Anonymous Coward | more than 7 years ago | (#16921144)

1988 called, they want their widget theme back. Not to be an ass, but GNUstep needs a serious overhaul in the looks department before it's ready for deployment. It can work wonders internaly but if it looks like that they will find it hard to get app developers.

Re:GNUstep (1)

cbv (221379) | more than 7 years ago | (#16921186)

Beauty lies in the eye of the beholder -- however, theming is possible, though not really propagated.

Used it, loved it. (2, Informative)

WPIDalamar (122110) | more than 7 years ago | (#16920886)

We used Qt for several rounds of development and it was always great to work with. In fact, I prefer their utility classes to the STL. Even if I was writing a single-platform project in c++ these days, I think I'd go for Qt.

Nowadays we're using Flash for the win/osx cross platform development. Big things are starting to come in that front.

Oh.. and Qt does use native (not emulated) widgets for win/osx.

Re:Used it, loved it. (0, Offtopic)

TemporalBeing (803363) | more than 7 years ago | (#16921330)

Nowadays we're using Flash for the win/osx cross platform development. Big things are starting to come in that front.
Glad you like to alienate your users that require 508 compliance (US - don't know what it would be referred to for other countries). Flash may give you a little bit of cross-platform, but it requires one to use the mouse, and basically forbids use of (i) keyboard navigation, and things like (ii) screen readers, which are very important for certain groups. Any company that wants to do a good, capable product - web or otherwise - would be concerned with 508 compliance, and Flash does not provide that.

I've heard that the folks behind Flash are looking at 508 compliance, but I do not see that any time soon. And that is more or less rumor mill, so who knows if they actually are.

Me - I'll still to using Qt and like technologies as I can get my 508 compliance easily enough.

Flash can be 508 compliant, in fact... (1)

mad.frog (525085) | more than 7 years ago | (#16922452)

Actually, Flash content can be completely 508-compliant... *if* designed properly.

Keyboard Nav and ScreenReader compatibility is present; it has to be factored into your Flash design work (just as with any other development environment)

http://www.adobe.com/resources/accessibility/flash 8/faq.html [adobe.com]

(plus )one Informative) (-1, Redundant)

Anonymous Coward | more than 7 years ago | (#16920916)

understand what you're getting into (3, Insightful)

oohshiny (998054) | more than 7 years ago | (#16922386)

People like to say how wonderful Qt is, but you should think carefully about what you're getting into.

Almost all of our projects are open source, but occasionally will do some custom commercial stuff. Yet, because the commercial version of Qt has a per developer license, we'd end up paying as much for it as if we did all closed-source development, since it would be impractical to divide our developers that way. And Qt isn't cheap: a couple of thousand dollars per developer. Think carefully about what it would cost you if you introduce Qt and start using it.

An additional problem with it is that it (gratuitously) uses non-standard C++ extensions. That causes additional development headaches. And the Qt/Embedded version is not even fully compatible with the desktop version, and it's an all-or-nothing proposition (forget about using other toolkits on Qt/Embedded devices).

Overall, I fail to see the point of Qt for most people. For cross-platform development needs, between Java, J2ME, and wxWidgets, I think all the bases are covered at lower licensing costs and (in the case of Java and J2ME) lower development and maintenance costs and better platform coverage.

Re:understand what you're getting into (1)

kramulous (977841) | more than 7 years ago | (#16922826)

Nicely said.

Check out Apple's wrongdoing! (0)

Anonymous Coward | more than 7 years ago | (#16922856)

Right here, lads! http://malfy.org/ [malfy.org]

Lets hope the Qt people see this (1)

adamkennedy (121032) | more than 7 years ago | (#16922996)

Dear Qt.

I write in Perl, a cross-platform language.

WxWindows has good Perl bindings, and can be compiled and installed from CPAN on the fly as a dependency, so that in any Perl application I just make a dependency on "Wx", and the someone can go...

    sudo cpan MyApplication ... and it Just Works. Everywhere. And it's free. Everywhere.

Qt has decayed binding for legacy Qt 3, and no bindings AT ALL for Qt 4. And I have to install it seperately. And if I ever used it even lightly for work, I'd have to pay. Which I'm assuming means it would be hard or impossible to have CPAN install it on the fly.

So given the two major choice for me are Wx and Qt, I have a situation where one works, installs and is free for all uses, and another one that doesn't work, doesn't install, and isn't free for all users.

Now don't get me wrong, this isn't a troll. I really do like Qt. I think it's prettier than Wx, and I'd use it if I could. I even came to your offices to gave a talk about Perl that time, remember?

But if you could take a little time and make it so that it's actually possible to in ANY way use your GUI toolkit with the most well used dynamic language (bindings? on CPAN? or something?) then I'd pay more attention.

But for our community, Qt has pretty much become legacy software at this point.

Load More Comments
Slashdot Login

Need an Account?

Forgot your password?

Submission Text Formatting Tips

We support a small subset of HTML, namely these tags:

  • b
  • i
  • p
  • br
  • a
  • ol
  • ul
  • li
  • dl
  • dt
  • dd
  • em
  • strong
  • tt
  • blockquote
  • div
  • quote
  • ecode

"ecode" can be used for code snippets, for example:

<ecode>    while(1) { do_something(); } </ecode>