ImageWidget Class Reference

`#include <ImageWidget.h>`

Inheritance diagram for ImageWidget:

## Public Member Functions

void | clone (ImageWidget *t)
QString | fileName ()
| Return d_file_name. More...
| ImageWidget (Graph *, const QString &fn=QString::null)
| Construct an image widget from a file name. More...
| ImageWidget (Graph *, const QImage &image)
| Construct an image widget from a QImage. More...
bool | load (const QString &fn, bool update=true)
| Import image from d_file_name. Returns true if successful. More...
void | paintEvent (QPaintEvent *e)
QPixmap | pixmap () const
| Return the pixmap to be drawn. More...
void | print (QPainter *p, const QwtScaleMap map[QwtPlot::axisCnt])
bool | saveInternally ()
virtual QString | saveToString ()
void | setPixmap (const QPixmap &)
void | setSaveInternally (bool save=true)
void | setWindowName (const QString &name)
QString | windowName ()
| Return d_window_name. More...
Public Member Functions inherited from FrameWidget
int | angle ()
AttachPolicy | attachPolicy ()
QColor | backgroundColor ()
double | bottom ()
QRectF | boundingRect () const
| Return bounding rectangle in plot coordinates. More...
QBrush | brush ()
QColor | frameColor ()
Qt::PenStyle | frameLineStyle ()
QPen | framePen ()
int | frameStyle ()
| FrameWidget (Graph *)
double | frameWidth ()
bool | isOnTop ()
void | mousePressEvent (QMouseEvent *)
void | move (const QPoint &pos)
Graph * | plot ()
void | resetCoordinates ()
void | resetOrigin ()
double | right ()
void | setAngle (int ang)
void | setAttachPolicy (AttachPolicy attachTo)
void | setBackgroundColor (const QColor &c)
void | setBrush (const QBrush &b)
void | setCoordinates (double left, double top, double right, double bottom)
| Set position (xValue() and yValue()), right and bottom values giving everything in plot coordinates. More...
void | setFrameColor (const QColor &c)
void | setFrameLineStyle (const Qt::PenStyle &s)
void | setFramePen (const QPen &p)
void | setFrameStyle (int style)
void | setFrameWidth (double w)
void | setOnTop (bool on=true)
void | setOrigin (int x, int y)
| Sets the position of the top left corner in paint coordinates. More...
void | setOriginCoord (double x, double y)
| Sets the position of the top left corner in axis coordinates. More...
void | setRect (int x, int y, int w, int h)
| Set geometry, giving everything in paint coordinates. More...
void | setSize (int w, int h)
| Set size in paint coordinates (pixels). More...
void | setSize (const QSize &newSize)
| Set size in paint coordinates. More...
void | showContextMenu ()
void | showPropertiesDialog ()
virtual void | updateCoordinates ()
double | xValue ()
| Returns the x axis coordiante of the top left corner. More...
double | yValue ()
| Returns the y axis coordiante of the top left corner. More...

## Static Public Member Functions

static void | restore (Graph *g, const QStringList &lst)
static QPixmap | windowPixmap (ApplicationWindow *mw, const QString &name, const QSize &size)
Static Public Member Functions inherited from FrameWidget
static double | heightIn (QWidget *w, Unit unit)
static void | setRect (QWidget *, double x, double y, double w, double h, Unit unit=Pixel)
| Set geometry of a widget in arbitrary units. More...
static double | widthIn (QWidget *w, Unit unit)
static double | xIn (QWidget *w, Unit unit)
static double | yIn (QWidget *w, Unit unit)

## Private Member Functions

void | draw (QPainter *painter, const QRect &r)

## Private Attributes

QString | d_file_name
| The file from which the image was loaded. More...
QPixmap | d_pix
bool | d_save_xpm
| Flag telling if the pixmap must be saved in the .qti project as XPM. More...
QString | d_window_name
| The window whos image is drawn. More...

## Additional Inherited Members

Public Types inherited from FrameWidget
enum | AttachPolicy { Page, Scales }
| The attach to policy. More...
enum | FrameStyle { None = 0, Line = 1, Shadow = 2 }
| The kinds of frame a FrameWidget can draw around. More...
enum | Unit { Inch, Millimeter, Centimeter, Point, Pixel, Scale }
| Length units. More...
Signals inherited from FrameWidget
void | changedCoordinates (const QRectF &)
void | showDialog ()
void | showMenu ()
Protected Member Functions inherited from FrameWidget
double | calculateBottomValue ()
| Returns the y axis coordinate of the bottom right corner based on the pixel value. More...
double | calculateRightValue ()
| Returns the x axis coordinate of the bottom right corner based on the pixel value. More...
double | calculateXValue ()
| Returns the x axis coordinate of the top left corner based on the pixel value. More...
double | calculateYValue ()
| Returns the y axis coordinate of the top left corner based on the pixel value. More...
void | contextMenuEvent (QContextMenuEvent *)
virtual void | drawFrame (QPainter *p, const QRect &rect)
Protected Attributes inherited from FrameWidget
int | d_angle
| Rotation angle: not implemented yet. More...
AttachPolicy | d_attach_policy
| The attach to policy. More...
QBrush | d_brush
| Background brush. More...
int | d_frame
| Frame type. More...
QPen | d_frame_pen
| Pen used to draw the frame. More...
bool | d_on_top
Graph * | d_plot
| Parent plot. More...
int | d_shadow_width
| Frame width in pixels. More...
double | d_x
| X axis coordinate of the top left corner. More...
double | d_x_right
| The right side position in scale coordinates. More...
double | d_y
| Y axis coordinate of the top left corner. More...
double | d_y_bottom
| The bottom side position in scale coordinates. More...

## Constructor & Destructor Documentation

ImageWidget::ImageWidget | ( | Graph * | plot,
|  | const QString & | fn = `QString::null`
| ) |  |

Construct an image widget from a file name.

References d_pix, load(), FrameWidget::move(), and FrameWidget::setSize().

ImageWidget::ImageWidget | ( | Graph * | plot,
|  | const QImage & | image
| ) |  |

Construct an image widget from a QImage.

References d_pix, FrameWidget::move(), and FrameWidget::setSize().

## Member Function Documentation

void ImageWidget::clone | ( | ImageWidget * | t | ) |

References FrameWidget::bottom(), d_file_name, FrameWidget::d_frame, d_save_xpm, fileName(), FrameWidget::framePen(), FrameWidget::frameStyle(), pixmap(), FrameWidget::right(), saveInternally(), FrameWidget::setCoordinates(), FrameWidget::setFramePen(), setPixmap(), FrameWidget::xValue(), and FrameWidget::yValue().

void ImageWidget::draw | ( | QPainter * | painter,
|  | const QRect & | r
| ) |  |

private

References FrameWidget::d_frame, FrameWidget::d_frame_pen, d_pix, FrameWidget::d_shadow_width, FrameWidget::drawFrame(), FrameWidget::Line, FrameWidget::None, and FrameWidget::Shadow.

Referenced by paintEvent(), and print().

QString ImageWidget::fileName | ( |  | ) |

inline

Return d_file_name.

References d_file_name.

Referenced by Graph::addImage(), EnrichmentDialog::chooseImageFile(), clone(), ApplicationWindow::intensityTable(), and EnrichmentDialog::setWidget().

bool ImageWidget::load | ( | const QString & | fn,
|  | bool | update = `true`
| ) |  |

Import image from d_file_name. Returns true if successful.

References d_file_name, d_pix, and FrameWidget::plot().

Referenced by EnrichmentDialog::chooseImageFile(), and ImageWidget().

void ImageWidget::paintEvent | ( | QPaintEvent * | e | ) |

virtual

Reimplemented from FrameWidget.

References MdiSubWindow::applicationWindow(), d_pix, d_window_name, draw(), Graph::multiLayer(), FrameWidget::plot(), and windowPixmap().

QPixmap ImageWidget::pixmap | ( |  | ) | const

inline

Return the pixmap to be drawn.

References d_pix.

Referenced by LineProfileTool::calculateLineProfile(), clone(), and EnrichmentDialog::setBestSize().

void ImageWidget::print | ( | QPainter * | p,
|  | const QwtScaleMap | map[QwtPlot::axisCnt]
| ) |  |

virtual

Reimplemented from FrameWidget.

References FrameWidget::bottom(), FrameWidget::calculateBottomValue(), FrameWidget::calculateRightValue(), FrameWidget::calculateXValue(), FrameWidget::calculateYValue(), draw(), and FrameWidget::right().

void ImageWidget::restore | ( | Graph * | g,
|  | const QStringList & | lst
| ) |  |

static

References Graph::addImage(), FrameWidget::bottom(), FrameWidget::frameStyle(), FrameWidget::Page, PenStyleBox::penStyle(), FrameWidget::right(), FrameWidget::setAttachPolicy(), FrameWidget::setCoordinates(), FrameWidget::setFramePen(), FrameWidget::setFrameStyle(), FrameWidget::setOnTop(), and setSaveInternally().

Referenced by ApplicationWindow::openGraph().

bool ImageWidget::saveInternally | ( |  | ) |

inline

References d_save_xpm.

Referenced by clone(), and EnrichmentDialog::setWidget().

QString ImageWidget::saveToString | ( |  | ) |

virtual

Reimplemented from FrameWidget.

References d_file_name, d_pix, d_save_xpm, and FrameWidget::saveToString().

void ImageWidget::setPixmap | ( | const QPixmap & | pix | ) |

References FrameWidget::d_frame, d_pix, FrameWidget::d_shadow_width, and FrameWidget::Shadow.

Referenced by clone().

void ImageWidget::setSaveInternally | ( | bool | save = `true` | ) |

inline

References d_save_xpm.

Referenced by restore(), and EnrichmentDialog::saveImagesInternally().

void ImageWidget::setWindowName | ( | const QString & | name | ) |

inline

References d_window_name.

QString ImageWidget::windowName | ( |  | ) |

inline

Return d_window_name.

References d_window_name.

QPixmap ImageWidget::windowPixmap | ( | ApplicationWindow * | mw,
|  | const QString & | name,
|  | const QSize & | size
| ) |  |

static

References MultiLayer::canvasPixmap(), Graph3D::surface(), Table::table(), and ApplicationWindow::window().

Referenced by paintEvent().

## Member Data Documentation

QString ImageWidget::d_file_name

private

The file from which the image was loaded.

Referenced by clone(), fileName(), load(), and saveToString().

QPixmap ImageWidget::d_pix

private

Referenced by draw(), ImageWidget(), load(), paintEvent(), pixmap(), saveToString(), and setPixmap().

bool ImageWidget::d_save_xpm

private

Flag telling if the pixmap must be saved in the .qti project as XPM.

Referenced by clone(), saveInternally(), saveToString(), and setSaveInternally().

QString ImageWidget::d_window_name

private

The window whos image is drawn.

Referenced by paintEvent(), setWindowName(), and windowName().

The documentation for this class was generated from the following files:

- qtiplot/src/plot2D/ImageWidget.h
- qtiplot/src/plot2D/ImageWidget.cpp