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


C++ QVariantList::clear方法代码示例

本文整理汇总了C++中QVariantList::clear方法的典型用法代码示例。如果您正苦于以下问题:C++ QVariantList::clear方法的具体用法?C++ QVariantList::clear怎么用?C++ QVariantList::clear使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在QVariantList的用法示例。


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

示例1: testUpdateNotification

void Ut_CReporterNotifyDialogPlugin::testUpdateNotification()
{
    // Test notification update.
    QSignalSpy requestCompletedSpy(m_Subject, SIGNAL(requestCompleted()));

    m_Subject->initialize(m_Server);
    QVariantList args;
    args << QString("/media/mmc1/core-dumps/test-1234-11-4321.rcore.lzo");

    // Request plugin and show notification.
    bool retVal = m_Subject->requestDialog(args);
    QVERIFY(retVal == true);

    QVERIFY(notificationCreated = true);
    QVERIFY(notificationTimeoutSet = true);

    notificationTimeoutSet = false;

    args.clear();
    args << QString("/media/mmc1/core-dumps/application-1234-9-4321.rcore.lzo");

    // Request plugin and show notification.
    retVal = m_Subject->requestDialog(args);
    QVERIFY(retVal == true);

    // Notifications are no longer updated but removed and replaced with a new one
    //QVERIFY(notificationUpdated == true);
    QVERIFY(notificationTimeoutSet == true);

    m_Subject->notificationTimeout();

    QVERIFY(m_Subject->isActive() == false);
    // Now request is not completed until the dialog has disappeared so this cannot be tested here.
    //QVERIFY(requestCompletedSpy.count() == 1);
}
开发者ID:rainemak,项目名称:crash-reporter,代码行数:35,代码来源:ut_creporternotifydialogplugin.cpp

示例2: initTables

void QxtWebJsonRPCService::Private::handle(QxtWebRequestEvent *event, QVariant rid, QString action,  QVariant argsE)
{
    QVariantMap argsM;
    QVariantList args;

    if (argsE.type() == QVariant::Map) {
        argsM = argsE.toMap();
        args = argsM.values();
    } else {
        args = argsE.toList();
    }

    if (!invokable)
        initTables(p);


    if (!methods.contains(action.toUtf8() + QByteArray::number(args.count()))) {
        QVariantMap res;
        res.insert("result", QVariant());
        res.insert("error", "no such method or incorrect number of arguments");
        res.insert("id", rid);
        QxtWebPageEvent *err = new QxtWebPageEvent(event->sessionID, event->requestID,
                QxtJSON::stringify(res).toUtf8() + "\r\n");
        p->postEvent(err);
        return;
    }
    Method method = methods.value(action.toUtf8() + QByteArray::number(args.count()));
    if (argsE.type() == QVariant::Map) {
        args.clear();
        foreach (const QString &pname, method.meta.parameterNames ()) {
            args.append(argsM.value(pname));
        }
    }
开发者ID:develnk,项目名称:qxtweb-qt5,代码行数:33,代码来源:qxtwebjsonrpcservice.cpp

示例3: qDebug

QList<NutshMetaData> NutshSqlSaver::getMetaDatas(const QString& listName) {

    //retourne la liste de métadonnée selon une requete

        QList<NutshMetaData> metaList;
        QVariantList cache;

        QSqlQuery requete;
    if(listName != QString()){
        if(!requete.exec(QString("SELECT * FROM bibliotheque INNER JOIN relationships ON relationships.music_id = bibliotheque.id WHERE (relationships.playlist_id = %1)").arg(crypt(listName)))) {
            qDebug() << requete.lastError() << requete.lastQuery();
        }
    } else {
        if(!requete.exec(QString("SELECT * FROM bibliotheque"))) {
            qDebug() << requete.lastError() << requete.lastQuery();
        }
    }

   while(requete.next()) {
       for(int i = 0;i<NB_CHAMPS_DATABASE;i++) {

           cache.append(requete.value(i));
       }
       metaList.append(NutshMetaData(cache));
       cache.clear();
   }

   return metaList;
}
开发者ID:adriencanterot,项目名称:Nutsh,代码行数:29,代码来源:nutshsqlsaver.cpp

示例4: updateStatement

QString ScenarioChangeMapper::updateStatement(DomainObject* _subject, QVariantList& _updateValues) const
{
	QString updateStatement =
			QString("UPDATE " + TABLE_NAME +
					" SET uuid = ?, "
					" datetime = ?, "
					" username = ?, "
					" undo_patch = ?, "
					" redo_patch = ?, "
					" is_draft = ? "
					" WHERE id = ? "
					);

	ScenarioChange* change = dynamic_cast<ScenarioChange*>(_subject);
	_updateValues.clear();
	_updateValues.append(change->uuid().toString());
	_updateValues.append(change->datetime().toString("yyyy-MM-dd hh:mm:ss"));
	_updateValues.append(change->user());
	_updateValues.append(change->undoPatch());
	_updateValues.append(change->redoPatch());
	_updateValues.append(change->isDraft() ? "1" : "0");
	_updateValues.append(change->id().value());

	return updateStatement;
}
开发者ID:Roger-Waters,项目名称:KITScenarist,代码行数:25,代码来源:ScenarioChangeMapper.cpp

示例5: deleteStatement

QString CharacterPhotoMapper::deleteStatement(DomainObject* _subject, QVariantList& _deleteValues) const
{
	QString deleteStatement = "DELETE FROM " + TABLE_NAME + " WHERE id = ?";

	_deleteValues.clear();
	_deleteValues.append(_subject->id().value());

	return deleteStatement;
}
开发者ID:Roger-Waters,项目名称:KITScenarist,代码行数:9,代码来源:CharacterPhotoMapper.cpp

示例6: getRecByID

void CRtTable::getRecByID(int keyid,QVariantList& vecValues)
{
	vecValues.clear();
	QString strSQL = getAllField();
	strSQL += " where id = ";
	strSQL += QString::number(keyid);
	QVector<QVariantList> vecList;
	getRecsBySQL(strSQL,vecList);
	if (vecList.count() > 0)
	{
		vecValues = vecList[0];
	}
}
开发者ID:radtek,项目名称:isoftstone,代码行数:13,代码来源:rtdb_api.cpp

示例7: insertStatement

QString CharacterPhotoMapper::insertStatement(DomainObject* _subject, QVariantList& _insertValues) const
{
	QString insertStatement =
			QString("INSERT INTO " + TABLE_NAME +
					" (id, fk_character_id, photo, sort_order) "
					" VALUES(?, ?, ?, ?) "
					);

	CharacterPhoto* photo = dynamic_cast<CharacterPhoto*>(_subject);
	_insertValues.clear();
	_insertValues.append(photo->id().value());
	_insertValues.append(photo->character()->id().value());
	_insertValues.append(ImageHelper::bytesFromImage(photo->photo()));
	_insertValues.append(photo->sortOrder());

	return insertStatement;
}
开发者ID:Roger-Waters,项目名称:KITScenarist,代码行数:17,代码来源:CharacterPhotoMapper.cpp

示例8: toVariant

QVariant QCollectionJsonItem::toVariant() const
{
    QVariantMap result;
    result[HREF] = href();

    QVariantList list;
    foreach(const QCollectionJsonData data, d->data) {
        list.append(data.toVariant());
    }
    if(!list.isEmpty()) result[DATA] = list;

    list.clear();
    foreach(const QCollectionJsonLink link, d->links) {
        list.append(link.toVariant());
    }
    if(!list.isEmpty()) result[LINKS] = list;

    return result;
}
开发者ID:Kampfgnom,项目名称:QCollectionJson,代码行数:19,代码来源:qcollectionjsonitem.cpp

示例9: updateStatement

QString CharacterPhotoMapper::updateStatement(DomainObject* _subject, QVariantList& _updateValues) const
{
	QString updateStatement =
			QString("UPDATE " + TABLE_NAME +
					" SET fk_character_id = ?, "
					" photo = ?, "
					" sort_order = ? "
					" WHERE id = ? "
					);

	CharacterPhoto* photo = dynamic_cast<CharacterPhoto*>(_subject);
	_updateValues.clear();
	_updateValues.append(photo->character()->id().value());
	_updateValues.append(ImageHelper::bytesFromImage(photo->photo()));
	_updateValues.append(photo->sortOrder());
	_updateValues.append(photo->id().value());

	return updateStatement;
}
开发者ID:Roger-Waters,项目名称:KITScenarist,代码行数:19,代码来源:CharacterPhotoMapper.cpp

示例10: insertStatement

QString ScenarioChangeMapper::insertStatement(DomainObject* _subject, QVariantList& _insertValues) const
{
	QString insertStatement =
			QString("INSERT INTO " + TABLE_NAME +
					" (" + COLUMNS + ") "
					" VALUES(?, ?, ?, ?, ?, ?, ?) "
					);

	ScenarioChange* change = dynamic_cast<ScenarioChange*>(_subject );
	_insertValues.clear();
	_insertValues.append(change->id().value());
	_insertValues.append(change->uuid().toString());
	_insertValues.append(change->datetime().toString("yyyy-MM-dd hh:mm:ss"));
	_insertValues.append(change->user());
	_insertValues.append(change->undoPatch());
	_insertValues.append(change->redoPatch());
	_insertValues.append(change->isDraft() ? "1" : "0");

	return insertStatement;
}
开发者ID:Roger-Waters,项目名称:KITScenarist,代码行数:20,代码来源:ScenarioChangeMapper.cpp

示例11: REQUETE

QList<NutshMetaData> NutshSqlSaver::getMostReaden(int display) {

        QList<NutshMetaData> metaList;
        QVariantList cache;

        REQUETE(QString("SELECT * FROM bibliotheque ORDER BY compteur  DESC LIMIT 0, %1").arg(display));

        while(requete.next()) {

            for(int i = 0;i<NB_CHAMPS_DATABASE;i++) {

                cache.append(requete.value(i));
            }

            metaList.append(NutshMetaData(cache));
            cache.clear();
        }

        return metaList;
}
开发者ID:adriencanterot,项目名称:Nutsh,代码行数:20,代码来源:nutshsqlsaver.cpp

示例12: helpFile

void
PreferencesWidget::showHelp()
{
  PropertyEditor propertyEditor;
  QMap<QString, QVariantList> plist;
  QVariantList vlist;

  vlist.clear();
  QFile helpFile(":/preferences.help");
  if (helpFile.open(QFile::ReadOnly))
    {
      QTextStream in(&helpFile);
      QString line = in.readLine();
      while (!line.isNull())
	{
	  if (line == "#begin")
	    {
	      QString keyword = in.readLine();
	      QString helptext;
	      line = in.readLine();
	      while (!line.isNull())
		{
		  helptext += line;
		  helptext += "\n";
		  line = in.readLine();
		  if (line == "#end") break;
		}
	      vlist << keyword << helptext;
	    }
	  line = in.readLine();
	}
    }
  plist["commandhelp"] = vlist;

  QStringList keys;
  keys << "commandhelp";

  propertyEditor.set("Preferences Help", plist, keys);
  propertyEditor.exec();

}
开发者ID:antonmx,项目名称:posmotri,代码行数:41,代码来源:preferenceswidget.cpp

示例13: parseResultsJSON

void DroidStoreAPI::parseResultsJSON(QString jsonString, QString categoryOnly)
{
	JsonDataAccess jda;
	QVariant jsonDATA 	= jda.loadFromBuffer(jsonString);
	_results 			= jsonDATA.toMap().value("results").toList();

	QVariantList newResults = _results;

	if(categoryOnly != "all")
	{
		newResults.clear();

		foreach (QVariant app , _results)
		{
			if(categoryOnly == "game")
			{
				if(app.toMap().value("cat_int").toInt() >= 25) // if it's an game type
				{
					newResults.append(app);
				}
			}
			else if(categoryOnly == "app")
			{
				if(app.toMap().value("cat_int").toInt() <= 26) // if it's a app type
				{
					newResults.append(app);
				}
			}
			else
			{
				if(app.toMap().value("cat_int").toInt() == categoryOnly.toInt()) // if it's a specific type
				{
					newResults.append(app);
				}
			}
		}
	}
开发者ID:NemOry,项目名称:DroidStore,代码行数:37,代码来源:DroidStoreAPI.cpp

示例14: if


//.........这里部分代码省略.........

	      return true;
	    }
	  else if (event->key() == Qt::Key_A)
	    {
	      int idx = m_paths[i]->pointPressed();
	      if (idx > -1)
		{
		  float a = m_paths[i]->getAngle(idx);
		  if (event->modifiers() & Qt::ShiftModifier)
		    a--;
		  else
		    a++;
		  m_paths[i]->setAngle(idx, a, m_sameForAll);
		  return true;
		}
	    }
	  else if (event->key() == Qt::Key_Delete ||
		   event->key() == Qt::Key_Backspace ||
		   event->key() == Qt::Key_Backtab)
	    {
	      m_paths[i]->removeFromMouseGrabberPool();
	      m_paths.removeAt(i);
	      return true;
	    }

	  if (event->key() == Qt::Key_Space)
	    {
	      PropertyEditor propertyEditor;
	      QMap<QString, QVariantList> plist;

	      QVariantList vlist;

	      vlist.clear();
	      vlist << QVariant("double");
	      vlist << QVariant(m_paths[i]->opacity());
	      vlist << QVariant(0.0);
	      vlist << QVariant(1.0);
	      vlist << QVariant(0.1); // singlestep
	      vlist << QVariant(1); // decimals
	      plist["opacity"] = vlist;

	      vlist.clear();
	      vlist << QVariant("colorgradient");
	      QGradientStops stops = m_paths[i]->stops();
	      for(int s=0; s<stops.size(); s++)
		{
		  float pos = stops[s].first;
		  QColor color = stops[s].second;
		  int r = color.red();
		  int g = color.green();
		  int b = color.blue();
		  int a = color.alpha();
		  vlist << QVariant(pos);
		  vlist << QVariant(r);
		  vlist << QVariant(g);
		  vlist << QVariant(b);
		  vlist << QVariant(a);
		}
	      plist["color"] = vlist;

	      vlist.clear();
	      vlist << QVariant("checkbox");
	      vlist << QVariant(m_paths[i]->filterPathLen());
	      plist["filter on length"] = vlist;
开发者ID:Elavina6,项目名称:drishti,代码行数:66,代码来源:pathgroups.cpp

示例15: helpFile

bool
ClipObject::commandEditor()
{
  PropertyEditor propertyEditor;
  QMap<QString, QVariantList> plist;
  QVariantList vlist;
  vlist.clear();
  plist["command"] = vlist;


  vlist.clear();
  vlist << QVariant("double");
  vlist << QVariant(m_opacity);
  vlist << QVariant(0.0);
  vlist << QVariant(1.0);
  vlist << QVariant(0.1); // singlestep
  vlist << QVariant(1); // decimals
  plist["opacity"] = vlist;
  
  vlist.clear();
  vlist << QVariant("color");
  Vec pcolor = m_color;
  QColor dcolor = QColor::fromRgbF(pcolor.x,
				   pcolor.y,
				   pcolor.z);
  vlist << dcolor;
  plist["color"] = vlist;
  
  vlist.clear();
  vlist << QVariant("checkbox");
  vlist << QVariant(m_apply);
  plist["apply clipping"] = vlist;

  vlist.clear();
  vlist << QVariant("int");
  vlist << QVariant(m_tfset);
  vlist << QVariant(-1);
  vlist << QVariant(15);
  plist["tfset"] = vlist;

  vlist.clear();
  vlist << QVariant("int");
  vlist << QVariant(m_thickness);
  vlist << QVariant(0);
  vlist << QVariant(200);
  plist["thickness"] = vlist;

  vlist.clear();
  vlist << QVariant("checkbox");
  vlist << QVariant(m_solidColor);
  plist["solid color"] = vlist;

  vlist.clear();
  vlist << QVariant("checkbox");
  vlist << QVariant(m_showSlice);
  plist["show slice"] = vlist;

  vlist.clear();
  vlist << QVariant("checkbox");
  vlist << QVariant(m_showThickness);
  plist["show thickness"] = vlist;

  vlist.clear();
  vlist << QVariant("combobox");
  if (m_viewportType)
    vlist << QVariant(1);
  else
    vlist << QVariant(0);
  vlist << QVariant("orthographic");
  vlist << QVariant("perspective");
  plist["camera type"] = vlist;

  vlist.clear();
  vlist << QVariant("double");
  vlist << QVariant(m_stereo);
  vlist << QVariant(0.0);
  vlist << QVariant(1.0);
  vlist << QVariant(0.1); // singlestep
  vlist << QVariant(1); // decimals
  plist["stereo"] = vlist;
  
  vlist.clear();
  vlist << QVariant("checkbox");
  vlist << QVariant(m_showOtherSlice);
  plist["show other slice"] = vlist;


  QString vpstr = QString("%1 %2 %3 %4").\
                  arg(m_viewport.x()).\
                  arg(m_viewport.y()).\
                  arg(m_viewport.z()).\
                  arg(m_viewport.w());
  vlist.clear();
  vlist << QVariant("string");
  vlist << QVariant(vpstr);
  plist["viewport"] = vlist;

  vlist.clear();
  vlist << QVariant("double");
  vlist << QVariant(m_viewportScale);
//.........这里部分代码省略.........
开发者ID:Elavina6,项目名称:drishti,代码行数:101,代码来源:clipobject.cpp


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