本文整理汇总了C++中QStringList::removeFirst方法的典型用法代码示例。如果您正苦于以下问题:C++ QStringList::removeFirst方法的具体用法?C++ QStringList::removeFirst怎么用?C++ QStringList::removeFirst使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类QStringList
的用法示例。
在下文中一共展示了QStringList::removeFirst方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: main
int main(int argc, char *argv[])
{
QQmlDebuggingEnabler::StartMode block = QQmlDebuggingEnabler::DoNotWaitForClient;
int portFrom = 0;
int portTo = 0;
QCoreApplication app(argc, argv);
QStringList arguments = app.arguments();
arguments.removeFirst();
if (arguments.size() && arguments.first() == QLatin1String("-block")) {
block = QQmlDebuggingEnabler::WaitForClient;
arguments.removeFirst();
}
if (arguments.size() >= 2) {
portFrom = arguments.takeFirst().toInt();
portTo = arguments.takeFirst().toInt();
}
if (!portFrom || !portTo)
qFatal("Port range has to be specified.");
while (portFrom <= portTo)
QQmlDebuggingEnabler::startTcpDebugServer(portFrom++, block);
QQmlEngine engine;
Q_UNUSED(engine);
return app.exec();
}
示例2: parseEvent
void sJarvisNode::parseEvent(QStringList args)
{
if(!args.count())return;
QString component = args.first();
args.removeFirst();
if(!args.count())return;
jarvisEvents event = jarvisEvents(args.first().toInt());
args.removeFirst();
emit incomingEvent(component,event,args);
}
示例3: main
int main(int argc, char *argv[]) {
QCoreApplication app(argc, argv);
app.setOrganizationName("QDailymotion");
app.setApplicationName("QDailymotion");
QStringList args = app.arguments();
if (args.size() < 3) {
qWarning() << "Usage: resources-update RESOURCEPATH RESOURCE";
return 0;
}
args.removeFirst();
QString resourcePath = args.takeFirst();
QVariantMap resource = QtJson::Json::parse(args.takeFirst()).toMap();
QSettings settings;
QDailymotion::ResourcesRequest request;
request.setClientId(settings.value("Authentication/clientId").toString());
request.setClientSecret(settings.value("Authentication/clientSecret").toString());
request.setAccessToken(settings.value("Authentication/accessToken").toString());
request.setRefreshToken(settings.value("Authentication/refreshToken").toString());
request.update(resourcePath, resource);
QObject::connect(&request, SIGNAL(finished()), &app, SLOT(quit()));
return app.exec();
}
示例4: supportedDevices
void UDPServer::supportedDevices(const QString cmd)
{
QString msg = "10;";
QMap<QString, int> map;
QString cmdStr;
QString methodString;
qDebug() << "cmd" << cmd;
QStringList cmdList;
cmdList = cmd.split(' ');
cmdList.removeFirst();
for(int i = 0; i < cmdList.size(); i++)
{
int intPos = cmdList[i].size() - 1;
int number = cmdList[i].toLower().data()[intPos].digitValue();
cmdStr = cmdList[i].remove(intPos,1);
map[cmdStr] = number;
}
methodString.append(QString("b %1,").arg(map.value("b", 0)));
methodString.append(QString("p %1,").arg(map.value("p", 0)));
methodString.append(QString("v %1").arg(map.value("v", 0)));
qDebug() << "methodString: " << methodString;
msg += SupportedDevices::instance()->printDevicesWithString(methodString);
sendDatagram(msg.toLatin1());
}
示例5: startDaemon
static bool startDaemon()
{
bool success;
QStringList args = QCoreApplication::arguments();
args.removeAll("-d");
#ifdef Q_OS_WIN
PROCESS_INFORMATION pinfo;
STARTUPINFOW startupInfo = { sizeof(STARTUPINFO), 0, 0, 0,
(ulong)CW_USEDEFAULT, (ulong)CW_USEDEFAULT,
(ulong)CW_USEDEFAULT, (ulong)CW_USEDEFAULT,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0
};
success = CreateProcess(0, (wchar_t*)args.join(" ").utf16(),
0, 0, FALSE, CREATE_UNICODE_ENVIRONMENT, 0,
(wchar_t*)QDir::currentPath().utf16(),
&startupInfo, &pinfo);
if (success) {
CloseHandle(pinfo.hThread);
CloseHandle(pinfo.hProcess);
}
#else
args.removeFirst(); // Removes the program name
success = QProcess::startDetached(QCoreApplication::applicationFilePath(), args, QDir::currentPath());
#endif
return success;
}
示例6: while
void
APIWebService::service(HttpRequest &request, HttpResponse &response)
{
// remove trailing '/' from request, just to be consistent
QString fullPath = request.getPath();
while (fullPath.endsWith("/")) fullPath.chop(1);
// get the paths
QStringList paths = QString(request.getPath()).split("/");
// we need to look at the first path to determine action
if (paths.count() < 2) return; // impossible really
// get ride of first blank, all URLs start with a '/'
paths.removeFirst();
// ROOT PATH RETURNS A LIST OF ATHLETES
if (paths[0] == "") {
listAthletes(response); // return csv list of all athlete and their characteristics
return;
}
// we don't have a fave icon
if (paths[0] == "favicon.ico") return;
// Call to retreive athlete data, downstream will resolve
// which functions to call for different data requests
athleteData(paths, response);
}
示例7: main
int main(int argc, char *argv[]) {
QCoreApplication app(argc, argv);
app.setOrganizationName("QYouTube");
app.setApplicationName("QYouTube");
QStringList args = app.arguments();
if (args.size() < 4) {
qWarning() << "Usage: resources-insert RESOURCE RESOURCEPATH PART [PARAMS]";
return 0;
}
args.removeFirst();
QVariantMap resource = QtJson::Json::parse(args.takeFirst()).toMap();
QString resourcePath = args.takeFirst();
QStringList part = QtJson::Json::parse(args.takeFirst()).toStringList();
QVariantMap params = args.isEmpty() ? QVariantMap() : QtJson::Json::parse(args.takeFirst()).toMap();
QSettings settings;
QYouTube::ResourcesRequest request;
request.setClientId(settings.value("Authentication/clientId").toString());
request.setClientSecret(settings.value("Authentication/clientSecret").toString());
request.setApiKey(settings.value("Authentication/apiKey").toString());
request.setAccessToken(settings.value("Authentication/accessToken").toString());
request.setRefreshToken(settings.value("Authentication/refreshToken").toString());
request.insert(resource, resourcePath, part, params);
QObject::connect(&request, SIGNAL(finished()), &app, SLOT(quit()));
return app.exec();
}
示例8: updateFields
void PerforceSubmitEditor::updateFields()
{
PerforceSubmitEditorWidget *widget = submitEditorWidget();
widget->setData(m_entries.value(QLatin1String("Change")).trimmed(),
m_entries.value(QLatin1String("Client")).trimmed(),
m_entries.value(QLatin1String("User")).trimmed());
const QString newLine = QString(QLatin1Char('\n'));
QStringList lines = m_entries.value(QLatin1String("Description")).split(newLine);
lines.removeFirst(); // that is the line break after 'Description:'
lines.removeLast(); // that is the empty line at the end
const QRegExp leadingTabPattern = QRegExp(QLatin1String("^\\t"));
QTC_ASSERT(leadingTabPattern.isValid(), /**/);
lines.replaceInStrings(leadingTabPattern, QString());
widget->setDescriptionText(lines.join(newLine));
lines = m_entries.value(QLatin1String("Files")).split(newLine);
// split up "file#add" and store complete spec line as user data
foreach (const QString &specLine, lines) {
const QStringList list = specLine.split(QLatin1Char('#'));
if (list.size() == 2) {
const QString file = list.at(0).trimmed();
const QString state = list.at(1).trimmed();
m_fileModel->addFile(file, state).at(0)->setData(specLine, FileSpecRole);
}
}
}
示例9: parseWifiConnectionsInfo
WifiInfoParseResult WifiDataParser::parseWifiConnectionsInfo(QString data)
{
WifiInfoParseResult result;
QStringList buffer = data.split(linuxDivider, QString::SkipEmptyParts);
result.connectedIndexes = findAllConnectedIndexes(buffer);
result.columnNames = buffer.first().split(whitespace, QString::SkipEmptyParts);
deleteConnectMark(result.columnNames);
int columnsCount = result.columnNames.length();
QStringList buff;
for (int i = 0; i < columnsCount; i++)
result.params.append(buff);
for (int i = 0; i < columnsCount; i++)
result.columnIndexes[result.columnNames[i].toLower()] = i;
buffer.removeFirst(); // remove title line
for (int i = 0; i < buffer.length(); i++) {
QStringList strParse = buffer.at(i).split(whitespace, QString::SkipEmptyParts);
deleteConnectMark(strParse);
int realRateIndex = combineRateStr(strParse);
int ssidLength = realRateIndex - result.columnIndexes["rate"] + 1;
combineSsid(strParse, result.columnIndexes["ssid"],
ssidLength);
if (strParse.length() == columnsCount)
pushToParamsList(result, strParse, columnsCount);
}
qDebug() << result.params;
return result;
}
示例10: numericMessageReceived
void QuazaaIRC::numericMessageReceived(QString sender, uint code, QStringList list)
{
switch (code)
{
case Irc::Rfc::RPL_NAMREPLY:
emit channelNames(list);
break;
case Irc::Rfc::RPL_BOUNCE:
{
for (int i = 0 ; i<list.size() ; ++i) {
QString opt = list.at(i);
if (opt.startsWith("PREFIX=", Qt::CaseInsensitive))
{
QString prefstr = opt.split("=")[1];
QString modes = prefstr.mid(1, prefstr.indexOf(")")-1);
QString mprefs = prefstr.right(modes.length());
emit setPrefixes(modes, mprefs);
}
}
}
default:
{
// append to status
list.removeFirst();
emit appendMessage(qobject_cast<Irc::Buffer*>(QObject::sender()), sender, "[" + QString::number(code) + "] " + list.join(" "), QuazaaIRC::Status);
}
}
}
示例11: self
/*!
Returns the current absolute url of this service depending on the request \a event.
*/
QUrl QxtWebSlotService::self(QxtWebRequestEvent* event)
{
QStringList u = event->url.path().split('/');
QStringList o = event->originalUrl.path().split('/');
u.removeFirst();
o.removeFirst();
for (int i = 0;i < u.count();i++)
o.removeLast();
QString r = "/";
foreach(const QString& d, o)
{
r += d + '/';
}
示例12: REPLCompletable
// private:
Phantom::Phantom(QObject *parent)
: REPLCompletable(parent)
, m_terminated(false)
, m_returnValue(0)
, m_filesystem(0)
, m_system(0)
{
// Skip the first argument, i.e. the application executable (phantomjs).
QStringList args = QApplication::arguments();
args.removeFirst();
// Prepare the configuration object based on the command line arguments.
// Because this object will be used by other classes, it needs to be ready ASAP.
m_config.init(&args);
// initialize key map
QMetaEnum keys = staticQtMetaObject.enumerator( staticQtMetaObject.indexOfEnumerator("Key") );
for(int i = 0; i < keys.keyCount(); ++i) {
QString name = keys.key(i);
if (name.startsWith("Key_")) {
name.remove(0, 4);
}
m_keyMap[name] = keys.value(i);
}
}
示例13: mFile
Cloud::Cloud( QString& pFile ){
// TODO Auto-generated constructor stub
QFile mFile(pFile);
//load file content
if(!mFile.open(QIODevice::ReadOnly)) {
qWarning()<<"Error opening file";
return;
}
//work on the file
QString lDatas = mFile.readAll();
QStringList lTokens = lDatas.split(QRegExp("[ |\n]"), QString::SkipEmptyParts);
QString nbInt = lTokens.at(0);
mNbPoints = nbInt.toInt();
//remove first item (size) from the list
lTokens.removeFirst();
QStringListIterator lTokIterator(lTokens);
while(lTokIterator.hasNext()) {
mPointList << lTokIterator.next().toFloat();
}
qWarning()<<mPointList.size()<<mNbPoints;
glPointSize(5.0f);
mGLBatch.Begin(GL_POINTS, mNbPoints);
for(int i=0;i<mNbPoints;i++)
{
mGLBatch.Vertex3f(mPointList[i*3],mPointList[i*3+1], mPointList[i*3+2]);
}
mGLBatch.End();
}
示例14: file
QT_BEGIN_NAMESPACE
QEdidParser::QEdidParser()
{
// Cache vendors list from pnp.ids
const QString fileName = QLatin1String("/usr/share/hwdata/pnp.ids");
if (QFile::exists(fileName)) {
QFile file(fileName);
if (file.open(QFile::ReadOnly)) {
while (!file.atEnd()) {
QString line = QString::fromUtf8(file.readLine()).trimmed();
if (line.startsWith(QLatin1Char('#')))
continue;
QStringList parts = line.split(QLatin1Char('\t'));
if (parts.count() > 1) {
QString pnpId = parts.at(0);
parts.removeFirst();
m_vendorCache[pnpId] = parts.join(QLatin1Char(' '));
}
}
file.close();
}
}
}
示例15: return
QStringList Arguments::toStringList() const
{
QStringList result = this->raw;
result.removeFirst();
return (result);
}