KWidgetsAddons

kpixmapsequenceoverlaypainter.h
1 /*
2  SPDX-FileCopyrightText: 2009 Sebastian Trueg <[email protected]>
3 
4  SPDX-License-Identifier: LGPL-2.1-or-later
5 */
6 
7 #ifndef _K_PIXMAPSEQUENCE_OVERLAY_PAINTER_H_
8 #define _K_PIXMAPSEQUENCE_OVERLAY_PAINTER_H_
9 
10 #include <QObject>
11 #include <QPoint>
12 
13 #include <kwidgetsaddons_export.h>
14 
15 class KPixmapSequence;
16 class QWidget;
17 class QEvent;
18 class QRect;
19 
33 class KWIDGETSADDONS_EXPORT KPixmapSequenceOverlayPainter : public QObject
34 {
35  Q_OBJECT
36 
37 public:
41  explicit KPixmapSequenceOverlayPainter(QObject *parent = nullptr);
42  KPixmapSequenceOverlayPainter(const KPixmapSequence &seq, QObject *parent = nullptr);
43 
48 
54  KPixmapSequence sequence() const;
55 
61  int interval() const;
62 
67  QRect rect() const;
68 
73  Qt::Alignment alignment() const;
74 
79  QPoint offset() const;
80 
81 public Q_SLOTS:
85  void setSequence(const KPixmapSequence &seq);
86 
90  void setInterval(int msecs);
91 
95  void setWidget(QWidget *w);
96 
108  void setRect(const QRect &rect);
109 
116  void setAlignment(Qt::Alignment align);
117 
126  void setOffset(const QPoint &offset);
127 
133  void start();
134 
138  void stop();
139 
140 protected:
141  bool eventFilter(QObject *obj, QEvent *event) override;
142 
143 private:
144  class Private;
145  Private *const d;
146 
147  Q_PRIVATE_SLOT(d, void _k_timeout())
148 };
149 
150 #endif
Loads and gives access to the frames of a typical multi-row pixmap as often used for spinners...
typedef Alignment
virtual bool eventFilter(QObject *watched, QEvent *event)
Paints a KPixmapSequence on top of any widget at any position.
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Aug 10 2020 22:47:13 by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.