- Extending Qt Creator Manual
- QtCreator
- IContext
- Extending Qt Creator Manual 13.0.0-beta1

# IContext Class

class Core::IContext

The IContext class associates a widget with a context list and context help. More...

Header: | #include <coreplugin/icontext.h>
Inherited By: | Core::IEditor and Core::IMode

- List of all members, including inherited members

## Public Functions

| IContext(QObject *parent)

## Detailed Description

An instance of IContext must be registered with Core::ICore::addContextObject() to have an effect. For many subclasses of IContext, like Core::IEditor and Core::IMode, this is done automatically. But instances of IContext can be created manually to associate a context and context help for an arbitrary widget, too. IContext instances are automatically unregistered when they are deleted. Use Core::ICore::removeContextObject() if you need to unregister an IContext instance manually.

Whenever the widget is part of the application wide focus widget's parent chain, the associated context list is made active. This makes actions active that were registered for any of the included context IDs. If the user requests context help, the top-most IContext instance in the focus widget's parent hierarchy is asked to provide it.

See The Action Manager and Commands for an overview of how contexts are used for managing actions.

See also Core::ICore, Core::Context, Core::ActionManager, and The Action Manager and Commands.

## Member Function Documentation

### `[default]` IContext::IContext(QObject *parent)

Creates an IContext with an optional parent.