Sophie

Sophie

distrib > Mandriva > 8.2 > i586 > media > contrib > by-pkgid > 112b0974ad288f6cd55bf971ee6026a9 > files > 1738

libqt3-devel-3.0.2-2mdk.i586.rpm

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<!-- /tmp/qt-3.0-reggie-28534/qt-x11-free-3.0.2/src/tools/qsettings_unix.cpp:52 -->
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>QSettings Class</title>
<style type="text/css"><!--
h3.fn,span.fn { margin-left: 1cm; text-indent: -1cm; }
a:link { color: #004faf; text-decoration: none }
a:visited { color: #672967; text-decoration: none }
body { background: #ffffff; color: black; }
--></style>
</head>
<body>

<table border="0" cellpadding="0" cellspacing="0" width="100%">
<tr bgcolor="#E5E5E5">
<td valign=center>
 <a href="index.html">
<font color="#004faf">Home</font></a>
 | <a href="classes.html">
<font color="#004faf">All&nbsp;Classes</font></a>
 | <a href="mainclasses.html">
<font color="#004faf">Main&nbsp;Classes</font></a>
 | <a href="annotated.html">
<font color="#004faf">Annotated</font></a>
 | <a href="groups.html">
<font color="#004faf">Grouped&nbsp;Classes</font></a>
 | <a href="functions.html">
<font color="#004faf">Functions</font></a>
</td>
<td align="right" valign="center"><img src="logo32.png" align="right" width="64" height="32" border="0"></td></tr></table><h1 align=center>QSettings Class Reference</h1>

<p>The QSettings class provides persistent platform-independent application settings.
<a href="#details">More...</a>
<p><tt>#include &lt;<a href="qsettings-h.html">qsettings.h</a>&gt;</tt>
<p><a href="qsettings-members.html">List of all member functions.</a>
<h2>Public Members</h2>
<ul>
<li><div class=fn><a href="#QSettings"><b>QSettings</b></a> ()</div></li>
<li><div class=fn><a href="#~QSettings"><b>~QSettings</b></a> ()</div></li>
<li><div class=fn>enum <a href="#System-enum"><b>System</b></a> { Unix = 0, Windows, Mac }</div></li>
<li><div class=fn>bool <a href="#writeEntry"><b>writeEntry</b></a> ( const&nbsp;QString&nbsp;&amp;&nbsp;key, bool&nbsp;value )</div></li>
<li><div class=fn>bool <a href="#writeEntry-2"><b>writeEntry</b></a> ( const&nbsp;QString&nbsp;&amp;&nbsp;key, double&nbsp;value )</div></li>
<li><div class=fn>bool <a href="#writeEntry-3"><b>writeEntry</b></a> ( const&nbsp;QString&nbsp;&amp;&nbsp;key, int&nbsp;value )</div></li>
<li><div class=fn>bool <a href="#writeEntry-5"><b>writeEntry</b></a> ( const&nbsp;QString&nbsp;&amp;&nbsp;key, const&nbsp;QString&nbsp;&amp;&nbsp;value )</div></li>
<li><div class=fn>bool <a href="#writeEntry-6"><b>writeEntry</b></a> ( const&nbsp;QString&nbsp;&amp;&nbsp;key, const&nbsp;QStringList&nbsp;&amp;&nbsp;value )</div></li>
<li><div class=fn>bool <a href="#writeEntry-7"><b>writeEntry</b></a> ( const&nbsp;QString&nbsp;&amp;&nbsp;key, const&nbsp;QStringList&nbsp;&amp;&nbsp;value, const&nbsp;QChar&nbsp;&amp;&nbsp;separator )</div></li>
<li><div class=fn>QStringList <a href="#entryList"><b>entryList</b></a> ( const&nbsp;QString&nbsp;&amp;&nbsp;key ) const</div></li>
<li><div class=fn>QStringList <a href="#subkeyList"><b>subkeyList</b></a> ( const&nbsp;QString&nbsp;&amp;&nbsp;key ) const</div></li>
<li><div class=fn>QStringList <a href="#readListEntry"><b>readListEntry</b></a> ( const&nbsp;QString&nbsp;&amp;&nbsp;key, bool&nbsp;*&nbsp;ok = 0 )</div></li>
<li><div class=fn>QStringList <a href="#readListEntry-2"><b>readListEntry</b></a> ( const&nbsp;QString&nbsp;&amp;&nbsp;key, const&nbsp;QChar&nbsp;&amp;&nbsp;separator, bool&nbsp;*&nbsp;ok = 0 )</div></li>
<li><div class=fn>QString <a href="#readEntry"><b>readEntry</b></a> ( const&nbsp;QString&nbsp;&amp;&nbsp;key, const&nbsp;QString&nbsp;&amp;&nbsp;def = QString::null, bool&nbsp;*&nbsp;ok = 0 )</div></li>
<li><div class=fn>int <a href="#readNumEntry"><b>readNumEntry</b></a> ( const&nbsp;QString&nbsp;&amp;&nbsp;key, int&nbsp;def = 0, bool&nbsp;*&nbsp;ok = 0 )</div></li>
<li><div class=fn>double <a href="#readDoubleEntry"><b>readDoubleEntry</b></a> ( const&nbsp;QString&nbsp;&amp;&nbsp;key, double&nbsp;def = 0, bool&nbsp;*&nbsp;ok = 0 )</div></li>
<li><div class=fn>bool <a href="#readBoolEntry"><b>readBoolEntry</b></a> ( const&nbsp;QString&nbsp;&amp;&nbsp;key, bool&nbsp;def = 0, bool&nbsp;*&nbsp;ok = 0 )</div></li>
<li><div class=fn>bool <a href="#removeEntry"><b>removeEntry</b></a> ( const&nbsp;QString&nbsp;&amp;&nbsp;key )</div></li>
<li><div class=fn>void <a href="#insertSearchPath"><b>insertSearchPath</b></a> ( System&nbsp;s, const&nbsp;QString&nbsp;&amp;&nbsp;path )</div></li>
<li><div class=fn>void <a href="#removeSearchPath"><b>removeSearchPath</b></a> ( System&nbsp;s, const&nbsp;QString&nbsp;&amp;&nbsp;path )</div></li>
</ul>
<hr><a name="details"></a><h2>Detailed Description</h2>


The QSettings class provides persistent platform-independent application settings.
<p> 


<p> On Unix systems, QSettings uses text files to store settings. On Windows
systems, QSettings uses the system registry.  On Mac OS X, QSettings will
behave as on Unix, and store to text files.
<p> Each setting comprises an identifying key and the data associated with
the key. A key is a unicode string which consists of <em>two</em> or more
subkeys. A subkey is a slash, '/', followed by one or more unicode
characters (excluding slashes, newlines, carriage returns and equals,
'=', signs). The associated data, called the entry or value, may be a
boolean, an integer, a double, a string or a list of strings. Entry
strings may contain any unicode characters.
<p> If you want to save and restore the entire desktop's settings, i.e.
which applications are running, use QSettings to save the settings
for each individual application and <a href="qsessionmanager.html">QSessionManager</a> to save the
desktop's session.
<p> Example settings:
<pre>
    /MyCompany/MyApplication/background color
    /MyCompany/MyApplication/foreground color
    /MyCompany/MyApplication/geometry/x
    /MyCompany/MyApplication/geometry/y
    /MyCompany/MyApplication/geometry/width
    /MyCompany/MyApplication/geometry/height
    /MyCompany/MyApplication/recent files/1
    /MyCompany/MyApplication/recent files/2
    /MyCompany/MyApplication/recent files/3
    </pre>
 
Each line above is a complete key, made up of subkeys.
<p> A typical usage pattern for application startup:
<pre>
    QSettings settings;
    settings.<a href="#insertSearchPath">insertSearchPath</a>( QSettings::<a href="#System-enum">Windows</a>, "/MyCompany" );
    // No search path needed for Unix; see notes further on.
    // Use default values if the keys don't exist
    <a href="qstring.html">QString</a> bgColor = settings.<a href="#readEntry">readEntry</a>( "/MyApplication/background color", "white" );
    int width = settings.<a href="#readNumEntry">readNumEntry</a>( "/MyApplication/geometry/width", 640 );
    // ...
    </pre>
 
<p> A typical usage pattern for application exit or 'save preferences':
<pre>
    QSettings settings;
    settings.<a href="#insertSearchPath">insertSearchPath</a>( QSettings::<a href="#System-enum">Windows</a>, "/MyCompany" );
    // No search path needed for Unix; see notes further on.
    settings.<a href="#writeEntry">writeEntry</a>( "/MyApplication/background color", bgColor );
    settings.<a href="#writeEntry">writeEntry</a>( "/MyApplication/geometry/width", width );
    // ...
    </pre>
 
<p> You can get a list of entry-holding keys by calling <a href="#entryList">entryList</a>(), and
a list of key-holding keys using <a href="#subkeyList">subkeyList</a>().
<p> <pre>
    <a href="qstringlist.html">QStringList</a> keys = <a href="#entryList">entryList</a>( "/MyApplication" );
    // keys contains 'background color' and 'foreground color'.

    <a href="qstringlist.html">QStringList</a> keys = <a href="#entryList">entryList</a>( "/MyApplication/recent files" );
    // keys contains '1', '2' and '3'.

    <a href="qstringlist.html">QStringList</a> subkeys = <a href="#subkeyList">subkeyList</a>( "/MyApplication" );
    // subkeys contains 'geometry' and 'recent files'

    <a href="qstringlist.html">QStringList</a> subkeys = <a href="#subkeyList">subkeyList</a>( "/MyApplication/recent files" );
    // subkeys is empty.
    </pre>
 
<p> If you wish to use a different search path call <a href="#insertSearchPath">insertSearchPath</a>()
as often as necessary to add your preferred paths. Call
<a href="#removeSearchPath">removeSearchPath</a>() to remove any unwanted paths.
<p> Since settings for Windows are stored in the registry there are size
limits as follows:
<ul>
<li> A subkey may not exceed 255 characters.
<li> An entry's value may not exceed 16,300 characters.
<li> All the values of a key (for example, all the 'recent files'
subkeys values), may not exceed 65,535 characters.
</ul>
<p> These limitations are not enforced on Unix.
<p> <h3> Notes for Unix Applications
</h3>
<a name="1"></a><p> There is no universally accepted place for storing application
settings under Unix. In the examples the settings file will be
searched for in the following directories:
<ol type=1>
<li> $QT_INSTALL_PREFIX/etc/settings
<li> /opt/MyCompany/share/etc
<li> /opt/MyCompany/share/MyApplication/etc
<li> $HOME/.qt
</ol>
When reading settings the files are searched in the order shown
above, with later settings overriding earlier settings. Files for
which the user doesn't have read permission are ignored. When saving
settings QSettings works forwards in the order shown above writing
to the first settings file for which the user has write permission.
($QT_INSTALL_PREFIX is the directory where Qt was installed.  This can be
modified by using the configure script's -prefix argument)
<p> If you want to put the settings in a particular place in the
filesystem you could do this:
<pre>
    settings.insertSearchPath( QSettings::<a href="#System-enum">Unix</a>, "/opt/MyCompany/share" );
    </pre>
 
<p> But in practice you may prefer not to use a search path for Unix.
For example the following code:
<pre>
    settings.writeEntry( "/MyApplication/geometry/width", width );
    </pre>
 
will end up writing the "geometry/width" setting to the file
<tt>$HOME/.qt/myapplicationrc</tt> (assuming that the application is
being run by an ordinary user, i.e. not by root).
<p> For cross-platform applications you should ensure that the Windows
size limitations are not exceeded.
<p>See also <a href="io.html">Input/Output and Networking</a> and <a href="misc.html">Miscellaneous Classes</a>.

<hr><h2>Member Type Documentation</h2>
<h3 class=fn><a name="System-enum"></a>QSettings::System</h3>

<ul>
<li><tt>QSettings::Mac</tt> - Macintosh execution environments
<li><tt>QSettings::Unix</tt> - Mac OS X, Unix, Linux and Unix-like execution environments
<li><tt>QSettings::Windows</tt> - Windows execution environments
</ul>
<hr><h2>Member Function Documentation</h2>
<h3 class=fn><a name="QSettings"></a>QSettings::QSettings ()
</h3>
Creates a settings object.

<h3 class=fn><a name="~QSettings"></a>QSettings::~QSettings ()
</h3>
Destroys the settings object.  All modifications made to the settings
will automatically be saved.
<p> 
<h3 class=fn><a href="qstringlist.html">QStringList</a> <a name="entryList"></a>QSettings::entryList ( const&nbsp;<a href="qstring.html">QString</a>&nbsp;&amp;&nbsp;key ) const
</h3>
Returns a list of the keys which contain entries under <em>key</em>. Does <em>not</em> return any keys that contain keys.
<p> Example settings:
<pre>
    /MyCompany/MyApplication/background color
    /MyCompany/MyApplication/foreground color
    /MyCompany/MyApplication/geometry/x
    /MyCompany/MyApplication/geometry/y
    /MyCompany/MyApplication/geometry/width
    /MyCompany/MyApplication/geometry/height
    </pre>
 
<pre>
    <a href="qstringlist.html">QStringList</a> keys = <a href="#entryList">entryList</a>( "/MyCompany/MyApplication" );
    </pre>
 
<tt>keys</tt> contains 'background color' and 'foreground color'. It does
not contain 'geometry' because this key contains keys not entries.
<p> To access the geometry values could either use <a href="#subkeyList">subkeyList</a>() to read
the keys and then read each entry, or simply read each entry
directly by specifying its full key, e.g.
"/MyCompany/MyApplication/geometry/y".
<p> <p>See also <a href="#subkeyList">subkeyList</a>().

<h3 class=fn>void <a name="insertSearchPath"></a>QSettings::insertSearchPath ( <a href="qsettings.html#System-enum">System</a>&nbsp;s, const&nbsp;<a href="qstring.html">QString</a>&nbsp;&amp;&nbsp;path )
</h3>
Inserts <em>path</em> into the settings search path. The semantics of <em>path</em> depends on the system <em>s</em>.
<p> When <em>s</em> is <em>Windows</em> and the execution environment is <em>not</em>
Windows the function does nothing. Similarly when <em>s</em> is <em>Unix</em> and
the execution environment is <em>not</em> Unix the function does nothing.
<p> When <em>s</em> is <em>Windows</em>, and the execution environment is Windows, the
search path list will be used as the first subfolder of the "Software"
folder in the registry.
<p> When reading settings the folders are searched forwards from the first
folder (listed below) to the last, with later settings overriding
settings found earlier, and ignoring any folders for which the user
doesn't have read permission.
<ol type=1>
<li> HKEY_CURRENT_USER/Software/MyCompany/MyApplication
<li> HKEY_CURRENT_USER/Software/MyApplication
<li> HKEY_LOCAL_MACHINE/Software/MyCompany/MyApplication
<li> HKEY_LOCAL_MACHINE/Software/MyApplication
</ol>
<p> <pre>
  QSettings settings;
  settings.<a href="#insertSearchPath">insertSearchPath</a>( QSettings::<a href="#System-enum">Windows</a>, "/MyCompany" );
  settings.<a href="#writeEntry">writeEntry</a>( "/MyApplication/Tip of the day", TRUE );
  </pre>
 
The code above will write the subkey "Tip of the day" into the <em>first</em>
of the registry folders listed below that is found and for which the
user has write permission.
<ol type=1>
<li> HKEY_LOCAL_MACHINE/Software/MyApplication
<li> HKEY_LOCAL_MACHINE/Software/MyCompany/MyApplication
<li> HKEY_CURRENT_USER/Software/MyApplication
<li> HKEY_CURRENT_USER/Software/MyCompany/MyApplication
</ol>
<p> When <em>s</em> is <em>Unix</em>, and the execution environment is Unix, the
search path list will be used when trying to determine a suitable
filename for reading and writing settings files. By default, there are
two entries in the search path:
<p> <ol type=1>
<li> $QTDIR/etc - where $QTDIR is the directory where Qt was installed.
<li> $HOME/.qt/ - where $HOME is the user's home directory.
</ol>
<p> All insertions into the search path will go before $HOME/.qt/.
For example:
<pre>
  QSettings settings;
  settings.<a href="#insertSearchPath">insertSearchPath</a>( QSettings::<a href="#System-enum">Unix</a>, "/opt/MyCompany/share/etc" );
  settings.<a href="#insertSearchPath">insertSearchPath</a>( QSettings::<a href="#System-enum">Unix</a>, "/opt/MyCompany/share/MyApplication/etc" );
  // ...
  </pre>
 
Will result in a search path of:
<ol type=1>
<li> $QTDIR/etc
<li> /opt/MyCompany/share/etc
<li> /opt/MyCompany/share/MyApplication/etc
<li> $HOME/.qt
</ol>
When reading settings the files are searched in the order shown
above, with later settings overriding earlier settings. Files for
which the user doesn't have read permission are ignored. When saving
settings QSettings works forwards in the order shown above writing
to the first settings file for which the user has write permission.
($QTDIR is the directory where Qt was installed.)
<p> Settings under Unix are stored in files whose names are based on the
first subkey of the key (not including the search path). The algorithm
for creating names is essentially: lowercase the first subkey, replace
spaces with underscores and add 'rc', e.g.
<tt>/MyCompany/MyApplication/background color</tt> will be stored in
<tt>myapplicationrc</tt> (assuming that <tt>/MyCompany</tt> is part of
the search path).
<p> <p>See also <a href="#removeSearchPath">removeSearchPath</a>().

<p> 
<h3 class=fn>bool <a name="readBoolEntry"></a>QSettings::readBoolEntry ( const&nbsp;<a href="qstring.html">QString</a>&nbsp;&amp;&nbsp;key, bool&nbsp;def = 0, bool&nbsp;*&nbsp;ok = 0 )
</h3>
Reads the entry specified by <em>key</em>, and returns a bool, or the
default value, <em>def</em>, if the entry couldn't be read.
If <em>ok</em> is non-null, *ok is set to TRUE if the key was read, FALSE
otherwise.
<p> <p>See also <a href="#readEntry">readEntry</a>(), <a href="#readNumEntry">readNumEntry</a>(), <a href="#readDoubleEntry">readDoubleEntry</a>(), <a href="#writeEntry">writeEntry</a>() and <a href="#removeEntry">removeEntry</a>().

<h3 class=fn>double <a name="readDoubleEntry"></a>QSettings::readDoubleEntry ( const&nbsp;<a href="qstring.html">QString</a>&nbsp;&amp;&nbsp;key, double&nbsp;def = 0, bool&nbsp;*&nbsp;ok = 0 )
</h3>
Reads the entry specified by <em>key</em>, and returns a double, or the
default value, <em>def</em>, if the entry couldn't be read.
If <em>ok</em> is non-null, *ok is set to TRUE if the key was read, FALSE
otherwise.
<p> <p>See also <a href="#readEntry">readEntry</a>(), <a href="#readNumEntry">readNumEntry</a>(), <a href="#readBoolEntry">readBoolEntry</a>(), <a href="#writeEntry">writeEntry</a>() and <a href="#removeEntry">removeEntry</a>().

<h3 class=fn><a href="qstring.html">QString</a> <a name="readEntry"></a>QSettings::readEntry ( const&nbsp;<a href="qstring.html">QString</a>&nbsp;&amp;&nbsp;key, const&nbsp;<a href="qstring.html">QString</a>&nbsp;&amp;&nbsp;def = QString::null, bool&nbsp;*&nbsp;ok = 0 )
</h3>
Reads the entry specified by <em>key</em>, and returns a <a href="qstring.html">QString</a>, or the
default value, <em>def</em>, if the entry couldn't be read.
If <em>ok</em> is non-null, *ok is set to TRUE if the key was read, FALSE
otherwise.
<p> <p>See also <a href="#readListEntry">readListEntry</a>(), <a href="#readNumEntry">readNumEntry</a>(), <a href="#readDoubleEntry">readDoubleEntry</a>(), <a href="#readBoolEntry">readBoolEntry</a>(), <a href="#writeEntry">writeEntry</a>() and <a href="#removeEntry">removeEntry</a>().

<h3 class=fn><a href="qstringlist.html">QStringList</a> <a name="readListEntry"></a>QSettings::readListEntry ( const&nbsp;<a href="qstring.html">QString</a>&nbsp;&amp;&nbsp;key, bool&nbsp;*&nbsp;ok = 0 )
</h3>
Reads the entry specified by <em>key</em> as a string.
If <em>ok</em> is non-null, *ok is set to TRUE if the key was read, FALSE
otherwise.
<p> Note that if you want to iterate over the list, you should
iterate over a copy, e.g.
<pre>
    <a href="qstringlist.html">QStringList</a> list = mySettings.readListEntry( "recentfiles" );
    QStringList::Iterator it = list.<a href="qvaluelist.html#begin">begin</a>();
    while( it != list.<a href="qvaluelist.html#end">end</a>() ) {
        myProcessing( *it );
        ++it;
    }
    </pre>
 
<p> <p>See also <a href="#readEntry">readEntry</a>(), <a href="#readDoubleEntry">readDoubleEntry</a>(), <a href="#readBoolEntry">readBoolEntry</a>(), <a href="#writeEntry">writeEntry</a>(), <a href="#removeEntry">removeEntry</a>() and <a href="qstringlist.html#split">QStringList::split</a>().

<h3 class=fn><a href="qstringlist.html">QStringList</a> <a name="readListEntry-2"></a>QSettings::readListEntry ( const&nbsp;<a href="qstring.html">QString</a>&nbsp;&amp;&nbsp;key, const&nbsp;<a href="qchar.html">QChar</a>&nbsp;&amp;&nbsp;separator, bool&nbsp;*&nbsp;ok = 0 )
</h3>
This is an overloaded member function, provided for convenience. It behaves essentially like the above function.
<p> Reads the entry specified by <em>key</em> as a string.  The <em>separator</em> is
used to create a <a href="qstringlist.html">QStringList</a> by calling <a href="qstringlist.html#split">QStringList::split</a>(<em>separator</em>, entry).
If <em>ok</em> is non-null, *ok is set to TRUE if the key was read, FALSE
otherwise.
<p> Note that if you want to iterate over the list, you should
iterate over a copy, e.g.
<pre>
    <a href="qstringlist.html">QStringList</a> list = mySettings.readListEntry( "size", " " );
    QStringList::Iterator it = list.<a href="qvaluelist.html#begin">begin</a>();
    while( it != list.<a href="qvaluelist.html#end">end</a>() ) {
        myProcessing( *it );
        ++it;
    }
    </pre>
 
<p> <p>See also <a href="#readEntry">readEntry</a>(), <a href="#readDoubleEntry">readDoubleEntry</a>(), <a href="#readBoolEntry">readBoolEntry</a>(), <a href="#writeEntry">writeEntry</a>(), <a href="#removeEntry">removeEntry</a>() and <a href="qstringlist.html#split">QStringList::split</a>().

<h3 class=fn>int <a name="readNumEntry"></a>QSettings::readNumEntry ( const&nbsp;<a href="qstring.html">QString</a>&nbsp;&amp;&nbsp;key, int&nbsp;def = 0, bool&nbsp;*&nbsp;ok = 0 )
</h3>
Reads the entry specified by <em>key</em>, and returns an integer, or the
default value, <em>def</em>, if the entry couldn't be read.
If <em>ok</em> is non-null, *ok is set to TRUE if the key was read, FALSE
otherwise.
<p> <p>See also <a href="#readEntry">readEntry</a>(), <a href="#readDoubleEntry">readDoubleEntry</a>(), <a href="#readBoolEntry">readBoolEntry</a>(), <a href="#writeEntry">writeEntry</a>() and <a href="#removeEntry">removeEntry</a>().

<h3 class=fn>bool <a name="removeEntry"></a>QSettings::removeEntry ( const&nbsp;<a href="qstring.html">QString</a>&nbsp;&amp;&nbsp;key )
</h3>
Removes the entry specified by <em>key</em>.
<p> Returns TRUE if the entry existed and was removed; otherwise returns FALSE.
<p> <p>See also <a href="#readEntry">readEntry</a>() and <a href="#writeEntry">writeEntry</a>().

<h3 class=fn>void <a name="removeSearchPath"></a>QSettings::removeSearchPath ( <a href="qsettings.html#System-enum">System</a>&nbsp;s, const&nbsp;<a href="qstring.html">QString</a>&nbsp;&amp;&nbsp;path )
</h3>
Removes all occurrences of <em>path</em> (using exact matching) from the
settings search path for system <em>s</em>. Note that the default search
paths cannot be removed.
<p> <p>See also <a href="#insertSearchPath">insertSearchPath</a>().

<h3 class=fn><a href="qstringlist.html">QStringList</a> <a name="subkeyList"></a>QSettings::subkeyList ( const&nbsp;<a href="qstring.html">QString</a>&nbsp;&amp;&nbsp;key ) const
</h3>
Returns a list of the keys which contain keys under <em>key</em>. Does <em>not</em> return any keys that contain entries.
<p> Example settings:
<pre>
    /MyCompany/MyApplication/background color
    /MyCompany/MyApplication/foreground color
    /MyCompany/MyApplication/geometry/x
    /MyCompany/MyApplication/geometry/y
    /MyCompany/MyApplication/geometry/width
    /MyCompany/MyApplication/geometry/height
    /MyCompany/MyApplication/recent files/1
    /MyCompany/MyApplication/recent files/2
    /MyCompany/MyApplication/recent files/3
    </pre>
 
<pre>
    <a href="qstringlist.html">QStringList</a> keys = <a href="#subkeyList">subkeyList</a>( "/MyCompany/MyApplication" );
    </pre>
 
<tt>keys</tt> contains 'geometry' and 'recent files'. It does not contain
'background color' or 'foreground color' because they are keys which
contain entries not keys. To get a list of keys that have values
rather than subkeys use <a href="#entryList">entryList</a>().
<p> <p>See also <a href="#entryList">entryList</a>().

<h3 class=fn>bool <a name="writeEntry"></a>QSettings::writeEntry ( const&nbsp;<a href="qstring.html">QString</a>&nbsp;&amp;&nbsp;key, bool&nbsp;value )
</h3>
Writes the boolean entry <em>value</em> into key <em>key</em>. The <em>key</em> is
created if it doesn't exist. Any previous value is overwritten by <em>value</em>.
<p> If an error occurs the settings are left unchanged and FALSE is
returned; otherwise TRUE is returned.
<p> <p>See also <a href="#readListEntry">readListEntry</a>(), <a href="#readNumEntry">readNumEntry</a>(), <a href="#readDoubleEntry">readDoubleEntry</a>(), <a href="#readBoolEntry">readBoolEntry</a>() and <a href="#removeEntry">removeEntry</a>().

<h3 class=fn>bool <a name="writeEntry-2"></a>QSettings::writeEntry ( const&nbsp;<a href="qstring.html">QString</a>&nbsp;&amp;&nbsp;key, double&nbsp;value )
</h3>
This is an overloaded member function, provided for convenience. It behaves essentially like the above function.
<p> Writes the double entry <em>value</em> into key <em>key</em>. The <em>key</em> is
created if it doesn't exist. Any previous value is overwritten by <em>value</em>.
<p> If an error occurs the settings are left unchanged and FALSE is
returned; otherwise TRUE is returned.
<p> <p>See also <a href="#readListEntry">readListEntry</a>(), <a href="#readNumEntry">readNumEntry</a>(), <a href="#readDoubleEntry">readDoubleEntry</a>(), <a href="#readBoolEntry">readBoolEntry</a>() and <a href="#removeEntry">removeEntry</a>().

<h3 class=fn>bool <a name="writeEntry-3"></a>QSettings::writeEntry ( const&nbsp;<a href="qstring.html">QString</a>&nbsp;&amp;&nbsp;key, int&nbsp;value )
</h3>
This is an overloaded member function, provided for convenience. It behaves essentially like the above function.
<p> Writes the integer entry <em>value</em> into key <em>key</em>. The <em>key</em> is
created if it doesn't exist. Any previous value is overwritten by <em>value</em>.
<p> If an error occurs the settings are left unchanged and FALSE is
returned; otherwise TRUE is returned.
<p> <p>See also <a href="#readListEntry">readListEntry</a>(), <a href="#readNumEntry">readNumEntry</a>(), <a href="#readDoubleEntry">readDoubleEntry</a>(), <a href="#readBoolEntry">readBoolEntry</a>() and <a href="#removeEntry">removeEntry</a>().

<h3 class=fn>bool <a name="writeEntry-5"></a>QSettings::writeEntry ( const&nbsp;<a href="qstring.html">QString</a>&nbsp;&amp;&nbsp;key, const&nbsp;<a href="qstring.html">QString</a>&nbsp;&amp;&nbsp;value )
</h3>
This is an overloaded member function, provided for convenience. It behaves essentially like the above function.
<p> Writes the string entry <em>value</em> into key <em>key</em>. The <em>key</em> is
created if it doesn't exist. Any previous value is overwritten by <em>value</em>. If <em>value</em> is an empty string or a null string the key's
value will be an empty string.
<p> If an error occurs the settings are left unchanged and FALSE is
returned; otherwise TRUE is returned.
<p> <p>See also <a href="#readListEntry">readListEntry</a>(), <a href="#readNumEntry">readNumEntry</a>(), <a href="#readDoubleEntry">readDoubleEntry</a>(), <a href="#readBoolEntry">readBoolEntry</a>() and <a href="#removeEntry">removeEntry</a>().

<h3 class=fn>bool <a name="writeEntry-6"></a>QSettings::writeEntry ( const&nbsp;<a href="qstring.html">QString</a>&nbsp;&amp;&nbsp;key, const&nbsp;<a href="qstringlist.html">QStringList</a>&nbsp;&amp;&nbsp;value )
</h3>
This is an overloaded member function, provided for convenience. It behaves essentially like the above function.
<p> Writes the string list entry <em>value</em> into key <em>key</em>. The <em>key</em> is
created if it doesn't exist. Any previous value is overwritten by <em>value</em>.
<p> If an error occurs the settings are left unchanged and FALSE is
returned; otherwise TRUE is returned.
<p> <p>See also <a href="#readListEntry">readListEntry</a>(), <a href="#readNumEntry">readNumEntry</a>(), <a href="#readDoubleEntry">readDoubleEntry</a>(), <a href="#readBoolEntry">readBoolEntry</a>() and <a href="#removeEntry">removeEntry</a>().

<h3 class=fn>bool <a name="writeEntry-7"></a>QSettings::writeEntry ( const&nbsp;<a href="qstring.html">QString</a>&nbsp;&amp;&nbsp;key, const&nbsp;<a href="qstringlist.html">QStringList</a>&nbsp;&amp;&nbsp;value, const&nbsp;<a href="qchar.html">QChar</a>&nbsp;&amp;&nbsp;separator )
</h3>
This is an overloaded member function, provided for convenience. It behaves essentially like the above function.
<p> Writes the string list entry <em>value</em> into key <em>key</em>. The <em>key</em> is
created if it doesn't exist. Any previous value is overwritten by <em>value</em>. The list is stored as a sequence of strings separated by <em>separator</em>, so none of the strings in the list should contain the
separator. If the list is empty or null the key's value will be an
empty string.
<p> If an error occurs the settings are left unchanged and FALSE is
returned; otherwise TRUE is returned.
<p> <p>See also <a href="#readListEntry">readListEntry</a>(), <a href="#readNumEntry">readNumEntry</a>(), <a href="#readDoubleEntry">readDoubleEntry</a>(), <a href="#readBoolEntry">readBoolEntry</a>() and <a href="#removeEntry">removeEntry</a>().

<!-- eof -->
<hr><p>
This file is part of the <a href="index.html">Qt toolkit</a>.
Copyright &copy; 1995-2001
<a href="http://www.trolltech.com/">Trolltech</a>. All Rights Reserved.<p><address><hr><div align=center>
<table width=100% cellspacing=0 border=0><tr>
<td>Copyright &copy; 2001 
<a href="http://www.trolltech.com">Trolltech</a><td><a href="http://www.trolltech.com/trademarks.html">Trademarks</a>
<td align=right><div align=right>Qt version 3.0.2</div>
</table></div></address></body>
</html>