28 class QPixmap; |
28 class QPixmap; |
29 |
29 |
30 class WidgetWithBackground : public QWidget |
30 class WidgetWithBackground : public QWidget |
31 { |
31 { |
32 Q_OBJECT |
32 Q_OBJECT |
33 public: |
33 public: |
34 /** Konstruktor */ |
34 /** Constructor */ |
35 WidgetWithBackground(QWidget * parent = 0); |
35 WidgetWithBackground(QWidget * parent = 0); |
36 |
36 |
37 /** Destruktor - usuwa bitmapkę. */ |
37 /** Destructor - removes the bitmap. */ |
38 ~WidgetWithBackground (); |
38 ~WidgetWithBackground (); |
39 |
39 |
40 /** |
40 /** |
41 * Operacja odmalowywania kontrolki - |
41 * An operation to repaint a control - |
42 * wkleja bitmapę z tłem na kontrolkę - |
42 * Pastes the background bitmap onto the control - |
43 * generująć ją wcześniej jeżeli zajdzie taka potrzeba. |
43 * Generate it earlier if needed. |
44 */ |
44 */ |
45 void drawBackground (); |
45 void drawBackground (); |
46 |
46 |
47 /** Odmalowywuje kontrolkę bezwarunkowo odmalowywując tło. */ |
47 /** Repaints the control by painting the background unconditionally. */ |
48 void updateWithBackground (); |
48 void updateWithBackground (); |
49 |
49 |
50 /** |
50 /** |
51 * Zawraca informacje czy kontrolka została zmodyfikowana |
51 * Returns whether a control has been modified. |
52 * Ta informacja jest ustawiana gdy bitmapka tła się zmienia |
52 * This information is set when the background bitmap changes, that is, |
53 * to znaczy zmienia się rozmiar komponentu lub istnieje |
53 * the size of the component changes or the background needs to be repainted. |
54 * potrzeba przemalowania tła. |
54 */ |
55 */ |
|
56 bool doRepaintBackground(); |
55 bool doRepaintBackground(); |
57 |
56 |
58 protected: |
57 protected: |
59 /** Wywołuje paintBackground - odmalowywując tło na nowo */ |
58 /** Invoke paintBackground - redrawing the background */ |
60 void repaintBackground(); |
59 void repaintBackground(); |
61 |
60 |
62 /** |
61 /** |
63 * Odmalowywuje tło kontrolki |
62 * Repaints the background of the control |
64 * @param painter urządzenie na ktróym mamy malować. |
63 * @param painter the device on which we are to paint. |
65 * @param background to tło kontrolki |
64 * @param background this is the background of the indicator |
66 */ |
65 */ |
67 virtual void paintBackground (QPainter & painer) = 0; |
66 virtual void paintBackground (QPainter & painer) = 0; |
68 |
|
69 |
|
70 |
67 |
71 protected: |
68 protected: |
72 /** Bufor na tło. */ |
69 /** Background buffer. */ |
73 QPixmap * m_pixmap; |
70 QPixmap * m_pixmap; |
|
71 |
74 /** |
72 /** |
75 * Ustawia tą zmienną po zmianie właściwości |
73 * Sets this variable after a property change |
76 */ |
74 */ |
77 bool m_modified; |
75 bool m_modified; |
78 }; |
76 }; |
|
77 |
79 #endif //WIDGETWITHBACKGROUND_H |
78 #endif //WIDGETWITHBACKGROUND_H |
80 |
79 |