- Extending Qt Creator Manual
- QtCreator
- SessionManager
- Extending Qt Creator Manual 12.0.1

# SessionManager Class

class Core::SessionManager

The SessionManager class manages sessions. More...

Header: | #include <SessionManager>

- List of all members, including inherited members

## Static Public Members

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()

## Detailed Description

TODO the interface of this class is not really great. The implementation suffers from that all the functions from the public interface just wrap around functions which do the actual work. This could be improved.

## Member Function Documentation

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

Shows a dialog asking the user to confirm the deletion of the specified sessions.

Returns whether the user confirmed the deletion.

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

Creates session, but does not actually create the file.

Returns whether the creation was successful.

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

Deletes session name from session list and the file from disk.

Returns whether the deletion was successful.

### `[static]` QString SessionManager::lastSession()

Returns the last session that was opened by the user.

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

Lets other plugins store persistent values specified by name and value within the session file.

### `[static]` QString SessionManager::startupSession()

Returns the session that was active when Qt Creator was last closed, if any.