| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This commit reduces the memory footprint of QGraphicsWidget by
around 40% (from around 663 bytes to around 409 bytes - measured
using /proc/<pid>/statm on Linux - see 'man 5 proc').
The technique used is to lazily allocate (on the heap) certain
data structures (i.e. not allocate them unless they are needed):
- QGraphicsLayoutItemPrivate::userSizeHints
=> used only if the size, width, or height is explicitly set
- QGraphicsWidgetPrivate::margins
=> used only if the contents margins are accessed
- QGraphicsWidgetPrivate::windowFrameMargins
=> used only if the window frame margins are accessed
- QGraphicsWidgetPrivate::windowData
=> used only if the graphics widget is a window
In addition, a few unused data members (and related code) were removed:
- QGraphicsWidgetPrivate::contentsRect
- QGraphicsWidgetPrivate::mouseDelta
- QGraphicsWidgetPrivate::*LayoutItemMargin
Reviewed-by: andreas
Task-number: 251592
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Change fd4d94df4eb16e9e54f61dd8ee45914e24832ae9 introduced mouse grab
and keyboard grab support to Graphics View (this was as part of 4.4).
The change was missing a large set of autotests that I wrote to test
the behavior of these features. As part of task 245317, which involves
investigating modality in Graphics View, I figured it would be a good
idea to start off but reconstructing these autotests. So this change
is mainly about adding autotests for mouse grabbing. And of course,
as it always is, I found two bugs while writing these tests.
1) Calling QGraphicsItem::grabMouse() while the item is holding the
implicit mouse grab will now upgrade the implicit grab to an
explicit grab.
2) Adding a popup to the scene will automatically grab the mouse.
Before, the popup would get the grab on show(), but if it was
already visible when added to the scene it would not gain the
grab.
Task-number: 245317
Reviewed-by: jasplin
|
|
|
|
|
|
|
|
|
| |
Do not send a QFontChange event before the item has been polished. This
is because we cannot call a virtual function while we're in the ctor.
This is basically the same as how we do it in QWidget.
Task-number: 246215
Reviewed-by: alexis
|
|
|