Labs

QGraphicsView: Widgets on the Canvas

Published Friday March 9th, 2007 | 10 Comments on QGraphicsView: Widgets on the Canvas
Posted in Graphics Items, Graphics View, Labs, Qt

Items or widgets? QGraphicsItem or QWidget? Which should I choose? Can you do everything with both? Mostly. You can write a games board widget, or a games board scene. An audio spectrum widget, or an audio spectrum item. Is QWidget faster? It can be, especially for simple widgets, and if you do everything right and […]

Read More

LALR(1) and Trolltech’s Creative Fridays

Published Friday March 9th, 2007 | 1 Comment on LALR(1) and Trolltech’s Creative Fridays
Posted in Compilers, Labs, News, QLALR, Qt

If you followed labs.trolltech.com, you’ve seen a new addition: QLALR. It’s a LALR(1) parser generator, created by Roberto Raggi of Qt Designer and KDevelop fame. Originally developed as Creative Friday project, it quickly got used in various projects within Trolltech. One example is the new script engine – no surprise, Roberto also had his fingers […]

Read More

Making asynchronous function calls with QFuture

Published Thursday March 8th, 2007 | 1 Comment on Making asynchronous function calls with QFuture
Posted in Labs, Qt Concurrent, Threads

QtConcurrent::run() runs a function in a worker thread. It returns a QFuture, which is then used to synchronize with the result: QString foo(); QFuture<QString> f = QtConcurrent::run(foo); … QString string = f.result() Calling f.result() will block the current thread until foo() has returned. The QFuture template argument must match the return type of foo(). If […]

Read More

Subversion in the Trolltech Labs

Published Wednesday March 7th, 2007 | 6 Comments on Subversion in the Trolltech Labs
Posted in Labs

I’ve seen already three different developers asking on IRC: “Why do you use Subversion in the Trolltech labs to publish your source code, instead of $FAVOURITE_REV_CTRL_SYSTEM?”. To make everyone’s life easier I thought I’d just answer the question here :) The two main arguments are simple: It’s portable. It runs well on Linux, OS X, […]

Read More

Perspective transformations on a QGraphicsView

Published Thursday March 1st, 2007 | 7 Comments on Perspective transformations on a QGraphicsView
Posted in Graphics Items, Graphics View, Labs, Qt

I don’t have much to say this time, just wanted to share a screenshot after I changed the 40000 Chips demo a bit. I replaced the single horizontal rotation-slider with three ones, each controlling one axis or rotation for the view. QTransform is really easy to use, and with some twiddling (thumb up, pointing finger […]

Read More

Graphics View improvements

Published Tuesday February 27th, 2007 | 21 Comments on Graphics View improvements
Posted in Graphics Items, Graphics View, Labs, Qt

We’re in the process of closing up the features for 4.3, and I’ve had a little run-down of what’s changed in Graphics View. In general, you will notice that the graphics run faster, (especially for complex polygons,) collisions are absolutely precise, the rubberband looks 100x better… I think most of our Graphics View followers will […]

Read More

Introducing Qt Concurrent

Published Friday February 23rd, 2007 | 9 Comments on Introducing Qt Concurrent
Posted in Labs, Qt Concurrent, Threads

As a part of Trolltech Labs, I’m adding the Qt Concurrent project. Qt Concurrent is a high-level threading framework for writing code that automatically scales on multi-core systems. For example, to make thumbnails of a list of images you can do this: QImage scaled(const QImage &image) { return image.scaled(QSize(100, 100)); } … const QList<QImage> images […]

Read More

Untransformable QGraphicsItem tags / labels

Published Sunday January 21st, 2007 | 2 Comments on Untransformable QGraphicsItem tags / labels
Posted in Graphics Items, Graphics View, Labs

Last summer, while we were finishing up 4.2, there was a great deal of activity on the mailing lists we set up for the 4.2 technical preview (http://lists.trolltech.com/). Some people kept on asking for support for “untransformable” items, that is, special QGraphicsItem items that don’t follow the parent’s or view’s transformations. Like the text labels […]

Read More
Get started today with Qt Download now