summaryrefslogtreecommitdiffstats
path: root/src/gui/doc/snippets/code/src_gui_painting_qbrush.cpp
blob: 69eedff7d10348909640a351e7c8dc530fee98fb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
// Copyright (C) 2016 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
#include <QPainter>

namespace src_gui_painting_qbrush {

struct Wrapper : public QPaintDevice {
    void wrapper();
};
void Wrapper::wrapper() {


//! [0]
QPainter painter(this);

painter.setBrush(Qt::cyan);
painter.setPen(Qt::darkCyan);
painter.drawRect(0, 0, 100,100);

painter.setBrush(Qt::NoBrush);
painter.setPen(Qt::darkGreen);
painter.drawRect(40, 40, 100, 100);
//! [0]


} // Wrapper::wrapper
} // src_gui_painting_qbrush