summaryrefslogtreecommitdiffstats
path: root/src/widgets/doc/snippets/code/src_gui_styles_qstyleoption.cpp
blob: 44cb0b35ebccce26da984d5daa470a394923d07f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
// Copyright (C) 2016 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause

//! [0]
int MyStyle::styleHint(StyleHint stylehint, const QStyleOption *opt,
                       const QWidget *widget, QStyleHintReturn* returnData) const;
{
    if (stylehint == SH_RubberBand_Mask) {
        const QStyleHintReturnMask *maskReturn =
                qstyleoption_cast<const QStyleHintReturnMask *>(hint);
        if (maskReturn) {
            ...
        }
    }
    ...
}
//! [0]