Exemple #1
0
void MainWindow::fileNew() {
    if (_sdata)
        if (!_sdata->isSaved())
            maybeSave();
        fileClose();
    // if project exist,
        // if not saved,
            //maybe save?
        // close


    // run wizard
    QMdiSubWindow * world = _mdiArea->addSubWindow(new WorldWidget());
    world->setWindowTitle("*untitled");
    world->setMinimumSize(300, 200);
    world->show();

    _sdata = new SimulationData();
    _sdata->setSaved(false);

    connect(_sdata, SIGNAL(fileNameChanged(QString)), world, SLOT(setWindowTitle(QString)));

    SensorNetwork net(40);
    net.push();
    net.start();

    _fileSaveAsAct->setEnabled(true);
    _fileCloseAct->setEnabled(true);
}
Exemple #2
0
PlotWithCurves* Group::insertPlot()
{
    QMdiSubWindow* window = new QMdiSubWindow;
    {
        window->setMinimumSize(250, 150);
        window->setWindowIcon(QIcon(":/res/mainWindow/closeAllPlots.png"));
        window->setAttribute(Qt::WA_DeleteOnClose);
    }
    PlotWithCurves* plot = new PlotWithCurves(samplesManager, curvesManagerView, window);
    {
        plot->connect(plot, SIGNAL(destroyed()), this, SLOT(retitle()));
        window->setWidget(plot);
        addSubWindow(window);
        window->show();
        retitle();
    }
    return plot;
}
Exemple #3
0
void MainWindow::loadOrig(QString filename){
    QImage orig;
    if(!orig.load(filename)){
        return;
    }
    fWorkImage *task = new fWorkImage(ui->mdiArea);
    QMdiSubWindow *sub =  ui->mdiArea->addSubWindow(task);
    task->setWindowTitle(filename);
    task->setPixmap(QPixmap(filename));
    task->show();

    sub->setMinimumSize(orig.size().width(), orig.height()+30);

    active = task;

    fInfo* fi = (fInfo*)info->widget();
    fi->setFileName(filename);
    fi->setWidth(orig.width());
    fi->setHeight(orig.height());

/*
    ui->tableWidget->setItem(3,0,new QTableWidgetItem(QString::fromLocal8Bit("Число цветов"))
                             );
    ui->tableWidget->setItem(3,1,new QTableWidgetItem(QString("%1").arg(orig.colorCount()))
                             );

    ui->tableWidget->setItem(4,0,new QTableWidgetItem(QString::fromLocal8Bit("Глубина цвета"))
                             );
    ui->tableWidget->setItem(4,1,new QTableWidgetItem(QString("%1").arg(orig.depth()))
                             );

    ui->tableWidget->setItem(5,0,new QTableWidgetItem(QString::fromLocal8Bit("Канал яркости"))
                             );
    ui->tableWidget->setItem(5,1,new QTableWidgetItem(QString("%1").arg(orig.hasAlphaChannel()))
                             );

    ui->tableWidget->setItem(6,0,new QTableWidgetItem(QString::fromLocal8Bit("Ч/Б изображение"))
                             );
    ui->tableWidget->setItem(6,1,new QTableWidgetItem(QString("%1").arg(orig.isGrayscale()))
                             );

    ui->tableWidget->resizeColumnsToContents();
    */
}