Slashdot Mirror


A Taste of Qt 4

Karma Sucks writes "In 'A Taste of Qt 4', Trolltech reveals that it is positioning Qt 4 directly against Java. Qt 4 promises to be smaller and faster than its predecessors and there will be a boatload of new features including support for non-GUI applications and accessibility under Linux using Sun's ATK. More controversial is the introduction of a new and elegant foreach construct. Incidentally, for those still opposed to Qt's moc preprocessor, Havoc has some interesting comments. It is possible the idea will be adapted to provide GObject introspection in the future."

36 of 365 comments (clear)

  1. Mono-Culture? by Anonymous Coward · · Score: 5, Interesting

    "Trolltech reveals that it is positioning Qt 4 directly against Java."

    And what about Mono?

    1. Re:Mono-Culture? by bircho · · Score: 4, Insightful

      It's not a Monopoly... I don't think Gnome is gonna embrace Qt (at least now). So Mono has its place.

    2. Re:Mono-Culture? by RoLi · · Score: 4, Insightful
      Is there even one single non-trivial software project made with/on Mono?

      I'm getting tired of all those predictions, promises and vaporware coming from Gnome/Mono. Why does anybody still take them seriously?

      So far, nothing useful has come from Mono while Qt runs REAL software (you know, the kind that actually runs and can be useful) ranging from a whole desktop environment to word-processors.

  2. About KDE... by c4Ff3In3+4ddiC+ · · Score: 5, Interesting

    When KDE released version 3.2, there was a noticable speed improvment for most users. Will we get to see another good speed boost when/if KDE moves to QT4? Here's hoping.

    --
    *twitch*
    1. Re:About KDE... by 10Ghz · · Score: 5, Informative

      I would say yes. There has been lots of talks in the KDE-community to keep on optimizing the code. And Qt4 has several improvements that boost performance in the toolkit-side. So the toolkit gets a significant performance-boost with Qt4, and KDE itself gets more and more performance through optimizations in the code.

      Qt4 alone should cut down the start-up time of apps significantly. It's effect in the run-time are propably less dramatic, but the KDE-folks can make a difference there (and they are making a difference). And Qt4 should eat considerably less RAM. I see good things ahead :).

      --
      Lesbian Nazi Hookers Abducted by UFOs and Forced Into Weight Loss Programs - -all next week on Town Talk.
  3. Trolltech by Anonymous Coward · · Score: 5, Funny

    Ain't it neat how the trolls have their own tech company?

  4. Psh... by Anonymous Coward · · Score: 4, Funny

    qt 6.5 has been out for a while now.

  5. Re:So by moxruby · · Score: 5, Insightful

    I'm not a developer, I'm just a KDE user. I fail to see how there's anything revolutionary in here for me, or the other users. After all, software isn't just for the developers.

    While you may not realise the benefits straight away, software being easier to develop means more, higher quality apps for everybody.

  6. Wait a minute ... by obsidianpreacher · · Score: 5, Funny

    I thought we had come to the conclusion that since Sun "sold out" to Microsoft, that Java was therefore "dead" ... didn't we? And now these guys come along and ... wait ... Trolltech ...?

    Nevermind, it makes sense now.

    --
    topreacher@signature.slashdot.org 1% rm -rf sig
  7. Java? by bunhed · · Score: 5, Insightful
    ..."positioning Qt 4 directly against Java"?

    That'll be great to be writing servlets and jsp's in C++. *cough*

    1. Re:Java? by moro_666 · · Score: 5, Interesting

      excuse me for the following expression :
      qt vs java ? WTF ?
      this is like comparing a ford vs. titanic.
      java is much more than some simple thread/socket apis
      and visual components.

      java has technologies from j2me to j2ee including
      huge transactioning clusters which work with thousands
      of clients. show me an qt based application server like jboss.
      there are none.

      so how could you POSSIBLY compare these things ?

      java runs anywhere from sun to x86, you don't have to
      compile anything if you switch the platform.

      with qt you have to. that's the trouble most users don't want to take.

      java can work in a cluster where machines are ranged
      x86's to ultrasparcs and Apple's G4's. Qt isn't able
      to do it. so .. what's the case ?

      it's hard to write a memory leaking application in java
      (i know it can be done, i have seen some "java programmers"
      who are experts on it, but usually it doesn't happen),
      every forgotten free() or a typo in a c/c++ program can
      cause you memory leaks.
      it's very hard to get a segmentation fault in java, in the
      opposite of that you get a catchable exception which
      you can handle as you like, as in c i belive everyone
      reading this forum has opened the bloody gdb and looked
      "where the f do i go wrong here... ?".

      gush. who ever wrote the article should be ashamed a bit.
      there is absolutely no point in the whole thing whatsoever.

      you may define one define that qt the standard of c++ as
      j2sdk is for java, but you couldn't obviously compare a c++
      library to the whole java business.

      --

      I'd tell you the chances of this story being a dupe, but you wouldn't like it.
    2. Re:Java? by Anonymous Coward · · Score: 4, Interesting

      Uh... it should have mentioned "positioning QT4 against J2ME", instead of just Java.

      It's about graphical toolkits used in cell phones.

  8. Happy Developers == Happy Users by Derleth · · Score: 5, Insightful

    This should be obvious.

    If the new Qt toolkit gives developers things to drool over, they'll develop more software. If they develop more software using droolworthy tools, there's a good chance some of that software will be droolworthy in and of itself.

    A good API isn't the be-all and end-all of software design. But giving developers things to feel excited over is important, especially in the open-source world.

    --
    How can you use my intestines as a gift? -Actual Hong Kong subtitle.
  9. Re:The Future of Linux by Anonymous Coward · · Score: 5, Funny

    Dude, you can't hope to get a job if your only skill is technical trolling. There is no such thing as a company called Trolltech... oh wait.

  10. Qt is almost a like a language by infiniti99 · · Score: 5, Informative

    In the Linux world, Qt is often thought of as just a GUI toolkit. After all, there is no look-and-feel standard in the X11 environment, and by default Qt and Gtk look much different. Therefore, most look-and-feel decisions on the X11 platform amount to selecting between the toolkits. Consider PyQt, which provides GUI support to python via Qt, but nothing more.

    What people don't realize is that Qt is actually a massive foundational library, similar in nature to Java's, for C++. It is a very large API, with threading, network, XML, objects, container classes, string handling, unicode, etc. The 'moc' tool even brings extra features to C++ that normally don't exist. It's almost as if Qt/C++ is a language of its own. GUI is a very small portion of Qt. In fact, of all the Qt code I've ever written, most of it has nothing to do with the GUI. Qt makes C++ actually fun.

    I'm very much looking forward to Qt 4. With the plans for advanced threading support and GUI/non-GUI split (similar to how glib and gtk are separated), I can see Qt being very useful for writing cross-platform server applications, a market mostly ruled by Java. The great thing about Qt is that it gives us natively compiled code.

    1. Re:Qt is almost a like a language by dcuny · · Score: 5, Informative
      What people don't realize is that Qt is actually a massive foundational library...

      Yes, a lot like wxWidgets.

    2. Re:Qt is almost a like a language by osewa77 · · Score: 4, Interesting

      For server-side programming, they'll need their own sort of Servlet API _or_ at least something that connects to Apache (see mod_cpp). There are conceivable ways to implement memory protection for such C++ Servlets, e.g. running each separate Servlet as it's own multithreaded application (another name for SpeedyCGI?)

    3. Re:Qt is almost a like a language by vivek7006 · · Score: 4, Informative

      You are right. QT is more than just a GUI. QT XML Module provides a very neat XML solution (both DOM and SAX), but unfortunately their implementation is really slow

    4. Re:Qt is almost a like a language by Yokaze · · Score: 4, Informative

      Only objects derived from QObject and added as a child to another QObject are deleteted automatically on destruction of the parent. (See QObject)

      This means that one doesn't have to delete all widgets which are added to a parent widgets by hand, but that it happens through the ownership-tree when deleteing the parent widget.

      I don't feel qualified to play judge between DDJ and Trolltech on wether that is good or bad C++ practice.

      --
      "Between strong and weak, between rich and poor [...], it is freedom which oppresses and the law which sets free"
    5. Re:Qt is almost a like a language by julesh · · Score: 4, Interesting

      You could argue that COM teaches bad practice because you never explicitly deallocate a COM object. You just call unlock() on it.

      Perhaps using a garbage collector is bad practice, too. We should probably therefore stay away from any project like Boehm GC that provides garbage collection in C and C++.

      Or maybe automatic ways of managing object destruction are useful tools that make programming easier... I wonder which?

  11. If We Use a Simple Syllogism... by tealover · · Score: 5, Funny

    a. More controversial is the introduction of a new and elegant foreach construct.

    b. VB has a foreach construct.

    c. Therefore, VB is elegant ?

    --
    -- You see, there would be these conclusions that you could jump to
    1. Re:If We Use a Simple Syllogism... by Idaho · · Score: 4, Funny


      a. More controversial is the introduction of a new and elegant foreach construct.
      b. VB has a foreach construct.
      c. Therefore, VB is elegant ?


      Yeah, and using the same type of logic:

      a. Human beings have hair
      b. Cats have hair
      c. Therefore, cats are human beings.

      See, I knew it! Your cat owns you, and not the other way round! (or is that only the case in Soviet Russia?)

      --
      Every expression is true, for a given value of 'true'
  12. Qt interface to Parrot? by tree_frog · · Score: 5, Interesting

    A Qt widget set target against the Parrot virtual machine would be lovely.

    Just think. .Net has well, all that Windows stuff (I'm not a big windows graphics programmer)
    Java has Swing / Eclipse and the old one whose name I can't remember but I did use it a lot but its 7:30am and the coffee hasn't hit me yet.
    A Parrot/Qt set would give Perl, Python, Ruby etc a nice graphics toolkit targettable against multiple platforms. Yes I know about Tk/Tcl and WxWindows.

    Uurgh. Must get coffee. And train

    regards, treefrog

  13. Yeah, BUT.... by SerpentMage · · Score: 4, Insightful

    Sounds interesting, BUT.... The problem QT are as follows:

    1) No GPL version for the Windows platform. As much as people in the Open Source community might hate MS, many (most) Open Source packages are cross-platform where Windows is a platform.

    2) A non GPL version of the library costs an outrageous sum of money. Sure Trolltech wants to make money, but lower the costs a bit.

    3) Why compete against Java? Somebody who uses Java is not going to switch to Qt as Java is still simpler. To me C++ != Java, and I am not saying one is better or worse than the other.

    Frankly, I tend to prefer wxWindows, which has many of facilities mentioned in the parent post. And there are plenty of bindings for wxWindows (Python, Java, .NET, etc)

    --

    "You can't make a race horse of a pig"
    "No," said Samuel, "but you can make very fast pig"
    1. Re:Yeah, BUT.... by infiniti99 · · Score: 4, Insightful

      1) No GPL version for the Windows platform. As much as people in the Open Source community might hate MS, many (most) Open Source packages are cross-platform where Windows is a platform.

      A port of the GPL'd Qt/X11 to Windows can be found here. Remember, there was a time when Gtk didn't run anywhere but X11 either, yet hobbyists managed to port it. Qt is arguably much easier to port, as it was designed this way, and Trolltech has already proven it with their own proprietary version.

      2) A non GPL version of the library costs an outrageous sum of money. Sure Trolltech wants to make money, but lower the costs a bit.

      Honestly, I'm not sure how Trolltech can afford to pay all of their programmers a decent wage by simply selling a developer tool (which by definition is a bit of a niche market), even at such a high price. They must sell a heap of licenses... I'm no business major, but I think that Qt has to be expensive if we want Trolltech in business (and we do, Linux on the desktop wouldn't be where it is today without 'em).

      3) Why compete against Java? Somebody who uses Java is not going to switch to Qt as Java is still simpler. To me C++ != Java, and I am not saying one is better or worse than the other.

      Ahh, but maybe Qt can keep a C++ user from switching to Java? I learned Qt before I learned Java, and during my study of the latter I kept thinking how much it was like Qt. At this stage, if something cool is possible in Java, I'd like to see it also possible in Qt/C++ (assuming such a feature would make sense in that context).

  14. New and Elegant "foreach" ? by PissingInTheWind · · Score: 5, Insightful

    Wow, a new syntactic construct. Stop the press.

    Seriously, such rejoicing about new language features fills me with pity at the thought of those poor programmers stuck with whatever language constructs the "higher autorities" deems them worthy to have.

    Lisp has supported extending the language for about 40 years. And people still get excited when they get a new syntactic construct for C++. That is sad.

    If you want to find joy and productivity in programming, use Scheme, Common Lisp or some other programmable programming language. Free your mind.

    --

    A message from the system administrator: 'I've upped my priority. Now up yours.'
  15. foreach by Bingo+Foo · · Score: 5, Insightful
    If you use a c++ compiler with "typeof" (g++ has this) and STL containers, you can do this handy trick:
    #define EACH( I , C ) typeof((C).begin()) (I) = (C).begin();\
    (I) != (C).end(); ++(I)
    that allows:
    std::vector<MyBigClass> v = ...

    for ( EACH( i, v ) ) {
    ... do something with i ...
    }
    which is very readable and maintainable. My guess is that Qt's foreach is something similar:
    #define foreach( I , C ) for ( typeof((C).begin()) (I) = (C).begin();\
    (I) != (C).end(); ++(I) )

    foreach( i, v ) {
    ... do something with i ...
    }
    The problem is that this is too much of a departure from C++ syntax (foiling editor syntax highlighting), and the macro hides too much of the actual loop construct.

    --
    taken! (by Davidleeroth) Thanks Bingo Foo!
  16. Trolltechs license is great by grahamsz · · Score: 5, Informative

    You can buy a commercial license and make closed-source linux applications, while supporting the community financially.

    Or you can stick with the open one...

    I can't see why it would bother microsoft either way.

  17. Win32, Win32, and Win32 again by henrypijames · · Score: 4, Interesting

    So Qt 4 is "positioned directly against Java". Fantastic! Except I read just a few days ago (also here on slashdot) that Qt will keep on blockading the release of a free-of-charge and publicly available version of their Win32 library port.

    Now, call me cynical, but how in the hell are you gonna compete with Java, whose foremost strength is the (alleged) platform independency if you kill yourself right away for the most commonly used platform?

    As pointed out by many readers already, Mac OS X is not free or Open Source, and does not have a statistically proven larger base of FOSS developers. So offering free Qt library for OS X while categorically denying Win32 is nothing but complete BS. And this new PR crap about "positioning against Java" is simply too laughable seen in this light.

    Btw, I prefer KDE over Gnome, so I'm not an "enemy" of Qt per se.

  18. Re:QT's licence is BAD! by Capt.+Beyond · · Score: 4, Insightful

    your post is redundant. GPL is GPL. If you want GPL Qt on windows, you are free to write the code yourself. As if Trolltech's GPL isn't as good as the GNU GPL. Give this a rest.

    --
    -- "Perceptions create reality. By changing your perceptions you change your reality."
  19. Against Java ? by MosesJones · · Score: 4, Insightful


    Which bit ?

    Against the J2EE platform supported by IBM, SAP, PeopleSoft, Oracle, BEA, Sun, Manugistics etc etc

    Against J2SE supported by IBM, Sun, Dell, HP etc

    Against J2ME supported by IBM, Nokia, Ericsson, Sony, Sun etc

    How about positioning it as a useful tool for corporate developers with minimal tooling support and no easy integration with corporate applications.

    OSS needs to realise what WORKS in a corporate environment and why it does, and why re-inventing, or competing with, the wheel is not a great idea.

    I like OSS, I advocate OSS with my clients, but its this sort of visionless statement that makes many serious IT directors walk away as they know its a bollocks statement made by people without a grasp of their problems.

    Corporate IT _is_ IT.

    --
    An Eye for an Eye will make the whole world blind - Gandhi
  20. Qt vs Java/Swing by nikster · · Score: 5, Interesting

    First, we need to clear up the confustion from the following statement:
    "Qt is positioned as superior alternative to Java".

    Trolltech cannot possibly mean that. What they meant to say is: "Qt is an alternative to Java when it comes to cross platform client applications using a GUI". While Qt may do some non-GUI things, too, it's totally different from Java (clue: Qt is not a programming language) and from the Java platform (it doesn't come with a VM, it doesn't have its own bytecode, etc...). What remains is that it's an alternative to Java if you want to deploy applications across Windows, Mac, and Linux. Giving Trolltech the benefit of doubt, this is what they meant.

    Having done client-side programming for many years, i can see that there is something to that. I once hoped that Qt would develop into a viable alternative because AWT/Swing was so slow.

    However, since then Sun has done their homework and made Swing fast (indistinguishable from native, for the most part), and they are continuing to work on performance in release 1.5. There is still a lot of room for improvement. Things like Apple's library caching - where they pre-compile the native libraries and cache the machine code on the hard disk which makes a Java apps start as fast as a native apps, more hardware acceleration for Swing etc.

    Once we get performance out of the way (i have not seen Qt, but i assume it's fast), there is nothing Qt could offer that Java didn't do better.
    For example, you don't have to deal with c++. Java is not perfect, but it's - yes we can say that in public - definitely more productive than c++, in the same way that c++ is more productive than asm machine code.
    Add to that extensive networking libraries, array bounds checking (buffer overflow exploits not possible in java, imagine that), garbage collection, serious instead of optional OO, and the list could go on and on, no recompiling, runs on more platforms than Qt, free deploy license...

  21. Re:QT's licence is BAD! by julesh · · Score: 4, Interesting

    Don't expect to port to Windows without paying the Trolls.

    Why on earth not? If you've only ever agreed to the GPL license on their X11 version, there is absolutely nothing they can do to stop you from porting the library, like these people are doing.

  22. Re:QT's licence is BAD! by Ben+Hutchings · · Score: 4, Insightful

    I work for a small development house, and we were certainly able to afford it. $1550 is less than two weeks' salary (and that's before counting expenses on the top of the payroll) so if Qt can save that much developer time it's worth buying. Note that the price includes good technical support.

  23. Extended multithreading support is interesting by Meijer · · Score: 4, Interesting
    For me, the extended support for multithreading is the biggest deal.
    Qt 4 takes threading support to another level, with per-thread event loops, signals--slots connections across threads, and thread-safe implicit data sharing.
    If I am not mistaken, this will enable slots to serve as messages in message passing concurrency.
    But how will they make shared data thread-safe implicitly!? Usually, for MPC, data is just copied. But if different threads share pointers, the access must be synchronized. Will QObjects become Monitors, like Java's Objects?
  24. Trolling? by brunes69 · · Score: 5, Insightful

    2) A non GPL version of the library costs an outrageous sum of money.

    If you think only 1500-3000 ( depending on package ) per developer for a perpetual license is a large amount of money, then you're either 12 years old or have never paid a dime for software in your life.

    A manager of any team of 5 or more people would laugh at that kind of money. It is chump change compared to how much a company would spend on *paper* for pete's sake.

    And if you take into account the developer's time ( which any manager must ), Qt is actually cheaper since it is so powerfull it takes on average 25-50% less code to do things in Qt than it does to do in other C++ toolkits I have used in the past.

    I would use Qt even if I was only targeting Windows and even if I was the only person on the team. It is *that* good. People who knock it just do not have experience using it.