summaryrefslogtreecommitdiffstats
path: root/src/gui/graphicsview
Commit message (Collapse)AuthorAgeFilesLines
* Fix QT_NO_GRAPHICSEFFECTJørgen Lind2009-11-065-2/+33
| | | | Reviewed-by: paul
* Merge branch '4.6' of git@scm.dev.nokia.troll.no:qt/qt-doc-team into 4.6David Boddie2009-11-041-0/+3
|\ | | | | | | | | | | Conflicts: src/gui/kernel/qevent.cpp src/gui/kernel/qgesture.cpp
| * Doc: Fixed qdoc warnings.David Boddie2009-11-041-0/+3
| | | | | | | | Reviewed-by: Trust Me
* | Merge commit '51c9b68' into 4.6Morten Johan Sørvig2009-11-045-13/+125
|\ \ | | | | | | | | | | | | | | | Conflicts: dist/changes-4.6.0 src/gui/kernel/qevent.h
| * | Gesture api review.Denis Dzyubenko2009-11-034-14/+12
| | | | | | | | | | | | | | | | | | Changes to the gesture api after the review. Reviewed-by: Jasmin Blanchette
| * | Modified gesture events propagation.Denis Dzyubenko2009-11-031-2/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | By default if the gesture is ignored, only gestures in the started state are propagated, and accepting a gesture in the started state adds an implicit grab meaning all the following events in the gesture sequence will be delivered to that widget. This is similar to the way QTouchEvent is propagated. Also added a hint, which specifies if gestures in any state can be propagated to the widget which has enabled the hint. Reviewed-by: Thomas Zander
| * | Added QGraphicsObject::ungrabGesture()Denis Dzyubenko2009-11-032-2/+16
| | | | | | | | | | | | | | | | | | | | | Oops, apparently we forgot to add a function for unsubscribing a graphics object from a gesture. Fixing it now. Reviewed-by: trustme
| * | Make GestureCancelPolicy work for graphicsviewThomas Zander2009-10-302-0/+91
| | | | | | | | | | | | Reviewed-By: Denis
* | | Merge branch '4.6' of git@scm.dev.nokia.troll.no:qt/qt into 4.6Gunnar Sletta2009-11-0316-236/+529
|\ \ \ | | |/ | |/|
| * | Merge commit 'origin/4.6' into featureJørgen Lind2009-11-0213-239/+546
| |\ \
| | * | Track declarative changesWarwick Allison2009-11-021-1/+1
| | | |
| | * | Merge commit 'widget/4.6' into origin/4.6Olivier Goffart2009-10-3012-230/+512
| | |\ \ | | | |/ | | |/| | | | | | | | | Conflicts: src/gui/effects/qgraphicseffect.cpp
| | | * Merge branch 'fixes' of git://gitorious.org/~cmarcelo/qt/cmarcelos-clone ↵Jan-Arve Sæther2009-10-292-13/+8
| | | |\ | | | | | | | | | | | | | | | into cmarcelo-fixes
| | | | * QGAL: set the orientation bit for complex anchorsCaio Marcelo de Oliveira Filho2009-10-282-13/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Sets the orientation bit for complex anchors. This is being done in the constructor, and I did a minor refactor to make the constructor of SequentialAnchor take the list of vertices and anchors that it is simplifying. Before that we set one of those directly in the structure and the other via a setter function. The tests were passing because right now, complex anchors do not use the orientation bit, while some Normal anchors use in the refreshSizeHints() function (to get either the width() or height() of an item). Signed-off-by: Caio Marcelo de Oliveira Filho <caio.oliveira@openbossa.org>
| | | * | Merge commit origin/4.6 into team-widgets/4.6Olivier Goffart2009-10-294-9/+29
| | | |\ \
| | | * | | Compile on 64bitOlivier Goffart2009-10-281-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | Reviewed-by: Jan-Arve
| | | * | | Fix initial focus bug in ItemIsFocusScope.Andreas Aardal Hanssen2009-10-281-7/+32
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The task provides an example that doesn't gain input focus when started. The fix contains two parts: one is to allow items with focus scope ancestors to become focus items even if the scope is inactive. The other is to fix up the focusItem pointers on reparent. Before, the focus scopes' focusItem pointers always pointed to itself, or the next scope. Now these items are treated no differently than other items in that respect. The change has a performance impact when reparenting a large subtree that has a sub focus item onto another item (one more dig). Task-number: QT-2331 Reviewed-by: Alexis Menard
| | | * | | Merge branch '4.6' of scm.dev.nokia.troll.no:qt/qt-widget-team into 4.6Jan-Arve Sæther2009-10-281-0/+2
| | | |\ \ \
| | | | * | | Let QGraphicsItem set QObjectPrivate::wasDeleted when appropriate.Andreas Aardal Hanssen2009-10-281-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This change allows children of QGraphicsObject-derived classes to check if the parent is being deleted by checking the private flag wasDeleted. Reverts 37b16d5cbb4e7bc534f690ebf50434d228b5ecfc, p4 change 9681, to allow QGraphicsItem to set QObjectPrivate's wasDeleted member before entering QObjectPrivate's destructor. The original code was in there to let the user know, via the console output, that QObject was double-deleted (e.g., when placing QObject on the stack, and also giving it a parent, so that if the parent is deleted first, bang). Reviewed-by: Aaron Kennedy Reviewed-by: Bradley T. Hughes
| | | * | | | Merge branch 'fixes' of ↵Jan-Arve Sæther2009-10-2812-215/+756
| | | |\ \ \ \ | | | | |/ / / | | | |/| | / | | | | | |/ | | | | |/| | | | | | | | | | | | | | | | | | | 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
| | | | * | QGAL (QSimplex): Add constraints simplificationEduardo M. Fleury2009-10-262-4/+99
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Now the simplex solver is able to remove fixed variables from its constraints as to improve its running time. The simplification consists of two actions that are done iteratively until no possible changes exist: 1st) Look for constraints of type Var == Constant Save constant as the trivial value of Var 2nd) Substitute known results in existing constraints Signed-off-by: Eduardo M. Fleury <eduardo.fleury@openbossa.org> Reviewed-by: Caio Marcelo de Oliveira Filho <caio.oliveira@openbossa.org>
| | | | * | QGAL (QSimplex): Make deep copy of constraints inside QSimplexEduardo M. Fleury2009-10-263-12/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The idea is to allow QSimplex solver to modify the constraints without breaking other parts of the code that rely on the original ones. Signed-off-by: Eduardo M. Fleury <eduardo.fleury@openbossa.org> Reviewed-by: Caio Marcelo de Oliveira Filho <caio.oliveira@openbossa.org>
| | | | * | QGAL: Add QSimplexConstraint::toString() method for debuggingEduardo M. Fleury2009-10-261-0/+23
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Signed-off-by: Eduardo M. Fleury <eduardo.fleury@openbossa.org> Reviewed-by: Caio Marcelo de Oliveira Filho <caio.oliveira@openbossa.org>
| | | | * | QGAL: Use constraints of type "equal" for fixed itemsEduardo M. Fleury2009-10-261-12/+22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We usually create two restrictions for each item, one to tell its size should be more than its minimum size and other enforcing it to be at most its maximum size. Now, for items that have fixed size, ie. minSize == maxSize, we create a single constraint telling its size should be equal its min/maxSize. The immediate advantage is to have one less constraint for each of these items. The indirect advantage is that the simplex solver can take advantage of such information. Signed-off-by: Eduardo M. Fleury <eduardo.fleury@openbossa.org> Reviewed-by: Caio Marcelo de Oliveira Filho <caio.oliveira@openbossa.org>
| | | | * | QGAL: clarify the usage of isLayoutAnchor bitCaio Marcelo de Oliveira Filho2009-10-262-11/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The 'isLayoutAnchor' is necessary only as a way to flag Layout internal anchors, i.e. anchors with the Layout as 'item' in the AnchorData structure. We don't need to propagate this bit when composing anchors. Signed-off-by: Caio Marcelo de Oliveira Filho <caio.oliveira@openbossa.org> Reviewed-by: Eduardo M. Fleury <eduardo.fleury@openbossa.org>
| | | | * | QGAL: add orientation bit to the anchorCaio Marcelo de Oliveira Filho2009-10-262-9/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Use a free bit in the anchor struct to save the orientation information. That way we do not depend on looking for this information in the vertices (by looking the orientation of its edge). Signed-off-by: Caio Marcelo de Oliveira Filho <caio.oliveira@openbossa.org> Reviewed-by: Eduardo M. Fleury <eduardo.fleury@openbossa.org>
| | | | * | QGAL: simplification doesn't depend on vertex anchor point informationCaio Marcelo de Oliveira Filho2009-10-261-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Look for information inside the anchor instead of on the vertices. This will give us flexibility of simplifying vertices before the anchor simplification phase. Signed-off-by: Caio Marcelo de Oliveira Filho <caio.oliveira@openbossa.org> Reviewed-by: Eduardo M. Fleury <eduardo.fleury@openbossa.org>
| | | | * | QGAL: store item and center-ness information in the anchorCaio Marcelo de Oliveira Filho2009-10-262-14/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We used to look for this information in the anchor's from and to vertices, but to enable simplification of vertices, we have to store this information in the anchor. Signed-off-by: Caio Marcelo de Oliveira Filho <caio.oliveira@openbossa.org> Reviewed-by: Eduardo M. Fleury <eduardo.fleury@openbossa.org>
| | | | * | QGAL: identify unfeasible setups even when graph is simplifiedCaio Marcelo de Oliveira Filho2009-10-262-34/+71
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The calculate graphs now can return early due to unfeasible anchor setups found out during simplification. This allows finding out problems in parallel anchors, when one anchor has maximum size smaller than the minimum size of the other anchor. The order for simplification and refreshing size hints also has been swaped: - First, refresh size hints for all anchors in the graph. If the graph is simplified, the refreshSizeHints() call will reach the children anchors. - Then, if the simplificated graph is invalid, rebuild it. During this rebuild, refreshSizeHints_helper() will be called for all levels. So in both situations we can identify an unfeasible setup. Note that this test alone is not enough to classify the graph as feasible, depending on the graph, it will still need to go through the Simplex. A test case was added and the function that traverse the graph refreshing now is called refreshAllSizeHints(). The old name was not so clear since the function will not fill only the anchors that have items associated. Last but not least, the lastCalculationUsedSimplex variable is cleared when starting calculateGraphs(), since we now can leave the function earlier, without reaching calculateTrunk(), which is the function that sets it. Signed-off-by: Caio Marcelo de Oliveira Filho <caio.oliveira@openbossa.org> Reviewed-by: Eduardo M. Fleury <eduardo.fleury@openbossa.org>
| | | | * | QGAL: separate parallel anchor creation from sequence creationCaio Marcelo de Oliveira Filho2009-10-261-29/+61
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Extract the creation of parallel anchors from the creation of sequential anchor. This will be useful to keep track whether a parallel anchor is feasible or not. Signed-off-by: Caio Marcelo de Oliveira Filho <caio.oliveira@openbossa.org> Reviewed-by: Eduardo M. Fleury <eduardo.fleury@openbossa.org>
| | | | * | QGAL: complex anchors can indicate errors when refreshing sizehintCaio Marcelo de Oliveira Filho2009-10-262-22/+31
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Now the refreshSizeHints() returns a boolean, and the parallel anchor will return false in unfeasible cases, e.g. one anchor has maximum size smaller than other minimum size. Signed-off-by: Caio Marcelo de Oliveira Filho <caio.oliveira@openbossa.org> Reviewed-by: Eduardo M. Fleury <eduardo.fleury@openbossa.org>
| | | * | | CompileOlivier Goffart2009-10-271-0/+1
| | | | | |
| | | * | | Respect the per-item layoutSpacing() if the style uses that feature.Jan-Arve Sæther2009-10-275-69/+109
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We move the QLayoutStyleInfo class out of the gridlayout engine to a common header file so that anchor layout also can utilize it. Due to that we now can have a per-item spacing we have to change the 'effectiveSpacing' argument of refreshSizeHints to just take a QLayoutStyleInfo pointer that we will later query for the actual spacing used.
| | | * | | If a QGraphicsWidget gets a StyleChange event, invalidate its layout.Jan-Arve Sæther2009-10-271-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The layout should be invalidated because all layouts are dependent on some style-specific defaults. (e.g. PM_LayoutHorizontalSpacing can differ.) Reviewed-by: alexis
| | | * | | Fix buglet in QGraphicsItem::stackBefore().Andreas Aardal Hanssen2009-10-261-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Reported by Alan. The stackBefore() implementation did not alter the insertion order if the two items' current Z values were different. The fix is to ensure it is updated, so that the stackBefore() operation takes effect should the Z values become equal in the future. Example: Current order: A-B-C-D A->setZValue(1); Current order: B-C-D-A (A moves to the end) D->stackBefore(A); Current order: B-C-D-A (unchanged, D is already before A) A->setZValue(0); Current order: D-A-B-C (now A moves back, and D moves in front) Reviewed-by: Aaron Kennedy
| | | * | | 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
| | | * | | QGraphicsLineItem leave traces when moving around (reg. against 4.5)Bjørn Erik Nilsen2009-10-231-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The problem was that QGraphicsLineItem's bounding rect is an empty rect (either width is 0 or height is 0), and when updating the item's old occupied area, we explicitly checked whether the rect was empty() or not. In case of being empty (rect.isEmpty()) we did nothing, which was the root of the problem. We can safely remove the rect.isEmpty() check without any significant loss of performance since the common case is that the rect is non-empty. And in the case of being empty, we'll bail out from QGraphicsViewPrivate::updateRect's highly optimized rect intersection. Auto test included. Task: QTBUG-4877 Reviewed-by: alexis
| | | * | | Fix crash in QGraphicsView BSP discovered in Amarok.Alexis Menard2009-10-221-6/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Basically some items were not properly remove in the BSP which means that if you delete one of items, the BSP tree may contain dangling pointers. The problem was in removeItemHelper in QGraphicsScene were the child were removed after reparenting to 0 the topmost parent. The sceneBoundingRect for children was invalid which means that we were removing them in the wrong position inside the BSP. Reparenting to 0 means that the sceneBoundingRect will be the boundingRect but wasn't the case before (for the topmost parent). Reviewed-by:bnilsen
| | | * | | Warning --Alexis Menard2009-10-221-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | Reviewed-by:TrustMe
| * | | | | Fix SCROLLAREA by fixing missing QT_NO_GRAPHICSVIEW dependenciesJørgen Lind2009-10-296-5/+12
| | | | | | | | | | | | | | | | | | | | | | | | Reviewed-by: tom
| * | | | | Fix LIBRARY and ICONJørgen Lind2009-10-292-0/+4
| | |_|_|/ | |/| | | | | | | | | | | | | | | | | | | | | | | However, compiling with QT_NO_ICON will still not work :( Reviewed-by: tom
* | | | | 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
* | | | Added some optimizations to the blur and drop shadow GL filters.Samuel Rødal2009-10-291-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Use ExpandToTransparentBorderPadMode since we can use GL_CLAMP_TO_EDGE to clamp to the texture. * Shrink the bounding rects reported by the blur and drop shadow filters (expanding by 2 * radius isn't needed). * Use a single-pass blur for radii <= 3 to avoid the overhead of rendering to an FBO. * Made the fast blur setting generate filters for only a predefined set of radii, and then use the actual blur radius to spread the sample points outwards. * Optimized the generated program to rely less on temporary variables, as those seemed to not be handled very well by certain GLSL compilers. Reviewed-by: Gunnar Sletta
* | | | Merge branch '4.6' of git@scm.dev.nokia.troll.no:qt/qt into 4.6Gunnar Sletta2009-10-284-8/+9
|\ \ \ \ | |/ / /
| * | | qdoc: Update QGraphicsTransform docs after changes to QGraphicsRotationRhys Weatherley2009-10-281-0/+3
| | | | | | | | | | | | | | | | Reviewed-by: Michael Brasser
| * | | Doc: Fixed qdoc warning.David Boddie2009-10-271-1/+1
| | | | | | | | | | | | | | | | Reviewed-by: Trust Me
| * | | Merge branch '4.6' of git@scm.dev.nokia.troll.no:qt/qt into 4.6axis2009-10-274-56/+93
| |\ \ \
| * \ \ \ Merge branch '4.6' of git@scm.dev.nokia.troll.no:qt/qt into 4.6axis2009-10-236-10/+326
| |\ \ \ \
| * \ \ \ \ Merge branch '4.6' of git@scm.dev.nokia.troll.no:qt/qt into 4.6Shane Kearns2009-10-227-80/+104
| |\ \ \ \ \ | | | |_|/ / | | |/| | |
| * | | | | QtGui release/debug binary compatibilityShane Kearns2009-10-222-7/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | QtGui had some debug functions only exported in the debug build. Now these are exported in release mode as well, but as stubs (i.e. no debug output is generated). Reviewed-by: Thiago Macieira