summaryrefslogtreecommitdiffstats
path: root/src/widgets/graphicsview
Commit message (Collapse)AuthorAgeFilesLines
* Made sure items with preferred width of 0 could also stretchJan Arve Saether2013-05-271-1/+1
| | | | | | | | | | | | | | | | | | If no stretch factors were specified, we used the preferred size as a stretch factor. Obviously, that didn't work if the preferred size was actually 0. This patch works around this by actually setting the stretch factor to 1.0 if this is the case. This should work fine in most cases, except for the case where there are also other items with a preferred size close to 0. In this case, the item with preferred size 0 will just grow faster than an item with e.g. preferred size 0.1. Task-number: QTBUG-31217 Change-Id: I966455da0bdd00308591c7f7cfbc4e134d423e57 Reviewed-by: Paul Olav Tvete <paul.tvete@digia.com>
* apply standard behaviorMaurice Kalinowski2013-05-211-1/+1
| | | | | | | | | | | According to documentation hoverLeaveEvent calls update(), which happens in QGraphicsItem. As QGraphicsWidget has not been calling parent implementation that did not happen and e.g. animatedtiles example did not work correctly. Change-Id: Ia25dda967bd21298c763996589c63dc173ba6b6a Reviewed-by: Samuel Rødal <samuel.rodal@digia.com> Reviewed-by: Oliver Wolff <oliver.wolff@digia.com>
* Don't send the same Input event twice to QGraphicsProxyWidget::inputMethodEventGatis Paeglis2013-05-151-1/+3
| | | | | | Task-number: QTBUG-30705 Change-Id: I6fa02807255d0abf74aa38e94662bbe3d9e642bb Reviewed-by: Gunnar Sletta <gunnar.sletta@digia.com>
* QGV: fix items not to be selected on right mouse button releaseJ-P Nurmi2013-05-141-1/+1
| | | | | | | Task-number: QTBUG-30990 Change-Id: I421d9169b592da2b468eceb9df4f3f7c6a06e8d6 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com> Reviewed-by: Andreas Aardal Hanssen <andreas@hanssen.name>
* Fix typo in QGraphicsItem documentation.Mitch Curtis2013-05-131-2/+2
| | | | | Change-Id: I69e7be75ec8164b81c2cd64fc0d4b475495a3db9 Reviewed-by: Jerome Pasion <jerome.pasion@digia.com>
* Fix tabFocusFirst when that item is removed from QGraphicsSceneMiikka Heikkinen2013-05-081-0/+9
| | | | | | | | | | If tabFocusFirst is not cleared or set to another valid item, there will be crash later if the removed item is deleted after removal. Task-number: QTBUG-30923 Change-Id: Iba9a6ce9334c52f8e552b0accda95ebb5fcfcdb1 Reviewed-by: Jan Arve Sæther <jan-arve.saether@digia.com>
* QGraphicsView: ignore unhandeled touch eventsRichard Moe Gustavsen2013-05-071-0/+2
| | | | | | | | | | | | | | | | | | | | When QGraphicsView has sceneInteractionAllowed == false (e.g when dragMode == QGraphicsView::ScrollHandDrag), all touch events are accepted. This is wrong, and will stop mouse synthesising from happening on touch platforms. This in turn will make ScrollHandDrag not work (since no mouse events will come through). This patch will call QEvent::ignore() if the touch event isn't send to the scene, which will cause a mouse event to be synthesised. Note that according to http://doc.qt.digia.com/qq/qq11-events.html the correct approach would probably be to just return 'false', rather than calling QEvent::ignore(). But this logic is not followed consistently elsewhere (e.g in QApplication::notify), so I choose to follow what the code actually expects for this bugfix. Change-Id: Ida777647134c41661bab156d7b164ebd882a6bb1 Reviewed-by: Shawn Rutledge <shawn.rutledge@digia.com>
* Make QGraphicsScene::touchEventhandler ignore unhandled touch eventsMorten Johan Sørvig2013-03-261-1/+1
| | | | | | | | | This was not done in Qt 4 to play well with the QGesture implementation, and may need to be revisited if/when we bring back QGesture for Qt 5. Change-Id: I4f5f6c8a67387039e838d1ef42ecc70c455ed8a3 Reviewed-by: Morten Johan Sørvig <morten.sorvig@digia.com>
* Merge remote-tracking branch 'gerrit/release' into stableSamuel Rødal2013-03-212-20/+0
|\ | | | | | | | | | | | | | | | | | | | | | | Conflicts: configure mkspecs/features/qt_module_headers.prf mkspecs/features/qt_tool.prf src/angle/angle.pro src/tools/bootstrap/bootstrap.pro tests/auto/widgets/kernel/qwidget/tst_qwidget.cpp Change-Id: Ide5759fe419a50f1c944211a48f7c66f662684e0
| * Don't call updateAccessibility from graphicsviewJan Arve Saether2013-03-152-20/+0
| | | | | | | | | | | | | | | | | | | | Graphics items are not accessible anyway, so it doesn't make much sense. Task-number: QTBUG-30169 Change-Id: Id10b0897bce88d9b91db84609a09495aac41b0b4 Reviewed-by: Frederik Gladhorn <frederik.gladhorn@digia.com>
* | Fix license headers stating QtGui for QtWidgets files.Jake Petroules2013-03-1947-47/+47
| | | | | | | | | | Change-Id: I0ca49e3e1f9f603f0b0f7f3553e854b871efe303 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | Whitespace cleanup: remove trailing whitespaceAxel Waggershauser2013-03-161-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Remove all trailing whitespace from the following list of files: *.cpp *.h *.conf *.qdoc *.pro *.pri *.mm *.rc *.pl *.qps *.xpm *.txt *README excluding 3rdparty, test-data and auto generated code. Note A): the only non 3rdparty c++-files that still have trailing whitespace after this change are: * src/corelib/codecs/cp949codetbl_p.h * src/corelib/codecs/qjpunicode.cpp * src/corelib/codecs/qbig5codec.cpp * src/corelib/xml/qxmlstream_p.h * src/tools/qdoc/qmlparser/qqmljsgrammar.cpp * src/tools/uic/ui4.cpp * tests/auto/other/qtokenautomaton/tokenizers/* * tests/benchmarks/corelib/tools/qstring/data.cpp * util/lexgen/tokenizer.cpp Note B): in about 30 files some overlapping 'leading tab' and 'TAB character in non-leading whitespace' issues have been fixed to make the sanity bot happy. Plus some general ws-fixes here and there as asked for during review. Change-Id: Ia713113c34d82442d6ce4d93d8b1cf545075d11d Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
* | Merge remote-tracking branch 'origin/stable' into devFrederik Gladhorn2013-03-051-2/+2
|\| | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: configure qmake/generators/mac/pbuilder_pbx.cpp src/corelib/kernel/qtimerinfo_unix.cpp src/plugins/platforms/cocoa/qcocoabackingstore.mm src/plugins/platforms/cocoa/qcocoawindow.mm src/plugins/platforms/windows/qwindowswindow.cpp src/plugins/platforms/xcb/qglxintegration.cpp Change-Id: I8d125fe498f5304874e6976b53f588d3e98a66ac
| * Fix some punctuation errors.Mitch Curtis2013-02-271-2/+2
| | | | | | | | | | Change-Id: I6aa2ad2b506466fbef6a22380d151988930807c9 Reviewed-by: Jerome Pasion <jerome.pasion@digia.com>
* | QGraphicsView - emit signal when rubber band changes.Thorbjørn Lund Martsum2013-02-263-3/+37
| | | | | | | | | | | | | | | | | | | | | | | | | | The rubberBandRect function is nice to have, but this patch makes it easier to track the rubber band by emiting a signal on change. That makes it easier (and less clumsy/hacky) to show information related to the rubber band. Change-Id: If65eb85d743a1804be3fdb823a821423411e9745 Reviewed-by: Andreas Aardal Hanssen <andreas@hanssen.name> Reviewed-by: Samuel Rødal <samuel.rodal@digia.com>
* | QGraphicsView - add function to get RubberBand rectThorbjørn Lund Martsum2013-02-262-1/+23
| | | | | | | | | | | | | | | | | | | | | | | | | | | | In many situations it is handy to know the rubberband rect. There are many situations where we want to show something related to the rubberband. Regardless how that is done the rubberband area is needed. (Not having this is a flaw that can force people to do make a customized rubberband just to get this information) Change-Id: Ia854db4c0022b6a97b150af2b4bb78fd5e974991 Reviewed-by: Andreas Aardal Hanssen <andreas@hanssen.name> Reviewed-by: Samuel Rødal <samuel.rodal@digia.com>
* | Merge remote-tracking branch 'origin/stable' into devFrederik Gladhorn2013-02-181-0/+2
|\| | | | | | | | | | | | | Conflicts: src/widgets/styles/qmacstyle_mac.mm Change-Id: If8326db9e7da3cbf45dbf7475fdff9915c7723b1
| * Fix crash in somewhat faulty QGraphicsProxyWidget unit test.Andreas Aardal Hanssen2013-02-181-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The crash is deep inside QGraphicsSceneIndex, which calls boundingRect() on the item that is being destroyed. The vtable is busted, resulting in a pure virtual function call. There's a more proper fix for this lying around somewhere but in this particular case we can get the test to not crash by guarding based on whether the item has a cursor set. This also happens to speed up QGraphicsItem destruction a bit so I figured it's a win-win situation to fix it. This case will still crash if the item actually had a cursor set but that makes the case even more narrow. Generally speaking, creating objects partially on the stack and partially on the heap, mixing parent/child relationships and then deleting one of the heap objects is quite sketchy and I doubt it happens much outside of this unit test. Change-Id: I25393d2cafb1256269ab6681519bd554cc380bfd Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
* | Merge remote-tracking branch 'origin/stable' into devFrederik Gladhorn2013-02-142-2/+2
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/concurrent/doc/qtconcurrent.qdocconf src/corelib/doc/qtcore.qdocconf src/corelib/global/qglobal.h src/dbus/doc/qtdbus.qdocconf src/dbus/qdbusmessage.h src/gui/doc/qtgui.qdocconf src/gui/image/qimagereader.cpp src/network/doc/qtnetwork.qdocconf src/opengl/doc/qtopengl.qdocconf src/opengl/qgl.h src/plugins/platforms/windows/qwindowswindow.cpp src/printsupport/doc/qtprintsupport.qdocconf src/sql/doc/qtsql.qdocconf src/testlib/doc/qttestlib.qdocconf src/tools/qdoc/doc/config/qt-cpp-ignore.qdocconf src/widgets/doc/qtwidgets.qdocconf src/xml/doc/qtxml.qdocconf Change-Id: Ie9a1fa2cc44bec22a0b942e817a1095ca3414629
| * Fix minor typos in docs, printed messages & commentsSze Howe Koh2013-01-282-2/+2
| | | | | | | | | | | | | | Missing apostrophes Change-Id: I3ef5e9d494fb7a37f8e6075f24cd3a274e572c23 Reviewed-by: Jerome Pasion <jerome.pasion@digia.com>
* | Make QGraphicsViewPrivate::updateRubberBand more readableThorbjørn Lund Martsum2013-02-121-41/+36
| | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch changes QGraphicsViewPrivate::updateRubberBand to return at once in case some of the first conditions (which were needed to do something with the rubberband) are not true. The indentation after these ifs is fixed, and there are a few style fixes, but beside the first 2 ifs, there are only white-space and new-line changes. Change-Id: I7e2edb7bfd334b35ee8ab246f733d854bff7e0f7 Reviewed-by: Andreas Aardal Hanssen <andreas@hanssen.name> Reviewed-by: Andy Shaw <andy.shaw@digia.com>
* | QGraphicsView - remove not needed storeMouseEventThorbjørn Lund Martsum2013-02-092-3/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | updateRubberBand is only called from mouseMoveEvent. The event is not changed. At the end of the event we call d->mouseMoveEventHandler which calls storeMouseEvent. There is no need to call it twice. Beside that this patch also changes the argument from QMouseEvent* to const QMouseEvent*. The only reason it needed to be const was the call to storeMouseEvent. Change-Id: I01148a6a8d36e782c4d95a90e36435e20b1681e1 Reviewed-by: Andreas Aardal Hanssen <andreas@hanssen.name> Reviewed-by: Samuel Rødal <samuel.rodal@digia.com>
* | Remove QT_{BEGIN,END}_HEADER macro usageSergio Ahumada2013-01-2915-59/+0
| | | | | | | | | | | | | | | | | | | | | | The macro was made empty in ba3dc5f3b56d1fab6fe37fe7ae08096d7dc68bcb and is no longer necessary or used. Discussed-on: http://lists.qt-project.org/pipermail/development/2013-January/009284.html Change-Id: Id2bb2e2cabde059305d4af5f12593344ba30f001 Reviewed-by: Laszlo Papp <lpapp@kde.org> Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@digia.com> Reviewed-by: hjk <hjk121@nokiamail.com>
* | Merge remote-tracking branch 'origin/stable' into devFrederik Gladhorn2013-01-241-5/+7
|\| | | | | | | | | | | | | Conflicts: src/plugins/platforms/windows/qwindowsdialoghelpers.cpp Change-Id: I4ca87d44129fa5c1d8541cd58b8d62bc69080688
| * Make sure QGraphicsItem notifies changes to focusScopeItem.Andreas Aardal Hanssen2013-01-241-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 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>
* | Merge remote-tracking branch 'origin/stable' into devFrederik Gladhorn2013-01-2251-51/+51
|\| | | | | | | | | | | | | | | | | | | Conflicts: src/corelib/io/qsavefile_p.h src/corelib/tools/qregularexpression.cpp src/gui/util/qvalidator.cpp src/gui/util/qvalidator.h Change-Id: I58fdf0358bd86e2fad5d9ad0556f3d3f1f535825
| * Update copyright year in Digia's license headersSergio Ahumada2013-01-1851-51/+51
| | | | | | | | | | Change-Id: Ic804938fc352291d011800d21e549c10acac66fb Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* | Merge branch 'stable' into devFrederik Gladhorn2013-01-043-71/+67
|\| | | | | | | | | | | | | | | | | | | | | Conflicts: examples/widgets/painting/shared/shared.pri src/corelib/tools/qharfbuzz_p.h src/corelib/tools/qunicodetools.cpp src/plugins/platforms/windows/accessible/qwindowsaccessibility.cpp src/plugins/platforms/windows/qwindowsfontdatabase.cpp Change-Id: Ibc9860abf570e5ce8b052fb88feb73ec35e64bd3
| * Remove unused function _q_qgraphicsItemSetFlagThiago Macieira2012-12-291-18/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Clang reports: graphicsview/qgraphicsitem.cpp:1779:13: error: function '_q_qgraphicsItemSetFlag' is not needed and will not be emitted [-Werror,-Wunneeded-internal-declaration] static void _q_qgraphicsItemSetFlag(QGraphicsItem *item, QGraphicsItem::GraphicsItemFlag flag, ^ According to the public Git history, in Qt 4.5.1 this function was already unused. The only reason it wasn't caught so far is that it is recursive: it calls itself. So it is used... by itself. Change-Id: I6fc6b33cb314b845525dc9315d0ad742e113d5cd Reviewed-by: Andreas Aardal Hanssen <andreas@hanssen.name> Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
| * Fix focusproxy-relayed crash in QGraphicsItem destructor.Andreas Aardal Hanssen2012-12-171-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Makes tst_qgraphicsitem::tst_focusProxyDeletion not crash. valgrind reported the error when running tst_qgraphicsitem. The crash was very real; when deleting an item that has another item as a focus proxy, the proxy still had a reference to the deleted item's focusProxy pointer. I'm not a huge fan of whitebox testing but thought this crash justifies a modification of the test to make it fail, instead of just passing silently with a warning only given by valgrind and friends. FTR the reason the test doesn't crash hard is that the memory is freed but not reused within the scope of the test. So the access to the pointer d_ptr->focusProxy succeeds, it just accesses memory that might as well have been reclaimed. But this is quite undefined... Task-number: QTBUG-28321 Change-Id: I2624631f5e5c2a8aa8bd4efe1fc128eba6c61f56 Reviewed-by: Jan Arve Sæther <jan-arve.saether@digia.com>
| * QGraphicsView - fix rubberband to expand on wheel eventThorbjørn Lund Martsum2012-12-111-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In SHA 51914375b615ddcac711171ac31779fea01b4323 the rubberband selection was fixed, so it followed the scene-point on mousemove. However wheelEvent could move the view - but avoid update of the rubberband (that would not be updated until next mouse-move). This patch fixes that (and generally improves rubberband behavior) since QGraphicsViewPrivate::mouseMoveEventHandler is called by replayLastMouseEvent, which is called from various places, where we need to update the rubberband (e.g scrollContentsBy). Change-Id: I1b78c27edaaecea797a2319086d7a11d437d2bd3 Reviewed-by: Andy Shaw <andy.shaw@digia.com> Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
| * QGraphicsView - move rubberband-handling into a private functionThorbjørn Lund Martsum2012-12-112-48/+55
| | | | | | | | | | | | | | | | | | | | | | | | | | This patch moves the rubberband-handling from QGraphicsView::mouseMoveEvent to QGraphicsViewPrivate::updateRubberBand. This function is then called from QGraphicsView::mouseMoveEvent. I have removed some d-> and added some q-> but beside that nothing is changed in the code. Change-Id: Iab70c55635c43733e0e02bb70e2bb03b90bf62f0 Reviewed-by: Andy Shaw <andy.shaw@digia.com> Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
| * QGraphicsView - add const to a not modified local variableThorbjørn Lund Martsum2012-12-111-1/+1
| | | | | | | | | | | | | | | | | | The QPointF ep is not modified. There is no reason it shouldn't be const. Change-Id: I41fb8f9ae5296a7a40f7eb8be13fc14d56915e3f Reviewed-by: Andy Shaw <andy.shaw@digia.com> Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
| * QGraphicsView - remove reference to avoid weird code.Thorbjørn Lund Martsum2012-12-111-1/+1
| | | | | | | | | | | | | | | | | | | | Even though the code before theoretic is ok, we really shouldn't have a reference since mapFromScene returns a QPointF and not a const QPointF&. Change-Id: I5ea8fd238bdbdd21fb1e3b6b5f280d45e3bc43ef Reviewed-by: Andy Shaw <andy.shaw@digia.com> Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
| * Clear focus of GraphicsItem focus scopes and their children.Andrew den Exter2012-12-041-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 Change-Id: I62a292eff000151e50b2f5221e22f326a380fc3a Reviewed-by: Martin Jones <martin.jones@jollamobile.com>
* | Deactivating an inactive panel no longer causes unwanted deactivation.Andreas Aardal Hanssen2012-12-171-10/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | QGraphicsItem::setActive() is by design not guarded against calls that do not change the current activation state of the item (e.g., calling setActive(true) on an active item or calling setActive(false) on an inactive item). This is to ensure that it's possible to set explicit activation state on items, either before they are added to a scene, or while the scene itself is inactive. Before this fix, calling setActive(false) on a panel item that is not currently active would by accident clear activation from any other panel that might have focus. After this fix, activation is only cleared if the item setActive() was called on itself is the active panel, or is the panel that will regain activation once the scene is reactivated. Task-number: QTBUG-28544 Change-Id: Ic4752f1e4400f9a0660bc968834747610212bb52 Reviewed-by: Bjørn Erik Nilsen <post@bjoernen.com> Reviewed-by: Andreas Aardal Hanssen <andreas@hanssen.name> Reviewed-by: Yoann Lopes <yoann.lopes@digia.com>
* | Add new signal: QGraphicsScene::focusItemChanged().Andreas Aardal Hanssen2012-12-173-7/+47
| | | | | | | | | | | | | | | | | | | | | | | | | | | | This signal is emitted by QGraphicsScene whenever focus changes in the scene (i.e., when an item gains or loses input focus, or when focus passes from one item to another). You can connect to this signal if you need to keep track of when other items gain input focus. It is particularily useful for implementing virtual keyboards, input methods, and cursor items. Task-number: QTBUG-10570 Change-Id: I9cbbd9a2d15d6f568e1597c2c33ec049eb70f793 Reviewed-by: Jan Arve Sæther <jan-arve.saether@digia.com> Reviewed-by: Yoann Lopes <yoann.lopes@digia.com>
* | Make sure panels always gain focus when activated or tab is pressed.Andreas Aardal Hanssen2012-12-171-2/+31
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This changes behavior, but I would argue it's a good change. If you create a panel and activate it (e.g., by simply showing it or reparenting it onto an already-visible item), you expect the panel to gain focus / which is sort of the whole point of activating it. Prior to this change, you had to have explicitly called setFocus() on one of the panel's children, which would give that item subfocus, for that item to auto- gain focus when the panel was activated. This change makes it more automatic. If the panel itself or any of the widgets in its focus chain can gain focus, they will gain focus when the panel is activated. So the new logic is - if the panel already has a focus item, so if someone explicitly set subfocus on an item before the panel is shown, that item gets focus. Otherwise, if the panel itself can gain focus (e.g., someone makes a line edit / text edit panel), it gains focus when activated. Otherwise, we search the focus chain until we find the first item that can gain focus. This last case is the file dialog case, where the dialog itself can't gain focus but typically the first item in the focus chain is the primary focus widget, such as the search field or the directory list view. The change also fixes this for the first Tab. If you clear focus on a panel, the user expects to be able to press Tab to regain focus. Prior to this change that didn't happen. Now, the panel or the first in the focus chain that can get focus gets focus on first tab. Task-number: QTBUG-28194 Change-Id: Id7ec1741d0d5eb4ea845469909c8d684e14017f1 Reviewed-by: Jan Arve Sæther <jan-arve.saether@digia.com>
* | Repair QGraphicsWidget focus chain when used with ItemIsPanel.Andreas Aardal Hanssen2012-12-073-78/+96
|/ | | | | | | | | | | | | | | | | Add handling of the focus chain to QGraphicsItem::setFlags(), so that the focus chain is repaired (panels pop out of the chain and non-panels merge back in) when the ItemIsPanel flag is toggled. Add handling focus chain to QGraphicsWidgetPrivate::fixFocusChainBeforeReparenting for panels. Before this fix, you must enable the ItemIsPanel flag before adding the item as a child to a parent panel, and you lose focus when using the tab key to focus around a panel after it has been reparented into another panel. Task-number: QTBUG-28187 Change-Id: I1d0d81a90697eaf715a8a337c8bf6c2159329e68 Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
* Renamed the keyboard-focus doc to make clear it's about WidgetsShawn Rutledge2012-12-011-1/+1
| | | | | | | Also link from the widgets index page. Change-Id: I49cd415b09d7458d89d75931ecfaafe29c226c6f Reviewed-by: Paul Olav Tvete <paul.tvete@digia.com>
* QGraphicsView - fix rubberband to stay right on scrollThorbjørn Lund Martsum2012-12-011-1/+1
| | | | | | | | | | | | | | We should consider the scene-position when we are expanding moving a rubberband. If the user does some auto-scroll (Qt should support that itself, but that is another matter) then the rubberband should not keep the (old) local position to calculate the rubberband extension, but instead use the scene-position that was actually clicked. Change-Id: I04a2df6a1edae8b3587e1ac2104c7fe4ccfb7762 Reviewed-by: Andy Shaw <andy.shaw@digia.com> Reviewed-by: Andreas Aardal Hanssen <andreas@hanssen.name> Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* QGV: set QStyleOption::styleObject for graphics items & widgetsJ-P Nurmi2012-11-303-0/+14
| | | | | | | | | | | Certain QStyle code paths expect the style object to be set. This will avoid problems when QGraphicsItems/Widgets utilize QStyle for drawing. Even if things will not necessarily animate properly, such legacy code won't cause a crash at least. Change-Id: Ic77cb4ee9820d6c4ec92c7278fd87cb866f5a780 Reviewed-by: Andreas Aardal Hanssen <andreas@hanssen.name> Reviewed-by: Morten Johan Sørvig <morten.sorvig@digia.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 5735. Change-Id: Ibc0739b9fe31be3cc74110225940e9e173f585e0 Reviewed-by: Bernd Weimer <bweimer@rim.com> Reviewed-by: Denis Dzyubenko <denis@ddenis.info> Reviewed-by: Nicolas Arnaud-Cormos <nicolas@kdab.com>
* Ensure subfocus is not reset to 0 when hiding a panel.Andreas Aardal Hanssen2012-11-262-14/+27
| | | | | | | | | | | | | | | | | | | When hiding any widget that is not a panel, it is correct to clear subfocus. In case clearFocus() has been called, the result is that focusItem() / focusWidget() points to 0, which is correct. Upon reactivation, nothing gains input focus. When changing focus, the following setSubFocus() call will ensure subfocus points to the new widget. When hiding a panel, however, it's essential that subfocus within that panel is not cleared, otherwise, when re-showing the panel, nothing will have focus, whereas the expected behavior is that focus is restored to the last item that had focus, i.e., the focusItem() a.k.a. subfocus widget. Task-number: QTBUG-22256 Change-Id: I84d849a505764e074e1369fef923cef1ad5c0b1e Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
* Made QMacStyle internalJ-P Nurmi2012-11-231-1/+1
| | | | | | | | | | | | | We will take this opportynity to remove various QStyle specializations from the public API in Qt5. This gives us much more freedom, for example changing the inheritance hierarchy, pluginizing etc. without worrying about BC. => Use QStyleFactory and/or QProxyStyle instead of creating an instance or inheriting QMacStyle directly. Change-Id: I44a2f5ee3fe08ecc837b593a2a2737eb90e8c267 Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@digia.com>
* Add a QEnterEvent containing the mouse position.Friedemann Kleint2012-11-101-4/+4
| | | | | | | | | | | | | Enter handling requires knowledge of the mouse position. Extend the enter handling of QWindowSystemInterface to receive the position (implemented for Windows, XCB and Mac), passing it on to QEnterEvent. Dispatch QEnterEvent from widgets code. Change-Id: I49c07d2b1f46310c877017dd55d4cd7d636bdbce Reviewed-by: Miikka Heikkinen <miikka.heikkinen@digia.com> Reviewed-by: Samuel Rødal <samuel.rodal@digia.com>
* Fix sentences in QGraphicsItem documentation.Mitch Curtis2012-11-071-10/+10
| | | | | Change-Id: I5f86cdca53be103976017c83123e1ac80fcb8aa8 Reviewed-by: Jerome Pasion <jerome.pasion@digia.com>
* De-inline some destructors in QtWidgetsMarc Mutz2012-11-062-0/+8
| | | | | | | | | | | | | | | | | | | | | | Destructors should be out-of-line so that the compiler doesn't generate one per translation unit. Apart from creating more work for the compiler, it can also lead to duplicated vtables if the dtor is the first virtual function (reimplementation), and all other virtuals are inline, too. Duplicate vtables then break RTTI. In addition, having virtual dtors de-inlined allows us to add code to them in a BC way. As a final argument, this change may lead to less code app-side, since a sequence of cross-DLL calls (to member variable dtors) is replaced by a single cross-DLL call to the new out-of-line dtor. Change-Id: Ifb8c4aa992c75d61ba9ac8de5ab41d1e96b0a0b1 Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com> Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com> Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@digia.com>
* QtWidgets: add some explicitMarc Mutz2012-11-051-24/+24
| | | | | | | Change-Id: I0650db3d47b506c67074c526ab9857f8159fd599 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com> Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com> Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* Make QPen default to 1-width non-cosmetic.Samuel Rødal2012-10-223-16/+5
| | | | | | | | | | | Use the Qt4CompatiblePainting render hint when painting with QPainter to treat default constructed QPens as cosmetic still. The NonCosmeticDefaultPen render hint gets documented as obsolete, since it was in any case not respected by the raster nor OpenGL paint engine. Change-Id: I04d910e9700baf7f13a8aac07a3633014bb9283e Reviewed-by: Jens Bache-Wiig <jens.bache-wiig@digia.com>