lorn
Qt
Qtopia
KDE
Posted by lorn
 in Qt, Qtopia, KDE
 on Sunday, September 28, 2008 @ 20:06

Well, now. The news is out, I can finally talk openly about this. Qtopia has been renamed Qt Extended!

There are new logos in the gui formerly known as Qtopia. Qtopia.net will be rebranded in the very near future, once the dust settles from the main web sites redesign.

Qt Software and Nokia are still committed to releasing Qt and Qt Extended under the GPL as open source, and will continue to do so. There will be an Openmoko Neo1973 and Freerunner SDK, as well as some really great devices in the future.

This all means that Qtopia^WQt Extended will use Qt! oh wait, it already does!

As a personal side note. I have now been working for Trolltech and been living in Australia for 5 years. There has been many changes in the organization and in Qt and Qtopia. Changes in my job from Qtopia Community Liasion to Software Engineer. There have also been great changes in my life as well. My 3 year old son has an Australian accent, but uses US English words such as ‘wrench’ not spanner (HA! much to the chagrin of his granddad) and to the dismay of his mother, ‘mom’.

Changes are a part of life and what make it exciting. The Open Source community has nothing to fear by this name change, or by Nokia buying Trolltech.

What is means is this: Qt Everywhere! Long live Qt! (Still pronounced as ‘kute’)

Thiago Macieira
Qt
KDE
Posted by Thiago Macieira
 in Qt, KDE
 on Sunday, September 28, 2008 @ 16:23

Less than two weeks after the last release, we publish a new release of Qt: 4.4.3 is out. The reason for this, I mentioned then: Qt is now copyright Nokia Corporation. So we make a new release with the new copyright.

But… we wouldn’t waste your time with just legalese, would we?

No, we take this opportunity to launch our cool new website with our new brand:

Qt new logo

(which are are © 2008 Nokia Corporation and/or its subsidiaries. Nokia, Qt and their respective logos are trademarks of Nokia Corporation in Finland and/or other countries worldwide.)

The 4.4.3 version of Qt comes with the new logos.

We also got a pinball machine installed. Well, kinda. You be the judge:

Pinball

In other news, Qt has now switched to Git. Here are some pictures to prove:

Lars and Simon   Sysadmins
Lars and Simon asking sysadmins to turn Perforce support off   System administrators making Qt in Perforce read-only

Perforce has served us extremely well for 10 years. And it’s still better than many other solutions out there (including Subversion). But as we grow, we need to improve our tools. And like I explained before, we feel Git matches our model better.

sroedal
KDE
Graphics Dojo
Posted by sroedal
 in KDE, Graphics Dojo
 on Tuesday, September 23, 2008 @ 18:41

When running an X11 compositing manager it’s possible to have translucent widgets by using 32 bit visuals, also known as ARGB visuals. We don’t use these visuals by default in Qt because we’ve seen some driver issues which cause buggy rendering and widgets containing garbage pixels when first being shown, as well as generic slow-downs in some cases. However, we’re now adding conditional ARGB visuals to top-level widgets that are non-opaque, i.e. either have the Qt::WA_NoSystemBackground attribute set or have a transparent or semi-transparent background color specified in the palette. This means that the ARGB visuals will be opt-in instead of being forced onto every Qt application.

What this all means that in 4.5 you’ll be able to have nice translucent Qt widgets on your Linux desktop without any hassle, as long as you have a compositing manager running (which should be easy to enable on newer distributions). Of course, this wouldn’t be a proper graphics dojo post without a nice and shiny example, so I’ve cooked up an example which puts some nice chrome buttons inside a graphics view, and does a fancy animation when you click on the buttons. Here’s a screenshot:

Translucent widget example

Translucent widget video capture

To play with the source and try the example out for yourself, do “svn checkout svn://labs.trolltech.com/svn/graphics/dojo/glossygradients”. You’ll have to wait for the snapshots to be back online to get the translucency effect though :)

Thiago Macieira
Qt
Posted by Thiago Macieira
 in Qt
 on Monday, September 22, 2008 @ 22:32

Today was the Autumn Equinox in the Northern Hemisphere (and Spring in the South). That means Summer is over and Autumn has started.

That means for us here in Oslo that we need to start to wear three layers of clothing when we go outside instead of just two (sweater over T-shirt), we can see the moist from our nose breathing, temperatures in the single-digit degrees (Celsius), etc. Pretty soon now we’ll set our clocks back one hour and the snow will come.

Interestingly, we’re also nearing feature freeze. The feature set for Qt 4.5 is coming together and the last features are being integrated this week. That’s why you won’t see Qt snapshots for the next week: we are adding code, cleaning up, and generally breaking Qt.

Also, like I said last week, we’re preparing Qt for the transition to Nokia. That means we have to change all of the copyright headers in Qt, reset the license texts, change the documentation, etc.

For those reasons, we prefer to finish our work before we publish it. We’ll bring snapshots back soon next week.

In the meantime, please enjoy the blogs about features being integrated.

gunnar
Qt
Painting
Graphics Dojo
Posted by gunnar
 in Qt, Painting, Graphics Dojo
 on Monday, September 22, 2008 @ 13:07

Sorry guys…

I know you have spent a lot of money on buying faster machines to get Qt to run fast enough for the software you are creating, but I’m now sad to inform you that Qt won’t make full use of these machines. In fact it will use your CPU a little bit less.

Jokes aside… We’ve been running a few optimizations internally, under the code name “Qt Falcon” (its going to make Qt fly!), and I wanted to share some of the current results. These things are not yet integrated into Qt Main, but they should be in place by the time Qt 4.5 goes Tech Preview.

Personally I sit on Windows for most of my daily work, so the benchmarks are from a Windows XP machine, and during the falcon initiative we did take the time to iron out a few things that has bothered us with the windows code paths along the way. Windows uses a software rendering engine, internally referred to as the “Raster Engine”. This is also the engine used for embedded and QImage drawing on X11 and Mac.

Lets start at the beginning, QPainter::begin(), a function that is called at the start of every single paint event in the history of Qt. When we originally designed the paint engines, we aimed at them being shared amongst different instances of the same subclass. e.g. all QWidget painting was done using a single paint engine. For this reason, we put most of the initialization logic into QPaintEngine::begin(), because the actual device changed all the time. With the introduction of the backingstore in 4.2 all widgets are actually being drawn to the same device so this begin() initialization started to make less sense, but the design stayed. With 4.5, we make raster engines be one per image and one per backingstore. The initialization is done outside of begin(), in the constructor if you can believe that.

On Windows, we also checked, in QRasterPaintEngine::begin(), if the system had switched its cleartype settings since the last time. This check was actually costing ~25% of the call to QPainter::begin() (ouch!). By listening for the system event when the users changes the settings instead of polling the value in the registry, we could kill those 25% and also support the feature that Qt switches cleartype when the user press “Apply” in the control panel, which we previously didn’t do.

A comparison of a plain QPainter::begin() / end() looks like this:

begin_end.png

The graph shows, in microseconds, the time to create a QPainter on a device and call end on it

We had a fair idea that save / restore was very costly when clipping was enabled in the 4.4. Part of the reason for this is that the communication between QPainter / QPaintEngine was done via a flat state update. A restore was performed by replaying the previous stack element, so if you consider the case of

p.setClipRect(rect1, Qt::ReplaceClip);
p.scale(2, 2);
p.setClipRect(rect2, Qt::IntersectClip);
p.rotate(10);
p.setClipRect(rect3, Qt::IntersectClip);
p.save();
p.drawStuff();
p.restore();

In the last line, restore(), QPainter would replay three clip operations to the underlying engine. Horrible you may think, and it is a piece of code that has been troubling me since I wrote it in the early 4.0 days. With Falcon, the engines can be made aware of QPainters stack, making it possible to cache the results on each level. That means that restore() becomes just a stack pop(). The results look like this:

save_restore.png

The graph shows, in microseconds, the time it takes to run save, followed by a state change, followed by restore

Another Windows thing that had bugged me for a while is the text drawing. Two separate things came together in QRasterPaintEngine::drawTextItem() as a bit of a mess. Again, I’m much to blame and the code has been troubling me for some time, but I didn’t have time to get back and fix these things. Until now, anyway… Point one, was that the only way to draw nice fonts on windows is using GDI, it does (in my opinion, I know people disagree ;) ) the nicest font rendering of all the systems, so using FreeType or another method would not be acceptable visually, as Qt would look worse than other apps on the platform. So we had to mix GDI and our own raster engine together to do clipping, textured / gradient text. The other point is that any pixel touched by GDI will have 0 as its alpha channel. The raster engine relies on premultiplied alpha so this basically destroys all rendering done afterwards. *sigh*

The solution to the two was to use GDI to render into a buffer and sample the values back into the raster engines buffer and at the same time patching the alpha channel. For cleartype this was even worse as the separate buffer first needed to be filled with the background (cleartype pixels depend on the background as well as the foreground). It ran “ok”, but it we were quite aware of that it could be done better. With Falcon, we introduce a mask-texture for each font engine, which generates the glyphs once using GDI. The approach supports both normal and cleartype text drawing and the cleartype approach even does the full RGB blend with Gamma correction (thanks to Samuel who spent an entire day with me to get the gamma correction of three-component alphablending proper). The speedups are quite noticeable. The results are measured in milliseconds:

text_windows.png

The graph shows, in milliseconds, the time it takes to draw the text “abcdefg” on a QPixmap using the default font with either cleartype or non-cleartype

We also removed some of the overhead of drawPixmap() on the raster engine. The problem was that there was a bit of set-up before we could get into the actual pixel-by-pixel blending. Instead of going through the generic rendering pipeline, we introduced a faster path for unclipped pixmaps (or pixmaps that fit inside a rectangular clip). I won’t bore you with the details, as this blog is already twice as long as I intended it to be. The results for 4.4 and Falcon fall together and become identically, speed wise, at around 200×200, but for the icon-size pixmap drawing, there is quite a visible difference.

draw_pixmap.png

The graph shows, in microseconds, how long time it takes to draw a QPixmap, solid or semi-transparent, at the specified sizes

What I’ve mentioned above, are a bunch of separate small things, and you may be thinking that how does this affect me in the real-world. You probably don’t do for-loops of begin/end() or save/restore. So I’ll finish up with some real-world examples. The numbers below are taken from a benchmark of a few widgets where we simply run “repaint()” a bunch of times. The QLabel numbers don’t have much relation to QComboBox etc, so don’t pay too much attention to that, but rather how each widget changes from 4.4 to Falcon.

overall.png

The graph shows, in milliseconds, how long repaint of a few widgets take

Now, much of the overall speedup here, probably over 50% of it is caused by some awesome work that Bjørn Erik has done in the backingstore. The rest is due to small things here and there, like the ones mentioned above.

There has been quite a bit of refactoring in the works here, and some work is still ahead of us, (like re-enabling GDI based glyph-generation of transformed text, which will be vector path based in the upcoming TP) but I hope that the changes we’ve made will benefit most users and that those that see problems with the new approaches let us know so we can look at those too.

Cheers!

trenton
Qt
News
Posted by trenton
 in Qt, News
 on Monday, September 22, 2008 @ 08:25

Hey!

We here at Qt Software are busy working on all sorts of stuff. Things are moving forward though. For example, I took the plunge and integrated the Cocoa port into the “main” branch over the weekend. It’s a massive undertaking to do a submit that touches many files and get everything working. In the end, it was only something in the UNIX print dialog that didn’t take (probably because of a bad merge from a while back).

Anyway, it’s in main now and should be part of the snapshots. Run configure -help to find out how to turn it on since its not the default.

Otherwise, I’m working on my presentations for DevDays. If you are looking for a chance to corner me and talk about the Cocoa port, you’d be hard pressed to find a better opportunity than at DevDays.

Back to the grind! :-)

Thiago Macieira
Qt
KDE
Posted by Thiago Macieira
 in Qt, KDE
 on Thursday, September 18, 2008 @ 18:06

I said it before, and before. I hope you know the chant by now: Qt 4.4.2 is now released.

It’s almost weird to release 4.4.2, for two reasons: first, we’re so deep into Qt 4.5 work that it seems like the past when we go to 4.4 again. And second, because this release went smoothly, unlike 4.4.0 (really, really big release) and 4.4.1 (Summer got in the way).

I have to tell you, though: this is the last Qt release that Trolltech ASA will do…

Read the rest of this entry »

englich
Qt
Aggregated
Posted by englich
 in Qt, Aggregated
 on Wednesday, September 10, 2008 @ 14:35

A couple of weeks ago, I merged the development branch for XSL-T into our main line, heading for Qt 4.5. The idea is that Qt will carry an XSL-T 2.0 implementation with as usual being cross-platform, having solid documentation, and easy of use.

Using it is should straightforward. Either on the command line:

xmlpatterns yourStylesheet.xsl yourInputDocument -param myParam=myValue

Or using the C++ API[1]:

QXmlQuery myQuery(QXmlQuery::XSLT20);
myQuery.bindVariable("myParam", QVariant("myValue");
myQuery.setQuery("http://example.com/myStylesheet.xsl");
QFile out("outFile.xml");
out.open(QIODevice::WriteOnly);

myQuery.evaluateTo(&out);

See the documentation for the QXmlQuery class on the overloads available for setQuery() and evaluateTo(), for instance.

However, due to the beast XSL-T 2.0 is — I agree that it’s larger than XQuery — we’ve decided to do this according to the “release early release often” approach. The first, in Qt 4.5, will carry a subset, and subsequently be complemented in Qt 4.6. The current status is documented in the main page for the QtXmlPatterns module, which can be viewed in the documentation snapshot.

Therefore, while the current implementation probably falls short on more complex applications(such as Docbook XSL), it can run simpler things, users can plan ahead, and we trolls can receive feedback on what features/APIs that are missing, and what needs focus. So feel free to do that: send a mail to qt-bugs@trolltech.com, or say hello on IRC(FransE, on Free Node).

The code is accessible through the Qt snapshots.

What is XSL-T anyway?

XSL-T is a programming language for transforming XML into XML, HTML or text. Some implementations,  such as QtXmlPatterns or Saxon, provides mechanisms to map XML to other data sources and hence widens the scope of the language by letting the XML act as an abstract interface. Wikipedia has a good article on XSL-T. Version 2.0 of XSL-T extends the language heavily by putting a rigid type system and data model in the backbone, and adds many features that was a pain to miss when programming in XSL-T 1.0. XSL-T 2.0 use XPath 2.0, and shares the same large function library as XQuery.

1.

Over time, Java bindings through QtJambi and ECMAScript bindings through QtScript, will likely arrive.

Kent
Uncategorized
Posted by Kent
 in Uncategorized
 on Monday, September 08, 2008 @ 13:36

This is the story of two engineers who went on a cabin trip to Sweden and decided to rent a boat.

The decision was not an easy one to make. The sea was angry that day. Well, maybe not “angry” in the “angry” sense of the word; but nobody could argue the fact that it had been raining not half an hour ago, and that the water was not still. (I believe the Norwegian name for that wind category is “flau bris”, which literally translates to “embarrassing wind” — hey, it wasn’t me.)

Anyhoo, the two engineers had their minds set on renting a boat, even though there were other engineers in their midst who had doubts. The two weren’t reckless, though; they wouldn’t settle for just any old boat. What type of boat should they go for? A motor boat? A sail boat? A canoe? A kayak? A row-boat? All respectable options, for sure, they agreed; but when they saw the picture of the Pedal Boat in the brochure, there was no point in discussing the matter further.

So they put on their finest rain coats, marched down to the boat rental agency and promptly acquired the key to Pedal Boat Number 2 (the girl behind the counter managed to fend off most of the tears of laughter until she had seen the two engineers off). If you could have seen their faces, you would see bliss; in their minds, they were already pedaling.

Down at the beach they found the pedal boat tightly secured with chains. The boat looked sturdy enough, solid yellow and white plastic all around. However, the two engineers soon made a horrible discovery; someone (an evil, evil person, most certainly not an Engineer) had previously broken off a key in the padlock. There was no way they could free this prisoner. And that was their boat, they reasoned, as both the boat and their key had the number 2 on them. Damn. The image of a childhood dream fulfilled had brutally turned into a gasping Lophius piscatorius on someone’s dinner plate. Were they really forced to settle for a lesser type of boat?

No, the two engineers reasoned further. Since theirs was Boat 2, surely there had to be a Boat 1 — but where? They considered that perhaps an equally crafty pair of engineers had already rented it that morning; that certainly seemed plausible. But then, almost by a fluke, they saw Her.

She had been dragged some 30 meters up and off the beach, digging into the hillside. Actually, depending on one’s perspective, one could argue that she lay closer to the forest than to the shore. Nevertheless, from a distance she looked exactly like Boat 2. As the two engineers drew closer, they noticed that her red front bumpers were looking a bit smashed; but they agreed that this only added to her character. As they marvelled at her beauty, one of the engineers found a small, black plug that looked like… it should be plugged somewhere. “Probably a spare part”, the other engineer concluded, “for our safety. Fault tolerance in practice!” She wasn’t locked down, and had no signs (e.g. “Thar she sinks!”) attached, so they did the only sensible thing they could think of; they dragged her down to shore and mounted her.

And things were looking good at first. The pedals worked, the steering worked (although they soon found she didn’t want to go straight for periods longer than 1 second; “Details!”). At last, they were living their big sea adventure. They waved goodbye to a group of engineers who had gathered at the pier to admire the act.


So long, suckers!
“So long, suckers!”

When they had pedaled some fractions of a nautical mile away from shore, one engineer noticed that water was beginning to gather at his feet. Or had the water been there from the beginning, and only now had he noticed it? “Yeah, probably just your seamagination”, the other engineer chuckled, and they raced on.


The right engineer now knows what the left engineer is doing!
The right engineer now knows what the left engineer is doing!

A couple of minutes later she was noticably leaning to one side. This development prompted the affected engineer to take off his shoes and socks, and soon he was treading the water. “Refreshing!”, he exclaimed (the temperature was maybe 12 degrees Celsius, and they were far from shore). Now they were getting into rougher waters; the wind started messing up their hairdos, the waves were pounding on the front deck, and the boat seemed to be going lower and lower into the water (again, was it fact or just another one of Neptune’s mind tricks?). A few more minutes passed before the two engineers reluctantly decided to turn back; but it wasn’t too big of a disappointment, as they had only rented the boat for one hour anyway. (Dragging her down to sea had taken 10 minutes.)


“We are sinking, we are sinking!” “What are we zinking about?”
“We are sinking, we are sinking!” “What are we zinking about?” Nah, the thought never even crossed their minds.

They made it back to shore safe and sound and dragged her out of the sea. What a heavy beast she was! They struggled, and managed to turn her round, and the water started pouring out. And pouring. And pouring. “Probably normal”, remarked the one engineer, “they take up some water to improve stability”. But as they were standing there waiting for her to finish dehydrating, the other engineer (this was the ingenious one — the one who had to take his footwear off) made a peculiar observation: Boat 2 (the one the padlock had taken prisoner) had plugs in the two holes where the water was pouring out of Boat 1. Plugs identical to the one they had found lying on the deck of Boat 1.

“Dude”, said the engineer to the other, “I think someone pulled the plug on us.” “Yeah”, replied the other, “and we didn’t even sea it comin’!” The first engineer then made a witty remark about pluggable architectures, and just like that, their sea adventure had come to an end.

Sounds like it was a great ride though!

Jens
Uncategorized
Qt
Styles
QGtkStyle
Posted by Jens
 in Uncategorized, Qt, Styles, QGtkStyle
 on Friday, September 05, 2008 @ 14:14

QGtkStyle made it’s way into the Qt snapshots this week, meaning it will become part of the Qt 4.5 release. Technical users can already compile and use it on their own desktop, but once Qt 4.5 is out it will simply replace Cleanlooks as the default application style Qt uses on GNOME desktops. While I haven’t blogged about it since the announcement back in May, a lot of fixes and improvements have gone into it since then and I’d like to thank everybody contributing bug reports, suggestions and patches to the project so far. Since the existing plugin based on Qt 4.4 seems rather popular and not everybody feel comfortable using an unstable version of Qt, I will continue to maintain it as a separate project and accept bug reports over at my google code page.

Clearlooks dialogglider theme

In other news, the nice folks over at the Qt4 Maemo garage have been adapting QGtkStyle to work nicely with the Maemo platform as was evidenced by lorn’s post last month. Samuel also blogged about using Freetype for subpixel filtering which should eventually take care of any differences in font rendering between Qt and GTK.



© 2008 Nokia Corporation and/or its subsidiaries. Nokia, Qt and their respective logos are trademarks of Nokia Corporation in Finland and/or other countries worldwide.
All other trademarks are property of their respective owners.