summaryrefslogtreecommitdiffstats
path: root/src/gui/graphicsview/qgraphicsview.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Update contact information in license headers.Sergio Ahumada2012-08-011-2/+2
| | | | | | | | | | | | | - 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>
* Update year in Nokia copyright messages.Jason McDonald2012-01-111-1/+1
| | | | | | | | | 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-211-1/+1
| | | | | | | | | 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
* Converting from double to qreal in guimread2011-10-101-8/+8
| | | | | | | | | | | | | | | | | | 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
* Update licenseheader text in source files for qt4.8Jyri Tahtela2011-05-131-17/+17
| | | | | | | Updated version of LGPL and FDL licenseheaders. Apply release phase licenseheaders for all source files. Reviewed-by: Trust Me
* Merge branch 4.7 into qt-master-from-4.7Qt Continuous Integration System2011-04-011-1/+1
|\
| * Fix width of TextInput micro focus rectangle.Andrew den Exter2011-03-301-1/+1
| | | | | | | | | | | | | | | | | | | | | | Remove the padding QLineControl::cursorRect() adds for region updates. QGraphicsView also grew the rectangle by returning the bounding rect of the transformed rectangle which is fixed by using the same transform for QRect as is used for QRectF. Change-Id: I8d8df9dbc6b4250e4e5392871191123a76b304a0 Task-number: QTBUG-18343 Reviewed-by: Martin Jones
* | Merge remote branch 'origin/4.7' into qt-master-from-4.7Olivier Goffart2011-01-171-1/+1
|\ \ | |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: examples/webkit/imageanalyzer/imageanalyzer.h examples/webkit/imageanalyzer/mainwindow.h mkspecs/unsupported/qws/linux-x86-openkode-g++/qplatformdefs.h src/corelib/io/qfsfileengine_iterator_unix.cpp src/corelib/io/qfsfileengine_iterator_win.cpp src/corelib/kernel/qcoreapplication.cpp src/network/access/qnetworkaccessdatabackend.cpp src/plugins/bearer/connman/qconnmanservice_linux.cpp src/plugins/platforms/openvglite/qwindowsurface_vglite.h src/s60installs/bwins/QtCoreu.def src/s60installs/eabi/QtCoreu.def src/s60installs/s60installs.pro tools/assistant/tools/assistant/helpviewer_qwv.h tools/qdoc3/test/qt-html-templates.qdocconf
| * Update copyright year to 2011.Jason McDonald2011-01-101-1/+1
| | | | | | | | Reviewed-by: Trust Me
* | Merge remote branch 'origin/4.7' into qt-master-from-4.7Olivier Goffart2010-12-201-1/+1
|\ \ | |/ | | | | | | | | | | | | | | | | Conflicts: demos/declarative/minehunt/minehunt.pro src/opengl/gl2paintengineex/qtextureglyphcache_gl.cpp src/plugins/phonon/mmf/mmf.pro src/s60installs/s60installs.pro tests/auto/qapplication/test/test.pro tests/auto/qgraphicsview/tst_qgraphicsview.cpp
| * 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
* | Change in QGraphicsView documentation.Yoann Lopes2010-11-151-4/+3
| | | | | | | | Reviewed-by: bnilsen
* | Make sure QGraphicsSceneHoverLeave event has non-null widget pointer.Denis Dzyubenko2010-10-191-0/+3
| | | | | | | | | | | | | | | | | | When constructing QGraphicsSceneHoverLeave event out of QEvent::Leave we should set the widget pointer to the graphicsview's viewport, th same as we do for other graphicsscene events like QGraphicsSceneMouseEvent. Reviewed-by: Yoann Lopes Reviewed-by: Bjørn Erik Nilsen
* | Merge remote branch 'origin/4.7' into qt-master-from-4.7Olivier Goffart2010-09-281-1/+2
|\ \ | |/ | | | | | | | | | | | | Conflicts: src/gui/painting/qrasterizer.cpp src/network/access/qnetworkaccessmanager.cpp tests/auto/qpainter/tst_qpainter.cpp tools/assistant/tools/assistant/mainwindow.cpp
| * QPainter not restored correctly in Graphics View.Bjørn Erik Nilsen2010-09-221-1/+2
| | | | | | | | | | | | | | | | | | World transform and opacity was sometimes not restored correctly after drawing items. Auto test included. Task-number: Discovered while working on QTBUG-12760
* | Merge remote branch 'origin/4.7' into qt-master-from-4.7Olivier Goffart2010-08-251-1/+3
|\ \ | |/ | | | | | | | | | | | | | | | | | | | | Conflicts: qmake/generators/win32/msbuild_objectmodel.cpp src/declarative/qml/qdeclarativexmlhttprequest.cpp src/opengl/opengl.pro src/opengl/qgl_p.h src/plugins/bearer/connman/qconnmanservice_linux.cpp tests/auto/qpainter/tst_qpainter.cpp tools/assistant/tools/assistant/helpviewer_qwv.h tools/assistant/tools/assistant/openpageswidget.h
| * QGraphicsView: fix few artefacts that can appear if the changed() signal is ↵Olivier Goffart2010-08-201-1/+3
| | | | | | | | | | | | connected. Reviewed-by: bnilsen
* | Merge remote branch 'origin/master'Olivier Goffart2010-06-151-0/+4
|\ \ | |/ | | | | | | Conflicts: src/gui/painting/qpainter.cpp
| * Add a new qconfig feature GESTURESTasuku Suzuki2010-06-021-0/+4
| | | | | | | | | | Merge-request: 535 Reviewed-by: Andreas Aardal Hanssen <andreas.aardal.hanssen@nokia.com>
* | Finally, remove some trailing whitespace.Andreas Aardal Hanssen2010-06-141-1/+1
|/ | | | Reviewed-by: Alexis Menard <alexis.menard@nokia.com>
* doc: Fixed many broken links.Martin Smith2010-05-201-1/+1
|
* Gestures in GraphicsView do not require a viewport to subscribe to gestures.Denis Dzyubenko2010-05-181-0/+5
| | | | | | | | | When a graphicsitem subscribes to a gesture the viewport is implicitly subscribed to it as well. Task-number: QTBUG-9849 Reviewed-by: Olivier Goffart Reviewed-by: Mikko Harju
* Merge branch '4.7' of scm.dev.nokia.troll.no:qt/oslo-staging-2 into ↵Qt Continuous Integration System2010-05-131-10/+66
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 4.7-integration * '4.7' of scm.dev.nokia.troll.no:qt/oslo-staging-2: (35 commits) Avoid running animation when loopCount == 0 Set the pictures for the examples of multitouch Compile fix on Windows. Remove an unnecessary assert. Documentation for the Pad Navigator Example. New Pad Nagivator example implementation. Skip definition of wintab functions in case of QT_NO_TABLETEVENT. Made curve tesselation be dynamically adjusted based on transform. Modified QPainter and QPixmap benchmarks to use raster pixmaps. Stabilize tst_QWidgetAction::visibilityUpdate Fix compiler warning in QT_REQUIRE_VERSION Stabilize tst_QColumnView::parentCurrentIndex Really fix tst_QDockWidget::taskQTBUG_9758_undockedGeometry on Linux Fix typos in Elastic Nodes example documentation. Made paint engine texture drawing work in GL ES 2 and updated docs. Opt out of visual-config size checks with extension Fix off-by-one in text layouts and widget size hints on Mac Stabilize tst_QDockWidget::taskQTBUG_9758_undockedGeometry Mark QFileDialog::Options as a Q_FLAGS fix tst_QDockWidget::taskQTBUG_9758_undockedGeometry on Linux ...
| * Performance issue with QGraphicsItem::ItemClipsChildrenToShape.Bjørn Erik Nilsen2010-05-051-2/+57
| | | | | | | | | | | | | | | | | | | | | | | | | | If the child rect is bigger than the parent rect and parent has the ItemClipsChildrenToShape flag set, then by updating the child, the whole child rect is marked as dirty, resulting in a much larger update area than required. This has a major impact on performance in Orbit/HB, where e.g. item-views typically consist of a container item that clips its children/items to shape. See attached video in QTBUG-9024. Auto test included. Task-number: QTBUG-9024
| * Pack Graphics View booleans in quint32 bit fields.Bjørn Erik Nilsen2010-05-051-8/+9
| | | | | | | | | | | | | | Reduces the memory footprint of a typical GV application by 27 * sizeof(bool). Nothing revolutionary, but you know, every byte counts :-) Reviewed-by: Jan-Arve
* | Don't use Q_UNUSED if you use parameters.Alexis Menard2010-05-111-2/+0
|/ | | | | | | That's many "use" in the sentence. Task-number:QT-1652 Reviewed-by:TrustMe
* QGraphicsView drawing artifacts due to rounding errors.Bjørn Erik Nilsen2010-05-031-39/+37
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Found during investigation of QTBUG-8820, and clearly visible in examples/graphicsview/diagramscene when slowly moving an item out of the viewport (left and top edge). Caused by two problems: 1) Using QRectF::toRect() instead of QRectF::toAlignedRect(). 2) Didn't adjust the item's bounding rect properly in drawSubtree(). QRectF::toRect() is completely useless since all the coordinates are rounded to the nearest integer. E.g. QRectF(-0.4, -0.4, 10.4, 10.4).toRect() -> QRect(0, 0, 10, 10), whereas toAlignedRect() returns QRect(-1, -1, 11, 11). Then when we have a proper aligned rect, we have to adjust it by 2 pixels in all directions (or 1 pixel in case of QGraphicsView::DontAdjustForAntialiasing). At first glance this adjustment seems too much, since one would assume adjusing the QRectF by 0.5 before using toAlignedRect() would be sufficient. That's sufficient in an untransformed world with pens using BevelJoin. However, the story is completely different as soon as the world is transformed or the pens use a different join. It's basically complicated (in some cases impossible) to calculate a pixel perfect aligned QRect, so instead we adjust by the amount of pixels required in the worst case. This commit also includes some optimizations for QRegion updates (since I anyways had to change the code). There's no point in using QRegion granularity if the viewport update mode is either FullViewportUpdate or BoundingRectViewportUpdate. Auto tests adjusted and new ones included. Task-number: QTBUG-10338
* Fix QDeclarativeTextInput and QGraphicsView in regards of input methods hints.Alexis Menard2010-04-271-2/+20
| | | | | | | | | | | | | | | | | | When the echoMode changes for QDeclarativeTextInput we need to update the inputmethod hints. Also in QGraphicsView we need to update the input context installed on the view to make the former is aware of the change. For the input context framework the only way to deal with the current widget is focusWidget(). Unfortunately the widget that has the focus is the QGraphicsView so the input context don't know the real object QGraphicsView is actually focusing. We must keep in sync the inputMethodHints of QGV with the object QGraphicsView is focusing so the input context just called focusWidget()->inputMethodhints() to update itself. Task-number:QTBUG-9922 Reviewed-by:janarve Reviewed-by:bnilsen Reviewed-by:Michael Brasser
* Fixes wrong QGraphicsView's viewport cursor reset.Yoann Lopes2010-04-211-5/+7
| | | | | | | | The cursor was reset even when it had not been previously saved. Autotest included. Task-number: QTBUG-7438 Reviewed-by: bnilsen
* Fixes wrong composition mode for cached backgrounds in Graphics View.Bjørn Erik Nilsen2010-03-031-6/+0
| | | | | | | | | | | This change partially reverts commit a589005f and therefore fully reverts 68be6457. We cannot assume that only opaque pixels are painted in drawBackground(). Regression against 4.5. Auto-test included. Task-number: QTBUG-8168 Reviewed-by: trond
* GV: Update issues if drawItems() is overridden and IndirectPainting is used.Bjørn Erik Nilsen2010-02-241-2/+25
| | | | | | | | | | | | | Problem was that the cached view bounding rect was never updated when overriding QGraphicsScene::drawItems or QGraphicsView::drawItems, without calling the base class implementation. The same for 'updateAll' boolean. We also have to make sure there are no unpolished items before we draw. Regression against 4.5. Auto-test included. Task-number: QTBUG-7880 Reviewed-by: yoann
* Doc fix, ensure that the \obsolete tag is placed correctlyAndy Shaw2010-02-171-1/+3
| | | | | | | If its not placed in the right place then it will cause the doc to lose the line that \obsolete is on Reviewed-by: TrustMe
* Cleanup after "QGraphicsWidget is painted twice on the first show"Bjørn Erik Nilsen2010-02-041-1/+0
| | | | | | | | Commit: dda8a57c085216db609f822837c50bae38006b4e We don't want to reset 'updateAll' at that point, for the same reason as mentioned in the above commit. More details in the task. Task-number: QTBUG-6956
* Merge branch '4.6' of scm.dev.nokia.troll.no:qt/oslo-staging-1 into ↵Qt Continuous Integration System2010-01-071-1/+1
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 4.6-integration * '4.6' of scm.dev.nokia.troll.no:qt/oslo-staging-1: QIODevice: Fix readAll() Temporary hackiesh solution to prevent BOM in the xml data. Fixed qxmlstream autotest when using shadow builds. Attempt at readding the capital P headers for Phonon Remove special Phonon processing from syncqt. Use the lowercase/shortname.h headers for Phonon includes Fixes a crash when setting focus on a widget with a focus proxy. Update copyright year to 2010 doc: Clarified activeSubControls and subControls. Remove warning "statement with no effect" doc: Clarified that .lnk files are System files on Windows.
| * Update copyright year to 2010Jason McDonald2010-01-061-1/+1
| | | | | | | | Reviewed-by: Trust Me
* | Document the QGraphicsView::IndirectPainting flagOlivier Goffart2010-01-061-1/+7
| | | | | | | | | | | | And that the QGraphics{View,Scene}::drawItems function are now obsolete. Reviewed-by: Alexis
* | Fixes painting artifacts when using CacheBackground in a QGraphicsView.Yoann Lopes2009-12-301-1/+2
|/ | | | | | | | | | The problem was that when the background cache was invalidated, it was entirely recreated but only the exposed area of the view was repainted in it, causing the cache to be partly empty in some cases. Now the background cache is always fully repainted when it is invalidated. Task-number: QTBUG-6935 Reviewed-by: ogoffart
* Fixes bug when using AnchorUnderMouse for GraphicsView transformation.Yoann Lopes2009-12-181-3/+16
| | | | | | | | | | | We now automatically enable mouse tracking on the viewport of the GraphicsView when setting AnchorUnderMouse as transformationAnchor or resizeAnchor. Autotest included. Task-number: QTBUG-6835 Reviewed-by: bnilsen
* Fix redraw bugs when using graphics effects in device coordinate mode.Samuel Rødal2009-12-101-0/+26
| | | | | | | | | | QGraphicsEffect::boundingRectFor() needs the source bounding rect in device coordinates. This patch fixes the documentation to reflect this, and fixes some internal usage of boundingRectFor() to ensure it always gets the device rect of the source. Task-number: QTBUG-5918 Reviewed-by: Bjørn Erik Nilsen
* Fix tst_QGraphicsView::inputMethodSensitivity autotestOlivier Goffart2009-11-171-0/+2
| | | | | | | | | The problem was that the scene was not notified it lost the focus when it was disconnected from the view (with setScene) So when it got back the focus, nothing was updated because the scene thought it still had the focus. Reviewed-by: jasplin
* Revert "Always set a clip on the painter in QGraphicsView."Andreas Aardal Hanssen2009-11-111-3/+0
| | | | | | | | | This reverts commit 4bf7f90a27377f439e86d6175e5e3cdebd131be0. The change is already reverted in kinetic-declarativeui. Reviewed-by: Warwick Allison Reviewed-by: bnilsen
* Merge branch '4.6-api-review' into 4.6Marius Storm-Olsen2009-11-091-1/+1
|\
| * API review: Rename numRects() -> rectCount()Marius Storm-Olsen2009-11-091-1/+1
| | | | | | | | | | | | | | QRegion::numRects() is marked obsolete. Removed all usage of the old function inside Qt and test-cases. Reviewed-by: Andreas Aardal Hanssen
* | Fix QGraphicsScene::isActive if the view is shown while the window is active.Olivier Goffart2009-11-061-0/+23
| | | | | | | | | | | | | | | | | | | | | | We need to make sure the active state is preserved if graphicsview are dinamically shown/hide while window is active. Or if scene is changed with setScene. This fixes KRunner focus regressions Reviewed-by: Andreas Task-number: QTBUG-5281
* | Always set a clip on the painter in QGraphicsView.Andreas Aardal Hanssen2009-11-051-0/+3
|/ | | | | | | | | | | | | | | | | | | | This allows items to check painter->clipRegion() to find out what the imposed clip is, in order to cull elements that don't need to be painted. This is an alternative approach to getting the same information from QStyleOptionGraphicsItem::exposedRect. It's better because it's a pull operation, but it's slightly worse because it doesn't include the complete system clip, and because QRegion has integer resolution only (whereas QGraphicsItem's coordinate uses qreal. A better approach may be to access QPainter's combined clip region; this option is open for future versions of Qt. Original patch by Warwick (which is why he's on reviewed-by), but the patch was modified to operate in device instead of logical coordinates. Reviewed-by: jasplin Reviewed-by: Warwick Allison
* Merge branch '4.6' of git@scm.dev.nokia.troll.no:qt/qt into 4.6Gunnar Sletta2009-11-031-0/+8
|\
| * Merge branch 'fixes' of ↵Jan-Arve Sæther2009-10-281-0/+13
| |\ | | | | | | | | | | | | | | | | | | | | | git://gitorious.org/~fleury/qt/fleury-openbossa-clone into openbossa-fleury-fixes3 Conflicts: src/gui/graphicsview/qgraphicsanchorlayout_p.cpp src/gui/graphicsview/qgraphicsanchorlayout_p.h
| * | Wrong worldTransform() on the painter in QGraphicsScene::drawForeground.Bjørn Erik Nilsen2009-10-231-0/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The painter's worldTransform() is updated for each item we draw, and when the DontSavePainterState optimization flag is set, this change is not protected by save() and restore(). After all the items are drawn, it means the painter is left with the last drawn item's transform. We therefore have to make sure it is reset back to whatever it was before the items were drawn. Auto-test included. Task-number: QTBUG-4973 Reviewed-by: alexis Reviewed-by: andreas
* | | Removed usage of CompositionMode_Source in QGraphicsView for X11.Trond Kjernåsen2009-11-031-1/+7
| |/ |/| | | | | | | | | | | | | | | | | Due to the rendering model in XRender ((src IN mask) OP dest) we can't support the PorterDuff composition modes natively under X11. They just behave differently than what we've defined them to do in QPainter, and there is no apparent workaround. Task-number: QTBUG-4829 Reviewed-by: Gunnar
* | Improved gesture event filtering inside QGraphicsView for QGraphicObjectsDenis Dzyubenko2009-10-221-0/+13
|/ | | | Reviewed-by: trustme