summaryrefslogtreecommitdiffstats
path: root/src/gui/graphicsview
Commit message (Collapse)AuthorAgeFilesLines
* Fix a bug that got revealed by 604c51f1fc5c79b7fad12cda911b06b9e6e5005fJan-Arve Sæther2011-01-191-2/+3
| | | | | | | | | | | | | | | | | | | | | | | The bug has been around for a while, but change 604c51f1fc5c7 made it emerge. The problem was that stretches were combined by always *maxing* them. The values of 'stretch' can be interpreted as this: -1: (the default) it means that the items should be stretched with the stretch factor dervived from the size hints. (In practice this means that they are distributed fairly). 0: Means that the item should not be stretched >0: Means that the item should be stretch with that number as a factor. This meant that combining one item with a fixed size(0) and another item with a default stretch (-1) the combined row stretch would end up being fixed. This also fixes how stretches are combined for spanning items too. Task-number: QTBUG-13551 Reviewed-by: John Tapsell (cherry picked from commit 7fbf1829e11504eca6a55f1e5dbddf2f658b5302)
* Proper fix for QGraphicsItem crash.Yoann Lopes2011-01-171-3/+2
| | | | | | | | See 8ffb49a4ac68b1c243b25343053e6e99f97ec2e7 Task-number: QTBUG-16374 Reviewed-by: TrustMe (cherry picked from commit 46ede046a34c822c612c55fdb1dc93dffe3fc6b6)
* Update copyright year to 2011.Jason McDonald2011-01-1151-51/+51
| | | | | Reviewed-by: Trust Me (cherry picked from commit ac5c099cc3c5b8c7eec7a49fdeb8a21037230350)
* Fixes crash in QGraphicsItem's destructor.Yoann Lopes2011-01-071-1/+3
| | | | | | | | Crash introduced by 783a278f243c6411f5f32d11f2165b9eed9b6f8c. Autotest written by Niklas Kurkisuo <ext-niklas.kurkisuo@nokia.com> Task-number: QTBUG-16374 Reviewed-by: TrustMe
* Fix to commit 3778c3f5208f3db99d6b23a2a3c4abf1fe2ec64fJan-Arve Sæther2010-12-141-1/+1
| | | | This is what could happen if you go to lunch before comitting.
* Make sure that d->init() is called from both ctors.Jan-Arve Sæther2010-12-141-1/+2
| | | | | | | | QGraphicsLayout uses the protected ctor that did not call d->init(), so all its subclasses was potentially suffering from this. Task-number: QTBUG-15333 Reviewed-by: John Tapsell
* Fixes text jitter in QtQuick components when using the virtual keyboardGabriel de Dietrich2010-12-131-1/+1
| | | | | | | | | | | | | | | | QGraphicsView::mapFromScene() returns a QRect instead of a QRectF. Thus, we were prematurely rounding the micro focus rectangle coordinates in QGraphicsView::inputMethodQuery(). (The Qt::ImMicroFocus query returns a QRectF from QGraphicsScene, which is the result of querying QDeclarativeTextEdit and mapping it to the scene.) Auto-test included. Reviewed-by: leo Reviewed-by: bnilsen Task-number: QTCOMPONENTS-288 Task-number: QTBUG-16063
* Merge branch '4.7' of scm.dev.nokia.troll.no:qt/oslo-staging-2 into ↵Qt Continuous Integration System2010-12-091-2/+2
|\ | | | | | | | | | | | | | | | | | | 4.7-integration * '4.7' of scm.dev.nokia.troll.no:qt/oslo-staging-2: Try using pure scissor clip in GL 2 engine for rotations. Fixed DeviceCoordinateCache items when using QGraphicsScene::render(). Fixed missing text in GL 2 engine after recreating a context. Fix compilation of qnetworkreply test with namespaces.
| * Fixed DeviceCoordinateCache items when using QGraphicsScene::render().Samuel Rødal2010-12-091-2/+2
| | | | | | | | | | | | | | | | Since viewRect is null, we shouldn't try to use the partialCacheExposure path which intersects the viewRect with the device rect of the item. Task-number: QTBUG-15977 Reviewed-by: Bjørn Erik Nilsen
* | Merge branch '4.7' of scm.dev.nokia.troll.no:qt/qt-water-staging into ↵Qt Continuous Integration System2010-12-093-3/+8
|\ \ | |/ |/| | | | | | | | | | | | | | | | | | | | | | | 4.7-integration * '4.7' of scm.dev.nokia.troll.no:qt/qt-water-staging: Remove whitespace and leading tab from documentation change Updating merge request 2512 QGraphicsLayoutItem - fix invalidating sizehint-with-constraints cache Fix integer overflow in bitfield Fix documentation for QML extended types Removes the reseting of the QMenu offset. Adding warning to QMenu documentation Fix filtering of columns in QSFPM.
| * QGraphicsLayoutItem - fix invalidating sizehint-with-constraints cacheJohn Tapsell2010-12-032-2/+7
| | | | | | | | Reviewed-by: Jan-Arve Sæther
| * Fix integer overflow in bitfieldJan-Arve Sæther2010-12-031-1/+1
| | | | | | | | | | | | | | UnfeasibleConstraint is 4, and that does not fit in 2 bits. Spotted by Thiago Reviewed-by: Thiago
* | Don't emit activeFocusChanged() unless the active focus actually changedTor Arne Vestbø2010-12-072-9/+13
|/ | | | | | | | | | | | | | | | | | | | | | | We would previously call subFocusItemChanged(0) on the item as part of clearing the subfocus, even if the item in question would recieve a new subfocus item as part of setting the new subfocus. This resulted in the declarative item emitting activeFocusChanged(false) and then activeFocusChanged(true), which was affecting any animation or state bound to the activeFocus property of the item. We now stop clearing the subfocus when encountering an item that we know will get subfocus during the set-subfocus pass. We then set subfocus all the way to the root item, since the subfocus item itself might change. The effect of this is that the declarative item will only get one call to subFocusItemChanged(), passing the new subfocus item, instead of two. This means the declarative item can keep track of wherther ot not it had a subfocus item previously, and only emit activeFocusChanged() when the active focus goes from true to false or false to true. Task-number: QTBUG-15615 Reviewed-by: Yoann Lopes <yoann.lopes@nokia.com>
* Merge branch '4.7-upstream' into 4.7-waterThierry Bastian2010-11-191-1/+1
|\
| * Doc: Fixing typoSergio Ahumada2010-11-161-1/+1
| |
* | Improve performance of hfw in qgridlayoutengine by adding more caching.Jan-Arve Sæther2010-11-192-11/+26
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The previous code tried to do caching of queries with constraints too, but it's usecase was rather limited. The caching worked for the simple case of effectiveSizeHint(Qt::PreferredSize, QSize(10, -1)); effectiveSizeHint(Qt::PreferredSize, QSize(10, -1)); // uses cache The problem was that if somebody called this sequence: effectiveSizeHint(Qt::PreferredSize, QSize(10, -1)); effectiveSizeHint(Qt::PreferredSize, QSize(-1, -1)); effectiveSizeHint(Qt::PreferredSize, QSize(10, -1)); Each call would disregard the cache because the constraint was different. Now the pattern is used in the qgridlayoutengine itself when we calculate hfw: (yes, height-for-width). First, we ask for the horizontal size hints with no constraints. Then, we'll ask for the vertical size hints with constraints. Since horizontal and vertical ultimately comes from the same function (effectiveSizeHint) it will invalidate the cache each time. The solution is to add another cache for the sizeHints with constraints. The most notable improvement is in the hfw, nested case. Result: RESULT : tst_QGraphicsLinearLayout::heightForWidth():"hfw, nested": 546 msecs per iteration (total: 546, iterations: 1) RESULT : tst_QGraphicsLinearLayout::heightForWidth():"hfw, nested": 0.000029 msecs per iteration (total: 62, iterations: 2097152) Improvement: 18,827,586 times faster (!!)
* | Some improvements to the docs that was added in merge request 894Jan-Arve Sæther2010-11-151-1/+1
| |
* | Change the QGraphics*Layout documentation to match the code - that the ↵John Tapsell2010-11-152-2/+13
| | | | | | | | | | | | | | | | | | | | default alignment is top-left. This includes unit tests to confirm that the alignment is top-left in a variety of different cases. Merge-request: 894 Reviewed-by: Jan-Arve Sæther <jan-arve.saether@nokia.com>
* | Fix item alignment in layouts bigger than the items thay they containJohn Tapsell2010-11-152-37/+62
| | | | | | | | | | | | | | | | Task-number: QTBUG-13551 Task-number: QTBUG-7756 Merge-request: 894 Reviewed-by: Jan-Arve Sæther <jan-arve.saether@nokia.com>
* | Code style cleanup for merge request 847Jan-Arve Sæther2010-11-121-4/+4
| |
* | Merge branch 'fixes-to-merge-requests' into 4.7Jan-Arve Sæther2010-11-121-50/+45
|\ \ | |/ |/|
| * Fix a behaviour change of sizeHint() introduced by 6d4d265e7e67dde58Jan-Arve Sæther2010-11-111-50/+45
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Commit 6d4d265e7e67dde58e45d7d89f4974d0bd8b70e4 added a behaviour change in the cases if there was an item with height-for-width and sizeHint() was called with no constraint. The commit tried to return the height needed for the preferred width, but it still did not satisfy the constraints, since the width used as the constraint could be less than the preferred width. This also meant that the sizeHint(Qt::MinimumSize) could actually be larger than the smallest possible size. The behaviour should be that it should return the smallest width possible regardless of height. For instance, for a label it could return the size of the longest word (to avoid hyphenation issues). The same logic applies for the height: It should return the smallest height possible regardless of width. For instance, for a label it could then return the height of the font. I also had to fix some stuff in the heightForWidthWithSpanning() autotest since it wrongly expected the maximum size to be QWIDGETSIZE_MAX in several of the cases. However, that is the current behaviour (and it is a bug), but it is unrelated to the problem with spans so I simply fix the test and mark them with QEXPECT_FAIL. Reviewed-by: John Tapsell
* | Doc: Fixing typoSergio Ahumada2010-11-093-3/+3
|/
* Fixed many spelling errors.Rohan McGovern2010-10-251-2/+2
|
* Further focus scope fixes.Michael Brasser2010-10-191-7/+12
| | | | | | Follow-up to e11ee40cefc981fbdcfb10816039d4efb080fb17. Reviewed-by: Yoann Lopes
* Fixed QGraphicsItem to send ItemScenePositionHasChanged when appropriateJ-P Nurmi2010-10-181-1/+5
| | | | | | | Task-number: QTBUG-13473 Merge-request: 812 Reviewed-by: Alexis Menard <alexis.menard@nokia.com>
* Merge commit 'doc-team/4.7' into 4.7Morten Engvoldsen2010-10-141-0/+16
|\
| * Merge branch '4.7-upstream' into 4.7-docA-Team2010-10-132-7/+11
| |\
| * | Moved the property documentation to its proper location.Jerome Pasion2010-10-111-0/+16
| | | | | | | | | | | | | | | Task-number: QTBUG-14351 Reviewed-by: David Boddie
* | | Merge branch '4.7' of scm.dev.nokia.troll.no:qt/oslo-staging-2 into ↵Qt Continuous Integration System2010-10-134-37/+274
|\ \ \ | |_|/ |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 4.7-integration * '4.7' of scm.dev.nokia.troll.no:qt/oslo-staging-2: QGraphicsLayoutItem - user set sizes should always override, even if there's a constraint QGridLayoutEngine - Rework height-for-width support so that row/col spanning works Revert "Revert "Fix (implement!) hfw/wfh in QGridLayoutEngine"" Adjust the parent index for the itemsMoved call. Correctly handle both 16bit and 32bit live pixmaps in meego graphics system. Correctly remove the egl alpha surface flags in meego graphics system. Proper dither & proper alpha checking. In meego graphics system, use always 16bit textures. QCompleter: do not auto complete when directory is changed. tst_qcompleter: Add a test for QFileSystemModel
| * | QGraphicsLayoutItem - user set sizes should always override, even if there's ↵John Tapsell2010-10-132-10/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | a constraint Notes: * I have had to remove some of the old unit tests because the tested for strange behaviour. Now that height for width items behave more like normal items, it's no longer so easy to calculate what the geometries should be in strangely-sized layouts. * This also fixes alignment of height-for-width objects and adds a unit test for this. This couldn't be done in a seperate commit since the two fixes are related. Merge-request: 847 Reviewed-by: Olivier Goffart
| * | QGridLayoutEngine - Rework height-for-width support so that row/col spanning ↵John Tapsell2010-10-132-191/+122
| | | | | | | | | | | | | | | | | | | | | | | | works Task-number: QTBUG-13547 Reviewed-by: Olivier Goffart Merge-request: 847
| * | Revert "Revert "Fix (implement!) hfw/wfh in QGridLayoutEngine""Olivier Goffart2010-10-134-13/+318
| |/ | | | | | | | | | | | | | | This reverts commit 5bd6f7eb5c7d87c08539b6c2df416990cc417ec7. This is a revert of the revert. It is required apply the merge-request 847, which itself revert back part of this commit but fixing it the (hopefuly) right way
* | Don't give focus to a FocusScope that has had focus explicitly cleared.Michael Brasser2010-10-112-7/+11
|/ | | | | | | If focus was explicitly cleared on a non-visible FocusScope, and then it was made visible, it would incorrectly grab focus. Task-number: QTBUG-13380
* Doc: fix description of the expected behavior for QGraphicsItem::cursorPierre Rossi2010-10-061-1/+1
| | | | | | It was fixed for setCursor in 600ff0193c9bfac4d2b40960766002e8b81aca22. Reviewed-by: Alexis
* QGraphicsItem device coordinate cache unefficient in portrait modeBjørn Erik Nilsen2010-10-061-18/+58
| | | | | | | | | | | | | Problem was that we always invalidated the cache whenever the item was rotated. This is however not required for simple rotations such as 90, 180 and 270 degrees. This commit also removes the somewhat arbitrary logic which takes the desktop size into account. We now use the viewport size instead. Auto test included. Task-number: QT-3779 Reviewed-by: yoann
* Fix QTBUG-13730. QGraphicsScene::render clipping bug. Includes test case.Chris Meyer2010-10-041-1/+1
| | | | | Merge-request: 2480 Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>
* FocusOut even when QGraphicsItem gets hidden.Frederik Gladhorn2010-10-011-3/+5
| | | | | | | | If a parent QGraphicsItem becomes invisible, its child would not receive a focus out event. Review-by: Thierry Task-number: QTBUG-13916
* Merge branch '4.7' of scm.dev.nokia.troll.no:qt/oslo-staging-2 into ↵Qt Continuous Integration System2010-10-015-332/+30
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 4.7-integration * '4.7' of scm.dev.nokia.troll.no:qt/oslo-staging-2: (24 commits) Stabilize tst_QGraphicsWidget::QT_BUG_13865_doublePaintWhenAddingASubItem Fixed accessing freed memory in raster engine. Build fix for -qtnamespace. Fixed parsing of SVGs with absolute font sizes. Moving QPdf::stripSpecialCharacter to fontengine Revert "Fix (implement!) hfw/wfh in QGridLayoutEngine" Fixed a layout issue where you could get NaN as dimensions QTextCodec: Fix valgrind warning when using QTextCodec in destructions functions Fix double painting when adding an item into a linear layout Fixed antialiased rasterization bug in raster engine. Fixed potential crash when loading corrupt GIFs. Work around an ATI driver problem with mutli-sampled pbuffers. tst_qstatemachine.cpp: fix compilation with Sun Studio Fixed regression in clipping.qps autotest on 64-bit. Fixed crash when using Qt::WA_DeleteOnClose on a QPrintDialog on Mac. Fixed performance regression in curve stroking. Don't disable texture_from_pixmap on GLX/X11 by default. Avoid creating copy of an image in memory when storing as png Doc update for the support of MSVC 2010 64-bit fix documentation of drawText(int, int, int, int, ... ...
| * Revert "Fix (implement!) hfw/wfh in QGridLayoutEngine"Thierry Bastian2010-09-304-318/+13
| | | | | | | | | | | | | | | | | | | | | | This reverts commit 62b5ef3cc1306e46a4042b14867f2f92d9a110f3. The implementation of hfw from this patch is unfortunately not robust enough. It doesn't manage correctly the constraints on the layouts and the cell spans. It caused bad behaviour or regressions seen in tasks: QTBUG-13547, QTBUG-13067, QTBUG-13549, and more Reviewed-By: ogoffart
| * Fixed a layout issue where you could get NaN as dimensionsThierry Bastian2010-09-301-12/+11
| | | | | | | | | | | | | | | | The problem is that with empty layouts we could sometimes divide by 0. Note: This doesn't fix the whole task... Task-number: QTBUG-13547 Reviewed-by: ogoffart
| * Fix double painting when adding an item into a linear layoutThierry Bastian2010-09-291-2/+6
| | | | | | | | | | | | | | | | | | | | the problem was that the item is first painted at its default position, then moved by the layout and finally repainted. We now made sure the item is laid out before the first paint event occurs. Task-number: QTBUG-13865 Reviewed-by: bnilsen
* | Add sendParentChangeNotification to QGraphicsItemMarco Bubke2010-09-302-4/+16
|/ | | | | | | Fixes crash in creator. If flag is true notifications are sent. It is important that positioners work correctly and don't leak. Reviewed-By: Alexis Menard
* QPainter not restored correctly in Graphics View.Bjørn Erik Nilsen2010-09-222-1/+4
| | | | | | | | | World transform and opacity was sometimes not restored correctly after drawing items. Auto test included. Task-number: Discovered while working on QTBUG-12760
* Setting QGraphicsItem::ItemClipsChildrenToShape forces ItemClipsToShapeBjørn Erik Nilsen2010-09-221-45/+79
| | | | | | | | | | | | Problem was that setting ItemClipsChildrenToShape on an item resulted in item itself being clipped to its own shape (ItemClipsToShape). This commit also reduces state changes on the painter and re-uses the clip whenever possible, which in turn means better performance for items that clip children to shape. Auto test included. Task-number: QTBUG-12760
* Fixed compile warning on Windows.Kim Motoyoshi Kalland2010-09-201-1/+1
| | | | Reviewed-by: bnilsen
* Merge branch '4.7' of scm.dev.nokia.troll.no:qt/oslo-staging-2 into ↵Qt Continuous Integration System2010-09-172-30/+29
|\ | | | | | | | | | | | | | | | | | | | | | | | | 4.7-integration * '4.7' of scm.dev.nokia.troll.no:qt/oslo-staging-2: Export qt_directfb_.* functions in plugin as well Added autotest for QPixmap::size() with null pixmaps. Update Symbian def files. QGraphicsItem::childrenBoundingRect behavior breaks QGraphicsEffect::sourceBoundingRect(). Wrong bounding rect returned by QGraphicsEffect::boundingRect(). Compile on Mac Ensure building of WebKit and QtConcurrent are disabled with SunCC.
| * QGraphicsItem::childrenBoundingRect behavior breaks ↵Bjørn Erik Nilsen2010-09-162-12/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | QGraphicsEffect::sourceBoundingRect(). Context: QGraphicsEffect::sourceBoundingRect() returns: item->boundingRect() | item->childrenBoundingRect(); Problem was that item->childrenBoundingRect() adjusted the children's bounding rect with the children's ancestor effects (child -> root item), which means the source bounding rect was bigger than needed. We should only account for effects downwards in the hierarchy. root (has effect) | item (has effect) | child | grandChild Auto test included. Task-number: QT-3633, QT-3828 Reviewed-by: samuel
| * Wrong bounding rect returned by QGraphicsEffect::boundingRect().Bjørn Erik Nilsen2010-09-162-20/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Regression after: f5c5e20a Problem was that the cached bounding rect was never invalidated. We can also remove the cached bounding rect in QGraphicsEffectSource because QGraphicsItem::childrenBoundingRect now clips by default. This basically means partially reverting above commit and invalidate whenever ItemClipsChildrenToShape flag changes. Auto test included. Task-number: Discovered while investigating QT-3633 Reviewed-by: samuel
* | Merge branch '4.7-upstream' into 4.7-docA-Team2010-09-162-1/+10
|\ \ | |/