本文整理汇总了C++中QFileDialog::layout方法的典型用法代码示例。如果您正苦于以下问题:C++ QFileDialog::layout方法的具体用法?C++ QFileDialog::layout怎么用?C++ QFileDialog::layout使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类QFileDialog
的用法示例。
在下文中一共展示了QFileDialog::layout方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: slot_fileOpen
void MainWindow::slot_fileOpen()
{
QFileDialog *dialog = new QFileDialog(this);
dialog->setOption(QFileDialog::DontUseNativeDialog, true);
SGFPreview *previewWidget = new SGFPreview(dialog);
QGridLayout *layout = (QGridLayout*)dialog->layout();
layout->addWidget(previewWidget, 1, 3);
connect(dialog,SIGNAL(currentChanged(QString)),previewWidget,SLOT(setPath(QString)));
connect(dialog,SIGNAL(fileSelected(QString)),this,SLOT(openSGF(QString)));
dialog->setNameFilter("Smart Game Format (*.sgf *.SGF)");
dialog->setFileMode(QFileDialog::ExistingFile);
dialog->exec();
delete dialog;
}
示例2: saveAsXMLPlugin
void PluginGeneratorGUI::saveAsXMLPlugin()
{
QFileDialog* saveDiag = new QFileDialog(this,tr("Save XML Plugin File"),finfo.absolutePath(), tr("MeshLab XML Plugin (*.xml)"));
#if defined(Q_OS_MAC)
saveDiag->setOption(QFileDialog::DontUseNativeDialog,true);
#endif
QLabel* namelab = new QLabel(tr("JScript Plugin Name"),saveDiag);
QLineEdit* jsline= new QLineEdit(plugscriptname,saveDiag);
QLabel* authlab = new QLabel(tr("Author Name"),saveDiag);
QLineEdit* authline= new QLineEdit(author,saveDiag);
QLabel* maillab = new QLabel(tr("Author e-Mail"),saveDiag);
QLineEdit* mailline= new QLineEdit(mail,saveDiag);
QCheckBox* cpp = new QCheckBox(tr("Generate *.cpp,*.h"),saveDiag);
cpp->setChecked(false);
QGridLayout* layout = (QGridLayout*) saveDiag->layout();
layout->addWidget(namelab,4,0);
layout->addWidget(jsline,4,1);
layout->addWidget(authlab,5,0);
layout->addWidget(authline,5,1);
layout->addWidget(maillab,6,0);
layout->addWidget(mailline,6,1);
layout->addWidget(cpp,7,1);
saveDiag->setAcceptMode(QFileDialog::AcceptSave);
saveDiag->exec();
plugscriptname = jsline->text();
author = authline->text();
mail = mailline->text();
QStringList files = saveDiag->selectedFiles();
if (files.size() != 1)
return;
QString fileName = files[0];
save(fileName,cpp->isChecked());
/*for(int ii = 0;ii < tabs->count();++ii)
{
XMLFilterInfo::XMLMap mp;
collectFilterInfo(mp);
ls.push_back(mp);
}*/
delete saveDiag;
}
示例3: getSaveFileName
QString QmitkToFRecorderWidget::getSaveFileName(mitk::ToFImageWriter::ToFImageType& tofImageType,
bool& distanceImageSelected,
bool& amplitudeImageSelected,
bool& intensityImageSelected,
bool& rgbImageSelected,
bool& rawDataSelected,
QWidget *parent,
const QString &caption,
const QString &dir,
const QString &filter,
QString *selectedFilter,
QFileDialog::Options options
)
{
QString selectedFileName = "";
QComboBox* combo = new QComboBox;
combo->addItem("3D");
combo->addItem("2D + t");
QHBoxLayout* checkBoxGroup = new QHBoxLayout();
QCheckBox* distanceImageCheckBox = new QCheckBox;
distanceImageCheckBox->setText("Distance image");
distanceImageCheckBox->setChecked(distanceImageSelected);
QCheckBox* amplitudeImageCheckBox = new QCheckBox;
amplitudeImageCheckBox->setText("Amplitude image");
amplitudeImageCheckBox->setChecked(amplitudeImageSelected);
QCheckBox* intensityImageCheckBox = new QCheckBox;
intensityImageCheckBox->setText("Intensity image");
intensityImageCheckBox->setChecked(intensityImageSelected);
QCheckBox* rgbImageCheckBox = new QCheckBox;
rgbImageCheckBox->setText("RGB image");
rgbImageCheckBox->setChecked(rgbImageSelected);
QCheckBox* rawDataCheckBox = new QCheckBox;
rawDataCheckBox->setText("Raw data");
rawDataCheckBox->setChecked(false);
rawDataCheckBox->setEnabled(false);
checkBoxGroup->addWidget(distanceImageCheckBox);
checkBoxGroup->addWidget(amplitudeImageCheckBox);
checkBoxGroup->addWidget(intensityImageCheckBox);
checkBoxGroup->addWidget(rgbImageCheckBox);
checkBoxGroup->addWidget(rawDataCheckBox);
QFileDialog* fileDialog = new QFileDialog(parent, caption, dir, filter);
QLayout* layout = fileDialog->layout();
QGridLayout* gridbox = qobject_cast<QGridLayout*>(layout);
if (gridbox)
{
gridbox->addWidget(new QLabel("ToF-Image type:"));
gridbox->addWidget(combo);
int lastRow = gridbox->rowCount();
gridbox->addLayout(checkBoxGroup, lastRow, 0, 1, -1);
}
fileDialog->setLayout(gridbox);
fileDialog->setAcceptMode(QFileDialog::AcceptSave);
if (selectedFilter)
{
fileDialog->selectNameFilter(*selectedFilter);
}
if (fileDialog->exec() == QDialog::Accepted)
{
if (selectedFilter)
{
*selectedFilter = fileDialog->selectedFilter();
}
if (combo->currentIndex() == 0)
{
tofImageType = mitk::ToFImageWriter::ToFImageType3D;
}
else
{
tofImageType = mitk::ToFImageWriter::ToFImageType2DPlusT;
}
distanceImageSelected = distanceImageCheckBox->isChecked();
amplitudeImageSelected = amplitudeImageCheckBox->isChecked();
intensityImageSelected = intensityImageCheckBox->isChecked();
rgbImageSelected = rgbImageCheckBox->isChecked();
rawDataSelected = rawDataCheckBox->isChecked();
selectedFileName = fileDialog->selectedFiles().value(0);
}
delete fileDialog;
return selectedFileName;
}