• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C++ QVariantMap函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C++中QVariantMap函数的典型用法代码示例。如果您正苦于以下问题:C++ QVariantMap函数的具体用法?C++ QVariantMap怎么用?C++ QVariantMap使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了QVariantMap函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: setProfileForKit

void QbsManager::addProfileFromKit(const ProjectExplorer::Kit *k)
{
    const QString name = ProjectExplorer::Project::makeUnique(
                QString::fromLatin1("qtc_") + k->fileSystemFriendlyName(), m_settings->profiles());
    setProfileForKit(name, k);
    addQtProfileFromKit(name, k);

    // set up properties:
    QVariantMap data = m_defaultPropertyProvider->properties(k, QVariantMap());
    QList<PropertyProvider *> providerList = ExtensionSystem::PluginManager::getObjects<PropertyProvider>();
    foreach (PropertyProvider *provider, providerList) {
        if (provider->canHandle(k))
            data = provider->properties(k, data);
    }

    addProfile(name, data);
}
开发者ID:ZerpHmm,项目名称:qt-creator,代码行数:17,代码来源:qbsprojectmanager.cpp


示例2: QVariantMap

void QSyncable::set(QVariantMap &data, const QStringList &path, const QVariant &value)
{
    QString key = path[0];

    if (path.size() == 1) {
        data[key] = value;
    } else {
        if (!data.contains(key) || !data[key].canConvert<QVariantMap>()) {
            data[key] = QVariantMap();
        }
        QStringList nextPath = path;
        nextPath.removeFirst();
        QVariantMap map = data[key].toMap();
        set(map, nextPath, value);
        data[key] = map;
    }
}
开发者ID:benlau,项目名称:qsyncable,代码行数:17,代码来源:qsyncablefunctions.cpp


示例3: qDebug

QVariantMap
QmlChoiseModel::get(int row) {
    qDebug() << Q_FUNC_INFO << "get" << row;

    if (row < 0 || row > _choiseItems.size() - 1) {
        qWarning() << Q_FUNC_INFO << "Invalid row " << row << "max" << _choiseItems.size();
        return QVariantMap();
    }
    QVariantMap map;
    const ChoiseItem &item = _choiseItems.at(row);

    map[_roleToProperty[IdRole]] = item.itemId;
    map[_roleToProperty[ShortDescriptionChoiseRole]] = item.shortDescription;
    map[_roleToProperty[LongDescriptionChoiseRole]] = item.longDescription;

    return map;
}
开发者ID:ajalkane,项目名称:profilematic,代码行数:17,代码来源:qmlchoisemodel.cpp


示例4: QVariantMap

QVariantMap ThemeConfig::save()
{
    QModelIndex index = configUi->themesListView->currentIndex();
    if (!index.isValid()) {
        return QVariantMap();
    }
    
    QVariantMap args;
    
    args["sddm.conf/Theme/Current"] = index.data(ThemesModel::IdRole);
    
    if (!mThemeConfigPath.isEmpty()) {
        args["theme.conf.user/General/background"] = mBackgroundPath;
    }
    
    return args;
}
开发者ID:KDE,项目名称:sddm-kcm,代码行数:17,代码来源:themeconfig.cpp


示例5: QVariantMap

TranslationInterface::~TranslationInterface()
{
#ifdef WITH_ANALYTICS
    if (m_privacyLevel == NoPrivacy) {
        m_analytics->trackEvent("Session End", QVariantMap(), true);
    }
#endif

    delete m_service;
    delete m_services;
    delete m_sourceLanguages;
    delete m_targetLanguages;
    delete m_sourceLanguage;
    delete m_targetLanguage;
    delete m_dict;
    delete m_settings;
}
开发者ID:smyhu,项目名称:taot,代码行数:17,代码来源:translationinterface.cpp


示例6: qfError

QVariantMap CardChecker::courseCodesForRunId(int run_id)
{
	QVariantMap ret;
	if(run_id <= 0) {
		qfError() << "Run ID == 0";
		return ret;
	}
	qf::qmlwidgets::framework::MainWindow *fwk = qf::qmlwidgets::framework::MainWindow::frameWork();
	auto runs_plugin = qobject_cast<Runs::RunsPlugin *>(fwk->plugin("Runs"));
	QF_ASSERT(runs_plugin != nullptr, "Bad plugin", return QVariantMap());

	int course_id = runs_plugin->courseForRun(run_id);
	if(course_id <= 0) {
		qfError() << "Course ID == 0";
		return ret;
	}
	{
		qfs::QueryBuilder qb;
		qb.select2("courses", "*")
				.from("courses")
				.where("courses.id=" QF_IARG(course_id));
		qfs::Query q;
		q.exec(qb.toString(), qf::core::Exception::Throw);
		if(q.next())
			ret = q.values();
	}
	{
		qfs::QueryBuilder qb;
		qb.select2("coursecodes", "position")
				.select2("codes", "code, altCode, outOfOrder")
				.from("coursecodes")
				.join("coursecodes.codeId", "codes.id")
				.where("coursecodes.courseId=" QF_IARG(course_id))
				.orderBy("coursecodes.position");
		qfs::Query q;
		//qfWarning() << qb.toString();
		q.exec(qb.toString(), qf::core::Exception::Throw);
		QVariantList codes;
		while (q.next()) {
			codes << q.values();
		}
		ret["codes"] = codes;
	}
	return ret;
}
开发者ID:Paukert,项目名称:quickbox,代码行数:45,代码来源:cardchecker.cpp


示例7: dialog

void DownloadRequestDialog::showPluginSettingsDialog(const QString &title, const QVariantList &settings) {
    PluginSettingsDialog dialog(settings, this);
    dialog.setWindowTitle(title);
    dialog.setTimeout(DownloadRequestModel::instance()->requestedSettingsTimeout());
    connect(DownloadRequestModel::instance(), SIGNAL(statusChanged(DownloadRequestModel::Status)),
            &dialog, SLOT(close()));
    
    switch (dialog.exec()) {
    case QDialog::Accepted:
        DownloadRequestModel::instance()->submitSettingsResponse(dialog.settings());
        break;
    case QDialog::Rejected:
        DownloadRequestModel::instance()->submitSettingsResponse(QVariantMap());
        break;
    default:
        break;
    }
}
开发者ID:marxoft,项目名称:qdl2,代码行数:18,代码来源:downloadrequestdialog.cpp


示例8: settings

void QbsManager::addProfileFromKit(const ProjectExplorer::Kit *k)
{
    const QString name = QString::fromLatin1("qtc_%1_%2").arg(k->fileSystemFriendlyName().left(8),
            QString::number(k->id().uniqueIdentifier(), 16));
    qbs::Profile(name, settings()).removeProfile();
    setProfileForKit(name, k);
    addQtProfileFromKit(name, k);

    // set up properties:
    QVariantMap data = m_defaultPropertyProvider->properties(k, QVariantMap());
    QList<PropertyProvider *> providerList = ExtensionSystem::PluginManager::getObjects<PropertyProvider>();
    foreach (PropertyProvider *provider, providerList) {
        if (provider->canHandle(k))
            data = provider->properties(k, data);
    }

    addProfile(name, data);
}
开发者ID:Gardenya,项目名称:qtcreator,代码行数:18,代码来源:qbsprojectmanager.cpp


示例9: createSession

void SessionAgent::createSession()
{
    if (m_manager->isAvailable()) {
        QDBusObjectPath obpath = m_manager->createSession(QVariantMap(),agentPath);
        if (!obpath.path().isEmpty()) {
            m_session = new Session(obpath.path(), this);
            new SessionNotificationAdaptor(this);
            QDBusConnection::systemBus().unregisterObject(agentPath);
            if (!QDBusConnection::systemBus().registerObject(agentPath, this)) {
                qDebug() << "Could not register agent object";
            }
        } else {
            qDebug() << "agentPath is not valid" << agentPath;
        }
    } else {
        qDebug() << Q_FUNC_INFO << "manager not valid";
    }
}
开发者ID:ftonello,项目名称:libconnman-qt,代码行数:18,代码来源:sessionagent.cpp


示例10: qsrand

void GenerateDNASequenceTask::run( ) {
    if ( seed < 0 ) {
        qsrand( QDateTime::currentDateTime( ).toTime_t( ) );
    } else {
        qsrand( seed );
    }
    dbiRef = AppContext::getDbiRegistry( )->getSessionTmpDbiRef( stateInfo );
    CHECK_OP( stateInfo, );
    DbiConnection con( dbiRef, stateInfo );
    CHECK_OP( stateInfo, );

    results.reserve( count );
    for ( int seqCount = 0; seqCount < count; seqCount++ ) {
        U2SequenceImporter seqImporter( QVariantMap( ), true );

        QByteArray sequenceChunk;
        if( window > length ) {
            window = length;
        }

        seqImporter.startSequence(stateInfo, dbiRef, U2ObjectDbi::ROOT_FOLDER, QString( "default" ), false);
        CHECK_OP_BREAK( stateInfo );

        for( int chunkCount = 0; chunkCount < length / window && !isCanceled( );
            chunkCount++ )
        {
            DNASequenceGenerator::generateSequence( baseContent, window, sequenceChunk );
            seqImporter.addBlock( sequenceChunk.constData( ), sequenceChunk.length( ), stateInfo );
            CHECK_OP_BREAK( stateInfo );
            const int currentProgress = int( 100 * ( seqCount + chunkCount * double ( window )
                / double ( length ) ) / double( count ) );
            stateInfo.setProgress( currentProgress );
        }
        // append last chunk
        DNASequenceGenerator::generateSequence( baseContent, length % window, sequenceChunk );
        seqImporter.addBlock( sequenceChunk.constData( ), sequenceChunk.length( ), stateInfo );
        CHECK_OP_BREAK( stateInfo );
        U2Sequence seq = seqImporter.finalizeSequence( stateInfo );
        CHECK_OP_BREAK( stateInfo );

        results.append( seq );
        stateInfo.setProgress( seqCount / count * 100 );
    }
}
开发者ID:ugeneunipro,项目名称:ugene,代码行数:44,代码来源:DNASequenceGenerator.cpp


示例11: while

QColor Theme::color(const QString& name)
{
    if(d->colorCache.contains(name))
        return d->colorCache.value(name);

    QStringList parts = name.split('/');
    QColor result;

    if(!parts.isEmpty())
    {
        QVariantMap map = d->colors;
        QString current = parts.takeFirst();

        while(map.contains(current))
        {
            QVariant value = map.value(current);
            if(value.type() == QVariant::Map)
            {
                if(parts.isEmpty())
                    break;

                map = value.toMap();
                current = parts.takeFirst();
            }
            else
            {
                result = value.value<QColor>();
                map = QVariantMap();
            }
        }
    }

    if(!result.isValid() && d->inheritedTheme) {
        result = d->inheritedTheme->color(name);
    }

    if(!result.isValid()) {
        qWarning() << "Unable to find color" << name;
    } else {
        d->colorCache.insert(name, result);
    }

    return result;
}
开发者ID:KDE,项目名称:calligra,代码行数:44,代码来源:Theme.cpp


示例12: warning

QVariantMap FileTransferChannelCreationProperties::createRequest() const
{
    if (!isValid()) {
        warning() << "Invalid file transfer creation properties";
        return QVariantMap();
    }

    QVariantMap request;
    request.insert(TP_QT_IFACE_CHANNEL + QLatin1String(".ChannelType"),
                   TP_QT_IFACE_CHANNEL_TYPE_FILE_TRANSFER);
    request.insert(TP_QT_IFACE_CHANNEL + QLatin1String(".TargetHandleType"),
                   (uint) Tp::HandleTypeContact);

    request.insert(TP_QT_IFACE_CHANNEL_TYPE_FILE_TRANSFER + QLatin1String(".Filename"),
                   suggestedFileName());
    request.insert(TP_QT_IFACE_CHANNEL_TYPE_FILE_TRANSFER + QLatin1String(".ContentType"),
                   contentType());
    request.insert(TP_QT_IFACE_CHANNEL_TYPE_FILE_TRANSFER + QLatin1String(".Size"),
                   size());

    if (hasContentHash()) {
        request.insert(TP_QT_IFACE_CHANNEL_TYPE_FILE_TRANSFER + QLatin1String(".ContentHashType"),
                       (uint) contentHashType());
        request.insert(TP_QT_IFACE_CHANNEL_TYPE_FILE_TRANSFER + QLatin1String(".ContentHash"),
                       contentHash());
    }

    if (hasDescription()) {
        request.insert(TP_QT_IFACE_CHANNEL_TYPE_FILE_TRANSFER + QLatin1String(".Description"),
                       description());
    }

    if (hasLastModificationTime()) {
        request.insert(TP_QT_IFACE_CHANNEL_TYPE_FILE_TRANSFER + QLatin1String(".Date"),
                       (qulonglong) lastModificationTime().toTime_t());
    }

    if (hasUri()) {
        request.insert(TP_QT_IFACE_CHANNEL_TYPE_FILE_TRANSFER + QLatin1String(".URI"),
                       uri());
    }

    return request;
}
开发者ID:TelepathyQt,项目名称:telepathy-qt,代码行数:44,代码来源:file-transfer-channel-creation-properties.cpp


示例13: authActionModifyUser

QVariantMap authActionModifyUser(int i, QIODevice *connection,
	const QSqlDatabase& db, const QSqlDatabase& user_db,
	const QVariantMap& action, const QString& email)
{
	Q_UNUSED(i);
	Q_UNUSED(db);
	Q_UNUSED(user_db);
	Q_UNUSED(connection);

	QString target_email = action.value("email").toString();
	QString new_email = action.value("new_email").toString();
	QString name = action.value("name").toString();
	QString pass = action.value("pass").toString();
	QVariantMap perms = action.value("perms").toMap();

	auth->modifyUser(email, target_email, new_email, name, pass, perms);

	return QVariantMap();
}
开发者ID:erikku,项目名称:frosty,代码行数:19,代码来源:AuthActions.cpp


示例14: tr

bool QgsProcessingProvider::addAlgorithm( QgsProcessingAlgorithm *algorithm )
{
  if ( !algorithm )
    return false;

  if ( mAlgorithms.contains( algorithm->name() ) )
  {
    QgsMessageLog::logMessage( tr( "Duplicate algorithm name %1 for provider %2" ).arg( algorithm->name(), id() ), QObject::tr( "Processing" ) );
    return false;
  }

  // init the algorithm - this allows direct querying of the algorithm's parameters
  // and outputs from the provider's copy
  algorithm->initAlgorithm( QVariantMap() );

  algorithm->setProvider( this );
  mAlgorithms.insert( algorithm->name(), algorithm );
  return true;
}
开发者ID:alexbruy,项目名称:QGIS,代码行数:19,代码来源:qgsprocessingprovider.cpp


示例15: QgsSettings

template<> QgsGeometryCheck *QgsGeometryCheckFactoryT<QgsGeometryTypeCheck>::createInstance( QgsGeometryCheckContext *context, const Ui::QgsGeometryCheckerSetupTab &ui ) const
{
  QgsSettings().setValue( sSettingsGroup + "checkTypePoint", ui.checkBoxPoint->isChecked() );
  QgsSettings().setValue( sSettingsGroup + "checkTypeMultipoint", ui.checkBoxMultipoint->isChecked() );
  QgsSettings().setValue( sSettingsGroup + "checkTypeLine", ui.checkBoxLine->isChecked() );
  QgsSettings().setValue( sSettingsGroup + "checkTypeMultiline", ui.checkBoxMultiline->isChecked() );
  QgsSettings().setValue( sSettingsGroup + "checkTypePolygon", ui.checkBoxPolygon->isChecked() );
  QgsSettings().setValue( sSettingsGroup + "checkTypeMultipolygon", ui.checkBoxMultipolygon->isChecked() );

  int allowedTypes = 0;
  if ( ui.checkBoxPoint->isEnabled() && ui.checkBoxPoint->isChecked() )
  {
    allowedTypes |= 1 << QgsWkbTypes::Point;
  }
  if ( ui.checkBoxMultipoint->isEnabled() && ui.checkBoxMultipoint->isChecked() )
  {
    allowedTypes |= 1 << QgsWkbTypes::MultiPoint;
  }
  if ( ui.checkBoxLine->isEnabled() && ui.checkBoxLine->isChecked() )
  {
    allowedTypes |= 1 << QgsWkbTypes::LineString;
  }
  if ( ui.checkBoxMultiline->isEnabled() && ui.checkBoxMultiline->isChecked() )
  {
    allowedTypes |= 1 << QgsWkbTypes::MultiLineString;
  }
  if ( ui.checkBoxPolygon->isEnabled() && ui.checkBoxPolygon->isChecked() )
  {
    allowedTypes |= 1 << QgsWkbTypes::Polygon;
  }
  if ( ui.checkBoxMultipolygon->isEnabled() && ui.checkBoxMultipolygon->isChecked() )
  {
    allowedTypes |= 1 << QgsWkbTypes::MultiPolygon;
  }
  if ( allowedTypes != 0 )
  {
    return new QgsGeometryTypeCheck( context, QVariantMap(), allowedTypes );
  }
  else
  {
    return nullptr;
  }
}
开发者ID:alexbruy,项目名称:QGIS,代码行数:43,代码来源:qgsgeometrycheckfactory.cpp


示例16: load

  QVariantMap load(QString fn, bool *ok) {
    if (ok)
      *ok = false;
    QFile f(fn);
    if (!f.open(QFile::ReadOnly)) {
      qDebug() << "JSONFile::load: file not found";
      return QVariantMap();
    }

    bool ok1;
    QTextStream ts(&f);
    ts.setCodec("UTF-8");
    QVariantMap res = read(ts.readAll(), &ok1);
    if (!ok1) 
      qDebug() << "(while reading: " << fn << ")";
    if (ok)
      *ok = ok1;
    return res;
  }
开发者ID:wagenadl,项目名称:eln,代码行数:19,代码来源:JSONFile.cpp


示例17: switch

void DesktopNotificationsFactory::showNotifications(const QPixmap &icon, const QString &heading, const QString &text)
{
    if (!m_enabled) {
        return;
    }

    switch (m_notifType) {
    case PopupWidget:
        if (!m_desktopNotif) {
            m_desktopNotif = new DesktopNotification();
        }
        m_desktopNotif.data()->setPixmap(icon);
        m_desktopNotif.data()->setHeading(heading);
        m_desktopNotif.data()->setText(text);
        m_desktopNotif.data()->setTimeout(m_timeout);
        m_desktopNotif.data()->move(m_position);
        m_desktopNotif.data()->show();
        break;
    case DesktopNative:
#ifdef Q_WS_X11
        QFile tmp(QDir::tempPath() + "/qupzilla_notif.png");
        tmp.open(QFile::WriteOnly);
        icon.save(tmp.fileName());

        QDBusInterface dbus("org.freedesktop.Notifications", "/org/freedesktop/Notifications", "org.freedesktop.Notifications", QDBusConnection::sessionBus());
        QVariantList args;
        args.append("qupzilla");
        args.append(m_uint);
        args.append(tmp.fileName());
        args.append(heading);
        args.append(text);
        args.append(QStringList());
        args.append(QVariantMap());
        args.append(m_timeout);
        QDBusMessage message = dbus.callWithArgumentList(QDBus::Block, "Notify", args);
        QVariantList list = message.arguments();
        if (list.count() > 0) {
            m_uint = list.at(0).toInt();
        }
#endif
        break;
    }
}
开发者ID:JHooverman,项目名称:QupZilla,代码行数:43,代码来源:desktopnotificationsfactory.cpp


示例18: qWarning

	void ProtoWrapper::RegisterAccount (const QString& name, const QList<QWidget*>& widgets)
	{
		auto fpg = qobject_cast<AccountRegFirstPage*> (widgets.value (0));
		if (!fpg)
		{
			qWarning () << Q_FUNC_INFO
					<< "incorrect first page"
					<< widgets;
			return;
		}

		const QVariantMap& params = GetParamsFromWidgets (widgets);

		auto pending = AM_->createAccount (CM_->name (), ProtoName_, name, params, QVariantMap ());
		connect (pending,
				SIGNAL (finished (Tp::PendingOperation*)),
				this,
				SLOT (handleAccountCreated (Tp::PendingOperation*)));
		PendingSettings_ [pending] = GetSettingsFromWidgets (widgets);
	}
开发者ID:aboduo,项目名称:leechcraft,代码行数:20,代码来源:protowrapper.cpp


示例19: QVariantList

void MixedTest::test_mixed()
{
    QVariantMap map;
    map["booleans"] = QVariantList() << false << true;
    map["list2"] = QVariantList() << (QVariantList() << "abc" << "def")
                                  << (QVariantList() << "qwe" << "rty");
    map["integers"] = QVariantList() << 0 << 127 << -31 << 128 << 777;
    map["bytearray"] = QByteArray("bytes");

    QVariantMap map2;
    map2["one"] = 1;
    map2["two"] = QVariantMap();
    map["map2"] = map2;

    QByteArray arr = MsgPack::pack(map);

    QVariant unpacked = MsgPack::unpack(arr);

    QVERIFY(unpacked.toMap() == map);
}
开发者ID:SGbo,项目名称:qmsgpack,代码行数:20,代码来源:mixed_test.cpp


示例20: value

Preferences QDesignerSettings::preferences() const
{
    Preferences rc;
#ifdef Q_WS_WIN
    const UIMode defaultMode = DockedMode;
#else
    const UIMode defaultMode = TopLevelMode;
#endif
    rc.m_uiMode = static_cast<UIMode>(value(QLatin1String("UI/currentMode"), defaultMode).toInt());
    rc.m_writingSystem = static_cast<QFontDatabase::WritingSystem>(value(QLatin1String("UI/writingSystem"), QFontDatabase::Any).toInt());
    rc.m_font = qVariantValue<QFont>(value(QLatin1String("UI/font")));
    rc.m_useFont = value(QLatin1String("UI/useFont"), QVariant(false)).toBool();
    const QVariantMap defaultGridMap = value(QLatin1String(defaultGridKey), QVariantMap()).toMap();
    if (!defaultGridMap.empty())
        rc.m_defaultGrid.fromVariantMap(defaultGridMap);
    rc.m_additionalTemplatePaths = additionalFormTemplatePaths();
    rc.m_previewConfigurationWidgetState = previewConfigurationWidgetState();
    rc.m_previewConfiguration = previewConfiguration();
    return rc;
}
开发者ID:FilipBE,项目名称:qtextended,代码行数:20,代码来源:qdesigner_settings.cpp



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ QVector2D函数代码示例发布时间:2022-05-30
下一篇:
C++ QVariantList函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap