QtBase  v6.3.1
backgrounditem.h
Go to the documentation of this file.
1 /****************************************************************************
2 **
3 ** Copyright (C) 2016 The Qt Company Ltd.
4 ** Contact: https://www.qt.io/licensing/
5 **
6 ** This file is part of the examples of the Qt Toolkit.
7 **
8 ** $QT_BEGIN_LICENSE:GPL-EXCEPT$
9 ** Commercial License Usage
10 ** Licensees holding valid commercial Qt licenses may use this file in
11 ** accordance with the commercial license agreement provided with the
12 ** Software or, alternatively, in accordance with the terms contained in
13 ** a written agreement between you and The Qt Company. For licensing terms
14 ** and conditions see https://www.qt.io/terms-conditions. For further
15 ** information use the contact form at https://www.qt.io/contact-us.
16 **
17 ** GNU General Public License Usage
18 ** Alternatively, this file may be used under the terms of the GNU
19 ** General Public License version 3 as published by the Free Software
20 ** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
21 ** included in the packaging of this file. Please review the following
22 ** information to ensure the GNU General Public License requirements will
23 ** be met: https://www.gnu.org/licenses/gpl-3.0.html.
24 **
25 ** $QT_END_LICENSE$
26 **
27 ****************************************************************************/
28 
29 #ifndef __BACKGROUNDITEM_H__
30 #define __BACKGROUNDITEM_H__
31 
32 #include <QPixmap>
33 
34 #include "gvbwidget.h"
35 
36 class QGraphicsWidget;
37 
38 class BackgroundItem : public GvbWidget
39 {
40  Q_OBJECT
41 
42 public:
45 
46  void paint(QPainter *painter,
48  QWidget *widget = 0);
50 
51 public slots:
52  void themeChange();
53 
54 private:
55  QPixmap m_background;
56  QString m_fileName;
57 };
58 
59 #endif /* __BACKGROUNDITEM_H__ */
BackgroundItem(const QString &filename, QGraphicsWidget *parent=0)
void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget=0)
void resizeEvent(QGraphicsSceneResizeEvent *event)
QGraphicsObject * parent
the parent of the item
The QGraphicsSceneResizeEvent class provides events for widget resizing in the graphics view framewor...
The QGraphicsWidget class is the base class for all widget items in a QGraphicsScene.
The QPainter class performs low-level painting on widgets and other paint devices.
Definition: qpainter.h:82
The QPixmap class is an off-screen image representation that can be used as a paint device.
Definition: qpixmap.h:63
The QString class provides a Unicode character string.
Definition: qstring.h:388
The QStyleOptionGraphicsItem class is used to describe the parameters needed to draw a QGraphicsItem.
Definition: qstyleoption.h:684
The QWidget class is the base class of all user interface objects.
Definition: qwidget.h:133
QOpenGLWidget * widget
[1]
struct _cl_event * event
Definition: qopenglext.h:2998
GLuint GLenum option
Definition: qopenglext.h:5929
#define Q_OBJECT
Definition: qtmetamacros.h:158
#define slots
Definition: qtmetamacros.h:76
QPainter painter(this)
[7]