Biomedical Image Analysis Library
The Biomedical Image Analysis Library is a poweful tool for developers, physicians, researchers, engineers, and so on.
thumbswidget.cpp
Go to the documentation of this file.
1 #include "controller.h"
2 #include "thumbswidget.h"
3 #include "ui_thumbswidget.h"
4 
5 ThumbsWidget::ThumbsWidget( QWidget *parent ) : QWidget( parent ), ui( new Ui::ThumbsWidget ) {
6  ui->setupUi( this );
7 }
8 
10  delete ui;
11 }
12 
14  COMMENT( "Reseting thumbnails.", 1 );
15  qDeleteAll( thumbs );
16  thumbs.clear( );
17 }
18 
20  COMMENT( "Loading new thumbnail", 1 );
21  int num = thumbs.size( );
22  int size = width( ) - 40;
23  Thumbnail *thumbnail = new Thumbnail( image, num, size );
24  thumbs.append( thumbnail );
25  ui->thumbsLayout->addWidget( thumbnail, num, 0, Qt::AlignHCenter );
26  ui->thumbsLayout->setMargin( 0 );
27  ui->thumbsLayout->setVerticalSpacing( 1 );
28  /* thumbnail->show(); */
29  connect( thumbnail, &Thumbnail::changeImage, controller, &Controller::setCurrentImagePos );
30 }
31 
33  controller = value;
34 }
35 
36 void ThumbsWidget::removeAt( int pos ) {
37  COMMENT( "Removing thumbnail at " << pos << ".", 1 );
38  delete thumbs[ pos ];
39  thumbs.removeAt( pos );
40  for( int i = 0; i < thumbs.size( ); ++i ) {
41  thumbs[ i ]->setObjectName( QString::number( i ) );
42  }
43 }
void setCurrentImagePos(int position)
setCurrentImagePos
Definition: controller.cpp:144
void changeImage(int index)
void setController(Controller *value)
The GuiImage class is a bridge to the Bial::Image data structure to the QImage data structure...
Definition: guiimage.h:20
ThumbsWidget(QWidget *parent=0)
Definition: thumbswidget.cpp:5
static size_t size
Definition: enough.c:173
static big_t * num
Definition: enough.c:175
The Controller class is one of the most important classes of the User Interface, and is responsible t...
Definition: controller.h:17
void removeAt(int pos)
void addThumbnail(GuiImage *image)