diff options
| author | Liang Qi <liang.qi@theqtcompany.com> | 2015-11-04 20:18:14 +0100 |
|---|---|---|
| committer | Liang Qi <liang.qi@theqtcompany.com> | 2015-11-04 20:18:14 +0100 |
| commit | 4159ee840549df11287294f0928e90f35f3e06ff (patch) | |
| tree | 4a3947e37d54bdb78b4042e9ced20dbf181b5a2c /src/widgets/doc/snippets/javastyle.cpp | |
| parent | 59dbf1786f22ec4ac88d8f9d38cac5cfb82acaea (diff) | |
| parent | c8c39ecc37c156ac2677de09a26548dfc274b564 (diff) | |
Merge remote-tracking branch 'origin/5.6' into dev
Conflicts:
config.tests/unix/ptrsize.test
configure
src/corelib/global/qnamespace.h
src/network/socket/qabstractsocket.cpp
tests/auto/other/networkselftest/networkselftest.pro
Change-Id: Ic78abb4a34f9068567cea876861d4220f5a07672
Diffstat (limited to 'src/widgets/doc/snippets/javastyle.cpp')
| -rw-r--r-- | src/widgets/doc/snippets/javastyle.cpp | 25 |
1 files changed, 10 insertions, 15 deletions
diff --git a/src/widgets/doc/snippets/javastyle.cpp b/src/widgets/doc/snippets/javastyle.cpp index b0b548e731a..4997e25ada9 100644 --- a/src/widgets/doc/snippets/javastyle.cpp +++ b/src/widgets/doc/snippets/javastyle.cpp @@ -236,9 +236,8 @@ void JavaStyle::drawControl(ControlElement control, const QStyleOption *option, break; } case CE_DockWidgetTitle: { - const QStyleOptionDockWidgetV2 *docker = - new QStyleOptionDockWidgetV2( - *qstyleoption_cast<const QStyleOptionDockWidget *>(option)); + const QStyleOptionDockWidget *docker = + qstyleoption_cast<const QStyleOptionDockWidget *>(option); QRect rect = docker->rect; QRect titleRect = rect; @@ -366,11 +365,9 @@ void JavaStyle::drawControl(ControlElement control, const QStyleOption *option, break; } case CE_ProgressBar: { - const QStyleOptionProgressBar *bar1 = + const QStyleOptionProgressBar *bar = qstyleoption_cast<const QStyleOptionProgressBar *>(option); - QStyleOptionProgressBarV2 *bar = new QStyleOptionProgressBarV2(*bar1); - QRect rect = bar->rect; if (bar->orientation == Qt::Vertical) { rect = QRect(rect.left(), rect.top(), rect.height(), rect.width()); @@ -416,7 +413,6 @@ void JavaStyle::drawControl(ControlElement control, const QStyleOption *option, if (bar->textVisible) drawControl(CE_ProgressBarLabel, &subBar, painter, widget); - delete bar; break; } case CE_ProgressBarGroove: { @@ -2366,18 +2362,17 @@ void JavaStyle::drawPrimitive(PrimitiveElement element, case PE_FrameLineEdit: { const QStyleOptionFrame *frame = qstyleoption_cast<const QStyleOptionFrame *>(option); - const QStyleOptionFrameV2 frameV2(*frame); painter->setPen(frame->palette.color(QPalette::Mid)); - painter->drawRect(frameV2.rect.adjusted(0, 0, -2, -2)); + painter->drawRect(frame->rect.adjusted(0, 0, -2, -2)); painter->setPen(Qt::white); - painter->drawRect(frameV2.rect.adjusted(1, 1, -1, -1)); - painter->setPen(frameV2.palette.color(QPalette::Active, + painter->drawRect(frame->rect.adjusted(1, 1, -1, -1)); + painter->setPen(frame->palette.color(QPalette::Active, QPalette::Background)); - painter->drawLine(frameV2.rect.bottomLeft(), - frameV2.rect.bottomLeft() + QPoint(1, -1)); - painter->drawLine(frameV2.rect.topRight(), - frameV2.rect.topRight() + QPoint(-1, 1)); + painter->drawLine(frame->rect.bottomLeft(), + frame->rect.bottomLeft() + QPoint(1, -1)); + painter->drawLine(frame->rect.topRight(), + frame->rect.topRight() + QPoint(-1, 1)); break; } case PE_FrameFocusRect: { |
