本页内容

Core::SessionManager Class

class Core::SessionManager

SessionManager 类用于管理会话。更多内容...

Header: #include <SessionManager>
Inherits: QObject

静态公共成员

bool confirmSessionDelete(const QStringList &sessions)
bool createSession(const QString &session)
bool deleteSession(const QString &session)
QString lastSession()
void setValue(const Utils::Key &name, const QVariant &value)
QString startupSession()

详细描述

待办事项:该类的接口设计并不理想。其实现存在的问题在于,公共接口中的所有函数仅仅是封装了执行实际工作的函数。这一点尚有改进空间。

成员函数文档

[static] bool SessionManager::confirmSessionDelete(const QStringList &sessions)

显示一个对话框,提示用户确认是否删除指定的sessions 。

返回用户是否已确认删除。

[static] bool SessionManager::createSession(const QString &session)

创建session ,但实际上并未创建该文件。

返回文件创建是否成功。

[static] bool SessionManager::deleteSession(const QString &session)

从会话列表中删除session 名称,并从磁盘中删除该文件。

返回删除是否成功。

[static] QString SessionManager::lastSession()

返回用户最近打开的会话。

[static] void SessionManager::setValue(const Utils::Key &name, const QVariant &value)

允许其他插件将由 `name ` 和 `value ` 指定的持久化值存储在会话文件中。

[static] QString SessionManager::startupSession()

返回上次关闭Qt Creator 时处于活动状态的会话(如有)。

Copyright © The Qt Company Ltd. and other contributors. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. 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.