Extending Qt Creator Manual | IDevice

Extending Qt Creator Manual 4.4.0

# IDevice Class

(ProjectExplorer::IDevice)

The IDevice class is the base class for all devices. More...

Header: | #include <IDevice>

- List of all members, including inherited members

## Public Types

class | DeviceInfoItem
typedef | ConstPtr
enum | ControlChannelHint { QmlControlChannel }
typedef | DeviceInfo
enum | DeviceState { DeviceReadyToUse, DeviceConnected, DeviceDisconnected, DeviceStateUnknown }
enum | MachineType { Hardware, Emulator }
enum | Origin { ManuallyAdded, AutoDetected }
typedef | Ptr

## Public Functions

virtual | ~IDevice()
virtual QList<Core::Id> | actionIds() const = 0
virtual bool | canAutoDetectPorts() const
virtual bool | canCreateProcess() const
virtual bool | canCreateProcessModel() const
virtual Ptr | clone() const = 0
virtual DeviceTester * | createDeviceTester() const
virtual DeviceProcess * | createProcess(QObject *parent) const
virtual DeviceProcessList * | createProcessListModel(QObject *parent = 0) const
virtual IDeviceWidget * | createWidget() = 0
QString | debugServerPath() const
virtual DeviceInfo | deviceInformation() const
DeviceState | deviceState() const
QString | deviceStateToString() const
QString | displayName() const
virtual QString | displayNameForActionId(Core::Id actionId) const = 0
virtual QString | displayType() const = 0
virtual DeviceEnvironmentFetcher::Ptr | environmentFetcher() const
virtual void | executeAction(Core::Id actionId, QWidget *parent = 0) = 0
Utils::PortList | freePorts() const
virtual void | fromMap(const QVariantMap &map)
virtual bool | hasDeviceTester() const
Core::Id | id() const
bool | isAutoDetected() const
virtual bool | isCompatibleWith(const Kit *k) const
MachineType | machineType() const
virtual Utils::OsType | osType() const
virtual PortsGatheringMethod::Ptr | portsGatheringMethod() const
void | setDebugServerPath(const QString &path)
void | setDeviceState(const DeviceState state)
void | setDisplayName(const QString &name)
void | setFreePorts(const Utils::PortList &freePorts)
void | setSshParameters(const QSsh::SshConnectionParameters &sshParameters)
virtual DeviceProcessSignalOperation::Ptr | signalOperation() const = 0
QSsh::SshConnectionParameters | sshParameters() const
virtual QVariantMap | toMap() const
virtual QUrl | toolControlChannel(const ControlChannelHint &) const
Core::Id | type() const
virtual std::function<RunWorker *( RunControl * ) > | workerCreator(Core::Id) const

## Static Public Members

QString | defaultPrivateKeyFilePath()
QString | defaultPublicKeyFilePath()
Core::Id | idFromMap(const QVariantMap &map)
Core::Id | typeFromMap(const QVariantMap &map)

## Protected Functions

| IDevice()
| IDevice(Core::Id type, Origin origin, MachineType machineType, Core::Id id = Core::Id())
| IDevice(const IDevice &other)

## Detailed Description

The IDevice class is the base class for all devices.

The term device refers to some host to which files can be deployed or on which an application can run, for example. In the typical case, this would be some sort of embedded computer connected in some way to the PC on which Qt Creator runs. This class itself does not specify a connection protocol; that kind of detail is to be added by subclasses. Devices are managed by a `DeviceManager`.

See also ProjectExplorer::DeviceManager.

## Member Type Documentation

### typedef IDevice::ConstPtr

### enum IDevice::ControlChannelHint

### typedef IDevice::DeviceInfo

### enum IDevice::DeviceState

### enum IDevice::MachineType

### enum IDevice::Origin

### typedef IDevice::Ptr

## Member Function Documentation

### `[protected]` IDevice::IDevice()

Default constructs an instance of IDevice.

### `[protected]` IDevice::IDevice(Core::Id type, Origin origin, MachineType machineType, Core::Id id = Core::Id())

Default constructs an instance of IDevice.

### `[protected]` IDevice::IDevice(const IDevice &other)

Copy constructor.

### `[virtual]` IDevice::~IDevice()

Destroys the instance of IDevice. The destructor is virtual.

### `[pure virtual]` QList<Core::Id> IDevice::actionIds() const

Returns a list of ids representing actions that can be run on this device. These actions will be available in the Devices options page.

### `[virtual]` bool IDevice::canAutoDetectPorts() const

### `[virtual]` bool IDevice::canCreateProcess() const

### `[virtual]` bool IDevice::canCreateProcessModel() const

### `[pure virtual]` Ptr IDevice::clone() const

Creates an identical copy of a device object.

### `[virtual]` DeviceTester *IDevice::createDeviceTester() const

### `[virtual]` DeviceProcess *IDevice::createProcess(QObject *parent) const

### `[virtual]` DeviceProcessList *IDevice::createProcessListModel(QObject *parent = 0) const

### `[pure virtual]` IDeviceWidget *IDevice::createWidget()

Creates a widget that displays device information not part of the IDevice base class. The widget can also be used to let the user change these attributes.

### QString IDevice::debugServerPath() const

See also setDebugServerPath().

### `[static]` QString IDevice::defaultPrivateKeyFilePath()

### `[static]` QString IDevice::defaultPublicKeyFilePath()

### `[virtual]` DeviceInfo IDevice::deviceInformation() const

### DeviceState IDevice::deviceState() const

See also setDeviceState().

### QString IDevice::deviceStateToString() const

### QString IDevice::displayName() const

Specifies a free-text name for the device to be displayed in GUI elements.

See also setDisplayName().

### `[pure virtual]` QString IDevice::displayNameForActionId(Core::Id actionId) const

A human-readable string for actionId. Will be displayed on a button which, when clicked, starts the respective action.

### `[pure virtual]` QString IDevice::displayType() const

Prints a representation of the device's type suitable for displaying to a user.

### `[virtual]` DeviceEnvironmentFetcher::Ptr IDevice::environmentFetcher() const

### `[pure virtual]` void IDevice::executeAction(Core::Id actionId, QWidget *parent = 0)

### Utils::PortList IDevice::freePorts() const

See also setFreePorts().

### `[virtual]` void IDevice::fromMap(const QVariantMap &map)

Restores a device object from a serialized state as written by toMap(). If subclasses override this to restore additional state, they must call the base class implementation.

### `[virtual]` bool IDevice::hasDeviceTester() const

### Core::Id IDevice::id() const

Identifies the device. If an id is given when constructing a device then this id is used. Otherwise, a UUID is generated and used to identity the device.

See also ProjectExplorer::DeviceManager::findInactiveAutoDetectedDevice().

### `[static]` Core::Id IDevice::idFromMap(const QVariantMap &map)

### bool IDevice::isAutoDetected() const

Returns `true` if the device has been added via some sort of auto-detection mechanism. Devices that are not auto-detected can only ever be created interactively from the Options page. This attribute is immutable.

See also DeviceSettingsWidget.

### `[virtual]` bool IDevice::isCompatibleWith(const Kit *k) const

Tests whether a device can be compatible with the given kit. The default implementation will match the device type specified in the kit against the device's own type.

### MachineType IDevice::machineType() const

### `[virtual]` Utils::OsType IDevice::osType() const

### `[virtual]` PortsGatheringMethod::Ptr IDevice::portsGatheringMethod() const

### void IDevice::setDebugServerPath(const QString &path)

See also debugServerPath().

### void IDevice::setDeviceState(const DeviceState state)

See also deviceState().

### void IDevice::setDisplayName(const QString &name)

See also displayName().

### void IDevice::setFreePorts(const Utils::PortList &freePorts)

See also freePorts().

### void IDevice::setSshParameters(const QSsh::SshConnectionParameters &sshParameters)

See also sshParameters().

### `[pure virtual]` DeviceProcessSignalOperation::Ptr IDevice::signalOperation() const

### QSsh::SshConnectionParameters IDevice::sshParameters() const

See also setSshParameters().

### `[virtual]` QVariantMap IDevice::toMap() const

Serializes a device object, for example to save it to a file. If subclasses override this function to save additional state, they must call the base class implementation.

### `[virtual]` QUrl IDevice::toolControlChannel(const ControlChannelHint &) const

### Core::Id IDevice::type() const

Identifies the type of the device. Devices with the same type share certain abilities. This attribute is immutable.

See also ProjectExplorer::IDeviceFactory.

### `[static]` Core::Id IDevice::typeFromMap(const QVariantMap &map)

### `[virtual]` std::function<RunWorker *( RunControl * ) > IDevice::workerCreator(Core::Id) const