IDevice Class
(ProjectExplorer::IDevice)The IDevice class is the base class for all devices. More...
Header: | #include <IDevice> |
Public Types
class | DeviceAction |
class | DeviceInfoItem |
enum | ControlChannelHint { QmlControlChannel } |
enum | DeviceState { DeviceReadyToUse, DeviceConnected, DeviceDisconnected, DeviceStateUnknown } |
enum | MachineType { Hardware, Emulator } |
enum | Origin { ManuallyAdded, AutoDetected } |
Public Functions
virtual | ~IDevice() |
void | addDeviceAction(const DeviceAction &deviceAction) |
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 = nullptr) const |
virtual IDeviceWidget * | createWidget() = 0 |
QString | debugServerPath() const |
const QList<DeviceAction> | deviceActions() const |
virtual DeviceInfo | deviceInformation() const |
DeviceState | deviceState() const |
QString | deviceStateToString() const |
QString | displayName() const |
virtual QString | displayType() const = 0 |
virtual DeviceEnvironmentFetcher::Ptr | environmentFetcher() const |
QVariant | extraData(Core::Id kind) const |
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 |
QString | qmlsceneCommand() const |
void | setDebugServerPath(const QString &path) |
void | setDeviceState(const DeviceState state) |
void | setDisplayName(const QString &name) |
void | setExtraData(Core::Id kind, const QVariant &data) |
void | setFreePorts(const Utils::PortList &freePorts) |
void | setMachineType(MachineType machineType) |
void | setQmlsceneCommand(const QString &path) |
void | setSshParameters(const QSsh::SshConnectionParameters &sshParameters) |
void | setType(Core::Id type) |
void | setupId(Origin origin, Core::Id id = Core::Id()) |
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 |
IDevice & | operator=(const IDevice &) = delete |
Static Public Members
QString | defaultPrivateKeyFilePath() |
QString | defaultPublicKeyFilePath() |
Core::Id | idFromMap(const QVariantMap &map) |
Core::Id | typeFromMap(const QVariantMap &map) |
Protected Functions
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
enum IDevice::ControlChannelHint
enum IDevice::DeviceState
enum IDevice::MachineType
enum IDevice::Origin
Member Function Documentation
[protected]
IDevice::IDevice()
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.
void IDevice::addDeviceAction(const DeviceAction &deviceAction)
Adds an 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 = nullptr) 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()
const QList<DeviceAction> IDevice::deviceActions() const
[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::displayType() const
Prints a representation of the device's type suitable for displaying to a user.
[virtual]
DeviceEnvironmentFetcher::Ptr IDevice::environmentFetcher() const
QVariant IDevice::extraData(Core::Id kind) const
See also setExtraData().
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
See also setMachineType().
[virtual]
Utils::OsType IDevice::osType() const
[virtual]
PortsGatheringMethod::Ptr IDevice::portsGatheringMethod() const
QString IDevice::qmlsceneCommand() const
See also setQmlsceneCommand().
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::setExtraData(Core::Id kind, const QVariant &data)
See also extraData().
void IDevice::setFreePorts(const Utils::PortList &freePorts)
See also freePorts().
void IDevice::setMachineType(MachineType machineType)
See also machineType().
void IDevice::setQmlsceneCommand(const QString &path)
See also qmlsceneCommand().
void IDevice::setSshParameters(const QSsh::SshConnectionParameters &sshParameters)
See also sshParameters().
void IDevice::setType(Core::Id type)
See also type().
void IDevice::setupId(Origin origin, Core::Id id = Core::Id())
[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 setType() and ProjectExplorer::IDeviceFactory.
[static]
Core::Id IDevice::typeFromMap(const QVariantMap &map)
[virtual]
std::function<RunWorker *( RunControl * ) > IDevice::workerCreator(Core::Id) const
[delete]
IDevice &IDevice::operator=(const IDevice &)
Copy-assignment operator.