Mercurial > retraceit
annotate src/imagelabel.h @ 38:26e1521b9afd
Add the possibility to detach the picture label on doubleclick
author | Andre Heinecke <andre.heinecke@intevation.de> |
---|---|
date | Wed, 06 May 2015 18:09:34 +0200 |
parents | 64a51a42c01f |
children | 098a10fc2e83 |
rev | line source |
---|---|
3
248d5d1cdb38
Add functionalty to control buttons and make picture resizable
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff
changeset
|
1 #ifndef IMAGELABEL_H |
248d5d1cdb38
Add functionalty to control buttons and make picture resizable
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff
changeset
|
2 #define IMAGELABEL_H |
25
64a51a42c01f
Assign copyright correctly
Andre Heinecke <andre.heinecke@intevation.de>
parents:
3
diff
changeset
|
3 /* Copyright (C) 2015 by ETH Zürich |
64a51a42c01f
Assign copyright correctly
Andre Heinecke <andre.heinecke@intevation.de>
parents:
3
diff
changeset
|
4 * Software engineering by Intevation GmbH |
3
248d5d1cdb38
Add functionalty to control buttons and make picture resizable
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff
changeset
|
5 * |
248d5d1cdb38
Add functionalty to control buttons and make picture resizable
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff
changeset
|
6 * This file is Free Software under the GNU GPL (v>=2) |
248d5d1cdb38
Add functionalty to control buttons and make picture resizable
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff
changeset
|
7 * and comes with ABSOLUTELY NO WARRANTY! |
248d5d1cdb38
Add functionalty to control buttons and make picture resizable
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff
changeset
|
8 * See LICENSE.txt for details. |
248d5d1cdb38
Add functionalty to control buttons and make picture resizable
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff
changeset
|
9 */ |
248d5d1cdb38
Add functionalty to control buttons and make picture resizable
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff
changeset
|
10 |
248d5d1cdb38
Add functionalty to control buttons and make picture resizable
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff
changeset
|
11 #include <QWidget> |
248d5d1cdb38
Add functionalty to control buttons and make picture resizable
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff
changeset
|
12 #include <QPixmap> |
248d5d1cdb38
Add functionalty to control buttons and make picture resizable
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff
changeset
|
13 #include <QLabel> |
248d5d1cdb38
Add functionalty to control buttons and make picture resizable
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff
changeset
|
14 |
38
26e1521b9afd
Add the possibility to detach the picture label on doubleclick
Andre Heinecke <andre.heinecke@intevation.de>
parents:
25
diff
changeset
|
15 class QMouseEvent; |
26e1521b9afd
Add the possibility to detach the picture label on doubleclick
Andre Heinecke <andre.heinecke@intevation.de>
parents:
25
diff
changeset
|
16 |
3
248d5d1cdb38
Add functionalty to control buttons and make picture resizable
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff
changeset
|
17 class ImageLabel : public QWidget |
248d5d1cdb38
Add functionalty to control buttons and make picture resizable
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff
changeset
|
18 { |
248d5d1cdb38
Add functionalty to control buttons and make picture resizable
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff
changeset
|
19 Q_OBJECT |
248d5d1cdb38
Add functionalty to control buttons and make picture resizable
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff
changeset
|
20 |
248d5d1cdb38
Add functionalty to control buttons and make picture resizable
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff
changeset
|
21 public: |
248d5d1cdb38
Add functionalty to control buttons and make picture resizable
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff
changeset
|
22 explicit ImageLabel(QWidget *parent = 0); |
248d5d1cdb38
Add functionalty to control buttons and make picture resizable
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff
changeset
|
23 const QPixmap* pixmap() const; |
248d5d1cdb38
Add functionalty to control buttons and make picture resizable
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff
changeset
|
24 |
248d5d1cdb38
Add functionalty to control buttons and make picture resizable
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff
changeset
|
25 public slots: |
248d5d1cdb38
Add functionalty to control buttons and make picture resizable
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff
changeset
|
26 void setPixmap(const QPixmap&); |
248d5d1cdb38
Add functionalty to control buttons and make picture resizable
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff
changeset
|
27 |
38
26e1521b9afd
Add the possibility to detach the picture label on doubleclick
Andre Heinecke <andre.heinecke@intevation.de>
parents:
25
diff
changeset
|
28 Q_SIGNALS: |
26e1521b9afd
Add the possibility to detach the picture label on doubleclick
Andre Heinecke <andre.heinecke@intevation.de>
parents:
25
diff
changeset
|
29 void doubleClicked(); |
26e1521b9afd
Add the possibility to detach the picture label on doubleclick
Andre Heinecke <andre.heinecke@intevation.de>
parents:
25
diff
changeset
|
30 void closeRequested(); |
26e1521b9afd
Add the possibility to detach the picture label on doubleclick
Andre Heinecke <andre.heinecke@intevation.de>
parents:
25
diff
changeset
|
31 |
3
248d5d1cdb38
Add functionalty to control buttons and make picture resizable
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff
changeset
|
32 protected: |
248d5d1cdb38
Add functionalty to control buttons and make picture resizable
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff
changeset
|
33 void resizeEvent(QResizeEvent *); |
38
26e1521b9afd
Add the possibility to detach the picture label on doubleclick
Andre Heinecke <andre.heinecke@intevation.de>
parents:
25
diff
changeset
|
34 void mouseDoubleClickEvent(QMouseEvent * event); |
26e1521b9afd
Add the possibility to detach the picture label on doubleclick
Andre Heinecke <andre.heinecke@intevation.de>
parents:
25
diff
changeset
|
35 void closeEvent(QCloseEvent *); |
3
248d5d1cdb38
Add functionalty to control buttons and make picture resizable
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff
changeset
|
36 |
248d5d1cdb38
Add functionalty to control buttons and make picture resizable
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff
changeset
|
37 private slots: |
248d5d1cdb38
Add functionalty to control buttons and make picture resizable
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff
changeset
|
38 void resizeImage(); |
248d5d1cdb38
Add functionalty to control buttons and make picture resizable
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff
changeset
|
39 |
248d5d1cdb38
Add functionalty to control buttons and make picture resizable
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff
changeset
|
40 private: |
248d5d1cdb38
Add functionalty to control buttons and make picture resizable
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff
changeset
|
41 QLabel *label; |
248d5d1cdb38
Add functionalty to control buttons and make picture resizable
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff
changeset
|
42 }; |
248d5d1cdb38
Add functionalty to control buttons and make picture resizable
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff
changeset
|
43 |
248d5d1cdb38
Add functionalty to control buttons and make picture resizable
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff
changeset
|
44 #endif // IMAGELABEL_H |