summaryrefslogtreecommitdiffstats
path: root/examples/threads/mandelbrot/mandelbrotwidget.h
diff options
context:
space:
mode:
Diffstat (limited to 'examples/threads/mandelbrot/mandelbrotwidget.h')
-rw-r--r--examples/threads/mandelbrot/mandelbrotwidget.h30
1 files changed, 28 insertions, 2 deletions
diff --git a/examples/threads/mandelbrot/mandelbrotwidget.h b/examples/threads/mandelbrot/mandelbrotwidget.h
index 5af3a8dffd..53bbeb6469 100644
--- a/examples/threads/mandelbrot/mandelbrotwidget.h
+++ b/examples/threads/mandelbrot/mandelbrotwidget.h
@@ -43,9 +43,35 @@
#include <QPixmap>
#include <QWidget>
-
#include "renderthread.h"
+#if defined(Q_WS_S60) || defined(Q_WS_MAEMO_5) || defined(Q_WS_SIMULATOR)
+#include <QPushButton>
+
+class ZoomButton : public QPushButton
+{
+ Q_OBJECT
+public:
+ ZoomButton(const QString &text, double zoomFactor, QWidget *parent = NULL)
+ : QPushButton(text, parent), m_ZoomFactor(zoomFactor)
+ {
+ connect(this, SIGNAL(clicked()), this, SLOT(handleClick()));
+ }
+
+signals:
+ void zoom(double zoomFactor);
+
+private slots:
+ void handleClick()
+ {
+ emit zoom(m_ZoomFactor);
+ }
+
+private:
+ const double m_ZoomFactor;
+};
+#endif
+
//! [0]
class MandelbrotWidget : public QWidget
{
@@ -65,9 +91,9 @@ protected:
private slots:
void updatePixmap(const QImage &image, double scaleFactor);
+ void zoom(double zoomFactor);
private:
- void zoom(double zoomFactor);
void scroll(int deltaX, int deltaY);
RenderThread thread;