QtWidgets: de-inline some Private ctors

Saves ~7KiB text size on optimized GCC 4.9 Linux AMD64
builds.

Drive-by fix: properly init
QGraphicsProxyWidgetPrivate::proxyIsGivingFocus.

Change-Id: Iac923f0f2a9cdc0349f706c5760883a210be36f3
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
bb10
Marc Mutz 2015-12-18 10:43:23 +01:00
parent ab4ddea4c1
commit 11c8823ff7
6 changed files with 113 additions and 97 deletions

View File

@ -810,6 +810,78 @@ static QPainterPath qt_graphicsItem_shapeFromPath(const QPainterPath &path, cons
return p;
}
/*!
\internal
*/
QGraphicsItemPrivate::QGraphicsItemPrivate()
: z(0),
opacity(1.),
scene(nullptr),
parent(nullptr),
transformData(nullptr),
graphicsEffect(nullptr),
index(-1),
siblingIndex(-1),
itemDepth(-1),
focusProxy(nullptr),
subFocusItem(nullptr),
focusScopeItem(nullptr),
imHints(Qt::ImhNone),
panelModality(QGraphicsItem::NonModal),
acceptedMouseButtons(0x1f),
visible(true),
explicitlyHidden(false),
enabled(true),
explicitlyDisabled(false),
selected(false),
acceptsHover(false),
acceptDrops(false),
isMemberOfGroup(false),
handlesChildEvents(false),
itemDiscovered(false),
hasCursor(false),
ancestorFlags(0),
cacheMode(0),
hasBoundingRegionGranularity(false),
isWidget(false),
dirty(false),
dirtyChildren(false),
localCollisionHack(false),
inSetPosHelper(false),
needSortChildren(false),
allChildrenDirty(false),
fullUpdatePending(false),
flags(0),
paintedViewBoundingRectsNeedRepaint(false),
dirtySceneTransform(true),
geometryChanged(true),
inDestructor(false),
isObject(false),
ignoreVisible(false),
ignoreOpacity(false),
acceptTouchEvents(false),
acceptedTouchBeginEvent(false),
filtersDescendantEvents(false),
sceneTransformTranslateOnly(false),
notifyBoundingRectChanged(false),
notifyInvalidated(false),
mouseSetsFocus(true),
explicitActivate(false),
wantsActive(false),
holesInSiblingIndex(false),
sequentialOrdering(true),
updateDueToGraphicsEffect(false),
scenePosDescendants(false),
pendingPolish(false),
mayHaveChildWithGraphicsEffect(false),
isDeclarativeItem(false),
sendParentChangeNotification(false),
dirtyChildrenBoundingRect(true),
globalStackingOrder(-1),
q_ptr(nullptr)
{
}
/*!
\internal
*/

View File

@ -168,75 +168,7 @@ public:
AncestorContainsChildren = 0x10
};
inline QGraphicsItemPrivate()
: z(0),
opacity(1.),
scene(0),
parent(0),
transformData(0),
graphicsEffect(0),
index(-1),
siblingIndex(-1),
itemDepth(-1),
focusProxy(0),
subFocusItem(0),
focusScopeItem(0),
imHints(Qt::ImhNone),
panelModality(QGraphicsItem::NonModal),
acceptedMouseButtons(0x1f),
visible(1),
explicitlyHidden(0),
enabled(1),
explicitlyDisabled(0),
selected(0),
acceptsHover(0),
acceptDrops(0),
isMemberOfGroup(0),
handlesChildEvents(0),
itemDiscovered(0),
hasCursor(0),
ancestorFlags(0),
cacheMode(0),
hasBoundingRegionGranularity(0),
isWidget(0),
dirty(0),
dirtyChildren(0),
localCollisionHack(0),
inSetPosHelper(0),
needSortChildren(0),
allChildrenDirty(0),
fullUpdatePending(0),
flags(0),
paintedViewBoundingRectsNeedRepaint(0),
dirtySceneTransform(1),
geometryChanged(1),
inDestructor(0),
isObject(0),
ignoreVisible(0),
ignoreOpacity(0),
acceptTouchEvents(0),
acceptedTouchBeginEvent(0),
filtersDescendantEvents(0),
sceneTransformTranslateOnly(0),
notifyBoundingRectChanged(0),
notifyInvalidated(0),
mouseSetsFocus(1),
explicitActivate(0),
wantsActive(0),
holesInSiblingIndex(0),
sequentialOrdering(1),
updateDueToGraphicsEffect(0),
scenePosDescendants(0),
pendingPolish(0),
mayHaveChildWithGraphicsEffect(0),
isDeclarativeItem(0),
sendParentChangeNotification(0),
dirtyChildrenBoundingRect(1),
globalStackingOrder(-1),
q_ptr(0)
{
}
QGraphicsItemPrivate();
virtual ~QGraphicsItemPrivate();
static const QGraphicsItemPrivate *get(const QGraphicsItem *item)

View File

@ -184,6 +184,24 @@ QT_BEGIN_NAMESPACE
extern bool qt_sendSpontaneousEvent(QObject *, QEvent *);
Q_WIDGETS_EXPORT extern bool qt_tab_all_widgets();
/*!
\internal
*/
QGraphicsProxyWidgetPrivate::QGraphicsProxyWidgetPrivate()
: QGraphicsWidgetPrivate(),
dragDropWidget(nullptr),
posChangeMode(NoMode),
sizeChangeMode(NoMode),
visibleChangeMode(NoMode),
enabledChangeMode(NoMode),
styleChangeMode(NoMode),
paletteChangeMode(NoMode),
tooltipChangeMode(NoMode),
focusFromWidgetToProxy(false),
proxyIsGivingFocus(false)
{
}
/*!
\internal
*/

View File

@ -56,17 +56,8 @@ class QGraphicsProxyWidgetPrivate : public QGraphicsWidgetPrivate
{
Q_DECLARE_PUBLIC(QGraphicsProxyWidget)
public:
QGraphicsProxyWidgetPrivate()
: dragDropWidget(0),
posChangeMode(NoMode),
sizeChangeMode(NoMode),
visibleChangeMode(NoMode),
enabledChangeMode(NoMode),
styleChangeMode(NoMode),
paletteChangeMode(NoMode),
tooltipChangeMode(NoMode),
focusFromWidgetToProxy(0)
{ }
QGraphicsProxyWidgetPrivate();
void init();
void sendWidgetMouseEvent(QGraphicsSceneMouseEvent *event);
void sendWidgetMouseEvent(QGraphicsSceneHoverEvent *event);

View File

@ -86,6 +86,25 @@ qreal QGraphicsWidgetPrivate::titleBarHeight(const QStyleOptionTitleBar &options
/*!
\internal
*/
QGraphicsWidgetPrivate::QGraphicsWidgetPrivate()
: margins(nullptr),
layout(nullptr),
inheritedPaletteResolveMask(0),
inheritedFontResolveMask(0),
inSetGeometry(false),
polished(false),
inSetPos(false),
autoFillBackground(false),
focusPolicy(Qt::NoFocus),
focusNext(nullptr),
focusPrev(nullptr),
windowFlags(),
windowData(nullptr),
setWindowFrameMargins(false),
windowFrameMargins(nullptr)
{
}
QGraphicsWidgetPrivate::~QGraphicsWidgetPrivate()
{
// Remove any lazily allocated data

View File

@ -64,23 +64,7 @@ class QGraphicsWidgetPrivate : public QGraphicsItemPrivate
{
Q_DECLARE_PUBLIC(QGraphicsWidget)
public:
QGraphicsWidgetPrivate()
: margins(0),
layout(0),
inheritedPaletteResolveMask(0),
inheritedFontResolveMask(0),
inSetGeometry(0),
polished(0),
inSetPos(0),
autoFillBackground(0),
focusPolicy(Qt::NoFocus),
focusNext(0),
focusPrev(0),
windowFlags(0),
windowData(0),
setWindowFrameMargins(false),
windowFrameMargins(0)
{ }
QGraphicsWidgetPrivate();
virtual ~QGraphicsWidgetPrivate();
void init(QGraphicsItem *parentItem, Qt::WindowFlags wFlags);