Qt
6.x
The Qt SDK
Loading...
Searching...
No Matches
src_gui_widgets_qscrollarea.cpp
Go to the documentation of this file.
1
// Copyright (C) 2016 The Qt Company Ltd.
2
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
3
5
QLabel
*
imageLabel
=
new
QLabel
;
6
QImage
image
(
"happyguy.png"
);
7
imageLabel
->
setPixmap
(
QPixmap::fromImage
(
image
));
8
9
scrollArea
=
new
QScrollArea
;
10
scrollArea
->setBackgroundRole(
QPalette::Dark
);
11
scrollArea
->setWidget(
imageLabel
);
QImage
\inmodule QtGui
Definition
qimage.h:37
QLabel
The QLabel widget provides a text or image display.
Definition
qlabel.h:20
QLabel::setPixmap
void setPixmap(const QPixmap &)
Definition
qlabel.cpp:339
QPalette::Dark
@ Dark
Definition
qpalette.h:50
QPixmap::fromImage
static QPixmap fromImage(const QImage &image, Qt::ImageConversionFlags flags=Qt::AutoColor)
Converts the given image to a pixmap using the specified flags to control the conversion.
Definition
qpixmap.cpp:1445
QScrollArea
The QScrollArea class provides a scrolling view onto another widget.
Definition
qscrollarea.h:17
image
Definition
image.cpp:4
imageLabel
QLabel * imageLabel
[0]
Definition
src_gui_widgets_qscrollarea.cpp:5
scrollArea
scrollArea
Definition
src_gui_widgets_qscrollarea.cpp:9
image
QImage image("happyguy.png")
qtbase
src
widgets
doc
snippets
code
src_gui_widgets_qscrollarea.cpp
Generated by
1.9.7