4 #include <qboxlayout.h> 8 m_imageNumber( number ) {
10 throw std::invalid_argument(
"Image does not exists." );
12 COMMENT(
"Creating thumbnail for image " << image->
fileName( ).toStdString( ), 0 );
13 setFrameStyle( QFrame::Raised );
14 setFrameShape( QFrame::StyledPanel );
15 setSizePolicy( QSizePolicy::Fixed, QSizePolicy::Fixed );
18 pix = pix.scaled( size, size, Qt::KeepAspectRatio, Qt::SmoothTransformation );
20 QLabel *imageLabel =
new QLabel;
21 imageLabel->setPixmap( pix );
23 QFileInfo info( image->
fileName( ) );
29 QString fname = info.fileName( );
31 setAttribute( Qt::WA_AlwaysShowToolTips );
36 QVBoxLayout *layout =
new QVBoxLayout;
37 layout->addWidget( imageLabel, 0, Qt::AlignHCenter );
39 layout->addStretch( 1 );
40 layout->setMargin( 2 );
void changeImage(int index)
The GuiImage class is a bridge to the Bial::Image data structure to the QImage data structure...
void mousePressEvent(QMouseEvent *)
void setImageNumber(int imageNumber)
Thumbnail(GuiImage *image, int number, int size, QWidget *parent=0)
QPixmap getSlice(size_t view)
getSlice calculates and returns a QImage with the current slice of the view.
QString fileName()
fileName is the image absolute path getter.