📄 fileselector.html
字号:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"><!-- /home/edba/dist/qtopia/main-Sunday/qtopia/src/libraries/qtopia/fileselector.cpp:380 --><html><head><meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"><title>FileSelector 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><td width="200" align="left" valign="top"><a href="index.html"><img height="27" width="472" src="dochead.png" border="0"></a><br><font face="Arial,Helvetica,Geneva,Swiss,SunSans-Regular" align="center" size=32>Qtopia</font> <a href="index.html">Home</a> - <a href="qtopiaclasses.html">Classes</a> - <a href="qtopiaannotated.html">Annotated</a> - <a href="qtopiafunctions.html">Functions</a> - <a href="qtindex.html">Qt Embedded</a></td><td align="right" valign="top"> <table border="0" cellpadding="0" cellspacing="0" width="137"> <tr> <td><a href="http://www.trolltech.com/company/about/trolls.html"><img height="100" width="100" src="face.png" border="0"></a></td> <td><img height="100" width="100" src="qtlogo.png" align="top" border="0"></td> </tr> </table></td></tr></table><h1 align=center>FileSelector Class Reference</h1><p>The FileSelector widget allows the user to select DocLnk objects.<a href="#details">More...</a><p><tt>#include <<a href="fileselector-h.html">fileselector.h</a>></tt><p><a href="fileselector-members.html">List of all member functions.</a><h2>Public Members</h2><ul><li><div class=fn><a href="#FileSelector"><b>FileSelector</b></a> ( const QString & f, QWidget * parent, const char * name = 0, bool newVisible = TRUE, bool closeVisible = TRUE )</div></li><li><div class=fn><a href="#~FileSelector"><b>~FileSelector</b></a> ()</div></li><li><div class=fn>void <a href="#setNewVisible"><b>setNewVisible</b></a> ( bool b )</div></li><li><div class=fn>void <a href="#setCloseVisible"><b>setCloseVisible</b></a> ( bool b )</div></li><li><div class=fn>int <a href="#fileCount"><b>fileCount</b></a> ()</div></li><li><div class=fn>DocLnk <a href="#selectedDocument"><b>selectedDocument</b></a> () const</div></li><li><div class=fn>QValueList<DocLnk> <a href="#fileList"><b>fileList</b></a> () const</div></li><li><div class=fn>void <a href="#reread"><b>reread</b></a> ()</div></li><li><div class=fn>void <b>addOptions</b> ( QPopupMenu * m )</div></li></ul><h2>Signals</h2><ul><li><div class=fn>void <a href="#fileSelected"><b>fileSelected</b></a> ( const DocLnk & f )</div></li><li><div class=fn>void <a href="#newSelected"><b>newSelected</b></a> ( const DocLnk & f )</div></li><li><div class=fn>void <a href="#closeMe"><b>closeMe</b></a> ()</div></li><li><div class=fn>void <a href="#typeChanged"><b>typeChanged</b></a> ( void )</div></li><li><div class=fn>void <a href="#categoryChanged"><b>categoryChanged</b></a> ( void )</div></li></ul><hr><a name="details"></a><h2>Detailed Description</h2>The FileSelector widget allows the user to select <a href="doclnk.html">DocLnk</a> objects.<p> This class presents a file selection dialog to the user. This widgetis usually the first widget seen in a <a href="docwidget.html">document-oriented application</a>. The developer will most oftencreate this widget in combination with a <ahref="qwidgetstack.html"> QWidgetStack</a> and the appropriateeditor and/or viewer widget for their application. This widgetshould be shown first and the user can the select which documentthey wish to operate on. Please refer to the implementation oftexteditor for an example of how to tie these classes together.<p> Use <a href="#setNewVisible">setNewVisible</a>() depending on whether the application can be usedto create new files or not. Use <a href="#setCloseVisible">setCloseVisible</a>() depending onwhether the user may leave the dialog without creating or selectinga document or not. The number of files in the view is available from<a href="#fileCount">fileCount</a>(). To force the view to be updated call <a href="#reread">reread</a>().<p> If the user presses the 'New' button the <a href="#newSelected">newSelected</a>()signal is emitted. If the user selects an existing file the<a href="#fileSelected">fileSelected</a>() signal is emitted. The selected file's <a href="doclnk.html">DocLnk</a> is available from the selected()function. If the file selector is no longer necessary the <a href="#closeMe">closeMe</a>()signal is emitted.<p> The <a href="#typeChanged">typeChanged</a>() and <a href="#categoryChanged">categoryChanged</a>() signals are emitted wheneither a different file type or category are selected. Note thatin Qtopia 1.5.0, there were no selectors for this, so these signalsare never emitted on that platform.<p> <p>See also <a href="filemanager.html">FileManager</a> and <a href="qtopiaemb.html">Qtopia Classes</a>.<hr><h2>Member Function Documentation</h2><h3 class=fn><a name="FileSelector"></a>FileSelector::FileSelector ( const QString & f, QWidget * parent, const char * name = 0, bool newVisible = TRUE, bool closeVisible = TRUE )</h3>Constructs a FileSelector with mime filter <em>f</em>.The standard Qt <em>parent</em> and <em>name</em> parameters are passed to theparent widget.<p> If <em>newVisible</em> is TRUE, the widget has a button to allow the userthe create "new" documents; this is useful for applications that cancreate and edit documents but not suitable for applications thatonly provide viewing.<p> <em>closeVisible</em> is deprecated<p> <p>See also <a href="doclnkset.html#DocLnkSet">DocLnkSet::DocLnkSet</a>().<h3 class=fn><a name="~FileSelector"></a>FileSelector::~FileSelector ()</h3>Destroys the widget.<h3 class=fn>void <a name="categoryChanged"></a>FileSelector::categoryChanged ( void )<tt> [signal]</tt></h3> This signal is emitted when a different category is selected.<h3 class=fn>void <a name="closeMe"></a>FileSelector::closeMe ()<tt> [signal]</tt></h3><p> This signal is emitted when the user no longer needs to view the widget.<h3 class=fn>int <a name="fileCount"></a>FileSelector::fileCount ()</h3>Returns the number of files in the view. If this is zero, an editorapplication might bypass the selector and immediately start witha "new" document.<h3 class=fn>QValueList<DocLnk> <a name="fileList"></a>FileSelector::fileList () const</h3>Returns a list of all documents.<p> First availability: Qtopia 1.6<h3 class=fn>void <a name="fileSelected"></a>FileSelector::fileSelected ( const <a href="doclnk.html">DocLnk</a> & f )<tt> [signal]</tt></h3><p> This signal is emitted when the user selects a document.<em>f</em> is the document.<h3 class=fn>void <a name="newSelected"></a>FileSelector::newSelected ( const <a href="doclnk.html">DocLnk</a> & f )<tt> [signal]</tt></h3><p> This signal is emitted when the user selects a "new" document.<em>f</em> is a <a href="doclnk.html">DocLnk</a> for the document. You will need to set the typeof the document after copying it.<h3 class=fn>void <a name="reread"></a>FileSelector::reread ()</h3>Rereads the list of documents.<h3 class=fn><a href="doclnk.html">DocLnk</a> <a name="selectedDocument"></a>FileSelector::selectedDocument () const</h3>Returns the selected <a href="doclnk.html">DocLnk</a>,or a null <a href="doclnk.html">DocLnk</a> is none is selected.<p> First availability: Qtopia 1.6<h3 class=fn>void <a name="setCloseVisible"></a>FileSelector::setCloseVisible ( bool b )</h3>If <em>b</em> is TRUE a "close" or "no document" button is visible; if <em>b</em> is FALSE this button is not visible and the user is unable toleave the dialog without creating or selecting a document.<p> This function is deprecated.<h3 class=fn>void <a name="setNewVisible"></a>FileSelector::setNewVisible ( bool b )</h3>If <em>b</em> is TRUE a "new document" entry is visible; if <em>b</em> is FALSEthis entry is not visible and the user is unable to create newdocuments from the dialog.<h3 class=fn>void <a name="typeChanged"></a>FileSelector::typeChanged ( void )<tt> [signal]</tt></h3> This signal is emitted when a different file type is selected.<!-- eof --><hr><p>This file is part of the <a href="../index.html">Qtopia</a> platform,copyright © 1995-2004<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 © 2001-2004 Trolltech<td><a href="http://www.trolltech.com/trademarks.html">Trademarks</a><td align="right"><div align="right">Qtopia version 2.0.0</div></table></div></address></body></html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -