Qt Graphical Effects in Qt Labs

Posted by Sami Lehtonen on February 2, 2012 · 26 comments

Introduction

The Qt Graphical Effects project is on its way to offer a set of design neutral visual effects for Qt Quick 2.0.

Over twenty ready-made QML graphical effect elements are currently available. The effects include code for blending, masking, blurring, coloring, and much more. There are still areas to improve and extend — all ideas, feedback, proposals and even concrete contributions are welcome!

The Effects

The Effects

Using the effects

Using the graphical effect elements should be straightforward for developers and technically oriented designers as you only need to know basic Qt Quick/QML to get started.

Any QML item can be used as a source item for an effect. You can add a drop shadow to an image, for instance, as follows:

import QtQuick 2.0
import QtGraphicalEffects 1.0

Item {
    width: 300
    height: 300

    Rectangle {
        id: background
        anchors.fill: parent
    }

    Image {
        id: butterfly
        source: "images/butterfly.png"
        sourceSize: Qt.size(parent.width, parent.height)
        smooth: true
        visible: false
    }

    DropShadow {
        anchors.fill: butterfly
        horizontalOffset: 3
        verticalOffset: 3
        radius: 8.0
        samples: 16
        color: "#80000000"
        source: butterfly
    }
}

Getting started

Get and build Qt5: http://developer.qt.nokia.com/wiki/Building_Qt_5_from_Git

Make sure that qtbase/bin is in your path and QTDIR points to /qtbase

Get and build Qt Graphical Effects module: https://qt.gitorious.org/qt-labs/qtgraphicaleffects

git clone git@gitorious.org:qt-labs/qtgraphicaleffects.git
cd qtgraphicaleffects
qmake
make install

To see the effects in action, run the code examples from the graphical effects doc/src/snippets folder:

qmlscene doc/src/snippets/DropShadow-example.qml

or launch the Testbed application:

qmlscene tests/manual/testbed/testBed.qml

The Testbed application is a convenient way to browse the effects and their properties as well as to visualise the results. Select an effect from the left, adjust its properties on the right, and see the result in the center in realtime:

API and documentation

The API for each effect is a set of QML properties. The effect properties can be animated just like any other QML properties. The documention contains property descriptions and basic usage examples. To generate the documentation, execute the following commands in the qtgraphicaleffects projects folder:

qmake
make docs

Open the generated doc/html/qml-graphicaleffects-index.html in a browser to view the documentation.

documentation

Implementation details

QML ShaderEffect is a built-in element in Qt Quick 2.0. This powerful QML element allows combining OpenGL Shading Language (GLSL) and QML, and makes it easy to implement visually impressive custom effects. Under the hood, all the effects in this project are based on ShaderEffect elements. Only QML and GLSL have been used, and there are no additional C++ APIs. If you are familiar with GLSL, you can easily study how the existing effects have been implemented. You can then create custom effects by modifying and combining the basic effects.

Links to related blog posts and specifications


 

QShare(this)

26 comments


Qt SDK 1.2 Released

Posted by Hannu Honkala on February 1, 2012 · 32 comments

We are happy to announce that a new important update for Qt SDK is published.
This Qt SDK 1.2 update sets a new baseline for the developers for a longer perspective. Some of the features have already been available as online updates, but Qt SDK 1.2 now integrates the very latest tools, most recent mobile build targets for Symbian and Nokia N9, and the still fresh Qt 4.8 for desktops. We have also introduced some improvements to the SDK and its maintenance tool.

As a summary, this is what is new in the Qt SDK:

  •     Fixes for Qt Creator 2.4 in a new 2.4.1 patch update
  •     Qt 4.8 for desktops delivering Qt Quick 1.1, Qt platform abstraction, Qt WebKit 2.2, and threaded OpenGL. See Sinan’s blog post for more details.
  •     More Qt Mobility examples for Nokia N9 and Symbian devices
  •     Ability to specify network proxy setting in the SDK Maintenance Tool
  •     Update to the Symbian Complementary Package introducing Analyze Tool plugin and new CODA 1.0.6 installation package
  •     An update to Notifications API improving the end user experience and fixing issues in the Nokia N9 implementation of the API.

If you already have Qt SDK installed, you can update to the latest version by running Update Qt SDK from the Qt SDK application folder on your computer. If you first time are getting started with Qt SDK, you can download 1.2 from our download page.

If you encounter problems, please file a bug report at http://bugreports.qt-project.org.

QShare(this)

32 comments


Qt Creator 2.4.1 released

Posted by Eike Ziller on February 1, 2012 · 2 comments

Today we publish a patch release of Qt Creator 2.4, that is also included in a bigger Qt SDK 1.2 update.

Qt Creator 2.4.1 contains no new features, but fixes a few issues, most notably

  • finding the QMLViewer.app on case sensitive Mac file systems
  • building debugging helpers for universal builds, and tool chain / mkspec setting in some configurations (Mac)
  • automatic proxy detection on Windows systems

Also see the 2.4.1 change log.

Get the new version from our download page, or through the updated SDK here.

QShare(this)

2 comments


Overview

This is an awfully dry post; dry due to the sheer logistic nature of it. This functionality exists and is quite straight forwards to stumble upon. This blog exists in order to draw your attention to it and hopefully minimize the stumble time.

You have a device:

1) Running an ssh server
2) With gdbserver

You also have:

1) A functional tool chain for the target (Code Sourcery is the traditional goto)
2) A Qt build for your target
3) A Linux box you are deploying from (My convenience, instructions should be readily repurposeable for Mac based developers)
4) Qt Creator (Qt Creator 2.4.0 (as shipped with the QtSDK) was used at the time of filming/documenting this process)

Qt Creator has various merits which basically speak for themselves.

Integrated documentation
Convenient remote visual debugging/profiling
Convenient (single click) deployment

You grow accustomed to this functionality if you target any of the officially/unofficially supported targets tightly integrated into Creator in its various distributions. (Official SDK, Necessitas, Meego SDK). It would be lovely if it were more commonly perceived as a generic end to end solution for deployment to generic Linux targets, and it is readily achievable if you avoid a couple of snags.

Initial configuration

Launch Creator
Menu -> Tools -> Options

Build & Run -> Qt Versions

Add your Raspberry PI Qt build: /opt/dev/qt-qpa-5-rasp-pi/bin/qmake

Creator indicates “Qt version 5.0.0 for Desktop”, this can be safely ignored.

Build & Run -> Tool Chains

Add your cross compiler: /opt/toolchains/arm-2010q1/bin/arm-none-linux-gnueabi-gcc

in my case. Adjust the ABI in the unlikely event it is incorrect.

Linux Devices -> Device Configurations

Add configuration with correct ssh details, deploy a public key and establish this works.

Per project configuration

1) Open an existing Qt application (example suffices)
2) Select a desktop build

Once this is done:

Projects -> Targets -> Build

Specify your target’s Qt version
Specify the toolchain from the drop down below

Projects -> Targets -> Run

Deployment

Method: Deploy to Remote Linux Host
Device Configuration: Select your “Linux Device” added in the Device Configurations step above

Run

Run Configuration: foo (on Remote Device)
Arguments: -platform eglfs

This should suffice, you should now be able to deploy, run and debug applications on the Raspberry PI (or any other similarly capable Linux based target)

A screen grab demonstrating the logistics is available here

A video where I talk through the steps is also available for those willing to weather my accent

Caveats

1) If you select a QtQuick UI project from the project wizard you will not be able to deploy to the target (will be grayed out). If you select a Qt Quick application you will get a QDeclarativeView based viewer/launch pad. If you want to dabble with Qt 5 (who doesn’t) at present, one has to ride to war with one’s own QQuickView based runtime/viewer (read: pony)

2) Qt must already be deployed on the target. We clearly handle this for our own devices, but when you are winging it as documented here, Qt has to have been (manually) installed to the configured prefix. (Needless to say, it is best to sanity check the Qt install prior to attempting IDE based deployment).

 

QShare(this)

13 comments


Qt 4 moved to open governance

Posted by Lars Knoll on January 10, 2012 · 8 comments

Since we released Qt under open governance on qt-project.org, there was always one piece missing. The Qt 4 repository was so far still handled in the old system. This was done as a simple prioritization, to get the parts of Qt that we considered most relevant for the development community out first.

The main problem has been the additional work required to integrate Qt 4 with the continuous integration (CI) system used on qt-project. Thanks to the efforts of Sergio, Rohan and others this has now been (mostly) solved. We run the full CI setup (that includes both compilation and running the test suite) on both Linux and Mac OS X for Qt 4.8. On Windows we currently only run compile tests, running the automated tests on Windows is coming soon.

You can now find the Qt 4.x repository on codereview. Pushing and reviewing changes works the same way as for Qt 5.

Approvers and Maintainers are the same as for the respective areas in Qt 5, but it should be noted that I don’t expect a lot of further development to happen in Qt 4.8. The focus here should be on bug fixes, and patches should be reviewed with this in mind.

The Qt 4.6 and 4.7 branches are not CI tested, so extreme care should be taken when submitting to these branches, and I’d like to see a review from a Maintainer for any change going in there. Changes in these branches should be limited to security issues and severe bugs that can’t be worked around in user code.

Any pending merge requests in gitorious should be resubmitted through gerrit, as we’ll close merge requests on gitorious and turn the repository there into a readonly copy.

Enjoy!

QShare(this)

8 comments


Qt 5 – A look back at the numbers

Posted by Marius Storm-Olsen on December 22, 2011

Marius Storm-Olsen is Head of Qt OSS in Nokia, and responsible for the operational side of the Qt Project. The Qt OSS team consists of 5 Sr. SW engineers who are exclusively dedicated to the Qt Project (although there are many more Nokia contributors than just those 5), and  focusing on working with the community on [...]

17 comments Read the full article →

The show must go on! Qt experts are talking and showing (again)!

Posted by Vladimir Minenko on December 21, 2011

It seems to be almost a tradition that shortly before Christmas, I post this message… “Qt Developer Days videos are online! Many treasures are inside”. This year is different in many ways… First, we used modern, broadcast grade video equipment and the content is in 720p HD format. All this means a much better video [...]

15 comments Read the full article →

Qt VS Add-in 1.1.10 released

Posted by Jörg on December 19, 2011

Together with Qt 4.8.0 we’ve released version 1.1.10 of the Qt Visual Studio Add-in. This release contains multiple bugfixes and improvements. The full changelog is available here. You can get it here: http://qt.nokia.com/downloads/visual-studio-add-in If you find bugs, please report them in our bug tracker: https://bugreports.qt.nokia.com/ Note: Qt VS Add-in 1.1.10 will be the last release [...]

22 comments Read the full article →

Qt 4.8.0 Released

Posted by Sinan Tanilkan on December 15, 2011

Qt has reached another important evolutionary milestone today. We are very proud to announce that Qt 4.8.0 has now been released. Many people have worked long and hard to deliver Qt 4.8.0. Today that hard work reaches final release maturity, and we are celebrating! Featuring Qt Platform Abstraction, threaded OpenGL support, multithreaded HTTP and optimized [...]

101 comments Read the full article →

New guides for those who are learning Qt Quick or Qt Quick Components on Symbian and N9

Posted by Vladimir Minenko on December 13, 2011

A post about new developer guides has been on the on the Qt Blog for a few weeks. We’ve made a small, but interesting update and we thought we should drop some lines about it. Just a few weeks ago we published two new developer guides. They are targeted toward those just starting out with [...]

21 comments Read the full article →

Qt Creator 2.4.0 released

Posted by Eike Ziller on December 13, 2011

We are happy to announce that finally Qt Creator 2.4.0 is ready to be published. I’ll summarize a few of the great amount of features and improvements in this release. You find a longer list in our change log, and you can also have a look at what we fixed for 2.4.0 in our bugtracker. [...]

49 comments Read the full article →

Testing QtQuick 2 (Qt 5) on your n9/n950

Posted by dcarr on November 21, 2011

QtQuick 2 promises superior performance, a new particle system and a host of new possibilities: http://doc.qt.nokia.com/qt5/qtquick2-whatsnew.html It is also quite ripe for testing if you are into that kind of thing. This is my personally recommended approach to testing QtQuick 2 on your n9(50) at this point in time and I have to stress that [...]

5 comments Read the full article →