当前位置: 首页>>代码示例>>C++>>正文


C++ QUuid类代码示例

本文整理汇总了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);
}
开发者ID:bavanisp,项目名称:qtmobility-1.1.0,代码行数:11,代码来源:objectendpoint_dbus.cpp

示例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();
}
开发者ID:MarcelEdward,项目名称:hifi,代码行数:8,代码来源:OctreeElement.cpp

示例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);
    }
}
开发者ID:AndrewMeadows,项目名称:hifi,代码行数:8,代码来源:ScriptUUID.cpp

示例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());
}
开发者ID:sanchay160887,项目名称:vacuum-im,代码行数:17,代码来源:consolewidget.cpp

示例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;
}
开发者ID:MarcelEdward,项目名称:hifi,代码行数:8,代码来源:OctreeElement.cpp

示例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();
    }
}
开发者ID:jgaa,项目名称:darkspeak,代码行数:8,代码来源:torserviceinterface.cpp

示例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;
}
开发者ID:AlexanderOtavka,项目名称:hifi,代码行数:8,代码来源:NLPacket.cpp

示例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);
}
开发者ID:KlemensWinter,项目名称:Nixnote2,代码行数:46,代码来源:datastore.cpp

示例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");
}
开发者ID:ecosprog,项目名称:pebble,代码行数:9,代码来源:jskitobjects.cpp

示例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;
}
开发者ID:llseptem,项目名称:Cat,代码行数:9,代码来源:CatSolution.cpp

示例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;
}
开发者ID:koboveb,项目名称:SVID.TERMINAL,代码行数:9,代码来源:Database.cpp

示例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));
    }
}
开发者ID:TheTypoMaster,项目名称:calligra,代码行数:18,代码来源:KoRdfFoaF.cpp

示例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();
}
开发者ID:Frechdachs,项目名称:mpc-qt,代码行数:9,代码来源:playlistwindow.cpp

示例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);
        }
    }
开发者ID:ClydeMojura,项目名称:android-python27,代码行数:18,代码来源:sipQtCoreQUuid.cpp

示例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;
    }
}
开发者ID:SeijiEmery,项目名称:hifi,代码行数:18,代码来源:AudioMixerClientData.cpp


注:本文中的QUuid类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。