⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 qsessionmanager.html

📁 QT 下载资料仅供参考
💻 HTML
📖 第 1 页 / 共 2 页
字号:
        // do something reasonable instead.    }}</pre> <p> If an error occurred within the application while saving its data,you may want to try <a href="#allowsErrorInteraction">allowsErrorInteraction</a>() instead.<p> <p>See also <a href="qapplication.html#commitData">QApplication::commitData</a>(), <a href="#release">release</a>() and <a href="#cancel">cancel</a>().<h3 class=fn>void <a name="cancel"></a>QSessionManager::cancel ()</h3><p> Tells the session manager to cancel the shutdown process.  Applicationsshould not call this function without first asking the user.<p> <p>See also <a href="#allowsInteraction">allowsInteraction</a>() and <a href="#allowsErrorInteraction">allowsErrorInteraction</a>().<p> <h3 class=fn><a href="qstringlist.html">QStringList</a> <a name="discardCommand"></a>QSessionManager::discardCommand () const</h3><p> Returns the currently set discard command.<p> Note that if you want to iterate over the list, you shoulditerate over a copy, e.g.<pre>    <a href="qstringlist.html">QStringList</a> list = mySession.discardCommand();    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="#setDiscardCommand">setDiscardCommand</a>(), <a href="#restartCommand">restartCommand</a>() and <a href="#setRestartCommand">setRestartCommand</a>().<h3 class=fn>void * <a name="handle"></a>QSessionManager::handle () const</h3><p> X11 only: returns a handle to the current <tt>SmcConnection</tt>.<h3 class=fn>bool <a name="isPhase2"></a>QSessionManager::isPhase2 () const</h3><p> Returns TRUE if the session manager is currently performing a secondsession management phase; otherwise returns FALSE.<p> <p>See also <a href="#requestPhase2">requestPhase2</a>().<h3 class=fn>void <a name="release"></a>QSessionManager::release ()</h3><p> Releases the session manager's interaction semaphore after aninteraction phase.<p> <p>See also <a href="#allowsInteraction">allowsInteraction</a>() and <a href="#allowsErrorInteraction">allowsErrorInteraction</a>().<h3 class=fn>void <a name="requestPhase2"></a>QSessionManager::requestPhase2 ()</h3><p> Requests a second session management phase for the application. Theapplication may then return immediately from the<a href="qapplication.html#commitData">QApplication::commitData</a>() or <a href="qapplication.html#saveState">QApplication::saveState</a>() function,and they will be called again once most or all other applications havefinished their session management.<p> The two phases are useful for applications such as the X11 window managerthat need to store information about another application's windowsand therefore have to wait until these applications have completed theirrespective session management tasks.<p> Note that if another application has requested a second phase itmay get called before, simultaneously with, or after yourapplication's second phase.<p> <p>See also <a href="#isPhase2">isPhase2</a>().<h3 class=fn><a href="qstringlist.html">QStringList</a> <a name="restartCommand"></a>QSessionManager::restartCommand () const</h3><p> Returns the currently set restart command.<p> Note that if you want to iterate over the list, you shoulditerate over a copy, e.g.<pre>    <a href="qstringlist.html">QStringList</a> list = mySession.restartCommand();    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="#setRestartCommand">setRestartCommand</a>() and <a href="#restartHint">restartHint</a>().<h3 class=fn><a href="qsessionmanager.html#RestartHint-enum">RestartHint</a> <a name="restartHint"></a>QSessionManager::restartHint () const</h3><p> Returns the application's current restart hint. The default is<a href="#RestartHint-enum">RestartIfRunning</a>.<p> <p>See also <a href="#setRestartHint">setRestartHint</a>().<h3 class=fn><a href="qstring.html">QString</a> <a name="sessionId"></a>QSessionManager::sessionId () const</h3><p> Returns the identifier of the current session.<p> If the application has been restored from an earlier session, thisidentifier is the same as it was in that earlier session.<p> <p>See also <a href="qapplication.html#sessionId">QApplication::sessionId</a>().<h3 class=fn>void <a name="setDiscardCommand"></a>QSessionManager::setDiscardCommand ( const&nbsp;<a href="qstringlist.html">QStringList</a>&nbsp;&amp; )</h3><p> <p>See also <a href="#discardCommand">discardCommand</a>() and <a href="#setRestartCommand">setRestartCommand</a>().<h3 class=fn>void <a name="setManagerProperty"></a>QSessionManager::setManagerProperty ( const&nbsp;<a href="qstring.html">QString</a>&nbsp;&amp;&nbsp;name, const&nbsp;<a href="qstringlist.html">QStringList</a>&nbsp;&amp;&nbsp;value )</h3><p> Low-level write access to the application's identification and staterecord are kept in the session manager.<p> The property called <em>name</em> has its value set to the string list <em>value</em>.<h3 class=fn>void <a name="setManagerProperty-2"></a>QSessionManager::setManagerProperty ( const&nbsp;<a href="qstring.html">QString</a>&nbsp;&amp;&nbsp;name, 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> Low-level write access to the application's identification and staterecords are kept in the session manager.<p> The property called <em>name</em> has its value set to the string <em>value</em>.<h3 class=fn>void <a name="setRestartCommand"></a>QSessionManager::setRestartCommand ( const&nbsp;<a href="qstringlist.html">QStringList</a>&nbsp;&amp;&nbsp;command )</h3><p> If the session manager is capable of restoring sessions it willexecute <em>command</em> in order to restore the application. The commanddefaults to<p> <pre>        appname -session id  </pre> <p> The <tt>-session</tt> option is mandatory; otherwise <a href="qapplication.html">QApplication</a> cannottell whether it has been restored or what the current sessionidentifier is. See <a href="qapplication.html#isSessionRestored">QApplication::isSessionRestored</a>() and<a href="qapplication.html#sessionId">QApplication::sessionId</a>() for details.<p> If your application is very simple, it may be possible to store theentire application state in additional command line options. Thisis usually a very bad idea because command lines are often limitedto a few hundred bytes. Instead, use <a href="qsettings.html">QSettings</a>, or temporary filesor a database for this purpose. By marking the data with the unique<a href="#sessionId">sessionId</a>(), you will be able to restore the application in a futuresession.<p> <p>See also <a href="#restartCommand">restartCommand</a>(), <a href="#setDiscardCommand">setDiscardCommand</a>() and <a href="#setRestartHint">setRestartHint</a>().<h3 class=fn>void <a name="setRestartHint"></a>QSessionManager::setRestartHint ( <a href="qsessionmanager.html#RestartHint-enum">RestartHint</a>&nbsp;hint )</h3><p> Sets the application's restart hint to <em>hint</em>. On applicationstartup the hint is set to <a href="#RestartHint-enum">RestartIfRunning</a>.<p> Note that these flags are only hints, a session manager may or maynot respect them.<p> We recommend setting the restart hint in <a href="qapplication.html#saveState">QApplication::saveState</a>()because most session managers perform a checkpoint shortly after anapplication's startup.<p> <p>See also <a href="#restartHint">restartHint</a>().<!-- eof --><hr><p>This file is part of the <a href="index.html">Qt toolkit</a>.Copyright &copy; 1995-2002<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; 2002 <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.5</div></table></div></address></body></html>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -