summaryrefslogtreecommitdiffstats
path: root/src/widgets/doc/snippets/qstyleoption
diff options
context:
space:
mode:
Diffstat (limited to 'src/widgets/doc/snippets/qstyleoption')
-rw-r--r--src/widgets/doc/snippets/qstyleoption/main.cpp33
1 files changed, 0 insertions, 33 deletions
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,