Пример #1
0
OverlayText::OverlayText() :
    ui(new Ui::OverlayText) {
    widget = new QWidget();
	font = new QFont();
	color = new QColor();
	pixmap = new QPixmap(32, 32);
	scene = new QGraphicsScene();
	scenePixmap = new QPixmap(100, 100);
    ui->setupUi(widget);
	ui->preview->setScene(scene);

	connect(ui->pushButton, SIGNAL(clicked()), this, SLOT(setFont()));
	connect(ui->colorPushButton, SIGNAL(clicked()), this, SLOT(setColor()));

	connect(ui->Text, SIGNAL(editingFinished()), this, SLOT(makePreview()));
	connect(ui->xSpinBox, SIGNAL(valueChanged(int)), this, SLOT(makePreview()));
	connect(ui->ySpinBox, SIGNAL(valueChanged(int)), this, SLOT(makePreview()));

	// loads last state of gui
	loadState();
	ui->fontComboBox->setCurrentFont(*font);
	pixmap->fill(*color);
	ui->colorPushButton->setIcon(QIcon(*pixmap));
	makePreview();

}
Пример #2
0
// shows a dialog to select color of text
void OverlayText::setColor() {
    QColor temp = QColorDialog::getColor(*color, widget);

	delete color;
	color = new QColor(temp);
	pixmap->fill(*color);
	ui->colorPushButton->setIcon(QIcon(*pixmap));
	makePreview();
}
//------------
void CameraHead::add(int currentCapture) {
	//if (this->found) {
		lock();
		camera.capture();
		makePreview(false);
		captures.add(currentCapture, raw, this->downSampled);
		unlock();
	//}
}
Пример #4
0
// shows a dialog to select font of text
void OverlayText::setFont() {
	bool ok;
    QFont temp = QFontDialog::getFont(&ok, *font, widget);
	if (ok) {
		delete font;
		this->font = new QFont(temp);
		ui->fontComboBox->setCurrentFont(temp);
	}
	makePreview();
}
Пример #5
0
PagerItem::PagerItem(string _path){
    string name = _path;
    XMLLoader loader(name);
    setAttr("path",_path);
    setAttr("name",name);
    setAttr("type",loader.getValue("type"));
    setAttr("sfx","button11");
    itemType = attrs["type"];
    duration = loader.getValue("duration");
    setAttr("preview", loader.getValue("preview"));
    if(itemType == "audio"){
        itemType = "audio";
        itemIndex = loader.getValue("position");
    }
    makePreview();
    SubObMediator::Instance()->addObserver("time-remaining", this);
    bReloader = false;
}
Пример #6
0
void QtDcmManager::getPreviewFromSelectedSerie ( const QString &uid, int elementIndex )
{
    if ( !d->tempDir.exists() ) {
        return;
    }

    if ( !d->listImages.size() ) {
        return;
    }

    if ( d->listImages.size() < elementIndex ) {
        return;
    }

    QString imageId = d->listImages[elementIndex];

    if ( d->mapImages.size() && d->mapImages.contains ( elementIndex ) ) {
        imageId = d->mapImages[elementIndex];
    }

    switch(d->mode) {
    case MEDIA:
    {
        QtDcmMoveDicomdir * mover = new QtDcmMoveDicomdir ( this );
        mover->setMode ( QtDcmMoveDicomdir::PREVIEW );
        mover->setDcmItem ( d->dfile.getDataset() );
        mover->setOutputDir ( d->tempDir.absolutePath() );
        mover->setSeries ( QStringList() << uid );
        mover->setImageId ( imageId );
        connect(mover, &QtDcmMoveDicomdir::previewSlice ,
                this,  &QtDcmManager::makePreview);
        connect(mover, &QtDcmMoveDicomdir::finished,
                mover, &QtDcmMoveDicomdir::deleteLater);
        mover->start();
    }
        break;
    case PACS:
    {
        //Check if file has already been moved
        this->clearPreview();
        emit gettingPreview();

        QString modality ( "MR" );
        if ( d->seriesTreeWidget->currentItem() ) {
            modality = d->seriesTreeWidget->currentItem()->text ( 1 );
        }
        
        QString filename ( d->tempDir.absolutePath() + "/" + uid + "/" + modality + "." + imageId );
        if ( QFile ( filename ).exists() ) {
            makePreview ( filename );
        }
        else {
            QtDcmMoveScu * mover = new QtDcmMoveScu ( this );
            mover->setMode ( QtDcmMoveScu::PREVIEW );
            mover->setOutputDir ( d->tempDir.absolutePath() );
            mover->setSeries ( QStringList() << uid );
            mover->setImageId ( imageId );
            connect(mover, &QtDcmMoveScu::previewSlice,
                    this,  &QtDcmManager::makePreview);
            connect(mover, &QtDcmMoveScu::finished,
                    mover, &QtDcmMoveScu::deleteLater);
            mover->start();
        }
    }
        break;
    default:
        qWarning() <<  "Move mode not supported";
        break;
    }

    return;
}
//------------
void CameraHead::threadedFunction() {
	while (this->isThreadRunning()) {
		capture();
		makePreview(true);
	}
}