mbm
Qt
KDE
Itemviews
Graphics View
Graphics Items
Posted by mbm
 in Qt, KDE, Itemviews, Graphics View, Graphics Items
 on Thursday, December 10, 2009 @ 13:07

Some time ago I wrote about our ideas for a new Qt widget set for QGraphicsView.
Up till now we have all been busy working on finishing Qt 4.6, so not much has happened since then.
But, it is now time to quote Hubert J. Farnsworth: “Good news, everyone!”. The Next Generation Qt Widgets project is of the ground!

Open Is The New Black

With Qt 4.6 released, we can now dedicate our time to Next Generation Qt Widgets. But we are not the only ones that will be working on this project. In addition to Qt developers, we will also have developers from INdT. And you are hereby invited to join as well!

liftoff by popofatticus on flickr
liftoff by popofatticus on flickr

Jump Into The Fray

First, you want to clone the repository. It is also recommended that you browse the Qt wiki to get familiar with coding conventions and the contribution model. You may also want to read up on the rules. You should now be ready to join the discussions on IRC or on our mailing-list.
We are looking forward to seeing you there! Happy hacking! :)

ettrich
Qt
KDE
Posted by ettrich
 in Qt, KDE
 on Thursday, November 12, 2009 @ 17:13

I just wanted to post a quick thank you to everybody who congratulated me on the German Medal of Merit, I truly appreciated it.

To get the facts straight: the Medal of Merit is the lowest class of the Order of Merit of the Federal Republic of Germany, unofficially but commonly described as Federal Cross of Merit. The medal does indeed feature a big cross, so the familiar name fits well. In order to get the next class - the Cross of Merit - you will typically have to be at least 40 years old, so this is a good as it gets and it does feel very satisfying indeed.

Let me explain the satisfying part: In Germany, the medal of merit is a state decoration which you receive for merits for the common welfare. It’s granted and signed by the President of Germany, at present Horst Köhler, In other words, this is yet another sign that we, the free software community, the hackers, the geeks, have arrived at what’s called the middle of society. What a change from the beginnings of KDE!

For those that do not rememember, it has taken a long time for free software to be seen as valuable outside our closed circle of hackers. Initially it was even seen as something bad, as some evil movement to harm companies and to kill jobs. When I started with free software I met either indifference, or more frequently malice and total lack of understanding. How can anybody in their right mind waste valuable time with this? For example, I do remember a situation where a fellow student of mine wanted to help me out when he learned that I spent all nights programming a document processor. His solution, in all honesty and seriousness, was to offer me a pirated copy of a commercial word processor.

And now this. Official recognition by the President of Germany. Should anybody wonder why you spend time with free software, let them know that in Germany this is officially recognized as work for the common welfare - isn’t that plain brilliant?

Obviously it’s not the freedom aspect per se that makes our software relevant for the common welfare. A free ego-shooter, while fun to work on, might for example not fall into this category. What makes all the difference is what we strive to achieve with KDE - and with the free desktop in general: a complete system for normal users, everything you need to participate in our modern communication society.

Society in Germany is starting to recognise this value. So I have been lucky enough to be selected as a representative for you all. All of you that strive to broaden the use of free software for everybody. It was both a day for me to proudly look back on what I have achieved with you, and for all of us as a community to be proud of what we achieve together. Whether you are a direct contributor, a supporter or a user of free software, be it KDE, Gnome or the underlying distributions, this award was just as much for you. I hope you are as proud as I am. You should be.

Thanks again, and keep on hacking.

Thiago Macieira
Qt
KDE
Git
C++
Posted by Thiago Macieira
 in Qt, KDE, Git, C++
 on Thursday, November 12, 2009 @ 13:34

To everyone using Qt 4.6 from the Git repository: be aware that I introduced a binary-incompatible change. This change is there to stay.

No, we’re not breaking binary compatibility with Qt 4.5. This only affects previous Qt 4.6 versions.

Actually, this kind of change happens all the time. So why am I blogging about this specific change?

Well, the problem is that this change affects QHash, QMap and QVector. And those classes are inlined everywhere in Qt-using code. This means that, if you update Qt across that version, you must recompile all of the Qt-using code, from scratch (i.e., make clean). For KDE developers using trunk, that means recompiling all of KDE.

This change will be included in the upcoming Qt 4.6.0 Release Candidate.

Note: the change is in the 4.6 branch but hasn’t reached the 4.6-stable branch yet. That also means it’s not in kde-qt’s 4.6-stable-patched branch yet. When you next update those stable branches, please remember to recompile everything.

PS: the stable branches aren’t updating not because of Qt not building. It is buiding. The reason why is because our Continuous Integration system experiencing some technical difficulties, like Windows running out of memory, the Symbian buildsystem failing for no apparent reason, the powerful 8-core Mac machines being able to run only one testcase at a time, etc.

Jens
Qt
KDE
Posted by Jens
 in Qt, KDE
 on Tuesday, October 27, 2009 @ 10:09

Someone sent me an e-mail asking what happened to the freedesktop icons I blogged about back in february so I realized I should probably write a followup. I’m happy to say that it has been merged into Qt 4.6 for some time already. If you look up the documentation for QIcon, you will find a new function QIcon::fromTheme(…) which essentially does what QtIconLoader::icon(…) did. Meaning Qt applications can now make use of the icon themes that KDE and GNOME ship with and use by default.

Since freedesktop icon themes only come as standard on X11 based desktops, you cannot use themed icons on other platforms such as Windows and Mac directly. This will simply return the fallback icon you provide. Allowing this would have forced us to decide on a standard icon theme as well as bloat the application by an extra few megabytes that many applications do not need. Instead we decided to leave this choice entirely up to the developer by making it possible to bundle themes such as Oxygen or Tango as part of the application resources and pointing to it using QIcon::setThemeName(…) instead.

This should make those pure Qt applications look a lot more integrated into the X11 desktop! Among other things, our trusty old Assistant client was modified to use the theme icons:

assistant

Screenshot showing of Assistant running on GNOME in 4.6.

Assistant KDE

Here is the same application running on KDE 4.

Thiago Macieira
Qt
KDE
Qt Jambi
Contributors
QtCreator
QtMobility
Posted by Thiago Macieira
 in Qt, KDE, Qt Jambi, Contributors, QtCreator, QtMobility
 on Tuesday, October 27, 2009 @ 10:05

For those of you who don’t read the new Qt blog website, where Qt Marketing and Product Management talk about “corporatey” stuff (affectionately called the “PHB blog” by our developers), we’ve just announced that our brand, new bugtracker is public: see http://bugreports.qt.nokia.com.

So, I won’t repeat everything that is in the other blog (it is, after all, written by Marketing, so it should be better written than this thrown-together “reblogging”). I’d just like to highlight one important point that Adam made in his blog:

The Qt Bug Tracker isn´t simply a read-only view into the bug tracking system used by Qt developers, it is the bug tracking tracking system used by Qt developers.

The previous solution was an in-house system we had built over the years. It started as a distribution list for the Qt developers back in the day, then got an automatic tool to reply to the emails received and assign numbers, a robot to collect incoming emails and add to the database. Internally, we’ve had a rich-client to access that database and manipulate our own bugs. But communicating with the reporters was always very difficult.

This new tool is different. Everything is on the web. And you get to vote on issues, even watch if they change.

This is another step in our opening up of our development model. Enjoy!

alexis.menard
KDE
Graphics View
Graphics Items
Graphics
Kinetic
Performance
Posted by alexis.menard
 in KDE, Graphics View, Graphics Items, Graphics, Kinetic, Performance
 on Tuesday, October 27, 2009 @ 08:59

Do you know the main advantage of a Hummer? It can go pretty much everywhere, that’s why many armies are using it. If I talk about a Hummer it is because QGraphicsView can go pretty much everywhere too. Recently I was lucky enough to get a N900 (generously given by Jesper, don’t know for how long though) so I decided to test Qt on it. I mainly work on QGraphicsView here at Qt Development Frameworks so it was a way to test the speed of my toy (:p). Since I’ve also been a KDE user and developer for quite a bit, I thought I could try KDE on it and more precisely Plasma.

So I downloaded the Maemo 5 SDK and started building KDE and Qt with it.

First thing you have to know is that scratchbox is not easy to set-up because you always face problems and compiling inside scratchbox is really slow. The link step is a bit broken and you have to specify manually where are the libs you link with (apparently it’s expected to be like that). It seems odd… Anyways, after a couple of hours I had Qt 4.6 (Fremantle branch) up and running. I was quite happy to see that it performs well (if you are using the right things). Animated tiles are running smoothly and painting demos as well (using opengl es2 graphicssystem).

After this initial success I tried KDE. This was more painful than I originally thought. Broken packages (mysql-server), out-dated packages (shared-mime-info for instance) and the worst : CMake crashed during the configure step. I solved that by downloading the 2.8 RC version that I built myself. But after a couple of hours of fighting and debugging I got this:

Link to youtube video

As you can see Plasma is running fine on this device. Of course a lot of work is needed to make it “finger” enabled (the actual applet handles are not really appropriate) but it’s a good start and Plasma is flexible enough to allow that. I have created a separate “shell” called plasma-mobile (Plasma already has the desktop and netbook shell) and I pushed that on the KDE playground. It also needs a lot of work to integrate well with the device (battery, network, profiles and so on) but the goal is to invite people to contribute to Plasma in order to offer a real alternative to the hildon-desktop. Plasma already has many many features/applets that we can just use on the N900. This also comes with a global effort to bring KDE technologies to the device as Kevin said in his blog. You can also participate in discussions on the KDE mailing-list for Maemo.

So yes Plasma is also a hummer, it runs everywhere but it’s the luxury version.

Alan Alpert
KDE
Declarative UI
Posted by Alan Alpert
 in KDE, Declarative UI
 on Thursday, September 24, 2009 @ 06:24

Something we’ve been trying out recently with Qt Declarative UI is a Plasma integration. A characteristic of plasmoids is that they tend to have their own unique UI design. Integration of Declarative UI with Plasma has the potential to make it much easier to design such plasmoids. There is also the potential to help make plasmoid development easier by providing a declarative language that is designed specifically for fluid user interfaces, and is more accessible to designers without C++ knowledge. And it also has the potential to facilitate the construction of highly animated plasmoids, like the weather example which animates the clouds and rain/snow all separately. As a prototype we are hoping that its use will provide constructive feedback which enables Declarative UI to truly fulfill these potentials.

There is one very tricky aspect to Declarative UI’s Plasma integration. That is that there are large sections of Plasma code which are already written, containing widgets and QGraphicsItems, which might like to add some declarative parts but are certainly not going to re-write themselves. Declarative UI is based on existing Qt technologies, GraphicsView in particular, and can be integrated into existing applications. We just have very little experience with doing that right now and are still investigating how well this works, so feedback on this issue is warmly welcomed. We do intend to get things so that, as much as possible, existing Qt code can easily add Declarative UI bits to its UI when and if they want. You certainly won’t have to rewrite your application to use Declarative UI if you’re happy with your Graphics View solution. In fact, the prototype Plasma integration makes the existing Plasma QGraphicsWidgets directly usable in QML without altering their code at all (we’re still checking how well this works though).

We’re hoping that, at some point in the future, people will have Declarative UI as another one of their options for how to build their plasmoids. An especially compelling one if it’s to be heavily animated or they don’t like coding.

Below is a screen shot showing some of what we have so far. On the left is the weather example, and those are Plasma::PushButtons being used in the middle. On the right is a data source example, printing all the information it can get from the time data source. On the right, below the QML plasmoid, is the file watcher plasmoid showing the full QML source for the data source example just above it.
Declarative UI on Plasma

Andreas
Qt
KDE
Posted by Andreas
 in Qt, KDE
 on Wednesday, September 16, 2009 @ 07:38

Hi, all.

Would it be interesting for us to add some apis, examples and demos that show how to write games in Qt?

No work is happening in this field right now, so this is just an early invite for comments.

For example, we could provide

* Physics engine integration, perhaps in-house, 3rdparty, plugin based?
* Collision detection system (a more comprehensive one than what we have already)

I’m aware of free and commercial APIs that exist already, does anyone have a favorite to recommend?

Any ideas? Anybody interested? Is this worth investigating? ;-)

Thomas Zander
KDE
KOffice
Posted by Thomas Zander
 in KDE, KOffice
 on Friday, August 28, 2009 @ 17:18

Its been some months since we released KOffice2.0.0, the first official release for the new platform KOffice2.
For common and certainly for advanced office users we made clear that 2.0 is missing features for them. What then, you may ask, is 2.1 going to change for them?
Well, here is what we are working on and what has been integrated into what will become the 2.1 release in a month or two.

Tables
Releasing a word processor without tables was pretty daring, and for 2.1 we did a lot of work to correct this. As part of the GSoC project we got Elvis Stansvik working on this for the whole summer. As this is part of KWord, I was the mentor and near the end we also got help from Casper Boemann. The end result is that KWord can show a huge set of tables based documents correctly. Its important to point out that this is ongoing work; creating new table cells or modifying the shape and look of a table is currently not possible.

Change Tracking
While editing a text document you can always undo your changes and get back to the way your document looked before. But what if you want to show the actual changes made right inside the current document? Or even better, being able to see what your colleague changed in the document over the weekend. This is what change tracking offers and this has been integrated just last week and it looks like we’ll have most of the expected features available in 2.1 thanks to the work of Pierre Stirnweiss. The most exciting part is that this lays the foundations for projects like collaborative editing.

Improved image handling
This has been detailed in another post already, so I’ll keep it short. For 2.1 the images handling has been made faster and we now are much smarter with memory usage so its possible to have image-heavy documents showing just fine even on memory constrained systems and devices.

Continued improvement in OpenDocument Format (ODF) support
ODF is still a huge specification and during the 2.1 time-frame there have been various teams working on testing and improving KOffice to become both better at writing correct and full ODF as well as reading other applications ODF documents. As ODF is a way to inter-operate between different application suites so its obvious that the way to get better ODF support is to collaborate on this front with others.
KOffice has been working at the front-lines with the industry big names for some time now. A recent example is the plugfest in The Netherlands last summer and the upcoming plugfest in Italy where KOffice is well represented.
An exciting initiative is the officeshots which renders an ODF document in all available office applications and shows the output. KOffice has been working with the OpenDoc Society to provide hardware and software support and make sure KOffice interoperability can be verified by everyone.

KFormula major improvements.
The formula editing component in KOffice has seen many upgrades since the 2.0 release. This means that all KOffice applications can now display and directly edit formulas. The GSoC project by Jeremias Epperlein has seen improvements specifically in rendering the formulas much more pleasing to the eye and the editing of a formula is well integrated into KOffice and quite easy to use.

Windows
At the tagging of the beta1 all of KOffice compiled without problems on visual studio 2008 which significantly lowers the barrier to developer and end user adoption of KOffice. We are still looking for enthusiastic packagers and naturally developers on this platform to help improve the experience for end users.

MSOffice support
Still quite important for many is the ability to open MSOffice documents correctly and the major painpoints are one by one being addressed. Major things like importing text correctly, importing tables and importing images in presentations have been added for 2.1.

Harald Fernengel
Qt
KDE
 in Qt, KDE
 on Friday, August 21, 2009 @ 16:51

Qt usually takes the boring memory allocation and deallocation from you, either through its implicitly shared containers, or with QObject’s parent child relationship model. But every once in a while, we need to allocate something on the heap, and then the stress starts - where do we delete it, and how do we make sure to not leak the memory?

To fix this problem, QScopedPointer was born. It will delete the object it is pointing to automatically when it goes out of scope:

void foo()
{
    QScopedPointer<int> i(new int(42));
    …
    if (someCondition)
        return; // our integer on the heap will either be deleted here…
    …
} // … or here

A new exit condition in our function will not make it leak the integer that we allocated.

So how do we access the object that we are pointing to? QScopedPointer implements operator* and operator->, so you it can be accessed just like any other pointer:

    QScopedPointer<int> i(new int(42));
    *i = 43;

Some operators are missing by design, for example the assignment operator:

    QScopedPointer<int> i(new int(42));
    i = new int(43); // will not compile
    i.reset(new int(43)); // correct

We figured that “reset” looks scary enough to make the reader realize that the old object is deleted, and the QScopedPointer is now pointing to the new object.

Another operator that is missing by design is the operator T*() that would allow accessing the pointer directly. This prevents accidents like:

int *foo()
{
    QScopedPointer<int> i(new int(42));
    …
    return i; // thankfully, this does not compile.
}

Do you see the mistake? The moment we return, our object will be deleted, because the scoped pointer goes out of scope. We would return a dangling pointer, potentially leading to a nasty crash. However, we can tell QScopedPointer that its job is done and that we take ownership of the heap object by calling take(). Our function might look like this:

int *foo()
{
    QScopedPointer<int> i(new int(42));
    …
    if (someError)
        return 0; // our integer is deleted here
    return i.take(); // from now on, our heap object is on its own.
}

But what about memory allocated with malloc, or the operator new[] for arrays? For those cases, we introduced a second template parameter to QScopedPointer that defines the cleanup:

QScopedPointer<int, QScopedPointerPodDeleter> pod(static_cast<int *>(malloc(sizeof int)));

QScopedPointerPodDeleter (pod stands for “plain old data”) will call free on the object if our QScopedPointer goes out of scope.

For convenience, there is a QScopedArrayPointer that defaults to deleting the object it is pointing to with the delete[] operator. It also features operator[] for convenience, so we can write:

void foo()
{
    QScopedArrayPointer<int> i(new int[10]);
    i[2] = 42;
    …
    return; // our integer array is now deleted using delete[]
}

Note that if you have a reference counted object, you can use QExplicitlySharedDataPointer to ensure that an object is deleted correctly when its reference count goes to 0.

QScopedPointer and QExplicitlySharedDataPointer are already used all over the place in the Qt for S60 branch and will soon hit Qt’s master branch. And the best part is that with the introduction of these smart pointers, we could remove lots of boring code and make Qt more readable without adding overhead - since all functions are inlined, the resulting binary using QScopedPointer is identical to the manual new/delete approach.

Happy developing :)



© 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.