~oif-team/ubuntu/natty/qt4-x11/xi2.1

« back to all changes in this revision

Viewing changes to doc/html/tools-completer-mainwindow-cpp.html

  • Committer: Bazaar Package Importer
  • Author(s): Jonathan Riddell
  • Date: 2008-08-01 11:30:30 UTC
  • mto: (15.1.1 lenny) (1.3.1 upstream)
  • mto: This revision was merged to the branch mainline in revision 55.
  • Revision ID: james.westby@ubuntu.com-20080801113030-c33y1z0l21t6cj5r
Tags: upstream-4.4.1
ImportĀ upstreamĀ versionĀ 4.4.1

Show diffs side-by-side

added added

removed removed

Lines of Context:
163
163
     if (!fileName.contains(QLatin1String("countries.txt")))
164
164
         return new QStringListModel(words, completer);
165
165
 
166
 
     <span class="comment">//</span> The last two chars of the countries.txt file indicate the country
167
 
     <span class="comment">//</span> symbol. We put that in column 2 of a standard item model
 
166
     <span class="comment">// The last two chars of the countries.txt file indicate the country</span>
 
167
     <span class="comment">// symbol. We put that in column 2 of a standard item model</span>
168
168
     QStandardItemModel *m = new QStandardItemModel(words.count(), 2, completer);
169
169
     for (int i = 0; i &lt; words.count(); ++i) {
170
170
         QModelIndex countryIdx = m-&gt;index(i, 0);
204
204
     switch (modelCombo-&gt;currentIndex()) {
205
205
     default:
206
206
     case 0:
207
 
         { <span class="comment">//</span> Unsorted QDirModel
 
207
         { <span class="comment">// Unsorted QDirModel</span>
208
208
             QDirModel *dirModel = new QDirModel(completer);
209
209
             completer-&gt;setModel(dirModel);
210
210
             contentsLabel-&gt;setText(tr(&quot;Enter file path&quot;));
211
211
         }
212
212
         break;
213
213
     case 1:
214
 
         { <span class="comment">//</span> DirModel that shows full paths
 
214
         { <span class="comment">// DirModel that shows full paths</span>
215
215
             DirModel *dirModel = new DirModel(completer);
216
216
             completer-&gt;setModel(dirModel);
217
217
             contentsLabel-&gt;setText(tr(&quot;Enter file path&quot;));
218
218
         }
219
219
         break;
220
220
     case 2:
221
 
         { <span class="comment">//</span> Country List
 
221
         { <span class="comment">// Country List</span>
222
222
             completer-&gt;setModel(modelFromFile(&quot;:/resources/countries.txt&quot;));
223
223
             QTreeView *treeView = new QTreeView;
224
224
             completer-&gt;setPopup(treeView);
231
231
         }
232
232
         break;
233
233
     case 3:
234
 
         { <span class="comment">//</span> Word list
 
234
         { <span class="comment">// Word list</span>
235
235
             completer-&gt;setModel(modelFromFile(&quot;:/resources/wordlist.txt&quot;));
236
236
             completer-&gt;setModelSorting(QCompleter::CaseInsensitivelySortedModel);
237
237
             contentsLabel-&gt;setText(tr(&quot;Enter a word&quot;));
255
255
<table width="100%" cellspacing="0" border="0"><tr class="address">
256
256
<td width="30%">Copyright &copy; 2008 <a href="trolltech.html">Trolltech</a></td>
257
257
<td width="40%" align="center"><a href="trademarks.html">Trademarks</a></td>
258
 
<td width="30%" align="right"><div align="right">Qt 4.4.0</div></td>
 
258
<td width="30%" align="right"><div align="right">Qt 4.4.1</div></td>
259
259
</tr></table></div></address></body>
260
260
</html>