500 lines
46 KiB
HTML
500 lines
46 KiB
HTML
<?xml version="1.0" encoding="UTF-8"?>
|
|
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
|
|
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en_US" lang="en_US">
|
|
<head>
|
|
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
|
<!-- qstringlist.cpp -->
|
|
<title>Qt 4.8: QStringList Class Reference</title>
|
|
<link rel="stylesheet" type="text/css" href="style/style.css" />
|
|
<script src="scripts/jquery.js" type="text/javascript"></script>
|
|
<script src="scripts/functions.js" type="text/javascript"></script>
|
|
<link rel="stylesheet" type="text/css" href="style/superfish.css" />
|
|
<link rel="stylesheet" type="text/css" href="style/narrow.css" />
|
|
<!--[if IE]>
|
|
<meta name="MSSmartTagsPreventParsing" content="true">
|
|
<meta http-equiv="imagetoolbar" content="no">
|
|
<![endif]-->
|
|
<!--[if lt IE 7]>
|
|
<link rel="stylesheet" type="text/css" href="style/style_ie6.css">
|
|
<![endif]-->
|
|
<!--[if IE 7]>
|
|
<link rel="stylesheet" type="text/css" href="style/style_ie7.css">
|
|
<![endif]-->
|
|
<!--[if IE 8]>
|
|
<link rel="stylesheet" type="text/css" href="style/style_ie8.css">
|
|
<![endif]-->
|
|
|
|
<script src="scripts/superfish.js" type="text/javascript"></script>
|
|
<script src="scripts/narrow.js" type="text/javascript"></script>
|
|
|
|
</head>
|
|
<body class="" onload="CheckEmptyAndLoadList();">
|
|
<div class="header" id="qtdocheader">
|
|
<div class="content">
|
|
<div id="nav-logo">
|
|
<a href="index.html">Home</a></div>
|
|
<a href="index.html" class="qtref"><span>Qt Reference Documentation</span></a>
|
|
<div id="narrowsearch"></div>
|
|
<div id="nav-topright">
|
|
<ul>
|
|
<li class="nav-topright-home"><a href="http://qt.digia.com/">Qt HOME</a></li>
|
|
<li class="nav-topright-dev"><a href="http://qt-project.org/">DEV</a></li>
|
|
<li class="nav-topright-doc nav-topright-doc-active"><a href="http://qt-project.org/doc/">
|
|
DOC</a></li>
|
|
<li class="nav-topright-blog"><a href="http://blog.qt.digia.com/">BLOG</a></li>
|
|
</ul>
|
|
</div>
|
|
<div id="shortCut">
|
|
<ul>
|
|
<li class="shortCut-topleft-inactive"><span><a href="index.html">Qt 4.8</a></span></li>
|
|
<li class="shortCut-topleft-active"><a href="http://qt-project.org/doc/">ALL VERSIONS </a></li>
|
|
</ul>
|
|
</div>
|
|
<ul class="sf-menu" id="narrowmenu">
|
|
<li><a href="#">API Lookup</a>
|
|
<ul>
|
|
<li><a href="classes.html">Class index</a></li>
|
|
<li><a href="functions.html">Function index</a></li>
|
|
<li><a href="modules.html">Modules</a></li>
|
|
<li><a href="namespaces.html">Namespaces</a></li>
|
|
<li><a href="qtglobal.html">Global Declarations</a></li>
|
|
<li><a href="qdeclarativeelements.html">QML elements</a></li>
|
|
</ul>
|
|
</li>
|
|
<li><a href="#">Qt Topics</a>
|
|
<ul>
|
|
<li><a href="qt-basic-concepts.html">Programming with Qt</a></li>
|
|
<li><a href="qtquick.html">Device UIs & Qt Quick</a></li>
|
|
<li><a href="qt-gui-concepts.html">UI Design with Qt</a></li>
|
|
<li><a href="supported-platforms.html">Supported Platforms</a></li>
|
|
<li><a href="technology-apis.html">Qt and Key Technologies</a></li>
|
|
<li><a href="best-practices.html">How-To's and Best Practices</a></li>
|
|
</ul>
|
|
</li>
|
|
<li><a href="#">Examples</a>
|
|
<ul>
|
|
<li><a href="all-examples.html">Examples</a></li>
|
|
<li><a href="tutorials.html">Tutorials</a></li>
|
|
<li><a href="demos.html">Demos</a></li>
|
|
<li><a href="qdeclarativeexamples.html">QML Examples</a></li>
|
|
</ul>
|
|
</li>
|
|
</ul>
|
|
</div>
|
|
</div>
|
|
<div class="wrapper">
|
|
<div class="hd">
|
|
<span></span>
|
|
</div>
|
|
<div class="bd group">
|
|
<div class="sidebar">
|
|
<div class="searchlabel">
|
|
Search index:</div>
|
|
<div class="search" id="sidebarsearch">
|
|
<form id="qtdocsearch" action="" onsubmit="return false;">
|
|
<fieldset>
|
|
<input type="text" name="searchstring" id="pageType" value="" />
|
|
<div id="resultdialog">
|
|
<a href="#" id="resultclose">Close</a>
|
|
<p id="resultlinks" class="all"><a href="#" id="showallresults">All</a> | <a href="#" id="showapiresults">API</a> | <a href="#" id="showarticleresults">Articles</a> | <a href="#" id="showexampleresults">Examples</a></p>
|
|
<p id="searchcount" class="all"><span id="resultcount"></span><span id="apicount"></span><span id="articlecount"></span><span id="examplecount"></span> results:</p>
|
|
<ul id="resultlist" class="all">
|
|
</ul>
|
|
</div>
|
|
</fieldset>
|
|
</form>
|
|
</div>
|
|
<div class="box first bottombar" id="lookup">
|
|
<h2 title="API Lookup"><span></span>
|
|
API Lookup</h2>
|
|
<div id="list001" class="list">
|
|
<ul id="ul001" >
|
|
<li class="defaultLink"><a href="classes.html">Class index</a></li>
|
|
<li class="defaultLink"><a href="functions.html">Function index</a></li>
|
|
<li class="defaultLink"><a href="modules.html">Modules</a></li>
|
|
<li class="defaultLink"><a href="namespaces.html">Namespaces</a></li>
|
|
<li class="defaultLink"><a href="qtglobal.html">Global Declarations</a></li>
|
|
<li class="defaultLink"><a href="qdeclarativeelements.html">QML elements</a></li>
|
|
</ul>
|
|
</div>
|
|
</div>
|
|
<div class="box bottombar" id="topics">
|
|
<h2 title="Qt Topics"><span></span>
|
|
Qt Topics</h2>
|
|
<div id="list002" class="list">
|
|
<ul id="ul002" >
|
|
<li class="defaultLink"><a href="qt-basic-concepts.html">Programming with Qt</a></li>
|
|
<li class="defaultLink"><a href="qtquick.html">Device UIs & Qt Quick</a></li>
|
|
<li class="defaultLink"><a href="qt-gui-concepts.html">UI Design with Qt</a></li>
|
|
<li class="defaultLink"><a href="supported-platforms.html">Supported Platforms</a></li>
|
|
<li class="defaultLink"><a href="technology-apis.html">Qt and Key Technologies</a></li>
|
|
<li class="defaultLink"><a href="best-practices.html">How-To's and Best Practices</a></li>
|
|
</ul>
|
|
</div>
|
|
</div>
|
|
<div class="box" id="examples">
|
|
<h2 title="Examples"><span></span>
|
|
Examples</h2>
|
|
<div id="list003" class="list">
|
|
<ul id="ul003">
|
|
<li class="defaultLink"><a href="all-examples.html">Examples</a></li>
|
|
<li class="defaultLink"><a href="tutorials.html">Tutorials</a></li>
|
|
<li class="defaultLink"><a href="demos.html">Demos</a></li>
|
|
<li class="defaultLink"><a href="qdeclarativeexamples.html">QML Examples</a></li>
|
|
</ul>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div class="wrap">
|
|
<div class="toolbar">
|
|
<div class="breadcrumb toolblock">
|
|
<ul>
|
|
<li class="first"><a href="index.html">Home</a></li>
|
|
<!-- Breadcrumbs go here -->
|
|
<li><a href="modules.html">Modules</a></li>
|
|
<li><a href="qtcore.html">QtCore</a></li>
|
|
<li>QStringList</li>
|
|
</ul>
|
|
</div>
|
|
<div class="toolbuttons toolblock">
|
|
<ul>
|
|
<li id="smallA" class="t_button">A</li>
|
|
<li id="medA" class="t_button active">A</li>
|
|
<li id="bigA" class="t_button">A</li>
|
|
<li id="print" class="t_button"><a href="javascript:this.print();">
|
|
<span>Print</span></a></li>
|
|
</ul>
|
|
</div>
|
|
</div>
|
|
<div class="content mainContent">
|
|
<div class="toc">
|
|
<h3><a name="toc">Contents</a></h3>
|
|
<ul>
|
|
<li class="level1"><a href="#public-functions">Public Functions</a></li>
|
|
<li class="level1"><a href="#related-non-members">Related Non-Members</a></li>
|
|
<li class="level1"><a href="#details">Detailed Description</a></li>
|
|
<li class="level2"><a href="#adding-strings">Adding strings</a></li>
|
|
<li class="level2"><a href="#iterating-over-the-strings">Iterating over the strings</a></li>
|
|
<li class="level2"><a href="#manipulating-the-strings">Manipulating the strings</a></li>
|
|
</ul>
|
|
</div>
|
|
<h1 class="title">QStringList Class Reference</h1>
|
|
<!-- $$$QStringList-brief -->
|
|
<p>The QStringList class provides a list of strings. <a href="#details">More...</a></p>
|
|
<!-- @@@QStringList -->
|
|
<pre class="cpp"> <span class="preprocessor">#include <QStringList></span></pre><p><b>Inherits: </b><a href="qlist.html">QList<QString></a>.</p>
|
|
<p><b>Note:</b> All functions in this class are <a href="threads-reentrancy.html#reentrant">reentrant</a>.</p>
|
|
<ul>
|
|
<li><a href="qstringlist-members.html">List of all members, including inherited members</a></li>
|
|
<li><a href="qstringlist-qt3.html">Qt 3 support members</a></li>
|
|
</ul>
|
|
<a name="public-functions"></a>
|
|
<h2>Public Functions</h2>
|
|
<table class="alignedsummary">
|
|
<tr><td class="memItemLeft rightAlign topAlign"> </td><td class="memItemRight bottomAlign"><b><a href="qstringlist.html#QStringList">QStringList</a></b> ()</td></tr>
|
|
<tr><td class="memItemLeft rightAlign topAlign"> </td><td class="memItemRight bottomAlign"><b><a href="qstringlist.html#QStringList-2">QStringList</a></b> ( const QString & <i>str</i> )</td></tr>
|
|
<tr><td class="memItemLeft rightAlign topAlign"> </td><td class="memItemRight bottomAlign"><b><a href="qstringlist.html#QStringList-3">QStringList</a></b> ( const QStringList & <i>other</i> )</td></tr>
|
|
<tr><td class="memItemLeft rightAlign topAlign"> </td><td class="memItemRight bottomAlign"><b><a href="qstringlist.html#QStringList-4">QStringList</a></b> ( const QList<QString> & <i>other</i> )</td></tr>
|
|
<tr><td class="memItemLeft rightAlign topAlign"> </td><td class="memItemRight bottomAlign"><b><a href="qstringlist.html#QStringList-5">QStringList</a></b> ( std::initializer_list<QString> <i>args</i> )</td></tr>
|
|
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qstringlist.html#contains">contains</a></b> ( const QString & <i>str</i>, Qt::CaseSensitivity <i>cs</i> = Qt::CaseSensitive ) const</td></tr>
|
|
<tr><td class="memItemLeft rightAlign topAlign"> QStringList </td><td class="memItemRight bottomAlign"><b><a href="qstringlist.html#filter">filter</a></b> ( const QString & <i>str</i>, Qt::CaseSensitivity <i>cs</i> = Qt::CaseSensitive ) const</td></tr>
|
|
<tr><td class="memItemLeft rightAlign topAlign"> QStringList </td><td class="memItemRight bottomAlign"><b><a href="qstringlist.html#filter-2">filter</a></b> ( const QRegExp & <i>rx</i> ) const</td></tr>
|
|
<tr><td class="memItemLeft rightAlign topAlign"> int </td><td class="memItemRight bottomAlign"><b><a href="qstringlist.html#indexOf">indexOf</a></b> ( const QRegExp & <i>rx</i>, int <i>from</i> = 0 ) const</td></tr>
|
|
<tr><td class="memItemLeft rightAlign topAlign"> int </td><td class="memItemRight bottomAlign"><b><a href="qstringlist.html#indexOf-2">indexOf</a></b> ( const QString & <i>value</i>, int <i>from</i> = 0 ) const</td></tr>
|
|
<tr><td class="memItemLeft rightAlign topAlign"> int </td><td class="memItemRight bottomAlign"><b><a href="qstringlist.html#indexOf-3">indexOf</a></b> ( QRegExp & <i>rx</i>, int <i>from</i> = 0 ) const</td></tr>
|
|
<tr><td class="memItemLeft rightAlign topAlign"> QString </td><td class="memItemRight bottomAlign"><b><a href="qstringlist.html#join">join</a></b> ( const QString & <i>separator</i> ) const</td></tr>
|
|
<tr><td class="memItemLeft rightAlign topAlign"> int </td><td class="memItemRight bottomAlign"><b><a href="qstringlist.html#lastIndexOf">lastIndexOf</a></b> ( const QRegExp & <i>rx</i>, int <i>from</i> = -1 ) const</td></tr>
|
|
<tr><td class="memItemLeft rightAlign topAlign"> int </td><td class="memItemRight bottomAlign"><b><a href="qstringlist.html#lastIndexOf-2">lastIndexOf</a></b> ( const QString & <i>value</i>, int <i>from</i> = -1 ) const</td></tr>
|
|
<tr><td class="memItemLeft rightAlign topAlign"> int </td><td class="memItemRight bottomAlign"><b><a href="qstringlist.html#lastIndexOf-3">lastIndexOf</a></b> ( QRegExp & <i>rx</i>, int <i>from</i> = -1 ) const</td></tr>
|
|
<tr><td class="memItemLeft rightAlign topAlign"> int </td><td class="memItemRight bottomAlign"><b><a href="qstringlist.html#removeDuplicates">removeDuplicates</a></b> ()</td></tr>
|
|
<tr><td class="memItemLeft rightAlign topAlign"> QStringList & </td><td class="memItemRight bottomAlign"><b><a href="qstringlist.html#replaceInStrings">replaceInStrings</a></b> ( const QString & <i>before</i>, const QString & <i>after</i>, Qt::CaseSensitivity <i>cs</i> = Qt::CaseSensitive )</td></tr>
|
|
<tr><td class="memItemLeft rightAlign topAlign"> QStringList & </td><td class="memItemRight bottomAlign"><b><a href="qstringlist.html#replaceInStrings-2">replaceInStrings</a></b> ( const QRegExp & <i>rx</i>, const QString & <i>after</i> )</td></tr>
|
|
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qstringlist.html#sort">sort</a></b> ()</td></tr>
|
|
<tr><td class="memItemLeft rightAlign topAlign"> QStringList </td><td class="memItemRight bottomAlign"><b><a href="qstringlist.html#operator-2b">operator+</a></b> ( const QStringList & <i>other</i> ) const</td></tr>
|
|
<tr><td class="memItemLeft rightAlign topAlign"> QStringList & </td><td class="memItemRight bottomAlign"><b><a href="qstringlist.html#operator-lt-lt">operator<<</a></b> ( const QString & <i>str</i> )</td></tr>
|
|
<tr><td class="memItemLeft rightAlign topAlign"> QStringList & </td><td class="memItemRight bottomAlign"><b><a href="qstringlist.html#operator-lt-lt-2">operator<<</a></b> ( const QStringList & <i>other</i> )</td></tr>
|
|
</table>
|
|
<ul>
|
|
<li class="fn">67 public functions inherited from <a href="qlist.html#public-functions">QList</a></li>
|
|
</ul>
|
|
<a name="related-non-members"></a>
|
|
<h2>Related Non-Members</h2>
|
|
<table class="alignedsummary">
|
|
<tr><td class="memItemLeft rightAlign topAlign"> typedef </td><td class="memItemRight bottomAlign"><b><a href="qstringlist.html#QMutableStringListIterator-typedef">QMutableStringListIterator</a></b></td></tr>
|
|
<tr><td class="memItemLeft rightAlign topAlign"> typedef </td><td class="memItemRight bottomAlign"><b><a href="qstringlist.html#QStringListIterator-typedef">QStringListIterator</a></b></td></tr>
|
|
<tr><td class="memItemLeft rightAlign topAlign"> QDataStream & </td><td class="memItemRight bottomAlign"><b><a href="qstringlist.html#operator-lt-lt-136">operator<<</a></b> ( QDataStream & <i>out</i>, const QStringList & <i>list</i> )</td></tr>
|
|
<tr><td class="memItemLeft rightAlign topAlign"> QDataStream & </td><td class="memItemRight bottomAlign"><b><a href="qstringlist.html#operator-gt-gt-72">operator>></a></b> ( QDataStream & <i>in</i>, QStringList & <i>list</i> )</td></tr>
|
|
</table>
|
|
<h3>Additional Inherited Members</h3>
|
|
<ul>
|
|
<li class="fn">3 static public members inherited from <a href="qlist.html#static-public-members">QList</a></li>
|
|
</ul>
|
|
<a name="details"></a>
|
|
<!-- $$$QStringList-description -->
|
|
<div class="descr">
|
|
<h2>Detailed Description</h2>
|
|
<p>The QStringList class provides a list of strings.</p>
|
|
<p>QStringList inherits from <a href="qlist.html">QList</a><<a href="qstring.html">QString</a>>. Like <a href="qlist.html">QList</a>, QStringList is <a href="implicit-sharing.html#implicitly-shared">implicitly shared</a>. It provides fast index-based access as well as fast insertions and removals. Passing string lists as value parameters is both fast and safe.</p>
|
|
<p>All of <a href="qlist.html">QList</a>'s functionality also applies to QStringList. For example, you can use <a href="qlist.html#isEmpty">isEmpty</a>() to test whether the list is empty, and you can call functions like <a href="qlist.html#append">append</a>(), <a href="qlist.html#prepend">prepend</a>(), <a href="qlist.html#insert">insert</a>(), <a href="qlist.html#replace">replace</a>(), <a href="qlist.html#removeAll">removeAll</a>(), <a href="qlist.html#removeAt">removeAt</a>(), <a href="qlist.html#removeFirst">removeFirst</a>(), <a href="qlist.html#removeLast">removeLast</a>(), and <a href="qlist.html#removeOne">removeOne</a>() to modify a QStringList. In addition, QStringList provides a few convenience functions that make handling lists of strings easier:</p>
|
|
<a name="adding-strings"></a>
|
|
<h3>Adding strings</h3>
|
|
<p>Strings can be added to a list using the <a href="qlist.html#append">append()</a>, <a href="qlist.html#operator-2b-eq">operator+=</a>() and <a href="qstringlist.html#operator-lt-lt">operator<<</a>() functions. For example:</p>
|
|
<pre class="cpp"> <span class="type">QStringList</span> fonts;
|
|
fonts <span class="operator"><</span><span class="operator"><</span> <span class="string">"Arial"</span> <span class="operator"><</span><span class="operator"><</span> <span class="string">"Helvetica"</span> <span class="operator"><</span><span class="operator"><</span> <span class="string">"Times"</span> <span class="operator"><</span><span class="operator"><</span> <span class="string">"Courier"</span>;</pre>
|
|
<a name="iterating-over-the-strings"></a>
|
|
<h3>Iterating over the strings</h3>
|
|
<p>To iterate over a list, you can either use index positions or <a href="qlist.html">QList</a>'s Java-style and STL-style iterator types:</p>
|
|
<p>Indexing:</p>
|
|
<pre class="cpp"> <span class="keyword">for</span> (<span class="type">int</span> i <span class="operator">=</span> <span class="number">0</span>; i <span class="operator"><</span> fonts<span class="operator">.</span>size(); <span class="operator">+</span><span class="operator">+</span>i)
|
|
cout <span class="operator"><</span><span class="operator"><</span> fonts<span class="operator">.</span>at(i)<span class="operator">.</span>toLocal8Bit()<span class="operator">.</span>constData() <span class="operator"><</span><span class="operator"><</span> endl;</pre>
|
|
<p>Java-style iterator:</p>
|
|
<pre class="cpp"> <span class="type"><a href="qstringlist.html#QStringListIterator-typedef">QStringListIterator</a></span> javaStyleIterator(fonts);
|
|
<span class="keyword">while</span> (javaStyleIterator<span class="operator">.</span>hasNext())
|
|
cout <span class="operator"><</span><span class="operator"><</span> javaStyleIterator<span class="operator">.</span>next()<span class="operator">.</span>toLocal8Bit()<span class="operator">.</span>constData() <span class="operator"><</span><span class="operator"><</span> endl;</pre>
|
|
<p>STL-style iterator:</p>
|
|
<pre class="cpp"> <span class="type">QStringList</span><span class="operator">::</span>const_iterator constIterator;
|
|
<span class="keyword">for</span> (constIterator <span class="operator">=</span> fonts<span class="operator">.</span>constBegin(); constIterator <span class="operator">!</span><span class="operator">=</span> fonts<span class="operator">.</span>constEnd();
|
|
<span class="operator">+</span><span class="operator">+</span>constIterator)
|
|
cout <span class="operator"><</span><span class="operator"><</span> (<span class="operator">*</span>constIterator)<span class="operator">.</span>toLocal8Bit()<span class="operator">.</span>constData() <span class="operator"><</span><span class="operator"><</span> endl;</pre>
|
|
<p>The <a href="qstringlist.html#QStringListIterator-typedef">QStringListIterator</a> class is simply a type definition for <a href="qlistiterator.html">QListIterator</a><<a href="qstring.html">QString</a>>. QStringList also provide the <a href="qstringlist.html#QMutableStringListIterator-typedef">QMutableStringListIterator</a> class which is a type definition for <a href="qmutablelistiterator.html">QMutableListIterator</a><<a href="qstring.html">QString</a>>.</p>
|
|
<a name="manipulating-the-strings"></a>
|
|
<h3>Manipulating the strings</h3>
|
|
<p>QStringList provides several functions allowing you to manipulate the contents of a list. You can concatenate all the strings in a string list into a single string (with an optional separator) using the <a href="qstringlist.html#join">join</a>() function. For example:</p>
|
|
<pre class="cpp"> <span class="type"><a href="qstring.html">QString</a></span> str <span class="operator">=</span> fonts<span class="operator">.</span>join(<span class="string">","</span>);
|
|
<span class="comment">// str == "Arial,Helvetica,Times,Courier"</span></pre>
|
|
<p>To break up a string into a string list, use the <a href="qstring.html#split">QString::split</a>() function:</p>
|
|
<pre class="cpp"> <span class="type">QStringList</span> list;
|
|
list <span class="operator">=</span> str<span class="operator">.</span>split(<span class="string">","</span>);
|
|
<span class="comment">// list: ["Arial", "Helvetica", "Times", "Courier"]</span></pre>
|
|
<p>The argument to split can be a single character, a string, or a <a href="qregexp.html">QRegExp</a>.</p>
|
|
<p>In addition, the <a href="qstringlist.html#operator-2b">operator+</a>() function allows you to concatenate two string lists into one. To sort a string list, use the <a href="qstringlist.html#sort">sort</a>() function.</p>
|
|
<p><a href="qstring.html">QString</a> list also provides the <a href="qstringlist.html#filter">filter</a>() function which lets you to extract a new list which contains only those strings which contain a particular substring (or match a particular regular expression):</p>
|
|
<pre class="cpp"> <span class="type">QStringList</span> monospacedFonts <span class="operator">=</span> fonts<span class="operator">.</span>filter(<span class="type"><a href="qregexp.html">QRegExp</a></span>(<span class="string">"Courier|Fixed"</span>));</pre>
|
|
<p>The <a href="qstringlist.html#contains">contains</a>() function tells you whether the list contains a given string, while the <a href="qstringlist.html#indexOf">indexOf</a>() function returns the index of the first occurrence of the given string. The <a href="qstringlist.html#lastIndexOf">lastIndexOf</a>() function on the other hand, returns the index of the last occurrence of the string.</p>
|
|
<p>Finally, the <a href="qstringlist.html#replaceInStrings">replaceInStrings</a>() function calls <a href="qstring.html#replace">QString::replace</a>() on each string in the string list in turn. For example:</p>
|
|
<pre class="cpp"> <span class="type">QStringList</span> files;
|
|
files <span class="operator"><</span><span class="operator"><</span> <span class="string">"$QTDIR/src/moc/moc.y"</span>
|
|
<span class="operator"><</span><span class="operator"><</span> <span class="string">"$QTDIR/src/moc/moc.l"</span>
|
|
<span class="operator"><</span><span class="operator"><</span> <span class="string">"$QTDIR/include/qconfig.h"</span>;
|
|
|
|
files<span class="operator">.</span>replaceInStrings(<span class="string">"$QTDIR"</span><span class="operator">,</span> <span class="string">"/usr/lib/qt"</span>);
|
|
<span class="comment">// files: [ "/usr/lib/qt/src/moc/moc.y", ...]</span></pre>
|
|
</div>
|
|
<p><b>See also </b><a href="qstring.html">QString</a>.</p>
|
|
<!-- @@@QStringList -->
|
|
<div class="func">
|
|
<h2>Member Function Documentation</h2>
|
|
<!-- $$$QStringList[overload1]$$$QStringList -->
|
|
<h3 class="fn"><a name="QStringList"></a>QStringList::<span class="name">QStringList</span> ()</h3>
|
|
<p>Constructs an empty string list.</p>
|
|
<!-- @@@QStringList -->
|
|
<!-- $$$QStringList$$$QStringListconstQString& -->
|
|
<h3 class="fn"><a name="QStringList-2"></a>QStringList::<span class="name">QStringList</span> ( const <span class="type"><a href="qstring.html">QString</a></span> & <i>str</i> )</h3>
|
|
<p>Constructs a string list that contains the given string, <i>str</i>. Longer lists are easily created like this:</p>
|
|
<pre class="cpp"> <span class="type"><a href="qstringlist.html">QStringList</a></span> longerList <span class="operator">=</span> (<span class="type"><a href="qstringlist.html">QStringList</a></span>() <span class="operator"><</span><span class="operator"><</span> str1 <span class="operator"><</span><span class="operator"><</span> str2 <span class="operator"><</span><span class="operator"><</span> str3);</pre>
|
|
<p><b>See also </b><a href="qlist.html#append">append</a>().</p>
|
|
<!-- @@@QStringList -->
|
|
<!-- $$$QStringList$$$QStringListconstQStringList& -->
|
|
<h3 class="fn"><a name="QStringList-3"></a>QStringList::<span class="name">QStringList</span> ( const <span class="type">QStringList</span> & <i>other</i> )</h3>
|
|
<p>Constructs a copy of the <i>other</i> string list.</p>
|
|
<p>This operation takes <a href="containers.html#constant-time">constant time</a> because <a href="qstringlist.html">QStringList</a> is <a href="implicit-sharing.html#implicitly-shared">implicitly shared</a>, making the process of returning a <a href="qstringlist.html">QStringList</a> from a function very fast. If a shared instance is modified, it will be copied (copy-on-write), and that takes <a href="containers.html#linear-time">linear time</a>.</p>
|
|
<p><b>See also </b><a href="qlist.html#operator-eq">operator=</a>().</p>
|
|
<!-- @@@QStringList -->
|
|
<!-- $$$QStringList$$$QStringListconstQList<QString>& -->
|
|
<h3 class="fn"><a name="QStringList-4"></a>QStringList::<span class="name">QStringList</span> ( const <span class="type"><a href="qlist.html">QList</a></span><<span class="type"><a href="qstring.html">QString</a></span>> & <i>other</i> )</h3>
|
|
<p>Constructs a copy of <i>other</i>.</p>
|
|
<p>This operation takes <a href="containers.html#constant-time">constant time</a>, because <a href="qstringlist.html">QStringList</a> is <a href="implicit-sharing.html#implicitly-shared">implicitly shared</a>. This makes returning a <a href="qstringlist.html">QStringList</a> from a function very fast. If a shared instance is modified, it will be copied (copy-on-write), and that takes <a href="containers.html#linear-time">linear time</a>.</p>
|
|
<p><b>See also </b><a href="qlist.html#operator-eq">operator=</a>().</p>
|
|
<!-- @@@QStringList -->
|
|
<!-- $$$QStringList$$$QStringListstd::initializer_list<QString> -->
|
|
<h3 class="fn"><a name="QStringList-5"></a>QStringList::<span class="name">QStringList</span> ( <span class="type">std::initializer_list</span><<span class="type"><a href="qstring.html">QString</a></span>> <i>args</i> )</h3>
|
|
<p>Construct a list from a std::initializer_list given by <i>args</i>.</p>
|
|
<p>This constructor is only enabled if the compiler supports C++0x</p>
|
|
<p>This function was introduced in Qt 4.8.</p>
|
|
<!-- @@@QStringList -->
|
|
<!-- $$$contains[overload1]$$$containsconstQString&Qt::CaseSensitivity -->
|
|
<h3 class="fn"><a name="contains"></a><span class="type">bool</span> QStringList::<span class="name">contains</span> ( const <span class="type"><a href="qstring.html">QString</a></span> & <i>str</i>, <span class="type"><a href="qt.html#CaseSensitivity-enum">Qt::CaseSensitivity</a></span> <i>cs</i> = Qt::CaseSensitive ) const</h3>
|
|
<p>Returns true if the list contains the string <i>str</i>; otherwise returns false. The search is case insensitive if <i>cs</i> is <a href="qt.html#CaseSensitivity-enum">Qt::CaseInsensitive</a>; the search is case sensitive by default.</p>
|
|
<p><b>See also </b><a href="qstringlist.html#indexOf">indexOf</a>(), <a href="qstringlist.html#lastIndexOf">lastIndexOf</a>(), and <a href="qstring.html#contains">QString::contains</a>().</p>
|
|
<!-- @@@contains -->
|
|
<!-- $$$filter[overload1]$$$filterconstQString&Qt::CaseSensitivity -->
|
|
<h3 class="fn"><a name="filter"></a><span class="type">QStringList</span> QStringList::<span class="name">filter</span> ( const <span class="type"><a href="qstring.html">QString</a></span> & <i>str</i>, <span class="type"><a href="qt.html#CaseSensitivity-enum">Qt::CaseSensitivity</a></span> <i>cs</i> = Qt::CaseSensitive ) const</h3>
|
|
<p>Returns a list of all the strings containing the substring <i>str</i>.</p>
|
|
<p>If <i>cs</i> is <a href="qt.html#CaseSensitivity-enum">Qt::CaseSensitive</a> (the default), the string comparison is case sensitive; otherwise the comparison is case insensitive.</p>
|
|
<pre class="cpp"> <span class="type"><a href="qstringlist.html">QStringList</a></span> list;
|
|
list <span class="operator"><</span><span class="operator"><</span> <span class="string">"Bill Murray"</span> <span class="operator"><</span><span class="operator"><</span> <span class="string">"John Doe"</span> <span class="operator"><</span><span class="operator"><</span> <span class="string">"Bill Clinton"</span>;
|
|
|
|
<span class="type"><a href="qstringlist.html">QStringList</a></span> result;
|
|
result <span class="operator">=</span> list<span class="operator">.</span>filter(<span class="string">"Bill"</span>);
|
|
<span class="comment">// result: ["Bill Murray", "Bill Clinton"]</span></pre>
|
|
<p>This is equivalent to</p>
|
|
<pre class="cpp"> <span class="type"><a href="qstringlist.html">QStringList</a></span> result;
|
|
foreach (<span class="keyword">const</span> <span class="type"><a href="qstring.html">QString</a></span> <span class="operator">&</span>str<span class="operator">,</span> list) {
|
|
<span class="keyword">if</span> (str<span class="operator">.</span>contains(<span class="string">"Bill"</span>))
|
|
result <span class="operator">+</span><span class="operator">=</span> str;
|
|
}</pre>
|
|
<p><b>See also </b><a href="qstringlist.html#contains">contains</a>().</p>
|
|
<!-- @@@filter -->
|
|
<!-- $$$filter$$$filterconstQRegExp& -->
|
|
<h3 class="fn"><a name="filter-2"></a><span class="type">QStringList</span> QStringList::<span class="name">filter</span> ( const <span class="type"><a href="qregexp.html">QRegExp</a></span> & <i>rx</i> ) const</h3>
|
|
<p>This is an overloaded function.</p>
|
|
<p>Returns a list of all the strings that match the regular expression <i>rx</i>.</p>
|
|
<!-- @@@filter -->
|
|
<!-- $$$indexOf[overload1]$$$indexOfconstQRegExp&int -->
|
|
<h3 class="fn"><a name="indexOf"></a><span class="type">int</span> QStringList::<span class="name">indexOf</span> ( const <span class="type"><a href="qregexp.html">QRegExp</a></span> & <i>rx</i>, <span class="type">int</span> <i>from</i> = 0 ) const</h3>
|
|
<p>Returns the index position of the first exact match of <i>rx</i> in the list, searching forward from index position <i>from</i>. Returns -1 if no item matched.</p>
|
|
<p>By default, this function is case sensitive.</p>
|
|
<p><b>See also </b><a href="qstringlist.html#lastIndexOf">lastIndexOf</a>(), <a href="qstringlist.html#contains">contains</a>(), and <a href="qregexp.html#exactMatch">QRegExp::exactMatch</a>().</p>
|
|
<!-- @@@indexOf -->
|
|
<!-- $$$indexOf$$$indexOfconstQString&int -->
|
|
<h3 class="fn"><a name="indexOf-2"></a><span class="type">int</span> QStringList::<span class="name">indexOf</span> ( const <span class="type"><a href="qstring.html">QString</a></span> & <i>value</i>, <span class="type">int</span> <i>from</i> = 0 ) const</h3>
|
|
<p>Returns the index position of the first occurrence of <i>value</i> in the list, searching forward from index position <i>from</i>. Returns -1 if no item matched.</p>
|
|
<p><b>See also </b><a href="qstringlist.html#lastIndexOf">lastIndexOf</a>(), <a href="qstringlist.html#contains">contains</a>(), and <a href="qlist.html#indexOf">QList::indexOf</a>().</p>
|
|
<!-- @@@indexOf -->
|
|
<!-- $$$indexOf$$$indexOfQRegExp&int -->
|
|
<h3 class="fn"><a name="indexOf-3"></a><span class="type">int</span> QStringList::<span class="name">indexOf</span> ( <span class="type"><a href="qregexp.html">QRegExp</a></span> & <i>rx</i>, <span class="type">int</span> <i>from</i> = 0 ) const</h3>
|
|
<p>This function overloads <a href="qstringlist.html#indexOf">indexOf</a>().</p>
|
|
<p>Returns the index position of the first exact match of <i>rx</i> in the list, searching forward from index position <i>from</i>. Returns -1 if no item matched.</p>
|
|
<p>By default, this function is case sensitive.</p>
|
|
<p>If an item matched, the <i>rx</i> regular expression will contain the matched objects (see QRegExp::matchedLength, QRegExp::cap).</p>
|
|
<p>This function was introduced in Qt 4.5.</p>
|
|
<p><b>See also </b><a href="qstringlist.html#lastIndexOf">lastIndexOf</a>(), <a href="qstringlist.html#contains">contains</a>(), and <a href="qregexp.html#exactMatch">QRegExp::exactMatch</a>().</p>
|
|
<!-- @@@indexOf -->
|
|
<!-- $$$join[overload1]$$$joinconstQString& -->
|
|
<h3 class="fn"><a name="join"></a><span class="type"><a href="qstring.html">QString</a></span> QStringList::<span class="name">join</span> ( const <span class="type"><a href="qstring.html">QString</a></span> & <i>separator</i> ) const</h3>
|
|
<p>Joins all the string list's strings into a single string with each element separated by the given <i>separator</i> (which can be an empty string).</p>
|
|
<p><b>See also </b><a href="qstring.html#split">QString::split</a>().</p>
|
|
<!-- @@@join -->
|
|
<!-- $$$lastIndexOf[overload1]$$$lastIndexOfconstQRegExp&int -->
|
|
<h3 class="fn"><a name="lastIndexOf"></a><span class="type">int</span> QStringList::<span class="name">lastIndexOf</span> ( const <span class="type"><a href="qregexp.html">QRegExp</a></span> & <i>rx</i>, <span class="type">int</span> <i>from</i> = -1 ) const</h3>
|
|
<p>Returns the index position of the last exact match of <i>rx</i> in the list, searching backward from index position <i>from</i>. If <i>from</i> is -1 (the default), the search starts at the last item. Returns -1 if no item matched.</p>
|
|
<p>By default, this function is case sensitive.</p>
|
|
<p><b>See also </b><a href="qstringlist.html#indexOf">indexOf</a>(), <a href="qstringlist.html#contains">contains</a>(), and <a href="qregexp.html#exactMatch">QRegExp::exactMatch</a>().</p>
|
|
<!-- @@@lastIndexOf -->
|
|
<!-- $$$lastIndexOf$$$lastIndexOfconstQString&int -->
|
|
<h3 class="fn"><a name="lastIndexOf-2"></a><span class="type">int</span> QStringList::<span class="name">lastIndexOf</span> ( const <span class="type"><a href="qstring.html">QString</a></span> & <i>value</i>, <span class="type">int</span> <i>from</i> = -1 ) const</h3>
|
|
<p>Returns the index position of the last occurrence of <i>value</i> in the list, searching backward from index position <i>from</i>. If <i>from</i> is -1 (the default), the search starts at the last item. Returns -1 if no item matched.</p>
|
|
<p>By default, this function is case sensitive.</p>
|
|
<p><b>See also </b><a href="qstringlist.html#indexOf">indexOf</a>() and <a href="qlist.html#lastIndexOf">QList::lastIndexOf</a>().</p>
|
|
<!-- @@@lastIndexOf -->
|
|
<!-- $$$lastIndexOf$$$lastIndexOfQRegExp&int -->
|
|
<h3 class="fn"><a name="lastIndexOf-3"></a><span class="type">int</span> QStringList::<span class="name">lastIndexOf</span> ( <span class="type"><a href="qregexp.html">QRegExp</a></span> & <i>rx</i>, <span class="type">int</span> <i>from</i> = -1 ) const</h3>
|
|
<p>This function overloads <a href="qstringlist.html#lastIndexOf">lastIndexOf</a>().</p>
|
|
<p>Returns the index position of the last exact match of <i>rx</i> in the list, searching backward from index position <i>from</i>. If <i>from</i> is -1 (the default), the search starts at the last item. Returns -1 if no item matched.</p>
|
|
<p>By default, this function is case sensitive.</p>
|
|
<p>If an item matched, the <i>rx</i> regular expression will contain the matched objects (see QRegExp::matchedLength, QRegExp::cap).</p>
|
|
<p>This function was introduced in Qt 4.5.</p>
|
|
<p><b>See also </b><a href="qstringlist.html#indexOf">indexOf</a>(), <a href="qstringlist.html#contains">contains</a>(), and <a href="qregexp.html#exactMatch">QRegExp::exactMatch</a>().</p>
|
|
<!-- @@@lastIndexOf -->
|
|
<!-- $$$removeDuplicates[overload1]$$$removeDuplicates -->
|
|
<h3 class="fn"><a name="removeDuplicates"></a><span class="type">int</span> QStringList::<span class="name">removeDuplicates</span> ()</h3>
|
|
<p>This function removes duplicate entries from a list. The entries do not have to be sorted. They will retain their original order.</p>
|
|
<p>Returns the number of removed entries.</p>
|
|
<p>This function was introduced in Qt 4.5.</p>
|
|
<!-- @@@removeDuplicates -->
|
|
<!-- $$$replaceInStrings[overload1]$$$replaceInStringsconstQString&constQString&Qt::CaseSensitivity -->
|
|
<h3 class="fn"><a name="replaceInStrings"></a><span class="type">QStringList</span> & QStringList::<span class="name">replaceInStrings</span> ( const <span class="type"><a href="qstring.html">QString</a></span> & <i>before</i>, const <span class="type"><a href="qstring.html">QString</a></span> & <i>after</i>, <span class="type"><a href="qt.html#CaseSensitivity-enum">Qt::CaseSensitivity</a></span> <i>cs</i> = Qt::CaseSensitive )</h3>
|
|
<p>Returns a string list where every string has had the <i>before</i> text replaced with the <i>after</i> text wherever the <i>before</i> text is found. The <i>before</i> text is matched case-sensitively or not depending on the <i>cs</i> flag.</p>
|
|
<p>For example:</p>
|
|
<pre class="cpp"> <span class="type"><a href="qstringlist.html">QStringList</a></span> list;
|
|
list <span class="operator"><</span><span class="operator"><</span> <span class="string">"alpha"</span> <span class="operator"><</span><span class="operator"><</span> <span class="string">"beta"</span> <span class="operator"><</span><span class="operator"><</span> <span class="string">"gamma"</span> <span class="operator"><</span><span class="operator"><</span> <span class="string">"epsilon"</span>;
|
|
list<span class="operator">.</span>replaceInStrings(<span class="string">"a"</span><span class="operator">,</span> <span class="string">"o"</span>);
|
|
<span class="comment">// list == ["olpho", "beto", "gommo", "epsilon"]</span></pre>
|
|
<p><b>See also </b><a href="qstring.html#replace">QString::replace</a>().</p>
|
|
<!-- @@@replaceInStrings -->
|
|
<!-- $$$replaceInStrings$$$replaceInStringsconstQRegExp&constQString& -->
|
|
<h3 class="fn"><a name="replaceInStrings-2"></a><span class="type">QStringList</span> & QStringList::<span class="name">replaceInStrings</span> ( const <span class="type"><a href="qregexp.html">QRegExp</a></span> & <i>rx</i>, const <span class="type"><a href="qstring.html">QString</a></span> & <i>after</i> )</h3>
|
|
<p>This is an overloaded function.</p>
|
|
<p>Replaces every occurrence of the regexp <i>rx</i>, in each of the string lists's strings, with <i>after</i>. Returns a reference to the string list.</p>
|
|
<p>For example:</p>
|
|
<pre class="cpp"> <span class="type"><a href="qstringlist.html">QStringList</a></span> list;
|
|
list <span class="operator"><</span><span class="operator"><</span> <span class="string">"alpha"</span> <span class="operator"><</span><span class="operator"><</span> <span class="string">"beta"</span> <span class="operator"><</span><span class="operator"><</span> <span class="string">"gamma"</span> <span class="operator"><</span><span class="operator"><</span> <span class="string">"epsilon"</span>;
|
|
list<span class="operator">.</span>replaceInStrings(<span class="type"><a href="qregexp.html">QRegExp</a></span>(<span class="string">"^a"</span>)<span class="operator">,</span> <span class="string">"o"</span>);
|
|
<span class="comment">// list == ["olpha", "beta", "gamma", "epsilon"]</span></pre>
|
|
<p>For regular expressions that contain <a href="qregexp.html#capturing-parentheses">capturing parentheses</a>, occurrences of <b>\1</b>, <b>\2</b>, ..., in <i>after</i> are replaced with <i>rx</i>.cap(1), <i>rx</i>.cap(2), ...</p>
|
|
<p>For example:</p>
|
|
<pre class="cpp"> <span class="type"><a href="qstringlist.html">QStringList</a></span> list;
|
|
list <span class="operator"><</span><span class="operator"><</span> <span class="string">"Bill Clinton"</span> <span class="operator"><</span><span class="operator"><</span> <span class="string">"Murray, Bill"</span>;
|
|
list<span class="operator">.</span>replaceInStrings(<span class="type"><a href="qregexp.html">QRegExp</a></span>(<span class="string">"^(.*), (.*)$"</span>)<span class="operator">,</span> <span class="string">"\\2 \\1"</span>);
|
|
<span class="comment">// list == ["Bill Clinton", "Bill Murray"]</span></pre>
|
|
<!-- @@@replaceInStrings -->
|
|
<!-- $$$sort[overload1]$$$sort -->
|
|
<h3 class="fn"><a name="sort"></a><span class="type">void</span> QStringList::<span class="name">sort</span> ()</h3>
|
|
<p>Sorts the list of strings in ascending order (case sensitively).</p>
|
|
<p>Sorting is performed using Qt's <a href="qtalgorithms.html#qSort">qSort</a>() algorithm, which operates in <a href="containers.html#linear-logarithmic-time">linear-logarithmic time</a>, i.e. O(<i>n</i> log <i>n</i>).</p>
|
|
<p>If you want to sort your strings in an arbitrary order, consider using the <a href="qmap.html">QMap</a> class. For example, you could use a <a href="qmap.html">QMap</a><<a href="qstring.html">QString</a>, <a href="qstring.html">QString</a>> to create a case-insensitive ordering (e.g. with the keys being lower-case versions of the strings, and the values being the strings), or a <a href="qmap.html">QMap</a><int, <a href="qstring.html">QString</a>> to sort the strings by some integer index.</p>
|
|
<p><b>See also </b><a href="qtalgorithms.html#qSort">qSort</a>().</p>
|
|
<!-- @@@sort -->
|
|
<!-- $$$operator+[overload1]$$$operator+constQStringList& -->
|
|
<h3 class="fn"><a name="operator-2b"></a><span class="type">QStringList</span> QStringList::<span class="name">operator+</span> ( const <span class="type">QStringList</span> & <i>other</i> ) const</h3>
|
|
<p>Returns a string list that is the concatenation of this string list with the <i>other</i> string list.</p>
|
|
<p><b>See also </b><a href="qlist.html#append">append</a>().</p>
|
|
<!-- @@@operator+ -->
|
|
<!-- $$$operator<<[overload1]$$$operator<<constQString& -->
|
|
<h3 class="fn"><a name="operator-lt-lt"></a><span class="type">QStringList</span> & QStringList::<span class="name">operator<<</span> ( const <span class="type"><a href="qstring.html">QString</a></span> & <i>str</i> )</h3>
|
|
<p>Appends the given string, <i>str</i>, to this string list and returns a reference to the string list.</p>
|
|
<p><b>See also </b><a href="qlist.html#append">append</a>().</p>
|
|
<!-- @@@operator<< -->
|
|
<!-- $$$operator<<$$$operator<<constQStringList& -->
|
|
<h3 class="fn"><a name="operator-lt-lt-2"></a><span class="type">QStringList</span> & QStringList::<span class="name">operator<<</span> ( const <span class="type">QStringList</span> & <i>other</i> )</h3>
|
|
<p>This is an overloaded function.</p>
|
|
<p>Appends the <i>other</i> string list to the string list and returns a reference to the latter string list.</p>
|
|
<!-- @@@operator<< -->
|
|
</div>
|
|
<div class="relnonmem">
|
|
<h2>Related Non-Members</h2>
|
|
<!-- $$$QMutableStringListIterator -->
|
|
<h3 class="fn"><a name="QMutableStringListIterator-typedef"></a>typedef <span class="name">QMutableStringListIterator</span></h3>
|
|
<p>The <a href="qstringlist.html#QStringListIterator-typedef">QStringListIterator</a> type definition provides a Java-style non-const iterator for <a href="qstringlist.html">QStringList</a>.</p>
|
|
<p><a href="qstringlist.html">QStringList</a> provides both <a href="containers.html#java-style-iterators">Java-style iterators</a> and <a href="containers.html#stl-style-iterators">STL-style iterators</a>. The Java-style non-const iterator is simply a type definition for <a href="qmutablelistiterator.html">QMutableListIterator</a><<a href="qstring.html">QString</a>>.</p>
|
|
<p><b>See also </b><a href="qstringlist.html#QStringListIterator-typedef">QStringListIterator</a> and <a href="qlist-iterator.html">QStringList::iterator</a>.</p>
|
|
<!-- @@@QMutableStringListIterator -->
|
|
<!-- $$$QStringListIterator -->
|
|
<h3 class="fn"><a name="QStringListIterator-typedef"></a>typedef <span class="name">QStringListIterator</span></h3>
|
|
<p>The QStringListIterator type definition provides a Java-style const iterator for <a href="qstringlist.html">QStringList</a>.</p>
|
|
<p><a href="qstringlist.html">QStringList</a> provides both <a href="containers.html#java-style-iterators">Java-style iterators</a> and <a href="containers.html#stl-style-iterators">STL-style iterators</a>. The Java-style const iterator is simply a type definition for <a href="qlistiterator.html">QListIterator</a><<a href="qstring.html">QString</a>>.</p>
|
|
<p><b>See also </b><a href="qstringlist.html#QMutableStringListIterator-typedef">QMutableStringListIterator</a> and <a href="qlist-const-iterator.html">QStringList::const_iterator</a>.</p>
|
|
<!-- @@@QStringListIterator -->
|
|
<!-- $$$operator<<$$$operator<<QDataStream&constQStringList& -->
|
|
<h3 class="fn"><a name="operator-lt-lt-136"></a><span class="type"><a href="qdatastream.html">QDataStream</a></span> & <span class="name">operator<<</span> ( <span class="type"><a href="qdatastream.html">QDataStream</a></span> & <i>out</i>, const <span class="type">QStringList</span> & <i>list</i> )</h3>
|
|
<p>Writes the given string <i>list</i> to the specified <i>out</i> stream.</p>
|
|
<p><b>See also </b><a href="datastreamformat.html">Serializing Qt Data Types</a>.</p>
|
|
<!-- @@@operator<< -->
|
|
<!-- $$$operator>>$$$operator>>QDataStream&QStringList& -->
|
|
<h3 class="fn"><a name="operator-gt-gt-72"></a><span class="type"><a href="qdatastream.html">QDataStream</a></span> & <span class="name">operator>></span> ( <span class="type"><a href="qdatastream.html">QDataStream</a></span> & <i>in</i>, <span class="type">QStringList</span> & <i>list</i> )</h3>
|
|
<p>Reads a string list from the given <i>in</i> stream into the specified <i>list</i>.</p>
|
|
<p><b>See also </b><a href="datastreamformat.html">Serializing Qt Data Types</a>.</p>
|
|
<!-- @@@operator>> -->
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div class="ft">
|
|
<span></span>
|
|
</div>
|
|
</div>
|
|
<div class="footer">
|
|
<p>
|
|
<acronym title="Copyright">©</acronym> 2015 The Qt Company Ltd.
|
|
Documentation contributions included herein are the copyrights of
|
|
their respective owners.</p>
|
|
<br />
|
|
<p>
|
|
The documentation provided herein is licensed under the terms of the
|
|
<a href="http://www.gnu.org/licenses/fdl.html">GNU Free Documentation
|
|
License version 1.3</a> as published by the Free Software Foundation.</p>
|
|
<p>
|
|
Documentation sources may be obtained from <a href="http://www.qt-project.org">
|
|
www.qt-project.org</a>.</p>
|
|
<br />
|
|
<p>
|
|
Qt and respective logos are trademarks of The Qt Company Ltd
|
|
in Finland and/or other countries worldwide. All other trademarks are property
|
|
of their respective owners. <a title="Privacy Policy"
|
|
href="http://en.gitorious.org/privacy_policy/">Privacy Policy</a></p>
|
|
</div>
|
|
|
|
<script src="scripts/functions.js" type="text/javascript"></script>
|
|
</body>
|
|
</html>
|