Qt
Internal/Contributor docs for the Qt SDK. <b>Note:</b> These are NOT official API docs; those are found <a href='https://doc.qt.io/'>here</a>.
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
12class QGridLayout;
13class QLabel;
14class QMouseEvent;
15class QWidget;
16
17class FinalWidget : public QFrame
18{
20
21public:
22 FinalWidget(QWidget *parent, const QString &name, const QSize &labelSize);
23 void setPixmap(const QPixmap &pixmap);
24 QPixmap pixmap() const;
25
26protected:
27 void mouseMoveEvent(QMouseEvent *event) override;
28 void mousePressEvent(QMouseEvent *event) override;
29
30private:
31 void createImage();
32
33 bool hasImage;
34 QImage originalImage;
35 QLabel *imageLabel;
36 QLabel *nameLabel;
37 QPoint dragStartPosition;
38};
39
40#endif
void mousePressEvent(QMouseEvent *event) override
Check for left mouse button presses in order to enable drag and drop.
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...
QPixmap pixmap() const
void setPixmap(const QPixmap &pixmap)
FinalWidget(QWidget *parent, const QString &name, const QSize &labelSize)
The QFrame class is the base class of widgets that can have a frame.
Definition qframe.h:17
The QGridLayout class lays out widgets in a grid.
Definition qgridlayout.h:21
\inmodule QtGui
Definition qimage.h:37
The QLabel widget provides a text or image display.
Definition qlabel.h:20
\inmodule QtGui
Definition qevent.h:196
QObject * parent() const
Returns a pointer to the parent object.
Definition qobject.h:346
Returns a copy of the pixmap that is transformed using the given transformation transform and transfo...
Definition qpixmap.h:27
\inmodule QtCore\reentrant
Definition qpoint.h:25
\inmodule QtCore
Definition qsize.h:25
\macro QT_RESTRICTED_CAST_FROM_ASCII
Definition qstring.h:129
The QWidget class is the base class of all user interface objects.
Definition qwidget.h:99
GLuint name
struct _cl_event * event
#define Q_OBJECT