• Skip to content
  • Skip to link menu
KDE API Reference
  • KDE API Reference
  • kdeedu API Reference
  • KDE Home
  • Contact Us
 

parley

  • sources
  • kde-4.14
  • kdeedu
  • parley
  • src
  • practice
imagewidget.h
Go to the documentation of this file.
1 /***************************************************************************
2  Copyright 2009 Daniel Laidig <d.laidig@gmx.de>
3  ***************************************************************************/
4 
5 /***************************************************************************
6  * *
7  * This program is free software; you can redistribute it and/or modify *
8  * it under the terms of the GNU General Public License as published by *
9  * the Free Software Foundation; either version 2 of the License, or *
10  * (at your option) any later version. *
11  * *
12  ***************************************************************************/
13 
14 #ifndef PRACTICE_IMAGEWIDGET_H
15 #define PRACTICE_IMAGEWIDGET_H
16 
17 #include <QtGui/QWidget>
18 
19 class QTimeLine;
20 
21 namespace Practice
22 {
23 
24 class ImageWidget : public QWidget
25 {
26  Q_OBJECT
27 
28 public:
29  ImageWidget(QWidget *parent = 0);
30 
31  void setPixmap(const QPixmap& pixmap);
32  void setScalingEnabled(bool scaling, bool onlyDownscaling = true);
33  void setKeepAspectRatio(Qt::AspectRatioMode mode);
34  void setFadingEnabled(bool fading);
35  void setAlignment(Qt::Alignment alignment);
36 
37 protected:
38  virtual void paintEvent(QPaintEvent *e);
39  virtual void resizeEvent(QResizeEvent *e);
40 
41 signals:
42  void sizeChanged();
43 
44 private Q_SLOTS:
45  void scalePixmap(bool smooth = true);
46  void animationFinished();
47 
48 private:
49  bool m_fading;
50  bool m_scaling;
51  bool m_onlyDownscaling;
52  Qt::AspectRatioMode m_keepAspectRatio;
53  Qt::Alignment m_alignment;
54  QPixmap m_originalPixmap;
55  QPixmap m_scaledPixmap;
56  QPixmap m_scaledBackupPixmap;
57  QPixmap m_animationPixmap;
58  bool m_scaledPixmapOutOfDate;
60  QTimer *m_scaleTimer;
61  QTimeLine *m_animation;
62 };
63 
64 }
65 
66 #endif // PRACTICE_IMAGEWIDGET_H
QResizeEvent
QWidget
Practice::ImageWidget::ImageWidget
ImageWidget(QWidget *parent=0)
Definition: imagewidget.cpp:185
Practice::ImageWidget::paintEvent
virtual void paintEvent(QPaintEvent *e)
Definition: imagewidget.cpp:245
Practice::ImageWidget::setAlignment
void setAlignment(Qt::Alignment alignment)
Definition: imagewidget.cpp:240
Qt::Alignment
typedef Alignment
Practice::ImageWidget::setScalingEnabled
void setScalingEnabled(bool scaling, bool onlyDownscaling=true)
Definition: imagewidget.cpp:224
Practice::ImageWidget::resizeEvent
virtual void resizeEvent(QResizeEvent *e)
Definition: imagewidget.cpp:273
Practice::ImageWidget::setKeepAspectRatio
void setKeepAspectRatio(Qt::AspectRatioMode mode)
Definition: imagewidget.cpp:230
QTimer
Practice::ImageWidget::setPixmap
void setPixmap(const QPixmap &pixmap)
Definition: imagewidget.cpp:200
QPixmap
QTimeLine
Practice::ImageWidget::setFadingEnabled
void setFadingEnabled(bool fading)
Definition: imagewidget.cpp:235
Practice::ImageWidget
Definition: imagewidget.h:24
QPaintEvent
Practice::ImageWidget::sizeChanged
void sizeChanged()
QObject::parent
QObject * parent() const
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Jun 22 2020 13:15:56 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

parley

Skip menu "parley"
  • Main Page
  • Namespace List
  • Namespace Members
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • File Members
  • Related Pages

kdeedu API Reference

Skip menu "kdeedu API Reference"
  • Analitza
  •     lib
  • kalgebra
  • kalzium
  •   libscience
  • kanagram
  • kig
  •   lib
  • klettres
  • marble
  • parley
  • rocs
  •   App
  •   RocsCore
  •   VisualEditor
  •   stepcore

Search



Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal