Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Loading...
Searching...
No Matches
finalwidget.h
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
4
#
ifndef
FINALWIDGET_H
5
#
define
FINALWIDGET_H
6
7
#
include
<
QFrame
>
8
#
include
<
QImage
>
9
#
include
<
QPoint
>
10
#
include
<
QSize
>
11
12
QT_BEGIN_NAMESPACE
13
14
class
QGridLayout;
15
class
QLabel;
16
class
QMouseEvent;
17
class
QWidget
;
18
19
class
FinalWidget
:
public
QFrame
20
{
21
Q_OBJECT
22
23
public
:
24
FinalWidget
(
QWidget
*
parent
,
const
QString
&
name
,
const
QSize
&
labelSize
);
25
void
setPixmap
(
const
QPixmap &pixmap);
26
QPixmap
pixmap
()
const
;
27
28
protected
:
29
void
mouseMoveEvent
(QMouseEvent *event)
override
;
30
void
mousePressEvent
(QMouseEvent *event)
override
;
31
32
private
:
33
void
createImage();
34
35
bool
hasImage;
36
QImage originalImage;
37
QLabel *imageLabel;
38
QLabel *nameLabel;
39
QPoint dragStartPosition;
40
};
41
42
QT_END_NAMESPACE
43
44
#
endif
FinalWidget
Definition
finalwidget.h:20
FinalWidget::mousePressEvent
void mousePressEvent(QMouseEvent *event) override
Check for left mouse button presses in order to enable drag and drop.
Definition
finalwidget.cpp:78
FinalWidget::mouseMoveEvent
void mouseMoveEvent(QMouseEvent *event) override
If the mouse moves far enough when the left mouse button is held down, start a drag and drop operatio...
Definition
finalwidget.cpp:41
FinalWidget::pixmap
QPixmap pixmap() const
Definition
finalwidget.cpp:84
FinalWidget::setPixmap
void setPixmap(const QPixmap &pixmap)
Definition
finalwidget.cpp:89
QPainter::QWidget
friend class QWidget
Definition
qpainter.h:431
qtbase
src
gui
doc
snippets
separations
finalwidget.h
Generated on
for Qt by
1.14.0