ObjectPtr StringDialog::createNewGeneratedString(){ Q_ASSERT(_document && _document->objectStore()); QString value = _stringTab->value(); // qDebug() << "Creating new string ===>" // << "\n\ttag:" << DataDialog::tagString() // << "\n\tvalue:" << value // << endl; StringPtr string = _document->objectStore()->createObject<String>(); string->setValue(value); string->setOrphan(true); string->setEditable(true); if (DataDialog::tagStringAuto()) { string->setDescriptiveName(QString()); } else { string->setDescriptiveName(DataDialog::tagString()); } string->writeLock(); string->registerChange(); string->unlock(); _dataObjectName = string->Name(); //UpdateServer::self()->requestUpdateSignal(); return static_cast<ObjectPtr>(string); }
void BasicPlugin::setOutputString(const QString &type, const QString &name) { QString txt = !name.isEmpty() ? name : type; Q_ASSERT(store()); StringPtr s = store()->createObject<String>(); s->setProvider(this); s->setSlaveName(txt); s->setOrphan(false); _outputStrings.insert(type, s); }