Eike Ziller
News
QtCreator
Posted by Eike Ziller
 in News, QtCreator
 on Friday, October 31, 2008 @ 15:23

When I started at Trolltech about two years ago, I never imaged that I would end up writing a C++ IDE. I mean, I knew that I would develop Qt tools, since that is one of the two main development areas done in Berlin (the other one is Qt/WinCE), but that meant things like Designer, Assistant, Linguist or the VS/Eclipse integrations at the time.

On the other hand, an IDE could well be called the top of all development tools, so all in all it’s a logic consequence :)

Enough of philosophy. “Grau ist alle theorie”, so let’s have some facts (also see the Qt Creator landing page):

It’s cross-platform. Hell, if it wasn’t, we couldn’t use it ourselves!

Slim and fast. One of the questions leading to QtCreator was “What does a text editor need to become an IDE?” Well, you don’t want your text editor to take a minute to come up :) .

Doesn’t invent yet another build system. Instead it’s directly working on pro-files. It’s open for extension with other build systems as well.

Talking about editors, QtCreator has a very powerful C++ editor:
Incremental search highlighting all occurrences.

Incremental Search

Code completion and of course Syntax highlighting, Auto-indentation, (Un-)Commenting code, Code folding, Bookmarks, …

Completion

Inline error markers while you type warning you of many common mistakes that otherwise lead to compile errors. (Ever thought “ow, man, another edit-compile cycle just because I forgot that !*&#%$ semicolon”?)

Inline Warning

Inline Error

Quick Navigation between your files, switch between header and source file, jump to symbol definitions under your cursor, jump to named symbols from your project and all referenced projects.

QuickOpen File

QuickOpen Symbol

Debugger frontend that let’s you easily set breakpoints, step through your code, and examine variables, showing you common Qt types in a friendly way (QLists, QVariants, QFiles, QMaps, …). Currently supporting gdb.

Debugger

Context help for the symbol under the cursor, right beside your code, integrating Assistant/QtHelpSystem in the most comfortable way.

Integrated Help

And lots of other things I forgot to mention here!

These are the people who created QtCreator
Check it out on the Qt Creator landing page,
and have a look at our introduction videos:

Qt Creator - 01 An Introduction

Qt Creator - 02 My first creation

Qt Creator - 03 Smart Code Completion

lorn
Uncategorized
Qt
Qtopia
Qt Extended
Posted by lorn
 in Uncategorized, Qt, Qtopia, Qt Extended
 on Thursday, October 30, 2008 @ 06:30

Along with the new name - Qt Extended, we have a completely, well almost completely, new build system. We have gotten rid of qtopiamake, and came up with qbuild!
Qbuild, according to the 4.4.1 release documentation is “The QBuild tool replaces qmake, allowing more efficient processing of the build instructions contained in .pro files and better management of dependencies.”
http://doc.trolltech.com/qtextended4.4/release-4-4-1.html

For 3rd party developers, this means you will have to “port” your projects .pro files to qbuild. Qbuild looks for qbuild.pro files, so a simple rename will get you started. In real world experience, this also means you need to edit the .pro file a bit for qbuild.

If you have written any project for Qtopia 4, you might be familiar with this statement:
qtopia_project(qtopia app) With qbuild, this is no longer needed, so if you have this in your .pro file, delete it.

This CONFIG+=qtopia_main becomes this CONFIG+=qtopia. For qbuild, you will also need to specify a TEMPLATE like this TEMPLATE=app TEMPLATE can be one of app, lib, plugin, or subdirs.

If you have any depends(libraries/foobar), you need to adjust it like this: MODULES+=foobar

Plugins need to add some more stuff
PLUGIN_FOR=qtopia
PLUGIN_TYPE=mediaengines

There is more information on qbuild Here and more on porting project files to qbuild Here

Qbuild also replaces make. So, to build your project, instead of make, you now need to type qbuild (assuming qbuild is in your PATH). If you have the correct INSTALLS in your project file, you can build packages by doing qbuild packages FORMAT=deb will create a nice debian style package for you. It will also build ipk and naturally, qpk’s.

Good luck!

mbm
Labs
Itemviews
Graphics View
Posted by mbm
 in Labs, Itemviews, Graphics View
 on Friday, October 24, 2008 @ 14:20

I figured it was time I blogged about my Creative Friday project, so here goes!

“Lieutenant. Do you intend to blast a hole in the viewer?”
- Picard to Worf in “Encounter At Farpoint”

As you may be aware of, the Qt Item Views is a set of widgets and classes that allow you to display, navigate and edit data, separating the data from the presentation (model/view).
I’ve had many discussions with customers and colleagues (and random people who just seemed to have opinions on the subject) about the item views over the years. You could say it is a hot subject.

Not surprising. If you are using Qt, chances are you are using the item views. And if you are using the item views, you are likely to have an opinion about them.
While using these classes you may have even form the opinion that they are not exactly the most shining example of Qt quality framework and API design. Let’s just say that there is room for improvement, lots of room!

Troi: “What happened to all the people?”
Worf: “War?”
Data: “Disease?”
Geordi: “A dissatisfied customer?”
- Troi, Worf, Data and Geordi “The Arsenal Of Freedom”

The symptoms are clear: the framework is generally too slow, unstable and the API is difficult to use. A clear case of overly complex design. But where does all this complexity stem from ?

“It’s elementary, my dear Riker. Sir.”
- Data in “Lonely Among Us”

The cause is the feature that has been both a blessing and a curse for item views.
The framework has been designed to trees, tables and lists interchangeably. You can use a list view to show a tree, a tree view to show a table and so on. A pretty cool and sometimes very useful feature.
But it also means that all parts of the framework has to work with a structure that can represent a tree, a table or a list. So, otherwise simple cases become complex because of the inherent complexity of this structure.

“Data, you all right ?”
“Yes sir, I’m fine.” [Contraction!]
“Then get rid of that damn twitch and put on the correct uniform.”
“Yes, Captain.”
- Picard and Data in “Datalore”

The cure is pretty obvious: separate the list, table and tree from each other.
This is the basis for my itemviews-ng research project. It is a complete re-design of all the components in the item views framework, with one overriding principle in mind:
Keep It Simple, Stupid!

“This is called a banana split. It’s quite possibly one of the greatest things in the universe.”
- Wesley in “Suddenly Human”

But there are more reasons to have another go at implementing item views.
Item views can’t get away with just displaying items anymore. They need to be animated, allow flick-scrolling and generally be loaded with snazzy graphical effects. Items fly in from all sides, zoom, rotate, blend or do other fancy stuff. The current item views are simply outdated.

“Can you recommend a way to counter the effect?”
“Simple. Change the gravitational constant of the universe.”
- Data and Q in “Deja Q”

The good news is that we already have something in Qt that allows us to do all this: the QGraphicsView. So it just makes sense that we use QGraphicsView and QGraphicsItem with the new item views.

As an experiment I’ve decided to implement the internals of the views as QGraphicsWidgets (called a control for now, although that name is slightly confusing). This allows you to use item views as elements in a graphics scene.
There is also a QWidget-based view (it actually inherits QGraphicsView) that wraps the control and also provides a default data model and selection manager.

path.png

For a QListViewNG you can use QListControl, QGridListControl or QPathListControl. In addition you always have the option of implementing your own custom control to get the layout and/or painting you want.

“Maybe Q did the right thing for the wrong reason.”
“How so ?”
“Well, Perhaps what we most needed was a kick in our complacency to prepare us for what lies ahead.”
- Picard and Guinan in “Q Who”

But enought talk, more rock! The code is available here:

Check it out and enjoy!

englich
Qt
Aggregated
Posted by englich
 in Qt, Aggregated
 on Thursday, October 23, 2008 @ 08:44

Thank you, to all who attended Dev Days 2008 in Munich. For me it was really great to talk to so many users and hear about all the baffling projects that people pull off with Qt. And of course, to hear how people use and what people need, in terms of Qt’s XML support.

One customer told about how sub-classes of QObject are used for representing data, and are converted to such from XML. So, why not add a little helper class to Qt for this?

The class, which currently only is a research idea and missed the feature freeze for Qt 4.5, is called QXmlToQObjectCreator, and hopefully the documentation explains it all:

QXmlToQObjectCreator API Documentation

In other words, it’s a very simple class that builds a QObject tree corresponding to the output of QXmlQuery. The current sketched code is pasted here, for those interested.

In what way can this class be made more useful?

      
Bradley T. Hughes
Qt
KDE
Labs
Threads
Qt Concurrent
 in Qt, KDE, Labs, Threads, Qt Concurrent
 on Wednesday, October 22, 2008 @ 15:53

For the past 2 weeks, I’ve been wrestling with a fix for task 208487. At first glance, it seems pretty far-fetched (at least it did to me): an application that has 2 billion running timers and runs out of timer ids. But then I went and looked at the code (that I wrote!) and the real problem slapped me in the face: any application can only ever start 2 billion timers in total (which is different from having 2 billion concurrent timers). We never recycle timer ids. That means that the following code will quit working after 24.85 days. If we change the timeout to be zero instead, the runtime is reduced to hours instead of days.

class Object : public QObject
{
Q_OBJECT
public:
    Object() : QObject() { QTimer::singleShot(1, this, SLOT(timeout())); }
public slots:
    void timeout() { QTimer::singleShot(1, this, SLOT(timeout())); }
};

After quickly rejecting the question “Should I fix this?” (of course I should!), I promptly got my hands dirty looking for a solution. Fixing this proved to be harder than I originally anticipated…

Read the rest of this entry »

gunnar
Uncategorized
Qt
KDE
Graphics View
Painting
Graphics Dojo
Posted by gunnar
 in Uncategorized, Qt, KDE, Graphics View, Painting, Graphics Dojo
 on Wednesday, October 22, 2008 @ 08:24

There have been a number of requests to be able to replace the rendering engine used for widgets and pixmaps to be either OpenGL or the Raster backends as these have much better support for more advanced graphics features, such as gradients, blending and transformations compared to, specially, the X11 painting backend.

There existed some previous tricks to swap these things around. For instance, it was common to do “setViewport(new QGLWidget())” on a graphicsview it if ran slow. Similarly, one could create a QImage the size of the widget and do paintEvent into the QImage and just copy the data at the end using QPainter::drawImage().

Now we provide you with the real option. Starting Qt 4.5 you can choose the graphics system to use. It is ready available in the Technology Preview and in the snapshots. The way to pick backend is currently to specify a command line argument: “-graphicssystem raster” for the software engine or “-graphicssystem opengl” for OpenGL. The OpenGL graphicssystem is considered experimental for 4.5, while the raster backlend is considered fully supported on all platforms.

“But hey, this means we have tons of XPutImage calls as part of the repainting, doesn’t it?” you are probably thinking. Luckily not… The raster graphics system is using the X Shared Memory extension to allocate the bits shared with an XPixmap so the end of a paint is a mere XCopyArea, which happens in-place on the X server, so it is quite cheap. Needless to say this is a solution that works best on local displays, but that does cover most of the Linux desktops out there, so it should be a gain in general.

Using this also means that QPixmaps reside in system memory and QImage < -> QPixmap conversions are cheap, making things like smoothScaled significantly faster. Another nice side effect is 100% feature compliance as the raster backend is the reference implementation of QPainter. In general you should expect speedups in anything related to svg’s, pixmap transformations and gradients when switching to the raster system.

Just to give you an idea, below you see results of running the svgviewer with the bubbles.svg file on the various systems

Windows (Intel Core 2 Quad 2.6 GHz, 4 GB Ram, NVidia GeForce 8500 GT)

  • Native: 60 Fps
  • Raster: 60 Fps
  • OpenGL: 245 Fps

Naturally, Native and Raster run at the same speed on windows because native is the raster backend.

X11 (Intel Pentium 4, 3 GHz, 1 Gb Ram, Nvidia GeForce 6600)

  • Native: 20 Fps
  • Raster: 36 Fps
  • OpenGL: 92 Fps

This machine is running a slightly older graphics card than the other two machines, but its still a significant boost compared to native and raster when running with OpenGL.

Mac OS X (PowerBook, Intel Core 2 Duo, 2.4 GHz, 4 GB Ram, NVidia GeForce 8600 GM)

  • Native: 9 Fps
  • Raster: 30 Fps
  • OpenGL: 215 Fps

So, to sum up, any Qt application can now be run with the command line option

> app -graphicssystem raster

or

> app -graphicssystem opengl

and it will use a different rendering backend. So to underlying graphics libraries we say:
“So long and thanks for the Blit!”

AndyS
News
Posted by AndyS
 in News
 on Tuesday, October 21, 2008 @ 19:15

You may have heard that Qt Software is looking for Software Engineers to work in Qt Support. The description given is fairly standard support job description and may even be putting you off applying. Hopefully after reading this you’ll change your mind :) I’ve been working in Qt Support for 8 years now, and I have enjoyed every day of it and still do.

On a daily basis in Qt Support we communicate with C++ developers who are working on their own commercial projects and also with open source developers. In the past I have satisfaction helped people working at Google and Adobe, as well as people working on KDE. There is always a good deal of satisfaction to be had when you recognize the company or even the developers that you are communicating with and you realize you are helping *them*! And by helping them you are in an albeit indirect way contributing to something like Google Earth and Adode Photoshop Album, not to mention the countless devices that are out there now using Qt.

Each day brings new exciting challenges for me, I am always pushing my own knowledge of Qt further, its not all just answering questions like how do I change the background color of a QPushButton (although we do get asked that occasionally :). There are times where I get to learn something new about Qt when I am trying to help someone or trying to reproduce a bug reported to Qt Support. Over the years I’ve played about with SQL databases, different network protocols, among other things and at the same time I am helping to solve a problem or aiding the Qt developers in pinpointing a bug that they can fix later.

Also, you get to work with one of the best support teams in the world (ok I’m biased, but I am sure there are plenty of people who will back me up here ;), we have a good relationship with each other, helping each other out when needed. The same applies with the development team, when we need specialist help then we know we can just wander down the corridor, knock on a door and get the help that we need.

And in Qt Support, its not all just sitting at a desk answering e-mails, writing code and feeling good about the responses that you are giving out. There is the opportunity to work on examples, documentation and even contribute to Qt directly or indirectly. We get to look at the new version of Qt and get to experiment with the new features and also give feedback on them directly to the developers who are working on those features. Since we are working with the people that use Qt directly we have a unique perspective on how Qt is used in the real world and can give our own take on the new features and the API to use them.

There is also the non-work related benefits to working in Qt Software, while I won’t bore you with details on the pension scheme, the heavily subsided lunches and drinks which I am sure has been mentioned numerous times. There is a kicker table, Wii machine and ping-pong table where you will occasionally find us in our breaks away from the computer. Also, every couple of months the support team will get together and have a team-building where we hang out and do something as a group and then have a meal after. There is also the Qt Software Christmas party and annual cabin trip with the technical department too, so there is plenty of chances to socialize with your colleagues.

There you have it, working in Qt Support is very rewarding in a number of ways, job satisfaction you get when helping others, for your own personal learning in C++ and Qt, plus the great environment that you get to work in each day. So what are you waiting for?! Dust off that CV and apply for a job in Qt Support? Who knows, maybe we’ll be seeing you soon :)

Thiago Macieira
Qt
Posted by Thiago Macieira
 in Qt
 on Tuesday, October 21, 2008 @ 14:43

I bet you’re getting bored about this now… But apparently the blogosphere is now the vehicle of communication. Even our Marketing department decided that our cool, new homepage wasn’t the forum for it… It’s getting scary.

Anyways, if you were in the Qt Developer Days event last week in Munich, this comes as no surprise to you: Qt 4.5.0 Technical Preview is released. We promised the release by the end of the week, and then Friday came and we decided to go for a beer… but I digress.

What does this mean? Well, it means you get to see all of the cool new features we’ve been working on for the past few months (though you could already), as well improvements and fixes. For an idea of what we’ve done, you can look at past blogs and the TP website.

I know you all want a comprehensive list of what has been done, but I won’t give you one. For one thing, we’re not done — only features are done.

One major area of improvement for this release was on QtWebKit. We upgraded it to webkit.org’s latest trunk, we added Netscape plugin support (yes, you can watch videos on YouTube), we added support for video and audio elements with Phonon, we added HTML5 client-side storage (SQLite), and so on. I don’t even know all the guys did on WebKit.

Then there was that project that ported Qt to a new platform: Cocoa. Yes, this is technically a new port, even though it’s the same operating system. Now you can build Qt and your applications on Mac OS X using that framework, which supports both 32- and 64-bit. You can make use of those 8 extra registers! Well, your compiler can… We also added a new Phonon backend for the Cocoa port, since the old QuickTime 7 one used libraries available in 32-bit only.

For Windows CE, we finished the features that had been missing from the 4.4 series: namely, WebKit and Phonon. So you can now see YouTube on a Windows CE device too! And for that, we had to add two new Phonon backends: one for DirectShow and a simpler one, called the “WaveOut”.

Are you keeping track? That’s three Phonon backends with 4.5, plus the three others we did for 4.4. The KDE community and outside communities have also provided three more (Xine, mplayer and VLC). They say the three is the charm, we’re on three times three.

And then we also spent a lot of time doing performance improvements. Not that we don’t do that normally, but this is the first time that we said: we’re going to put major focus on performance. The results of that are a boost on several areas of Qt, mostly the painting and text. We’ll publish some benchmarks and shiny graphics later on. One result of that focus on performance was the new pluggable graphics backend system: that means you can switch which paint engine you’re going to use to draw. We offer you the native ones, the raster (software-based) one, and a new OpenGL-accelerated engine. (Be careful, some/most OpenGL implementations sacrifice perfection for performance, so you may see artifacts).

As a positive “side-effect” of the focus on performance was that we added benchmarking tools to QtTest, our unit-testing library. That’s to help you create benchmarks for your code. We provide three backends for it: a time-based one, a valgrind/callgrind-based one and a third one. I don’t remember what the third one is, but I know there’s one (we seem to do everything in threes anyways).

Besides those main areas of focus, we also added XSL-T support to QtXmlPatterns; we added the QtScriptTools module and a QtScript debugger tool; we added support for creating OpenDocument (ODF) text straight out of our text engine classes; we added QSharedPointer; we added support for compressed SVGs; we added Gtk+ integration (the QGtkStyle style); we improved Qt Designer and Qt Linguist; …

The technical preview is available under a special license at https://trolltech.com/developer/preview-qt-4.5. The Open Source GPL versions are at ftp://ftp.trolltech.com/qt/source/. As for past pre-releases, please send feedback to the qt4-preview-feedback mailing list (see webpage for instructions on how to subscribe).

I hope you enjoy Qt 4.5 as much as we enjoyed making it!

espenr
Qt
News
Posted by espenr
 in Qt, News
 on Monday, October 20, 2008 @ 10:57

April this year we started a new project here in Oslo called “Qt for S60″ and I’ve been wanting to blog about it ever since. Now I finally can! Basically we’re porting Qt to yet another platform: S60, which roughly gives us around 80 million new devices Qt can run on. Our vision of Qt Everywhere is becoming more and more of a reality. And it feels good.

Let’s get to the important stuff. Click here to:

About the tech-preview and the demos

The Qt for S60 pre-release packages comes in two license flavours, either download the opensource (GPL2 or GPL3) package or the preview-commercial package. Content wise there is no real difference between them. However, the opensource package contains pre-compiled binaries which the preview commercial package does not. The reason for this is that the compiler (GCCE) opensource developers have access too, at the moment, cannot build Qt libraries. RVCT however can - but you most likely don’t have access to that one as it’s not freely available. So basically, for the opensource package you’ll be building Qt applications with GCCE, but linking with RVCT built Qt libraries we provide for you. For the preview-commercial package we assume you’ve got access to RVCT, and we let you do all the stuff yourself. I’m sure we’ll sort out the GCCE issue for the next tech-preview.

The Qt modules available in this package are:

We support S60 3.1 and higher, even the 5.0 stuff that was just released :) Btw. if you try to install the demo above on your phone, and you’ve got a 3.1 device, you have to install Pips/Open C as well for it to work. We’ve got a package conveniently here for you.

Feedback

Our policy here in Qt Software is: release often, release early. We want feedback from developers trying out our software. Now keep in mind, this first relase is a technology preview. It is not supported, it is not complete, it is not production quality - basically it’s for you to play with. We have set up a special mailinglist for feedback on the S60 port. The address of the mailinglist is:

qts60-feedback@trolltech.com

please join if you want to provide technical feedback, bug reports, suggestions or comments. In order to join the mailing list send a mail to:

qts60-feedback-request@trolltech.com

with the subject set to: subscribe. In order to leave the list send a mail with the subject set to: unsubscribe. This will be an open list so make sure not to share sensitive information.

Let the hacking begin

We’re at the Symbian Smartphone show in London this week answering questions and showing of Qt on some phones. Drop by if you’re in the area :) But even more important, start making cool and crazy apps for your phones! I’m sure a lot of you already have an S60 bouncing around in your pockets, and it’s just waiting to be played with.

We also just announced the Pimp my widgets! contest, why not do a double-combo and try out Qt for S60 pimpin style ;)

Anyways, (sorry for the long blog) here is a picture of Qt running on all the S60 devices I got my hands on - just showing you I’m not lying.

Qt on lots of S60 devices - can you name them all?
Qt on lots of S60 devices - can you name them all?

Friedemann Kleint
Uncategorized
 in Uncategorized
 on Thursday, October 16, 2008 @ 07:49

Today, I would like to take you on a tour of the features of Qt Designer in the upcoming 4.5 release. The general focus of the 4.5 release is on stability and performance. Regarding Qt Designer, we mostly worked on usability and workflow-related issues.

The widget box and the property editor now have Filter fields, which let you find properties or widgets very quickly.

Property Editor

Using Ctrl+F in the object inspector will now display a search field at the bottom, letting you perform an incremental search on the form’s widgets.

Object Inspector

Another thing to note about the object inspector is that the layout state of containers is now displayed with an icon in the left column. Broken layouts show up using the icon of the “Break Layout” action, which makes it possible to quickly check whether all container widgets have proper layouts.

The widget box now features an “Icon Mode”, in which the icons are arranged in rows. This should substantially reduce the need to scroll, especially if there are many custom widgets present.

Widget Box

Quite some work has gone into object selection. The selection modifiers now conform to standards, i.e.,Ctrl can be used to toggle the selection status of a widget. Rubber-band-selection, which was previously available only on the form itself, can now be used everywhere using the middle mouse button. A common complaint about the previous versions of Qt Designer was that selecting a layout within a nested hierarchy of layouts was difficult. As of 4.5, there will be two additional ways to achieve this: The widget context menu contains an entry “Select ancestors” which lets you select the desired ancestor widget by name. In addition, Shift-clicking a selected widget will select the next ancestor, going up the hierarchy.

Some improvements were made to layout editing. It is now possible to re-layout just by choosing another layout type without having to break the layout. Also, when breaking the layout of a container embedded into another layout, it will no longer be squeezed to zero height or width in the form editor. Instead, it will maintain its size also in the unlaid-out state, allowing for conveniently rearranging and re-layouting it. Note that this deviates from the WYSIWYG principle employed in Qt Designer; it is a temporary state that only exists in the form editor.

The form layout has an additional action “Add form layout row” in the context menu, which brings the dialog shown in the picture (also triggered by double clicking):

Form Layout “Add Row” Dialog

It let’s you specify description label and field control to be used for a row to be added very conveniently. The object names of the widget are derived from the label text as you type, no, no more lineEdit1, lineEdit2…!

One feature we are particularly proud of is “Morphing widgets”. The context menu now features a “Morph into” entry, which lists similar widget types. For example, it is possible to morph a QWidget into a QFrame or into a QGroupBox without having to break layouts, move children elsewhere, re-layout, etc.

We have not forgotten our embedded designers. Qt Designer now features an “Embedded Design” tab within its preferences dialog page, letting you define embedded device profiles. A device profile comprises screen settings like display resolution, default font and style. Designer will use these settings when editing forms.

Various other features:
- Qt Designer 4.5 now supports linear wizards based on QWizard.
- Strings now have more sub-properties, for example a “translateable” checkbox that let’s you disable the translation of a string (causing it not to show up in Qt Linguist). Also, the comment field has been split up into “disambiguation” and “comment”.
- Item widget editors have been improved, allowing you to specify more properties for the items.
- Support for QButtonGroup has been added accessible via context menu for subclasses of QAbstractButton

I hope this little tour has piqued your curiosity and you will try out one of the snapshot packages!



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