|
Eneboo - Documentación para desarrolladores
|
#include <pixmapchooser.h>
Métodos públicos | |
| PixmapView (QWidget *parent) | |
| void | setPixmap (const QPixmap &pix) |
| void | drawContents (QPainter *p, int, int, int, int) |
| void | previewUrl (const QUrl &u) |
| PixmapView::PixmapView | ( | QWidget * | parent | ) |
| void PixmapView::drawContents | ( | QPainter * | p, |
| int | clipx, | ||
| int | clipy, | ||
| int | clipw, | ||
| int | cliph | ||
| ) | [virtual] |
Reimplement this function if you are viewing a drawing area rather than a widget.
The function should draw the rectangle (clipx, clipy, clipw, cliph) of the contents using painter p. The clip rectangle is in the scrollview's coordinates.
For example:
{
// Fill a 40000 by 50000 rectangle at (100000,150000)
// Calculate the coordinates...
int x1 = 100000, y1 = 150000;
int x2 = x1+40000-1, y2 = y1+50000-1;
// Clip the coordinates so X/Windows will not have problems...
if (x1 < clipx) x1=clipx;
if (y1 < clipy) y1=clipy;
if (x2 > clipx+clipw-1) x2=clipx+clipw-1;
if (y2 > clipy+cliph-1) y2=clipy+cliph-1;
// Paint using the small coordinates...
if ( x2 >= x1 && y2 >= y1 )
p->fillRect(x1, y1, x2-x1+1, y2-y1+1, red);
}
The clip rectangle and translation of the painter p is already set appropriately.
Reimplementado de QScrollView.
| void PixmapView::previewUrl | ( | const QUrl & | url | ) | [virtual] |
This function is called by QFileDialog if a preview for the url should be shown. Reimplement this function to provide file previewing.
Implementa QFilePreview.
| void PixmapView::setPixmap | ( | const QPixmap & | pix | ) |
1.7.4