-rw-r--r-- | examples/applet/simpleimpl.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/examples/applet/simpleimpl.cpp b/examples/applet/simpleimpl.cpp index 62d9bf7..ff651ca 100644 --- a/examples/applet/simpleimpl.cpp +++ b/examples/applet/simpleimpl.cpp | |||
@@ -26,65 +26,66 @@ SimpleApplet::SimpleApplet(QWidget *parent) | |||
26 | 26 | ||
27 | QImage image = Resource::loadImage("Tux"); | 27 | QImage image = Resource::loadImage("Tux"); |
28 | /* | 28 | /* |
29 | * smooth scale to AppLnk smallIconSize for applest | 29 | * smooth scale to AppLnk smallIconSize for applest |
30 | * smallIconSize gets adjusted to the resolution | 30 | * smallIconSize gets adjusted to the resolution |
31 | * so on some displays like SIMpad and a C-750 the smallIconSize | 31 | * so on some displays like SIMpad and a C-750 the smallIconSize |
32 | * is greater than on a iPAQ h3870 | 32 | * is greater than on a iPAQ h3870 |
33 | */ | 33 | */ |
34 | image = image.smoothScale(AppLnk::smallIconSize(), AppLnk::smallIconSize() ); | 34 | image = image.smoothScale(AppLnk::smallIconSize(), AppLnk::smallIconSize() ); |
35 | 35 | ||
36 | /* | 36 | /* |
37 | * now we need to convert the Image to a Pixmap cause these | 37 | * now we need to convert the Image to a Pixmap cause these |
38 | * can be drawn more easily | 38 | * can be drawn more easily |
39 | */ | 39 | */ |
40 | m_pix = new QPixmap(); | 40 | m_pix = new QPixmap(); |
41 | m_pix->convertFromImage( image ); | 41 | m_pix->convertFromImage( image ); |
42 | 42 | ||
43 | /* | 43 | /* |
44 | * Now we will say that we don't want to be bigger than our | 44 | * Now we will say that we don't want to be bigger than our |
45 | * Pixmap | 45 | * Pixmap |
46 | */ | 46 | */ |
47 | setFixedHeight(AppLnk::smallIconSize() ); | 47 | setFixedHeight(AppLnk::smallIconSize() ); |
48 | setFixedWidth( AppLnk::smallIconSize() ); | 48 | setFixedWidth( AppLnk::smallIconSize() ); |
49 | 49 | ||
50 | } | 50 | } |
51 | 51 | ||
52 | SimpleApplet::~SimpleApplet() { | 52 | SimpleApplet::~SimpleApplet() { |
53 | delete m_pix; | 53 | delete m_pix; |
54 | } | 54 | } |
55 | 55 | ||
56 | 56 | ||
57 | /* | 57 | /* |
58 | * here you would normal show or do something | 58 | * here you would normal show or do something |
59 | * useful. If you want to show a widget at the top left | 59 | * useful. If you want to show a widget at the top left |
60 | * of your icon you need to map your rect().topLeft() to | 60 | * of your icon you need to map your rect().topLeft() to |
61 | * global with mapToGlobal(). Then you might also need to | 61 | * global with mapToGlobal(). Then you might also need to |
62 | * move the widgets so it is visible | 62 | * move the widgets so it is visible |
63 | */ | 63 | */ |
64 | void SimpleApplet::mousePressEvent(QMouseEvent* ) { | 64 | void SimpleApplet::mousePressEvent(QMouseEvent* ) { |
65 | QMessageBox::information(this, tr("No action taken"), | 65 | QMessageBox::information(this, tr("No action taken"), |
66 | tr("<qt>This Plugin does not yet support anything usefule aye.</qt>"), | 66 | tr("<qt>This Plugin does not yet support anything usefule aye.</qt>"), |
67 | QMessageBox::Ok ); | 67 | QMessageBox::Ok ); |
68 | 68 | ||
69 | } | 69 | } |
70 | 70 | ||
71 | void SimpleApplet::paintEvent( QPaintEvent* ) { | 71 | void SimpleApplet::paintEvent( QPaintEvent* ) { |
72 | QPainter p(this); | 72 | QPainter p(this); |
73 | 73 | ||
74 | /* simpy draw the pixmap from the start of this widget */ | 74 | /* simpy draw the pixmap from the start of this widget */ |
75 | p.drawPixmap(0, 0, *m_pix ); | 75 | p.drawPixmap(0, 0, *m_pix ); |
76 | } | 76 | } |
77 | 77 | ||
78 | /* | 78 | /* |
79 | * We need to add this symbol for the plugin exporter! | 79 | * We need to add this symbol for the plugin exporter! |
80 | */ | 80 | */ |
81 | int SimpleApplet::position(){ | 81 | int SimpleApplet::position(){ |
82 | return 1; | 82 | return 1; |
83 | } | 83 | } |
84 | 84 | ||
85 | 85 | ||
86 | 86 | ||
87 | /* | 87 | /* |
88 | * Here comes the implementation of the interface | 88 | * Here comes the implementation of the interface |
89 | */ | 89 | */ |
90 | EXPORT_OPIE_APPLET_v1( SimpleApplet ) \ No newline at end of file | 90 | EXPORT_OPIE_APPLET_v1( SimpleApplet ) |
91 | |||