16
|
1 |
#ifndef ScaleThreePainter_H
|
|
2 |
#define ScaleThreePainter_H
|
|
3 |
|
|
4 |
#include <QPixmap>
|
|
5 |
|
|
6 |
class QPainter;
|
|
7 |
class QString;
|
|
8 |
class QStyleOptionGraphicsItem;
|
|
9 |
class QWidget;
|
|
10 |
|
|
11 |
namespace GVA {
|
|
12 |
|
|
13 |
/*!
|
|
14 |
* This class paints a resizable window background using separate images for its' left, middle and right areas.
|
|
15 |
*/
|
|
16 |
class ScaleThreePainter
|
|
17 |
{
|
|
18 |
public:
|
|
19 |
ScaleThreePainter(const QString &leftFilename,
|
|
20 |
const QString &middleFilename,
|
|
21 |
const QString &rightFilename
|
|
22 |
);
|
|
23 |
~ScaleThreePainter();
|
|
24 |
|
|
25 |
void paint(QPainter* painter, const QRect &rect, QWidget* widget);
|
|
26 |
void unloadPixmaps();
|
|
27 |
|
|
28 |
private:
|
|
29 |
void loadPixmaps();
|
|
30 |
|
|
31 |
private:
|
|
32 |
QString m_leftFilename;
|
|
33 |
QString m_middleFilename;
|
|
34 |
QString m_rightFilename;
|
|
35 |
QPixmap *m_leftPixmap;
|
|
36 |
QPixmap *m_middlePixmap;
|
|
37 |
QPixmap *m_rightPixmap;
|
|
38 |
bool m_pixmapsLoaded;
|
|
39 |
};
|
|
40 |
|
|
41 |
} // GVA namespace
|
|
42 |
|
|
43 |
#endif // ScaleThreePainter_H
|