Sophie

Sophie

distrib > Mageia > 7 > x86_64 > by-pkgid > 1dd17e0d683ef79b4bb6872bbf359d7f > files > 6913

qt4-doc-4.8.7-26.2.mga7.noarch.rpm

<?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" />
<!-- qtranslator.cpp -->
  <title>Qt 4.8: QTranslator 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 &amp; 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>&nbsp;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 &amp; 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>QTranslator</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="#details">Detailed Description</a></li>
<li class="level2"><a href="#looking-up-translations">Looking up Translations</a></li>
<li class="level2"><a href="#using-multiple-translations">Using Multiple Translations</a></li>
</ul>
</div>
<h1 class="title">QTranslator Class Reference</h1>
<!-- $$$QTranslator-brief -->
<p>The QTranslator class provides internationalization support for text output. <a href="#details">More...</a></p>
<!-- @@@QTranslator -->
<pre class="cpp"> <span class="preprocessor">#include &lt;QTranslator&gt;</span></pre><p><b>Inherits: </b><a href="qobject.html">QObject</a>.</p>
<ul>
<li><a href="qtranslator-members.html">List of all members, including inherited members</a></li>
<li><a href="qtranslator-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="qtranslator.html#QTranslator">QTranslator</a></b> ( QObject * <i>parent</i> = 0 )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> </td><td class="memItemRight bottomAlign"><b><a href="qtranslator.html#dtor.QTranslator">~QTranslator</a></b> ()</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> virtual bool </td><td class="memItemRight bottomAlign"><b><a href="qtranslator.html#isEmpty">isEmpty</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qtranslator.html#load">load</a></b> ( const QString &amp; <i>filename</i>, const QString &amp; <i>directory</i> = QString(), const QString &amp; <i>search_delimiters</i> = QString(), const QString &amp; <i>suffix</i> = QString() )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qtranslator.html#load-2">load</a></b> ( const QLocale &amp; <i>locale</i>, const QString &amp; <i>filename</i>, const QString &amp; <i>prefix</i> = QString(), const QString &amp; <i>directory</i> = QString(), const QString &amp; <i>suffix</i> = QString() )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qtranslator.html#load-3">load</a></b> ( const uchar * <i>data</i>, int <i>len</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> virtual QString </td><td class="memItemRight bottomAlign"><b><a href="qtranslator.html#translate">translate</a></b> ( const char * <i>context</i>, const char * <i>sourceText</i>, const char * <i>disambiguation</i> = 0 ) const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QString </td><td class="memItemRight bottomAlign"><b><a href="qtranslator.html#translate-2">translate</a></b> ( const char * <i>context</i>, const char * <i>sourceText</i>, const char * <i>disambiguation</i>, int <i>n</i> ) const</td></tr>
</table>
<ul>
<li class="fn">29 public functions inherited from <a href="qobject.html#public-functions">QObject</a></li>
</ul>
<h3>Additional Inherited Members</h3>
<ul>
<li class="fn">1 property inherited from <a href="qobject.html#properties">QObject</a></li>
<li class="fn">1 public slot inherited from <a href="qobject.html#public-slots">QObject</a></li>
<li class="fn">1 signal inherited from <a href="qobject.html#signals">QObject</a></li>
<li class="fn">7 static public members inherited from <a href="qobject.html#static-public-members">QObject</a></li>
<li class="fn">8 protected functions inherited from <a href="qobject.html#protected-functions">QObject</a></li>
</ul>
<a name="details"></a>
<!-- $$$QTranslator-description -->
<div class="descr">
<h2>Detailed Description</h2>
<p>The QTranslator class provides internationalization support for text output.</p>
<p>An object of this class contains a set of translations from a source language to a target language. QTranslator provides functions to look up translations in a translation file. Translation files are created using <a href="linguist-manual.html#qt-linguist">Qt Linguist</a>.</p>
<p>The most common use of QTranslator is to: load a translation file, install it using <a href="qcoreapplication.html#installTranslator">QApplication::installTranslator</a>(), and use it via <a href="qobject.html#tr">QObject::tr</a>(). Here's the <tt>main()</tt> function from the <a href="linguist-hellotr.html">Hello tr()</a> example:</p>
<pre class="cpp"> <span class="type">int</span> main(<span class="type">int</span> argc<span class="operator">,</span> <span class="type">char</span> <span class="operator">*</span>argv<span class="operator">[</span><span class="operator">]</span>)
 {
     <span class="type"><a href="qapplication.html">QApplication</a></span> app(argc<span class="operator">,</span> argv);

     <span class="type">QTranslator</span> translator;
     translator<span class="operator">.</span>load(<span class="string">&quot;hellotr_la&quot;</span>);
     app<span class="operator">.</span>installTranslator(<span class="operator">&amp;</span>translator);

     <span class="type"><a href="qpushbutton.html">QPushButton</a></span> hello(<span class="type"><a href="qpushbutton.html">QPushButton</a></span><span class="operator">::</span>tr(<span class="string">&quot;Hello world!&quot;</span>));
     hello<span class="operator">.</span>resize(<span class="number">100</span><span class="operator">,</span> <span class="number">30</span>);

     hello<span class="operator">.</span>show();
     <span class="keyword">return</span> app<span class="operator">.</span>exec();
 }</pre>
<p>Note that the translator must be created <i>before</i> the application's widgets.</p>
<p>Most applications will never need to do anything else with this class. The other functions provided by this class are useful for applications that work on translator files.</p>
<a name="looking-up-translations"></a>
<h3>Looking up Translations</h3>
<p>It is possible to look up a translation using <a href="qtranslator.html#translate">translate</a>() (as <a href="qobject.html#tr">tr</a>() and <a href="qcoreapplication.html#translate">QApplication::translate</a>() do). The <a href="qtranslator.html#translate">translate</a>() function takes up to three parameters:</p>
<ul>
<li>The <i>context</i> - usually the class name for the <a href="qobject.html#tr">tr</a>() caller.</li>
<li>The <i>source text</i> - usually the argument to <a href="qobject.html#tr">tr</a>().</li>
<li>The <i>disambiguation</i> - an optional string that helps disambiguate different uses of the same text in the same context.</li>
</ul>
<p>For example, the &quot;Cancel&quot; in a dialog might have &quot;Anuluj&quot; when the program runs in Polish (in this case the source text would be &quot;Cancel&quot;). The context would (normally) be the dialog's class name; there would normally be no comment, and the translated text would be &quot;Anuluj&quot;.</p>
<p>But it's not always so simple. The Spanish version of a printer dialog with settings for two-sided printing and binding would probably require both &quot;Activado&quot; and &quot;Activada&quot; as translations for &quot;Enabled&quot;. In this case the source text would be &quot;Enabled&quot; in both cases, and the context would be the dialog's class name, but the two items would have disambiguations such as &quot;two-sided printing&quot; for one and &quot;binding&quot; for the other. The disambiguation enables the translator to choose the appropriate gender for the Spanish version, and enables Qt to distinguish between translations.</p>
<a name="using-multiple-translations"></a>
<h3>Using Multiple Translations</h3>
<p>Multiple translation files can be installed in an application. Translations are searched for in the reverse order in which they were installed, so the most recently installed translation file is searched for translations first and the earliest translation file is searched last. The search stops as soon as a translation containing a matching string is found.</p>
<p>This mechanism makes it possible for a specific translation to be &quot;selected&quot; or given priority over the others; simply uninstall the translator from the application by passing it to the <a href="qcoreapplication.html#removeTranslator">QApplication::removeTranslator</a>() function and reinstall it with <a href="qcoreapplication.html#installTranslator">QApplication::installTranslator</a>(). It will then be the first translation to be searched for matching strings.</p>
</div>
<p><b>See also </b><a href="qcoreapplication.html#installTranslator">QApplication::installTranslator</a>(), <a href="qcoreapplication.html#removeTranslator">QApplication::removeTranslator</a>(), <a href="qobject.html#tr">QObject::tr</a>(), <a href="qcoreapplication.html#translate">QApplication::translate</a>(), <a href="tools-i18n.html">I18N Example</a>, <a href="linguist-hellotr.html">Hello tr</a>() Example, <a href="linguist-arrowpad.html">Arrow Pad Example</a>, and <a href="linguist-trollprint.html">Troll Print Example</a>.</p>
<!-- @@@QTranslator -->
<div class="func">
<h2>Member Function Documentation</h2>
<!-- $$$QTranslator[overload1]$$$QTranslatorQObject* -->
<h3 class="fn"><a name="QTranslator"></a>QTranslator::<span class="name">QTranslator</span> ( <span class="type"><a href="qobject.html">QObject</a></span> * <i>parent</i> = 0 )</h3>
<p>Constructs an empty message file object with parent <i>parent</i> that is not connected to any file.</p>
<!-- @@@QTranslator -->
<!-- $$$~QTranslator[overload1]$$$~QTranslator -->
<h3 class="fn"><a name="dtor.QTranslator"></a>QTranslator::<span class="name">~QTranslator</span> ()</h3>
<p>Destroys the object and frees any allocated resources.</p>
<!-- @@@~QTranslator -->
<!-- $$$isEmpty[overload1]$$$isEmpty -->
<h3 class="fn"><a name="isEmpty"></a><span class="type">bool</span> QTranslator::<span class="name">isEmpty</span> () const<tt> [virtual]</tt></h3>
<p>Returns true if this translator is empty, otherwise returns false. This function works with stripped and unstripped translation files.</p>
<!-- @@@isEmpty -->
<!-- $$$load[overload1]$$$loadconstQString&constQString&constQString&constQString& -->
<h3 class="fn"><a name="load"></a><span class="type">bool</span> QTranslator::<span class="name">load</span> ( const <span class="type"><a href="qstring.html">QString</a></span> &amp; <i>filename</i>, const <span class="type"><a href="qstring.html">QString</a></span> &amp; <i>directory</i> = QString(), const <span class="type"><a href="qstring.html">QString</a></span> &amp; <i>search_delimiters</i> = QString(), const <span class="type"><a href="qstring.html">QString</a></span> &amp; <i>suffix</i> = QString() )</h3>
<p>Loads <i>filename</i> + <i>suffix</i> (&quot;.qm&quot; if the <i>suffix</i> is not specified), which may be an absolute file name or relative to <i>directory</i>. Returns true if the translation is successfully loaded; otherwise returns false.</p>
<p>If <i>directory</i> is not specified, the directory of the application's executable is used (i.e&#x2e;, as <a href="qcoreapplication.html#applicationDirPath">applicationDirPath()</a>).</p>
<p>The previous contents of this translator object are discarded.</p>
<p>If the file name does not exist, other file names are tried in the following order:</p>
<ol class="1">
<li>File name without <i>suffix</i> appended.</li>
<li>File name with text after a character in <i>search_delimiters</i> stripped (&quot;<a href="index.html">_</a>.&quot; is the default for <i>search_delimiters</i> if it is an empty string) and <i>suffix</i>.</li>
<li>File name stripped without <i>suffix</i> appended.</li>
<li>File name stripped further, etc.</li>
</ol>
<p>For example, an application running in the fr_CA locale (French-speaking Canada) might call load(&quot;foo.fr_ca&quot;, &quot;/opt/foolib&quot;). load() would then try to open the first existing readable file from this list:</p>
<ol class="1">
<li><tt>/opt/foolib/foo.fr_ca.qm</tt></li>
<li><tt>/opt/foolib/foo.fr_ca</tt></li>
<li><tt>/opt/foolib/foo.fr.qm</tt></li>
<li><tt>/opt/foolib/foo.fr</tt></li>
<li><tt>/opt/foolib/foo.qm</tt></li>
<li><tt>/opt/foolib/foo</tt></li>
</ol>
<!-- @@@load -->
<!-- $$$load$$$loadconstQLocale&constQString&constQString&constQString&constQString& -->
<h3 class="fn"><a name="load-2"></a><span class="type">bool</span> QTranslator::<span class="name">load</span> ( const <span class="type"><a href="qlocale.html">QLocale</a></span> &amp; <i>locale</i>, const <span class="type"><a href="qstring.html">QString</a></span> &amp; <i>filename</i>, const <span class="type"><a href="qstring.html">QString</a></span> &amp; <i>prefix</i> = QString(), const <span class="type"><a href="qstring.html">QString</a></span> &amp; <i>directory</i> = QString(), const <span class="type"><a href="qstring.html">QString</a></span> &amp; <i>suffix</i> = QString() )</h3>
<p>Loads <i>filename</i> + <i>prefix</i> + <a href="qlocale.html#uiLanguages">ui language name</a> + <i>suffix</i> (&quot;.qm&quot; if the <i>suffix</i> is not specified), which may be an absolute file name or relative to <i>directory</i>. Returns true if the translation is successfully loaded; otherwise returns false.</p>
<p>The previous contents of this translator object are discarded.</p>
<p>If the file name does not exist, other file names are tried in the following order:</p>
<ol class="1">
<li>File name without <i>suffix</i> appended.</li>
<li>File name with ui language part after a &quot;<a href="index.html">_</a>&quot; character stripped and <i>suffix</i>.</li>
<li>File name with ui language part stripped without <i>suffix</i> appended.</li>
<li>File name with ui language part stripped further, etc.</li>
</ol>
<p>For example, an application running in the locale with the following <a href="qlocale.html#uiLanguages">ui languages</a> - &quot;es&quot;, &quot;fr-CA&quot;, &quot;de&quot; might call load(<a href="qlocale.html#system">QLocale::system</a>(), &quot;foo&quot;, &quot;.&quot;, &quot;/opt/foolib&quot;, &quot;.qm&quot;). <a href="qtranslator.html#load">load</a>() would replace '-' (dash) with '<a href="index.html">_</a>' (underscore) in the ui language and then try to open the first existing readable file from this list:</p>
<ol class="1">
<li><tt>/opt/foolib/foo.es.qm</tt></li>
<li><tt>/opt/foolib/foo.es</tt></li>
<li><tt>/opt/foolib/foo.fr_CA.qm</tt></li>
<li><tt>/opt/foolib/foo.fr_CA</tt></li>
<li><tt>/opt/foolib/foo.de.qm</tt></li>
<li><tt>/opt/foolib/foo.de</tt></li>
<li><tt>/opt/foolib/foo.fr.qm</tt></li>
<li><tt>/opt/foolib/foo.fr</tt></li>
<li><tt>/opt/foolib/foo.qm</tt></li>
<li><tt>/opt/foolib/foo</tt>.</li>
<li><tt>/opt/foolib/foo</tt></li>
</ol>
<p>On operating systems where file system is case sensitive, <a href="qtranslator.html">QTranslator</a> also tries to load a lower-cased version of the locale name.</p>
<p>This function was introduced in Qt 4.8.</p>
<!-- @@@load -->
<!-- $$$load$$$loadconstuchar*int -->
<h3 class="fn"><a name="load-3"></a><span class="type">bool</span> QTranslator::<span class="name">load</span> ( const <span class="type"><a href="qtglobal.html#uchar-typedef">uchar</a></span> * <i>data</i>, <span class="type">int</span> <i>len</i> )</h3>
<p>This function overloads <a href="qtranslator.html#load">load</a>().</p>
<p>Loads the QM file data <i>data</i> of length <i>len</i> into the translator.</p>
<p>The data is not copied. The caller must be able to guarantee that <i>data</i> will not be deleted or modified.</p>
<!-- @@@load -->
<!-- $$$translate[overload1]$$$translateconstchar*constchar*constchar* -->
<h3 class="fn"><a name="translate"></a><span class="type"><a href="qstring.html">QString</a></span> QTranslator::<span class="name">translate</span> ( const <span class="type">char</span> * <i>context</i>, const <span class="type">char</span> * <i>sourceText</i>, const <span class="type">char</span> * <i>disambiguation</i> = 0 ) const<tt> [virtual]</tt></h3>
<p>Returns the translation for the key (<i>context</i>, <i>sourceText</i>, <i>disambiguation</i>). If none is found, also tries (<i>context</i>, <i>sourceText</i>, &quot;&quot;). If that still fails, returns an empty string.</p>
<p>If you need to programatically insert translations in to a <a href="qtranslator.html">QTranslator</a>, this function can be reimplemented.</p>
<p><b>See also </b><a href="qtranslator.html#load">load</a>().</p>
<!-- @@@translate -->
<!-- $$$translate$$$translateconstchar*constchar*constchar*int -->
<h3 class="fn"><a name="translate-2"></a><span class="type"><a href="qstring.html">QString</a></span> QTranslator::<span class="name">translate</span> ( const <span class="type">char</span> * <i>context</i>, const <span class="type">char</span> * <i>sourceText</i>, const <span class="type">char</span> * <i>disambiguation</i>, <span class="type">int</span> <i>n</i> ) const</h3>
<p>This function overloads <a href="qtranslator.html#translate">translate</a>().</p>
<p>Returns the translation for the key (<i>context</i>, <i>sourceText</i>, <i>disambiguation</i>). If none is found, also tries (<i>context</i>, <i>sourceText</i>, &quot;&quot;). If that still fails, returns an empty string.</p>
<p>If <i>n</i> is not -1, it is used to choose an appropriate form for the translation (e.g&#x2e; &quot;%n file found&quot; vs. &quot;%n files found&quot;).</p>
<p><b>See also </b><a href="qtranslator.html#load">load</a>().</p>
<!-- @@@translate -->
</div>
      </div>
    </div>
    </div> 
    <div class="ft">
      <span></span>
    </div>
  </div> 
  <div class="footer">
    <p>
      <acronym title="Copyright">&copy;</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>