karbon
vstrokefillpreview.h00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020 #ifndef __VSTROKEFILLPREVIEW_H__
00021 #define __VSTROKEFILLPREVIEW_H__
00022
00023 #include <qframe.h>
00024 #include <qpixmap.h>
00025
00026 class VKoPainter;
00027 class VFill;
00028 class VStroke;
00029 class KarbonPart;
00030
00031 class VStrokeFillPreview : public QFrame
00032 {
00033 Q_OBJECT
00034
00035 public:
00036 VStrokeFillPreview( KarbonPart *part, QWidget* parent = 0L, const char* name = 0L );
00037 ~VStrokeFillPreview();
00038
00039 virtual QSize sizeHint() const
00040 { return QSize( 50, 50 ); }
00041 virtual QSize minimumSizeHint() const
00042 { return QSize( 20, 20 ); }
00043 virtual QSizePolicy sizePolicy() const
00044 { return QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Expanding ); }
00045
00046 void update( const VStroke &, const VFill & );
00047
00048 virtual bool eventFilter( QObject* object, QEvent* event );
00049
00050 bool strokeIsSelected() const { return m_strokeWidget; }
00051
00052 signals:
00053 void strokeChanged( const VStroke & );
00054 void fillChanged( const VFill& );
00055 void fillSelected();
00056 void strokeSelected();
00057
00058 protected:
00059 virtual void paintEvent( QPaintEvent* event );
00060
00061 private:
00062 VKoPainter* m_painter;
00063 void drawFill( const VFill & );
00064 void drawStroke( const VStroke & );
00065 QPixmap m_pixmap;
00066 KarbonPart *m_part;
00067 bool m_strokeWidget;
00068 const VFill *m_fill;
00069 const VStroke *m_stroke;
00070 };
00071
00072 #endif
00073
|