summaryrefslogtreecommitdiffstats
path: root/src/gui/image/qbitmap.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/gui/image/qbitmap.cpp')
-rw-r--r--src/gui/image/qbitmap.cpp56
1 files changed, 15 insertions, 41 deletions
diff --git a/src/gui/image/qbitmap.cpp b/src/gui/image/qbitmap.cpp
index e8733885a5..2208cca1be 100644
--- a/src/gui/image/qbitmap.cpp
+++ b/src/gui/image/qbitmap.cpp
@@ -1,41 +1,5 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtGui module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2016 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
#include "qbitmap.h"
#include <qpa/qplatformpixmap.h>
@@ -46,6 +10,8 @@
#include <qpainter.h>
#include <private/qguiapplication_p.h>
+#include <memory>
+
QT_BEGIN_NAMESPACE
/*!
@@ -133,6 +99,12 @@ QBitmap::QBitmap(const QSize &size)
}
/*!
+ \internal
+ This dtor must stay empty until Qt 7 (was inline until 6.2).
+*/
+QBitmap::~QBitmap() = default;
+
+/*!
\fn QBitmap::clear()
Clears the bitmap, setting all its bits to Qt::color0.
@@ -183,10 +155,10 @@ static QBitmap makeBitmap(QImage &&image, Qt::ImageConversionFlags flags)
image.setColor(1, c0);
}
- QScopedPointer<QPlatformPixmap> data(QGuiApplicationPrivate::platformIntegration()->createPlatformPixmap(QPlatformPixmap::BitmapType));
+ std::unique_ptr<QPlatformPixmap> data(QGuiApplicationPrivate::platformIntegration()->createPlatformPixmap(QPlatformPixmap::BitmapType));
data->fromImageInPlace(image, flags | Qt::MonoOnly);
- return QBitmap::fromPixmap(QPixmap(data.take()));
+ return QBitmap::fromPixmap(QPixmap(data.release()));
}
/*!
@@ -224,7 +196,7 @@ QBitmap QBitmap::fromImage(QImage &&image, Qt::ImageConversionFlags flags)
Constructs a bitmap with the given \a size, and sets the contents to
the \a bits supplied.
- The bitmap data has to be byte aligned and provided in in the bit
+ The bitmap data has to be byte aligned and provided in the bit
order specified by \a monoFormat. The mono format must be either
QImage::Format_Mono or QImage::Format_MonoLSB. Use
QImage::Format_Mono to specify data on the XBM format.
@@ -254,6 +226,8 @@ QBitmap QBitmap::fromData(const QSize &size, const uchar *bits, QImage::Format m
If the pixmap has a depth greater than 1, the resulting bitmap
will be dithered automatically.
+ \since 6.0
+
\sa QPixmap::depth()
*/