Catch up on stories from the past week (and beyond) at the Slashdot story archive

 



Forgot your password?
typodupeerror
×
Programming IT Technology

In-Depth With Qt 4.4 253

QtPi writes "Trolltech has announced the availability of Qt 4.4, the cross-platform software development framework. Ars Technica has an in-depth look at the release, which include an integrated WebKit-based HTML rendering engine, the new Phonon multimedia framework, support for Windows CE, and significant improvements to the QGraphicsView system. 'Qt 4.4 brings a lot of rich new capabilities to the toolkit that are sure to please open source and commercial software developers. It sounds like Trolltech already has some nice plans for Qt 4.5, and we will hopefully get to hear more about the long-term roadmap after Nokia completes its acquisition.'"
This discussion has been archived. No new comments can be posted.

In-Depth With Qt 4.4

Comments Filter:
  • by Enleth ( 947766 ) <enleth@enleth.com> on Tuesday May 06, 2008 @05:44PM (#23318368) Homepage
    Graphics View alone is an extremely powerful tool - now it seems to be able to do things no other toolkit comes even close to. I can't wait to use 4.4 in an application I'm developing right now (a game map editor), this feature will allow me to make some parts of the user interface a whole lot simpler and more intuitive, throwing away a bunch of docks and toolbars in favor of a more interactive workspace.
    • You can do similar things with Swing but with a LOT more work. Also you'll feel like you're working against the system the whole time you're programming it. I bought a book called "Filthy Rich Clients" after seeing some stuff at JavaOne last year. I got half way through it and realized everything was a hack.
  • Great as it is, I can't use it.

    On Linux the libraries are now so damn big that non-KDE users wont install them.

    On Windows the best development tools are moving away from C++.

    On Mac it's just plain ugly.

    I'm sure the embedded developers are loving it though.

    • libqt-mt is about 10MB on my system. That doesn't seem too ungainly, not to mention QT4 has made large strides into componentizing the library so it's not all just one huge library to load, you can load only the parts you want.
      • by Verunks ( 1000826 ) on Tuesday May 06, 2008 @06:17PM (#23318658)
        libqt-mt is probably qt3 not qt4, but anyway qt4 provides a lot of things and nowadays disk space is not a problem, try to mix together gtk+libxml+webkit/gecko+many more things and you'll probably use much more disk space than qt4 with different api and with all kind of cross platform issue I don't understand your problem with windows, but qt4 isn't just c++, there are many bindings for python, ruby and even c# on mac os x qt4 looks good to me, there is even an alpha version of qt4 that uses cocoa instead of carbon
        • Re: (Score:3, Informative)

          by willy_me ( 212994 )

          on mac os x qt4 looks good to me, there is even an alpha version of qt4 that uses cocoa instead of carbon

          The problem is not the look, it's the feel. It is the way the toolbars work, dialog boxes, etc. It is the way all the pieces fit together to provide a user interface. Qt is impressive but it is not native.

          there is even an alpha version of qt4 that uses cocoa instead of carbon

          Cocoa and Carbon are actually the same thing. Just different APIs used to access the same elements. Qt adds yet another

    • by flymolo ( 28723 )

      On Mac it's just plain ugly.
      It looks native on Mac. I'm using it now. Sadly it isn't 64 bit yet, but that's slated for 10.5 .
    • Google Earth is based on QT and it's avalaible for Windows / MacOS X / Linux.

      I think that google engineers have studied several tools for developing this program for multiple operating systems and decided that QT was the best toolkit
      • by thzinc ( 679235 ) on Tuesday May 06, 2008 @06:18PM (#23318672) Homepage
        It was Keyhole's engineers that made that decision, not Google's.
        • Re: (Score:2, Interesting)

          by Anonymous Coward
          As far as I know (second hand info), Google Earth moved to QT for version 4, which was done after they were bought by Google. It was probably still *former* Keyhole engineers who made the decision, but they were Google engineers at the time.
      • by sbryant ( 93075 )

        Google Earth is a good example of how not to use QT! I think they went out of their way to make it look nasty. If they had just left things alone (ie: font sizes, widget styles) it would look miles better.

        -- Steve

    • Re: (Score:3, Insightful)

      by Enleth ( 947766 )
      While you are technically right on those issures, I'd dare to say they're, well, non-issues compared to what Qt offers, save for the Mac version ugliness.

      Frankly, I don't see any reasonable, sincere and unbiased way of arguing that a few megabytes more is enough to dismiss a toolkit completely.

      As for the Windows development problem, Visual Studio 2008 which is hailed even on Slashdot as the best (or at least one of the best) Windows IDE out there supports C++ just as well as other languages. So what did you
      • by QuantumG ( 50515 ) *
        Blah, if people won't install your app for any of these reasons then they are important.

        • by Enleth ( 947766 ) <enleth@enleth.com> on Tuesday May 06, 2008 @06:51PM (#23318934) Homepage
          If your app risks being dismissed by the user for such reasons, you have some serious problems than just the toolkit you are using. Like, well, the app being nothing of particular value usefulness compared to the alternatives or something along these lines.
          • If gaining Mac users is your goal, then the toolkit is not a trivial issue. Many Mac users, myself included, are very finicky about apps that do not look or feel like Mac apps.* Using an app that looks significantly out of place in an otherwise consistent UI is very annoying, and the app would need to be significantly better than the alternatives. I fully understand why some developers steer clear of Mac support for that very reason, but it is a reality, and it's not going away.

            * In rough terms, a tradition
            • by GigaplexNZ ( 1233886 ) on Wednesday May 07, 2008 @03:45AM (#23321652)
              You mean like how iTunes and Safari look completely at home on Windows? Apple fans have double standards; they expect uniformity on the Mac and allow Apple software to stick out like a sore thumb on Windows. If an OS X user rejects my applications because the toolkit only looks 95% at home compared to other applications, it is their loss, not mine.
            • by Weedlekin ( 836313 ) on Wednesday May 07, 2008 @03:53AM (#23321682)
              "Many Mac users, myself included, are very finicky about apps that do not look or feel like Mac apps."

              While others are like me, and don't give two hoots if the app does something we want or need. I'm far more worried about the ability to paste information between apps, use of standard centralised resources such as the dictionary / thesaurus, support for drag-and-drop conventions, and Mac-style installation and removal mechanisms than whether it's a little ugly or uses a few non-standard keystrokes.

              "Using an app that looks significantly out of place in an otherwise consistent UI is very annoying"

              Unless of course it's from Apple, who, like MS, seem to be quite happy to break their own look-and-feel guidelines.

              "I fully understand why some developers steer clear of Mac support for that very reason, but it is a reality, and it's not going away"

              It will however become less significant as Apple's market share grows, because there are more and more new users who're running Windows apps on their Macs via dual-boot or virtualisation, and they're a lot less Mac-like than QT-based ports (even Java stuff is more Mac-like than software written specifically for Windows).
        • Re: (Score:3, Insightful)

          by Otter ( 3800 )
          Blah, if people won't install your app for any of these reasons then they are important.

          No Windows user is going to not use your app because C++ is out of fashion on that platform. Only the dumbest Linux users would do something like that.

      • Re: (Score:3, Informative)

        The reason for the size of Qt is that it is analoguous to the all-encompassing class libraries of Java and .NET, but in C++ world. Which is for the better - it is much more productive to have all the common, and even the less-so-common functionality readily available as needed. Add to that the great quality of Trolltech offering, and who cares about a couple extra megabytes?

        Anyway, Qt is pretty much the only reasonable choice for cross-platform C++ development, and a very strong contender even if you're g

    • Re: (Score:3, Insightful)

      by Kjella ( 173770 )

      On Linux the libraries are now so damn big that non-KDE users wont install them.

      I take it you run no Java apps at all then? One of those suck down way more than Qt does. Plus it's modular so you can take your pick, but if you want a core + ui + network + sql + xml + svg + unit test + opengl framework yeah it adds up. I think you get a lot more than GTK does though. And seriously, even with all of them you're talking 10-15MB in a world where 4GB DDR2 costs 60-65$.

      On Windows the best development tools are moving away from C++.

      We'll see, C++ certainly isn't going away fast. The tools are good and there's plenty developers so I wouldn't worry about

      • And seriously, even with all of them you're talking 10-15MB in a world where 4GB DDR2 costs 60-65$.
        Older PCs like mine still make up a large part of the market for a Free app. How much does a new motherboard that has slots for 4 GiB of RAM cost? And a new CPU because they don't make motherboards for a 5 to 7 year old CPU's socket anymore?
        • How much does a new motherboard that has slots for 4 GiB of RAM cost?
          Hmm, $75 - $125? And CPUs are dirt cheap too now.

          But ignoring that, KDE4 will run on a system with 512MB RAM, and my PC 5 years ago had that. 1GB of RAM, even old DDR 1, won't cost much if you need to upgrade.

          If you're on an older machine still, maybe you should change job or something.
      • Wouldn't know, don't have one. Worse than other cross-platform tools as it seems to be Mac users are never happy with anything not native Mac?

        Appearance is important, but more important is behavior. Most if not all cross-platform toolkits get a LOT of basic behaviors completely wrong, including Firefox. (Disclaimer: haven't been a heavy OS X user in about a year.)

        For example, position the text cursor at the bottom of a multi-line text field, then hit the down arrow. What happens on Windows? What happens on
    • by pherthyl ( 445706 ) on Tuesday May 06, 2008 @06:35PM (#23318818)
      >> On Linux the libraries are now so damn big that non-KDE users wont install them.

      That's ridiculous. Only the hardcore GTK purists won't install qt libs. No one else will ever know or care. You can never please those fanatics. If you use GTK you will have the same problem with hardcore Qt purists. You can safely ignore those idiots.

      >> On Windows the best development tools are moving away from C++.

      As others have mentioned, that's not the case at all. Visual Studio has excellent C++ support in its latest versions, and there are lots of decent free alternatives (Eclipse CDT, dedicated stuff like QDevelop).

      >> On Mac it's just plain ugly.

      I can't say much about that since I don't use a mac, but some other people have mentioned that they didn't even notice the difference on some Qt using apps. Once again I doubt it's an issue for anyone except the hardcore purists.

      And what's the alternative? Write a custom UI for each platform? Maybe if you have resources to burn, but these days it's just a huge waste.
      • Re: (Score:2, Interesting)

        by Ant P. ( 974313 )
        I'm not sure what a hardcore GTK purist is... is that someone who refuses to install Gnome because it requires about 50 different toolkits and frameworks? Someone who refuses to use Firefox because it uses XUL?

        Honestly I used to run Gnome a long, long time ago, and avoided installing anything Qt-related because of how big it looked. Then I looked at the hundred or so separate libraries needed to run the bland windows 3.1 clone on my screen and I realised I had it completely backwards.
    • by aproposofwhat ( 1019098 ) on Wednesday May 07, 2008 @02:27AM (#23321288)

      On Windows the best development tools are moving away from C++.

      I think you meant that:

      On Windows the majority of tools who think they are developers are moving away from C++.

    • "On Windows the best development tools are moving away from C++."

      The .NET stuff is largely aimed at corporate developers, who were never big C++ users anyway. Shrink-wrap Windows software (including all Microsoft's shrink-wrap stuff) is however still developed in compiled languages, with C++ being by far the most popular.
  • Excellent (Score:5, Interesting)

    by Kjella ( 173770 ) on Tuesday May 06, 2008 @05:50PM (#23318424) Homepage
    I really look forward to the Phonon functionality. You can now finally write cross-platform players, capturers, encoders, indexers, mixers, filters and whatnot that'll work across all backends, as Qt is writing the backends for Windows (DirectShow) and OS X (Quicktime) as well. Note: I know not all of these features aren't in 4.4 some are pushed back to 4.5. I really hope this manages to unify the Linux multimedia experience. It's these kinds of deep changes I think are necessary for Linux to succeed in the long run, having to deal with xine/gstreamer/vlc/mplayer which all seem to work on different content but none on all is something the user shouldn't have to do. Having them all in one cross-backend API is a very big step forward.
    • Reinventing Wheels (Score:2, Interesting)

      by Anonymous Coward
      Kernel Developer: Here's a nice, easy to use sound backend. Enjoy.

      Userspace Soundserver developer: Hey, since the Kernel guys can't provide autosense and switching and networked audio, let's abstract it.

      Multimedia Framework developer: Hey, because one multimedia backend isn't enough, and isn't portable across OSes, let's abstract it and make it support many different sound servers.

      Phonon developer: Hey, because one abstraction's not enough, let's abstract it again!

      At this point, you have to wond
    • having to deal with xine/gstreamer/vlc/mplayer which all seem to work on different content but none on all is something the user shouldn't have to do.
      I disagree with the idea that throwing another player into the game is going to do anything to help the user.

      • Re:Excellent (Score:4, Insightful)

        by Kjella ( 173770 ) on Tuesday May 06, 2008 @06:49PM (#23318922) Homepage

        I disagree with the idea that throwing another player into the game is going to do anything to help the user.
        Actually, they're throwing one out - the arTs sound server. Phonon is not a multimedia framework, it has no intention of implementing anything. It makes life easier for application developers, which honestly shouldn't care more about which media backend is in use than what scheduling algorithm the kernel uses.
      • Seems like on Unix, Xine has pretty much become the official backend for KDE. It might be via Phonon, maybe not, but I seriously doubt this is "another player" in the sense that you mean.
  • by Anonymous Coward on Tuesday May 06, 2008 @05:59PM (#23318500)
    Vladimir just posted about working more on Qt for Firefox - http://blog.vlad1.com/2008/05/06/well-isnt-that-qt/ - the more devs that can help, the quicker this will happen.
  • ActiveX WebKit (Score:3, Interesting)

    by Xaroth ( 67516 ) on Tuesday May 06, 2008 @06:27PM (#23318754) Homepage
    This is only tangentially related to the Qt 4.4 release, but it seems to me that, when combined with ActiveQT, this theoretically provides the first ActiveX wrapper around WebKit. This sort of thing would enable hobbyist C# or VB users to quickly get web-driven applications up and running.

    As I understand it, at current ActiveQT is only available under the paid licenses, which makes it difficult to create a F/OSS Windows application that uses such a control (which I happen to want to do).

    Are there any ActiveX wrappers to WebKit out there (whether using Qt or not) that are suitable for use in F/OSS projects, or - failing that - any other drop-in ways to get a standards compliant browser pane up and running?
    • Re: (Score:3, Informative)

      by slimjim8094 ( 941042 )
      http://www.iol.ie/~locka/mozilla/mozilla.htm [www.iol.ie]

      Wine uses it. It's as standards-compliant as Gecko, which is probably enough for you (unless it's an evangelical thing)

      In any case, it's better than Internet Explorer's ActiveX (where standards are concerned)

      NOTE: That link's a bit old, but should be more than adequate.
      • Question: Is this actively developed at all? I don't see any updates since 2005 or so.

        And if not, shouldn't it be incorporated into Wine? Or at least available as a package that Wine can optionally depend on?
  • by alberthier ( 998375 ) on Tuesday May 06, 2008 @06:37PM (#23318832)
    The only drawbacks on Qt I see in the comments here is that the lib is too fat or that C++ is dead. But let's concentrate on What Qt provides:

    A API that covers the purpose of glib + gobject + gio + atk + pango + cairo + gtk + gstreamer + gecko + libxml2 + goocanvas + internationalization + portability accross Unices, Mac and Windows This is splitted in several modules Core, Xml, Network, Gui, Phonon, Webkit And the main point is that you have all that in the same API with the same object design. If you never coded in Qt, try it before saying it sucks, you will see how straitforward everything is.

    Signals/Slots in really a fantastic feature and massively used in Qt

    Java / .NET descided like Trolltech that C++ was too complicated. Sun created the java language, MS the C#, Trolltech just decided to limit themselves to a subset of C++ and add some extensions via macros (and a precompiler which generates the boilerplates) but globally the aproach is similar.

    I use Qt every day and I really don't think I could be as productive with WxWidgets or GTK. Maybe GTK / Vala will be the future real competitor to Qt.
    • by tepples ( 727027 )

      The only drawbacks on Qt I see in the comments here is that the lib is too fat or that C++ is dead.
      That or the fact that you can't link Creative Commons CC-BY licensed icons into a GPL program.
    • by master_p ( 608214 ) on Wednesday May 07, 2008 @03:37AM (#23321606)
      The Qt library is the C++ SDK that the C++ language is missing. I would pay to see the C++ Standards Committee adopt it as the standard C++ toolkit. Now if only C++ got real garbage collection and lambda functions (two features that are really necessary for high end development)...
      • Now if only C++ got real garbage collection

        You can have that [hp.com] today already.

        and lambda functions (two features that are really necessary for high end development)...

        It'll be there [open-std.org] in about a year (assuming the GCC folks will roll out an implementation of the new standard right away).

        • Re: (Score:3, Interesting)

          by Ed Avis ( 5917 )
          Unfortunately a bolt-on Boehm garbage collector is not real GC. It has to guess what things are pointers and what aren't, so it can get confused by integers that happen to be a valid address. If you think that's unlikely to happen in practice, consider the scope for denial-of-service attacks by feeding in data designed to trick the GC. When dealing with security, theoretical possibilities become all too practical.

          Real lambda functions (not Boost's weird simulation) will be cool.
        • Boehm's GC does not work well for two reasons:

          1) it does not work well with dlls. I tried it (look here: http://thread.gmane.org/gmane.comp.programming.garbage-collection.boehmgc/2016/focus=2027 [gmane.org]).

          2) it provides a great opportunity for DoS attacks, as another poster says.

      • by Ed Avis ( 5917 ) <ed@membled.com> on Wednesday May 07, 2008 @04:19AM (#23321778) Homepage
        OTOH, I would pay to see Troll Tech adopt the standard C++ library in Qt, rather than reinventing their own strings, vectors, lists and so on.
        • I hear you. I guess when Qt started out, the STL was pretty unstable and unpredictable across platforms, but C++ has moved on since then. C'mon Trolltech, how about it?
        • Re: (Score:3, Insightful)

          by master_p ( 608214 )
          The Qt's container APIs are richer than the STL.
      • ...use Java or some other high level language or even just smart pointers. Thats not what C++ is about. Besides which the language is bloated enough already.
      • Many seem to long for a C++ GC. Personally, I can't see why. With all the containers and allocators provided in various libraries, I don't see a reason for using it. I'd be happy to see an example of when it would be useful, but so far I haven't. (Not trolling, it's a serious opinion, however flawed it may be.)

        The Boost library has lambda functions. I have not used them yet, so I can't say how useful they are.
    • by rumith ( 983060 )

      Trolltech just decided to limit themselves to a subset of C++
      Not really; Qt Jambi [troll.no] brings Qt to Java developers since 4.2 IIRC.
  • Comment removed (Score:5, Informative)

    by account_deleted ( 4530225 ) on Tuesday May 06, 2008 @07:02PM (#23319004)
    Comment removed based on user account deletion
    • So, just a heads up to anybody else who's interested: Don't bother with it unless you have Visual Studio Professional 2005 or later.
      Actually, looking at the requirements for WM6 SDK, it says "Microsoft Visual Studio 2005, Standard Edition or above". Standard costs $199 for an upgrade, but considering that you can "upgrade" from the free Express, there's no excuse not to ;)
  • Qt is a cross-platform programming framework which also includes a GUI toolkit. wxWidgets and Gtk and basically (if not only) GUI toolkits. Gtk (to my knowledge) doesn't do database driver abstraction, network abstraction, sound abstraction, etc, etc.
    • Re: (Score:3, Informative)

      by EvilIdler ( 21087 )
      Gtk+ does GUI and threading, but wxWidgets is a complete application framework with networking, filehandling and a whole lot more abstracted. Plugin libraries exist for both to extend them, and I'm sure there is at least some basic file abstraction in Glib (which is required by Gtk+).

      Licensing aside, I rate Qt and wx about the same in features. They both seem to get the native look on OS X, and wxWidgets takes on the Gtk+ theme on X (which is an engine using the KDE theme).
  • by 12357bd ( 686909 )
    Great, just waiting for KDE 4.x to stabilize usability/features, and we'll have a real killer graphic/desktop programming. Next is having major game makers to use it as his base platform.
  • I did not have the opportunity to work with Qt 4 yet, but I have used Qt 3 extensively. One minor disappointment with Signals and Slots is that they require the use of a special tool (qmake) to produce some C++ code which is then fed to the real compiler.

    My company has purchased Qt 3.0.5 for my department, and that version comes with integration with Visual Studio 6. But VS6 is really an old dog, with many bugs both in the compiler and the IDE, and VS8 is much better. So in order to use Qt 3 with VS8 I had
    • by shutdown -p now ( 807394 ) on Wednesday May 07, 2008 @04:18AM (#23321774) Journal

      So, here is my question: in Qt 4, can we do signals and slots programmatically, or do we still have to use qmake?
      I imagine you mean "moc" ("meta-object compiler") here rather than qmake. You can call moc yourself without any problems, and you can run it from post-build actions for files in your project you need preprocessed. It's all there in UI in VS2008. And, of course, if you buy Qt4, you'll get full integration with all modern VS versions out of the box.

      IIRC, you always could do signals/slots programmatically - after all, moc is not some kind of magic, it just generates all the boilerplate C++ code. It's not exactly convenient, though (not like e.g. boost::signal), precisely because it's not intended to be used manually.

      • Re: (Score:3, Interesting)

        by master_p ( 608214 )
        Yeah, sorry, I meant the MOC.

        I do not want to run the MOC myself, neither would I want to have to setup a build action for each file. I just want to press F5 and see my app compile. Anything else detracts from the development process.

        I can't buy Qt4, my boss will not buy it.

        I did signals/slots programmatically, and it's great. I studied the boilerplate code the MOC creates and simply copied it into templates. Now I don't have to use any special tools.

        Another benefit from this is that I can use any function
  • Because I can never find any (or on GTK+) in my local bookshops.

    And no , I'm not going to learn online and get eyestrain and a stinking headache staring at a monitor or spend a fortune printing out an online manual. Before anyone suggests it.

Top Ten Things Overheard At The ANSI C Draft Committee Meetings: (10) Sorry, but that's too useful.

Working...