summaryrefslogtreecommitdiffstats
path: root/src/gui/graphicsview
Commit message (Collapse)AuthorAgeFilesLines
* Update copyright headersAkseli Salovaara2015-03-3151-663/+663
| | | | | | | | | Qt copyrights are now in The Qt Company, so we could update the source code headers accordingly. In the same go we should also fix the links to point to qt.io. Change-Id: I7e3e96183e073877b46bc8071b2ccae19e69426b Reviewed-by: Jani Heikkinen <jani.heikkinen@theqtcompany.com>
* Fixed a bug where spans did not always work in layouts.Jan Arve Saether2014-12-101-1/+1
| | | | | | | | | | | | | | | | | The problem was that the span we stored in the multiCellMap was the "effective" span (i.e. the given span subtracted with the number of ignored rows it would span). Later we used that span to distribute its size across all its cells. However, since the span now could be smaller that the given span, we could sometimes fail to distribute to the last span(s). [ChangeLog][QtWidgets][layouts] Fixed a bug where spans sometimes didn't distribute themselves to the last cells they covered. Change-Id: I7bfbbe721f0ec4398be6a5f234c109ddfec18514 Task-number: QTBUG-43099 Reviewed-by: Paul Olav Tvete <paul.tvete@theqtcompany.com> (cherry picked from qtbase/c9db6e52bc9bd9731159fcb4e95fca5cba01bc9c)
* Adjust the layout if a QGraphicsWidget is explicitly hiddenJan Arve Saether2014-10-313-1/+14
| | | | | | | Task-number: QTBUG-20132 Change-Id: Iab59fc9b61d4ca1bb2208c479a027da6eb0283a9 Reviewed-by: Paul Olav Tvete <paul.tvete@digia.com> (cherry picked from qtbase/bf200fc948d89e1a735a8bcca879654028f944d2)
* Fix crash when deleting top level windows embedded into QGraphicsProxyWidget.Friedemann Kleint2014-04-151-0/+4
| | | | | | | | | | | Clear proxyWidget pointer in slot QGraphicsProxyWidgetPrivate::_q_removeWidgetSlot(). Task-number: QTBUG-29684 Task-number: QTBUG-33213 Change-Id: Ibdbd52aa810ca908e3d98daa00954345e7a93a48 Reviewed-by: Andreas Aardal Hanssen <andreas@hanssen.name> (cherry picked from qtbase/ff2dbe609ef4482d66d1ecd135b4f53f6aff7e60)
* Updated year in copyright headerKai Koehne2014-03-2651-51/+51
| | | | | | | | | | | | | | | | | | find . -path '*/3rdparty/*' -prune -o -type f -print | xargs -L1 sed -i -E 's/Copyright(.*) 2013 Digia/Copyright\1 2014 Digia/g' Manually patched files: demos/spectrum/3rdparty/fftreal/fftreal_wrapper.h demos/spectrum/3rdparty/fftreal/fftreal_wrapper.cpp src/3rdparty/s60/eiksoftkeyimage.h tools/qdoc3/test/qt-project.qdocconf tests/auto/qsharedpointer/nontracked.h tests/auto/qsharedpointer/nontracked.cpp Change-Id: I3f9074923b4d6bd4666258ab04f01476cc6e901c Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Sergio Ahumada <sahumada@blackberry.com> Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* Fix double transform for items ignoring parent transformations.Andreas Aardal Hanssen2013-08-051-3/+8
| | | | | | | | | | | | | | | | | | | Previously, the topmost untransformable's scene transform, which includes the item's position and local transformation, was used to determine the item's anchoring position. This position was then passed on to be multiplied by the item's transform again. This works fine for toplevel untransformable items that don't have any transform set at all, but those who do would have their transforms applied twice - one to determine the anchoring position, and again to transform the item itself. Since only translation transformations can affect the first operation (the anchoring pos), this bug only applies to items that set ItemIgnoresTransformations and use a local transform that includes translation. Task-number: QTBUG-21618 Change-Id: I3f3c4f2357e2ca6cd0c75cb5b7e428c0803d9e73 Reviewed-by: Alexis Menard <alexis@webkit.org> Reviewed-by: Jan Arve Sæther <jan-arve.saether@digia.com>
* QGV: fix items not to be selected on right mouse button releaseJ-P Nurmi2013-05-151-1/+1
| | | | | | | | Task-number: QTBUG-30990 Change-Id: Iaf2dd7ed496625097daa05d5dc92ef5957574ee9 (Cherry-picked from qtbase/0b862e067756132225e33be09670631edd50d944) Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com> Reviewed-by: Andreas Aardal Hanssen <andreas@hanssen.name>
* Fixed a bug where the MaximumSizeHint of a layout with spans was wrongJan Arve Saether2013-04-051-0/+2
| | | | | | | | | | | | | | This was spotted while tracking down a similar bug related to spans. This now also eliminates the Q_EXPECT_FAILs in heightForWidthWithSpanning(), since it now finally works. The problem was only for the maximum size, since the size of an ignored row/column was min: 0, pref: 0, max: FLT_MAX (the default constructed values for a QGridLayoutBox). Change-Id: Ibb33c26ede40ed02edd26f596ba6133d59c9962f Reviewed-by: Paul Olav Tvete <paul.tvete@digia.com> (cherry picked from qtbase/9d7ae6dfbe25fb70a362a4cf955c187cd24cb007)
* Fixed a bug where spans across empty cells got broken.Jan Arve Saether2013-04-041-1/+1
| | | | | | | | | | | | | | | | If a row/column is only used only because of the spanning of an item, the cell should be treated as it didn't exist. We keep track of this with the "ignore" bit array. The old code would always start from the row/column at position 1. In the attached testcase this made the effectiveRowSpan become larger than actually needed. Task-number: QTBUG-30255 Change-Id: Ief0e7018ee8e5ee36272ce075a43312ffeac7b91 (cherry picked from qtbase/f9e43c526a30ae3912adfe3d5cb781af5ddda4b0) Reviewed-by: Paul Olav Tvete <paul.tvete@digia.com>
* Make sure QGraphicsItem notifies changes to focusScopeItem.Andreas Aardal Hanssen2013-01-291-5/+7
| | | | | | | | | | | | | | | | | | | A glitch in QGraphicsItem's logic made it update the focusScopeItem pointer, but fail to notify the change to QDeclarativeItem through the d_ptr->focusScopeItemChange() virtual function, hindering QDeclarativeItem from emitting focusChanged() correctly for focus scopes that do not have focus. Two lines were moved, and a comment updated to reflect the reason why the "return" is needed at this point. It's clear that the calls to focusScopeItemChange() are unrelated to the return. Task-number: QTBUG-29260 Change-Id: I12ba9161b16d34c3689401a92c86d2047989f7bd (cherry picked from qtbase/6476d6728eb3cde8e4a5fd0eb607b92977932296) Reviewed-by: Andreas Aardal Hanssen <andreas@hanssen.name> Reviewed-by: Jan Arve Sæther <jan-arve.saether@digia.com> Reviewed-by: Alan Alpert <aalpert@rim.com>
* Update copyright year in Digia's license headersSergio Ahumada2013-01-1351-51/+51
| | | | | | Change-Id: I52bf8ef0447b701b4ebf7d7d240013a72adb9425 Reviewed-by: Akseli Salovaara <akseli.salovaara@digia.com> Reviewed-by: Sergio Ahumada <sergio.ahumada@digia.com>
* Clear focus of GraphicsItem focus scopes and their children.Andrew den Exter2012-12-051-3/+9
| | | | | | | | | | | | | A focus scope has effective focus if one of its children is the focus item, clearFocus() should remove effective focus from an item and its children not just from the focus item. Task-number: QTBUG-28328 Reviewed-by: Martin Jones <martin.jones@jollamobile.com> (cherry picked from commit ab97a44b6ae5cc826460f3704669383afd398594) Change-Id: Ib6f43b40091cb1bb1a0d5b8b9ac71e44f35b037b Reviewed-by: Martin Jones <martin.jones@jollamobile.com>
* Remove invalid assert from QGraphicsSceneRafael Roquetto2012-11-281-1/+0
| | | | | | | | | | | | This assert has become invalid since commit 40fef403. After that commit, the 'origin' mentioned by the assert is not necessarily the first item of cachedItemsUnderMouse, since it origin can be reassigned at line 5839. cherry-picked from qt5 f4b80c1210e444ad7454abfb80ba166ce2e2a5f2 Change-Id: Iae264f5b301b4bf76b59c7262b06edb24c594ee5 Reviewed-by: Bernd Weimer <bweimer@rim.com> Reviewed-by: Denis Dzyubenko <denis@ddenis.info>
* Change copyrights from Nokia to DigiaIikka Eklund2012-09-2951-1224/+1224
| | | | | | | | Change copyrights and license headers from Nokia to Digia Change-Id: I280c0a575987d1770e354b4948f1d4d767d711ea Reviewed-by: Simo Fält <simo.falt@digia.com> Reviewed-by: Sergio Ahumada <sergio.ahumada@digia.com>
* Ensure child items are updated even if the parent item has no contentAndy Shaw2012-09-121-1/+2
| | | | | | | | | | | | | When a parent item had its visiblity toggled, then the child item would not update if the parent item had ItemHasNoContents and ItemClipsChildrenToShape set. This is a common use case in declarative as the root item has ItemHasNoContents set. Task-number: QTBUG-26846 Change-Id: Id6592ebc4ba2caa4331a4a71f7247e40993131b6 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com> (cherry picked from commit 49c251e0543ea80e69d1725bb08bb4dfe3f225ab)
* Update contact information in license headers.Sergio Ahumada2012-08-0151-102/+102
| | | | | | | | | | | | | - Replace Nokia contact email address with Qt Project website. - Remove "All rights reserved" line from license headers. As in the past, to avoid rewriting various autotests that contain line-number information, an extra blank line has been inserted at the end of the license text to ensure that this commit does not change the total number of lines in the license header. Change-Id: Ie7ba62011752fcb149b99b26317c54f2a0cfa931 Reviewed-by: Jason McDonald <jason.mcdonald@nokia.com>
* Fix dangling pointer issue in QGraphicsItem focus handlingPauli Jarvinen2012-06-011-6/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When focused QGraphicsWidget is being hidden, it tries to move the focus to next focusable widget by calling focusNextPrevChild(true). If there is no such widget available, the focus is cleared altogether. The logic used to rely on the return value of focusNextPrevChild to decide if clearing the focus is necessary. This was incorrect because the return value may be true also when the focus has actually moved within the graphics widget in question rather than moving to the next widget. This is the case at least when GraphicsWebView item is focused. Thus, the focus could then be left on invisible item which was a serious issue: elsewhere in the qgraphicsitem.ccp, it is assumed that no visible item can point to invisible item with its subFocus pointer. Such pointers will become dangling pointers once the pointed graphicsitem is deleted, and the process will then crash as soon as the focus is tried to be moved to another item. Now, the logic has been modified so that it is explicitely checked after call to focusNextPrevChild if the item being hidden still has the focus. If this is the case, the focus is cleared. To be consistent, the same logic is applied also when disabling a QGraphicsWidget. Having focus on disabled item is not as severe issue as having it on invisible item, but it is still wrong. Task-number: ou1cimx1#995710 Change-Id: Ica32bc381befc3ccaac79fb4cf4d50c5d452fad0 Reviewed-by: Gunnar Sletta <gunnar.sletta@nokia.com> Reviewed-by: Pasi Pentikäinen <ext-pasi.a.pentikainen@nokia.com>
* Revert "Don't rely on mapFromGlobal in QGraphicsScenePrivate::itemsAtPosition."Jonathan Liu2012-02-281-3/+7
| | | | | | | | | | | | | This reverts commit 7c0d15a22266a425c9e9ac0120d6774e120fe01e. The commit caused a regression whereby tooltips may be shown even if the mouse is not over the item if it has the Qt::ItemIgnoresTransformations flag and the QGraphicsView had been scaled. Task-number: QTBUG-17517 Task-number: QTBUG-22663 Change-Id: Ib7fd788d9712c5e659fe07182f9505a4eb135ab2 Reviewed-by: Andy Shaw <andy.shaw@digia.com> Reviewed-by: Robin Burchell <robin+qt@viroteck.net>
* Fixed DEBUG macro redefinition when compiling for WEC7 with MSVC.jaanttil2012-02-031-11/+11
| | | | | | | | | | DEBUG macro is defined from command line for debug builds in WEC7. Changed graphcisscene internal macro to have different name. Task-number: QTBUG-22512 Change-Id: I3d2bb8b7a2741fe34397a1c3cc268c1f6c5593b3 Reviewed-by: Denis Dzyubenko <denis.dzyubenko@nokia.com> Reviewed-by: Joerg Bornemann <joerg.bornemann@nokia.com>
* Various qt documentation fixes (wk 43)artoka2012-01-312-3/+7
| | | | | | | | | | | | | | | | | | | | | Task-number: QTBUG-12389 Task-number: QTBUG-16667 Task-number: QTBUG-6151 Task-number: QTBUG-8625 Task-number: QTBUG-19808 Task-number: QTBUG-12096 Task-number: QTBUG-1231 Task-number: QTBUG-21073 Task-number: QTBUG-8939 Task-number: QTBUG-20399 Task-number: QTBUG-20944 Task-number: QTBUG-7542 Task-number: QTBUG-22095 Task-number: QTBUG-11278 Task-number: QTBUG-15653 Change-Id: Ibc369998d06e7f2f11b01a1ba4c2fb927e3c065b Reviewed-by: Casper van Donderen <casper.vandonderen@nokia.com>
* Update year in Nokia copyright messages.Jason McDonald2012-01-1151-51/+51
| | | | | | | | | Simple search and replace. This commit doesn't touch 3rd-party files, nor translations (where the change is not so simple and will be handled in a separate commit). Change-Id: I4e48513b8078a44a8cd272326685b25338890148 Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
* Symbian: Fix exporting and importing of some functions for autotestsMiikka Heikkinen2011-12-212-2/+2
| | | | | | | | | Symbian builds seem more strict about properly declaring exports than other builds, so added proper exporting and importing to some function declarations. Task-number: ou1cimx1#957184 Reviewed-by: mread
* Merge branch '4.8-upstream' into master-waterWater-Team2011-11-161-1/+4
|\
| * Merge branch 4.7 into qt-4.8-from-4.7Sergio Ahumada2011-11-151-1/+4
| |\
| | * Fix focusScopeItemChange setting crashDamian Jansen2011-11-151-1/+4
| | | | | | | | | | | | | | | | | | | | | | | | Delay focusScopeItemChange to after reparenting, to prevent an invalid focusScopeItem pointer crash. Task-number: QTBUG-21640 Reviewed-by: Martin Jones
* | | QGraphicsLayoutItem - bound constraint the minimum and maximum sizeJohn Tapsell2011-11-081-2/+68
|/ / | | | | | | | | | | | | | | | | | | | | | | The scenario was this: If you had a height for width item, and that item had a maximum width of 50. If you called item->effectiveSizeHint(Qt::PreferredSize, QSizeF(100,-1)); it would return (100, ?), thus violating its own maximum width. Merge-request: 1423 Reviewed-by: Jan-Arve Saether <jan-arve.saether@nokia.com>
* | Merge branch '4.8-upstream' into master-waterWater-Team2011-10-176-17/+17
|\ \
| * | Converting from double to qreal in guimread2011-10-106-17/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | There were a number of places in QtGui where doubles were used in expressions due to the use of floating point constants in the code. Many of these constants are now constructed as qreal, removing the use of double operations where unneeded. These changes have been limited to constants that have exactly the same value whether double or float, to ensure that precision errors are not introduced. This should not affect any of the desktop platforms where qreal is double. On Symbian, where qreal is float, appropriate autotests have been run. Task-number: QTBUG-4894 Reviewed-by: Sami Merila
* | | Fix bug in QGraphicsItem::isVisibleTo().Andreas Aardal Hanssen2011-09-291-9/+11
|/ / | | | | | | | | | | | | | | | | Task-number: QTBUG-21612 Reviewed-by: James Perrett Reviewed-by: Magne Pettersen Zachrisen Merge-request: 1396 Reviewed-by: Jan-Arve Saether <jan-arve.saether@nokia.com>
* | Merge branch '4.8-upstream' into master-waterWater-Team2011-09-183-17/+29
|\ \
| * | QGraphicsWidget::setLayoutDirection doesn't propagate to new childrenJohn Tapsell2011-09-161-0/+6
| | | | | | | | | | | | | | | Merge-request: 1360 Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>
| * | Prevent unnecessary graphics item updates when graphics effect changes.Christophe Oosterlynck2011-09-161-16/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Don't invalidate a QGraphicsItem (neither its cache) when an update is triggered because of a QGraphicsEffect attached to it. Autotest for QGraphicsEffect extended with 2 cache invalidation tests Merge-request: 2681 Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>
| * | Fix - QGraphicsTextItem in a tab of QTabWidget cannot get focusKalle Viironen2011-09-151-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Any QGraphicsTextItems in those tabs which are not the first tab of QTabWidget, cannot get focus although the tab is current tab of QTabWidget.But the QGraphicsTextItem in the first tab of QTabWidget can get focus. i.e. a focus frame (dotted box) appears around the QGraphicsTextItem. Those QGraphicsTextItems which cannot get focus can get focus only after the main window is minimized and then maximized. i.e. After that, a focus frame appears around it. Task-number: QTBUG-19680 Merge-request: 2676 Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>
* | | minor docu fixesKonstantin Ritt2011-09-151-5/+5
| | | | | | | | | | | | | | | Merge-request: 2646 Reviewed-by: Frederik Gladhorn <frederik.gladhorn@nokia.com>
* | | Merge branch 'master' of scm.dev.nokia.troll.no:qt/qt-water-teamJan-Arve Saether2011-09-071-16/+18
|\ \ \ | |/ /
| * | FocusScope's focusItem must always be a descendentAlan Alpert2011-08-301-16/+18
| | | | | | | | | | | | | | | Task-number: QTBUG-20699 Reviewed-by: Michael Brasser
* | | Do not leak memoryJan-Arve Saether2011-09-071-4/+5
|/ / | | | | | | | | Task-number: QT-4333 Reviewed-by: Trustme
* | Don't endless loopAlan Alpert2011-08-091-1/+1
| | | | | | | | | | Task-number: QTBUG-20699 Reviewed-by: Michael Brasser
* | Fix a crash with QGraphicsScene.Pierre Rossi2011-07-121-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | It happened when the scene gets deleted after ~QApplication has been called. test case: int main(int argc, char *argv[]) { QApplication a(argc, argv); QGraphicsScene *scene = new QGraphicsScene(&a); return 0; } Reviewed-by: Gabi
* | Merge branch '4.8-upstream' into master-waterWater-Team2011-07-081-0/+2
|\ \
| * | Doc: Updated documentation with \since 4.8 declarations.David Boddie2011-06-301-0/+2
| | |
* | | Make this feature public for Qt 4.8 (was privately added for Qt 4.7)Jan-Arve Saether2011-07-051-2/+0
|/ /
* | Merge branch 'master' of scm.dev.nokia.troll.no:qt/qt-fire-staging into ↵Qt Continuous Integration System2011-06-281-1/+1
|\ \ | | | | | | | | | | | | | | | | | | | | | | | | master-integration * 'master' of scm.dev.nokia.troll.no:qt/qt-fire-staging: Reorder variable to eliminate warnings Only compare styleNames if they are not empty Add styleName to QFontDef comparison
| * | Reorder variable to eliminate warningsJiang Jiang2011-06-271-1/+1
| | | | | | | | | | | | Reviewed-by: Frederik Gladhorn
* | | Merge branch 'master' of scm.dev.nokia.troll.no:qt/qt-water-staging into ↵Qt Continuous Integration System2011-06-272-6/+22
|\ \ \ | |/ / |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | master-integration * 'master' of scm.dev.nokia.troll.no:qt/qt-water-staging: Incorrect property name in QAccessibleAbstractSpinBox::setCurrentValue When asking for relations, don't crash on children that don't return an interface. Remove more inconsistencies with invisible. QAccessibleToolButton::text should return accessibleName if set. Remove stray semicolon. Do not expose text when echo mode is not Normal. Check validator when changing text using accessibility functions. Fix some issues introduced in df6713b8f55fc007796f40. Add tilde (both ~ and ~<userName>) expansion to QFileDialog on UNIX. Avoid bogus accessibility focus events from menus. Build fix for Mac OS 10.5 Avoided calling updateAccessibility() from updateMicroFocus if the item was hidden Notify a11y framework of FocusChanges for QGraphicsObject Call updateAccessibility on the QGraphicsObject in updateMicroFocus Fix updateAccessibility for QGraphicsObjects Make accessibility work on Windows with alien
| * | Merge remote-tracking branch 'upstream/4.8' into 4.8Frederik Gladhorn2011-06-1251-951/+1058
| |\ \
| * | | Notify a11y framework of FocusChanges for QGraphicsObjectJan-Arve Sæther2011-05-091-0/+12
| | | | | | | | | | | | | | | | | | | | | | | | (cherry picked from commit 1b5cb7865eb8b48a2721f9b9c3ccd2fb25f8175d) Reviewed-by: Frederik Gladhorn
| * | | Call updateAccessibility on the QGraphicsObject in updateMicroFocusJan-Arve Sæther2011-05-091-6/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Since QGraphicsObjects now can be in the a11y hierarchy, we should treat them just like we treat widgets. (cherry picked from commit 860745a4713b29857d14571572504da71a2ca077) Reviewed-by: Frederik Gladhorn
* | | | Merge remote branch 'origin/4.7' into qt-4.8-from-4.7Jani Hautakangas2011-06-225-24/+30
|\ \ \ \ | | |_|/ | |/| | | | | | | | | | | | | | | | | | Conflicts: src/opengl/qgl.cpp src/opengl/qpixmapdata_symbiangl.cpp src/opengl/qwindowsurface_gl.cpp
| * | | Fixes to how resize event and layout request are posted.Jan-Arve Saether2011-06-105-22/+29
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Also fixed how the relayout is initiated. This is because we needed to react differently to *posted* layout requests than to sent layout requests. (sent ones should activate the layout, posted ones should also resize the widget). We therefore introduced the private slot _q_relayout() in order to be able to make the distinction between posted and sent layout requests. (Instead of posting we now invokeMethod with a queued connection. In order to make it behave as it was compressed we also have to refcount the number of calls to invokeMethod.) (Note that refCount is 16 bits only, so it should not overflow in sane cases. In the insane cases, the worst thing that will happen is that it'll relayout the layout one extra time). Make sure we resize QGraphicsWidget to be within its min,max sizes when we change one of its constraints. (e.g. we change minimumSize to something bigger than the current size). This did not work if the widget did not have a layout. Send a resize event whenever a QGraphicsWidget changes its size. This did not happen before, because in the cases where a Layout Request was sent, we did not send a resize event. This patch changes that, so that when we send a resize event, we do not send a Layout Request event. This means that a Layout Request event is now *only* sent in order to tell a widget to relayout its children (but the widgets size was not changed, that's why we cannot send a resize event in that case) Also includes a unit test, and a fix to make sure that we send a resize event when we resize due to the sizehint changing followed by a setPos command. Added autotests for this. (and changed some) Many thanks to John Tapsell and Stanislav Ionascu for help. (autotests were provided by them). My poor explanation did not convince Frederik 100%, but he is "convinced enough" :) Reviewed-by: Frederik Gladhorn