Example #1
0
File: Viewer.cpp Project: goeb/ji3
Viewer::Viewer(Scenario & s) : scenario(s), clickDisabled(false)
{
    items = s.getItemSequence();
    periodMs = s.getPeriodMs();
    index = 0;
    imageLabel = new Image;
    imageLabel->setAlignment(Qt::AlignHCenter|Qt::AlignVCenter);
    distractor = 0;

    if (scenario.getMode() == MODE_DIVIDED_ATTENTION_VISUAL) {
        distractor = new QLabel(this);
        const QImage img("Data/lutin.png");
        const QPixmap p = QPixmap::fromImage(img);
        int w = width()/4;
        int h = height()/4;
        // set a scaled pixmap to a w x h window keeping its aspect ratio
        distractor->setPixmap(p.scaled(w, h, Qt::KeepAspectRatio));
        distractor->hide();
    } else if (scenario.getMode() == MODE_DIVIDED_ATTENTION_SOUND) {
        // nothing at this stage
    }
    else distractor = 0;

    nDistractor = 0;

    descriptionLabel = 0;
    setWindowTitle(QString("ji") + VERSION);
    showFullScreen();
    start();
}