void Segmentation::on_segmentButton_clicked() { segDialog->ui.ScribbleWidget->clearTime(); getMethod(); if(method.isEmpty()) { QMessageBox::warning(this, tr("Method"), tr("Please select a method first!")); return; } initializeDialog(); segDialog->exec(); ui.timeLineEdit->setText(QString::number(segDialog->ui.ScribbleWidget->getSegTime())); showImageOnLabel(ui.seedImage, QString(), segDialog->ui.ScribbleWidget->seedImage); showImageOnLabel(ui.resultImage, QString(), segDialog->ui.ScribbleWidget->segImage); }
ossimQtIcpDialog::ossimQtIcpDialog(QWidget* parent, ossimImageChain* image_chain) : QDialog(parent, "ossimQtIcpDialog", true, WDestructiveClose), theChain(image_chain), theWriter(NULL), theMainVBox(NULL), theHBox1(NULL), theSourceImageGroupBox(NULL), theSourceImageLabel(NULL), theHBox2(NULL), theStartLineGroupBox(NULL), theStartLineField(NULL), theStopLineGroupBox(NULL), theStopLineField(NULL), theHBox3(NULL), theStartSampleGroupBox(NULL), theStartSampleField(NULL), theStopSampleGroupBox(NULL), theStopSampleField(NULL), theHBox4(NULL), theOutputImageGroupBox(NULL), theOutputImageField(NULL), theOutputImageButton(NULL), theHBox5(NULL), theOutputImageTypeGroupBox(NULL), theOutputImageWriterMenu(NULL), theEditOutputImageWriterButton(NULL), theHBox6(NULL), theSaveButton(NULL), theCloseButton(NULL), theSourceImageRect(), theOutputImageRect() { setCaption("Export Image"); // Main vertical box. theMainVBox = new QVBoxLayout(this); // First row, display source image file name. theHBox1 = new QHBoxLayout(theMainVBox); theSourceImageGroupBox = new QGroupBox(1, Qt::Horizontal, "source image", this, "theSourceImageGroupBox"); theSourceImageGroupBox->setAlignment(Qt::AlignHCenter); QString s = getImageFileName(); theSourceImageLabel = new QLabel(s, theSourceImageGroupBox, "theSourceImageLabel"); theHBox1->addWidget(theSourceImageGroupBox); // End of first row. // Second row, start line, stop line. theHBox2 = new QHBoxLayout(theMainVBox); theStartLineGroupBox = new QGroupBox(1, Qt::Horizontal, "start line", this); theStartLineGroupBox->setAlignment(Qt::AlignHCenter); theStartLineField = new QLineEdit(theStartLineGroupBox, "theStartLineField"); theHBox2->addWidget(theStartLineGroupBox); // Make the stop line box. theStopLineGroupBox = new QGroupBox(1, Qt::Horizontal, "stop line", this); theStopLineGroupBox->setAlignment(Qt::AlignHCenter); theStopLineField = new QLineEdit(theStopLineGroupBox, "theStopLineField"); theHBox2->addWidget(theStopLineGroupBox); // End of second row. // Third row, start sample, stop sample. theHBox3 = new QHBoxLayout(theMainVBox); // Make the start sample box. theStartSampleGroupBox = new QGroupBox(1, Qt::Horizontal, "start sample", this); theStartSampleGroupBox->setAlignment(Qt::AlignHCenter); theStartSampleField = new QLineEdit(theStartSampleGroupBox, "theStartSampleField"); theHBox3->addWidget(theStartSampleGroupBox); // Make the stop sample box. theStopSampleGroupBox = new QGroupBox(1, Qt::Horizontal, "stop sample", this); theStopSampleGroupBox->setAlignment(Qt::AlignHCenter); theStopSampleField = new QLineEdit(theStopSampleGroupBox, "theStopSampleField"); theHBox3->addWidget(theStopSampleGroupBox); // End of third row... // Fourth row, output file, file dialog button. theHBox4 = new QHBoxLayout(theMainVBox); theOutputImageGroupBox = new QHGroupBox("output image", this, "theOutputImageGroupBox"); theOutputImageGroupBox->setAlignment(Qt::AlignHCenter); theOutputImageField = new QLineEdit(theOutputImageGroupBox, "theOutputImageField"); theOutputImageButton = new QPushButton( theOutputImageGroupBox, "theOutputImageButton" ); theOutputImageButton->setText( "..." ); theOutputImageButton->setDefault(false); theOutputImageButton->setAutoDefault(false); theHBox4->addWidget(theOutputImageGroupBox); // End of fourth row... // Fifth row. theHBox5 = new QHBoxLayout(theMainVBox); theOutputImageTypeGroupBox = new QHGroupBox("output image type", this, "theOutputImageTypeGroupBox"); theOutputImageTypeGroupBox->setAlignment(Qt::AlignHCenter); theOutputImageWriterMenu = new QComboBox(theOutputImageTypeGroupBox, "theOutputWriterBox"); buildWriterMenu(); theEditOutputImageWriterButton = new QPushButton( theOutputImageTypeGroupBox, "theEditOutputImageWriterButton" ); theEditOutputImageWriterButton->setText( "edit writer" ); theEditOutputImageWriterButton->setDefault(false); theEditOutputImageWriterButton->setAutoDefault(false); theHBox5->addWidget(theOutputImageTypeGroupBox); // Sixth row. theHBox6 = new QHBoxLayout(theMainVBox); theSaveButton = new QPushButton( this, "theSaveButton" ); theSaveButton->setText( "Save" ); theSaveButton->setDefault(false); theSaveButton->setAutoDefault(false); theCloseButton = new QPushButton( this, "theCloseButton" ); theCloseButton->setText( "Close" ); theCloseButton->setDefault(false); theCloseButton->setAutoDefault(false); theHBox6->addWidget(theSaveButton); theHBox6->addWidget(theCloseButton); //--- // Connect all the signals to slots... // // NOTE: // If a push button is set to "default" or "auto default" it will always // call that slot when return is pressed in the dialog. // Since this isn't what I want all defaults are set to off! //--- connect( theStartLineField, SIGNAL ( returnPressed() ), this, SLOT ( startLinePressed() ) ); connect( theStopLineField, SIGNAL ( returnPressed() ), this, SLOT ( stopLinePressed() ) ); connect( theStartSampleField, SIGNAL ( returnPressed() ), this, SLOT ( startSamplePressed() ) ); connect( theStopSampleField, SIGNAL ( returnPressed() ), this, SLOT ( stopSamplePressed() ) ); connect( theOutputImageField, SIGNAL ( returnPressed() ), this, SLOT ( outputImagePressed() ) ); connect( theOutputImageButton, SIGNAL ( clicked() ), this, SLOT ( outputImageClicked() ) ); connect( theOutputImageWriterMenu, SIGNAL ( activated( const QString& ) ), this, SLOT ( outputImageWriterMenuActivated( const QString& ) ) ); connect( theEditOutputImageWriterButton, SIGNAL ( clicked() ), this, SLOT ( editOutputImageWriterClicked() ) ); connect( theSaveButton, SIGNAL ( clicked() ), this, SLOT ( saveClicked() ) ); connect( theCloseButton, SIGNAL ( clicked() ), this, SLOT ( closeClicked() ) ); initializeDialog(); }