#include <QStringList>
#include <QDebug>
#include <iostream>
using namespace std;
/* Some simple examples using QStringList, split and join */
int main() {
QString winter
= "December, January, February";
QString spring
= "March, April, May";
QString summer
= "June, July, August";
QString fall
= "September, October, November";
list << winter;
list += spring;
list.append(summer);
list << fall;
qDebug() << "The Spring months are: " << list[1] ;
cout << "Hi" << endl;
QString allmonths
= list.
join(", ");
/* from list to string - join with a ", " delimiter */
qDebug() << allmonths;
/* split is the opposite of join. Each month will have its own element. */
Q_ASSERT(list2.size() == 12);
qDebug
() <<
QString(" [%1] ").
arg(str
);
}
it != list.end(); ++it) {
qDebug() << "[[" << current << "]]";
}
QListIterator<QString> itr (list2);
while (itr.hasNext()) {
qDebug() << "{" << current << "}";
}
return 0;
}
#include <QStringList>
#include <QDebug>
#include <iostream>
using namespace std;
/* Some simple examples using QStringList, split and join */
int main() {
QString winter = "December, January, February";
QString spring = "March, April, May";
QString summer = "June, July, August";
QString fall = "September, October, November";
QStringList list;
list << winter;
list += spring;
list.append(summer);
list << fall;
qDebug() << "The Spring months are: " << list[1] ;
cout << "Hi" << endl;
QString allmonths = list.join(", ");
/* from list to string - join with a ", " delimiter */
qDebug() << allmonths;
QStringList list2 = allmonths.split(", ");
/* split is the opposite of join. Each month will have its own element. */
Q_ASSERT(list2.size() == 12);
foreach (QString str, list) {
qDebug() << QString(" [%1] ").arg(str);
}
for (QStringList::iterator it = list.begin();
it != list.end(); ++it) {
QString current = *it;
qDebug() << "[[" << current << "]]";
}
QListIterator<QString> itr (list2);
while (itr.hasNext()) {
QString current = itr.next();
qDebug() << "{" << current << "}";
}
return 0;
}
To copy to clipboard, switch view to plain text mode
qmake -project
qmake
make release
qmake -project
qmake
make release
To copy to clipboard, switch view to plain text mode
Bookmarks