本文整理汇总了C++中QUuid类的典型用法代码示例。如果您正苦于以下问题:C++ QUuid类的具体用法?C++ QUuid怎么用?C++ QUuid使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了QUuid类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: unregisterObjectDBus
/*!
Unregisters the DBus object
*/
void ObjectEndPoint::unregisterObjectDBus(const QRemoteServiceRegister::Entry& entry, const QUuid& id)
{
uint hash = qHash(id.toString());
QString objPath = "/" + entry.interfaceName() + "/" + entry.version() +
"/" + QString::number(hash);
objPath.replace(QString("."), QString("/"));
connection->unregisterObject(objPath, QDBusConnection::UnregisterTree);
}
示例2: QUuid
bool OctreeElement::matchesSourceUUID(const QUuid& sourceUUID) const {
if (_sourceUUIDKey > KEY_FOR_NULL) {
if (_mapKeysToSourceUUIDs.end() != _mapKeysToSourceUUIDs.find(_sourceUUIDKey)) {
return QUuid(_mapKeysToSourceUUIDs[_sourceUUIDKey]) == sourceUUID;
}
}
return sourceUUID.isNull();
}
示例3: print
void ScriptUUID::print(const QString& label, const QUuid& id) {
QString message = QString("%1 %2").arg(qPrintable(label));
message = message.arg(id.toString());
qCDebug(scriptengine) << message;
if (ScriptEngine* scriptEngine = qobject_cast<ScriptEngine*>(engine())) {
scriptEngine->print(message);
}
}
示例4: saveContext
void ConsoleWidget::saveContext(const QUuid &AContextId)
{
OptionsNode node = Options::node(OPV_CONSOLE_CONTEXT_ITEM, AContextId.toString());
node.setValue(ui.cmbStreamJid->currentIndex()>0 ? ui.cmbStreamJid->itemData(ui.cmbStreamJid->currentIndex()).toString() : QString::null,"streamjid");
QStringList conditions;
for (int i=0; i<ui.ltwConditions->count(); i++)
conditions.append(ui.ltwConditions->item(i)->text());
node.setValue(conditions,"conditions");
node.setValue(ui.chbWordWrap->isChecked(),"word-wrap");
node.setValue(ui.chbHilightXML->checkState(),"highlight-xml");
Options::setFileValue(saveGeometry(),"console.context.window-geometry",AContextId.toString());
Options::setFileValue(ui.sptHSplitter->saveState(),"console.context.hsplitter-state",AContextId.toString());
Options::setFileValue(ui.sptVSplitter->saveState(),"console.context.vsplitter-state",AContextId.toString());
}
示例5: getSourceNodeUUIDKey
uint16_t OctreeElement::getSourceNodeUUIDKey(const QUuid& sourceUUID) {
uint16_t key = KEY_FOR_NULL;
QString sourceUUIDString = sourceUUID.toString();
if (_mapSourceUUIDsToKeys.end() != _mapSourceUUIDsToKeys.find(sourceUUIDString)) {
key = _mapSourceUUIDsToKeys[sourceUUIDString];
}
return key;
}
示例6: autorizeConnection
void TorServiceInterface::autorizeConnection(const QUuid &connection, const bool allow)
{
if (auto peer = getPeer(connection)) {
peer->authorize(allow);
} else {
LFLOG_WARN << "No peer with id " << connection.toString();
}
}
示例7: writeSourceID
void NLPacket::writeSourceID(const QUuid& sourceID) const {
Q_ASSERT(!NON_SOURCED_PACKETS.contains(_type));
auto offset = Packet::totalHeaderSize(isPartOfMessage()) + sizeof(PacketType) + sizeof(PacketVersion);
memcpy(_packet.get() + offset, sourceID.toRfc4122().constData(), NUM_BYTES_RFC4122_UUID);
_sourceID = sourceID;
}
示例8: QLOG_TRACE
//* Create the NoteTable table.
void DataStore::createTable() {
db->lockForWrite();
QLOG_TRACE() << "Entering DataStore::createTable()";
QLOG_DEBUG() << "Creating table DataStore";
NSqlQuery sql(db);
QString command("Create table DataStore (" +
QString("lid integer,") +
QString("key integer,") +
QString("data blob default null collate nocase)"));
if (!sql.exec(command)) {
QLOG_ERROR() << "Creation of DataStore table failed: " << sql.lastError();
}
sql.exec("CREATE INDEX DataStore_Lid on DataStore (lid)");
sql.exec("CREATE INDEX DataStore_Key on DataStore (key)");
sql.prepare("Create view SearchModel as select lid, data as name from DataStore where key=2001");
if (!sql.exec()) {
QLOG_ERROR() << "Creation of SearchModel table failed: " << sql.lastError();
}
sql.prepare("Create View TagModel as select a.lid, (select d.data from DataStore d where d.key=1000 and a.lid = d.lid) as guid, (select data from datastore b1 where b1.lid = (select b.data from DataStore b where b.key=1002 and a.lid = b.lid)) as parent_gid, (select c.data from DataStore c where c.key=1001 and a.lid = c.lid) as name, (select e.data from DataStore e where e.key=1006 and a.lid = e.lid) as account from DataStore a where a.key=1000;");
if (!sql.exec()) {
QLOG_ERROR() << "Creation of TagModel table failed: " << sql.lastError();
}
sql.prepare("Create View NotebookModel as select a.lid, (select b.data from DataStore b where b.key=3002 and a.lid = b.lid) as stack, (select c.data from DataStore c where c.key=3001 and a.lid = c.lid) as name, (select d.data from DataStore d where d.key=3201 and a.lid = d.lid) as username, (select e.data from DataStore e where e.key=3999 and a.lid = e.lid) as isClosed from DataStore a where a.key=3000;");
if (!sql.exec()) {
QLOG_ERROR() << "Creation of NotebookModel table failed: " << sql.lastError();
}
if (!sql.exec("Create virtual table SearchIndex using fts4 (lid int, weight int, source text, content text)")) {
QLOG_ERROR() << "Creation of SearchIndex table failed: " << sql.lastError();
}
sql.finish();
db->unlock();
Notebook notebook;
NotebookTable table(db);
notebook.name = "My Notebook";
notebook.defaultNotebook = true;
QUuid uuid;
notebook.guid = uuid.createUuid().toString().replace("{","").replace("}","");
table.add(0,notebook,true,false);
}
示例9: getStorageFileFor
QString JSKitLocalStorage::getStorageFileFor(const QUuid &uuid)
{
QDir dataDir(QStandardPaths::writableLocation(QStandardPaths::DataLocation));
dataDir.mkpath("js-storage");
QString fileName = uuid.toString();
fileName.remove('{');
fileName.remove('}');
return dataDir.absoluteFilePath("js-storage/" + fileName + ".ini");
}
示例10: createCommand
QDomElement CatSolution::createCommand(const QUuid& uid)
{
QDomElement cmd = myDoc.createElement("Command");
QDomElement id = myDoc.createElement("UID");
QDomText uuidStr = myDoc.createTextNode(uid.toString());
id.appendChild(uuidStr);
cmd.appendChild(id);
return cmd;
}
示例11: buildNameFromId
QString Database::buildNameFromId(const QString& prefix, const QUuid& id)
{
QString str;
str = prefix + id.toString();
str.remove(QChar('{'));
str.remove(QChar('}'));
str.remove(QChar('-'));
return str;
}
示例12: updateFromEditorData
void KoRdfFoaF::updateFromEditorData()
{
if (m_uri.size() <= 0) {
QUuid u = QUuid::createUuid();
m_uri = u.toString();
kDebug(30015) << "no uuid, created one:" << u.toString();
}
QString predBase = "http://xmlns.com/foaf/0.1/";
kDebug(30015) << "name:" << m_name << " newV:" << editWidget.name->text();
setRdfType(predBase + "Person");
updateTriple(m_name, editWidget.name->text(), predBase + "name");
updateTriple(m_nick, editWidget.nick->text(), predBase + "nick");
updateTriple(m_homePage, editWidget.url->text(), predBase + "homepage");
updateTriple(m_phone, editWidget.phone->text(), predBase + "phone");
if (documentRdf()) {
const_cast<KoDocumentRdf*>(documentRdf())->emitSemanticObjectUpdated(hKoRdfSemanticItem(this));
}
}
示例13: changePlaylistSelection
void PlaylistWindow::changePlaylistSelection( QUrl itemUrl, QUuid playlistUuid, QUuid itemUuid)
{
(void)itemUrl;
if (!activateItem(playlistUuid, itemUuid))
return;
auto pl = PlaylistCollection::getSingleton()->playlistOf(playlistUuid);
if (!itemUuid.isNull() && pl->queueFirst() == itemUuid)
pl->queueTakeFirst();
}
示例14: sipConvertFromNewType
static PyObject *meth_QUuid_toString(PyObject *sipSelf, PyObject *sipArgs)
{
PyObject *sipParseErr = NULL;
{
QUuid *sipCpp;
if (sipParseArgs(&sipParseErr, sipArgs, "B", &sipSelf, sipType_QUuid, &sipCpp))
{
QString *sipRes;
Py_BEGIN_ALLOW_THREADS
sipRes = new QString(sipCpp->toString());
Py_END_ALLOW_THREADS
return sipConvertFromNewType(sipRes,sipType_QString,NULL);
}
}
示例15: unpackFloatGainFromByte
void AudioMixerClientData::parsePerAvatarGainSet(ReceivedMessage& message, const SharedNodePointer& node) {
QUuid uuid = node->getUUID();
// parse the UUID from the packet
QUuid avatarUuid = QUuid::fromRfc4122(message.readWithoutCopy(NUM_BYTES_RFC4122_UUID));
uint8_t packedGain;
message.readPrimitive(&packedGain);
float gain = unpackFloatGainFromByte(packedGain);
if (avatarUuid.isNull()) {
// set the MASTER avatar gain
setMasterAvatarGain(gain);
qCDebug(audio) << "Setting MASTER avatar gain for " << uuid << " to " << gain;
} else {
// set the per-source avatar gain
hrtfForStream(avatarUuid, QUuid()).setGainAdjustment(gain);
qCDebug(audio) << "Setting avatar gain adjustment for hrtf[" << uuid << "][" << avatarUuid << "] to " << gain;
}
}