#include <qwt_pixframe.h>
Inherits QFrame.
Inherited by QwtPlotPixFrame.
Inheritance diagram for QwtPixFrame
Public Methods | |
QwtPixFrame (QWidget *parent, const char *name =0) | |
~QwtPixFrame () | |
void | setPixmap (const QPixmap &pix) |
const QPixmap* | pixmap () const |
void | fillPixmap (const QColor &c) |
void | clearPixmap () |
void | updatePixmap () |
void | updatePixmapRect (const QRect &r) |
void | setPixmapBackground (const QColor &c) |
void | setVariableSize (bool tf) |
const QColor& | pixmapBackground () const |
Signals | |
void | pixmapResized () |
Protected Methods | |
void | adjustPixmap () |
void | adjustFrame () |
virtual void | paintEvent (QPaintEvent *e) |
virtual void | resizeEvent (QResizeEvent *e) |
virtual void | frameChanged () |
Protected Attributes | |
QPixmap | d_pix |
bool | d_adjustPixmap |
QwtPixFrame is a frame which contains a pixmap. The size of the pixmap is dynamically adjusted in order to fit the frame's contents.
#include "../include/qwt_pixframe.h> class ParentClass : ... { ... QwtPixFrame *pixframe; ... void newPicture(); ... private slots: void repaintPixmap(); } // // Connect pixmapResized() to a slot // ParentClass::ParentClass(...) { ... connect(pixframe, SIGNAL(pixmapResized()), SLOT(repaintPixmap())); } // // Repaint when the pixmap has been resized // ParentClass::repaintPixmap() { QPainter p; p.begin(pixframe->pixmap()); redraw_picture(&p, pixframe->pixmap().rect()); p.end(); // Note: No updatePixmap() required here } // // Renew the pixmap's contents independently // ParentClass::newPicture() { // Change the pixmap's contents draw_new_picture(pixframe->pixmap()); // Generate paint event pixframe->updatePixmap(); }
|
CTOR.
|
|
DTOR.
|
|
Resize the frame according to the pixmap size.
|
|
Resize the pixmap according to the frame size.
|
|
Clear the contents of the pixmap and fill it with its background color.
|
|
Fill the pixmap with a specified color.
|
|
Notify a change of the frame.
|
|
Paint event.
|
|
|
|
|
|
A signal which is emitted when the size of the pixmap has been changed.
When resized, the pixmap is cleared and filled with its background color. |
|
Assign a pixmap.
If the variable size feature is enabled (disabled by default), the size of the frame will not change when a new pixmap has been assigned. |
|
Assign a background color the the pixmap.
|
|
Set resizing policy.
|
|
Maps the pixmap to the screen.
This function synchronizes the screen contents with the current contents of the pixmap. It generates a paint event which updates the widget.
|
|
Repaint a part of the pixmap.
|