summaryrefslogtreecommitdiffstats
path: root/src/widgets/doc
diff options
context:
space:
mode:
authorLiang Qi <liang.qi@theqtcompany.com>2015-11-04 20:18:14 +0100
committerLiang Qi <liang.qi@theqtcompany.com>2015-11-04 20:18:14 +0100
commit4159ee840549df11287294f0928e90f35f3e06ff (patch)
tree4a3947e37d54bdb78b4042e9ced20dbf181b5a2c /src/widgets/doc
parent59dbf1786f22ec4ac88d8f9d38cac5cfb82acaea (diff)
parentc8c39ecc37c156ac2677de09a26548dfc274b564 (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')
-rw-r--r--src/widgets/doc/snippets/code/src_gui_graphicsview_qgraphicsview.cpp2
-rw-r--r--src/widgets/doc/snippets/javastyle.cpp25
-rw-r--r--src/widgets/doc/snippets/qstyleoption/main.cpp33
-rw-r--r--src/widgets/doc/src/widgets-and-layouts/styles.qdoc10
4 files changed, 15 insertions, 55 deletions
diff --git a/src/widgets/doc/snippets/code/src_gui_graphicsview_qgraphicsview.cpp b/src/widgets/doc/snippets/code/src_gui_graphicsview_qgraphicsview.cpp
index 2f6865c9dd..074b214f80 100644
--- a/src/widgets/doc/snippets/code/src_gui_graphicsview_qgraphicsview.cpp
+++ b/src/widgets/doc/snippets/code/src_gui_graphicsview_qgraphicsview.cpp
@@ -116,7 +116,7 @@ void CustomView::mousePressEvent(QMouseEvent *event)
if (QGraphicsItem *item = itemAt(event->pos())) {
qDebug() << "You clicked on item" << item;
} else {
- qDebug() << "You didn't click on an item.";
+ qDebug("You didn't click on an item.");
}
}
//! [6]
diff --git a/src/widgets/doc/snippets/javastyle.cpp b/src/widgets/doc/snippets/javastyle.cpp
index b0b548e731..4997e25ada 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: {
diff --git a/src/widgets/doc/snippets/qstyleoption/main.cpp b/src/widgets/doc/snippets/qstyleoption/main.cpp
index aa4220d8ea..05d5ece33d 100644
--- a/src/widgets/doc/snippets/qstyleoption/main.cpp
+++ b/src/widgets/doc/snippets/qstyleoption/main.cpp
@@ -75,44 +75,11 @@ void MyPushButton::paintEvent(QPaintEvent *)
class MyStyle : public QStyle
{
public:
- MyStyle();
void drawPrimitive(PrimitiveElement element, const QStyleOption *option,
QPainter *painter, const QWidget *widget);
};
-MyStyle::MyStyle()
-{
-//! [1]
- QStyleOptionFrame *option;
-
- if (const QStyleOptionFrame *frameOption =
- qstyleoption_cast<const QStyleOptionFrame *>(option)) {
- QStyleOptionFrameV2 frameOptionV2(*frameOption);
-
- // draw the frame using frameOptionV2
- }
-//! [1]
-
-//! [2]
- if (const QStyleOptionProgressBar *progressBarOption =
- qstyleoption_cast<const QStyleOptionProgressBar *>(option)) {
- QStyleOptionProgressBarV2 progressBarV2(*progressBarOption);
-
- // draw the progress bar using progressBarV2
- }
-//! [2]
-
-//! [3]
- if (const QStyleOptionTab *tabOption =
- qstyleoption_cast<const QStyleOptionTab *>(option)) {
- QStyleOptionTabV2 tabV2(*tabOption);
-
- // draw the tab using tabV2
- }
-//! [3]
-}
-
//! [4]
void MyStyle::drawPrimitive(PrimitiveElement element,
const QStyleOption *option,
diff --git a/src/widgets/doc/src/widgets-and-layouts/styles.qdoc b/src/widgets/doc/src/widgets-and-layouts/styles.qdoc
index 74a5ce3189..a42ee0db61 100644
--- a/src/widgets/doc/src/widgets-and-layouts/styles.qdoc
+++ b/src/widgets/doc/src/widgets-and-layouts/styles.qdoc
@@ -989,9 +989,7 @@
The style option for tabs (QStyleOptionTab) contains the necessary
information for drawing tabs. The option contains the position of
the tab in the tab bar, the position of the selected tab, the
- shape of the tab, the text, and the icon. After Qt 4.1, the option
- should be cast to a QStyleOptionTabV2, which also contains the
- icon's size.
+ shape of the tab, the text, the icon, and the icon's size.
As the Java style tabs don't overlap, we also present an image of
a tab widget in the common style. Note that if you want the tabs
@@ -1024,7 +1022,7 @@
Note that individual tabs may be disabled even if the tab bar
is not. The tab will be active if the tab bar is active.
- Here follows a table of QStyleOptionTabV2's members:
+ Here follows a table of QStyleOptionTab's members:
\table 90%
\header
@@ -1450,7 +1448,7 @@
\li Content
\row
\li features
- \li Flags of the QStyleOptionFrameV2::FrameFeatures
+ \li Flags of the QStyleOptionFrame::FrameFeatures
enum describing the frame of the group box.
\row
\li lineWidth
@@ -1501,7 +1499,7 @@
\image javastyle/progressbarimage.png
- The style option for QProgressBar is QStyleOptionProgressBarV2.
+ The style option for QProgressBar is QStyleOptionProgressBar.
The bar does not set any state flags, but the other members of the
option are: