summaryrefslogtreecommitdiffstats
path: root/src/gui/graphicsview
Commit message (Collapse)AuthorAgeFilesLines
* Fixed broken scrolling of cached graphics items on X11.Samuel Rødal2009-09-181-41/+1
| | | | | | | | | | | The scrolling was broken in other graphics systems than the native, since _q_scrollPixmap assumed that all QPixmaps were using the X11 backend. We can just use QPixmap::scroll instead, which should also make it faster with the raster paint engine than creating a temporary painter and doing a blit. Also, _q_scrollPixmap would do blending instead of blitting for non-opaque pixmaps. Reviewed-by: Olivier Goffart
* Don't loose precision by converting the sizes (qreals) to ints.Jan-Arve Sæther2009-09-181-16/+12
| | | | Reviewed-by: leo
* Call effectiveSizeHint(Qt::MinimumSize).width instead of minimumWidth()Jan-Arve Sæther2009-09-181-48/+40
| | | | | | Small refactoring, since the two code blocks were almost the same. Reviewed-by: leo
* QGraphicsAnchorLayout: Initial support for Size PolicyAnselmo Lacerda S. de Melo2009-09-182-5/+39
| | | | | | | | | | | | | In this commit we introduce initial support for Size Policy. The size policies supported now are: * QSizePolicy::Fixed * QSizePolicy::Minimum * QSizePolicy::Maximum * QSizePolicy::Preferred * QSizePolicy::Ignored Signed-off-by: Anselmo Lacerda S. de Melo <anselmo.melo@openbossa.org>
* Implement hasConflicts().Jan-Arve Sæther2009-09-176-95/+133
|
* QGraphicsAnchorLayout: Remove QGALPrivate::deleteAnchorData()Eduardo M. Fleury2009-09-172-13/+1
| | | | | | | | | | | | This method, formerly called by the QGraphicsAnchor destructor, to remove the anchor associated to it, is no longer needed. That destructor now calls QGALPrivate::removeAnchor(), a method analagous to addAnchor(), that provides the high level feature of "anchor removal". Signed-off-by: Eduardo M. Fleury <eduardo.fleury@openbossa.org> Reviewed-by: Jesus Sanchez-Palencia <jesus.palencia@openbossa.org>
* QGraphicsAnchorLayoutPrivate: Removing item from layout when there are no ↵Jesus Sanchez-Palencia2009-09-172-0/+77
| | | | | | | | | | more anchors Now the removeAnchor() method has returned and it is ready for being use in the API for ensure that items are removed from the layout when they have no more external anchors. Signed-off-by: Jesus Sanchez-Palencia <jesus.palencia@openbossa.org> Reviewed-by: Eduardo M. Fleury <eduardo.fleury@openbossa.org>
* QGraphicsAnchorLayoutPrivate: Removing method removeAnchor()Jesus Sanchez-Palencia2009-09-172-22/+12
| | | | | | | | All method calls were replaced by calling removeAnchor_helper(), with internalVertex() calls Signed-off-by: Jesus Sanchez-Palencia <jesus.palencia@openbossa.org> Reviewed-by: Eduardo M. Fleury <eduardo.fleury@openbossa.org>
* QGraphicsAnchorLayout: Removing methods names inconsistencies on private classJesus Sanchez-Palencia2009-09-173-19/+19
| | | | | | | | | QGraphicsAnchorLayoutPrivate now has addAnchor() replacing anchor() and addAnchor_helper() replacing addAnchor(). With this changes we are respecting the API behavior, where anchor() is a "getter" instead of a "setter". Signed-off-by: Jesus Sanchez-Palencia <jesus.palencia@openbossa.org> Reviewed-by: Eduardo M. Fleury <eduardo.fleury@openbossa.org>
* QGraphicsAnchorLayout: Handle negative spacing in "setAnchorSpacing"Eduardo M. Fleury2009-09-171-2/+25
| | | | | | | | | | | The simplex solver cannot handle negative-sized anchors. Those should be handled by the layout itself. This is done by inverting such anchors and making their size positive again. Ie. A --> B with size -10 becomes B --> A with size 10 Signed-off-by: Eduardo M. Fleury <eduardo.fleury@openbossa.org> Reviewed-by: Jesus Sanchez-Palencia <jesus.palencia@openbossa.org>
* QGraphicsAnchorLayout: Fix anchor creation heuristicsEduardo M. Fleury2009-09-171-19/+17
| | | | | | | | | | | | | | Fixing the case where creating an anchor between the layout Left edge and an item Right edge (or vice-versa) would have different behaviors depending on the argument order. Now both calls below have the same meaning: addAnchor(layout, Qt::AnchorLeft, widget, Qt::AnchorRight) addAnchor(widget, Qt::AnchorRight, layout, Qt::AnchorLeft) Signed-off-by: Eduardo M. Fleury <eduardo.fleury@openbossa.org> Reviewed-by: Jesus Sanchez-Palencia <jesus.palencia@openbossa.org>
* Fix a bug in FocusScopes; ensure subFocus is set correctly.Andreas Aardal Hanssen2009-09-151-1/+3
| | | | | | | | The bug was triggered by setting focus on a parent scope (which then passes focus to the innermost scope). Subfocus was set up for the first scope, but not the inner scopes. Reviewed-by: TrustMe
* Remove unused signal declaration.Andreas Aardal Hanssen2009-09-151-1/+0
| | | | | | | This came in with change c8bf9bd17a4520eefe4306b7b1bb4f93fb296d80, by accident - it was a leftover after debugging. Reviewed-by: Martin Smith
* doc: Fixed some qdoc errors.Martin Smith2009-09-151-42/+3
|
* Support for focus scopes: QGraphicsItem::ItemIsFocusScope.Andreas Aardal Hanssen2009-09-155-36/+177
| | | | | | | | | | | | | | | | This feature is essential for Declarative UI, but does not add much value for C++ developers. A FocusScope provides a stack of focused widgets, and it ensures that the topmost item on the stack has focus if any of the items in the stack gains focus. When the topmost loses focus, focus is passed to the "parent" focus scope, and so on. You can get almost the same behavior using panels (ItemIsPanel), except panels impose other behavior, like stopping clickfocus propagation, and stopping event propagation in general. In a QML world you would typically use FocusScope for controlling focus locally, and panels when you need to maintain separate focus stacks. Reviewed-by: akennedy
* Fix bugs in handling of initial focus.Andreas Aardal Hanssen2009-09-151-2/+5
| | | | | | | | | | | | | Make sure you can't set focus on an inactive scene, allow items with subfocus to gain focus even if added to a scene that's not active, and finally ensure that activating a panel in an active, but unfocused scene, gives focus to the scene. Also added a test that checks adding normal vs. panel items to an active vs. inactive scene, and what happens if you initially say the item should have focus. Reviewed-by: TrustMe
* Remove this line; which no longer has any effect.Andreas Aardal Hanssen2009-09-151-2/+0
| | | | | | | | | | | This line was added to fix crashes when deleting items that had a subFocusItem pointing to a child that was already deleted. This bug was fixed by ebb1162f54a29baeccb71d1e283146892629518f. After this, subFocusItem is always 0 at this point. The original change was eb3d5a73148cd7206c6b3b6672ed47b44611f745. Reviewed-by: TrustMe
* Fix update issues in QGraphicsView.Alexis Menard2009-09-152-15/+11
| | | | | | | | | | | | | | | The bug appeared only when calling collidingItems right after setPos. When calling setPos on a parent the sceneTransform is mark as dirty, so when we paint the parent and its children if the scene transform of the parent was dirty then we update all children sceneTransform. In our case here, collidingItems call ensureTransform on one of the children which go recursively to the top most dirty item and update the sceneTransform. The problem is that all sibling children are not mark their sceneTransform dirty so next paint will skip them (since the parent is not dirty anymore). Task-number:260711 Reviewed-by:bnilsen
* API change. This will get rid of the ugly setAnchorSpacing() method.Jan-Arve Sæther2009-09-144-200/+292
| | | | | | | | | | | | | | | | | | | | Say hello to QGraphicsAnchor, move the spacing (and removeAnchor) functionality over to that class. This also opens up for a cleaner API when we add support for size policies or min/pref/max sizes for anchors. Also remove - addLeftAndRightAnchors() - addTopAndBottomAnchors() - addAllAnchors() in favor of - addAnchors(itemA, itemB, Qt::Orientations) API change discussed with Caio and Andreas. Reviewed-by: Alexis
* Respect the layoutDirection property of the parent widget.Jan-Arve Sæther2009-09-113-20/+29
| | | | | | | Add a layoutDirection autotest, and sprinkle some of the tests with checkReverseDirection() Reviewed-by: Eduardo M. Fleury
* Wrong opacity set on the painter in QGraphicsEffect::draw.Bjørn Erik Nilsen2009-09-101-0/+1
| | | | | | | | We have to initialize the painter with the 'effected' item's opacity before calling QGraphicsEffect::draw; otherwise we'll use the previous rendered item's opacity (which is wrong). Reviewed-by: Michael Brasser
* Fix crash/bug in QGraphicsItem's subFocus handling.Andreas Aardal Hanssen2009-09-092-8/+14
| | | | | | | | Removes dangling subFocusItem pointers when changing focus after reparenting. This change also includes a mini-optimization when adding focusable items to an inactive scene. Reviewed-by: brad
* Only active QGraphicsScenes can have active input focus.Andreas Aardal Hanssen2009-09-092-9/+21
| | | | | | | | | | | | | | | | | This change ensures that only active scenes can have active input focus items. If you try to set input focus on items that are in an inactive scene, these items will gain input focus only when the scene is activated. For scenes attached to a view, this change should only fix the bug that you could have a blinking line edit in a scene when the view is inactive, meaning you couldn't type into the line edit. For scenes that have no view, you now must activate the scene in order to give the items active input focus. This will affect those who use QGraphicsScene with custom key and focus handling. Reviewed-by: brad
* Remove ItemAutoDetectsFocusProxy from QGraphicsItem.Andreas Aardal Hanssen2009-09-093-47/+4
| | | | | | | | | | | | This change partially reverts f68fed388dcdba6ab6dad3af4933bcd3aa123cf8, which was an attempt at getting FocusRealms working. Turns out this approach is wrong. The flag behaves badly when reparenting, and the feature conflicts with plain old setting focus. Discussed with Aaron; this change was already reverted in the kinetic-declarativeui branch. Reviewed-by: TrustMe
* Fix crash on QGraphicsItem destruction related to focus handling (redone)Kai Koehne2009-09-091-1/+3
| | | | | | | | | Reset the dangling subFocusItem pointer in ~QGraphicsItem, after all the child items have been deleted. This replaces commit d724c91a0ae. Reviewed-by: Thomas Hartmann
* Update license headers again.Jason McDonald2009-09-0951-204/+204
| | | | Reviewed-by: Trust Me
* Fix crash on QGraphicsItem destruction related to focus handlingKai Koehne2009-09-071-1/+1
| | | | | | | | Do not call clearFocus() for child item in setParentItemHelper() if called from destructor: At this time, the ~QGraphicsItem destructor already deleted all its children. Reviewed-by: Andreas Aardal Hanssen
* Fix crashes when moving descendents during destruction.Andreas Aardal Hanssen2009-09-041-7/+11
| | | | | | | | | | | This fix prevents crashes in QGraphicsItem caused by calls to pure virtual functions as an item tries to access its dying parent. This happens when an item is moved by an ancestor during this ancestor's destructor. Autotests included. Reviewed-by: bnilsen
* Don't call pure virtuals on deleting QGraphicsItemAaron Kennedy2009-09-041-1/+3
| | | | | | This also needs to be reviewed by andreas. Reviewed-by: Michael Brasser
* Make sure that top-level windows respect hfw/wfh constraint.Jan-Arve Sæther2009-09-041-25/+139
| | | | | | | | | | Note that the constraint is only enforced when resizing the window interactively. Calling setGeometry() will not try to enforce the constraint. See the graphicsview/flowlayout example for a "manual test". Task-number: 257455
* QGraphicsWidget::sizeHint didn't pass the correct constraint to layout.Jan-Arve Sæther2009-09-041-2/+4
| | | | | Adjust the constraint with the widget margin before passing it on to d->layout->effectiveSizeHint().
* Doc: Review of docs for QGraphicsItem::ItemUsesExtendedStyleOption.Geir Vattekar2009-09-041-7/+11
| | | | | Task-number: 253733 Reviewed-by: Bjørn Erik Nilsen
* Removing a few superfluous semicolons.Alessandro Portale2009-09-032-4/+4
| | | | Reviewed-By: TrustMe
* Rendering artifacts when installing an effect on HasNoContents items.Bjørn Erik Nilsen2009-09-031-5/+10
| | | | | | | | | | | QGraphicsItem::HasNoContents is documented to not paint anything when the flag is set on an item, so all the update requests are ignored. However, we cannot ignore update requests on such items when an effect is installed on them, because when the effects changes parameters it calls update on the item. We still don't paint the item, but we processes the update request such that its children can be painted properly. Reviewed-by: Andreas
* Fix crash bug when rendering a graphicsview offscreen with effectsThomas Hartmann2009-09-031-4/+8
| | | | Reviewed-by: Bjoern Erik Nilsen
* Improvements to usage of QMatrix4x4 in QGraphicsItem.Andreas Aardal Hanssen2009-09-031-20/+10
| | | | | | | | | | | This could have been amended to 464ee98eee5ce160b497aec6a1163422980dd797, the idea is that we use QMatrix4x4 only for the QGraphicsTransform instances and QTransform for the rest. The problem with the last submit was that adding any (unrelated) QGraphicsTransform would cause the QGraphicsItem::rotation properties (and friends) to lose precision. Reviewed-by: Olivier Reviewed-by: gabi
* Fix test failure & optimize matrix operations in QGraphicsItem.Andreas Aardal Hanssen2009-09-031-0/+13
| | | | | | | | | | | | | | | | This fixes failures in tst_QGraphicsItem::setTransformProperties(). Change 9e8ff32d introduced QMatrix4x4 as an internal matrix for QGraphicsItem. Problem is, QMatrix4x4 is float-based whereas QTransform is double-based. This change readds the use of QTransform in the case where there are no QGraphicsTransforms in the list. This by itself also makes this common case a bit faster. The workaround is moot if somebody adds any QGraphicsTransform, including one that doesn't do anything (like rotate by 0 degrees). So we might have to find a better fix. Reviewed-by: Olivier
* Fix the issue where the simplification did not simplify 2 anchors.Jan-Arve Sæther2009-09-021-36/+49
| | | | (It had to be minimum three anchors.)
* Doc: Fixed typos in QGraphicsItem and Diagram Scene ExampleGeir Vattekar2009-09-011-14/+13
| | | | | Task-number: 257292 Reviewed-by: Trust Me
* Make sure the BSP is updated when a graphics effect changes bounding rect.Bjørn Erik Nilsen2009-09-011-0/+3
| | | | | | | | | In the case of applying an effect to a QGraphicsItem, we have to notify the scene's BSP that the item's bounding rect has changed. We do this by calling prepareGeometryChange(). In the case of QWidget, it's sub-optimal that we update its parent, but there's no other way to solve it at the moment.
* fix doc. id maps to QObject::objectName, not QGraphicsObject::setOpacity ;-)Riccardo Iaconelli2009-08-311-1/+1
| | | | | | | Signed-off-by: Riccardo Iaconelli <riccardo@kde.org> Merge-request: 1371 Reviewed-by: Thiago Macieira <thiago.macieira@nokia.com>
* Add auto-activation on show/hide and setParentItem().Andreas Aardal Hanssen2009-08-313-6/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | If you show a child panel of an active panel, the child will now be activated and the parent deactivated. Hiding the child panel will reactive the parent. If the parent is 0, no other panel is activated. Reparenting a panel onto an active panel will also activate the (new) child. Reparenting away does not affect activation in any way. This change also fixes QGraphicsWidget::isActiveWindow(), which returned true for all toplevel widgets (not in a panel/window). This is wrong; either the non-panel items are active, or a panel is active. The correct behavior is the same as calling QGraphicsItem::isActive(). Fixed the autotests (which wrongly tested that both a panel and a non-panel item were active at the same time). This change causes popups (QGraphics{Proxy,}Widget) to deactivate the parent widget. On the positive side this activates the popup, and ensures that the parent regains proper focus when the popup is closed. However it also means the parent widget is inactive while the popup is open, which (e.g.) causes editable combobox line edit cursors to stop blinking. This is to be fixed soon, but the fix is a bit big so we'll do that later. Autotests included. Reviewed-by: Brad
* Fix activation behavior for panels, and add QGraphicsItem::setActive().Andreas Aardal Hanssen2009-08-315-61/+137
| | | | | | | | | Allow delayed activation for more fine grained control over which panels are activated or left inactive when the scene is created. Autotests included. Reviewed-by: Brad
* Update tech preview license header for files that are new in 4.6.Jason McDonald2009-08-3116-208/+208
| | | | Reviewed-by: Trust Me
* Fixed performance issue with graphics effects on graphics items.Samuel Rødal2009-08-311-0/+2
| | | | | | | Prevent a deep copy of the pixmap by ending the painter before returning the pixmap. Reviewed-by: Bjørn Erik Nilsen
* Merge branch '4.5' into 4.6Thiago Macieira2009-08-3135-455/+455
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: demos/boxes/glshaders.cpp demos/boxes/vector.h demos/embedded/fluidlauncher/pictureflow.cpp demos/embedded/fluidlauncher/pictureflow.h doc/src/desktop-integration.qdoc doc/src/distributingqt.qdoc doc/src/examples-overview.qdoc doc/src/examples.qdoc doc/src/frameworks-technologies/dbus-adaptors.qdoc doc/src/geometry.qdoc doc/src/groups.qdoc doc/src/objecttrees.qdoc doc/src/platform-notes.qdoc doc/src/plugins-howto.qdoc doc/src/qt3support.qdoc doc/src/qtdbus.qdoc doc/src/qtdesigner.qdoc doc/src/qtgui.qdoc doc/src/qtmain.qdoc doc/src/qtopengl.qdoc doc/src/qtsvg.qdoc doc/src/qtuiloader.qdoc doc/src/qundo.qdoc doc/src/richtext.qdoc doc/src/topics.qdoc src/corelib/tools/qdumper.cpp src/gui/embedded/qkbdpc101_qws.cpp src/gui/embedded/qkbdsl5000_qws.cpp src/gui/embedded/qkbdusb_qws.cpp src/gui/embedded/qkbdvr41xx_qws.cpp src/gui/embedded/qkbdyopy_qws.cpp src/gui/embedded/qmousebus_qws.cpp src/gui/embedded/qmousevr41xx_qws.cpp src/gui/embedded/qmouseyopy_qws.cpp src/gui/painting/qpaintengine_d3d.cpp src/gui/painting/qwindowsurface_d3d.cpp src/opengl/gl2paintengineex/glgc_shader_source.h src/opengl/gl2paintengineex/qglpexshadermanager.cpp src/opengl/gl2paintengineex/qglpexshadermanager_p.h src/opengl/gl2paintengineex/qglshader.cpp src/opengl/gl2paintengineex/qglshader_p.h src/opengl/util/fragmentprograms_p.h src/plugins/kbddrivers/linuxis/linuxiskbdhandler.cpp src/plugins/mousedrivers/linuxis/linuxismousehandler.cpp src/script/parser/qscript.g src/script/qscriptarray_p.h src/script/qscriptasm_p.h src/script/qscriptbuffer_p.h src/script/qscriptclass.cpp src/script/qscriptclassdata_p.h src/script/qscriptcompiler.cpp src/script/qscriptcompiler_p.h src/script/qscriptcontext.cpp src/script/qscriptcontext_p.cpp src/script/qscriptcontext_p.h src/script/qscriptcontextfwd_p.h src/script/qscriptecmaarray.cpp src/script/qscriptecmaarray_p.h src/script/qscriptecmaboolean.cpp src/script/qscriptecmacore.cpp src/script/qscriptecmadate.cpp src/script/qscriptecmadate_p.h src/script/qscriptecmaerror.cpp src/script/qscriptecmaerror_p.h src/script/qscriptecmafunction.cpp src/script/qscriptecmafunction_p.h src/script/qscriptecmaglobal.cpp src/script/qscriptecmaglobal_p.h src/script/qscriptecmamath.cpp src/script/qscriptecmamath_p.h src/script/qscriptecmanumber.cpp src/script/qscriptecmanumber_p.h src/script/qscriptecmaobject.cpp src/script/qscriptecmaobject_p.h src/script/qscriptecmaregexp.cpp src/script/qscriptecmaregexp_p.h src/script/qscriptecmastring.cpp src/script/qscriptecmastring_p.h src/script/qscriptengine.cpp src/script/qscriptengine_p.cpp src/script/qscriptengine_p.h src/script/qscriptenginefwd_p.h src/script/qscriptextenumeration.cpp src/script/qscriptextenumeration_p.h src/script/qscriptextqobject.cpp src/script/qscriptextqobject_p.h src/script/qscriptextvariant.cpp src/script/qscriptfunction.cpp src/script/qscriptfunction_p.h src/script/qscriptgc_p.h src/script/qscriptmember_p.h src/script/qscriptobject_p.h src/script/qscriptprettypretty.cpp src/script/qscriptprettypretty_p.h src/script/qscriptvalue.cpp src/script/qscriptvalueimpl.cpp src/script/qscriptvalueimpl_p.h src/script/qscriptvalueimplfwd_p.h src/script/qscriptvalueiteratorimpl.cpp src/script/qscriptxmlgenerator.cpp src/script/qscriptxmlgenerator_p.h tests/auto/linguist/lupdate/testdata/recursivescan/project.ui tests/auto/linguist/lupdate/testdata/recursivescan/sub/finddialog.cpp tests/auto/qkeyevent/tst_qkeyevent.cpp tools/linguist/shared/cpp.cpp
| * Update tech preview license header.Jason McDonald2009-08-3135-455/+455
| | | | | | | | Reviewed-by: Trust Me
* | Fix wrong transform when drawing graphics item effect source.Bjørn Erik Nilsen2009-08-281-4/+2
| | | | | | | | | | We are only interested in the difference between the original transform and the transform set on the painter we're about to use.
* | Fixed runtime warning in tst_QGraphicsProxyWidget::childPos.Gabriel de Dietrich2009-08-281-2/+2
| | | | | | | | | | | | | | ungrabKeyboard was called on an item without checking whether it was a keyboard grabber. Reviewed-by: bnilsen
* | Merge branch '4.6'Thiago Macieira2009-08-2718-43/+87
|\ \ | | | | | | | | | | | | Conflicts: src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp