本文整理汇总了C++中QObjectScopedPointer类的典型用法代码示例。如果您正苦于以下问题:C++ QObjectScopedPointer类的具体用法?C++ QObjectScopedPointer怎么用?C++ QObjectScopedPointer使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了QObjectScopedPointer类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: EditMarkerDialog
void EditMarkerGroupDialog::sl_onEditButtonClicked() {
QItemSelectionModel *m = table->selectionModel();
QModelIndexList selected = m->selectedRows();
if (1 != selected.size()) {
return;
}
QMap<QString, QString>::iterator i = marker->getValues().begin();
i += selected.first().row();
QVariantList values;
MarkerUtils::stringToValue(MarkerTypes::getDataTypeById(marker->getType()),marker->getValues().key(*i), values);
QObjectScopedPointer<EditMarkerDialog> dlg = new EditMarkerDialog(false, marker->getType(), *i, values, this);
const int dialogResult = dlg->exec();
CHECK(!dlg.isNull(), );
if (QDialog::Accepted == dialogResult) {
QString newValueString;
QString newName = dlg->getName();
MarkerUtils::valueToString(MarkerTypes::getDataTypeById(marker->getType()), dlg->getValues(), newValueString);
markerModel->removeRows(selected.first().row(), 1, selected.first());
markerModel->addMarker(newValueString, newName);
}
}
示例2: tr
void EnzymesPlugin::sl_onOpenDigestSequenceDialog() {
GObjectViewWindow* w = GObjectViewUtils::getActiveObjectViewWindow();
if (w == NULL) {
QMessageBox::information(QApplication::activeWindow(), openDigestSequenceDialog->text(),
tr("There is no active sequence object.\nTo start partition open sequence document."));
return;
}
AnnotatedDNAView* view = qobject_cast<AnnotatedDNAView*>(w->getObjectView());
if (view == NULL) {
QMessageBox::information(QApplication::activeWindow(), openDigestSequenceDialog->text(),
tr("There is no active sequence object.\nTo start partition open sequence document."));
return;
}
if (!view->getSequenceInFocus()->getSequenceObject()->getAlphabet()->isNucleic()) {
QMessageBox::information(QApplication::activeWindow(), openDigestSequenceDialog->text(),
tr("Can not digest into fragments non-nucleic sequence."));
return;
}
QObjectScopedPointer<DigestSequenceDialog> dlg = new DigestSequenceDialog(view->getSequenceInFocus(), QApplication::activeWindow());
dlg->exec();
}
示例3: assert
void CollocationsDialogController::sl_saveClicked() {
assert(resultsList->count() > 0);
CreateAnnotationModel m;
m.sequenceObjectRef = ctx->getSequenceGObject();
m.hideLocation = true;
m.useAminoAnnotationTypes = ctx->getAlphabet()->isAmino();
m.sequenceLen = ctx->getSequenceObject()->getSequenceLength();
QObjectScopedPointer<CreateAnnotationDialog> d = new CreateAnnotationDialog(this, m);
const int rc = d->exec();
CHECK(!d.isNull(), );
if (rc != QDialog::Accepted) {
return;
}
QList<SharedAnnotationData> list;
for (int i=0, n = resultsList->count(); i<n; ++i) {
CDCResultItem* item = static_cast<CDCResultItem*>(resultsList->item(i));
SharedAnnotationData data = m.data;
data->location->regions.append(item->r);
data->setStrand(U2Strand::Direct);
U1AnnotationUtils::addDescriptionQualifier(data, m.description);
list.append(data);
}
ADVCreateAnnotationsTask* t = new ADVCreateAnnotationsTask(ctx->getAnnotatedDNAView(), m.getAnnotationObject(), m.groupName, list);
AppContext::getTaskScheduler()->registerTopLevelTask(t);
}
示例4: SAFE_POINT
void SecStructPredictViewAction::sl_execute() {
QAction *a = dynamic_cast<QAction*>(sender());
GObjectViewAction *viewAction = dynamic_cast<GObjectViewAction*>(a);
SAFE_POINT(NULL != viewAction, "NULL action",);
AnnotatedDNAView *av = qobject_cast<AnnotatedDNAView*>(viewAction->getObjectView());
SAFE_POINT(NULL != av, "NULL dna view",);
SecStructPredictAlgRegistry *sspar = AppContext::getSecStructPredictAlgRegistry();
SAFE_POINT(NULL != sspar, "NULL SecStructPredictAlgRegistry",);
if (sspar->getAlgNameList().isEmpty()) {
QMessageBox::information(av->getWidget(),
tr("Secondary Structure Prediction"),
tr("No algorithms for secondary structure prediction are available.\nPlease, load the corresponding plugins."));
return;
}
ADVSequenceObjectContext *seqCtx = av->getSequenceInFocus();
SAFE_POINT(NULL != seqCtx, "NULL sequence context",);
SAFE_POINT(NULL != seqCtx->getAlphabet(), "NULL alphabet",);
SAFE_POINT(seqCtx->getAlphabet()->isAmino(), "Wrong alphabet",);
QObjectScopedPointer<SecStructDialog> secStructDialog = new SecStructDialog(seqCtx, av->getWidget());
secStructDialog->exec();
}
示例5: sl_showDialog
void TrimmomaticPropertyWidget::sl_showDialog() {
QObjectScopedPointer<TrimmomaticPropertyDialog> dialog
(new TrimmomaticPropertyDialog(lineEdit->text(), this));
if (QDialog::Accepted == dialog->exec()) {
CHECK(!dialog.isNull(), );
lineEdit->setText(dialog->getValue());
emit si_valueChanged(value());
}
示例6: PrimerLibrarySelector
void PrimerGroupBox::sl_browse() {
QObjectScopedPointer<PrimerLibrarySelector> dlg = new PrimerLibrarySelector(AppContext::getMainWindow()->getQMainWindow());
dlg->exec();
CHECK(!dlg.isNull(), );
CHECK(QDialog::Accepted == dlg->result(), );
Primer result = dlg->getResult();
primerEdit->setInvalidatedText(result.sequence);
}
示例7: tr
void DnaAssemblySupport::sl_showBuildIndexDialog()
{
DnaAssemblyAlgRegistry* registry = AppContext::getDnaAssemblyAlgRegistry();
if (registry->getRegisteredAlgorithmIds().isEmpty()) {
QMessageBox::information(QApplication::activeWindow(), tr("DNA Assembly"),
tr("There are no algorithms for DNA assembly available.\nPlease, check your plugin list.") );
return;
}
QObjectScopedPointer<BuildIndexDialog> dlg = new BuildIndexDialog(registry, QApplication::activeWindow());
dlg->exec();
CHECK(!dlg.isNull(), );
if (QDialog::Accepted == dlg->result()) {
DnaAssemblyToRefTaskSettings s;
s.refSeqUrl = dlg->getRefSeqUrl();
s.algName = dlg->getAlgorithmName();
s.resultFileName = dlg->getIndexFileName();
s.indexFileName = dlg->getIndexFileName();
s.setCustomSettings(dlg->getCustomSettings());
s.openView = false;
s.prebuiltIndex = false;
s.pairedReads = false;
Task* assemblyTask = new DnaAssemblyTaskWithConversions(s, false, true);
AppContext::getTaskScheduler()->registerTopLevelTask(assemblyTask);
}
}
示例8: assert
void EnzymesADVContext::sl_search() {
GObjectViewAction* action = qobject_cast<GObjectViewAction*>(sender());
assert(action!=NULL);
AnnotatedDNAView* av = qobject_cast<AnnotatedDNAView*>(action->getObjectView());
assert(av!=NULL);
ADVSequenceObjectContext* seqCtx = av->getSequenceInFocus();
assert(seqCtx->getAlphabet()->isNucleic());
QObjectScopedPointer<FindEnzymesDialog> d = new FindEnzymesDialog(seqCtx);
d->exec();
}
示例9: QColorDialog
void DotPlotDialog::sl_invertedColorButton() {
QObjectScopedPointer<QColorDialog> d = new QColorDialog(invertedColor, this);
d->exec();
CHECK(!d.isNull(), );
if (QDialog::Accepted == d->result()) {
invertedColor = d->selectedColor();
invertedCheckBox->setChecked(true);
}
updateColors();
}
示例10: assert
void ImportAnnotationsFromCSVDialog::configureColumn(int column) {
assert(column >= 0 && column < columnsConfig.size());
const ColumnConfig& config = columnsConfig.at(column);
QObjectScopedPointer<CSVColumnConfigurationDialog> d = new CSVColumnConfigurationDialog(this, config);
int rc = d->exec(); // TODO: set dialog position close to the header item
CHECK(!d.isNull(), );
if (rc == QDialog::Accepted) {
columnsConfig[column] = d->config;
}
previewTable->horizontalHeaderItem(column)->setText(getHeaderItemText(column));
}
示例11: assert
void HMMMSAEditorContext::sl_build() {
GObjectViewAction* action = qobject_cast<GObjectViewAction*>(sender());
assert(action!=NULL);
MSAEditor* ed = qobject_cast<MSAEditor*>(action->getObjectView());
assert(ed!=NULL);
MAlignmentObject* obj = ed->getMSAObject();
if (obj) {
QString profileName = obj->getGObjectName() == MA_OBJECT_NAME ? obj->getDocument()->getName() : obj->getGObjectName();
QObjectScopedPointer<HMMBuildDialogController> d = new HMMBuildDialogController(profileName, obj->getMAlignment());
d->exec();
CHECK(!d.isNull(), );
}
}
示例12: foreach
bool CreatePhyTreeDialogController::checkLicense() {
if (settings.algorithmId == "PHYLIP Neighbor Joining") { // This is a bad hack :(
QList<Plugin *> plugins = AppContext::getPluginSupport()->getPlugins();
foreach (Plugin *plugin, plugins) {
if (plugin->getName() == "PHYLIP") {
if (!plugin->isLicenseAccepted()) {
QObjectScopedPointer<LicenseDialog> licenseDialog = new LicenseDialog(plugin);
const int ret = licenseDialog->exec();
CHECK(!licenseDialog.isNull(), false);
return (ret == QDialog::Accepted);
}
}
}
}
示例13: EditConnectionDialog
void SharedConnectionsDialog::sl_editClicked() {
const QString dbiUrl = ui->lwConnections->currentItem()->data(UrlRole).toString();
const QString userName = ui->lwConnections->currentItem()->data(LoginRole).toString();
const QString connectionName = ui->lwConnections->currentItem()->text();
QObjectScopedPointer<EditConnectionDialog> editDialog = new EditConnectionDialog(this, dbiUrl, userName, connectionName);
editDialog->setReadOnly(U2DbiUtils::PUBLIC_DATABASE_URL == U2DbiUtils::createFullDbiUrl(userName, dbiUrl));
const int dialogResult = editDialog->exec();
CHECK(!editDialog.isNull(), );
if (QDialog::Accepted == dialogResult) {
QListWidgetItem* item = ui->lwConnections->currentItem();
const QString login = editDialog->getUserName();
const QString shortDbUrl = editDialog->getShortDbiUrl();
checkDbConnectionDuplicate(shortDbUrl, login, item->data(Qt::DisplayRole).toString());
if (connectionName != editDialog->getName()) {
removeRecentConnection(item);
}
item->setText(editDialog->getName());
item->setData(UrlRole, shortDbUrl);
item->setData(LoginRole, login);
connectionTasks.remove(item);
findUpgradeTasks();
saveRecentConnection(item);
updateState();
}
}
示例14: AddNewDocumentDialogImpl
void AddNewDocumentDialogController::run(QWidget* p, AddNewDocumentDialogModel& m, const DocumentFormatConstraints& c) {
Project* proj = AppContext::getProject();
if (proj->isStateLocked()) {
QMessageBox::critical(NULL, L10N::errorTitle(), AddNewDocumentDialogImpl::tr("Project is locked"));
m.successful = false;
return;
}
QObjectScopedPointer<AddNewDocumentDialogImpl> d = new AddNewDocumentDialogImpl(p, m, c);
d->exec();
CHECK(!d.isNull(), );
m = d->model;
assert(proj->findDocumentByURL(m.url) == NULL);
}
示例15: SAFE_POINT
bool CreatePhyTreeDialogController::checkMemory() {
SAFE_POINT(NULL != settingsWidget, "Settings widget is NULL", false);
QString msg;
const bool memCheckOk = settingsWidget->checkMemoryEstimation(msg, msa, settings);
if (!memCheckOk) {
QObjectScopedPointer<QMessageBox> mb = new QMessageBox(QMessageBox::Warning, tr("Warning"), msg, QMessageBox::Ok|QMessageBox::Cancel, this);
mb->exec();
CHECK(!mb.isNull(), false);
return (mb->result() == QMessageBox::Ok);
}
return true;
}