summaryrefslogtreecommitdiffstats
path: root/src/widgets/doc/snippets/widget-mask/main.cpp
blob: 90841bf3daa50e20f671bfac2a2a8d93581ee270 (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

#include <QtGui>

int main(int argc, char *argv[])
{
    QApplication app(argc, argv);
//! [0]
    QLabel topLevelLabel;
    QPixmap pixmap(":/images/tux.png");
    topLevelLabel.setPixmap(pixmap);
    topLevelLabel.setMask(pixmap.mask());
//! [0]
    topLevelLabel.show();
    return app.exec();
}