1 //============================================================================
3 // KRotation screen saver for KDE
4 // Copyright (C) 2004 Georg Drenkhahn
7 //============================================================================
9 #ifndef SSPREVIEWAREA_H
10 #define SSPREVIEWAREA_H
14 #include <QResizeEvent>
16 /** @brief Reimplementation of QWidget emitting a signal if resized.
18 * This class is equalt to QWidget except for the fact that the signal resized()
19 * is emitted if the widget gets resized. By this signaling mechanism it is
20 * possible to resize the embedded GL area object within the screen saver setup
23 * In the constructor of the dialog widget (KPendulumSetup::KPendulumSetup(),
24 * KRotationSetup::KRotationSetup()) the signal SsPreviewArea::resized() is
25 * connected with a slot of the screensaver class
26 * (KPendulumSaver::resizeGlArea(), KRotationSaver::resizeGlArea()). This slot
27 * function calls the reimplemented QGLWidget::resizeGL() method of the GL
28 * widgets (PendulumGLWidget::resizeGL(), RotationGLWidget::resizeGL()) which
29 * really resizes the GL scenery. */
30 class SsPreviewArea
: public QWidget
35 /** @brief Constructor for SsPreviewArea
36 * @param parent Pointer tp parent widget, forwarded to the QWidget
39 * The constructor just calls QWidget::QWidget() with the given arguments.
41 SsPreviewArea(QWidget
* parent
= NULL
);
44 /** @brief Called if widget gets resized.
45 * @param e Pointer to the corresponding QResizeEvent object containing the
48 * Reimplemented event handler from QWidget. Only the signal resized() is
50 virtual void resizeEvent(QResizeEvent
* e
);
53 /** @brief Signal which is emitted in the resizeEvent() method.
54 * @param e Pointer to the corresponding QResizeEvent object */
55 void resized(QResizeEvent
* e
);