Merge QStyleOption*V{2,3,4} classes together
authorGiuseppe D'Angelo <dangelog@gmail.com>
Mon, 30 Jan 2012 00:52:34 +0000 (00:52 +0000)
committerQt by Nokia <qt-info@nokia.com>
Thu, 2 Feb 2012 19:18:55 +0000 (20:18 +0100)
commit3578e05b293c1cc53582109001b20f02c7a1eeb7
treea062b961954c0e7c6c4f9d9a0675af1b3d4f3707
parent75711510b1ad7d4ac4434ad41a0ed71cfc0344dc
Merge QStyleOption*V{2,3,4} classes together

In order to keep binary compatibility, Qt 4 introduced V{2,3,4}
classes for QStyleOption subclasses. They're simple, low level
containers for various members with public access (no accessors
required).

In Qt 5.0 we can break BC, so this patch moves the members
from the derived classes into the ``base'' ones.
The ``base'' ones get a version bump matching the highest
version available, and the V{2,3,4} classes become typedefs.

This change can cause problems in code that used QStyleOption
directly, especially QStyleOptionViewItem, because the old V4
fields get default initialization but the QStyle subclasses
detect that the option is a V4 option and expect all fields
to be properly initialized. The fix in such places is to
properly initialize all fields.

Task-number: QTBUG-23522
Change-Id: I2f782da09ca5cc8c4cbafc07448fb0d33153a251
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
dist/changes-5.0.0
src/widgets/styles/qstyleoption.cpp
src/widgets/styles/qstyleoption.h
tests/auto/widgets/itemviews/qitemdelegate/tst_qitemdelegate.cpp
tests/auto/widgets/itemviews/qtreewidget/tst_qtreewidget.cpp