code
stringlengths
2.5k
150k
kind
stringclasses
1 value
qt KeyboardObserver QML Type KeyboardObserver QML Type ========================= Acts as a hub for keyboard event notifications. [More...](#details) | | | | --- | --- | | Import Statement: | import QtQuick.VirtualKeyboard | | Instantiates: | [QVirtualKeyboardObserver](qvirtualkeyboardobserver) | * [List of all members, including inherited members](https://doc.qt.io/qt-6.2/qml-qtquick-virtualkeyboard-keyboardobserver-members.html) Properties ---------- * **[layout](qml-qtquick-virtualkeyboard-keyboardobserver#layout-prop)** : variant Detailed Description -------------------- Property Documentation ---------------------- ### [read-only] layout : variant The current keyboard layout expressed as a variant. qt QTexture1D Class QTexture1D Class ================ class [Qt3DRender](https://doc.qt.io/qt-6.2/qt3drender-module.html)::QTexture1D A [QAbstractTexture](qt3drender-qabstracttexture) with a Target1D target format. [More...](#details) | | | | --- | --- | | Header: | #include <Qt3DRender/QTexture> | | CMake: | find\_package(Qt6 COMPONENTS 3drender REQUIRED) target\_link\_libraries(mytarget PRIVATE Qt6::3drender) | | qmake: | QT += 3drender | | Since: | Qt 5.5 | | Instantiated By: | [Texture1D](qml-qt3d-render-texture1d) | | Inherits: | [Qt3DRender::QAbstractTexture](qt3drender-qabstracttexture) | * [List of all members, including inherited members](https://doc.qt.io/qt-6.2/qt3drender-qtexture1d-members.html) Public Functions ---------------- | | | | --- | --- | | | **[QTexture1D](qt3drender-qtexture1d#QTexture1D)**(Qt3DCore::QNode \**parent* = nullptr) | Detailed Description -------------------- Member Function Documentation ----------------------------- ### QTexture1D::QTexture1D([Qt3DCore::QNode](qt3dcore-qnode) \**parent* = nullptr) Constructs a new [Qt3DRender::QTexture1D](qt3drender-qtexture1d) instance with *parent* as parent. qt QBluetoothServiceDiscoveryAgent Class QBluetoothServiceDiscoveryAgent Class ===================================== The QBluetoothServiceDiscoveryAgent class enables you to query for Bluetooth services. [More...](#details) | | | | --- | --- | | Header: | #include <QBluetoothServiceDiscoveryAgent> | | qmake: | QT += bluetooth | | Since: | Qt 5.2 | | Inherits: | [QObject](qobject) | * [List of all members, including inherited members](https://doc.qt.io/qt-6.2/qbluetoothservicediscoveryagent-members.html) Public Types ------------ | | | | --- | --- | | enum | **[DiscoveryMode](qbluetoothservicediscoveryagent#DiscoveryMode-enum)** { MinimalDiscovery, FullDiscovery } | | enum | **[Error](qbluetoothservicediscoveryagent#Error-enum)** { NoError, PoweredOffError, InputOutputError, InvalidBluetoothAdapterError, UnknownError } | Public Functions ---------------- | | | | --- | --- | | | **[QBluetoothServiceDiscoveryAgent](qbluetoothservicediscoveryagent#QBluetoothServiceDiscoveryAgent-1)**(const QBluetoothAddress &*deviceAdapter*, QObject \**parent* = nullptr) | | | **[QBluetoothServiceDiscoveryAgent](qbluetoothservicediscoveryagent#QBluetoothServiceDiscoveryAgent)**(QObject \**parent* = nullptr) | | virtual | **[~QBluetoothServiceDiscoveryAgent](qbluetoothservicediscoveryagent#dtor.QBluetoothServiceDiscoveryAgent)**() | | QList<QBluetoothServiceInfo> | **[discoveredServices](qbluetoothservicediscoveryagent#discoveredServices)**() const | | QBluetoothServiceDiscoveryAgent::Error | **[error](qbluetoothservicediscoveryagent#error)**() const | | QString | **[errorString](qbluetoothservicediscoveryagent#errorString)**() const | | bool | **[isActive](qbluetoothservicediscoveryagent#isActive)**() const | | QBluetoothAddress | **[remoteAddress](qbluetoothservicediscoveryagent#remoteAddress)**() const | | bool | **[setRemoteAddress](qbluetoothservicediscoveryagent#setRemoteAddress)**(const QBluetoothAddress &*address*) | | void | **[setUuidFilter](qbluetoothservicediscoveryagent#setUuidFilter)**(const QList<QBluetoothUuid> &*uuids*) | | void | **[setUuidFilter](qbluetoothservicediscoveryagent#setUuidFilter-1)**(const QBluetoothUuid &*uuid*) | | QList<QBluetoothUuid> | **[uuidFilter](qbluetoothservicediscoveryagent#uuidFilter)**() const | Public Slots ------------ | | | | --- | --- | | void | **[clear](qbluetoothservicediscoveryagent#clear)**() | | void | **[start](qbluetoothservicediscoveryagent#start)**(QBluetoothServiceDiscoveryAgent::DiscoveryMode *mode* = MinimalDiscovery) | | void | **[stop](qbluetoothservicediscoveryagent#stop)**() | Signals ------- | | | | --- | --- | | void | **[canceled](qbluetoothservicediscoveryagent#canceled)**() | | void | **[errorOccurred](qbluetoothservicediscoveryagent#errorOccurred)**(QBluetoothServiceDiscoveryAgent::Error *error*) | | void | **[finished](qbluetoothservicediscoveryagent#finished)**() | | void | **[serviceDiscovered](qbluetoothservicediscoveryagent#serviceDiscovered)**(const QBluetoothServiceInfo &*info*) | Detailed Description -------------------- The discovery process relies on the Bluetooth Service Discovery Process (SDP). The following steps are required to query the services provided by all contactable Bluetooth devices: * create an instance of QBluetoothServiceDiscoveryAgent, * connect to either the [serviceDiscovered](qbluetoothservicediscoveryagent#serviceDiscovered)() or [finished](qbluetoothservicediscoveryagent#finished)() signals, * and call [start](qbluetoothservicediscoveryagent#start)(). ``` void MyClass::startServiceDiscovery() { // Create a discovery agent and connect to its signals QBluetoothServiceDiscoveryAgent *discoveryAgent = new QBluetoothServiceDiscoveryAgent(this); connect(discoveryAgent, SIGNAL(serviceDiscovered(QBluetoothServiceInfo)), this, SLOT(serviceDiscovered(QBluetoothServiceInfo))); // Start a discovery discoveryAgent->start(); //... } // In your local slot, read information about the found devices void MyClass::serviceDiscovered(const QBluetoothServiceInfo &service) { qDebug() << "Found new service:" << service.serviceName() << '(' << service.device().address().toString() << ')'; } ``` By default a minimal service discovery is performed. In this mode, the returned [QBluetoothServiceInfo](qbluetoothserviceinfo) objects are guaranteed to contain only device and service UUID information. Depending on platform and device capabilities, other service information may also be available. The minimal service discovery mode relies on cached SDP data of the platform. Therefore it is possible that this discovery does not find a device although it is physically available. In such cases a full discovery must be performed to force an update of the platform cache. However for most use cases a minimal discovery is adequate as it is much quicker and other classes which require up-to-date information such as [QBluetoothSocket::connectToService](qbluetoothsocket#connectToService)() will perform additional discovery if required. If the full service information is required, pass [FullDiscovery](qbluetoothservicediscoveryagent#DiscoveryMode-enum) as the discoveryMode parameter to [start](qbluetoothservicediscoveryagent#start)(). This class may internally utilize [QBluetoothDeviceDiscoveryAgent](qtbluetooth-changes-qt6#qbluetoothdevicediscoveryagent) to find unknown devices. The service discovery may find Bluetooth Low Energy services too if the target device is a combination of a classic and Low Energy device. Those devices are required to advertise their Low Energy services via SDP. If the target device only supports Bluetooth Low Energy services, it is likely to not advertise them via SDP. The [QLowEnergyController](qtbluetooth-changes-qt6#qlowenergycontroller) class should be utilized to perform the service discovery on Low Energy devices. On iOS, this class cannot be used because the platform does not expose an API which may permit access to QBluetoothServiceDiscoveryAgent related features. **See also** [QBluetoothDeviceDiscoveryAgent](qtbluetooth-changes-qt6#qbluetoothdevicediscoveryagent) and [QLowEnergyController](qtbluetooth-changes-qt6#qlowenergycontroller). Member Type Documentation ------------------------- ### enum QBluetoothServiceDiscoveryAgent::DiscoveryMode This enum describes the service discovery mode. | Constant | Value | Description | | --- | --- | --- | | `QBluetoothServiceDiscoveryAgent::MinimalDiscovery` | `0` | Performs a minimal service discovery. The [QBluetoothServiceInfo](qbluetoothserviceinfo) objects returned may be incomplete and are only guaranteed to contain device and service UUID information. Since a minimal discovery relies on cached SDP data it may not find a physically existing device until a `FullDiscovery` is performed. | | `QBluetoothServiceDiscoveryAgent::FullDiscovery` | `1` | Performs a full service discovery. | ### enum QBluetoothServiceDiscoveryAgent::Error This enum describes errors that can occur during service discovery. | Constant | Value | Description | | --- | --- | --- | | `QBluetoothServiceDiscoveryAgent::NoError` | `QBluetoothDeviceDiscoveryAgent::NoError` | No error has occurred. | | `QBluetoothServiceDiscoveryAgent::PoweredOffError` | `QBluetoothDeviceDiscoveryAgent::PoweredOffError` | The Bluetooth adaptor is powered off, power it on before doing discovery. | | `QBluetoothServiceDiscoveryAgent::InputOutputError` | `QBluetoothDeviceDiscoveryAgent::InputOutputError` | Writing or reading from the device resulted in an error. | | `QBluetoothServiceDiscoveryAgent::InvalidBluetoothAdapterError` | `QBluetoothDeviceDiscoveryAgent::InvalidBluetoothAdapterError` | The passed local adapter address does not match the physical adapter address of any local Bluetooth device. This value was introduced by Qt 5.3. | | `QBluetoothServiceDiscoveryAgent::UnknownError` | `QBluetoothDeviceDiscoveryAgent::UnknownError` | An unknown error has occurred. | Member Function Documentation ----------------------------- ### QBluetoothServiceDiscoveryAgent::QBluetoothServiceDiscoveryAgent(const [QBluetoothAddress](qbluetoothaddress) &*deviceAdapter*, [QObject](qobject#QObject) \**parent* = nullptr) Constructs a new QBluetoothServiceDiscoveryAgent for *deviceAdapter* and with *parent*. It uses *deviceAdapter* for the service search. If *deviceAdapter* is default constructed the resulting QBluetoothServiceDiscoveryAgent object will use the local default Bluetooth adapter. If a *deviceAdapter* is specified that is not a local adapter [error](qbluetoothservicediscoveryagent#error)() will be set to [InvalidBluetoothAdapterError](qbluetoothservicediscoveryagent#Error-enum). Therefore it is recommended to test the error flag immediately after using this constructor. **Note:** On WinRT the passed adapter address will be ignored. **Note:** On Android passing any *deviceAdapter* address is meaningless as Android 6.0 or later does not publish the local Bluetooth address anymore. Subsequently, the passed adapter address can never be matched against the local adapter address. Therefore the subsequent call to [start](qbluetoothservicediscoveryagent#start)() will always trigger [InvalidBluetoothAdapterError](qbluetoothservicediscoveryagent#Error-enum). **See also** [error](qbluetoothservicediscoveryagent#error)(). ### QBluetoothServiceDiscoveryAgent::QBluetoothServiceDiscoveryAgent([QObject](qobject#QObject) \**parent* = nullptr) Constructs a new QBluetoothServiceDiscoveryAgent with *parent*. The search is performed via the local default Bluetooth adapter. ### `[signal]` void QBluetoothServiceDiscoveryAgent::canceled() This signal is triggered when the service discovery was canceled via a call to [stop](qbluetoothservicediscoveryagent#stop)(). ### `[slot]` void QBluetoothServiceDiscoveryAgent::clear() Clears the results of previous service discoveries and resets [uuidFilter](qbluetoothservicediscoveryagent#uuidFilter)(). This function does nothing during an ongoing service discovery (see [isActive](qbluetoothservicediscoveryagent#isActive)()). **See also** [discoveredServices](qbluetoothservicediscoveryagent#discoveredServices)(). ### `[signal, since 6.2]` void QBluetoothServiceDiscoveryAgent::errorOccurred([QBluetoothServiceDiscoveryAgent::Error](qbluetoothservicediscoveryagent#Error-enum) *error*) This signal is emitted when an *error* occurs. The *error* parameter describes the error that occurred. This function was introduced in Qt 6.2. ### `[signal]` void QBluetoothServiceDiscoveryAgent::finished() This signal is emitted when the Bluetooth service discovery completes. Unlike the [QBluetoothDeviceDiscoveryAgent::finished](qbluetoothdevicediscoveryagent#finished)() signal this signal will even be emitted when an error occurred during the service discovery. Therefore it is recommended to check the [error](qbluetoothservicediscoveryagent#error)() signal to evaluate the success of the service discovery discovery. ### `[signal]` void QBluetoothServiceDiscoveryAgent::serviceDiscovered(const [QBluetoothServiceInfo](qbluetoothserviceinfo) &*info*) This signal is emitted when the Bluetooth service described by *info* is discovered. **Note:** The passed [QBluetoothServiceInfo](qbluetoothserviceinfo) parameter may contain a Bluetooth Low Energy service if the target device advertises the service via SDP. This is required from device which support both, classic Bluetooth (BaseRate) and Low Energy services. **See also** [QBluetoothDeviceInfo::coreConfigurations](qbluetoothdeviceinfo#coreConfigurations)(). ### `[slot]` void QBluetoothServiceDiscoveryAgent::start([QBluetoothServiceDiscoveryAgent::DiscoveryMode](qbluetoothservicediscoveryagent#DiscoveryMode-enum) *mode* = MinimalDiscovery) Starts service discovery. *mode* specifies the type of service discovery to perform. On some platforms, device discovery may lead to pairing requests. **See also** [DiscoveryMode](qbluetoothservicediscoveryagent#DiscoveryMode-enum). ### `[slot]` void QBluetoothServiceDiscoveryAgent::stop() Stops the service discovery process. The [canceled](qbluetoothservicediscoveryagent#canceled)() signal will be emitted once the search has stopped. ### `[virtual]` QBluetoothServiceDiscoveryAgent::~QBluetoothServiceDiscoveryAgent() Destructor for [QBluetoothServiceDiscoveryAgent](qbluetoothservicediscoveryagent) ### [QList](qlist)<[QBluetoothServiceInfo](qbluetoothserviceinfo)> QBluetoothServiceDiscoveryAgent::discoveredServices() const Returns the list of all discovered services. This list of services accumulates newly discovered services from multiple calls to [start](qbluetoothservicediscoveryagent#start)(). Unless [clear](qbluetoothservicediscoveryagent#clear)() is called the list cannot decrease in size. This implies that if a remote Bluetooth device moves out of range in between two subsequent calls to [start](qbluetoothservicediscoveryagent#start)() the list may contain stale entries. **Note:** The list of services should always be cleared before the discovery mode is changed. **See also** [clear](qbluetoothservicediscoveryagent#clear)(). ### [QBluetoothServiceDiscoveryAgent::Error](qbluetoothservicediscoveryagent#Error-enum) QBluetoothServiceDiscoveryAgent::error() const Returns the type of error that last occurred. If the service discovery is done for a single [remoteAddress](qbluetoothservicediscoveryagent#remoteAddress)() it will return errors that occurred while trying to discover services on that device. If the [remoteAddress](qbluetoothservicediscoveryagent#remoteAddress)() is not set and devices are discovered by a scan, errors during service discovery on individual devices are not saved and no signals are emitted. In this case, errors are fairly normal as some devices may not respond to discovery or may no longer be in range. Such errors are surpressed. If no services are returned, it can be assumed no services could be discovered. ### [QString](qstring) QBluetoothServiceDiscoveryAgent::errorString() const Returns a human-readable description of the last error that occurred during the service discovery. ### bool QBluetoothServiceDiscoveryAgent::isActive() const Returns `true` if the service discovery is currently active; otherwise returns `false`. An active discovery can be stopped by calling [stop](qbluetoothservicediscoveryagent#stop)(). ### [QBluetoothAddress](qbluetoothaddress) QBluetoothServiceDiscoveryAgent::remoteAddress() const Returns the remote device address. If [setRemoteAddress](qbluetoothservicediscoveryagent#setRemoteAddress)() is not called, the function will return a default constructed [QBluetoothAddress](qbluetoothaddress). **See also** [setRemoteAddress](qbluetoothservicediscoveryagent#setRemoteAddress)(). ### bool QBluetoothServiceDiscoveryAgent::setRemoteAddress(const [QBluetoothAddress](qbluetoothaddress) &*address*) Sets the remote device address to *address*. If *address* is default constructed, services will be discovered on all contactable Bluetooth devices. A new remote address can only be set while there is no service discovery in progress; otherwise this function returns false. On some platforms the service discovery might lead to pairing requests. Therefore it is not recommended to do service discoveries on all devices. This function can be used to restrict the service discovery to a particular device. **See also** [remoteAddress](qbluetoothservicediscoveryagent#remoteAddress)(). ### void QBluetoothServiceDiscoveryAgent::setUuidFilter(const [QList](qlist)<[QBluetoothUuid](qbluetoothuuid)> &*uuids*) Sets the UUID filter to *uuids*. Only services matching the UUIDs in *uuids* will be returned. The matching applies to the service's [ServiceId](qbluetoothserviceinfo#AttributeId-enum) and [ServiceClassIds](qbluetoothserviceinfo#AttributeId-enum) attributes. An empty UUID list is equivalent to a list containing only [QBluetoothUuid::ServiceClassUuid::PublicBrowseGroup](qbluetoothuuid#ServiceClassUuid-enum). **See also** [uuidFilter](qbluetoothservicediscoveryagent#uuidFilter)(). ### void QBluetoothServiceDiscoveryAgent::setUuidFilter(const [QBluetoothUuid](qbluetoothuuid) &*uuid*) This is an overloaded member function, provided for convenience. Sets the UUID filter to a list containing the single element *uuid*. The matching applies to the service's [ServiceId](qbluetoothserviceinfo#AttributeId-enum) and [ServiceClassIds](qbluetoothserviceinfo#AttributeId-enum) attributes. **See also** [uuidFilter](qbluetoothservicediscoveryagent#uuidFilter)(). ### [QList](qlist)<[QBluetoothUuid](qbluetoothuuid)> QBluetoothServiceDiscoveryAgent::uuidFilter() const Returns the UUID filter. **See also** [setUuidFilter](qbluetoothservicediscoveryagent#setUuidFilter)(). qt Status Status ====== These commands are for indicating that a documented element has some special status. The element could be marked *deprecated*, that is, it's about to be made obsolete and no longer included in the public interface. The [\since](16-qdoc-commands-status#since-command) command is for specifying the version number in which a function or class first appeared. The [\qmlabstract](16-qdoc-commands-status#qmlabstract-command) command is for marking a QML type as an abstract base class. \abstract and \qmlabstract -------------------------- \abstract is a synonym for the \qmlabstract command. Add this command to the [\qmltype](https://doc.qt.io/qt-6.2/13-qdoc-commands-topics.html#qmltype-command) comment for a QML type when that type is meant to be used *only* as an abstract base type. When a QML type is abstract, it means that the QML type that can't be instantiated. Instead, the properties in its public API are included in the public properties list on the reference page for each QML type that inherits the abstract QML type. The properties are documented as if they are properties of the inheriting QML type. Normally, when a QML type is marked with *\qmlabstract*, it is also marked with *\internal* so that its reference page is not generated. It the abstract QML type is not marked internal, it will have a reference page in the documentation. \default -------- The \default command is used for documenting a default value for a QML property. The command takes a single argument, which is displayed in the documentation as the default value. ``` /*! \qmlproperty real Item::x \default 0.0 */ ``` If the default value is a non-empty string, use quotes: ``` /*! \qmlproperty string Item::state \default "invalid" */ ``` \qmldefault ----------- The \qmldefault command is for marking a QML property as the [default property](qtqml-syntax-objectattributes#default-properties). The word `default` is displayed in the documentation of the property. ``` / *! \qmlproperty list<Change> State::changes This property holds the changes to apply for this state. \qmldefault By default, these changes are applied against the default state. If the state extends another state, then the changes are applied against the state being extended. * / ``` See how QDoc renders this property on the reference page for the [State](qml-qtquick-state#changes-prop) type. \dontdocument ------------- The \dontdocument command is only used in a dontdocument.qdoc file for a particular module. This file specifies publically declared classes or structs that are not meant to be documented. QDoc will not print warnings about missing \class comments for these classes and structs. Below you will find the \dontdocument command in the dontdocument.qdoc for widgets: ``` / *! \dontdocument (QTypeInfo QMetaTypeId) * / ``` \inheaderfile ------------- The \inheaderfile meta-command is used for overriding the include statement generated for a C++ class, namespace, or header file reference documentation. By default, QDoc documents a `\class SomeClass` to be available with a following include statement: ``` #include <SomeClass> ``` If the actual include statement differs from the default, this can be documented as ``` \class SomeClass \inheaderfile Tools/SomeClass ... ``` See also [\class](https://doc.qt.io/qt-6.2/13-qdoc-commands-topics.html#class-command) and [\headerfile](https://doc.qt.io/qt-6.2/13-qdoc-commands-topics.html#headerfile-command). \obsolete --------- The \obsolete command is superceded by the \deprecated command. This command is kept for backwards compatibility reasons only. It may be removed in a future version of QDoc. Use the \deprecated command instead. See also [\deprecated](16-qdoc-commands-status#deprecated-command). \deprecated ----------- The \deprecated command is for indicating that a function is being deprecated, and that it should no longer be used in new code. There is no guarantee for how long it will remain in the library. The \deprecated command takes two optional arguments: * A version in square brackets (e.g. [6.2]). * A string with more information, for example a suggested replacement. When generating the reference documentation for a class, QDoc will create and link to a separate page documenting its deprecated functions. It is good practice to suggest an equivalent function as an alternative. ``` / *! \fn MyClass::MyDeprecatedFunction \deprecated [6.2] Use MyNewFunction() instead. * / ``` QDoc renders this in `myclass-obsolete.html` as: > Deprecated Members for MyClass > ============================== > > **The following class members are deprecated.** We strongly advise against using them in new code. > > ... > > * void MyDeprecatedFunction() `(deprecated)` > * ... > > > > --- > > Member Function Documentation > ----------------------------- > > ### void MyDeprecatedFunction () > > This function is deprecated since 6.2. It is provided to keep old source code working. We strongly advise against using it in new code. Use MyNewFunction() instead. > > ... > > \internal --------- The \internal command indicates that the referenced function is not part of the public interface. The command must stand on its own line. QDoc ignores the documentation as well as the documented item, when generating the associated class reference documentation. ``` / *! \internal Tries to find the decimal separator. If it can't find it and the thousand delimiter is != '.' it will try to find a '.'; * / int QDoubleSpinBoxPrivate::findDelimiter (const QString &str, int index) const { int dotindex = str.indexOf(delimiter, index); if (dotindex == -1 && thousand != dot && delimiter != dot) dotindex = str.indexOf(dot, index); return dotindex; } ``` This function will not be included in the documentation, unless QDoc is called with the `-showinternal` command line option or the `QDOC_SHOW_INTERNAL` environment variable is set. \preliminary ------------ The \preliminary command is for indicating that a referenced function is still under development. The command must stand on its own line. The \preliminary command expands to a notification in the function documentation, and marks the function as preliminary when it appears in lists. ``` / *! \preliminary Returns information about the joining type attributes of the character (needed for certain languages such as Arabic or Syriac). * / QChar::JoiningType QChar::joiningType() const { return QChar::joiningType(ucs); } ``` QDoc renders this as: > ### [JoiningType](http://doc.qt.io/qt-5/qchar.html#JoiningType-enum) QChar::joiningType() const > > **This function is under development and subject to change.** > > Returns information about the joining type attributes of the character (needed for certain languages such as Arabic or Syriac). > > And the function's entry in [QChar](qchar)'s list of public functions will be rendered as: > > * ... > * JoiningType [joiningType](qchar#joiningType)() const `(preliminary)` > * ... > > \readonly --------- The \readonly command is used in conjunction with a [\qmlproperty](https://doc.qt.io/qt-6.2/13-qdoc-commands-topics.html#qmlproperty-command) command to mark the QML property as read-only. \required --------- The \required command is used in conjunction with a [\qmlproperty](https://doc.qt.io/qt-6.2/13-qdoc-commands-topics.html#qmlproperty-command) command to mark the QML property as required. **See also** [The Property System](properties). \since ------ The \since command tells in which minor release the associated functionality was added. ``` / *! \since 4.1 Returns an icon for \a standardIcon. ... \sa standardPixmap() * / QIcon QStyle::standardIcon(StandardPixmap standardIcon, const QStyleOption *option, const QWidget *widget) const { } ``` QDoc renders this as: > ### QIcon QStyle::standardIcon(StandardPixmap standardIcon, const QStyleOption \*option, const QWidget \*widget) const > > This function was introduced in Qt version 4.1 > > Returns an icon for *standardIcon*. > > ... > > See also [standardPixmap](https://doc.qt.io/qt-6.2/qstyle-obsolete.html#standardPixmap)(). > > QDoc generates the "Qt" reference from the [`project`](25-qdoc-configuration-derivedprojects#project) configuration variable. For that reason this reference will change according to the current documentation project. See also [`project`](25-qdoc-configuration-derivedprojects#project).
programming_docs
qt QQmlFileSelector Class QQmlFileSelector Class ====================== A class for applying a [QFileSelector](qfileselector) to QML file loading. [More...](#details) | | | | --- | --- | | Header: | #include <QQmlFileSelector> | | CMake: | find\_package(Qt6 COMPONENTS Qml REQUIRED) target\_link\_libraries(mytarget PRIVATE Qt6::Qml) | | qmake: | QT += qml | | Since: | Qt 5.2 | | Inherits: | [QObject](qobject) | * [List of all members, including inherited members](https://doc.qt.io/qt-6.2/qqmlfileselector-members.html) * [Deprecated members](https://doc.qt.io/qt-6.2/qqmlfileselector-obsolete.html) Public Functions ---------------- | | | | --- | --- | | | **[QQmlFileSelector](qqmlfileselector#QQmlFileSelector)**(QQmlEngine \**engine*, QObject \**parent* = nullptr) | | virtual | **[~QQmlFileSelector](qqmlfileselector#dtor.QQmlFileSelector)**() override | | QFileSelector \* | **[selector](qqmlfileselector#selector)**() const | | void | **[setExtraSelectors](qqmlfileselector#setExtraSelectors)**(const QStringList &*strings*) | | void | **[setSelector](qqmlfileselector#setSelector)**(QFileSelector \**selector*) | Detailed Description -------------------- QQmlFileSelector will automatically apply a [QFileSelector](qfileselector) to qml file and asset paths. It is used as follows: ``` QQmlEngine engine; QQmlFileSelector* selector = new QQmlFileSelector(&engine); ``` Then you can swap out files like so: ``` main.qml Component.qml asset.png +unix/Component.qml +mac/asset.png ``` In this example, main.qml will normally use Component.qml for the Component type. However on a unix platform, the unix selector will be present and the +unix/Component.qml version will be used instead. Note that this acts like swapping out Component.qml with +unix/Component.qml, so when using Component.qml you should not need to alter any paths based on which version was selected. For example, to pass the "asset.png" file path around you would refer to it just as "asset.png" in all of main.qml, Component.qml, and +linux/Component.qml. It will be replaced with +mac/asset.png on Mac platforms in all cases. For a list of available selectors, see `QFileSelector`. Your platform may also provide additional selectors for you to use. As specified by [QFileSelector](qfileselector), directories used for selection must start with a '+' character, so you will not accidentally trigger this feature unless you have directories with such names inside your project. If a new QQmlFileSelector is set on the engine, the old one will be replaced. Member Function Documentation ----------------------------- ### QQmlFileSelector::QQmlFileSelector([QQmlEngine](qqmlengine) \**engine*, [QObject](qobject#QObject) \**parent* = nullptr) Creates a new QQmlFileSelector with parent object *parent*, which includes its own [QFileSelector](qfileselector). *engine* is the [QQmlEngine](qqmlengine) you wish to apply file selectors to. It will also take ownership of the QQmlFileSelector. ### `[override virtual]` QQmlFileSelector::~QQmlFileSelector() Destroys the [QQmlFileSelector](qqmlfileselector) object. ### `[since 5.7]` [QFileSelector](qfileselector) \*QQmlFileSelector::selector() const Returns the [QFileSelector](qfileselector) instance used by the [QQmlFileSelector](qqmlfileselector). This function was introduced in Qt 5.7. **See also** [setSelector](qqmlfileselector#setSelector)(). ### void QQmlFileSelector::setExtraSelectors(const [QStringList](qstringlist) &*strings*) Adds extra selectors contained in *strings* to the current [QFileSelector](qfileselector) being used. Use this when extra selectors are all you need to avoid having to create your own [QFileSelector](qfileselector) instance. ### void QQmlFileSelector::setSelector([QFileSelector](qfileselector) \**selector*) Sets the [QFileSelector](qfileselector) instance for use by the [QQmlFileSelector](qqmlfileselector) to *selector*. [QQmlFileSelector](qqmlfileselector) does not take ownership of the new [QFileSelector](qfileselector). To reset [QQmlFileSelector](qqmlfileselector) to use its internal [QFileSelector](qfileselector) instance, call setSelector(`nullptr`). **See also** [selector](qqmlfileselector#selector)(). qt QAccelerometer Class QAccelerometer Class ==================== The QAccelerometer class is a convenience wrapper around [QSensor](qsensor). [More...](#details) | | | | --- | --- | | Header: | #include <QAccelerometer> | | CMake: | find\_package(Qt6 COMPONENTS Sensors REQUIRED) target\_link\_libraries(mytarget PRIVATE Qt6::Sensors) | | qmake: | QT += sensors | | Since: | Qt 5.1 | | Inherits: | [QSensor](qsensor) | * [List of all members, including inherited members](https://doc.qt.io/qt-6.2/qaccelerometer-members.html) Public Types ------------ | | | | --- | --- | | enum | **[AccelerationMode](qaccelerometer#AccelerationMode-enum)** { Combined, Gravity, User } | Properties ---------- * **[accelerationMode](qaccelerometer#accelerationMode-prop)** : AccelerationMode Public Functions ---------------- | | | | --- | --- | | | **[QAccelerometer](qaccelerometer#QAccelerometer)**(QObject \**parent* = nullptr) | | virtual | **[~QAccelerometer](qaccelerometer#dtor.QAccelerometer)**() | | QAccelerometer::AccelerationMode | **[accelerationMode](qaccelerometer#accelerationMode-prop)**() const | | QAccelerometerReading \* | **[reading](qaccelerometer#reading)**() const | | void | **[setAccelerationMode](qaccelerometer#setAccelerationMode)**(QAccelerometer::AccelerationMode *accelerationMode*) | Signals ------- | | | | --- | --- | | void | **[accelerationModeChanged](qaccelerometer#accelerationModeChanged)**(QAccelerometer::AccelerationMode *accelerationMode*) | Detailed Description -------------------- The only behavioural difference is that this class sets the type properly. It also supports changing the acceleration mode, which controls whether the force of gravity is included in the accelerometer values or not. Furthermore, this class features a [reading](qaccelerometer#reading)() function that returns a [QAccelerometerReading](qaccelerometerreading) instead of a [QSensorReading](qsensorreading). For details about how the sensor works, see [QAccelerometerReading](qaccelerometerreading). **See also** [QAccelerometerReading](qaccelerometerreading). Member Type Documentation ------------------------- ### `[since 5.1]` enum QAccelerometer::AccelerationMode This enum represents the acceleration mode of an acceleration sensor. The acceleration mode controls how the sensor reports acceleration. QAccelerometer::Combined is the only mode in which the values can be directly physically measured, the others are an approximation. | Constant | Value | Description | | --- | --- | --- | | `QAccelerometer::Combined` | `0` | Both the acceleration caused by gravity and the acceleration caused by the user moving the device is reported combined. | | `QAccelerometer::Gravity` | `1` | Only the acceleration caused by gravity is reported. Movements of the device caused by the user have no effect other than changing the direction when the device is rotated. | | `QAccelerometer::User` | `2` | Only the acceleration caused by the user moving the device is reported, the effect of gravity is canceled out. A device at rest therefore should report values of, or close to, zero. In other APIs, this mode might be known as *linear acceleration*. | This enum was introduced or modified in Qt 5.1. **See also** [QAccelerometer::accelerationMode](qaccelerometer#accelerationMode-prop). Property Documentation ---------------------- ### `[since 5.1]` accelerationMode : [AccelerationMode](qaccelerometer#AccelerationMode-enum) This property holds the acceleration mode controls how acceleration values are reported. The acceleration mode controls how the acceleration sensor reports its values. The default mode is [QAccelerometer::Combined](qaccelerometer#AccelerationMode-enum), which means the acceleration caused by gravity is included in the reported values. Acceleration caused by gravity and acceleration caused by the user moving the device are physically impossible to distinguish because of general relativity. Most devices use sensor fusion to figure out which parts of the acceleration is caused by gravity, for example by using a rotation sensor to calculate the gravity direction and assuming a fixed magnitude for gravity. Therefore the result is only an approximation and may be inaccurate. The [QAccelerometer::Combined](qaccelerometer#AccelerationMode-enum) mode is the most accurate one, as it does not involve approximating the gravity. Not all backends and devices might support setting the acceleration mode. For those cases, the default mode [QAccelerometer::Combined](qaccelerometer#AccelerationMode-enum) is used, changing it has no effect. This property was introduced in Qt 5.1. **Access functions:** | | | | --- | --- | | QAccelerometer::AccelerationMode | **accelerationMode**() const | | void | **[setAccelerationMode](qaccelerometer#setAccelerationMode)**(QAccelerometer::AccelerationMode *accelerationMode*) | **Notifier signal:** | | | | --- | --- | | void | **[accelerationModeChanged](qaccelerometer#accelerationModeChanged)**(QAccelerometer::AccelerationMode *accelerationMode*) | Member Function Documentation ----------------------------- ### QAccelerometer::QAccelerometer([QObject](qobject#QObject) \**parent* = nullptr) Construct the sensor as a child of *parent*. ### `[signal, since 5.1]` void QAccelerometer::accelerationModeChanged([QAccelerometer::AccelerationMode](qaccelerometer#AccelerationMode-enum) *accelerationMode*) Emitted when the *accelerationMode* was changed. **Note:** Notifier signal for property [accelerationMode](qaccelerometer#accelerationMode-prop). This function was introduced in Qt 5.1. ### `[virtual]` QAccelerometer::~QAccelerometer() Destroy the sensor. Stops the sensor if it has not already been stopped. ### [QAccelerometerReading](qaccelerometerreading) \*QAccelerometer::reading() const Returns the reading class for this sensor. **See also** [QSensor::reading](qsensor#reading-prop)(). ### `[since 5.1]` void QAccelerometer::setAccelerationMode([QAccelerometer::AccelerationMode](qaccelerometer#AccelerationMode-enum) *accelerationMode*) Sets the acceleration mode to *accelerationMode*. **Note:** Setter function for property [accelerationMode](qaccelerometer#accelerationMode-prop). This function was introduced in Qt 5.1. **See also** [accelerationMode](qaccelerometer#accelerationMode-prop)(). qt QScatter3DSeries Class QScatter3DSeries Class ====================== The QScatter3DSeries class represents a data series in a 3D scatter graph. [More...](#details) | | | | --- | --- | | Header: | #include <QScatter3DSeries> | | Since: | QtDataVisualization 1.0 | | Instantiated By: | [Scatter3DSeries](qml-qtdatavisualization-scatter3dseries) | | Inherits: | [QAbstract3DSeries](qabstract3dseries) | * [List of all members, including inherited members](https://doc.qt.io/qt-6.2/qscatter3dseries-members.html) Properties ---------- * **[dataProxy](qscatter3dseries#dataProxy-prop)** : QScatterDataProxy\* * **[itemSize](qscatter3dseries#itemSize-prop)** : float * **[selectedItem](qscatter3dseries#selectedItem-prop)** : int Public Functions ---------------- | | | | --- | --- | | | **[QScatter3DSeries](qscatter3dseries#QScatter3DSeries-1)**(QScatterDataProxy \**dataProxy*, QObject \**parent* = nullptr) | | | **[QScatter3DSeries](qscatter3dseries#QScatter3DSeries)**(QObject \**parent* = nullptr) | | virtual | **[~QScatter3DSeries](qscatter3dseries#dtor.QScatter3DSeries)**() | | QScatterDataProxy \* | **[dataProxy](qscatter3dseries#dataProxy-prop)**() const | | float | **[itemSize](qscatter3dseries#itemSize-prop)**() const | | int | **[selectedItem](qscatter3dseries#selectedItem-prop)**() const | | void | **[setDataProxy](qscatter3dseries#setDataProxy)**(QScatterDataProxy \**proxy*) | | void | **[setItemSize](qscatter3dseries#itemSize-prop)**(float *size*) | | void | **[setSelectedItem](qscatter3dseries#setSelectedItem)**(int *index*) | Signals ------- | | | | --- | --- | | void | **[dataProxyChanged](qscatter3dseries#dataProxy-prop)**(QScatterDataProxy \**proxy*) | | void | **[itemSizeChanged](qscatter3dseries#itemSize-prop)**(float *size*) | | void | **[selectedItemChanged](qscatter3dseries#selectedItem-prop)**(int *index*) | Static Public Members --------------------- | | | | --- | --- | | int | **[invalidSelectionIndex](qscatter3dseries#invalidSelectionIndex)**() | Detailed Description -------------------- This class manages the series specific visual elements, as well as the series data (via a data proxy). If no data proxy is set explicitly for the series, the series creates a default proxy. Setting another proxy will destroy the existing proxy and all data added to it. QScatter3DSeries supports the following format tags for [QAbstract3DSeries::setItemLabelFormat](qabstract3dseries#itemLabelFormat-prop)(): | | | | --- | --- | | @xTitle | Title from x-axis | | @yTitle | Title from y-axis | | @zTitle | Title from z-axis | | @xLabel | Item value formatted using the format of the x-axis. For more information, see [QValue3DAxis::setLabelFormat](qvalue3daxis#labelFormat-prop)(). | | @yLabel | Item value formatted using the format of the y-axis. For more information, see [QValue3DAxis::setLabelFormat](qvalue3daxis#labelFormat-prop)(). | | @zLabel | Item value formatted using the format of the z-axis. For more information, see [QValue3DAxis::setLabelFormat](qvalue3daxis#labelFormat-prop)(). | | @seriesName | Name of the series | For example: ``` proxy->setItemLabelFormat(QStringLiteral("@valueTitle for (@rowLabel, @colLabel): %.1f")); ``` **See also** [Qt Data Visualization Data Handling](qtdatavisualization-data-handling). Property Documentation ---------------------- ### dataProxy : [QScatterDataProxy](qscatterdataproxy)\* This property holds the active data proxy. **Access functions:** | | | | --- | --- | | QScatterDataProxy \* | **dataProxy**() const | | void | **[setDataProxy](qscatter3dseries#setDataProxy)**(QScatterDataProxy \**proxy*) | **Notifier signal:** | | | | --- | --- | | void | **dataProxyChanged**(QScatterDataProxy \**proxy*) | ### itemSize : float Item size for the series. The size must be between `0.0f` and `1.0f`. Setting the size to `0.0f` causes the item size to be automatically scaled based on the total number of items in all the series for the graph. The preset default is `0.0f`. **Access functions:** | | | | --- | --- | | float | **itemSize**() const | | void | **setItemSize**(float *size*) | **Notifier signal:** | | | | --- | --- | | void | **itemSizeChanged**(float *size*) | ### selectedItem : int This property holds the item that is selected in the series. **Access functions:** | | | | --- | --- | | int | **selectedItem**() const | | void | **[setSelectedItem](qscatter3dseries#setSelectedItem)**(int *index*) | **Notifier signal:** | | | | --- | --- | | void | **selectedItemChanged**(int *index*) | Member Function Documentation ----------------------------- ### QScatter3DSeries::QScatter3DSeries([QScatterDataProxy](qscatterdataproxy) \**dataProxy*, [QObject](qobject#QObject) \**parent* = nullptr) Constructs a scatter 3D series with the data proxy *dataProxy* and the parent *parent*. ### QScatter3DSeries::QScatter3DSeries([QObject](qobject#QObject) \**parent* = nullptr) Constructs a scatter 3D series with the parent *parent*. ### `[virtual]` QScatter3DSeries::~QScatter3DSeries() Deletes the scatter 3D series. ### `[static]` int QScatter3DSeries::invalidSelectionIndex() Returns an invalid index for selection. This index is set to the [selectedItem](qscatter3dseries#selectedItem-prop) property to clear the selection from this series. **See also** [QAbstract3DGraph::clearSelection](qabstract3dgraph#clearSelection)(). ### void QScatter3DSeries::setDataProxy([QScatterDataProxy](qscatterdataproxy) \**proxy*) Sets the active data proxy for the series to *proxy*. The series assumes ownership of any proxy set to it and deletes any previously set proxy when a new one is added. The *proxy* argument cannot be null or set to another series. **Note:** Setter function for property [dataProxy](qscatter3dseries#dataProxy-prop). **See also** [dataProxy](qscatter3dseries#dataProxy-prop)(). ### void QScatter3DSeries::setSelectedItem(int *index*) Selects the item at the index *index* in the data array of the series. Only one item can be selected at a time. To clear selection from this series, [invalidSelectionIndex](qscatter3dseries#invalidSelectionIndex)() is set as *index*. If this series is added to a graph, the graph can adjust the selection according to user interaction or if it becomes invalid. Selecting an item on another added series will also clear the selection. Removing items from or inserting items to the series before the selected item will adjust the selection so that the same item will stay selected. **Note:** Setter function for property [selectedItem](qscatter3dseries#selectedItem-prop). **See also** [selectedItem](qscatter3dseries#selectedItem-prop)() and [QAbstract3DGraph::clearSelection](qabstract3dgraph#clearSelection)(). qt Desaturate QML Type Desaturate QML Type =================== A desaturating effect. [More...](#details) | | | | --- | --- | | Import Statement: | import QtQuick3D.Effects | * [List of all members, including inherited members](https://doc.qt.io/qt-6.2/qml-qtquick3d-effects-desaturate-members.html) Properties ---------- * **[amount](qml-qtquick3d-effects-desaturate#amount-prop)** : real Detailed Description -------------------- The Desaturate effect allows decreasing the intensity of all colors in the scene. Property Documentation ---------------------- ### amount : [real](qml-real) The strength of desaturation. The range is `[0...1]`, with `0` being fully saturated and `1` being fully grayscale. The default value is `0.5`. qt QSqlRelationalDelegate Class QSqlRelationalDelegate Class ============================ The QSqlRelationalDelegate class provides a delegate that is used to display and edit data from a [QSqlRelationalTableModel](qsqlrelationaltablemodel). [More...](#details) | | | | --- | --- | | Header: | #include <QSqlRelationalDelegate> | | CMake: | find\_package(Qt6 COMPONENTS Sql REQUIRED) target\_link\_libraries(mytarget PRIVATE Qt6::Sql) | | qmake: | QT += sql | | Inherits: | [QStyledItemDelegate](qstyleditemdelegate) | * [List of all members, including inherited members](https://doc.qt.io/qt-6.2/qsqlrelationaldelegate-members.html) Public Functions ---------------- | | | | --- | --- | | | **[QSqlRelationalDelegate](qsqlrelationaldelegate#QSqlRelationalDelegate)**(QObject \**parent* = nullptr) | | virtual | **[~QSqlRelationalDelegate](qsqlrelationaldelegate#dtor.QSqlRelationalDelegate)**() | Reimplemented Public Functions ------------------------------ | | | | --- | --- | | virtual QWidget \* | **[createEditor](qsqlrelationaldelegate#createEditor)**(QWidget \**parent*, const QStyleOptionViewItem &*option*, const QModelIndex &*index*) const override | | virtual void | **[setModelData](qsqlrelationaldelegate#setModelData)**(QWidget \**editor*, QAbstractItemModel \**model*, const QModelIndex &*index*) const override | Detailed Description -------------------- Unlike the default delegate, QSqlRelationalDelegate provides a combobox for fields that are foreign keys into other tables. To use the class, simply call [QAbstractItemView::setItemDelegate](qabstractitemview#setItemDelegate)() on the view with an instance of QSqlRelationalDelegate: ``` std::unique_ptr<QTableView> view{new QTableView}; view->setModel(model); view->setItemDelegate(new QSqlRelationalDelegate(view.get())); ``` The [Relational Table Model](https://doc.qt.io/qt-6.2/qtsql-relationaltablemodel-example.html) example (shown below) illustrates how to use QSqlRelationalDelegate in conjunction with [QSqlRelationalTableModel](qsqlrelationaltablemodel) to provide tables with foreign key support. **See also** [QSqlRelationalTableModel](qsqlrelationaltablemodel) and [Model/View Programming](model-view-programming). Member Function Documentation ----------------------------- ### QSqlRelationalDelegate::QSqlRelationalDelegate([QObject](qobject#QObject) \**parent* = nullptr) Constructs a QSqlRelationalDelegate object with the given *parent*. ### `[virtual]` QSqlRelationalDelegate::~QSqlRelationalDelegate() Destroys the [QSqlRelationalDelegate](qsqlrelationaldelegate) object and frees any allocated resources. ### `[override virtual]` [QWidget](qwidget) \*QSqlRelationalDelegate::createEditor([QWidget](qwidget) \**parent*, const [QStyleOptionViewItem](qstyleoptionviewitem) &*option*, const [QModelIndex](qmodelindex) &*index*) const Reimplements: [QStyledItemDelegate::createEditor(QWidget \*parent, const QStyleOptionViewItem &option, const QModelIndex &index) const](qstyleditemdelegate#createEditor). ### `[override virtual]` void QSqlRelationalDelegate::setModelData([QWidget](qwidget) \**editor*, [QAbstractItemModel](qabstractitemmodel) \**model*, const [QModelIndex](qmodelindex) &*index*) const Reimplements: [QStyledItemDelegate::setModelData(QWidget \*editor, QAbstractItemModel \*model, const QModelIndex &index) const](qstyleditemdelegate#setModelData).
programming_docs
qt GraphicsPipelineState Struct GraphicsPipelineState Struct ============================ struct [QSGMaterialShader](qsgmaterialshader)::GraphicsPipelineState Describes state changes that the material wants to apply to the currently active graphics pipeline state. [More...](#details) This struct was introduced in Qt 5.14. * [List of all members, including inherited members](https://doc.qt.io/qt-6.2/qsgmaterialshader-graphicspipelinestate-members.html) Public Types ------------ | | | | --- | --- | | enum | **[BlendFactor](qsgmaterialshader-graphicspipelinestate#BlendFactor-enum)** { Zero, One, SrcColor, OneMinusSrcColor, DstColor, …, OneMinusSrc1Alpha } | | flags | **[ColorMask](qsgmaterialshader-graphicspipelinestate#ColorMaskComponent-enum)** | | enum | **[ColorMaskComponent](qsgmaterialshader-graphicspipelinestate#ColorMaskComponent-enum)** { R, G, B, A } | | enum | **[CullMode](qsgmaterialshader-graphicspipelinestate#CullMode-enum)** { CullNone, CullFront, CullBack } | Detailed Description -------------------- Unlike [QSGMaterialShader](qsgmaterialshader), directly issuing state change commands with the underlying graphics API is not possible with [QSGMaterialShader](qsgmaterialshader). This is mainly because the concept of individually changeable states is considered deprecated and not supported with modern graphics APIs. Therefore, it is up to [QSGMaterialShader](qsgmaterialshader) to expose a data structure with the set of supported states, which the material can change in its updatePipelineState() implementation, if there is one. The scenegraph will then internally apply these changes to the active graphics pipeline state, then rolling them back as appropriate. Member Type Documentation ------------------------- ### `[since 5.14]` enum GraphicsPipelineState::BlendFactor | Constant | Value | | --- | --- | | `QSGMaterialShader::GraphicsPipelineState::Zero` | `0` | | `QSGMaterialShader::GraphicsPipelineState::One` | `1` | | `QSGMaterialShader::GraphicsPipelineState::SrcColor` | `2` | | `QSGMaterialShader::GraphicsPipelineState::OneMinusSrcColor` | `3` | | `QSGMaterialShader::GraphicsPipelineState::DstColor` | `4` | | `QSGMaterialShader::GraphicsPipelineState::OneMinusDstColor` | `5` | | `QSGMaterialShader::GraphicsPipelineState::SrcAlpha` | `6` | | `QSGMaterialShader::GraphicsPipelineState::OneMinusSrcAlpha` | `7` | | `QSGMaterialShader::GraphicsPipelineState::DstAlpha` | `8` | | `QSGMaterialShader::GraphicsPipelineState::OneMinusDstAlpha` | `9` | | `QSGMaterialShader::GraphicsPipelineState::ConstantColor` | `10` | | `QSGMaterialShader::GraphicsPipelineState::OneMinusConstantColor` | `11` | | `QSGMaterialShader::GraphicsPipelineState::ConstantAlpha` | `12` | | `QSGMaterialShader::GraphicsPipelineState::OneMinusConstantAlpha` | `13` | | `QSGMaterialShader::GraphicsPipelineState::SrcAlphaSaturate` | `14` | | `QSGMaterialShader::GraphicsPipelineState::Src1Color` | `15` | | `QSGMaterialShader::GraphicsPipelineState::OneMinusSrc1Color` | `16` | | `QSGMaterialShader::GraphicsPipelineState::Src1Alpha` | `17` | | `QSGMaterialShader::GraphicsPipelineState::OneMinusSrc1Alpha` | `18` | This enum was introduced or modified in Qt 5.14. ### `[since 5.14]` enum GraphicsPipelineState::ColorMaskComponentflags GraphicsPipelineState::ColorMask | Constant | Value | | --- | --- | | `QSGMaterialShader::GraphicsPipelineState::R` | `1 << 0` | | `QSGMaterialShader::GraphicsPipelineState::G` | `1 << 1` | | `QSGMaterialShader::GraphicsPipelineState::B` | `1 << 2` | | `QSGMaterialShader::GraphicsPipelineState::A` | `1 << 3` | This enum was introduced or modified in Qt 5.14. The ColorMask type is a typedef for [QFlags](qflags)<ColorMaskComponent>. It stores an OR combination of ColorMaskComponent values. ### `[since 5.14]` enum GraphicsPipelineState::CullMode | Constant | Value | | --- | --- | | `QSGMaterialShader::GraphicsPipelineState::CullNone` | `0` | | `QSGMaterialShader::GraphicsPipelineState::CullFront` | `1` | | `QSGMaterialShader::GraphicsPipelineState::CullBack` | `2` | This enum was introduced or modified in Qt 5.14. qt size QML Basic Type size QML Basic Type =================== The `size` type refers to a value with has `width` and `height` attributes. For example, to read the `width` and `height` values of the [Image::sourceSize](qml-qtquick-image#sourceSize-prop) size-type property: ``` Column { Image { id: image; source: "logo.png" } Text { text: image.sourceSize.width + "," + image.sourceSize.height } } ``` To create a `size` value, specify it as a "width x height" string: ``` Image { sourceSize: "150x50" } ``` Or use the [Qt.size](qml-qtqml-qt#size-method)() function: ``` Image { sourceSize: Qt.size(150, 50) } ``` When integrating with C++, note that any [QSize](qsize) or [QSizeF](qsizef) value [passed into QML from C++](qtqml-cppintegration-data) is automatically converted into a `size` value, and vice-versa. When a `size` value is passed to C++, it is automatically converted into a [QSizeF](qsizef) value. **See also** [QML Basic Types](qtqml-typesystem-basictypes). qt QHelpSearchEngine Class QHelpSearchEngine Class ======================= The QHelpSearchEngine class provides access to widgets reusable to integrate fulltext search as well as to index and search documentation. [More...](#details) | | | | --- | --- | | Header: | #include <QHelpSearchEngine> | | CMake: | find\_package(Qt6 COMPONENTS Help REQUIRED) target\_link\_libraries(mytarget PRIVATE Qt6::Help) | | qmake: | QT += help | | Inherits: | [QObject](qobject) | * [List of all members, including inherited members](https://doc.qt.io/qt-6.2/qhelpsearchengine-members.html) * [Deprecated members](https://doc.qt.io/qt-6.2/qhelpsearchengine-obsolete.html) Public Functions ---------------- | | | | --- | --- | | | **[QHelpSearchEngine](qhelpsearchengine#QHelpSearchEngine)**(QHelpEngineCore \**helpEngine*, QObject \**parent* = nullptr) | | virtual | **[~QHelpSearchEngine](qhelpsearchengine#dtor.QHelpSearchEngine)**() | | QHelpSearchQueryWidget \* | **[queryWidget](qhelpsearchengine#queryWidget)**() | | QHelpSearchResultWidget \* | **[resultWidget](qhelpsearchengine#resultWidget)**() | | QString | **[searchInput](qhelpsearchengine#searchInput)**() const | | int | **[searchResultCount](qhelpsearchengine#searchResultCount)**() const | | QList<QHelpSearchResult> | **[searchResults](qhelpsearchengine#searchResults)**(int *start*, int *end*) const | Public Slots ------------ | | | | --- | --- | | void | **[cancelIndexing](qhelpsearchengine#cancelIndexing)**() | | void | **[cancelSearching](qhelpsearchengine#cancelSearching)**() | | void | **[reindexDocumentation](qhelpsearchengine#reindexDocumentation)**() | | void | **[search](qhelpsearchengine#search-1)**(const QString &*searchInput*) | Signals ------- | | | | --- | --- | | void | **[indexingFinished](qhelpsearchengine#indexingFinished)**() | | void | **[indexingStarted](qhelpsearchengine#indexingStarted)**() | | void | **[searchingFinished](qhelpsearchengine#searchingFinished)**(int *searchResultCount*) | | void | **[searchingStarted](qhelpsearchengine#searchingStarted)**() | Detailed Description -------------------- Before the search engine can be used, one has to instantiate at least a [QHelpEngineCore](qhelpenginecore) object that needs to be passed to the search engines constructor. This is required as the search engine needs to be connected to the help engines setupFinished() signal to know when it can start to index documentation. After starting the indexing process the signal [indexingStarted](qhelpsearchengine#indexingStarted)() is emitted and on the end of the indexing process the [indexingFinished](qhelpsearchengine#indexingFinished)() is emitted. To stop the indexing one can call [cancelIndexing](qhelpsearchengine#cancelIndexing)(). When the indexing process has finished, the search engine can be used to search through the index for a given term using the search() function. When the search input is passed to the search engine, the [searchingStarted](qhelpsearchengine#searchingStarted)() signal is emitted. When the search finishes, the [searchingFinished](qhelpsearchengine#searchingFinished)() signal is emitted. The search process can be stopped by calling [cancelSearching](qhelpsearchengine#cancelSearching)(). If the search succeeds, [searchingFinished](qhelpsearchengine#searchingFinished)() is called with the search result count to fetch the search results from the search engine. Calling the [searchResults](qhelpsearchengine#searchResults)() function with a range returns a list of [QHelpSearchResult](qhelpsearchresult) objects within the range. The results consist of the document title and URL, as well as a snippet from the document that contains the best match for the search input. To display the given search results use the [QHelpSearchResultWidget](qhelpsearchresultwidget) or build up your own one if you need more advanced functionality. Note that the [QHelpSearchResultWidget](qhelpsearchresultwidget) can not be instantiated directly, you must retrieve the widget from the search engine in use as all connections will be established for you by the widget itself. Member Function Documentation ----------------------------- ### QHelpSearchEngine::QHelpSearchEngine([QHelpEngineCore](qhelpenginecore) \**helpEngine*, [QObject](qobject#QObject) \**parent* = nullptr) Constructs a new search engine with the given *parent*. The search engine uses the given *helpEngine* to access the documentation that needs to be indexed. The [QHelpEngine](qhelpengine)'s setupFinished() signal is automatically connected to the QHelpSearchEngine's indexing function, so that new documentation will be indexed after the signal is emitted. ### `[slot]` void QHelpSearchEngine::cancelIndexing() Stops the indexing process. ### `[slot]` void QHelpSearchEngine::cancelSearching() Stops the search process. ### `[signal]` void QHelpSearchEngine::indexingFinished() This signal is emitted when the indexing process is complete. ### `[signal]` void QHelpSearchEngine::indexingStarted() This signal is emitted when indexing process is started. ### `[slot]` void QHelpSearchEngine::reindexDocumentation() Forces the search engine to reindex all documentation files. ### `[slot, since 5.9]` void QHelpSearchEngine::search(const [QString](qstring) &*searchInput*) Starts the search process using the given search phrase *searchInput*. The phrase may consist of several words. By default, the search engine returns the list of documents that contain all the specified words. The phrase may contain any combination of the logical operators AND, OR, and NOT. The operator must be written in all capital letters, otherwise it will be considered a part of the search phrase. If double quotation marks are used to group the words, the search engine will search for an exact match of the quoted phrase. For more information about the text query syntax, see [SQLite FTS5 Extension](https://sqlite.org/fts5.html#full_text_query_syntax). This function was introduced in Qt 5.9. ### `[signal]` void QHelpSearchEngine::searchingFinished(int *searchResultCount*) This signal is emitted when the search process is complete. The search result count is stored in *searchResultCount*. ### `[signal]` void QHelpSearchEngine::searchingStarted() This signal is emitted when the search process is started. ### `[virtual]` QHelpSearchEngine::~QHelpSearchEngine() Destructs the search engine. ### [QHelpSearchQueryWidget](qhelpsearchquerywidget) \*QHelpSearchEngine::queryWidget() Returns a widget to use as input widget. Depending on your search engine configuration you will get a different widget with more or less subwidgets. ### [QHelpSearchResultWidget](qhelpsearchresultwidget) \*QHelpSearchEngine::resultWidget() Returns a widget that can hold and display the search results. ### `[since 5.9]` [QString](qstring) QHelpSearchEngine::searchInput() const Returns the phrase that was last searched for. This function was introduced in Qt 5.9. ### `[since 5.9]` int QHelpSearchEngine::searchResultCount() const Returns the number of results the search engine found. This function was introduced in Qt 5.9. ### `[since 5.9]` [QList](qlist)<[QHelpSearchResult](qhelpsearchresult)> QHelpSearchEngine::searchResults(int *start*, int *end*) const Returns a list of search results within the range from the index specified by *start* to the index specified by *end*. This function was introduced in Qt 5.9. qt QVulkanInfoVector Class QVulkanInfoVector Class ======================= template <typename T> class QVulkanInfoVector A specialized [QList](qlist) for [QVulkanLayer](qvulkanlayer) and [QVulkanExtension](qvulkanextension). [More...](#details) | | | | --- | --- | | Header: | #include <QVulkanInfoVector> | | CMake: | find\_package(Qt6 COMPONENTS Gui REQUIRED) target\_link\_libraries(mytarget PRIVATE Qt6::Gui) | | qmake: | QT += gui | | Inherits: | [QList](qlist) | * [List of all members, including inherited members](https://doc.qt.io/qt-6.2/qvulkaninfovector-members.html) Public Functions ---------------- | | | | --- | --- | | bool | **[contains](qvulkaninfovector#contains)**(const QByteArray &*name*) const | | bool | **[contains](qvulkaninfovector#contains-1)**(const QByteArray &*name*, int *minVersion*) const | Detailed Description -------------------- Member Function Documentation ----------------------------- ### bool QVulkanInfoVector::contains(const [QByteArray](qbytearray) &*name*) const Returns true if the list contains a layer or extension with the given *name*. ### bool QVulkanInfoVector::contains(const [QByteArray](qbytearray) &*name*, int *minVersion*) const Returns true if the list contains a layer or extension with the given *name* and a version same as or newer than *minVersion*. qt Node QML Type Node QML Type ============= A base QML type that other types inherit. It cannot be directly created. [More...](#details) | | | | --- | --- | | Import Statement: | import Qt3D.Core | | Since: | Qt 5.5 | | Inherited By: | [AbstractSkeleton](qml-qt3d-core-abstractskeleton), [AbstractTextureImage](qml-qt3d-render-abstracttextureimage), [Component3D](qml-qt3d-core-component3d), [Effect](qml-qt3d-render-effect), [Entity](qml-qt3d-core-entity), [FilterKey](qml-qt3d-render-filterkey), [FrameGraphNode](qml-qt3d-render-framegraphnode), [Geometry](qml-qt3d-core-geometry), [GeometryView](qml-qt3d-core-geometryview), [Joint](qml-qt3d-core-joint), [KeyboardDevice](qml-qt3d-input-keyboarddevice), [RenderPass](qml-qt3d-render-renderpass), [RenderState](qml-qt3d-render-renderstate), and [RenderTargetOutput](qml-qt3d-render-rendertargetoutput) | * [List of all members, including inherited members](https://doc.qt.io/qt-6.2/qml-qt3d-core-node-members.html) Properties ---------- * **[childNodes](qml-qt3d-core-node#childNodes-prop)** : list<Node> * **[data](qml-qt3d-core-node#data-prop)** : list<QtQml::QtObject> Detailed Description -------------------- Property Documentation ---------------------- ### [read-only] childNodes : [list](qml-list)<[Node](qml-qt3d-core-node)> ### [default] data : [list](qml-list)<[QtQml::QtObject](qml-qtqml-qtobject)> qt QOpcUaAttributeOperand Class QOpcUaAttributeOperand Class ============================ The OPC UA [AttributeOperand](qml-qtopcua-attributeoperand) type. [More...](#details) | | | | --- | --- | | Header: | #include <QOpcUaAttributeOperand> | | qmake: | QT += opcua | * [List of all members, including inherited members](https://doc.qt.io/qt-6.2/qopcuaattributeoperand-members.html) Public Functions ---------------- | | | | --- | --- | | | **[QOpcUaAttributeOperand](qopcuaattributeoperand#QOpcUaAttributeOperand-1)**(const QOpcUaAttributeOperand &*rhs*) | | QOpcUaAttributeOperand & | **[operator=](qopcuaattributeoperand#operator-eq)**(const QOpcUaAttributeOperand &*rhs*) | | QString | **[alias](qopcuaattributeoperand#alias)**() const | | QOpcUa::NodeAttribute | **[attributeId](qopcuaattributeoperand#attributeId)**() const | | QList<QOpcUaRelativePathElement> | **[browsePath](qopcuaattributeoperand#browsePath)**() const | | QList<QOpcUaRelativePathElement> & | **[browsePathRef](qopcuaattributeoperand#browsePathRef)**() | | QString | **[indexRange](qopcuaattributeoperand#indexRange)**() const | | QString | **[nodeId](qopcuaattributeoperand#nodeId)**() const | | void | **[setAlias](qopcuaattributeoperand#setAlias)**(const QString &*alias*) | | void | **[setAttributeId](qopcuaattributeoperand#setAttributeId)**(QOpcUa::NodeAttribute *attributeId*) | | void | **[setBrowsePath](qopcuaattributeoperand#setBrowsePath)**(const QList<QOpcUaRelativePathElement> &*browsePath*) | | void | **[setIndexRange](qopcuaattributeoperand#setIndexRange)**(const QString &*indexRange*) | | void | **[setNodeId](qopcuaattributeoperand#setNodeId)**(const QString &*nodeId*) | | QVariant | **[operator QVariant](qopcuaattributeoperand#operator-QVariant)**() const | Detailed Description -------------------- The [AttributeOperand](qml-qtopcua-attributeoperand) is defined in OPC-UA part 4, 7.4.4.4. It has the same purpose as [QOpcUaSimpleAttributeOperand](qopcuasimpleattributeoperand) but has more configurable options. Member Function Documentation ----------------------------- ### QOpcUaAttributeOperand::QOpcUaAttributeOperand(const QOpcUaAttributeOperand &*rhs*) Constructs an attribute operand from *rhs*. ### QOpcUaAttributeOperand &QOpcUaAttributeOperand::operator=(const QOpcUaAttributeOperand &*rhs*) Sets the values from *rhs* in this attribute operand. ### [QString](qstring) QOpcUaAttributeOperand::alias() const Returns the alias for this QAttributeOperand. **See also** [setAlias](qopcuaattributeoperand#setAlias)(). ### [QOpcUa::NodeAttribute](qopcua#NodeAttribute-enum) QOpcUaAttributeOperand::attributeId() const Returns the attribute id for an attribute of the node [browsePath](qopcuaattributeoperand#browsePath) is pointing to. **See also** [setAttributeId](qopcuaattributeoperand#setAttributeId)(). ### [QList](qlist)<[QOpcUaRelativePathElement](qopcuarelativepathelement)> QOpcUaAttributeOperand::browsePath() const Returns the browse path. **See also** [setBrowsePath](qopcuaattributeoperand#setBrowsePath)(). ### [QList](qlist)<[QOpcUaRelativePathElement](qopcuarelativepathelement)> &QOpcUaAttributeOperand::browsePathRef() Returns a reference to the browse path. **See also** [browsePath](qopcuaattributeoperand#browsePath)(). ### [QString](qstring) QOpcUaAttributeOperand::indexRange() const Returns the index range string. **See also** [setIndexRange](qopcuaattributeoperand#setIndexRange)(). ### [QString](qstring) QOpcUaAttributeOperand::nodeId() const Returns the node id of the type definition node. **See also** [setNodeId](qopcuaattributeoperand#setNodeId)(). ### void QOpcUaAttributeOperand::setAlias(const [QString](qstring) &*alias*) Sets the alias to *alias*. This allows using this instance as operand for other operations in the filter. **See also** [alias](qopcuaattributeoperand#alias)(). ### void QOpcUaAttributeOperand::setAttributeId([QOpcUa::NodeAttribute](qopcua#NodeAttribute-enum) *attributeId*) Sets the attribute id to *attributeId*. **See also** [attributeId](qopcuaattributeoperand#attributeId)(). ### void QOpcUaAttributeOperand::setBrowsePath(const [QList](qlist)<[QOpcUaRelativePathElement](qopcuarelativepathelement)> &*browsePath*) Sets the relative path to a node starting from [nodeId](qopcuaattributeoperand#nodeId)() to *browsePath*. **See also** [browsePath](qopcuaattributeoperand#browsePath)(). ### void QOpcUaAttributeOperand::setIndexRange(const [QString](qstring) &*indexRange*) Sets the index range string used to identify a single value or subset of the attribute's value to *indexRange*. **See also** [indexRange](qopcuaattributeoperand#indexRange)(). ### void QOpcUaAttributeOperand::setNodeId(const [QString](qstring) &*nodeId*) Sets the node id of the type definition node to *nodeId*. **See also** [nodeId](qopcuaattributeoperand#nodeId)(). ### [QVariant](qvariant) QOpcUaAttributeOperand::operator QVariant() const Converts this attribute operand to [QVariant](qvariant).
programming_docs
qt QOpcUaEUInformation Class QOpcUaEUInformation Class ========================= The OPC UA EURange type. [More...](#details) | | | | --- | --- | | Header: | #include <QOpcUaEUInformation> | | qmake: | QT += opcua | * [List of all members, including inherited members](https://doc.qt.io/qt-6.2/qopcuaeuinformation-members.html) Public Functions ---------------- | | | | --- | --- | | | **[QOpcUaEUInformation](qopcuaeuinformation#QOpcUaEUInformation-2)**(const QString &*namespaceUri*, qint32 *unitId*, const QOpcUaLocalizedText &*displayName*, const QOpcUaLocalizedText &*description*) | | | **[QOpcUaEUInformation](qopcuaeuinformation#QOpcUaEUInformation-1)**(const QOpcUaEUInformation &*rhs*) | | QOpcUaEUInformation & | **[operator=](qopcuaeuinformation#operator-eq)**(const QOpcUaEUInformation &*rhs*) | | QOpcUaLocalizedText | **[description](qopcuaeuinformation#description)**() const | | QOpcUaLocalizedText | **[displayName](qopcuaeuinformation#displayName)**() const | | QString | **[namespaceUri](qopcuaeuinformation#namespaceUri)**() const | | void | **[setDescription](qopcuaeuinformation#setDescription)**(const QOpcUaLocalizedText &*description*) | | void | **[setDisplayName](qopcuaeuinformation#setDisplayName)**(const QOpcUaLocalizedText &*displayName*) | | void | **[setNamespaceUri](qopcuaeuinformation#setNamespaceUri)**(const QString &*namespaceUri*) | | void | **[setUnitId](qopcuaeuinformation#setUnitId)**(qint32 *unitId*) | | qint32 | **[unitId](qopcuaeuinformation#unitId)**() const | | QVariant | **[operator QVariant](qopcuaeuinformation#operator-QVariant)**() const | | bool | **[operator==](qopcuaeuinformation#operator-eq-eq)**(const QOpcUaEUInformation &*rhs*) const | Detailed Description -------------------- This is the Qt OPC UA representation for the OPC UA EUInformation type defined in OPC-UA part 8, 5.6.3. EUInformation values contain information about units and are mostly used as property of a node with a numeric value attribute. The information can e. g. be used to add text and tooltips to GUI elements. Member Function Documentation ----------------------------- ### QOpcUaEUInformation::QOpcUaEUInformation(const [QString](qstring) &*namespaceUri*, [qint32](qtglobal#qint32-typedef) *unitId*, const [QOpcUaLocalizedText](qopcualocalizedtext) &*displayName*, const [QOpcUaLocalizedText](qopcualocalizedtext) &*description*) Constructs a EUinformation with namespace URI *namespaceUri*, unit id *unitId*, display name *displayName* and description *description*. ### QOpcUaEUInformation::QOpcUaEUInformation(const QOpcUaEUInformation &*rhs*) Constructs a EUinformation from *rhs*. ### QOpcUaEUInformation &QOpcUaEUInformation::operator=(const QOpcUaEUInformation &*rhs*) Sets the values from *rhs* in this EUinformation. ### [QOpcUaLocalizedText](qopcualocalizedtext) QOpcUaEUInformation::description() const Returns the description of the unit, for example *degree Celsius*. **See also** [setDescription](qopcuaeuinformation#setDescription)(). ### [QOpcUaLocalizedText](qopcualocalizedtext) QOpcUaEUInformation::displayName() const Returns the display name of the unit, for example *°C*. **See also** [setDisplayName](qopcuaeuinformation#setDisplayName)(). ### [QString](qstring) QOpcUaEUInformation::namespaceUri() const Returns the namespace URI of the unit. **See also** [setNamespaceUri](qopcuaeuinformation#setNamespaceUri)(). ### void QOpcUaEUInformation::setDescription(const [QOpcUaLocalizedText](qopcualocalizedtext) &*description*) Sets the description if the unit to *description*. **See also** [description](qopcuaeuinformation#description)(). ### void QOpcUaEUInformation::setDisplayName(const [QOpcUaLocalizedText](qopcualocalizedtext) &*displayName*) Sets the display name of the unit to *displayName*. **See also** [displayName](qopcuaeuinformation#displayName)(). ### void QOpcUaEUInformation::setNamespaceUri(const [QString](qstring) &*namespaceUri*) Sets the namespace URI of the unit to *namespaceUri*. **See also** [namespaceUri](qopcuaeuinformation#namespaceUri)(). ### void QOpcUaEUInformation::setUnitId([qint32](qtglobal#qint32-typedef) *unitId*) Sets the machine-readable identifier for the unit to *unitId*. **See also** [unitId](qopcuaeuinformation#unitId)(). ### [qint32](qtglobal#qint32-typedef) QOpcUaEUInformation::unitId() const Returns the machine-readable identifier for the unit. **See also** [setUnitId](qopcuaeuinformation#setUnitId)(). ### [QVariant](qvariant) QOpcUaEUInformation::operator QVariant() const Converts this EUinformation to [QVariant](qvariant). ### bool QOpcUaEUInformation::operator==(const QOpcUaEUInformation &*rhs*) const Returns `true` if this EUinformation has the same value as *rhs*. qt ButtonGroup QML Type ButtonGroup QML Type ==================== Mutually-exclusive group of checkable buttons. [More...](#details) | | | | --- | --- | | Import Statement: | import QtQuick.Controls | | Since: | Qt 5.7 | | Inherits: | [QtObject](qml-qtqml-qtobject) | * [List of all members, including inherited members](https://doc.qt.io/qt-6.2/qml-qtquick-controls2-buttongroup-members.html) Properties ---------- * **[buttons](qml-qtquick-controls2-buttongroup#buttons-prop)** : list<AbstractButton> * **[checkState](qml-qtquick-controls2-buttongroup#checkState-prop)** : enumeration * **[checkedButton](qml-qtquick-controls2-buttongroup#checkedButton-prop)** : AbstractButton * **[exclusive](qml-qtquick-controls2-buttongroup#exclusive-prop)** : bool Attached Properties ------------------- * **[group](qml-qtquick-controls2-buttongroup#group-attached-prop)** : ButtonGroup Signals ------- * **[clicked](qml-qtquick-controls2-buttongroup#clicked-signal)**(AbstractButton *button*) Methods ------- * void **[addButton](qml-qtquick-controls2-buttongroup#addButton-method)**(AbstractButton *button*) * void **[removeButton](qml-qtquick-controls2-buttongroup#removeButton-method)**(AbstractButton *button*) Detailed Description -------------------- ButtonGroup is a non-visual, mutually exclusive group of buttons. It is used with controls such as [RadioButton](qml-qtquick-controls2-radiobutton), where only one of the options can be selected at a time. The most straight-forward way to use ButtonGroup is to assign a list of buttons. For example, the list of children of a [positioner](qtquick-positioning-layouts) or a [layout](qtquicklayouts-index) that manages a group of mutually exclusive buttons. ``` ButtonGroup { buttons: column.children } Column { id: column RadioButton { checked: true text: qsTr("DAB") } RadioButton { text: qsTr("FM") } RadioButton { text: qsTr("AM") } } ``` Mutually exclusive buttons do not always share the same parent item, or the parent layout may sometimes contain items that should not be included in the button group. Such cases are best handled using the [group](qml-qtquick-controls2-buttongroup#group-attached-prop) attached property. ``` ButtonGroup { id: radioGroup } Column { Label { text: qsTr("Radio:") } RadioButton { checked: true text: qsTr("DAB") ButtonGroup.group: radioGroup } RadioButton { text: qsTr("FM") ButtonGroup.group: radioGroup } RadioButton { text: qsTr("AM") ButtonGroup.group: radioGroup } } ``` More advanced use cases can be handled using the `addButton()` and `removeButton()` methods. **See also** [RadioButton](qml-qtquick-controls2-radiobutton) and [Button Controls](qtquickcontrols2-buttons). Property Documentation ---------------------- ### buttons : [list](qml-list)<[AbstractButton](qml-qtquick-controls2-abstractbutton)> This property holds the list of buttons. ``` ButtonGroup { buttons: column.children } Column { id: column RadioButton { checked: true text: qsTr("Option A") } RadioButton { text: qsTr("Option B") } } ``` **See also** [group](qml-qtquick-controls2-buttongroup#group-attached-prop). ### [since QtQuick.Controls 2.4 (Qt 5.11)] checkState : [enumeration](qml-enumeration) This property holds the combined check state of the button group. Available states: | Constant | Description | | --- | --- | | `Qt.Unchecked` | None of the buttons are checked. | | `Qt.PartiallyChecked` | Some of the buttons are checked. | | `Qt.Checked` | All of the buttons are checked. | Setting the check state of a non-exclusive button group to `Qt.Unchecked` or `Qt.Checked` unchecks or checks all buttons in the group, respectively. `Qt.PartiallyChecked` is ignored. Setting the check state of an exclusive button group to `Qt.Unchecked` unchecks the [checkedButton](qml-qtquick-controls2-buttongroup#checkedButton-prop). `Qt.Checked` and `Qt.PartiallyChecked` are ignored. This property was introduced in QtQuick.Controls 2.4 (Qt 5.11). ### checkedButton : [AbstractButton](qml-qtquick-controls2-abstractbutton) This property holds the currently selected button in an exclusive group, or `null` if there is none or the group is non-exclusive. By default, it is the first checked button added to an exclusive button group. **See also** [exclusive](qml-qtquick-controls2-buttongroup#exclusive-prop). ### [since QtQuick.Controls 2.3 (Qt 5.10)] exclusive : [bool](qml-bool) This property holds whether the button group is exclusive. The default value is `true`. If this property is `true`, then only one button in the group can be checked at any given time. The user can click on any button to check it, and that button will replace the existing one as the checked button in the group. In an exclusive group, the user cannot uncheck the currently checked button by clicking on it; instead, another button in the group must be clicked to set the new checked button for that group. In a non-exclusive group, checking and unchecking buttons does not affect the other buttons in the group. Furthermore, the value of the [checkedButton](qml-qtquick-controls2-buttongroup#checkedButton-prop) property is `null`. This property was introduced in QtQuick.Controls 2.3 (Qt 5.10). Attached Property Documentation ------------------------------- ### ButtonGroup.group : [ButtonGroup](qml-qtquick-controls2-buttongroup) This property attaches a button to a button group. ``` ButtonGroup { id: group } RadioButton { checked: true text: qsTr("Option A") ButtonGroup.group: group } RadioButton { text: qsTr("Option B") ButtonGroup.group: group } ``` **See also** [buttons](qml-qtquick-controls2-buttongroup#buttons-prop). Signal Documentation -------------------- ### `[since QtQuick.Controls 2.1 (Qt 5.8)]` clicked([AbstractButton](qml-qtquick-controls2-abstractbutton) *button*) This signal is emitted when a *button* in the group has been clicked. This signal is convenient for implementing a common signal handler for all buttons in the same group. ``` ButtonGroup { buttons: column.children onClicked: console.log("clicked:", button.text) } Column { id: column Button { text: "First" } Button { text: "Second" } Button { text: "Third" } } ``` **Note:** The corresponding handler is `onClicked`. This signal was introduced in QtQuick.Controls 2.1 (Qt 5.8). **See also** [AbstractButton::clicked](qml-qtquick-controls2-abstractbutton#clicked-signal)(). Method Documentation -------------------- ### void addButton([AbstractButton](qml-qtquick-controls2-abstractbutton) *button*) Adds a *button* to the button group. **Note:** Manually adding objects to a button group is typically unnecessary. The [buttons](qml-qtquick-controls2-buttongroup#buttons-prop) property and the [group](qml-qtquick-controls2-buttongroup#group-attached-prop) attached property provide a convenient and declarative syntax. **See also** [buttons](qml-qtquick-controls2-buttongroup#buttons-prop) and [group](qml-qtquick-controls2-buttongroup#group-attached-prop). ### void removeButton([AbstractButton](qml-qtquick-controls2-abstractbutton) *button*) Removes a *button* from the button group. **Note:** Manually removing objects from a button group is typically unnecessary. The [buttons](qml-qtquick-controls2-buttongroup#buttons-prop) property and the [group](qml-qtquick-controls2-buttongroup#group-attached-prop) attached property provide a convenient and declarative syntax. **See also** [buttons](qml-qtquick-controls2-buttongroup#buttons-prop) and [group](qml-qtquick-controls2-buttongroup#group-attached-prop). qt Behavior QML Type Behavior QML Type ================= Defines a default animation for a property change. [More...](#details) | | | | --- | --- | | Import Statement: | import QtQuick | * [List of all members, including inherited members](https://doc.qt.io/qt-6.2/qml-qtquick-behavior-members.html) Properties ---------- * **[animation](qml-qtquick-behavior#animation-prop)** : Animation * **[enabled](qml-qtquick-behavior#enabled-prop)** : bool * **[targetProperty](qml-qtquick-behavior#targetProperty-prop)** + **[targetProperty.name](qml-qtquick-behavior#targetProperty.name-prop)** : string + **[targetProperty.object](qml-qtquick-behavior#targetProperty.object-prop)** : Object * **[targetValue](qml-qtquick-behavior#targetValue-prop)** : Variant Detailed Description -------------------- A Behavior defines the default animation to be applied whenever a particular property value changes. For example, the following Behavior defines a [NumberAnimation](qml-qtquick-numberanimation) to be run whenever the [Rectangle](qml-qtquick-rectangle)'s `width` value changes. When the [MouseArea](qml-qtquick-mousearea) is clicked, the `width` is changed, triggering the behavior's animation: ``` import QtQuick 2.0 Rectangle { id: rect width: 100; height: 100 color: "red" Behavior on width { NumberAnimation { duration: 1000 } } MouseArea { anchors.fill: parent onClicked: rect.width = 50 } } ``` Note that a property cannot have more than one assigned Behavior. To provide multiple animations within a Behavior, use [ParallelAnimation](qml-qtquick-parallelanimation) or [SequentialAnimation](qml-qtquick-sequentialanimation). If a [state change](qtquick-statesanimations-states) has a [Transition](https://doc.qt.io/qt-6.2/qmlexampletoggleswitch.html#transition) that matches the same property as a Behavior, the [Transition](https://doc.qt.io/qt-6.2/qmlexampletoggleswitch.html#transition) animation overrides the Behavior for that state change. For general advice on using Behaviors to animate state changes, see [Using Qt Quick Behaviors with States](qtquick-statesanimations-behaviors). **See also** [Animation and Transitions in Qt Quick](qtquick-statesanimations-animations), [Behavior example](https://doc.qt.io/qt-6.2/qtquick-animation-example.html#behaviors), and [Qt QML](qtqml-index). Property Documentation ---------------------- ### [default] animation : [Animation](qml-qtquick-animation) This property holds the animation to run when the behavior is triggered. ### enabled : [bool](qml-bool) This property holds whether the behavior will be triggered when the tracked property changes value. By default a Behavior is enabled. ### [read-only, since QtQuick 2.15] targetProperty.name : [string](qml-string) | Property | Description | | --- | --- | | name | This property holds the name of the property being controlled by this Behavior. | | object | This property holds the object of the property being controlled by this Behavior. | This property can be used to define custom behaviors based on the name or the object of the property being controlled. The following example defines a Behavior fading out and fading in its target object when the property it controls changes: ``` // FadeBehavior.qml import QtQuick 2.15 Behavior { id: root property Item fadeTarget: targetProperty.object SequentialAnimation { NumberAnimation { target: root.fadeTarget property: "opacity" to: 0 easing.type: Easing.InQuad } PropertyAction { } // actually change the controlled property between the 2 other animations NumberAnimation { target: root.fadeTarget property: "opacity" to: 1 easing.type: Easing.OutQuad } } } ``` This can be used to animate a text when it changes: ``` import QtQuick 2.15 Text { id: root property int counter text: counter FadeBehavior on text {} Timer { running: true repeat: true interval: 1000 onTriggered: ++root.counter } } ``` This QML property was introduced in QtQuick 2.15. ### [since QtQuick 2.13] targetValue : Variant This property holds the target value of the property being controlled by the Behavior. This value is set by the Behavior before the animation is started. This property was introduced in QtQuick 2.13. qt QCoreApplication Class QCoreApplication Class ====================== The QCoreApplication class provides an event loop for Qt applications without UI. [More...](#details) | | | | --- | --- | | Header: | #include <QCoreApplication> | | CMake: | find\_package(Qt6 COMPONENTS Core REQUIRED) target\_link\_libraries(mytarget PRIVATE Qt6::Core) | | qmake: | QT += core | | Inherits: | [QObject](qobject) | | Inherited By: | [QAndroidService](qandroidservice) and [QGuiApplication](qguiapplication) | * [List of all members, including inherited members](https://doc.qt.io/qt-6.2/qcoreapplication-members.html) Properties ---------- | | | | --- | --- | | * **[applicationName](qcoreapplication#applicationName-prop)** : QString * **[applicationVersion](qcoreapplication#applicationVersion-prop)** : QString * **[organizationDomain](qcoreapplication#organizationDomain-prop)** : QString | * **[organizationName](qcoreapplication#organizationName-prop)** : QString * **[quitLockEnabled](qcoreapplication#quitLockEnabled-prop)** : bool | Public Functions ---------------- | | | | --- | --- | | | **[QCoreApplication](qcoreapplication#QCoreApplication)**(int &*argc*, char \*\**argv*) | | virtual | **[~QCoreApplication](qcoreapplication#dtor.QCoreApplication)**() | | void | **[installNativeEventFilter](qcoreapplication#installNativeEventFilter)**(QAbstractNativeEventFilter \**filterObj*) | | virtual bool | **[notify](qcoreapplication#notify)**(QObject \**receiver*, QEvent \**event*) | | void | **[removeNativeEventFilter](qcoreapplication#removeNativeEventFilter)**(QAbstractNativeEventFilter \**filterObject*) | Public Slots ------------ | | | | --- | --- | | void | **[exit](qcoreapplication#exit)**(int *returnCode* = 0) | | void | **[quit](qcoreapplication#quit)**() | Signals ------- | | | | --- | --- | | void | **[aboutToQuit](qcoreapplication#aboutToQuit)**() | | void | **[applicationNameChanged](qcoreapplication#applicationName-prop)**() | | void | **[applicationVersionChanged](qcoreapplication#applicationVersion-prop)**() | | void | **[organizationDomainChanged](qcoreapplication#organizationDomain-prop)**() | | void | **[organizationNameChanged](qcoreapplication#organizationName-prop)**() | Static Public Members --------------------- | | | | --- | --- | | void | **[addLibraryPath](qcoreapplication#addLibraryPath)**(const QString &*path*) | | QString | **[applicationDirPath](qcoreapplication#applicationDirPath)**() | | QString | **[applicationFilePath](qcoreapplication#applicationFilePath)**() | | QString | **[applicationName](qcoreapplication#applicationName-prop)**() | | qint64 | **[applicationPid](qcoreapplication#applicationPid)**() | | QString | **[applicationVersion](qcoreapplication#applicationVersion-prop)**() | | QStringList | **[arguments](qcoreapplication#arguments)**() | | bool | **[closingDown](qcoreapplication#closingDown)**() | | QAbstractEventDispatcher \* | **[eventDispatcher](qcoreapplication#eventDispatcher)**() | | int | **[exec](qcoreapplication#exec)**() | | bool | **[installTranslator](qcoreapplication#installTranslator)**(QTranslator \**translationFile*) | | QCoreApplication \* | **[instance](qcoreapplication#instance)**() | | bool | **[isQuitLockEnabled](qcoreapplication#quitLockEnabled-prop)**() | | bool | **[isSetuidAllowed](qcoreapplication#isSetuidAllowed)**() | | QStringList | **[libraryPaths](qcoreapplication#libraryPaths)**() | | QString | **[organizationDomain](qcoreapplication#organizationDomain-prop)**() | | QString | **[organizationName](qcoreapplication#organizationName-prop)**() | | void | **[postEvent](qcoreapplication#postEvent)**(QObject \**receiver*, QEvent \**event*, int *priority* = Qt::NormalEventPriority) | | void | **[processEvents](qcoreapplication#processEvents)**(QEventLoop::ProcessEventsFlags *flags* = QEventLoop::AllEvents) | | void | **[processEvents](qcoreapplication#processEvents-1)**(QEventLoop::ProcessEventsFlags *flags*, int *ms*) | | void | **[removeLibraryPath](qcoreapplication#removeLibraryPath)**(const QString &*path*) | | void | **[removePostedEvents](qcoreapplication#removePostedEvents)**(QObject \**receiver*, int *eventType* = 0) | | bool | **[removeTranslator](qcoreapplication#removeTranslator)**(QTranslator \**translationFile*) | | bool | **[sendEvent](qcoreapplication#sendEvent)**(QObject \**receiver*, QEvent \**event*) | | void | **[sendPostedEvents](qcoreapplication#sendPostedEvents)**(QObject \**receiver* = nullptr, int *event\_type* = 0) | | void | **[setApplicationName](qcoreapplication#applicationName-prop)**(const QString &*application*) | | void | **[setApplicationVersion](qcoreapplication#applicationVersion-prop)**(const QString &*version*) | | void | **[setAttribute](qcoreapplication#setAttribute)**(Qt::ApplicationAttribute *attribute*, bool *on* = true) | | void | **[setEventDispatcher](qcoreapplication#setEventDispatcher)**(QAbstractEventDispatcher \**eventDispatcher*) | | void | **[setLibraryPaths](qcoreapplication#setLibraryPaths)**(const QStringList &*paths*) | | void | **[setOrganizationDomain](qcoreapplication#organizationDomain-prop)**(const QString &*orgDomain*) | | void | **[setOrganizationName](qcoreapplication#organizationName-prop)**(const QString &*orgName*) | | void | **[setQuitLockEnabled](qcoreapplication#quitLockEnabled-prop)**(bool *enabled*) | | void | **[setSetuidAllowed](qcoreapplication#setSetuidAllowed)**(bool *allow*) | | bool | **[startingUp](qcoreapplication#startingUp)**() | | bool | **[testAttribute](qcoreapplication#testAttribute)**(Qt::ApplicationAttribute *attribute*) | | QString | **[translate](qcoreapplication#translate)**(const char \**context*, const char \**sourceText*, const char \**disambiguation* = nullptr, int *n* = -1) | Reimplemented Protected Functions --------------------------------- | | | | --- | --- | | virtual bool | **[event](qcoreapplication#event)**(QEvent \**e*) override | Related Non-Members ------------------- | | | | --- | --- | | void | **[qAddPostRoutine](qcoreapplication#qAddPostRoutine)**(QtCleanUpFunction *ptr*) | | void | **[qRemovePostRoutine](qcoreapplication#qRemovePostRoutine)**(QtCleanUpFunction *ptr*) | Macros ------ | | | | --- | --- | | | **[Q\_COREAPP\_STARTUP\_FUNCTION](qcoreapplication#Q_COREAPP_STARTUP_FUNCTION)**(QtStartUpFunction *ptr*) | | | **[Q\_DECLARE\_TR\_FUNCTIONS](qcoreapplication#Q_DECLARE_TR_FUNCTIONS)**(*context*) | Detailed Description -------------------- This class is used by non-GUI applications to provide their event loop. For non-GUI application that uses Qt, there should be exactly one QCoreApplication object. For GUI applications, see [QGuiApplication](qguiapplication). For applications that use the Qt Widgets module, see [QApplication](qapplication). QCoreApplication contains the main event loop, where all events from the operating system (e.g., timer and network events) and other sources are processed and dispatched. It also handles the application's initialization and finalization, as well as system-wide and application-wide settings. ### The Event Loop and Event Handling The event loop is started with a call to [exec](qcoreapplication#exec)(). Long-running operations can call [processEvents](qcoreapplication#processEvents)() to keep the application responsive. In general, we recommend that you create a QCoreApplication, [QGuiApplication](qguiapplication) or a [QApplication](qapplication) object in your `main()` function as early as possible. [exec](qcoreapplication#exec)() will not return until the event loop exits; e.g., when [quit](qcoreapplication#quit)() is called. Several static convenience functions are also provided. The QCoreApplication object is available from [instance](qcoreapplication#instance)(). Events can be sent with [sendEvent](qcoreapplication#sendEvent)() or posted to an event queue with [postEvent](qcoreapplication#postEvent)(). Pending events can be removed with [removePostedEvents](qcoreapplication#removePostedEvents)() or dispatched with [sendPostedEvents](qcoreapplication#sendPostedEvents)(). The class provides a [quit](qcoreapplication#quit)() slot and an [aboutToQuit](qcoreapplication#aboutToQuit)() signal. ### Application and Library Paths An application has an [applicationDirPath](qcoreapplication#applicationDirPath)() and an [applicationFilePath](qcoreapplication#applicationFilePath)(). Library paths (see [QLibrary](qlibrary)) can be retrieved with [libraryPaths](qcoreapplication#libraryPaths)() and manipulated by [setLibraryPaths](qcoreapplication#setLibraryPaths)(), [addLibraryPath](qcoreapplication#addLibraryPath)(), and [removeLibraryPath](qcoreapplication#removeLibraryPath)(). ### Internationalization and Translations Translation files can be added or removed using [installTranslator](qcoreapplication#installTranslator)() and [removeTranslator](qcoreapplication#removeTranslator)(). Application strings can be translated using [translate](qcoreapplication#translate)(). The [QObject::tr](qobject#tr)() function is implemented in terms of [translate](qcoreapplication#translate)(). ### Accessing Command Line Arguments The command line arguments which are passed to QCoreApplication's constructor should be accessed using the [arguments](qcoreapplication#arguments)() function. **Note:** QCoreApplication removes option `-qmljsdebugger="..."`. It parses the argument of `qmljsdebugger`, and then removes this option plus its argument. For more advanced command line option handling, create a [QCommandLineParser](qcommandlineparser). ### Locale Settings On Unix/Linux Qt is configured to use the system locale settings by default. This can cause a conflict when using POSIX functions, for instance, when converting between data types such as floats and strings, since the notation may differ between locales. To get around this problem, call the POSIX function `setlocale(LC_NUMERIC,"C")` right after initializing [QApplication](qapplication), [QGuiApplication](qguiapplication) or QCoreApplication to reset the locale that is used for number formatting to "C"-locale. **See also** [QGuiApplication](qguiapplication), [QAbstractEventDispatcher](qabstracteventdispatcher), [QEventLoop](qeventloop), [Semaphores Example](https://doc.qt.io/qt-6.2/qtcore-threads-semaphores-example.html), and [Wait Conditions Example](https://doc.qt.io/qt-6.2/qtcore-threads-waitconditions-example.html). Property Documentation ---------------------- ### applicationName : [QString](qstring) This property holds the name of this application The value is used by the [QSettings](qsettings) class when it is constructed using the empty constructor. This saves having to repeat this information each time a [QSettings](qsettings) object is created. If not set, the application name defaults to the executable name (since 5.0). **Access functions:** | | | | --- | --- | | QString | **applicationName**() | | void | **setApplicationName**(const QString &*application*) | **Notifier signal:** | | | | --- | --- | | void | **applicationNameChanged**() | **See also** [organizationName](qcoreapplication#organizationName-prop), [organizationDomain](qcoreapplication#organizationDomain-prop), [applicationVersion](qcoreapplication#applicationVersion-prop), and [applicationFilePath](qcoreapplication#applicationFilePath)(). ### applicationVersion : [QString](qstring) This property holds the version of this application If not set, the application version defaults to a platform-specific value determined from the main application executable or package (since Qt 5.9): | Platform | Source | | --- | --- | | Windows (classic desktop) | PRODUCTVERSION parameter of the VERSIONINFO resource | | macOS, iOS, tvOS, watchOS | CFBundleVersion property of the information property list | | Android | android:versionName property of the AndroidManifest.xml manifest element | On other platforms, the default is the empty string. **Access functions:** | | | | --- | --- | | QString | **applicationVersion**() | | void | **setApplicationVersion**(const QString &*version*) | **Notifier signal:** | | | | --- | --- | | void | **applicationVersionChanged**() | **See also** [applicationName](qcoreapplication#applicationName-prop), [organizationName](qcoreapplication#organizationName-prop), and [organizationDomain](qcoreapplication#organizationDomain-prop). ### organizationDomain : [QString](qstring) This property holds the Internet domain of the organization that wrote this application The value is used by the [QSettings](qsettings) class when it is constructed using the empty constructor. This saves having to repeat this information each time a [QSettings](qsettings) object is created. On Mac, [QSettings](qsettings) uses organizationDomain() as the organization if it's not an empty string; otherwise it uses [organizationName](qcoreapplication#organizationName-prop)(). On all other platforms, [QSettings](qsettings) uses [organizationName](qcoreapplication#organizationName-prop)() as the organization. **Access functions:** | | | | --- | --- | | QString | **organizationDomain**() | | void | **setOrganizationDomain**(const QString &*orgDomain*) | **Notifier signal:** | | | | --- | --- | | void | **organizationDomainChanged**() | **See also** [organizationName](qcoreapplication#organizationName-prop), [applicationName](qcoreapplication#applicationName-prop), and [applicationVersion](qcoreapplication#applicationVersion-prop). ### organizationName : [QString](qstring) This property holds the name of the organization that wrote this application The value is used by the [QSettings](qsettings) class when it is constructed using the empty constructor. This saves having to repeat this information each time a [QSettings](qsettings) object is created. On Mac, [QSettings](qsettings) uses [organizationDomain](qcoreapplication#organizationDomain-prop)() as the organization if it's not an empty string; otherwise it uses organizationName(). On all other platforms, [QSettings](qsettings) uses organizationName() as the organization. **Access functions:** | | | | --- | --- | | QString | **organizationName**() | | void | **setOrganizationName**(const QString &*orgName*) | **Notifier signal:** | | | | --- | --- | | void | **organizationNameChanged**() | **See also** [organizationDomain](qcoreapplication#organizationDomain-prop) and [applicationName](qcoreapplication#applicationName-prop). ### quitLockEnabled : bool This property holds whether the use of the [QEventLoopLocker](qeventlooplocker) feature can cause the application to quit. The default is `true`. **Access functions:** | | | | --- | --- | | bool | **isQuitLockEnabled**() | | void | **setQuitLockEnabled**(bool *enabled*) | **See also** [QEventLoopLocker](qeventlooplocker). Member Function Documentation ----------------------------- ### QCoreApplication::QCoreApplication(int &*argc*, char \*\**argv*) Constructs a Qt core application. Core applications are applications without a graphical user interface. Such applications are used at the console or as server processes. The *argc* and *argv* arguments are processed by the application, and made available in a more convenient form by the [arguments](qcoreapplication#arguments)() function. **Warning:** The data referred to by *argc* and *argv* must stay valid for the entire lifetime of the QCoreApplication object. In addition, *argc* must be greater than zero and *argv* must contain at least one valid character string. ### `[private signal]` void QCoreApplication::aboutToQuit() This signal is emitted when the application is about to quit the main event loop, e.g. when the event loop level drops to zero. This may happen either after a call to [quit](qcoreapplication#quit)() from inside the application or when the user shuts down the entire desktop session. The signal is particularly useful if your application has to do some last-second cleanup. Note that no user interaction is possible in this state. **Note:** This is a private signal. It can be used in signal connections but cannot be emitted by the user. **See also** [quit](qcoreapplication#quit)(). ### `[static slot]` void QCoreApplication::exit(int *returnCode* = 0) Tells the application to exit with a return code. After this function has been called, the application leaves the main event loop and returns from the call to [exec](qcoreapplication#exec)(). The [exec](qcoreapplication#exec)() function returns *returnCode*. If the event loop is not running, this function does nothing. By convention, a *returnCode* of 0 means success, and any non-zero value indicates an error. It's good practice to always connect signals to this slot using a [QueuedConnection](qt#ConnectionType-enum). If a signal connected (non-queued) to this slot is emitted before control enters the main event loop (such as before "int main" calls [exec](qcoreapplication#exec)()), the slot has no effect and the application never exits. Using a queued connection ensures that the slot will not be invoked until after control enters the main event loop. Note that unlike the C library function of the same name, this function *does* return to the caller -- it is event processing that stops. Note also that this function is not thread-safe. It should be called only from the main thread (the thread that the [QCoreApplication](qcoreapplication) object is processing events on). To ask the application to exit from another thread, either use [QCoreApplication::quit](qcoreapplication#quit)() or instead call this function from the main thread with QMetaMethod::invokeMethod(). **See also** [quit](qcoreapplication#quit)() and [exec](qcoreapplication#exec)(). ### `[static slot]` void QCoreApplication::quit() Asks the application to quit. The request may be ignored if the application prevents the quit, for example if one of its windows can't be closed. The application can affect this by handling the [QEvent::Quit](qevent#Type-enum) event on the application level, or [QEvent::Close](qevent#Type-enum) events for the individual windows. If the quit is not interrupted the application will exit with return code 0 (success). To exit the application without a chance of being interrupted, call [exit](qcoreapplication#exit)() directly. Note that method is not thread-safe. It's good practice to always connect signals to this slot using a [QueuedConnection](qt#ConnectionType-enum). If a signal connected (non-queued) to this slot is emitted before control enters the main event loop (such as before "int main" calls [exec](qcoreapplication#exec)()), the slot has no effect and the application never exits. Using a queued connection ensures that the slot will not be invoked until after control enters the main event loop. Example: ``` QPushButton *quitButton = new QPushButton("Quit"); connect(quitButton, &QPushButton::clicked, &app, &QCoreApplication::quit, Qt::QueuedConnection); ``` **Thread-safety note**: this function may be called from any thread to thread-safely cause the currently-running main application loop to exit. However, thread-safety is not guaranteed if the [QCoreApplication](qcoreapplication) object is being destroyed at the same time. **Note:** This function is [thread-safe](threads-reentrancy). **See also** [exit](qcoreapplication#exit)() and [aboutToQuit](qcoreapplication#aboutToQuit)(). ### `[virtual]` QCoreApplication::~QCoreApplication() Destroys the [QCoreApplication](qcoreapplication) object. ### `[static]` void QCoreApplication::addLibraryPath(const [QString](qstring) &*path*) Prepends *path* to the beginning of the library path list, ensuring that it is searched for libraries first. If *path* is empty or already in the path list, the path list is not changed. The default path list consists of one or two entries. The first is the installation directory for plugins, which is `INSTALL/plugins`, where `INSTALL` is the directory where Qt was installed. The second is the application's own directory (**not** the current directory), but only after the [QCoreApplication](qcoreapplication) object is instantiated. The library paths are reset to the default when an instance of [QCoreApplication](qcoreapplication) is destructed. **See also** [removeLibraryPath](qcoreapplication#removeLibraryPath)(), [libraryPaths](qcoreapplication#libraryPaths)(), and [setLibraryPaths](qcoreapplication#setLibraryPaths)(). ### `[static]` [QString](qstring) QCoreApplication::applicationDirPath() Returns the directory that contains the application executable. For example, if you have installed Qt in the `C:\Qt` directory, and you run the `regexp` example, this function will return "C:/Qt/examples/tools/regexp". On macOS and iOS this will point to the directory actually containing the executable, which may be inside an application bundle (if the application is bundled). **Warning:** On Linux, this function will try to get the path from the `/proc` file system. If that fails, it assumes that `argv[0]` contains the absolute file name of the executable. The function also assumes that the current directory has not been changed by the application. **See also** [applicationFilePath](qcoreapplication#applicationFilePath)(). ### `[static]` [QString](qstring) QCoreApplication::applicationFilePath() Returns the file path of the application executable. For example, if you have installed Qt in the `/usr/local/qt` directory, and you run the `regexp` example, this function will return "/usr/local/qt/examples/tools/regexp/regexp". **Warning:** On Linux, this function will try to get the path from the `/proc` file system. If that fails, it assumes that `argv[0]` contains the absolute file name of the executable. The function also assumes that the current directory has not been changed by the application. **See also** [applicationDirPath](qcoreapplication#applicationDirPath)(). ### `[static]` [qint64](qtglobal#qint64-typedef) QCoreApplication::applicationPid() Returns the current process ID for the application. ### `[static]` [QStringList](qstringlist) QCoreApplication::arguments() Returns the list of command-line arguments. Usually arguments().at(0) is the program name, arguments().at(1) is the first argument, and arguments().last() is the last argument. See the note below about Windows. Calling this function is slow - you should store the result in a variable when parsing the command line. **Warning:** On Unix, this list is built from the argc and argv parameters passed to the constructor in the main() function. The string-data in argv is interpreted using [QString::fromLocal8Bit](qstring#fromLocal8Bit)(); hence it is not possible to pass, for example, Japanese command line arguments on a system that runs in a Latin1 locale. Most modern Unix systems do not have this limitation, as they are Unicode-based. On Windows, the list is built from the argc and argv parameters only if modified argv/argc parameters are passed to the constructor. In that case, encoding problems might occur. Otherwise, the arguments() are constructed from the return value of [GetCommandLine()](https://docs.microsoft.com/en-us/windows/win32/api/processenv/nf-processenv-getcommandlinea). As a result of this, the string given by arguments().at(0) might not be the program name on Windows, depending on how the application was started. **See also** [applicationFilePath](qcoreapplication#applicationFilePath)() and [QCommandLineParser](qcommandlineparser). ### `[static]` bool QCoreApplication::closingDown() Returns `true` if the application objects are being destroyed; otherwise returns `false`. **See also** [startingUp](qcoreapplication#startingUp)(). ### `[override virtual protected]` bool QCoreApplication::event([QEvent](qevent) \**e*) Reimplements: [QObject::event](qobject#event)(QEvent \*e). ### `[static]` [QAbstractEventDispatcher](qabstracteventdispatcher) \*QCoreApplication::eventDispatcher() Returns a pointer to the event dispatcher object for the main thread. If no event dispatcher exists for the thread, this function returns `nullptr`. **See also** [setEventDispatcher](qcoreapplication#setEventDispatcher)(). ### `[static]` int QCoreApplication::exec() Enters the main event loop and waits until [exit](qcoreapplication#exit)() is called. Returns the value that was passed to [exit](qcoreapplication#exit)() (which is 0 if [exit](qcoreapplication#exit)() is called via [quit](qcoreapplication#quit)()). It is necessary to call this function to start event handling. The main event loop receives events from the window system and dispatches these to the application widgets. To make your application perform idle processing (by executing a special function whenever there are no pending events), use a [QTimer](qtimer) with 0 timeout. More advanced idle processing schemes can be achieved using [processEvents](qcoreapplication#processEvents)(). We recommend that you connect clean-up code to the [aboutToQuit](qcoreapplication#aboutToQuit)() signal, instead of putting it in your application's `main()` function because on some platforms the exec() call may not return. For example, on Windows when the user logs off, the system terminates the process after Qt closes all top-level windows. Hence, there is no guarantee that the application will have time to exit its event loop and execute code at the end of the `main()` function after the exec() call. **See also** [quit](qcoreapplication#quit)(), [exit](qcoreapplication#exit)(), [processEvents](qcoreapplication#processEvents)(), and [QApplication::exec](qapplication#exec)(). ### `[since 5.0]` void QCoreApplication::installNativeEventFilter([QAbstractNativeEventFilter](qabstractnativeeventfilter) \**filterObj*) Installs an event filter *filterObj* for all native events received by the application in the main thread. The event filter *filterObj* receives events via its [nativeEventFilter](qabstractnativeeventfilter#nativeEventFilter)() function, which is called for all native events received in the main thread. The [QAbstractNativeEventFilter::nativeEventFilter](qabstractnativeeventfilter#nativeEventFilter)() function should return true if the event should be filtered, i.e. stopped. It should return false to allow normal Qt processing to continue: the native event can then be translated into a [QEvent](qevent) and handled by the standard Qt [event](qevent) filtering, e.g. [QObject::installEventFilter](qobject#installEventFilter)(). If multiple event filters are installed, the filter that was installed last is activated first. **Note:** The filter function set here receives native messages, i.e. MSG or XCB event structs. **Note:** Native event filters will be disabled in the application when the [Qt::AA\_PluginApplication](qt#ApplicationAttribute-enum) attribute is set. For maximum portability, you should always try to use [QEvent](qevent) and [QObject::installEventFilter](qobject#installEventFilter)() whenever possible. This function was introduced in Qt 5.0. **See also** [QObject::installEventFilter](qobject#installEventFilter)(). ### `[static]` bool QCoreApplication::installTranslator([QTranslator](qtranslator) \**translationFile*) Adds the translation file *translationFile* to the list of translation files to be used for translations. Multiple translation files can be installed. Translations are searched for in the reverse order in which they were installed, so the most recently installed translation file is searched first and the first translation file installed is searched last. The search stops as soon as a translation containing a matching string is found. Installing or removing a [QTranslator](qtranslator), or changing an installed [QTranslator](qtranslator) generates a [LanguageChange](qevent#Type-enum) event for the [QCoreApplication](qcoreapplication) instance. A [QApplication](qapplication) instance will propagate the event to all toplevel widgets, where a reimplementation of changeEvent can re-translate the user interface by passing user-visible strings via the [tr](qobject#tr)() function to the respective property setters. User-interface classes generated by Qt Designer provide a `retranslateUi()` function that can be called. The function returns `true` on success and false on failure. **See also** [removeTranslator](qcoreapplication#removeTranslator)(), [translate](qcoreapplication#translate)(), [QTranslator::load](qtranslator#load)(), and [Dynamic Translation](internationalization#dynamic-translation). ### `[static]` [QCoreApplication](qcoreapplication#QCoreApplication) \*QCoreApplication::instance() Returns a pointer to the application's [QCoreApplication](qcoreapplication) (or [QGuiApplication](qguiapplication)/[QApplication](qapplication)) instance. If no instance has been allocated, `nullptr` is returned. ### `[static, since 5.3]` bool QCoreApplication::isSetuidAllowed() Returns true if the application is allowed to run setuid on UNIX platforms. This function was introduced in Qt 5.3. **See also** [QCoreApplication::setSetuidAllowed](qcoreapplication#setSetuidAllowed)(). ### `[static]` [QStringList](qstringlist) QCoreApplication::libraryPaths() Returns a list of paths that the application will search when dynamically loading libraries. The return value of this function may change when a [QCoreApplication](qcoreapplication) is created. It is not recommended to call it before creating a [QCoreApplication](qcoreapplication). The directory of the application executable (**not** the working directory) is part of the list if it is known. In order to make it known a [QCoreApplication](qcoreapplication) has to be constructed as it will use `argv[0]` to find it. Qt provides default library paths, but they can also be set using a [qt.conf](qt-conf) file. Paths specified in this file will override default values. Note that if the qt.conf file is in the directory of the application executable, it may not be found until a [QCoreApplication](qcoreapplication) is created. If it is not found when calling this function, the default library paths will be used. The list will include the installation directory for plugins if it exists (the default installation directory for plugins is `INSTALL/plugins`, where `INSTALL` is the directory where Qt was installed). The colon separated entries of the `QT_PLUGIN_PATH` environment variable are always added. The plugin installation directory (and its existence) may change when the directory of the application executable becomes known. If you want to iterate over the list, you can use the [foreach](containers#foreach) pseudo-keyword: ``` foreach (const QString &path, app.libraryPaths()) do_something(path); ``` **See also** [setLibraryPaths](qcoreapplication#setLibraryPaths)(), [addLibraryPath](qcoreapplication#addLibraryPath)(), [removeLibraryPath](qcoreapplication#removeLibraryPath)(), [QLibrary](qlibrary), and [How to Create Qt Plugins](plugins-howto). ### `[virtual]` bool QCoreApplication::notify([QObject](qobject#QObject) \**receiver*, [QEvent](qevent) \**event*) Sends *event* to *receiver*: *receiver*->event(*event*). Returns the value that is returned from the receiver's event handler. Note that this function is called for all events sent to any object in any thread. For certain types of events (e.g. mouse and key events), the event will be propagated to the receiver's parent and so on up to the top-level object if the receiver is not interested in the event (i.e., it returns `false`). There are five different ways that events can be processed; reimplementing this virtual function is just one of them. All five approaches are listed below: 1. Reimplementing [paintEvent](qwidget#paintEvent)(), [mousePressEvent](qwidget#mousePressEvent)() and so on. This is the most common, easiest, and least powerful way. 2. Reimplementing this function. This is very powerful, providing complete control; but only one subclass can be active at a time. 3. Installing an event filter on [QCoreApplication::instance](qcoreapplication#instance)(). Such an event filter is able to process all events for all widgets, so it's just as powerful as reimplementing notify(); furthermore, it's possible to have more than one application-global event filter. Global event filters even see mouse events for [disabled widgets](qwidget#enabled-prop). Note that application event filters are only called for objects that live in the main thread. 4. Reimplementing [QObject::event](qobject#event)() (as [QWidget](qwidget) does). If you do this you get Tab key presses, and you get to see the events before any widget-specific event filters. 5. Installing an event filter on the object. Such an event filter gets all the events, including Tab and Shift+Tab key press events, as long as they do not change the focus widget. **Future direction:** This function will not be called for objects that live outside the main thread in Qt 6. Applications that need that functionality should find other solutions for their event inspection needs in the meantime. The change may be extended to the main thread, causing this function to be deprecated. **Warning:** If you override this function, you must ensure all threads that process events stop doing so before your application object begins destruction. This includes threads started by other libraries that you may be using, but does not apply to Qt's own threads. **See also** [QObject::event](qobject#event)() and [installNativeEventFilter](qcoreapplication#installNativeEventFilter)(). ### `[static]` void QCoreApplication::postEvent([QObject](qobject#QObject) \**receiver*, [QEvent](qevent) \**event*, int *priority* = Qt::NormalEventPriority) Adds the event *event*, with the object *receiver* as the receiver of the event, to an event queue and returns immediately. The event must be allocated on the heap since the post event queue will take ownership of the event and delete it once it has been posted. It is *not safe* to access the event after it has been posted. When control returns to the main event loop, all events that are stored in the queue will be sent using the [notify](qcoreapplication#notify)() function. Events are sorted in descending *priority* order, i.e. events with a high *priority* are queued before events with a lower *priority*. The *priority* can be any integer value, i.e. between INT\_MAX and INT\_MIN, inclusive; see [Qt::EventPriority](qt#EventPriority-enum) for more details. Events with equal *priority* will be processed in the order posted. **Note:** This function is [thread-safe](threads-reentrancy). **See also** [sendEvent](qcoreapplication#sendEvent)(), [notify](qcoreapplication#notify)(), [sendPostedEvents](qcoreapplication#sendPostedEvents)(), and [Qt::EventPriority](qt#EventPriority-enum). ### `[static]` void QCoreApplication::processEvents([QEventLoop::ProcessEventsFlags](qeventloop#ProcessEventsFlag-enum) *flags* = QEventLoop::AllEvents) Processes some pending events for the calling thread according to the specified *flags*. Use of this function is discouraged. Instead, prefer to move long operations out of the GUI thread into an auxiliary one and to completely avoid nested event loop processing. If event processing is really necessary, consider using [QEventLoop](qeventloop) instead. In the event that you are running a local loop which calls this function continuously, without an event loop, the [DeferredDelete](qevent#Type-enum) events will not be processed. This can affect the behaviour of widgets, e.g. [QToolTip](qtooltip), that rely on [DeferredDelete](qevent#Type-enum) events to function properly. An alternative would be to call [sendPostedEvents](qcoreapplication#sendPostedEvents)() from within that local loop. Calling this function processes events only for the calling thread, and returns after all available events have been processed. Available events are events queued before the function call. This means that events that are posted while the function runs will be queued until a later round of event processing. **Note:** This function is [thread-safe](threads-reentrancy). **See also** [exec](qcoreapplication#exec)(), [QTimer](qtimer), [QEventLoop::processEvents](qeventloop#processEvents)(), and [sendPostedEvents](qcoreapplication#sendPostedEvents)(). ### `[static]` void QCoreApplication::processEvents([QEventLoop::ProcessEventsFlags](qeventloop#ProcessEventsFlag-enum) *flags*, int *ms*) This function overloads processEvents(). Processes pending events for the calling thread for *ms* milliseconds or until there are no more events to process, whichever is shorter. Use of this function is discouraged. Instead, prefer to move long operations out of the GUI thread into an auxiliary one and to completely avoid nested event loop processing. If event processing is really necessary, consider using [QEventLoop](qeventloop) instead. Calling this function processes events only for the calling thread. **Note:** Unlike the [processEvents](qcoreapplication#processEvents)() overload, this function also processes events that are posted while the function runs. **Note:** All events that were queued before the timeout will be processed, however long it takes. **Note:** This function is [thread-safe](threads-reentrancy). **See also** [exec](qcoreapplication#exec)(), [QTimer](qtimer), and [QEventLoop::processEvents](qeventloop#processEvents)(). ### `[static]` void QCoreApplication::removeLibraryPath(const [QString](qstring) &*path*) Removes *path* from the library path list. If *path* is empty or not in the path list, the list is not changed. The library paths are reset to the default when an instance of [QCoreApplication](qcoreapplication) is destructed. **See also** [addLibraryPath](qcoreapplication#addLibraryPath)(), [libraryPaths](qcoreapplication#libraryPaths)(), and [setLibraryPaths](qcoreapplication#setLibraryPaths)(). ### `[since 5.0]` void QCoreApplication::removeNativeEventFilter([QAbstractNativeEventFilter](qabstractnativeeventfilter) \**filterObject*) Removes an event *filterObject* from this object. The request is ignored if such an event filter has not been installed. All event filters for this object are automatically removed when this object is destroyed. It is always safe to remove an event filter, even during event filter activation (i.e. from the nativeEventFilter() function). This function was introduced in Qt 5.0. **See also** [installNativeEventFilter](qcoreapplication#installNativeEventFilter)(). ### `[static]` void QCoreApplication::removePostedEvents([QObject](qobject#QObject) \**receiver*, int *eventType* = 0) Removes all events of the given *eventType* that were posted using [postEvent](qcoreapplication#postEvent)() for *receiver*. The events are *not* dispatched, instead they are removed from the queue. You should never need to call this function. If you do call it, be aware that killing events may cause *receiver* to break one or more invariants. If *receiver* is `nullptr`, the events of *eventType* are removed for all objects. If *eventType* is 0, all the events are removed for *receiver*. You should never call this function with *eventType* of 0. **Note:** This function is [thread-safe](threads-reentrancy). ### `[static]` bool QCoreApplication::removeTranslator([QTranslator](qtranslator) \**translationFile*) Removes the translation file *translationFile* from the list of translation files used by this application. (It does not delete the translation file from the file system.) The function returns `true` on success and false on failure. **See also** [installTranslator](qcoreapplication#installTranslator)(), [translate](qcoreapplication#translate)(), and [QObject::tr](qobject#tr)(). ### `[static]` bool QCoreApplication::sendEvent([QObject](qobject#QObject) \**receiver*, [QEvent](qevent) \**event*) Sends event *event* directly to receiver *receiver*, using the [notify](qcoreapplication#notify)() function. Returns the value that was returned from the event handler. The event is *not* deleted when the event has been sent. The normal approach is to create the event on the stack, for example: ``` QMouseEvent event(QEvent::MouseButtonPress, pos, 0, 0, 0); QApplication::sendEvent(mainWindow, &event); ``` **See also** [postEvent](qcoreapplication#postEvent)() and [notify](qcoreapplication#notify)(). ### `[static]` void QCoreApplication::sendPostedEvents([QObject](qobject#QObject) \**receiver* = nullptr, int *event\_type* = 0) Immediately dispatches all events which have been previously queued with [QCoreApplication::postEvent](qcoreapplication#postEvent)() and which are for the object *receiver* and have the event type *event\_type*. Events from the window system are *not* dispatched by this function, but by [processEvents](qcoreapplication#processEvents)(). If *receiver* is `nullptr`, the events of *event\_type* are sent for all objects. If *event\_type* is 0, all the events are sent for *receiver*. **Note:** This method must be called from the thread in which its [QObject](qobject) parameter, *receiver*, lives. **See also** [postEvent](qcoreapplication#postEvent)(). ### `[static]` void QCoreApplication::setAttribute([Qt::ApplicationAttribute](qt#ApplicationAttribute-enum) *attribute*, bool *on* = true) Sets the attribute *attribute* if *on* is true; otherwise clears the attribute. **Note:** Some application attributes must be set **before** creating a [QCoreApplication](qcoreapplication) instance. Refer to the [Qt::ApplicationAttribute](qt#ApplicationAttribute-enum) documentation for more information. **See also** [testAttribute](qcoreapplication#testAttribute)(). ### `[static]` void QCoreApplication::setEventDispatcher([QAbstractEventDispatcher](qabstracteventdispatcher) \**eventDispatcher*) Sets the event dispatcher for the main thread to *eventDispatcher*. This is only possible as long as there is no event dispatcher installed yet. That is, before [QCoreApplication](qcoreapplication) has been instantiated. This method takes ownership of the object. **See also** [eventDispatcher](qcoreapplication#eventDispatcher)(). ### `[static]` void QCoreApplication::setLibraryPaths(const [QStringList](qstringlist) &*paths*) Sets the list of directories to search when loading plugins with [QLibrary](qlibrary) to *paths*. All existing paths will be deleted and the path list will consist of the paths given in *paths* and the path to the application. The library paths are reset to the default when an instance of [QCoreApplication](qcoreapplication) is destructed. **See also** [libraryPaths](qcoreapplication#libraryPaths)(), [addLibraryPath](qcoreapplication#addLibraryPath)(), [removeLibraryPath](qcoreapplication#removeLibraryPath)(), and [QLibrary](qlibrary). ### `[static, since 5.3]` void QCoreApplication::setSetuidAllowed(bool *allow*) Allows the application to run setuid on UNIX platforms if *allow* is true. If *allow* is false (the default) and Qt detects the application is running with an effective user id different than the real user id, the application will be aborted when a [QCoreApplication](qcoreapplication) instance is created. Qt is not an appropriate solution for setuid programs due to its large attack surface. However some applications may be required to run in this manner for historical reasons. This flag will prevent Qt from aborting the application when this is detected, and must be set before a [QCoreApplication](qcoreapplication) instance is created. **Note:** It is strongly recommended not to enable this option since it introduces security risks. This function was introduced in Qt 5.3. **See also** [isSetuidAllowed](qcoreapplication#isSetuidAllowed)(). ### `[static]` bool QCoreApplication::startingUp() Returns `true` if an application object has not been created yet; otherwise returns `false`. **See also** [closingDown](qcoreapplication#closingDown)(). ### `[static]` bool QCoreApplication::testAttribute([Qt::ApplicationAttribute](qt#ApplicationAttribute-enum) *attribute*) Returns `true` if attribute *attribute* is set; otherwise returns `false`. **See also** [setAttribute](qcoreapplication#setAttribute)(). ### `[static]` [QString](qstring) QCoreApplication::translate(const char \**context*, const char \**sourceText*, const char \**disambiguation* = nullptr, int *n* = -1) Returns the translation text for *sourceText*, by querying the installed translation files. The translation files are searched from the most recently installed file back to the first installed file. [QObject::tr](qobject#tr)() provides this functionality more conveniently. *context* is typically a class name (e.g., "MyDialog") and *sourceText* is either English text or a short identifying text. *disambiguation* is an identifying string, for when the same *sourceText* is used in different roles within the same context. By default, it is `nullptr`. See the [QTranslator](qtranslator) and [QObject::tr](qobject#tr)() documentation for more information about contexts, disambiguations and comments. *n* is used in conjunction with `%n` to support plural forms. See [QObject::tr](qobject#tr)() for details. If none of the translation files contain a translation for *sourceText* in *context*, this function returns a [QString](qstring) equivalent of *sourceText*. This function is not virtual. You can use alternative translation techniques by subclassing [QTranslator](qtranslator). **Note:** This function is [thread-safe](threads-reentrancy). **See also** [QObject::tr](qobject#tr)(), [installTranslator](qcoreapplication#installTranslator)(), [removeTranslator](qcoreapplication#removeTranslator)(), and translate(). Related Non-Members ------------------- ### void qAddPostRoutine(QtCleanUpFunction *ptr*) Adds a global routine that will be called from the [QCoreApplication](qcoreapplication) destructor. This function is normally used to add cleanup routines for program-wide functionality. The cleanup routines are called in the reverse order of their addition. The function specified by *ptr* should take no arguments and should return nothing. For example: ``` static int *global_ptr = nullptr; static void cleanup_ptr() { delete [] global_ptr; global_ptr = nullptr; } void init_ptr() { global_ptr = new int[100]; // allocate data qAddPostRoutine(cleanup_ptr); // delete later } ``` Note that for an application- or module-wide cleanup, qAddPostRoutine() is often not suitable. For example, if the program is split into dynamically loaded modules, the relevant module may be unloaded long before the [QCoreApplication](qcoreapplication) destructor is called. In such cases, if using qAddPostRoutine() is still desirable, [qRemovePostRoutine](qcoreapplication#qRemovePostRoutine)() can be used to prevent a routine from being called by the [QCoreApplication](qcoreapplication) destructor. For example, if that routine was called before the module was unloaded. For modules and libraries, using a reference-counted initialization manager or Qt's parent-child deletion mechanism may be better. Here is an example of a private class that uses the parent-child mechanism to call a cleanup function at the right time: ``` class MyPrivateInitStuff : public QObject { public: static MyPrivateInitStuff *initStuff(QObject *parent) { if (!p) p = new MyPrivateInitStuff(parent); return p; } ~MyPrivateInitStuff() { // cleanup goes here } private: MyPrivateInitStuff(QObject *parent) : QObject(parent) { // initialization goes here } MyPrivateInitStuff *p; }; ``` By selecting the right parent object, this can often be made to clean up the module's data at the right moment. **Note:** This function has been thread-safe since Qt 5.10. **Note:** This function is [thread-safe](threads-reentrancy). **See also** [qRemovePostRoutine](qcoreapplication#qRemovePostRoutine)(). ### `[since 5.3]` void qRemovePostRoutine(QtCleanUpFunction *ptr*) Removes the cleanup routine specified by *ptr* from the list of routines called by the [QCoreApplication](qcoreapplication) destructor. The routine must have been previously added to the list by a call to [qAddPostRoutine](qcoreapplication#qAddPostRoutine)(), otherwise this function has no effect. **Note:** This function has been thread-safe since Qt 5.10. **Note:** This function is [thread-safe](threads-reentrancy). This function was introduced in Qt 5.3. **See also** [qAddPostRoutine](qcoreapplication#qAddPostRoutine)(). Macro Documentation ------------------- ### `[since 5.1]` Q\_COREAPP\_STARTUP\_FUNCTION(QtStartUpFunction *ptr*) Adds a global function that will be called from the [QCoreApplication](qcoreapplication) constructor. This macro is normally used to initialize libraries for program-wide functionality, without requiring the application to call into the library for initialization. The function specified by *ptr* should take no arguments and should return nothing. For example: ``` // Called once QCoreApplication exists static void preRoutineMyDebugTool() { MyDebugTool* tool = new MyDebugTool(QCoreApplication::instance()); QCoreApplication::instance()->installEventFilter(tool); } Q_COREAPP_STARTUP_FUNCTION(preRoutineMyDebugTool) ``` Note that the startup function will run at the end of the [QCoreApplication](qcoreapplication) constructor, before any GUI initialization. If GUI code is required in the function, use a timer (or a queued invocation) to perform the initialization later on, from the event loop. If [QCoreApplication](qcoreapplication) is deleted and another [QCoreApplication](qcoreapplication) is created, the startup function will be invoked again. **Note:** This macro is not suitable for use in library code that is then statically linked into an application since the function may not be called at all due to being eliminated by the linker. **Note:** This function is [reentrant](17-qdoc-commands-thread#reentrant). This function was introduced in Qt 5.1. ### Q\_DECLARE\_TR\_FUNCTIONS(*context*) The Q\_DECLARE\_TR\_FUNCTIONS() macro declares and implements the translation function `tr()` with this signature: ``` static inline QString tr(const char *sourceText, const char *comment = nullptr); ``` This macro is useful if you want to use [QObject::tr](qobject#tr)() in classes that don't inherit from [QObject](qobject). Q\_DECLARE\_TR\_FUNCTIONS() must appear at the very top of the class definition (before the first `public:` or `protected:`). For example: ``` class MyMfcView : public CView { Q_DECLARE_TR_FUNCTIONS(MyMfcView) public: MyMfcView(); ... }; ``` The *context* parameter is normally the class name, but it can be any text. **See also** [Q\_OBJECT](qobject#Q_OBJECT) and [QObject::tr](qobject#tr)().
programming_docs
qt CustomMaterial QML Type CustomMaterial QML Type ======================= Base component for creating custom materials used to shade models. [More...](#details) | | | | --- | --- | | Import Statement: | import QtQuick3D | | Inherits: | [Material](qml-qtquick3d-material) | * [List of all members, including inherited members](https://doc.qt.io/qt-6.2/qml-qtquick3d-custommaterial-members.html) Properties ---------- * **[alwaysDirty](qml-qtquick3d-custommaterial#alwaysDirty-prop)** : bool * **[destinationBlend](qml-qtquick3d-custommaterial#destinationBlend-prop)** : enumeration * **[fragmentShader](qml-qtquick3d-custommaterial#fragmentShader-prop)** : url * **[lineWidth](qml-qtquick3d-custommaterial#lineWidth-prop)** : real * **[shadingMode](qml-qtquick3d-custommaterial#shadingMode-prop)** : enumeration * **[sourceBlend](qml-qtquick3d-custommaterial#sourceBlend-prop)** : enumeration * **[vertexShader](qml-qtquick3d-custommaterial#vertexShader-prop)** : url Detailed Description -------------------- The custom material allows using custom shader code for a material, enabling programmability on graphics shader level. A vertex, fragment, or both shaders can be provided. The [vertexShader](qml-qtquick3d-custommaterial#vertexShader-prop) and [fragmentShader](qml-qtquick3d-custommaterial#fragmentShader-prop) properties are URLs, referencing files containing shader snippets, and work very similarly to [ShaderEffect](qml-qtquick-shadereffect) or [Image.source](qml-qtquick-image#source-prop). Only the `file` and `qrc` schemes are supported with custom materials. It is also possible to omit the `file` scheme, allowing to specify a relative path in a convenient way. Such a path is resolved relative to the component's (the `.qml` file's) location. For a getting started guide to custom materials, see the page [Programmable Materials, Effects, Geometry, and Texture data](qtquick3d-custom). Introduction ------------ Consider the following versions of the same scene. On the left, the cylinder is using a built-in, non-programmable material. Such materials are configurable through a wide range of properties, but there is no further control given over the shaders that are generated under the hood. On the right, the same cylinder is now associated with a CustomMaterial referencing application-provided vertex and fragment shader snippets. This allows inserting custom, application-specific logic into the vertex shader to transform the geometry, and to determine certain color properties in a custom manner in the fragment shader. As this is a [shaded](qml-qtquick3d-custommaterial#shadingMode-prop) custom material, the cylinder still participates in the scene lighting normally. | | | | --- | --- | | ``` View3D { anchors.fill: parent PerspectiveCamera { id: camera position: Qt.vector3d(0, 0, 600) } camera: camera DirectionalLight { position: Qt.vector3d(-500, 500, -100) color: Qt.rgba(0.2, 0.2, 0.2, 1.0) ambientColor: Qt.rgba(0.1, 0.1, 0.1, 1.0) } Model { source: "#Cylinder" eulerRotation: Qt.vector3d(30, 30, 0) scale: Qt.vector3d(1.5, 1.5, 1.5) materials: [ DefaultMaterial { diffuseColor: Qt.rgba(0, 1, 0, 1) } ] } } ``` | ``` View3D { anchors.fill: parent PerspectiveCamera { id: camera position: Qt.vector3d(0, 0, 600) } camera: camera DirectionalLight { position: Qt.vector3d(-500, 500, -100) color: Qt.rgba(0.2, 0.2, 0.2, 1.0) ambientColor: Qt.rgba(0.1, 0.1, 0.1, 1.0) } Model { source: "#Cylinder" eulerRotation: Qt.vector3d(30, 30, 0) scale: Qt.vector3d(1.5, 1.5, 1.5) materials: [ CustomMaterial { vertexShader: "material.vert" fragmentShader: "material.frag" property real uTime property real uAmplitude: 50 NumberAnimation on uTime { from: 0; to: 100; duration: 10000; loops: -1 } } ] } } ``` | Let's assume that the shader snippets in `material.vert` and `material.frag` are the following: | | | | --- | --- | | ``` void MAIN() { VERTEX.x += sin(uTime + VERTEX.y) * uAmplitude; } ``` | ``` void MAIN() { BASE_COLOR = vec4(0.0, 1.0, 0.0, 1.0); } ``` | Notice how `uTime` and `uAmplitude` are properties of the CustomMaterial element. They can change values and get animated normally, the values will be exposed to the shaders automatically without any further action from the developer. The result is a cylinder that animates its vertices: Two flavors of custom materials ------------------------------- There are two main types of custom materials. This is specified by the [shadingMode](qml-qtquick3d-custommaterial#shadingMode-prop) property. In [unshaded](qml-qtquick3d-custommaterial#shadingMode-prop) custom materials the fragment shader outputs a single `vec4` color, ignoring lights, light probes, shadowing in the scene. In [shaded](qml-qtquick3d-custommaterial#shadingMode-prop) materials the shader is expected to implement certain functions and work with built-in variables to take lighting and shadow contribution into account. The default choice is typically a shaded material, this is reflected in the default value of the [shadingMode](qml-qtquick3d-custommaterial#shadingMode-prop) property. This fits materials that needs to transform vertices or other incoming data from the geometry, or determine values like `BASE_COLOR` or `EMISSIVE_COLOR` in a custom manner, perhaps by sampling `SCREEN_TEXTURE` or `DEPTH_TEXTURE`, while still reciving light and shadow contributions from the scene. Additionally, such materials can also override and reimplement the equations used to calculate the contributions from directional, point, and other lights. The application-provided shader snippets are heavily amended by the Qt Quick 3D engine under the hood, in order to provide the features, such as lighting, the standard materials have. Unshaded materials are useful when the object's appearance is determined completely by the custom shader code. The shaders for such materials receive minimal additions by the engine, and therefore it is completely up to the shader to determine the final fragment color. This gives more freedom, but also limits possiblities to integrate with other elements of the scene, such as lights. **Note:** Shader code is always provided using Vulkan-style GLSL, regardless of the graphics API used by Qt at run time. **Note:** The vertex and fragment shader code provided by the material are not full, complete GLSL shaders on their own. Rather, they provide a set of functions, which are then amended with further shader code by the engine. Exposing data to the shaders ---------------------------- The dynamic properties of the CustomMaterial can be changed and animated using QML and Qt Quick facilities, and the values are exposed to the shaders automatically. This in practice is very similar [ShaderEffect](qml-qtquick-shadereffect). The following list shows how properties are mapped: * bool, int, real -> bool, int, float * [QColor](qcolor), [color](qml-qtqml-qt#rgba-method) -> vec4, and the color gets converted to linear, assuming sRGB space for the color value specified in QML. The built-in Qt colors, such as `"green"` are in sRGB color space as well, and the same conversion is performed for all color properties of [DefaultMaterial](qml-qtquick3d-defaultmaterial) and [PrincipledMaterial](qml-qtquick3d-principledmaterial), so this behavior of CustomMaterial matches those. Unlike Qt Quick, for Qt Quick 3D linearizing is essential as there will typically be tonemapping performed on the 3D scene. * [QRect](qrect), [QRectF](qrectf), [rect](qml-qtqml-qt#rect-method) -> vec4 * [QPoint](qpoint), [QPointF](qpointf), [point](qml-qtqml-qt#point-method), [QSize](qsize), [QSizeF](qsizef), [size](qml-qtqml-qt#size-method) -> vec2 * [QVector2D](qvector2d), [vector2d](qml-qtqml-qt#vector2d-method) -> vec2 * [QVector3D](qvector3d), [vector3d](qml-qtqml-qt#vector3d-method) -> vec3 * [QVector4D](qvector4d), [vector4d](qml-qtqml-qt#vector4d-method) -> vec4 * [QMatrix4x4](qmatrix4x4), [matrix4x4](qml-qtqml-qt#matrix4x4-method) -> mat4 * [QQuaternion](qquaternion), [quaternion](qml-qtqml-qt#quaternion-method) -> vec4, scalar value is `w` * [TextureInput](qml-qtquick3d-textureinput) -> sampler2D - Textures referencing [image files](qml-qtquick3d-texture#source-prop) and [Qt Quick item layers](qml-qtquick3d-texture#sourceItem-prop) are both supported. Setting the [enabled](qml-qtquick3d-textureinput#enabled-prop) property to false leads to exposing a dummy texture to the shader, meaning the shaders are still functional but will sample a texture with opaque black image content. Pay attention to the fact that properties for samplers must always reference a [TextureInput](qml-qtquick3d-textureinput) object, not a [Texture](qml-qtquick3d-texture) directly. When it comes to the [Texture](qml-qtquick3d-texture) properties, the source, tiling, and filtering related ones are the only ones that are taken into account implicitly with custom materials, as the rest (such as, UV transformations) is up to the custom shaders to implement as they see fit. **Note:** When a uniform referenced in the shader code does not have a corresponding property, it will cause a shader compilation error when processing the material at run time. There are some exceptions to this, such as, sampler uniforms, that get a dummy texture bound when no corresponding QML property is present, but as a general rule, all uniforms and samplers must have a corresponding property declared in the CustomMaterial object. Unshaded custom materials ------------------------- The following is an example of an [unshaded](qml-qtquick3d-custommaterial#shadingMode-prop) custom material. ``` CustomMaterial { // These properties are automatically exposed to the shaders property real time: 0.0 property real amplitude: 5.0 property real alpha: 1.0 property TextureInput tex: TextureInput { enabled: true texture: Texture { source: "image.png" } } shadingMode: CustomMaterial.Unshaded sourceBlend: alpha < 1.0 ? CustomMaterial.SrcAlpha : CustomMaterial.NoBlend destinationBlend: alpha < 1.0 ? CustomMaterial.OneMinusSrcAlpha : CustomMaterial.NoBlend cullMode: CustomMaterial.BackFaceCulling vertexShader: "customshader.vert" fragmentShader: "customshader.frag" } ``` With the above example, the [unshaded](qml-qtquick3d-custommaterial#shadingMode-prop) vertex and fragment shaders snippets could look like the following. Note how the shaders do not, and must not, declare uniforms or vertex inputs as that is taken care of by Qt when assembling the final shader code. ``` VARYING vec3 pos; VARYING vec2 texcoord; void MAIN() { pos = VERTEX; pos.x += sin(time * 4.0 + pos.y) * amplitude; texcoord = UV0; POSITION = MODELVIEWPROJECTION_MATRIX * vec4(pos, 1.0); } ``` ``` VARYING vec3 pos; VARYING vec2 texcoord; void MAIN() { vec4 c = texture(tex, texcoord); FRAGCOLOR = vec4(pos.x * 0.02, pos.y * 0.02, pos.z * 0.02, alpha) * c; } ``` The following special, uppercase keywords are available: * MAIN -> the name of the entry point in the vertex or fragment shader snippet must always be `MAIN`. Providing this function is mandatory in shader snippets for unshaded custom materials. * VARYING -> declares an output from the vertex shader or an input to the fragment shader * POSITION -> vec4, the output from the vertex shader * FRAGCOLOR -> vec4, the output from the fragment shader. Available only for unshaded custom materials. * VERTEX -> vec3, the vertex position in the vertex shader. * NORMAL -> vec3, the vertex normal in the vertex shader. When the mesh for the associated model does not provide normals, the value is vec3(0.0). * UV0 -> vec2, the first set of texture coordinates in the vertex shader. When the mesh for the associated model does not provide texture coordinates, the value is vec2(0.0). * UV1 -> vec2, the second set of texture coordinates in the vertex shader. When the mesh for the associated model does not provide a second set of texture coordinates, the value is vec2(0.0). * COLOR -> vec4, the vertex color in the vertex shader. When the mesh for the associated model does not provide per-vertex colors, the value is vec4(1.0). * TANGENT -> vec3, tangent in the vertex shader. When the mesh for the associated model does not provide tangent data, the value is vec3(0.0). * BINORMAL -> vec3, binormal in the vertex shader. When the mesh for the associated model does not provide binormal data, the value is vec3(0.0). * JOINTS -> ivec4, joint indexes in the vertex shader. When the mesh for the associated model does not provide joint indexes data, the value is ivec4(0). * WEIGHTS -> vec4, joint weights in the vertex shader. When the mesh for the associated model does not provide joint weights data, the value is vec4(0.0). * MORPH\_POSITION*n* -> vec3, the *n*th morph target position in the vertex shader. *n*'s range is from 0 to 7. The associated model should provide proper data. For safety, the user can check **defined(QT\_MORPH\_IN\_POSITION*n*)** before use it. * MORPH\_NORMAL*n* -> vec3, the *n*th morph target normal in the vertex shader. *n*'s range is from 0 to 4. The associated model should provide proper data. For safety, the user can check **defined(QT\_MORPH\_IN\_NORMAL*n*)** before use it. * MORPH\_TANGENT*n* -> vec3, the *n*th morph target tangent in the vertex shader. *n*'s range is from 0 to 1. The associated model should provide proper data. For safety, the user can check **defined(QT\_MORPH\_IN\_TANGENT*n*)** before use it. * MORPH\_BINORMAL*n* -> vec3, the *n*th morph target binormal in the vertex shader. *n*'s range is from 0 to 1. The associated model should provide proper data. For safety, the user can check **defined(QT\_MORPH\_IN\_BINORMAL*n*)** before use it. * MODELVIEWPROJECTION\_MATRIX -> mat4, the model-view-projection matrix. Projection matrices always follow OpenGL conventions, with a baked-in transformation for the Y axis direction and clip depth, depending on the graphics API used at run time. * VIEWPROJECTION\_MATRIX -> mat4, the view-projection matrix * PROJECTION\_MATRIX -> mat4, the projection matrix * INVERSE\_PROJECTION\_MATRIX -> mat4, the inverse projection matrix * VIEW\_MATRIX -> mat4, the view (camera) matrix * MODEL\_MATRIX -> mat4, the model (world) matrix * NORMAL\_MATRIX -> mat3, the normal matrix (the transpose of the inverse of the top-left 3x3 part of the model matrix) * BONE\_TRANSFORMS -> mat4[], the array of the model's bone matrixes * BONE\_NORMAL\_TRANSFORMS -> mat3[], the array of the model's bone normal matrixes (the transpose of the inverse of the top-left 3x3 part of the each bone matrixes) * MORPH\_WEIGHTS -> float[], the array of the morph weights. The associated model should provide proper data. For safety, **QT\_MORPH\_MAX\_COUNT** is defined to the size of this array. * CAMERA\_POSITION -> vec3, the camera position in world space * CAMERA\_DIRECTION -> vec3, the camera direction vector * CAMERA\_PROPERTIES -> vec2, the near and far clip values for the camera * POINT\_SIZE -> float, writable in the vertex shader only. When rendering geometry with a topology of points, the custom vertex shader must set this to either 1.0 or another value, both in shaded and unshaded custom materials. See [PrincipledMaterial::pointSize](qml-qtquick3d-principledmaterial#pointSize-prop) for further notes on support for sizes other than 1. Shaded custom materials ----------------------- A [shaded](qml-qtquick3d-custommaterial#shadingMode-prop) material `augments` the shader code that would be generated by a [PrincipledMaterial](qml-qtquick3d-principledmaterial). Unlike unshaded materials, that provide almost all logic for the vertex and fragment shader main functions on their own, preventing adding generated code for lighting, shadowing, global illumination, etc., shaded materials let shader generation happen normally, as if the CustomMaterial was a [PrincipledMaterial](qml-qtquick3d-principledmaterial). The vertex and fragment shader snippets are expected to provide optional functions that are then invoked at certain points, giving them the possibility to customize the colors and other values that are then used for calculating lighting and the final fragment color. Rather than implementing just a `MAIN` function, the fragment shader for a shaded custom material can implement multiple functions. All functions, including `MAIN`, are optional to implement in shaded custom materials. An empty shader snippet, or, even, not specifying the [vertexShader](qml-qtquick3d-custommaterial#vertexShader-prop) or [fragmentShader](qml-qtquick3d-custommaterial#fragmentShader-prop) properties at all can be perfectly valid too. ### Vertex shader snippets in a shaded custom material The following functions can be implemented in a vertex shader snippet: * `void MAIN()` When present, this function is called in order to set the value of `POSITION`, the vec4 output from the vertex shader, and, optionally, to modify the values of `VERTEX`, `COLOR`, `NORMAL`, `UV0`, `UV1`, `TANGENT`, `BINORMAL`, `JOINTS`, and `WEIGHTS`. Unlike in unshaded materials, writing to these makes sense because the modified values are then taken into account in the rest of the generated shader code (whereas for unshaded materials there is no additional shader code generated). For example, if the custom vertex shader displaces the vertices or the normals, it will want to store the modified values to `VERTEX` or `NORMAL`, to achieve correct lighting calculations afterwards. Additionally, the function can write to variables defined with `VARYING` in order to pass interpolated data to the fragment shader. When this function or a redefinition of `POSITION` is not present, `POSITION` is calculated based on `VERTEX` and `MODELVIEWPROJECTION_MATRIX`, just like a [PrincipledMaterial](qml-qtquick3d-principledmaterial) would do.Example, with relying both on QML properties exposed as uniforms, and also passing data to the fragment shader: ``` VARYING vec3 vNormal; VARYING vec3 vViewVec; void MAIN() { VERTEX.x += sin(uTime * 4.0 + VERTEX.y) * uAmplitude; vNormal = normalize(NORMAL_MATRIX * NORMAL); vViewVec = CAMERA_POSITION - (MODEL_MATRIX * vec4(VERTEX, 1.0)).xyz; POSITION = MODELVIEWPROJECTION_MATRIX * vec4(VERTEX, 1.0); } ``` **Note:** In the above example, assigning a value to `POSITION` is optional as the usage in this case is identical to the default behavior. ### Fragment shader snippets in a shaded custom material The following functions can be implemented in a fragment shader snippet: * `void MAIN()` When present, this function is called to set the values of the special writable variables `BASE_COLOR`, `METALNESS`, `ROUGHNESS`, `SPECULAR_AMOUNT`, NORMAL, and `FRESNEL_POWER`.One common use case is to set the value of `BASE_COLOR` based on sampling a texture, be it a base color map, `SCREEN_TEXTURE`, or some other kind of source. This can be relevant and convenient especially when no custom light processor functions are implemented. Setting `BASE_COLOR.a` to something other than the default 1.0 allows affecting the final alpha value of the fragment. (note that this will often require also enabling alpha blending in [sourceBlend](qml-qtquick3d-custommaterial#sourceBlend-prop) and [destinationBlend](qml-qtquick3d-custommaterial#destinationBlend-prop)) Another scenario is when there is no custom `SPECULAR_LIGHT` function provided, or when there is a light probe set in the [SceneEnvironment](qml-qtquick3d-sceneenvironment). The metalness, roughness, and other values that affect the specular contribution calculation can be set in `MAIN` to their desired custom values. The function can write to the following special variables. The values written to these will typically be either hardcoded or be calculated based on QML properties mapped to uniforms. The semantics are identical to [PrincipledMaterial](qml-qtquick3d-principledmaterial). + vec4 `BASE_COLOR` - The base color and material alpha value. Corresponds to the [built-in materials' color property](qml-qtquick3d-principledmaterial#baseColor-prop). When light processor functions are not implemented, it can be convenient to set a custom base color in `MAIN` because that is then taken into account in the default lighting calculations. The default value is `vec4(1.0)`, meaning white with an alpha of 1.0. The alpha value effects the final alpha of the fragment. The final alpha value is the object (model) opacity multiplied by the base color alpha. When specifying the value directly in shader code, not relying on uniform values exposed from **color** properties in QML, be aware that it is up to the shader to perform the sRGB to linear conversion, if needed. For example, assuming a `vec3 color` and `float alpha` this can be achieved like the following: ``` float C1 = 0.305306011; vec3 C2 = vec3(0.682171111, 0.682171111, 0.682171111); vec3 C3 = vec3(0.012522878, 0.012522878, 0.012522878); BASE_COLOR = vec4(rgb * (rgb * (rgb * C1 + C2) + C3), alpha); ``` + vec3 `EMISSIVE_COLOR` - The color of self-illumination. Corresponds to the built-in materials' emissive color which is combined by [built-in materials's emissiveFactor property](qml-qtquick3d-principledmaterial#emissiveFactor-prop) and [built-in materials's emissiveMap property](qml-qtquick3d-principledmaterial#emissiveMap-prop). The default value is `vec3(0.0)`. When specifying the value directly in shader code, not relying on uniform values exposed from **color** properties in QML, be aware that it is up to the shader to perform the sRGB to linear conversion, if needed. + float `METALNESS` Metalness amount in range 0.0 - 1.0. The default value is 0. Must be set to a non-zero value to have effect. + float `ROUGHNESS` Roughness value in range 0.0 - 1.0. The default value is 0. + float `FRESNEL_POWER` Specifies the fresnel power. A typical value, and also the default, is `5.0` as that is what a [PrincipledMaterial](qml-qtquick3d-principledmaterial) would use. + float `SPECULAR_AMOUNT` Specular amount in range 0.0 - 1.0. The default value is `0.5`, matching [PrincipledMaterial::specularAmount](qml-qtquick3d-principledmaterial#specularAmount-prop). Must be set to a non-zero value to have effect. + vec3 `NORMAL` - The normal that comes from the vertex shader in world space. While this property has the same initial value as `VAR_WORLD_NORMAL`, only changing the value of `NORMAL` will have an effect on lighting. + vec3 `TANGENT` - The tanget that comes from the vertex shader in world space. This value is potentially adjusted for double-sidedness. + vec3 `BINORMAL` - The binormal that comes from the vertex shader in world space. This value is potentially adjusted for double-sidedness. + vec2 `UV0` - The first set of texture coordinates from the vertex shader. This property is readonly in the fragment shader. + vec2 `UV1` - The second set of texture coordinates from the vertex shader. This property is readonly in the fragment shader. **Note:** Unlike with unshaded materials, the fragment `MAIN` for a shaded material has no direct control over `FRAGCOLOR`. Rather, it is the `DIFFUSE` and `SPECULAR` values written in the light processor functions that decide what the final fragment color is. When a light processor function is not implemented, the relevant default shading calculations are performed as with a [PrincipledMaterial](qml-qtquick3d-principledmaterial), taking `BASE_COLOR` and other values from the list above into account. An example of a simple, metallic custom material shader could be the following: ``` void MAIN() { METALNESS = 1.0; ROUGHNESS = 0.5; FRESNEL_POWER = 5.0; } ``` Another example, where the base color and alpha are set by sampling a texture: ``` VARYING vec2 texcoord; void MAIN() { BASE_COLOR = texture(uColorMap, texcoord); } ``` * `void AMBIENT_LIGHT()` When present, this function is called once for each fragment. The task of the function is to add the total ambient contribution to a writable special variable `DIFFUSE`. It can of course choose to calculate a different value, or not touch `DIFFUSE` at all (to ignore ambient lighting completely). When this function is not present at all, the ambient contribution is calculated normally, like a [PrincipledMaterial](qml-qtquick3d-principledmaterial) would do.The function can write to the following special variables: + vec3 `DIFFUSE` Accumulates the diffuse light contributions, per fragment. The light processor functions will typically add (`+=`) to it, since overwriting the value would lose the contribution from other lights.The function can read the following special variables, in addition to the matrix (such as, `MODEL_MATRIX`) and vector (such as, `CAMERA_POSITION`) uniforms from the table above: + vec3 `TOTAL_AMBIENT_COLOR` The total ambient contribution in the scene.Example: ``` void AMBIENT_LIGHT() { DIFFUSE += TOTAL_AMBIENT_COLOR; } ``` * `void DIRECTIONAL_LIGHT()` When present, this function is called for each active directional light in the scene for each fragment. The task of the function is to add the diffuse contribution to a writable special variable `DIFFUSE`. The function can also choose to do nothing, in which case diffuse contributions from directional lights are ignored. When the function is not present at all, the diffuse contributions from directional lights are accumulated normally, like a [PrincipledMaterial](qml-qtquick3d-principledmaterial) would do.The function can write to the following special variables: + vec3 `DIFFUSE` Accumulates the diffuse light contributions, per fragment. The light processor functions will typically add (`+=`) to it, since overwriting the value would lose the contribution from other lights.The function can read the following special variables, in addition to the matrix (such as, `MODEL_MATRIX`) and vector (such as, `CAMERA_POSITION`) uniforms from the table above: + vec3 `LIGHT_COLOR` Diffuse light color. + float `SHADOW_CONTRIB` Shadow contribution, or 1.0 if not shadowed at all or not reciving shadows. + vec3 `TO_LIGHT_DIR` Vector pointing towards the light source. + vec3 `NORMAL` The normal vector in world space. + vec4 `BASE_COLOR` The base color and material alpha value. + float `METALNESS` The Metalness amount. + float `ROUGHNESS` The Roughness amount.Example: ``` void DIRECTIONAL_LIGHT() { DIFFUSE += LIGHT_COLOR * SHADOW_CONTRIB * vec3(max(0.0, dot(normalize(VAR_WORLD_NORMAL), TO_LIGHT_DIR))); } ``` * `void POINT_LIGHT()` When present, this function is called for each active point light in the scene for each fragment. The task of the function is to add the diffuse contribution to a writable special variable `DIFFUSE`. The function can also choose to do nothing, in which case diffuse contributions from point lights are ignored. When the function is not present at all, the diffuse contributions from point lights are accumulated normally, like a [PrincipledMaterial](qml-qtquick3d-principledmaterial) would do.The function can write to the following special variables: + vec3 `DIFFUSE` Accumulates the diffuse light contributions, per fragment.The function can read the following special variables, in addition to the matrix (such as, `MODEL_MATRIX`) and vector (such as, `CAMERA_POSITION`) uniforms from the table above: + vec3 `LIGHT_COLOR` Diffuse light color. + float `LIGHT_ATTENUATION` Light attenuation. + float `SHADOW_CONTRIB` Shadow contribution, or 1.0 if not shadowed at all or not reciving shadows. + vec3 `TO_LIGHT_DIR` Vector pointing towards the light source. + vec3 `NORMAL` The normal vector in world space. + vec4 `BASE_COLOR` The base color and material alpha value. + float `METALNESS` The Metalness amount. + float `ROUGHNESS` The Roughness amount.Example: ``` void POINT_LIGHT() { DIFFUSE += LIGHT_COLOR * LIGHT_ATTENUATION * SHADOW_CONTRIB * vec3(max(0.0, dot(normalize(VAR_WORLD_NORMAL), TO_LIGHT_DIR))); } ``` * `void SPOT_LIGHT()` When present, this function is called for each active spot light in the scene for each fragment. The task of the function is to add the diffuse contribution to a writable special variable `DIFFUSE`. The function can also choose to do nothing, in which case diffuse contributions from spot lights are ignored. When the function is not present at all, the diffuse contributions from spot lights are accumulated normally, like a [PrincipledMaterial](qml-qtquick3d-principledmaterial) would do.The function can write to the following special variables: + vec3 `DIFFUSE` Accumulates the diffuse light contributions, per fragment.The function can read the following special variables, in addition to the matrix (such as, `MODEL_MATRIX`) and vector (such as, `CAMERA_POSITION`) uniforms from the table above: + vec3 `LIGHT_COLOR` Diffuse light color. + float `LIGHT_ATTENUATION` Light attenuation. + float `SHADOW_CONTRIB` Shadow contribution, or 1.0 if not shadowed at all or not reciving shadows. + vec3 `TO_LIGHT_DIR` Vector pointing towards the light source. + float `SPOT_FACTOR` Spot light factor. + vec3 `NORMAL` The normal vector in world space. + vec4 `BASE_COLOR` The base color and material alpha value. + float `METALNESS` The Metalness amount. + float `ROUGHNESS` The Roughness amount.Example: ``` void SPOT_LIGHT() { DIFFUSE += LIGHT_COLOR * LIGHT_ATTENUATION * SPOT_FACTOR * SHADOW_CONTRIB * vec3(max(0.0, dot(normalize(VAR_WORLD_NORMAL), TO_LIGHT_DIR))); } ``` * `void SPECULAR_LIGHT()` When present, this function is called for each active light in the scene for each fragment. The task of the function is to add the specular contribution to a writable special variable `SPECULAR`. The function can also choose to do nothing, in which case specular contributions from lights are ignored. When the function is not present at all, the specular contributions from lights are accumulated normally, like a [PrincipledMaterial](qml-qtquick3d-principledmaterial) would do.The function can write to the following special variables: + vec3 `SPECULAR` Accumulates the specular light contributions, per frament. The light processor functions will typically add (`+=`) to it, since overwriting the value would lose the contribution from other lights.The function can read the following special variables, in addition to the matrix (such as, `MODEL_MATRIX`) and vector (such as, `CAMERA_POSITION`) uniforms from the table above: + vec3 `LIGHT_COLOR` Specular light color. + float `LIGHT_ATTENUATION` Light attenuation. For directional lights the value is 1.0. For spot lights the value is the same as `LIGHT_ATTENUATION * SPOT_FACTOR` of `void SPOT_LIGHT()`. + float `SHADOW_CONTRIB` Shadow contribution, or 1.0 if not shadowed at all or not reciving shadows. + vec3 `FRESNEL_CONTRIB` Fresnel contribution from built in Fresnel calculation. + vec3 `TO_LIGHT_DIR` Vector pointing towards the light source. + vec3 `NORMAL` The normal vector in world space. + vec4 `BASE_COLOR` The base color and material alpha value. + float `METALNESS` The Metalness amount. + float `ROUGHNESS` The Roughness amount. + float `SPECULAR_AMOUNT` The specular amount. This value will be between 0.0 and 1.0 will be the same value set in the custom `MAIN` function. This value will useful for calculating Fresnel contributions when not using the built-in Fresnel contribution provided by `FRESNEL_CONTRIB`. ``` void SPECULAR_LIGHT() { vec3 H = normalize(VIEW_VECTOR + TO_LIGHT_DIR); float cosAlpha = max(0.0, dot(H, normalize(NORMAL))); float shine = pow(cosAlpha, exp2(15.0 * (1.0 - ROUGHNESS) + 1.0) * 0.25); SPECULAR += shine * LIGHT_COLOR * FRESNEL_CONTRIB * SHADOW_CONTRIB * LIGHT_ATTENUATION; } ``` * `void POST_PROCESS()` When present, this function is called at the end of the fragment pipeline. The task of the function is to finalize `COLOR_SUM` with final diffuse, specular and emissive terms. Unlike `FRAGCOLOR` for a unshaded material, `COLOR_SUM` will be automatically tonemapped before written to the framebuffer. For debugging purposes it is sometimes useful to output a value that should not be treated as a color. To avoid the tonemapping distorting this value it can be disabled by setting the [tonemapMode](qml-qtquick3d-sceneenvironment#tonemapMode-prop) property to `TonemapModeNone`The function can write to the following special variables: + vec4 `COLOR_SUM` the output from the fragment shader. The default value is vec4(DIFFUSE.rgb + SPECULAR + EMISSIVE, DIFFUSE.a)The function can read the following special variables. + vec4 `DIFFUSE` The final diffuse term of the fragment pipeline. + vec3 `SPECULAR` The final specular term of the fragment pipeline. + vec3 `EMISSIVE` The final emissive term of the fragment pipeline. + vec2 `UV0` - The first set of texture coordinates from the vertex shader. + vec2 `UV1` - The second set of texture coordinates from the vertex shader. ``` void POST_PROCESS() { float center_x = textureSize(SCREEN_TEXTURE, 0).x * 0.5; if (gl_FragCoord.x > center_x) COLOR_SUM = DIFFUSE; else COLOR_SUM = vec4(EMISSIVE, DIFFUSE.a); } ``` ### Custom variables between functions Additional variables can be delivered from the MAIN function to the others. The `SHARED_VARS` keyword can be used for defining new custom variables. These user-defined variables can be accessed with SHARED.<variable name>. For example, a shaded custom material can fetch a shared value in the MAIN and use it in other functions. ``` SHARED_VARS { vec3 colorThreshold; }; void MAIN() { BASE_COLOR = texture(baseColorMap, UV0); SHARED.colorThreshold = texture(thresholdMap, UV0).rgb; } void DIRECTIONAL_LIGHT() { if (DIFFUSE >= SHARED.colorThreshold) { DIFFUSE = SHARED.colorThreshold; return; } DIFFUSE += LIGHT_COLOR * SHADOW_CONTRIB; } ``` **Note:** SHARED can be written on all the functions without POST\_PROCESS but it is safe to write it on MAIN and read on the other functions. **Note:** A recommended use case to write SHARED on LIGHT functions is reseting it on MAIN first and then accumulating it on each LIGHT functions. ``` SHARED_VARS { float sheenIntensity; float sheenRoughness; vec3 sheenColor; vec3 outSheenColor; }; void MAIN() { ... vec4 tex = texture(uSheenMap, UV0); SHARED.sheenColor = tex.rgb; SHARED.sheenIntensity = tex.a; SHARED.sheenRoughness = uSheenRoughness; SHARED.outSheenColor = vec3(0.0); } void SPECULAR_LIGHT() { SHARED.outSheenColor += ...; } void POST_PROCESS() { COLOR_SUM = DIFFUSE + SPECULAR + EMISSIVE + SHARED.outSheenColor; } ``` **Note:** MAIN is called before others, and POST\_PROCESS after all others, but that there is no guarantee for any other ordering for light processors. ### Additional special keywords The custom fragment shader code can freely access uniforms (such as, `CAMERA_DIRECTION` or `CAMERA_POSITION`), and varyings passed on from the custom vertex shader. Additionally, there are a number of built-in varyings available as special keywords. Some of these are optional in the sense that a vertex `MAIN` could calculate and pass on these on its own, but to reduce duplicated data fragment shaders can also rely on these built-ins instead. These built-ins are available in light processor functions and in the fragment MAIN. * vec3 `VAR_WORLD_NORMAL` - Interpolated normal transformed by `NORMAL_MATRIX`. * vec3 `VAR_WORLD_TANGENT` - Interpolated tangent transformed by `MODEL_MATRIX`. * vec3 `VAR_WORLD_BINORMAL` - Interpolated binormal transformed by `MODEL_MATRIX` * vec3 `NORMAL` - Unlike `VAR_WORLD_NORMAL`, which is the interpolated normal as-is, this value is potentially adjusted for double-sidedness: when rendering with culling disabled, the normal will get inverted as necessary. Therefore lighting and other calculations are recommended to use `NORMAL` instead of `VAR_WORLD_NORMAL` in order behave correctly with all culling modes. * vec3 `TANGENT` - Like `NORMAL`, this value is potentially adjusted for double-sidedness: when rendering with culling disabled, the tangent will get inverted as necessary. * vec3 `BINORMAL` - Like `NORMAL`, this value is potentially adjusted for double-sidedness: when rendering with culling disabled, the binormal will get inverted as necessary. * vec3 `VAR_WORLD_POSITION` - Interpolated world space vertex position (`(MODEL_MATRIX * vec4(VERTEX, 1.0)).xyz`) * vec4 `VAR_COLOR` - The interpolated vertex color when colors are provided in the mesh. `vec4(1.0)` otherwise. * vec3 `VIEW_VECTOR` - Points towards the camera. This is effectively the `CAMERA_POSITION - VAR_WORLD_POSITION` vector normalized. * vec4 `FRAGCOORD` - Contains the window-relative coordinates of the current fragment. * float `FRAMEBUFFER_Y_UP` - The value is `1` when the Y axis points up in the coordinate system for framebuffers (textures), meaning `(0, 0)` is the bottom-left corner. The value is `-1` when the Y axis points down, `(0, 0)` being the top-left corner. Such differences in the underlying graphics APIs do not concern most custom materials. One notable exception is sampling `SCREEN_TEXTURE` with texture coordinates **not** based on `FRAGCOORD`. As the orientation of `SCREEN_TEXTURE` is tied to the underlying graphics API by nature, using texture coordinates from a mesh may need appropriate adjustments to the Y coordinate.For example, the following fragment shader, suitable for Rectangle or Cube meshes, will display the opaque objects from the scene on the model: ``` VARYING vec2 texcoord; void MAIN() { vec2 screencoord = texcoord; if (FRAMEBUFFER_Y_UP < 0.0) // effectively: if not OpenGL screencoord.y = 1.0 - screencoord.y; BASE_COLOR = texture(SCREEN_TEXTURE, screencoord); } ``` When sampling textures other than `SCREEN_TEXTURE` and `DEPTH_TEXTURE`, or when `FRAGCOORD` is used to calculate the texture coordinate (which would be the typical use case for accessing the screen and depth textures), such an adjustment is not necessary. * float `NDC_Y_UP` - The value is `1` when the Y axis points up in normalized device coordinate space, and `-1` when the Y axis points down. Y pointing down is the case when rendering happens with Vulkan. Most materials do not need to be concerned by this, but being able to branch based on this can become useful in certain advanced use cases. * float `NEAR_CLIP_VALUE` - The value is `-1` for when the clipping plane range's starts at `-1` and goes to `1`. This is true when using OpenGL for rendering. For other rendering backends the value of this property will be `0` meaning the clipping plane range is `0` to `1`. This value is useful with certain techniques involving the `DEPTH_TEXTURE`For example, the following fragment shader demonstrates a technique for reconstructing the position of a value from the depth buffer to determine the distance from the current position being rendered. When used in combination with `INVERSE_PROJECTION_MATRIX` the value of depth needs to be in normalized device coordinates so it is important to make sure that the range of depth value reflects that. When the `NEAR_CLIP_VALUE` is `-1` then the depth value gets scaled to be between `-1` and `1`. ``` void MAIN() { vec2 screen_uv = FRAGCOORD.xy / vec2(textureSize(SCREEN_TEXTURE, 0)); float depth = texture(DEPTH_TEXTURE, screen_uv).r; if (NEAR_CLIP_VALUE < 0.0) // effectively: if opengl depth = depth * 2.0 - 1.0; vec4 unproject = INVERSE_PROJECTION_MATRIX * vec4(screen_uv, depth, 1.0); depth = (unproject.xyz / unproject.w).z; float viewVectorZ = (VIEW_MATRIX * vec4(VAR_WORLD_POSITION, 1.0)).z; depth = viewVectorZ - depth; BASE_COLOR = vec4(depth, depth, depth, 1.0); } ``` ### Instancing When doing instanced rendering, some of the keywords above do not apply. The following keywords are only available with instancing: * `INSTANCE_MODEL_MATRIX` -> mat4, replacement for `MODEL_MATRIX`, including the instancing transformation. * `INSTANCE_MODELVIEWPROJECTION_MATRIX` -> mat4, replacement for `MODELVIEWPROJECTION_MATRIX`, including the instancing transformation. * `INSTANCE_COLOR` -> vec4, the instance color: to be combined with `COLOR`. * `INSTANCE_DATA` -> vec4, instance custom data. * `INSTANCE_INDEX` -> int, the instance number, and index into the instancing table. Screen, depth, and other textures --------------------------------- The rendering pipeline can expose a number of textures to the custom material shaders with content from special render passes. This applies both to shaded and unshaded custom materials. For example, a shader may want access to a depth texture that contains the depth buffer contents for the opaque objects in the scene. This is achieved by sampling `DEPTH_TEXTURE`. Such a texture is not normally generated, unless there is a real need for it. Therefore, the presence of the following keywords in the vertex or fragment shader also acts as a toggle for opting in to the - potentially expensive - passes for generating the texture in question. (of course, it could be that some of these become already enabled due to other settings, such as the ambient occlusion parameters in [SceneEnvironment](qml-qtquick3d-sceneenvironment) or due to a post-processing effect relying on the depth texture, in which case the textures in question are generated regardless of the custom material and so sampling these special textures in the material comes at no extra cost apart from the texture access itself) * `SCREEN_TEXTURE` - When present, a texture (sampler2D) with the color buffer from a rendering pass containing the opaque objects in the scene is exposed to the shader under this name. This also implies that any object with a custom material where the shaders sample `SCREEN_TEXTURE` will be treated as if it had semi-transparency enabled on it, even when the object opacity is 1.0 and blending was not enabled on the CustomMaterial. This is because such an object cannot be part of the opaque rendering lists, because it itself depends on the rendering results of those objects and thus cannot be rendered in line together with those. Pixels that are not covered by opaque objects will be set to transparent (`vec4(0.0)`) in the texture. For example, a fragment shader could contain the following: ``` vec2 uv = FRAGCOORD.xy / vec2(textureSize(SCREEN_TEXTURE, 0)); vec2 displace = vec2(0.1); vec4 c = texture(SCREEN_TEXTURE, uv + displace); ``` Be aware that using `SCREEN_TEXTURE` requires appropriate, conscious design of the scene. Objects using such materials have to be positioned carefully, typically above all other objects that are expected to be visible in the texture. Objects that employ semi-transparency in some form are never part of the `SCREEN_TEXTURE`. Often `SCREEN_TEXTURE` will be used in combination with `BASE_COLOR` in `MAIN`. For example, the following custom fragment shader applies an emboss effect, while keeping fragments not touched by opaque objects transparent. This assumes that the object with the material is placed in the front, and that it has blending enabled. ``` void MAIN() { vec2 size = vec2(textureSize(SCREEN_TEXTURE, 0)); vec2 uv = FRAGCOORD.xy / size; // basic emboss effect vec2 d = vec2(1.0 / size.x, 1.0 / size.y); vec4 diff = texture(SCREEN_TEXTURE, uv + d) - texture(SCREEN_TEXTURE, uv - d); float c = (diff.x + diff.y + diff.z) + 0.5; float alpha = texture(SCREEN_TEXTURE, uv).a; BASE_COLOR = vec4(vec3(c), alpha); } ``` * `SCREEN_MIP_TEXTURE` - Identical to `SCREEN_TEXTURE` in most ways, the difference being that this texture has mipmaps generated. This can be an expensive feature performance-wise, depending on the screen size, and due to having to generate the mipmaps every time the scene is rendered. Therefore, prefer using `SCREEN_TEXTURE` always, unless a technique relying on the texture mip levels (e.g. using `textureLod` in the shader) is implemented by the custom material. * `DEPTH_TEXTURE` - When present, a texture (sampler2D) with the (non-linearized) depth buffer contents is exposed to the shader under this name. Only opaque objects are included. For example, a fragment shader could contain the following: ``` ivec2 dtSize = textureSize(DEPTH_TEXTURE, 0); vec2 dtUV = (FRAGCOORD.xy) / vec2(dtSize); vec4 depthSample = texture(DEPTH_TEXTURE, dtUV); float zNear = CAMERA_PROPERTIES.x; float zFar = CAMERA_PROPERTIES.y; float zRange = zFar - zNear; float z_n = 2.0 * depthSample.r - 1.0; float d = 2.0 * zNear * zFar / (zFar + zNear - z_n * zRange); d /= zFar; ``` * `AO_TEXTURE` - When present and screen space ambient occlusion is enabled (meaning when the AO strength and distance are both non-zero) in [SceneEnvironment](qml-qtquick3d-sceneenvironment), the SSAO texture (sampler2D) is exposed to the shader under this name. Sampling this texture can be useful in unshaded materials. Shaded materials have ambient occlusion support built in. This means that the ambient occlusion factor is taken into account automatically. Whereas in a fragment shader for an unshaded material one could write the following to achieve the same: ``` ivec2 aoSize = textureSize(AO_TEXTURE, 0); vec2 aoUV = (FRAGCOORD.xy) / vec2(aoSize); float aoFactor = texture(AO_TEXTURE, aoUV).x; ``` **See also** [SceneEnvironment::tonemapMode](qml-qtquick3d-sceneenvironment#tonemapMode-prop), [Qt Quick 3D - Custom Shaders Example](https://doc.qt.io/qt-6.2/qtquick3d-customshaders-example.html), [Qt Quick 3D - Custom Materials Example](https://doc.qt.io/qt-6.2/qtquick3d-custommaterial-example.html), and [Programmable Materials, Effects, Geometry, and Texture data](qtquick3d-custom). Property Documentation ---------------------- ### alwaysDirty : [bool](qml-bool) Specifies that the material state is always dirty, which indicates that the material needs to be refreshed every time it is used by the [QtQuick3D](https://doc.qt.io/qt-6.2/qtquick3d-qmlmodule.html). ### destinationBlend : [enumeration](qml-enumeration) Specifies the destination blend factor. The default value is `CustomMaterial.NoBlend`. | Constant | Value | | --- | --- | | `CustomMaterial.NoBlend` | | `CustomMaterial.Zero` | | `CustomMaterial.One` | | `CustomMaterial.SrcColor` | | `CustomMaterial.OneMinusSrcColor` | | `CustomMaterial.DstColor` | | `CustomMaterial.OneMinusDstColor` | | `CustomMaterial.SrcAlpha` | | `CustomMaterial.OneMinusSrcAlpha` | | `CustomMaterial.DstAlpha` | | `CustomMaterial.OneMinusDstAlpha` | | `CustomMaterial.ConstantColor` | | `CustomMaterial.OneMinusConstantColor` | | `CustomMaterial.ConstantAlpha` | | `CustomMaterial.OneMinusConstantAlpha` | | `CustomMaterial.SrcAlphaSaturate` | ### fragmentShader : [url](qml-url) Specfies the file with the snippet of custom fragment shader code. The value is a URL and must either be a local file or use the qrc scheme to access files embedded via the Qt resource system. Relative file paths (without a scheme) are also accepted, in which case the file is treated as relative to the component (the `.qml` file). **See also** [vertexShader](qml-qtquick3d-custommaterial#vertexShader-prop). ### lineWidth : [real](qml-real) This property determines the width of the lines rendered, when the geometry is using a primitive type of lines or line strips. The default value is 1.0. This property is not relevant when rendering other types of geometry, such as, triangle meshes. **Warning:** Line widths other than 1 may not be suported at run time, depending on the underlying graphics API. When that is the case, the request to change the width is ignored. For example, none of the following can be expected to support wide lines: Direct3D, Metal, OpenGL with core profile contexts. **Note:** Unlike the line width, the value of which is part of the graphics pipeline object, the point size for geometries with a topology of points is controlled by the vertex shader (when supported), and has therefore no corresponding QML property. ### shadingMode : [enumeration](qml-enumeration) Specifies the type of the material. The default value is Shaded. | Constant | Value | | --- | --- | | `CustomMaterial.Unshaded` | | `CustomMaterial.Shaded` | ### sourceBlend : [enumeration](qml-enumeration) Specifies the source blend factor. The default value is `CustomMaterial.NoBlend`. | Constant | Value | | --- | --- | | `CustomMaterial.NoBlend` | | `CustomMaterial.Zero` | | `CustomMaterial.One` | | `CustomMaterial.SrcColor` | | `CustomMaterial.OneMinusSrcColor` | | `CustomMaterial.DstColor` | | `CustomMaterial.OneMinusDstColor` | | `CustomMaterial.SrcAlpha` | | `CustomMaterial.OneMinusSrcAlpha` | | `CustomMaterial.DstAlpha` | | `CustomMaterial.OneMinusDstAlpha` | | `CustomMaterial.ConstantColor` | | `CustomMaterial.OneMinusConstantColor` | | `CustomMaterial.ConstantAlpha` | | `CustomMaterial.OneMinusConstantAlpha` | | `CustomMaterial.SrcAlphaSaturate` | ### vertexShader : [url](qml-url) Specfies the file with the snippet of custom vertex shader code. The value is a URL and must either be a local file or use the qrc scheme to access files embedded via the Qt resource system. Relative file paths (without a scheme) are also accepted, in which case the file is treated as relative to the component (the `.qml` file). **See also** [fragmentShader](qml-qtquick3d-custommaterial#fragmentShader-prop).
programming_docs
qt Connection QML Type Connection QML Type =================== Connects to a server. [More...](#details) | | | | --- | --- | | Import Statement: | import QtOpcUa | | Since: | QtOpcUa 5.12 | * [List of all members, including inherited members](https://doc.qt.io/qt-6.2/qml-qtopcua-connection-members.html) Properties ---------- * **[authenticationInformation](qml-qtopcua-connection#authenticationInformation-prop)** : AuthenticationInformation * **[availableBackends](qml-qtopcua-connection#availableBackends-prop)** : stringlist * **[backend](qml-qtopcua-connection#backend-prop)** : string * **[connected](qml-qtopcua-connection#connected-prop)** : bool * **[connection](qml-qtopcua-connection#connection-prop)** : QOpcUaClient * **[currentEndpoint](qml-qtopcua-connection#currentEndpoint-prop)** : QOpcUaEndpointDescription * **[defaultConnection](qml-qtopcua-connection#defaultConnection-prop)** : bool * **[namespaces](qml-qtopcua-connection#namespaces-prop)** : stringlist * **[supportedSecurityPolicies](qml-qtopcua-connection#supportedSecurityPolicies-prop)** : stringlist * **[supportedUserTokenTypes](qml-qtopcua-connection#supportedUserTokenTypes-prop)** : array[tokenTypes] Signals ------- * **[nodeChanged](qml-qtopcua-connection#nodeChanged-signal)**() * **[readNodeAttributesFinished](qml-qtopcua-connection#readNodeAttributesFinished-signal)**(*readResults*) * **[writeNodeAttributesFinished](qml-qtopcua-connection#writeNodeAttributesFinished-signal)**(*writeResults*) Methods ------- * **[connectToEndpoint](qml-qtopcua-connection#connectToEndpoint-method)**(*endpointDescription*) * **[disconnectFromEndpoint](qml-qtopcua-connection#disconnectFromEndpoint-method)**() * **[readNodeAttributes](qml-qtopcua-connection#readNodeAttributes-method)**(*valuesToBeRead*) * **[writeNodeAttributes](qml-qtopcua-connection#writeNodeAttributes-method)**(*valuesToBeWritten*) Detailed Description -------------------- The main API uses backends to make connections. You have to set the backend before any connection attempt. ``` import QtOpcUa 5.13 as QtOpcUa QtOpcUa.Connection { backend: "open62541" } Component.onCompleted: { connection.connectToEndpoint("opc.tcp://127.0.0.1:43344"); } ``` Property Documentation ---------------------- ### authenticationInformation : [AuthenticationInformation](qml-qtopcua-authenticationinformation) Set the authentication information to this connection. The authentication information has to be set before calling [connectToEndpoint](qml-qtopcua-connection#connectToEndpoint-method). If no authentication information is set, the anonymous mode will be used. It has no effect on the current connection. If the client is disconnected and then reconnected, the new credentials are used. Reading and writing this property before a [backend](qml-qtopcua-connection#backend-prop) is set, writes are ignored and reads return and invalid [AuthenticationInformation](qml-qtopcua-authenticationinformation). ### [read-only] availableBackends : stringlist Returns the names of all available backends as a list. These are used to select a backend when connecting. **See also** [Connection::backend](qml-qtopcua-connection#backend-prop). ### backend : [string](qml-string) Set the backend to use for a connection to the server. Has to be set before any connection attempt. **See also** [Connection::availableBackends](qml-qtopcua-connection#availableBackends-prop). ### [read-only] connected : [bool](qml-bool) Status of the connection. `true` when there is a connection, otherwise `false`. ### [since 5.13] connection : QOpcUaClient This property is used only to inject a connection from C++. In case of complex setup of a connection you can use C++ to handle all the details. After the connection is established it can be handed to QML using this property. Ownership of the client is transferred to QML. ``` class MyClass : public QObject { Q_OBJECT Q_PROPERTY(QOpcUaClient* connection READ connection NOTIFY connectionChanged) public: MyClass (QObject* parent = nullptr); QOpcUaClient *connection() const; signals: void connectionChanged(QOpcUaClient *); ``` Emitting the signal `connectionChanged` when the client setup is completed, the QML code below will use the connection. ``` import QtOpcUa 5.13 as QtOpcUa MyClass { id: myclass } QtOpcUa.Connection { connection: myclass.connection } ``` This property was introduced in Qt 5.13. ### [since 5.13] currentEndpoint : QOpcUaEndpointDescription An endpoint description of the server to which the connection is connected to. When the connection is not established, an empty endpoint description is returned. This property was introduced in Qt 5.13. ### defaultConnection : [bool](qml-bool) Makes this the default connection. Usually each node needs to be given a connection to use. If this property is set to `true`, this connection will be used in all cases where a node has no connection set. Already established connections are not affected. If `defaultConnection` is set to `true` on multiple connection the last one is used. ``` QtOpcUa.Connection { ... defaultConnection: true ... } ``` **See also** [Node](qml-qtopcua-node). ### [read-only] namespaces : stringlist List of strings of all namespace URIs registered on the connected server. ### [since 5.13] supportedSecurityPolicies : stringlist A list of strings containing the supported security policies This property is currently available as a Technology Preview, and therefore the API and functionality provided may be subject to change at any time without prior notice. This property was introduced in Qt 5.13. ### [since 5.13] supportedUserTokenTypes : array[tokenTypes] An array of user token policy types of all supported user token types. This property is currently available as a Technology Preview, and therefore the API and functionality provided may be subject to change at any time without prior notice. This property was introduced in Qt 5.13. Signal Documentation -------------------- ### nodeChanged() Emitted when the underlying node has changed. This happens when the namespace or identifier of the [NodeId](qml-qtopcua-nodeid) changed. **Note:** The corresponding handler is `onNodeChanged`. ### `[since 5.13]` readNodeAttributesFinished(*readResults*) Emitted when the read request, started using [readNodeAttributes](qml-qtopcua-connection#readNodeAttributes-method)(), is finished. The *readResults* parameter is an array of [ReadResult](qml-qtopcua-readresult) entries, containing the values requested from the server. ``` connection.onReadNodeAttributesFinished(results) { for (var i = 0; results.length; i++) { if (results[i].status.isGood) { console.log(results[i].value); } else { // handle error } } } ``` **Note:** The corresponding handler is `onReadNodeAttributesFinished`. This signal was introduced in Qt 5.13. **See also** [readNodeAttributes](qml-qtopcua-connection#readNodeAttributes-method)() and [ReadResult](qml-qtopcua-readresult). ### `[since 5.13]` writeNodeAttributesFinished(*writeResults*) Emitted when the write request started using [writeNodeAttributes](qml-qtopcua-connection#writeNodeAttributes-method)() is finished. The *writeResults* parameter is an array of [WriteResult](qml-qtopcua-writeresult) entries, containing the values requested from the server. ``` for (var i = 0; i < writeResults.length; i++) { console.log(writeResults[i].nodeId); console.log(writeResults[i].namespaceName); console.log(writeResults[i].attribute); if (writeResults[i].status.isBad) { // value was not written } } ``` **Note:** The corresponding handler is `onWriteNodeAttributesFinished`. This signal was introduced in Qt 5.13. **See also** [writeNodeAttributes](qml-qtopcua-connection#writeNodeAttributes-method)() and [WriteResult](qml-qtopcua-writeresult). Method Documentation -------------------- ### connectToEndpoint(*endpointDescription*) Connects to the endpoint specified with *endpointDescription*. **See also** [EndpointDescription](qml-qtopcua-endpointdescription). ### disconnectFromEndpoint() Disconnects an established connection. ### readNodeAttributes(*valuesToBeRead*) This function is used to read multiple values from a server in one go. Returns `true` if the read request was dispatched successfully. The *valuesToBeRead* parameter must be a JavaScript array of [ReadItem](qml-qtopcua-readitem) entries. ``` // List of items to read var readItemList = []; // Item to be added to the list of items to be read var readItem; // Prepare an item to be read // Create a new read item and fill properties readItem = QtOpcUa.ReadItem.create(); readItem.ns = "http://qt-project.org"; readItem.nodeId = "s=Demo.Static.Scalar.Double"; readItem.attribute = QtOpcUa.Constants.NodeAttribute.DisplayName; // Add the prepared item to the list of items to be read readItemList.push(readItem); // Add further items [...] if (!connection.readNodeAttributes(readItemList)) { // handle error } ``` The result of the read request are provided by the signal [readNodeAttributesFinished](qml-qtopcua-connection#readNodeAttributesFinished-signal)(). **See also** [readNodeAttributesFinished](qml-qtopcua-connection#readNodeAttributesFinished-signal)() and [ReadItem](qml-qtopcua-readitem). ### writeNodeAttributes(*valuesToBeWritten*) This function is used to write multiple values to a server in one go. Returns `true` if the write request was dispatched successfully. The *valuesToBeWritten* parameter must be a JavaScript array of [WriteItem](qml-qtopcua-writeitem) entries. ``` // List of items to write var writeItemList = []; // Item to be added to the list of items to be written var writeItem; // Prepare an item to be written // Create a new write item and fill properties writeItem = QtOpcUa.WriteItem.create(); writeItem.ns = "http://qt-project.org"; writeItem.nodeId = "s=Demo.Static.Scalar.Double"; writeItem.attribute = QtOpcUa.Constants.NodeAttribute.Value; writeItem.value = 32.1; writeItem.valueType = QtOpcUa.Constants.Double; // Add the prepared item to the list of items to be written writeItemList.push(writeItem); // Add further items [...] if (!connection.writeNodeAttributes(writeItemList)) { // handle error } ``` The result of the write request are provided by the signal [Connection::writeNodeAttributesFinished](qml-qtopcua-connection#writeNodeAttributesFinished-signal)(). **See also** [Connection::writeNodeAttributesFinished](qml-qtopcua-connection#writeNodeAttributesFinished-signal)() and [WriteItem](qml-qtopcua-writeitem). qt Styling Qt Quick Controls Styling Qt Quick Controls ========================= Available Styles ---------------- Qt Quick Controls comes with a selection of styles. ### Basic Style The [Basic Style](qtquickcontrols2-basic) is a simple and light-weight all-round style that offers the maximum performance for Qt Quick Controls. ### Fusion Style The [Fusion Style](qtquickcontrols2-fusion) is a platform-agnostic style that offers a desktop-oriented look and feel for Qt Quick Controls. ### Imagine Style The [Imagine Style](qtquickcontrols2-imagine) is based on image assets. The style comes with a default set of images which can easily be changed by providing a directory with images using a predefined naming convention. ### macOS Style The [macOS Style](qtquickcontrols2-macos) is a native-looking style for macOS. **Note:** this style is only available for applications running on macOS. ### Material Style The [Material Style](qtquickcontrols2-material) offers an appealing design based on the [Google Material Design Guidelines](https://www.google.com/design/spec/material-design/introduction.html), but requires more system resources than the Basic style. ### Universal Style The [Universal Style](qtquickcontrols2-universal) offers an appealing design based on the [Microsoft Universal Design Guidelines](https://dev.windows.com/design), but requires more system resources than the Basic style. ### Windows Style The [Windows Style](qtquickcontrols2-windows) is a native-looking style for Windows. **Note:** this style is only available for applications running on Windows. Using Styles in Qt Quick Controls --------------------------------- There are two ways of using styles in Qt Quick Controls: run-time style selection and compile-time style selection. ### Compile-Time Style Selection Compile-time style selection involves using QML imports to specify the style. For example, to import the Material style: ``` import QtQuick.Controls.Material ApplicationWindow { // ... } ``` Notice that [QtQuick](https://doc.qt.io/qt-6.2/qtquick-module.html).Controls (which is responsible for run-time style selection) is not imported. The fallback style is specified by the qmldir of the style: ``` module QtQuick.Controls.Material # ... import QtQuick.Controls.Basic auto ``` The benefit of compile-time style selection is that the [QtQuick](https://doc.qt.io/qt-6.2/qtquick-module.html).Controls plugin is not used and therefore does not need to be deployed with the application. Explicit imports are also necessary if your application is built [statically](https://doc.qt.io/qt-6.2/qtquickcontrols2-deployment.html#static-builds). ### Run-Time Style Selection Run-time style selection involves importing `QtQuick.Controls`: ``` import QtQuick.Controls ``` The [QtQuick](https://doc.qt.io/qt-6.2/qtquick-module.html).Controls plugin will import the style and fallback style that were set at runtime via one of the following approaches: * [QQuickStyle::setStyle](qquickstyle#setStyle)() * The `-style` command line argument * The `QT_QUICK_CONTROLS_STYLE` environment variable * The `qtquickcontrols2.conf` configuration file The priority of these approaches follows the order they are listed, from highest to lowest. That is, using `QQuickStyle` to set the style will always take priority over using the command line argument, for example. The benefit of run-time style selection is that a single application binary can support multiple styles, meaning that the end user can choose which style to run the application with. #### Using QQuickStyle in C++ [QQuickStyle](qquickstyle) provides C++ API for configuring a specific style. The following example runs a Qt Quick Controls application with the Material style: ``` QQuickStyle::setStyle("Material"); ``` See the detailed description of [QQuickStyle](qquickstyle) for more details. #### Command line argument Passing a `-style` command line argument is the convenient way to test different styles. It takes precedence over the other methods listed below. The following example runs a Qt Quick Controls application with the Material style: ``` ./app -style material ``` #### Environment variable Setting the `QT_QUICK_CONTROLS_STYLE` environment variable can be used to set a system-wide style preference. It takes precedence over the configuration file mentioned below. The following example runs a Qt Quick Controls application with the Universal style: ``` QT_QUICK_CONTROLS_STYLE=universal ./app ``` See [Supported Environment Variables in Qt Quick Controls](qtquickcontrols2-environment) for the full list of supported environment variables. #### Configuration file Qt Quick Controls support a special configuration file, `:/qtquickcontrols2.conf`, that is built into an application's resources. The configuration file can specify the preferred style (may be overridden by either of the methods described earlier) and certain style-specific attributes. The following example specifies that the preferred style is the Material style. ``` [Controls] Style=Material ``` See [Qt Quick Controls Configuration File](qtquickcontrols2-configuration) for more details about the configuration file. Related Information ------------------- * [Basic Style](qtquickcontrols2-basic) * [Fusion Style](qtquickcontrols2-fusion) * [Imagine Style](qtquickcontrols2-imagine) * [Material Style](qtquickcontrols2-material) * [Universal Style](qtquickcontrols2-universal) * [Customizing Qt Quick Controls](qtquickcontrols2-customize) * [Using File Selectors with Qt Quick Controls](qtquickcontrols2-fileselectors) * [Deploying Qt Quick Controls Applications](https://doc.qt.io/qt-6.2/qtquickcontrols2-deployment.html) * [Qt Quick Controls Configuration File](qtquickcontrols2-configuration) * [Supported Environment Variables in Qt Quick Controls](qtquickcontrols2-environment) qt LineWidth QML Type LineWidth QML Type ================== Specifies the width of rasterized lines. [More...](#details) | | | | --- | --- | | Import Statement: | import Qt3D.Render | | Since: | Qt 5.10 | | Instantiates: | [QLineWidth](qt3drender-qlinewidth) | | Inherits: | [RenderState](qml-qt3d-render-renderstate) | * [List of all members, including inherited members](https://doc.qt.io/qt-6.2/qml-qt3d-render-linewidth-members.html) Properties ---------- * **[value](qml-qt3d-render-linewidth#value-prop)** : real Detailed Description -------------------- Property Documentation ---------------------- ### value : [real](qml-real) Specifies the width value to be used. qt QNdefNfcUriRecord Class QNdefNfcUriRecord Class ======================= The QNdefNfcUriRecord class provides an NFC RTD-URI. [More...](#details) | | | | --- | --- | | Header: | #include <QNdefNfcUriRecord> | | CMake: | find\_package(Qt6 COMPONENTS Nfc REQUIRED) target\_link\_libraries(mytarget PRIVATE Qt6::Nfc) | | qmake: | QT += nfc | | Since: | Qt 5.2 | | Inherits: | [QNdefRecord](qndefrecord) | * [List of all members, including inherited members](https://doc.qt.io/qt-6.2/qndefnfcurirecord-members.html) Public Functions ---------------- | | | | --- | --- | | | **[QNdefNfcUriRecord](qndefnfcurirecord#QNdefNfcUriRecord-1)**(const QNdefRecord &*other*) | | | **[QNdefNfcUriRecord](qndefnfcurirecord#QNdefNfcUriRecord)**() | | void | **[setUri](qndefnfcurirecord#setUri)**(const QUrl &*uri*) | | QUrl | **[uri](qndefnfcurirecord#uri)**() const | Detailed Description -------------------- RTD-URI encapsulates a URI. Member Function Documentation ----------------------------- ### QNdefNfcUriRecord::QNdefNfcUriRecord(const [QNdefRecord](qndefrecord#QNdefRecord) &*other*) Constructs a new NFC uri record that is a copy of *other*. ### QNdefNfcUriRecord::QNdefNfcUriRecord() Constructs an empty NFC uri record. ### void QNdefNfcUriRecord::setUri(const [QUrl](qurl) &*uri*) Sets the URI of this URI record to *uri*. **See also** [uri](qndefnfcurirecord#uri)(). ### [QUrl](qurl) QNdefNfcUriRecord::uri() const Returns the URI of this URI record. **See also** [setUri](qndefnfcurirecord#setUri)(). qt Best Practices for QML and Qt Quick Best Practices for QML and Qt Quick =================================== Despite all of the benefits that QML and Qt Quick offer, they can be challenging in certain situations. The following sections elaborate on some of the best practices that will help you get better results when developing applications. Custom UI Controls ------------------ A fluid and modern UI is key for any application's success in today's world, and that's where QML makes so much sense for a designer or developer. Qt offers the most basic UI controls that are necessary to create a fluid and modern-looking UI. It is recommended to browse this list of UI controls before creating your own custom UI control. Besides these basic UI controls offered by Qt Quick itself, a rich set of UI controls are also available with Qt Quick Controls. They cater to the most common use cases without any change, and offer a lot more possibilities with their customization options. In particular, Qt Quick Controls provides styling options that align with the latest UI design trends. If these UI controls do not satisfy your application's needs, only then it is recommended to create a custom control. ### Related Information * [Qt Quick Controls](qtquickcontrols-index) * [Qt Quick](qtquick-index) Coding Conventions ------------------ See [QML Coding Conventions](qml-codingconventions). Bundle Application Resources ---------------------------- Most applications depend on resources such as images and icons to provide a rich user experience. It can often be a challenge to make these resources available to the application regardless of the target OS. Most popular OS-es employ stricter security policies that restrict access to the file system, making it harder to load these resources. As an alternative, Qt offers its own [resource system](resources) that is built into the application binary, enabling access to the application's resources regardless of the target OS. For example, consider the following project directory structure: ``` MyModule ├── images │ ├── image1.png │ └── image2.png ├── CMakeLists.txt └── main.qml ``` You may represent this structure as a [CMake QML Module](https://doc.qt.io/qt-6.2/qt-add-qml-module.html) in the following way: ``` qt_add_qml_module(my_module URI MyModule VERSION 1.0 QML_FILES main.qml RESOURCES images/image1.png images/image2.png # ... ) ``` All QML files listed under `QML_FILES` will automatically get compiled [ahead of time](https://doc.qt.io/qt-6.2/qtquick-deployment.html#ahead-of-time-compilation). ### Related Information * [The Qt Resource System](resources) Separate UI from Logic ---------------------- One of the key goals that most application developers want to achieve is to create a maintainable application. One of the ways to achieve this goal is to separate the user interface from the business logic. The following are a few reasons why an application's UI should be written in QML: * Declarative languages are strongly suited for defining UIs. * QML code is simpler to write, as it is less verbose than C++, and is not strongly typed. This also results in it being an excellent language to prototype in, a quality that is vital when collaborating with designers, for example. * JavaScript can easily be used in QML to respond to events. Being a strongly typed language, C++ is best suited for an application's logic. Typically, such code performs tasks such as complex calculations or data processing, which are faster in C++ than QML. Qt offers various approaches to integrate QML and C++ code in an application. A typical use case is displaying a list of data in a user interface. If the data set is static, simple, and/or small, a model written in QML can be sufficient. The following snippet demonstrates examples of models written in QML: ``` model: [ "Item 1", "Item 2", "Item 3" ] model: 10 ``` Use [C++](qtquick-modelviewsdata-cppmodels#qabstractitemmodel-subclass) for dynamic data sets that are large or frequently modified. ### Exposing Data from C++ to QML Refactoring QML is a lot easier than refactoring C++, so in order to make maintenance pain-free, we should strive to keep C++ types unaware of QML as much as possible. This can be achieved by "pushing" references to C++ types into QML. This can be done by using [required properties](qtqml-syntax-objectattributes#required-properties) and setting them via [QQmlApplicationEngine::setInitialProperties](qqmlapplicationengine#setInitialProperties). It is also possible to create one or multiple [singletons](qqmlengine#QML_SINGLETON) which will return all the data the C++ side wants to provide to QML. With this approach, the C++ remains unchanged in the event that the QML needs to be refactored in the future. For a quick guide to choosing the correct approach to expose C++ types to QML, see [Choosing the Correct Integration Method Between C++ and QML](https://doc.qt.io/qt-6.2/qtqml-cppintegration-overview.html#choosing-the-correct-integration-method-between-c-and-qml). ### Related Information * [Integrating QML and C++](https://doc.qt.io/qt-6.2/qtqml-cppintegration-topic.html) * [Chat application tutorial](https://doc.qt.io/qt-6.2/qtquickcontrols-chattutorial-example.html) Using Qt Quick Layouts ---------------------- Qt offers Qt Quick Layouts to arrange Qt Quick items visually in a layout. Unlike its alternative, the item positioners, the Qt Quick Layouts can also resize its children on window resize. Although Qt Quick Layouts are often the desired choice for most use cases, the following *dos* and *don'ts* must be considered while using them: ### Dos * Use [anchors](qml-qtquick-item#anchors-prop) or the [width](qml-qtquick-item#width-prop) and [height](qml-qtquick-item#height-prop) properties to specify the size of the layout against its non-layout parent item. * Use the [Layout](qml-qtquick-layouts-layout) attached property to set the size and alignment attributes of the layout's immediate children. ### Don'ts * Do not define preferred sizes for items that provide implicitWidth and implicitHeight, unless their implicit sizes are not satisfactory. * Do not use anchors on an item that is an immediate child of a layout. Instead, use `Layout.preferredWidth` and `Layout.preferredHeight`: ``` RowLayout { id: layout anchors.fill: parent spacing: 6 Rectangle { color: 'azure' Layout.fillWidth: true Layout.minimumWidth: 50 Layout.preferredWidth: 100 Layout.maximumWidth: 300 Layout.minimumHeight: 150 Text { anchors.centerIn: parent text: parent.width + 'x' + parent.height } } Rectangle { color: 'plum' Layout.fillWidth: true Layout.minimumWidth: 100 Layout.preferredWidth: 200 Layout.preferredHeight: 100 Text { anchors.centerIn: parent text: parent.width + 'x' + parent.height } } } ``` **Note:** Layouts and anchors are both types of objects that take more memory and instantiation time. Avoid using them (especially in list and table delegates, and styles for controls) when simple bindings to x, y, width, and height properties are enough. ### Related Information * [Item Positioners](qtquick-positioning-layouts) * [Qt Quick Layouts Overview](https://doc.qt.io/qt-6.2/qtquicklayouts-overview.html) Type Safety ----------- When declaring properties in QML, it's easy and convenient to use the "var" type: ``` property var name property var size property var optionsMenu ``` However, this approach has several disadvantages: * If a value with the wrong type is assigned, the error reported will point to the location of the property declaration, as opposed to the location where the property was assigned to. This slows down the development process by making it more difficult to track down errors. * Static anaylsis to catch errors like the ones mentioned above is not possible. * The actual underlying type of the property is not always immediately clear to the reader. Instead, always use the actual type where possible: ``` property string name property int size property MyMenu optionsMenu ``` Performance ----------- For information on performance in QML and Qt Quick, see [Performance Considerations And Suggestions](qtquick-performance). Prefer Declarative Bindings Over Imperative Assignments ------------------------------------------------------- In QML, it's possible to use imperative JavaScript code to perform tasks such as responding to input events, send data over a network, and so on. Imperative code has an important place in QML, but it's also important to be aware of when not to use it. For example, consider the following imperative assignment: ``` Rectangle { Component.onCompleted: color = "red" } ``` This has the following disadvantages: * It's slow. The color property will first be evaluated with a default-constructed value, and then again with "red" later on. * It delays errors that could be found at build time to run time, slowing down the development process. * It overwrites any declarative binding that was in place. In most cases this is intended, but sometimes it can be unintentional. See [Debugging overwriting of bindings](qtqml-syntax-propertybinding#debugging-overwriting-of-bindings) for more information. * It interferes with tooling; Qt Quick Designer, for example, doesn't support JavaScript. The code can be rewritten to be a declarative binding instead: ``` Rectangle { color: "red" } ``` Tools and Utilities ------------------- For information on useful tools and utilies that make working with QML and Qt Quick easier, see [Qt Quick Tools and Utilities](qtquick-tools-and-utilities). Scene Graph ----------- For information on Qt Quick's scene graph, see [Qt Quick Scene Graph](qtquick-visualcanvas-scenegraph). Scalable User Interfaces ------------------------ As display resolutions improve, a scalable application UI becomes more and more important. One of the approaches to achieve this is to maintain several copies of the UI for different screen resolutions, and load the appropriate one depending on the available resolution. Although this works pretty well, it adds to the maintenance overhead. Qt offers a better solution to this problem and recommends the application developers to follow these tips: * Use anchors or the Qt Quick Layouts module to lay out the visual items. * Do not specify explicit width and height for a visual item. * Provide UI resources such as images and icons for each display resolution that your application supports. The Qt Quick Controls gallery example demonstrates this well by providing the `qt-logo.png` for `@2x`, `@3x`, and `@4x` resolutions, enabling the application to cater to high resolution displays. Qt automatically chooses the appropriate image that is suitable for the given display, provided the high DPI scaling feature is explicitly enabled. * Use SVG images for small icons. While larger SVGs can be slow to render, small ones work well. Vector images avoid the need to provide several versions of an image, as is necessary with bitmap images. * Use font-based icons, such as Font Awesome. These scale to any display resolution, and also allow colorization. The Qt Quick Controls Text Editor example demonstrates this well. With this in place, your application's UI should scale depending on the display resolution on offer. ### Related Information * [Gallery example](https://doc.qt.io/qt-6.2/qtquickcontrols-gallery-example.html) * [Text Editor example](https://doc.qt.io/qt-6.2/qtquickcontrols-texteditor-example.html) * [Font Awesome](https://fontawesome.com/) * [Scalability](https://doc.qt.io/qt-6.2/scalability.html) * [High DPI](https://doc.qt.io/qt-6.2/portingguide.html#high-dpi)
programming_docs
qt GridGeometry QML Type GridGeometry QML Type ===================== A custom geometry provider for rendering grids. [More...](#details) | | | | --- | --- | | Import Statement: | import QtQuick3D.Helpers | | Inherits: | [Geometry](qml-qtquick3d-geometry) | * [List of all members, including inherited members](https://doc.qt.io/qt-6.2/qml-qtquick3d-helpers-gridgeometry-members.html) Properties ---------- * **[horizontalLines](qml-qtquick3d-helpers-gridgeometry#horizontalLines-prop)** : int * **[horizontalStep](qml-qtquick3d-helpers-gridgeometry#horizontalStep-prop)** : real * **[verticalLines](qml-qtquick3d-helpers-gridgeometry#verticalLines-prop)** : int * **[verticalStep](qml-qtquick3d-helpers-gridgeometry#verticalStep-prop)** : real Detailed Description -------------------- This helper implements grid geometry, which allows showing a grid in a scene. For example, the following snippet would display a grid with 19 cells in both directions in a scene that has one light. Without further transformations, the grid is facing the camera by default. ``` View3D { anchors.fill: parent camera: camera PerspectiveCamera { id: camera position: Qt.vector3d(0, 0, 600) } DirectionalLight { position: Qt.vector3d(-500, 500, -100) color: Qt.rgba(0.4, 0.2, 0.6, 1.0) ambientColor: Qt.rgba(0.1, 0.1, 0.1, 1.0) } Model { scale: Qt.vector3d(100, 100, 100) geometry: GridGeometry { horizontalLines: 20 verticalLines: 20 } materials: [ DefaultMaterial { } ] } } ``` **See also** [Qt Quick 3D - Custom Geometry Example](https://doc.qt.io/qt-6.2/qtquick3d-customgeometry-example.html) and [Model](qml-qtquick3d-model). Property Documentation ---------------------- ### horizontalLines : [int](qml-int) Specifies the number of horizontal lines in a grid. The default value is 1000. ### horizontalStep : [real](qml-real) Specifies the spacing between horizontal lines. The default value is 0.1. ### verticalLines : [int](qml-int) Specifies the number of vertical lines in a grid. The default value is 1000. ### verticalStep : [real](qml-real) Specifies the spacing between vertical lines. The default value is 0.1. qt QUiLoader Class QUiLoader Class =============== The QUiLoader class enables standalone applications to dynamically create user interfaces at run-time using the information stored in UI files or specified in plugin paths. [More...](#details) | | | | --- | --- | | Header: | #include <QUiLoader> | | CMake: | find\_package(Qt6 COMPONENTS UiTools REQUIRED) target\_link\_libraries(mytarget PRIVATE Qt6::UiTools) | | qmake: | QT += uitools | | Inherits: | [QObject](qobject) | * [List of all members, including inherited members](https://doc.qt.io/qt-6.2/quiloader-members.html) Public Functions ---------------- | | | | --- | --- | | | **[QUiLoader](quiloader#QUiLoader)**(QObject \**parent* = nullptr) | | virtual | **[~QUiLoader](quiloader#dtor.QUiLoader)**() override | | void | **[addPluginPath](quiloader#addPluginPath)**(const QString &*path*) | | QStringList | **[availableLayouts](quiloader#availableLayouts)**() const | | QStringList | **[availableWidgets](quiloader#availableWidgets)**() const | | void | **[clearPluginPaths](quiloader#clearPluginPaths)**() | | virtual QAction \* | **[createAction](quiloader#createAction)**(QObject \**parent* = nullptr, const QString &*name* = QString()) | | virtual QActionGroup \* | **[createActionGroup](quiloader#createActionGroup)**(QObject \**parent* = nullptr, const QString &*name* = QString()) | | virtual QLayout \* | **[createLayout](quiloader#createLayout)**(const QString &*className*, QObject \**parent* = nullptr, const QString &*name* = QString()) | | virtual QWidget \* | **[createWidget](quiloader#createWidget)**(const QString &*className*, QWidget \**parent* = nullptr, const QString &*name* = QString()) | | QString | **[errorString](quiloader#errorString)**() const | | bool | **[isLanguageChangeEnabled](quiloader#isLanguageChangeEnabled)**() const | | QWidget \* | **[load](quiloader#load)**(QIODevice \**device*, QWidget \**parentWidget* = nullptr) | | QStringList | **[pluginPaths](quiloader#pluginPaths)**() const | | void | **[setLanguageChangeEnabled](quiloader#setLanguageChangeEnabled)**(bool *enabled*) | | void | **[setWorkingDirectory](quiloader#setWorkingDirectory)**(const QDir &*dir*) | | QDir | **[workingDirectory](quiloader#workingDirectory)**() const | Detailed Description -------------------- In addition, you can customize or create your own user interface by deriving your own loader class. If you have a custom component or an application that embeds *Qt Designer*, you can also use the [QFormBuilder](qformbuilder) class provided by the [QtDesigner](https://doc.qt.io/qt-6.2/qtdesigner-module.html) module to create user interfaces from UI files. The QUiLoader class provides a collection of functions allowing you to create widgets based on the information stored in UI files (created with *Qt Designer*) or available in the specified plugin paths. The specified plugin paths can be retrieved using the [pluginPaths](quiloader#pluginPaths)() function. Similarly, the contents of a UI file can be retrieved using the [load](quiloader#load)() function. For example: ``` MyWidget::MyWidget(QWidget *parent) : QWidget(parent) { QUiLoader loader; QFile file(":/forms/myform.ui"); file.open(QFile::ReadOnly); QWidget *myWidget = loader.load(&file, this); file.close(); QVBoxLayout *layout = new QVBoxLayout; layout->addWidget(myWidget); setLayout(layout); } ``` By including the user interface in the form's resources (`myform.qrc`), we ensure that it will be present at run-time: ``` <!DOCTYPE RCC><RCC version="1.0"> <qresource prefix="/forms"> <file>myform.ui</file> </qresource> </RCC> ``` The [availableWidgets](quiloader#availableWidgets)() function returns a [QStringList](qstringlist) with the class names of the widgets available in the specified plugin paths. To create these widgets, simply use the [createWidget](quiloader#createWidget)() function. For example: ``` QWidget *loadCustomWidget(QWidget *parent) { QUiLoader loader; QWidget *myWidget; QStringList availableWidgets = loader.availableWidgets(); if (availableWidgets.contains("AnalogClock")) myWidget = loader.createWidget("AnalogClock", parent); return myWidget; } ``` To make a custom widget available to the loader, you can use the [addPluginPath](quiloader#addPluginPath)() function; to remove all available widgets, you can call the [clearPluginPaths](quiloader#clearPluginPaths)() function. The [createAction](quiloader#createAction)(), [createActionGroup](quiloader#createActionGroup)(), [createLayout](quiloader#createLayout)(), and [createWidget](quiloader#createWidget)() functions are used internally by the QUiLoader class whenever it has to create an action, action group, layout, or widget respectively. For that reason, you can subclass the QUiLoader class and reimplement these functions to intervene the process of constructing a user interface. For example, you might want to have a list of the actions created when loading a form or creating a custom widget. For a complete example using the QUiLoader class, see the [Calculator Builder Example](https://doc.qt.io/qt-6.2/qtdesigner-calculatorbuilder-example.html). **See also** [Qt UI Tools](qtuitools-index) and [QFormBuilder](qformbuilder). Member Function Documentation ----------------------------- ### QUiLoader::QUiLoader([QObject](qobject#QObject) \**parent* = nullptr) Creates a form loader with the given *parent*. ### `[override virtual]` QUiLoader::~QUiLoader() Destroys the loader. ### void QUiLoader::addPluginPath(const [QString](qstring) &*path*) Adds the given *path* to the list of paths in which the loader will search when locating plugins. **See also** [pluginPaths](quiloader#pluginPaths)() and [clearPluginPaths](quiloader#clearPluginPaths)(). ### [QStringList](qstringlist) QUiLoader::availableLayouts() const Returns a list naming all available layouts that can be built using the [createLayout](quiloader#createLayout)() function **See also** [createLayout](quiloader#createLayout)(). ### [QStringList](qstringlist) QUiLoader::availableWidgets() const Returns a list naming all available widgets that can be built using the [createWidget](quiloader#createWidget)() function, i.e all the widgets specified within the given plugin paths. **See also** [pluginPaths](quiloader#pluginPaths)() and [createWidget](quiloader#createWidget)(). ### void QUiLoader::clearPluginPaths() Clears the list of paths in which the loader will search when locating plugins. **See also** [addPluginPath](quiloader#addPluginPath)() and [pluginPaths](quiloader#pluginPaths)(). ### `[virtual]` QAction \*QUiLoader::createAction([QObject](qobject#QObject) \**parent* = nullptr, const [QString](qstring) &*name* = QString()) Creates a new action with the given *parent* and *name*. The function is also used internally by the [QUiLoader](quiloader) class whenever it creates a widget. Hence, you can subclass [QUiLoader](quiloader) and reimplement this function to intervene process of constructing a user interface or widget. However, in your implementation, ensure that you call [QUiLoader](quiloader)'s version first. **See also** [createActionGroup](quiloader#createActionGroup)(), [createWidget](quiloader#createWidget)(), and [load](quiloader#load)(). ### `[virtual]` QActionGroup \*QUiLoader::createActionGroup([QObject](qobject#QObject) \**parent* = nullptr, const [QString](qstring) &*name* = QString()) Creates a new action group with the given *parent* and *name*. The function is also used internally by the [QUiLoader](quiloader) class whenever it creates a widget. Hence, you can subclass [QUiLoader](quiloader) and reimplement this function to intervene process of constructing a user interface or widget. However, in your implementation, ensure that you call [QUiLoader](quiloader)'s version first. **See also** [createAction](quiloader#createAction)(), [createWidget](quiloader#createWidget)(), and [load](quiloader#load)(). ### `[virtual]` [QLayout](qlayout) \*QUiLoader::createLayout(const [QString](qstring) &*className*, [QObject](qobject#QObject) \**parent* = nullptr, const [QString](qstring) &*name* = QString()) Creates a new layout with the given *parent* and *name* using the class specified by *className*. The function is also used internally by the [QUiLoader](quiloader) class whenever it creates a widget. Hence, you can subclass [QUiLoader](quiloader) and reimplement this function to intervene process of constructing a user interface or widget. However, in your implementation, ensure that you call [QUiLoader](quiloader)'s version first. **See also** [createWidget](quiloader#createWidget)() and [load](quiloader#load)(). ### `[virtual]` [QWidget](qwidget) \*QUiLoader::createWidget(const [QString](qstring) &*className*, [QWidget](qwidget) \**parent* = nullptr, const [QString](qstring) &*name* = QString()) Creates a new widget with the given *parent* and *name* using the class specified by *className*. You can use this function to create any of the widgets returned by the [availableWidgets](quiloader#availableWidgets)() function. The function is also used internally by the [QUiLoader](quiloader) class whenever it creates a widget. Hence, you can subclass [QUiLoader](quiloader) and reimplement this function to intervene process of constructing a user interface or widget. However, in your implementation, ensure that you call [QUiLoader](quiloader)'s version first. **See also** [availableWidgets](quiloader#availableWidgets)() and [load](quiloader#load)(). ### `[since 5.0]` [QString](qstring) QUiLoader::errorString() const Returns a human-readable description of the last error occurred in [load](quiloader#load)(). This function was introduced in Qt 5.0. **See also** [load](quiloader#load)(). ### bool QUiLoader::isLanguageChangeEnabled() const Returns true if dynamic retranslation on language change is enabled; returns false otherwise. **See also** [setLanguageChangeEnabled](quiloader#setLanguageChangeEnabled)(). ### [QWidget](qwidget) \*QUiLoader::load([QIODevice](qiodevice) \**device*, [QWidget](qwidget) \**parentWidget* = nullptr) Loads a form from the given *device* and creates a new widget with the given *parentWidget* to hold its contents. **See also** [createWidget](quiloader#createWidget)() and [errorString](quiloader#errorString)(). ### [QStringList](qstringlist) QUiLoader::pluginPaths() const Returns a list naming the paths in which the loader will search when locating custom widget plugins. **See also** [addPluginPath](quiloader#addPluginPath)() and [clearPluginPaths](quiloader#clearPluginPaths)(). ### void QUiLoader::setLanguageChangeEnabled(bool *enabled*) If *enabled* is true, user interfaces loaded by this loader will automatically retranslate themselves upon receiving a language change event. Otherwise, the user interfaces will not be retranslated. **See also** [isLanguageChangeEnabled](quiloader#isLanguageChangeEnabled)(). ### void QUiLoader::setWorkingDirectory(const [QDir](qdir) &*dir*) Sets the working directory of the loader to *dir*. The loader will look for other resources, such as icons and resource files, in paths relative to this directory. **See also** [workingDirectory](quiloader#workingDirectory)(). ### [QDir](qdir) QUiLoader::workingDirectory() const Returns the working directory of the loader. **See also** [setWorkingDirectory](quiloader#setWorkingDirectory)(). qt TabBar QML Type TabBar QML Type =============== Allows the user to switch between different views or subtasks. [More...](#details) | | | | --- | --- | | Import Statement: | import QtQuick.Controls | | Since: | Qt 5.7 | | Inherits: | [Container](qml-qtquick-controls2-container) | * [List of all members, including inherited members](https://doc.qt.io/qt-6.2/qml-qtquick-controls2-tabbar-members.html) Properties ---------- * **[contentHeight](qml-qtquick-controls2-tabbar#contentHeight-prop)** : real * **[contentWidth](qml-qtquick-controls2-tabbar#contentWidth-prop)** : real * **[position](qml-qtquick-controls2-tabbar#position-prop)** : enumeration Attached Properties ------------------- * **[index](qml-qtquick-controls2-tabbar#index-attached-prop)** : int * **[position](qml-qtquick-controls2-tabbar#position-attached-prop)** : enumeration * **[tabBar](qml-qtquick-controls2-tabbar#tabBar-attached-prop)** : TabBar Detailed Description -------------------- TabBar provides a tab-based navigation model. TabBar is populated with [TabButton](qml-qtquick-controls2-tabbutton) controls, and can be used together with any layout or container control that provides `currentIndex` -property, such as [StackLayout](qml-qtquick-layouts-stacklayout) or [SwipeView](qml-qtquick-controls2-swipeview) ``` TabBar { id: bar width: parent.width TabButton { text: qsTr("Home") } TabButton { text: qsTr("Discover") } TabButton { text: qsTr("Activity") } } StackLayout { width: parent.width currentIndex: bar.currentIndex Item { id: homeTab } Item { id: discoverTab } Item { id: activityTab } } ``` As shown above, TabBar is typically populated with a static set of tab buttons that are defined inline as children of the tab bar. It is also possible to [add](qml-qtquick-controls2-container#addItem-method), [insert](qml-qtquick-controls2-container#insertItem-method), [move](qml-qtquick-controls2-container#moveItem-method), and [remove](qml-qtquick-controls2-container#removeItem-method) items dynamically at run time. The items can be accessed using [itemAt](qml-qtquick-controls2-container#itemAt-method)() or [contentChildren](qml-qtquick-controls2-container#contentChildren-prop). ### Resizing Tabs By default, TabBar resizes its buttons to fit the width of the control. The available space is distributed equally to each button. The default resizing behavior can be overridden by setting an explicit width for the buttons. The following example illustrates how to keep each tab button at their implicit size instead of being resized to fit the tabbar: ``` TabBar { width: parent.width TabButton { text: "First" width: implicitWidth } TabButton { text: "Second" width: implicitWidth } TabButton { text: "Third" width: implicitWidth } } ``` ### Flickable Tabs If the total width of the buttons exceeds the available width of the tab bar, it automatically becomes flickable. ``` TabBar { id: bar width: parent.width Repeater { model: ["First", "Second", "Third", "Fourth", "Fifth"] TabButton { text: modelData width: Math.max(100, bar.width / 5) } } } ``` **See also** [TabButton](qml-qtquick-controls2-tabbutton), [Customizing TabBar](qtquickcontrols2-customize#customizing-tabbar), [Navigation Controls](qtquickcontrols2-navigation), [Container Controls](qtquickcontrols2-containers), and [Focus Management in Qt Quick Controls](qtquickcontrols2-focus). Property Documentation ---------------------- ### [since QtQuick.Controls 2.2 (Qt 5.9)] contentHeight : [real](qml-real) This property holds the content height. It is used for calculating the total implicit height of the tab bar. **Note:** This property is available in [TabBar](qml-qtquick-controls2-tabbar) since [QtQuick](https://doc.qt.io/qt-6.2/qtquick-module.html).Controls 2.2 (Qt 5.9), but it was promoted to the Container base type in [QtQuick](https://doc.qt.io/qt-6.2/qtquick-module.html).Controls 2.5 (Qt 5.12). This property was introduced in QtQuick.Controls 2.2 (Qt 5.9). **See also** [Container::contentHeight](qml-qtquick-controls2-container#contentHeight-prop). ### [since QtQuick.Controls 2.2 (Qt 5.9)] contentWidth : [real](qml-real) This property holds the content width. It is used for calculating the total implicit width of the tab bar. **Note:** This property is available in [TabBar](qml-qtquick-controls2-tabbar) since [QtQuick](https://doc.qt.io/qt-6.2/qtquick-module.html).Controls 2.2 (Qt 5.9), but it was promoted to the Container base type in [QtQuick](https://doc.qt.io/qt-6.2/qtquick-module.html).Controls 2.5 (Qt 5.12). This property was introduced in QtQuick.Controls 2.2 (Qt 5.9). **See also** [Container::contentWidth](qml-qtquick-controls2-container#contentWidth-prop). ### position : [enumeration](qml-enumeration) This property holds the position of the tab bar. **Note:** If the tab bar is assigned as a header or footer of [ApplicationWindow](qtquickcontrols-changes-qt6#applicationwindow) or [Page](qml-qtquick-controls2-page), the appropriate position is set automatically. Possible values: | Constant | Description | | --- | --- | | `TabBar.Header` | The tab bar is at the top, as a window or page header. | | `TabBar.Footer` | The tab bar is at the bottom, as a window or page footer. | The default value is style-specific. **See also** [ApplicationWindow::header](qml-qtquick-controls2-applicationwindow#header-attached-prop), [ApplicationWindow::footer](qml-qtquick-controls2-applicationwindow#footer-attached-prop), [Page::header](qml-qtquick-controls2-page#header-prop), and [Page::footer](qml-qtquick-controls2-page#footer-prop). Attached Property Documentation ------------------------------- ### [read-only, since QtQuick.Controls 2.3 (Qt 5.10)] TabBar.index : [int](qml-int) This attached property holds the index of each tab button in the [TabBar](qml-qtquick-controls2-tabbar). It is attached to each tab button of the [TabBar](qml-qtquick-controls2-tabbar). This property was introduced in QtQuick.Controls 2.3 (Qt 5.10). ### [read-only, since QtQuick.Controls 2.3 (Qt 5.10)] TabBar.position : [enumeration](qml-enumeration) This attached property holds the position of the tab bar. It is attached to each tab button of the [TabBar](qml-qtquick-controls2-tabbar). Possible values: | Constant | Description | | --- | --- | | `TabBar.Header` | The tab bar is at the top, as a window or page header. | | `TabBar.Footer` | The tab bar is at the bottom, as a window or page footer. | This property was introduced in QtQuick.Controls 2.3 (Qt 5.10). ### [read-only, since QtQuick.Controls 2.3 (Qt 5.10)] TabBar.tabBar : [TabBar](qml-qtquick-controls2-tabbar) This attached property holds the tab bar that manages this tab button. It is attached to each tab button of the [TabBar](qml-qtquick-controls2-tabbar). This property was introduced in QtQuick.Controls 2.3 (Qt 5.10).
programming_docs
qt Qt Widgets Qt Widgets ========== The [Qt Widgets Module](https://doc.qt.io/qt-6.2/qtwidgets-module.html) provides a set of UI elements to create classic desktop-style user interfaces. See the [User Interfaces](https://doc.qt.io/qt-6.2/topics-ui.html) overview for more information on using widgets. Widgets ------- Widgets are the primary elements for creating user interfaces in Qt. [Widgets](widget-classes#the-widget-classes) can display data and status information, receive user input, and provide a container for other widgets that should be grouped together. A widget that is not embedded in a parent widget is called a [window](application-windows). The [QWidget](qwidget) class provides the basic capability to render to the screen, and to handle user input events. All UI elements that Qt provides are either subclasses of [QWidget](qwidget), or are used in connection with a [QWidget](qwidget) subclass. Creating custom widgets is done by subclassing [QWidget](qwidget) or a suitable subclass and reimplementing the virtual event handlers. * [Window and Dialog Widgets](application-windows) * [Application Main Window](mainwindow) * [Dialog Windows](dialogs) * [Keyboard Focus in Widgets](focus) Styles ------ [Styles](style-reference) draw on behalf of widgets and encapsulate the look and feel of a GUI. Qt's built-in widgets use the [QStyle](qstyle) class to perform nearly all of their drawing, ensuring that they look exactly like the equivalent native widgets. | | | | | --- | --- | --- | | | | | [Qt Style Sheets](stylesheet) are a powerful mechanism that allows you to customize the appearance of widgets, in addition to what is already possible by subclassing [QStyle](qstyle). Layouts ------- [Layouts](layout) are an elegant and flexible way to automatically arrange child widgets within their container. Each widget reports its size requirements to the layout through the [sizeHint](qwidget#sizeHint-prop) and [sizePolicy](qwidget#sizePolicy-prop) properties, and the layout distributes the available space accordingly. | | | | --- | --- | | | | [Qt Designer](qtdesigner-manual) is a powerful tool for interactively creating and arranging widgets in layouts. Model/View Classes ------------------ The [model/view](model-view-programming) architecture provides classes that manage the way data is presented to the user. Data-driven applications which use lists and tables are structured to separate the data and view using models, views, and delegates. Graphics View ------------- The [Graphics View Framework](graphicsview) is for managing and interacting with a large number of custom-made 2D graphical items, and a view widget for visualizing the items, with support for zooming and rotation. Using the Module ---------------- Using a Qt module requires linking against the module library, either directly or through other dependencies. Several build tools have dedicated support for this, including [CMake](http://www.cmake.org/cmake/help/documentation.html) and [qmake](resources#qmake). ### Building with CMake Use the `find_package()` command to locate the needed module components in the `Qt6` package: ``` find_package(Qt6 COMPONENTS Widgets REQUIRED) target_link_libraries(mytarget PRIVATE Qt6::Widgets) ``` See also the [Build with CMake](cmake-manual) overview. ### Building with qmake To configure the module for building with qmake, add the module as a value of the `QT` variable in the project's .pro file: ``` QT += widgets ``` Module Evolution ---------------- [Changes to Qt Widgets](widgets-changes-qt6) lists important changes in the module API and functionality that were done for the Qt 6 series of Qt. Licenses -------- The Qt Widgets module is available under commercial licenses from [The Qt Company](http://www.qt.io/about-us/). In addition, it is available under free software licenses: The [GNU Lesser General Public License, version 3](http://www.gnu.org/licenses/lgpl-3.0.html), or the [GNU General Public License, version 2](http://www.gnu.org/licenses/gpl-2.0.html). See [Qt Licensing](https://doc.qt.io/qt-6.2/licensing.html) for further details. Related Information ------------------- ### Tutorials * [Widgets Tutorial](https://doc.qt.io/qt-6.2/widgets-tutorial.html) * [Getting Started Programming with Qt Widgets](https://doc.qt.io/qt-6.2/qtwidgets-tutorials-notepad-example.html) * [Creating a Qt Widget Based Application](https://doc.qt.io/qtcreator/creator-writing-program.html) * [Model/View Tutorial](https://doc.qt.io/qt-6.2/modelview.html) ### Examples * [Qt Widgets Examples](https://doc.qt.io/qt-6.2/examples-widgets.html) * [Layout Examples](layout#layout-examples) API Reference ------------- These are links to the API reference materials. * [Qt Widgets C++ Classes](https://doc.qt.io/qt-6.2/qtwidgets-module.html) + [Basic Widget Classes](widget-classes#basic-widget-classes) + [Advanced Widget Classes](widget-classes#advanced-widget-classes) + [Abstract Widget Classes](widget-classes#abstract-widget-classes) + [Organizer Widget Classes](widget-classes#organizer-widget-classes) + [Graphics View Classes](widget-classes#graphics-view-classes) + [Model/View Classes](model-view-programming#model-view-classes) + [Main Window and Related Classes](widget-classes#main-window-and-related-classes) + [Widget Appearance and Style Related Classes](widget-classes#widget-appearance-and-style-related-classes) + [Layout Classes](widget-classes#layout-classes) * [Qt Style Sheets Reference](stylesheet-reference) qt QKeyCombination Class QKeyCombination Class ===================== The QKeyCombination class stores a combination of a key with optional modifiers. [More...](#details) | | | | --- | --- | | Header: | #include <QKeyCombination> | | CMake: | find\_package(Qt6 COMPONENTS Core REQUIRED) target\_link\_libraries(mytarget PRIVATE Qt6::Core) | | qmake: | QT += core | | Since: | Qt 6.0 | * [List of all members, including inherited members](https://doc.qt.io/qt-6.2/qkeycombination-members.html) * [Deprecated members](https://doc.qt.io/qt-6.2/qkeycombination-obsolete.html) Public Functions ---------------- | | | | --- | --- | | | **[QKeyCombination](qkeycombination#QKeyCombination-2)**(Qt::KeyboardModifiers *modifiers*, Qt::Key *key* = Qt::Key\_unknown) | | | **[QKeyCombination](qkeycombination#QKeyCombination-1)**(Qt::Modifiers *modifiers*, Qt::Key *key* = Qt::Key\_unknown) | | | **[QKeyCombination](qkeycombination#QKeyCombination)**(Qt::Key *key* = Qt::Key\_unknown) | | Qt::Key | **[key](qkeycombination#key)**() const | | Qt::KeyboardModifiers | **[keyboardModifiers](qkeycombination#keyboardModifiers)**() const | | int | **[toCombined](qkeycombination#toCombined)**() const | Static Public Members --------------------- | | | | --- | --- | | QKeyCombination | **[fromCombined](qkeycombination#fromCombined)**(int *combined*) | Related Non-Members ------------------- | | | | --- | --- | | size\_t | **[qHash](qkeycombination#qHash)**(QKeyCombination *key*, size\_t *seed* = 0) | | bool | **[operator!=](qkeycombination#operator-not-eq)**(QKeyCombination *lhs*, QKeyCombination *rhs*) | | QDebug | **[operator<<](qkeycombination#operator-lt-lt)**(QDebug *debug*, QKeyCombination *combination*) | | QDataStream & | **[operator<<](qkeycombination#operator-lt-lt-1)**(QDataStream &*out*, QKeyCombination *combination*) | | bool | **[operator==](qkeycombination#operator-eq-eq)**(QKeyCombination *lhs*, QKeyCombination *rhs*) | | QDataStream & | **[operator>>](qkeycombination#operator-gt-gt)**(QDataStream &*in*, QKeyCombination &*combination*) | | QKeyCombination | **[operator|](qkeycombination#operator-7c)**(Qt::Modifier *modifier*, Qt::Key *key*) | | QKeyCombination | **[operator|](qkeycombination#operator-7c-1)**(Qt::KeyboardModifier *modifier*, Qt::Key *key*) | | QKeyCombination | **[operator|](qkeycombination#operator-7c-2)**(Qt::Key *key*, Qt::Modifier *modifier*) | | QKeyCombination | **[operator|](qkeycombination#operator-7c-3)**(Qt::Key *key*, Qt::KeyboardModifier *modifier*) | | QKeyCombination | **[operator|](qkeycombination#operator-7c-4)**(Qt::Modifiers *modifiers*, Qt::Key *key*) | | QKeyCombination | **[operator|](qkeycombination#operator-7c-5)**(Qt::KeyboardModifiers *modifiers*, Qt::Key *key*) | | QKeyCombination | **[operator|](qkeycombination#operator-7c-6)**(Qt::Key *key*, Qt::Modifiers *modifiers*) | | QKeyCombination | **[operator|](qkeycombination#operator-7c-7)**(Qt::Key *key*, Qt::KeyboardModifiers *modifiers*) | Detailed Description -------------------- The QKeyCombination class can be used to represent a combination of a key with zero or more keyboard modifiers. **See also** [QKeySequence](qkeysequence). Member Function Documentation ----------------------------- ### QKeyCombination::QKeyCombination([Qt::KeyboardModifiers](qt#KeyboardModifier-enum) *modifiers*, [Qt::Key](qt#Key-enum) *key* = Qt::Key\_unknown) Constructs a QKeyCombination object that represents the combination of *key* with the modifiers *modifiers*. **See also** [key](qkeycombination#key)() and [keyboardModifiers](qkeycombination#keyboardModifiers)(). ### QKeyCombination::QKeyCombination([Qt::Modifiers](qt#Modifier-enum) *modifiers*, [Qt::Key](qt#Key-enum) *key* = Qt::Key\_unknown) Constructs a QKeyCombination object that represents the combination of *key* with the modifiers *modifiers*. **See also** [key](qkeycombination#key)() and [keyboardModifiers](qkeycombination#keyboardModifiers)(). ### QKeyCombination::QKeyCombination([Qt::Key](qt#Key-enum) *key* = Qt::Key\_unknown) Constructs a QKeyCombination object that represents the key *key* and no modifiers. **See also** [key](qkeycombination#key)(). ### `[static]` [QKeyCombination](qkeycombination#QKeyCombination) QKeyCombination::fromCombined(int *combined*) Constructs a [QKeyCombination](qkeycombination) object by extracting the key and the modifiers out of *combined*, which must be the result of a bitwise OR between a value of type [Qt::Key](qt#Key-enum) and value of type [Qt::KeyboardModifiers](qt#KeyboardModifier-enum). [toCombined](qkeycombination#toCombined)() can be used in order to produce valid values for *combined*. **See also** [toCombined](qkeycombination#toCombined)(). ### [Qt::Key](qt#Key-enum) QKeyCombination::key() const Returns the key represented by this [QKeyCombination](qkeycombination) object. **See also** [keyboardModifiers](qkeycombination#keyboardModifiers)(). ### [Qt::KeyboardModifiers](qt#KeyboardModifier-enum) QKeyCombination::keyboardModifiers() const Returns the keyboard modifiers represented by this [QKeyCombination](qkeycombination) object. **See also** [key](qkeycombination#key)(). ### int QKeyCombination::toCombined() const Returns an integer value obtained by applying a bitwise OR between the values of [key](qkeycombination#key)() and [keyboardModifiers](qkeycombination#keyboardModifiers)() represented by this object. A [QKeyCombination](qkeycombination) object can be created from the returned integer value by using [fromCombined](qkeycombination#fromCombined)(). **See also** [fromCombined](qkeycombination#fromCombined)(), [key](qkeycombination#key)(), and [keyboardModifiers](qkeycombination#keyboardModifiers)(). Related Non-Members ------------------- ### [QKeyCombination](qkeycombination#QKeyCombination) operator|([Qt::Key](qt#Key-enum) *key*, [Qt::KeyboardModifiers](qt#KeyboardModifier-enum) *modifiers*) ### [QKeyCombination](qkeycombination#QKeyCombination) operator|([Qt::Key](qt#Key-enum) *key*, [Qt::Modifiers](qt#Modifier-enum) *modifiers*) ### [QKeyCombination](qkeycombination#QKeyCombination) operator|([Qt::KeyboardModifiers](qt#KeyboardModifier-enum) *modifiers*, [Qt::Key](qt#Key-enum) *key*) ### [QKeyCombination](qkeycombination#QKeyCombination) operator|([Qt::Modifiers](qt#Modifier-enum) *modifiers*, [Qt::Key](qt#Key-enum) *key*) Returns a [QKeyCombination](qkeycombination) object that represents the combination of *key* with the modifiers *modifiers*. ### [QKeyCombination](qkeycombination#QKeyCombination) operator|([Qt::Key](qt#Key-enum) *key*, [Qt::KeyboardModifier](qt#KeyboardModifier-enum) *modifier*) ### [QKeyCombination](qkeycombination#QKeyCombination) operator|([Qt::Key](qt#Key-enum) *key*, [Qt::Modifier](qt#Modifier-enum) *modifier*) ### [QKeyCombination](qkeycombination#QKeyCombination) operator|([Qt::KeyboardModifier](qt#KeyboardModifier-enum) *modifier*, [Qt::Key](qt#Key-enum) *key*) ### [QKeyCombination](qkeycombination#QKeyCombination) operator|([Qt::Modifier](qt#Modifier-enum) *modifier*, [Qt::Key](qt#Key-enum) *key*) Returns a [QKeyCombination](qkeycombination) object that represents the combination of *key* with the modifier *modifier*. ### size\_t qHash([QKeyCombination](qkeycombination#QKeyCombination) *key*, size\_t *seed* = 0) Returns the hash value for the *key*, using *seed* to seed the calculation. ### bool operator!=([QKeyCombination](qkeycombination#QKeyCombination) *lhs*, [QKeyCombination](qkeycombination#QKeyCombination) *rhs*) Returns `true` if *lhs* and *rhs* have different combinations of key and modifiers, otherwise `false`. ### [QDebug](qdebug) operator<<([QDebug](qdebug) *debug*, [QKeyCombination](qkeycombination#QKeyCombination) *combination*) Writes the combination *combination* into the debug object *debug* for debugging purposes. **See also** [Debugging Techniques](testing-and-debugging#debugging-techniques). ### [QDataStream](qdatastream) &operator<<([QDataStream](qdatastream) &*out*, [QKeyCombination](qkeycombination#QKeyCombination) *combination*) Writes the combination *combination* into the stream *out*. Returns *out*. **See also** [Serializing Qt Data Types](datastreamformat). ### bool operator==([QKeyCombination](qkeycombination#QKeyCombination) *lhs*, [QKeyCombination](qkeycombination#QKeyCombination) *rhs*) Returns `true` if *lhs* and *rhs* have the same combination of key and modifiers, and `false` otherwise. ### [QDataStream](qdatastream) &operator>>([QDataStream](qdatastream) &*in*, [QKeyCombination](qkeycombination#QKeyCombination) &*combination*) Reads the combination *combination* from the stream *in*. Returns *in*. **See also** [Serializing Qt Data Types](datastreamformat). qt StateMachine QML Type StateMachine QML Type ===================== Provides a hierarchical finite state machine. [More...](#details) | | | | --- | --- | | Import Statement: | import QtQml.StateMachine | | Since: | Qt 5.4 | | Inherits: | [State](qml-qtqml-statemachine-state) | * [List of all members, including inherited members](https://doc.qt.io/qt-6.2/qml-qtqml-statemachine-statemachine-members.html) Properties ---------- * **[errorString](qml-qtqml-statemachine-statemachine#errorString-prop)** : string * **[globalRestorePolicy](qml-qtqml-statemachine-statemachine#globalRestorePolicy-prop)** : enumeration * **[running](qml-qtqml-statemachine-statemachine#running-prop)** : bool Signals ------- * **[started](qml-qtqml-statemachine-statemachine#started-signal)**() * **[stopped](qml-qtqml-statemachine-statemachine#stopped-signal)**() Methods ------- * **[start](qml-qtqml-statemachine-statemachine#start-method)**() * **[stop](qml-qtqml-statemachine-statemachine#stop-method)**() Detailed Description -------------------- StateMachine is based on the concepts and notation of [Statecharts](http://www.wisdom.weizmann.ac.il/~dharel/SCANNED.PAPERS/Statecharts.pdf). StateMachine is part of [Qt State Machine QML API](qmlstatemachine-qml-guide) A state machine manages a set of states and transitions between those states; these states and transitions define a state graph. Once a state graph has been built, the state machine can execute it. StateMachine's execution algorithm is based on the [State Chart XML (SCXML)](http://www.w3.org/TR/scxml/) algorithm. The framework's [overview](qmlstatemachine-qml-guide) gives several state graphs and the code to build them. Before the machine can be started, the [initialState](qml-qtqml-statemachine-state#initialState-prop) must be set. The initial state is the state that the machine enters when started. You can then set running property to true or [start](qml-qtqml-statemachine-statemachine#start-method)() the state machine. The started signal is emitted when the initial state is entered. The state machine processes events and takes transitions until a top-level final state is entered; the state machine then emits the finished() signal. You can also [stop](qml-qtqml-statemachine-statemachine#stop-method)() the state machine explicitly (you can also set running property to false). The stopped signal is emitted in this case. Example Usage ------------- The following snippet shows a state machine that will finish when a button is clicked: ``` import QtQuick import QtQml.StateMachine as DSM Rectangle { Button { anchors.fill: parent id: button text: "Finish state" DSM.StateMachine { id: stateMachine initialState: state running: true DSM.State { id: state DSM.SignalTransition { targetState: finalState signal: button.clicked } } DSM.FinalState { id: finalState } onFinished: Qt.quit() } } } ``` If an error is encountered, the machine will look for an [errorState](qml-qtqml-statemachine-state#errorState-prop), and if one is available, it will enter this state. After the error state is entered, the type of the error can be retrieved with error(). The execution of the state graph will not stop when the error state is entered. If no error state applies to the erroneous state, the machine will stop executing and an error message will be printed to the console. **Warning:** Setting the childMode of a StateMachine to anything else than [QState::ExclusiveStates](qstate#ChildMode-enum) will result in an invalid state machine, and can lead to incorrect behavior. **See also** [QAbstractState](qml-qtqml-statemachine-qabstractstate), [State](qml-qtqml-statemachine-state), [SignalTransition](qml-qtqml-statemachine-signaltransition), [TimeoutTransition](qml-qtqml-statemachine-timeouttransition), [HistoryState](qml-qtqml-statemachine-historystate), and [Qt State Machine QML Guide](qmlstatemachine-qml-guide). Property Documentation ---------------------- ### [read-only] errorString : [string](qml-string) The error string of this state machine. ### globalRestorePolicy : [enumeration](qml-enumeration) The restore policy for states of this state machine. The default value of this property is [QState](qstate).DontRestoreProperties. This enum specifies the restore policy type. The restore policy takes effect when the machine enters a state which sets one or more properties. If the restore policy is set to [QState](qstate).RestoreProperties, the state machine will save the original value of the property before the new value is set. Later, when the machine either enters a state which does not set a value for the given property, the property will automatically be restored to its initial value. Only one initial value will be saved for any given property. If a value for a property has already been saved by the state machine, it will not be overwritten until the property has been successfully restored. * [QState](qstate).DontRestoreProperties The state machine should not save the initial values of properties and restore them later. * [QState](qstate).RestoreProperties The state machine should save the initial values of properties and restore them later. ### running : [bool](qml-bool) The running state of this state machine. **See also** [start](qml-qtqml-statemachine-statemachine#start-method)() and [stop](qml-qtqml-statemachine-statemachine#stop-method)(). Signal Documentation -------------------- ### started() This signal is emitted when the state machine has entered its initial state ([State::initialState](qml-qtqml-statemachine-state#initialState-prop)). **Note:** The corresponding handler is `onStarted`. **See also** [running](qml-qtqml-statemachine-statemachine#running-prop), [start](qml-qtqml-statemachine-statemachine#start-method)(), and [State::finished](qml-qtqml-statemachine-state#finished-signal). ### stopped() This signal is emitted when the state machine has stopped. **Note:** The corresponding handler is `onStopped`. **See also** [running](qml-qtqml-statemachine-statemachine#running-prop), [stop](qml-qtqml-statemachine-statemachine#stop-method)(), and [State::finished](qml-qtqml-statemachine-state#finished-signal). Method Documentation -------------------- ### start() Starts this state machine. The machine will reset its configuration and transition to the initial state. When a final top-level state ([FinalState](qml-qtqml-statemachine-finalstate)) is entered, the machine will emit the finished() signal. **Note:** A state machine will not run without a running event loop, such as the main application event loop started with [QCoreApplication::exec](qcoreapplication#exec)() or [QApplication::exec](qapplication#exec)(). **See also** [started](qml-qtqml-statemachine-statemachine#started-signal), [State::finished](qml-qtqml-statemachine-state#finished-signal), [stop](qml-qtqml-statemachine-statemachine#stop-method)(), [State::initialState](qml-qtqml-statemachine-state#initialState-prop), and [running](qml-qtqml-statemachine-statemachine#running-prop). ### stop() Stops this state machine. The state machine will stop processing events and then emit the stopped signal. **See also** [stopped](qml-qtqml-statemachine-statemachine#stopped-signal), [start](qml-qtqml-statemachine-statemachine#start-method)(), and [running](qml-qtqml-statemachine-statemachine#running-prop).
programming_docs
qt QFrontFace Class QFrontFace Class ================ class [Qt3DRender](https://doc.qt.io/qt-6.2/qt3drender-module.html)::QFrontFace The QFrontFace class defines front and back facing polygons. [More...](#details) | | | | --- | --- | | Header: | #include <QFrontFace> | | CMake: | find\_package(Qt6 COMPONENTS 3drender REQUIRED) target\_link\_libraries(mytarget PRIVATE Qt6::3drender) | | qmake: | QT += 3drender | | Since: | Qt 5.7 | | Instantiated By: | [FrontFace](qml-qt3d-render-frontface) | | Inherits: | [Qt3DRender::QRenderState](qt3drender-qrenderstate) | * [List of all members, including inherited members](https://doc.qt.io/qt-6.2/qt3drender-qfrontface-members.html) Public Types ------------ | | | | --- | --- | | enum | **[WindingDirection](qt3drender-qfrontface#WindingDirection-enum)** { ClockWise, CounterClockWise } | Properties ---------- * **[direction](qt3drender-qfrontface#direction-prop)** : WindingDirection Public Functions ---------------- | | | | --- | --- | | | **[QFrontFace](qt3drender-qfrontface#QFrontFace)**(Qt3DCore::QNode \**parent* = nullptr) | | Qt3DRender::QFrontFace::WindingDirection | **[direction](qt3drender-qfrontface#direction-prop)**() const | Public Slots ------------ | | | | --- | --- | | void | **[setDirection](qt3drender-qfrontface#direction-prop)**(Qt3DRender::QFrontFace::WindingDirection *direction*) | Signals ------- | | | | --- | --- | | void | **[directionChanged](qt3drender-qfrontface#direction-prop)**(Qt3DRender::QFrontFace::WindingDirection *direction*) | Detailed Description -------------------- A [Qt3DRender::QFrontFace](qt3drender-qfrontface) sets the winding direction of the front facing polygons. **See also** [QCullFace](qt3drender-qcullface). Member Type Documentation ------------------------- ### enum QFrontFace::WindingDirection This enumeration specifies the winding direction values. | Constant | Value | Description | | --- | --- | --- | | `Qt3DRender::QFrontFace::ClockWise` | `0x0900` | Clockwise polygons are front facing. | | `Qt3DRender::QFrontFace::CounterClockWise` | `0x0901` | Counter clockwise polygons are front facing. | Property Documentation ---------------------- ### direction : [WindingDirection](qt3drender-qfrontface#WindingDirection-enum) Holds the winding direction of the front facing polygons. Default is Clockwise. **Access functions:** | | | | --- | --- | | Qt3DRender::QFrontFace::WindingDirection | **direction**() const | | void | **setDirection**(Qt3DRender::QFrontFace::WindingDirection *direction*) | **Notifier signal:** | | | | --- | --- | | void | **directionChanged**(Qt3DRender::QFrontFace::WindingDirection *direction*) | Member Function Documentation ----------------------------- ### QFrontFace::QFrontFace([Qt3DCore::QNode](qt3dcore-qnode) \**parent* = nullptr) The constructor creates a new [QFrontFace::QFrontFace](qt3drender-qfrontface) instance with the specified *parent* qt QScxmlDynamicScxmlServiceFactory Class QScxmlDynamicScxmlServiceFactory Class ====================================== The QScxmlDynamicScxmlServiceFactory class creates SCXML service instances from documents loaded at runtime. [More...](#details) | | | | --- | --- | | Header: | #include <QScxmlDynamicScxmlServiceFactory> | | CMake: | find\_package(Qt6 COMPONENTS Scxml REQUIRED) target\_link\_libraries(mytarget PRIVATE Qt6::Scxml) | | qmake: | QT += scxml | | Since: | Qt 5.8 | | Inherits: | [QScxmlInvokableServiceFactory](qscxmlinvokableservicefactory) | * [List of all members, including inherited members](https://doc.qt.io/qt-6.2/qscxmldynamicscxmlservicefactory-members.html) Public Functions ---------------- | | | | --- | --- | | | **[QScxmlDynamicScxmlServiceFactory](qscxmldynamicscxmlservicefactory#QScxmlDynamicScxmlServiceFactory)**(const QScxmlExecutableContent::InvokeInfo &*invokeInfo*, const QList<QScxmlExecutableContent::StringId> &*names*, const QList<QScxmlExecutableContent::ParameterInfo> &*parameters*, QObject \**parent* = nullptr) | Reimplemented Public Functions ------------------------------ | | | | --- | --- | | virtual QScxmlInvokableService \* | **[invoke](qscxmldynamicscxmlservicefactory#invoke)**(QScxmlStateMachine \**parentStateMachine*) override | Detailed Description -------------------- Dynamically resolved services are used when loading [SCXML](http://www.w3.org/TR/scxml/) content from files that a parent state machine requests at runtime, via the `srcexpr` attribute in the `<invoke>` element. Member Function Documentation ----------------------------- ### QScxmlDynamicScxmlServiceFactory::QScxmlDynamicScxmlServiceFactory(const [QScxmlExecutableContent::InvokeInfo](qscxmlexecutablecontent-invokeinfo) &*invokeInfo*, const [QList](qlist)<[QScxmlExecutableContent::StringId](qscxmlexecutablecontent#StringId-typedef)> &*names*, const [QList](qlist)<[QScxmlExecutableContent::ParameterInfo](qscxmlexecutablecontent-parameterinfo)> &*parameters*, [QObject](qobject#QObject) \**parent* = nullptr) Creates a factory for dynamically resolved services, passing the attributes of the `<invoke>` element as *invokeInfo*, any `<param>` child elements as *parameters*, the content of the `names` attribute as *names*, and the [QObject](qobject) parent *parent*. ### `[override virtual]` [QScxmlInvokableService](qscxmlinvokableservice) \*QScxmlDynamicScxmlServiceFactory::invoke([QScxmlStateMachine](qscxmlstatemachine) \**parentStateMachine*) Reimplements: [QScxmlInvokableServiceFactory::invoke](qscxmlinvokableservicefactory#invoke)(QScxmlStateMachine \*parentStateMachine). qt SphereMesh QML Type SphereMesh QML Type =================== A spherical mesh. [More...](#details) | | | | --- | --- | | Import Statement: | import Qt3D.Extras | | Instantiates: | [QSphereMesh](qt3dextras-qspheremesh) | * [List of all members, including inherited members](https://doc.qt.io/qt-6.2/qml-qt3d-extras-spheremesh-members.html) Properties ---------- * **[generateTangents](qml-qt3d-extras-spheremesh#generateTangents-prop)** : bool * **[radius](qml-qt3d-extras-spheremesh#radius-prop)** : real * **[rings](qml-qt3d-extras-spheremesh#rings-prop)** : int * **[slices](qml-qt3d-extras-spheremesh#slices-prop)** : int Detailed Description -------------------- Property Documentation ---------------------- ### generateTangents : [bool](qml-bool) Holds the value of the automatic tangent vectors generation flag. Tangent vectors are orthogonal to normal vectors. ### radius : [real](qml-real) Holds the radius of the sphere. ### rings : [int](qml-int) Holds the number of rings in the mesh. ### slices : [int](qml-int) Holds the number of slices in the mesh. qt QtConcurrent Namespace QtConcurrent Namespace ====================== The QtConcurrent namespace provides high-level APIs that make it possible to write multi-threaded programs without using low-level threading primitives. [More...](#details) | | | | --- | --- | | Header: | #include <QtConcurrent> | | CMake: | find\_package(Qt6 COMPONENTS Concurrent REQUIRED) target\_link\_libraries(mytarget PRIVATE Qt6::Concurrent) | | qmake: | QT += concurrent | Classes ------- | | | | --- | --- | | class | **[QTaskBuilder](qtconcurrent-qtaskbuilder)** | Types ----- | | | | --- | --- | | enum class | **[FutureResult](qtconcurrent#FutureResult-enum)** { Ignore } | | | **[InvokeResultType](qtconcurrent-qtaskbuilder#InvokeResultType-typedef)** | | enum | **[ReduceOption](qtconcurrent#ReduceOption-enum)** { UnorderedReduce, OrderedReduce, SequentialReduce } | | flags | **[ReduceOptions](qtconcurrent#ReduceOption-enum)** | Functions --------- | | | | --- | --- | | void | **[blockingFilter](qtconcurrent#blockingFilter)**(QThreadPool \**pool*, Sequence &*sequence*, KeepFunctor &&*filterFunction*) | | void | **[blockingFilter](qtconcurrent#blockingFilter-1)**(Sequence &*sequence*, KeepFunctor &&*filterFunction*) | | std::decay\_t<Sequence> | **[blockingFiltered](qtconcurrent#blockingFiltered)**(QThreadPool \**pool*, Sequence &&*sequence*, KeepFunctor &&*filterFunction*) | | std::decay\_t<Sequence> | **[blockingFiltered](qtconcurrent#blockingFiltered-1)**(Sequence &&*sequence*, KeepFunctor &&*filterFunction*) | | OutputSequence | **[blockingFiltered](qtconcurrent#blockingFiltered-2)**(QThreadPool \**pool*, Iterator *begin*, Iterator *end*, KeepFunctor &&*filterFunction*) | | OutputSequence | **[blockingFiltered](qtconcurrent#blockingFiltered-3)**(Iterator *begin*, Iterator *end*, KeepFunctor &&*filterFunction*) | | ResultType | **[blockingFilteredReduced](qtconcurrent#blockingFilteredReduced)**(QThreadPool \**pool*, Sequence &&*sequence*, KeepFunctor &&*filterFunction*, ReduceFunctor &&*reduceFunction*, QtConcurrent::ReduceOptions *reduceOptions* = ReduceOptions(UnorderedReduce | SequentialReduce)) | | ResultType | **[blockingFilteredReduced](qtconcurrent#blockingFilteredReduced-1)**(Sequence &&*sequence*, KeepFunctor &&*filterFunction*, ReduceFunctor &&*reduceFunction*, QtConcurrent::ReduceOptions *reduceOptions* = ReduceOptions(UnorderedReduce | SequentialReduce)) | | ResultType | **[blockingFilteredReduced](qtconcurrent#blockingFilteredReduced-2)**(QThreadPool \**pool*, Sequence &&*sequence*, KeepFunctor &&*filterFunction*, ReduceFunctor &&*reduceFunction*, InitialValueType &&*initialValue*, QtConcurrent::ReduceOptions *reduceOptions* = ReduceOptions(UnorderedReduce | SequentialReduce)) | | ResultType | **[blockingFilteredReduced](qtconcurrent#blockingFilteredReduced-3)**(Sequence &&*sequence*, KeepFunctor &&*filterFunction*, ReduceFunctor &&*reduceFunction*, InitialValueType &&*initialValue*, QtConcurrent::ReduceOptions *reduceOptions* = ReduceOptions(UnorderedReduce | SequentialReduce)) | | ResultType | **[blockingFilteredReduced](qtconcurrent#blockingFilteredReduced-4)**(QThreadPool \**pool*, Iterator *begin*, Iterator *end*, KeepFunctor &&*filterFunction*, ReduceFunctor &&*reduceFunction*, QtConcurrent::ReduceOptions *reduceOptions* = ReduceOptions(UnorderedReduce | SequentialReduce)) | | ResultType | **[blockingFilteredReduced](qtconcurrent#blockingFilteredReduced-5)**(Iterator *begin*, Iterator *end*, KeepFunctor &&*filterFunction*, ReduceFunctor &&*reduceFunction*, QtConcurrent::ReduceOptions *reduceOptions* = ReduceOptions(UnorderedReduce | SequentialReduce)) | | ResultType | **[blockingFilteredReduced](qtconcurrent#blockingFilteredReduced-6)**(QThreadPool \**pool*, Iterator *begin*, Iterator *end*, KeepFunctor &&*filterFunction*, ReduceFunctor &&*reduceFunction*, InitialValueType &&*initialValue*, QtConcurrent::ReduceOptions *reduceOptions* = ReduceOptions(UnorderedReduce | SequentialReduce)) | | ResultType | **[blockingFilteredReduced](qtconcurrent#blockingFilteredReduced-7)**(Iterator *begin*, Iterator *end*, KeepFunctor &&*filterFunction*, ReduceFunctor &&*reduceFunction*, InitialValueType &&*initialValue*, QtConcurrent::ReduceOptions *reduceOptions* = ReduceOptions(UnorderedReduce | SequentialReduce)) | | void | **[blockingMap](qtconcurrent#blockingMap)**(QThreadPool \**pool*, Sequence &&*sequence*, MapFunctor *function*) | | void | **[blockingMap](qtconcurrent#blockingMap-1)**(Sequence &&*sequence*, MapFunctor &&*function*) | | void | **[blockingMap](qtconcurrent#blockingMap-2)**(QThreadPool \**pool*, Iterator *begin*, Iterator *end*, MapFunctor &&*function*) | | void | **[blockingMap](qtconcurrent#blockingMap-3)**(Iterator *begin*, Iterator *end*, MapFunctor &&*function*) | | OutputSequence | **[blockingMapped](qtconcurrent#blockingMapped)**(QThreadPool \**pool*, InputSequence &&*sequence*, MapFunctor &&*function*) | | OutputSequence | **[blockingMapped](qtconcurrent#blockingMapped-1)**(InputSequence &&*sequence*, MapFunctor &&*function*) | | Sequence | **[blockingMapped](qtconcurrent#blockingMapped-2)**(QThreadPool \**pool*, Iterator *begin*, Iterator *end*, MapFunctor &&*function*) | | Sequence | **[blockingMapped](qtconcurrent#blockingMapped-3)**(Iterator *begin*, Iterator *end*, MapFunctor &&*function*) | | ResultType | **[blockingMappedReduced](qtconcurrent#blockingMappedReduced)**(QThreadPool \**pool*, Sequence &&*sequence*, MapFunctor &&*mapFunction*, ReduceFunctor &&*reduceFunction*, QtConcurrent::ReduceOptions *reduceOptions* = ReduceOptions(UnorderedReduce | SequentialReduce)) | | ResultType | **[blockingMappedReduced](qtconcurrent#blockingMappedReduced-1)**(Sequence &&*sequence*, MapFunctor &&*mapFunction*, ReduceFunctor &&*reduceFunction*, QtConcurrent::ReduceOptions *reduceOptions* = ReduceOptions(UnorderedReduce | SequentialReduce)) | | ResultType | **[blockingMappedReduced](qtconcurrent#blockingMappedReduced-2)**(QThreadPool \**pool*, Sequence &&*sequence*, MapFunctor &&*mapFunction*, ReduceFunctor &&*reduceFunction*, InitialValueType &&*initialValue*, QtConcurrent::ReduceOptions *reduceOptions* = ReduceOptions(UnorderedReduce | SequentialReduce)) | | ResultType | **[blockingMappedReduced](qtconcurrent#blockingMappedReduced-3)**(Sequence &&*sequence*, MapFunctor &&*mapFunction*, ReduceFunctor &&*reduceFunction*, InitialValueType &&*initialValue*, QtConcurrent::ReduceOptions *reduceOptions* = ReduceOptions(UnorderedReduce | SequentialReduce)) | | ResultType | **[blockingMappedReduced](qtconcurrent#blockingMappedReduced-4)**(QThreadPool \**pool*, Iterator *begin*, Iterator *end*, MapFunctor &&*mapFunction*, ReduceFunctor &&*reduceFunction*, QtConcurrent::ReduceOptions *reduceOptions* = ReduceOptions(UnorderedReduce | SequentialReduce)) | | ResultType | **[blockingMappedReduced](qtconcurrent#blockingMappedReduced-5)**(Iterator *begin*, Iterator *end*, MapFunctor &&*mapFunction*, ReduceFunctor &&*reduceFunction*, QtConcurrent::ReduceOptions *reduceOptions* = ReduceOptions(UnorderedReduce | SequentialReduce)) | | ResultType | **[blockingMappedReduced](qtconcurrent#blockingMappedReduced-6)**(QThreadPool \**pool*, Iterator *begin*, Iterator *end*, MapFunctor &&*mapFunction*, ReduceFunctor &&*reduceFunction*, InitialValueType &&*initialValue*, QtConcurrent::ReduceOptions *reduceOptions* = ReduceOptions(UnorderedReduce | SequentialReduce)) | | ResultType | **[blockingMappedReduced](qtconcurrent#blockingMappedReduced-7)**(Iterator *begin*, Iterator *end*, MapFunctor &&*mapFunction*, ReduceFunctor &&*reduceFunction*, InitialValueType &&*initialValue*, QtConcurrent::ReduceOptions *reduceOptions* = ReduceOptions(UnorderedReduce | SequentialReduce)) | | QFuture<void> | **[filter](qtconcurrent#filter)**(QThreadPool \**pool*, Sequence &*sequence*, KeepFunctor &&*filterFunction*) | | QFuture<void> | **[filter](qtconcurrent#filter-1)**(Sequence &*sequence*, KeepFunctor &&*filterFunction*) | | QFuture<typename std::decay\_t<Sequence>::value\_type> | **[filtered](qtconcurrent#filtered)**(QThreadPool \**pool*, Sequence &&*sequence*, KeepFunctor &&*filterFunction*) | | QFuture<typename std::decay\_t<Sequence>::value\_type> | **[filtered](qtconcurrent#filtered-1)**(Sequence &&*sequence*, KeepFunctor &&*filterFunction*) | | QFuture<typename qValueType<Iterator>::value\_type> | **[filtered](qtconcurrent#filtered-2)**(QThreadPool \**pool*, Iterator *begin*, Iterator *end*, KeepFunctor &&*filterFunction*) | | QFuture<typename qValueType<Iterator>::value\_type> | **[filtered](qtconcurrent#filtered-3)**(Iterator *begin*, Iterator *end*, KeepFunctor &&*filterFunction*) | | QFuture<ResultType> | **[filteredReduced](qtconcurrent#filteredReduced)**(QThreadPool \**pool*, Sequence &&*sequence*, KeepFunctor &&*filterFunction*, ReduceFunctor &&*reduceFunction*, QtConcurrent::ReduceOptions *reduceOptions* = ReduceOptions(UnorderedReduce | SequentialReduce)) | | QFuture<ResultType> | **[filteredReduced](qtconcurrent#filteredReduced-1)**(Sequence &&*sequence*, KeepFunctor &&*filterFunction*, ReduceFunctor &&*reduceFunction*, QtConcurrent::ReduceOptions *reduceOptions* = ReduceOptions(UnorderedReduce | SequentialReduce)) | | QFuture<ResultType> | **[filteredReduced](qtconcurrent#filteredReduced-2)**(QThreadPool \**pool*, Sequence &&*sequence*, KeepFunctor &&*filterFunction*, ReduceFunctor &&*reduceFunction*, InitialValueType &&*initialValue*, QtConcurrent::ReduceOptions *reduceOptions* = ReduceOptions(UnorderedReduce | SequentialReduce)) | | QFuture<ResultType> | **[filteredReduced](qtconcurrent#filteredReduced-3)**(Sequence &&*sequence*, KeepFunctor &&*filterFunction*, ReduceFunctor &&*reduceFunction*, InitialValueType &&*initialValue*, QtConcurrent::ReduceOptions *reduceOptions* = ReduceOptions(UnorderedReduce | SequentialReduce)) | | QFuture<ResultType> | **[filteredReduced](qtconcurrent#filteredReduced-4)**(QThreadPool \**pool*, Iterator *begin*, Iterator *end*, KeepFunctor &&*filterFunction*, ReduceFunctor &&*reduceFunction*, QtConcurrent::ReduceOptions *reduceOptions* = ReduceOptions(UnorderedReduce | SequentialReduce)) | | QFuture<ResultType> | **[filteredReduced](qtconcurrent#filteredReduced-5)**(Iterator *begin*, Iterator *end*, KeepFunctor &&*filterFunction*, ReduceFunctor &&*reduceFunction*, QtConcurrent::ReduceOptions *reduceOptions* = ReduceOptions(UnorderedReduce | SequentialReduce)) | | QFuture<ResultType> | **[filteredReduced](qtconcurrent#filteredReduced-6)**(QThreadPool \**pool*, Iterator *begin*, Iterator *end*, KeepFunctor &&*filterFunction*, ReduceFunctor &&*reduceFunction*, InitialValueType &&*initialValue*, QtConcurrent::ReduceOptions *reduceOptions* = ReduceOptions(UnorderedReduce | SequentialReduce)) | | QFuture<ResultType> | **[filteredReduced](qtconcurrent#filteredReduced-7)**(Iterator *begin*, Iterator *end*, KeepFunctor &&*filterFunction*, ReduceFunctor &&*reduceFunction*, InitialValueType &&*initialValue*, QtConcurrent::ReduceOptions *reduceOptions* = ReduceOptions(UnorderedReduce | SequentialReduce)) | | QFuture<void> | **[map](qtconcurrent#map)**(QThreadPool \**pool*, Sequence &&*sequence*, MapFunctor &&*function*) | | QFuture<void> | **[map](qtconcurrent#map-1)**(Sequence &&*sequence*, MapFunctor &&*function*) | | QFuture<void> | **[map](qtconcurrent#map-2)**(QThreadPool \**pool*, Iterator *begin*, Iterator *end*, MapFunctor &&*function*) | | QFuture<void> | **[map](qtconcurrent#map-3)**(Iterator *begin*, Iterator *end*, MapFunctor &&*function*) | | QFuture<QtPrivate::MapResultType<Sequence, MapFunctor> > | **[mapped](qtconcurrent#mapped)**(QThreadPool \**pool*, Sequence &&*sequence*, MapFunctor &&*function*) | | QFuture<QtPrivate::MapResultType<Sequence, MapFunctor> > | **[mapped](qtconcurrent#mapped-1)**(Sequence &&*sequence*, MapFunctor &&*function*) | | QFuture<QtPrivate::MapResultType<Iterator, MapFunctor> > | **[mapped](qtconcurrent#mapped-2)**(QThreadPool \**pool*, Iterator *begin*, Iterator *end*, MapFunctor &&*function*) | | QFuture<QtPrivate::MapResultType<Iterator, MapFunctor> > | **[mapped](qtconcurrent#mapped-3)**(Iterator *begin*, Iterator *end*, MapFunctor &&*function*) | | QFuture<ResultType> | **[mappedReduced](qtconcurrent#mappedReduced)**(QThreadPool \**pool*, Sequence &&*sequence*, MapFunctor &&*mapFunction*, ReduceFunctor &&*reduceFunction*, QtConcurrent::ReduceOptions *reduceOptions* = ReduceOptions(UnorderedReduce | SequentialReduce)) | | QFuture<ResultType> | **[mappedReduced](qtconcurrent#mappedReduced-1)**(Sequence &&*sequence*, MapFunctor &&*mapFunction*, ReduceFunctor &&*reduceFunction*, QtConcurrent::ReduceOptions *reduceOptions* = ReduceOptions(UnorderedReduce | SequentialReduce)) | | QFuture<ResultType> | **[mappedReduced](qtconcurrent#mappedReduced-2)**(QThreadPool \**pool*, Sequence &&*sequence*, MapFunctor &&*mapFunction*, ReduceFunctor &&*reduceFunction*, InitialValueType &&*initialValue*, QtConcurrent::ReduceOptions *reduceOptions* = ReduceOptions(UnorderedReduce | SequentialReduce)) | | QFuture<ResultType> | **[mappedReduced](qtconcurrent#mappedReduced-3)**(Sequence &&*sequence*, MapFunctor &&*mapFunction*, ReduceFunctor &&*reduceFunction*, InitialValueType &&*initialValue*, QtConcurrent::ReduceOptions *reduceOptions* = ReduceOptions(UnorderedReduce | SequentialReduce)) | | QFuture<ResultType> | **[mappedReduced](qtconcurrent#mappedReduced-4)**(QThreadPool \**pool*, Iterator *begin*, Iterator *end*, MapFunctor &&*mapFunction*, ReduceFunctor &&*reduceFunction*, QtConcurrent::ReduceOptions *reduceOptions* = ReduceOptions(UnorderedReduce | SequentialReduce)) | | QFuture<ResultType> | **[mappedReduced](qtconcurrent#mappedReduced-5)**(Iterator *begin*, Iterator *end*, MapFunctor &&*mapFunction*, ReduceFunctor &&*reduceFunction*, QtConcurrent::ReduceOptions *reduceOptions* = ReduceOptions(UnorderedReduce | SequentialReduce)) | | QFuture<ResultType> | **[mappedReduced](qtconcurrent#mappedReduced-6)**(QThreadPool \**pool*, Iterator *begin*, Iterator *end*, MapFunctor &&*mapFunction*, ReduceFunctor &&*reduceFunction*, InitialValueType &&*initialValue*, QtConcurrent::ReduceOptions *reduceOptions* = ReduceOptions(UnorderedReduce | SequentialReduce)) | | QFuture<ResultType> | **[mappedReduced](qtconcurrent#mappedReduced-7)**(Iterator *begin*, Iterator *end*, MapFunctor &&*mapFunction*, ReduceFunctor &&*reduceFunction*, InitialValueType &&*initialValue*, QtConcurrent::ReduceOptions *reduceOptions* = ReduceOptions(UnorderedReduce | SequentialReduce)) | | QFuture<T> | **[run](qtconcurrent#run)**(Function *function*, ...) | | QFuture<T> | **[run](qtconcurrent#run-1)**(QThreadPool \**pool*, Function *function*, ...) | | QTaskBuilder<Task> | **[task](qtconcurrent#task)**(Task &&*task*) | Detailed Description -------------------- See the [Qt Concurrent](qtconcurrent-index) module documentation for an overview of available functions, or see below for detailed information on each function. Classes ------- ### class [QTaskBuilder](qtconcurrent-qtaskbuilder) The QTaskBuilder class is used for adjusting task parameters. [More...](qtconcurrent-qtaskbuilder#details) Type Documentation ------------------ ### enum class QtConcurrent::FutureResult This enum type is used to invoke a special overload of [QtConcurrent::QTaskBuilder::spawn](qtconcurrent-qtaskbuilder#spawn)(QtConcurrent::FutureResult) that doesn't return a future object. | Constant | Value | Description | | --- | --- | --- | | `QtConcurrent::FutureResult::Ignore` | `0` | An auxiliary tag which introduced to improve code readability. | ### `[alias]` InvokeResultType The simplified definition of this type looks like this: ``` template <class Task, class ...Args> using InvokeResultType = std::invoke_result_t<std::decay_t<Task>, std::decay_t<Args>...>; ``` The real implementation also contains a compile-time check for whether the task can be invoked with the specified arguments or not. ### enum QtConcurrent::ReduceOptionflags QtConcurrent::ReduceOptions This enum specifies the order of which results from the map or filter function are passed to the reduce function. | Constant | Value | Description | | --- | --- | --- | | `QtConcurrent::UnorderedReduce` | `0x1` | Reduction is done in an arbitrary order. | | `QtConcurrent::OrderedReduce` | `0x2` | Reduction is done in the order of the original sequence. | | `QtConcurrent::SequentialReduce` | `0x4` | Reduction is done sequentially: only one thread will enter the reduce function at a time. (Parallel reduction might be supported in a future version of Qt Concurrent.) | The ReduceOptions type is a typedef for [QFlags](qflags)<ReduceOption>. It stores an OR combination of ReduceOption values. Function Documentation ---------------------- ### template <typename Sequence, typename KeepFunctor> void QtConcurrent::blockingFilter([QThreadPool](qthreadpool) \**pool*, Sequence &*sequence*, KeepFunctor &&*filterFunction*) Calls *filterFunction* once for each item in *sequence*. All calls to *filterFunction* are invoked from the threads taken from the [QThreadPool](qthreadpool) *pool*. If *filterFunction* returns `true`, the item is kept in *sequence*; otherwise, the item is removed from *sequence*. Note that this method doesn't have an overload working with iterators, because it invalidates the iterators of the sequence it operates on. **Note:** This function will block until all items in the sequence have been processed. **See also** [Concurrent Filter and Filter-Reduce](qtconcurrentfilter). ### template <typename Sequence, typename KeepFunctor> void QtConcurrent::blockingFilter(Sequence &*sequence*, KeepFunctor &&*filterFunction*) Calls *filterFunction* once for each item in *sequence*. If *filterFunction* returns `true`, the item is kept in *sequence*; otherwise, the item is removed from *sequence*. Note that this method doesn't have an overload working with iterators, because it invalidates the iterators of the sequence it operates on. **Note:** This function will block until all items in the sequence have been processed. **See also** [Concurrent Filter and Filter-Reduce](qtconcurrentfilter). ### template <typename Sequence, typename KeepFunctor> std::decay\_t<Sequence> QtConcurrent::blockingFiltered([QThreadPool](qthreadpool) \**pool*, Sequence &&*sequence*, KeepFunctor &&*filterFunction*) Calls *filterFunction* once for each item in *sequence* and returns a new Sequence of kept items. All calls to *filterFunction* are invoked from the threads taken from the [QThreadPool](qthreadpool) *pool*. If *filterFunction* returns `true`, a copy of the item is put in the new Sequence. Otherwise, the item will *not* appear in the new Sequence. **Note:** This function will block until all items in the sequence have been processed. **See also** [filtered](qtconcurrent#filtered)() and [Concurrent Filter and Filter-Reduce](qtconcurrentfilter). ### template <typename Sequence, typename KeepFunctor> std::decay\_t<Sequence> QtConcurrent::blockingFiltered(Sequence &&*sequence*, KeepFunctor &&*filterFunction*) Calls *filterFunction* once for each item in *sequence* and returns a new Sequence of kept items. If *filterFunction* returns `true`, a copy of the item is put in the new Sequence. Otherwise, the item will *not* appear in the new Sequence. **Note:** This function will block until all items in the sequence have been processed. **See also** [filtered](qtconcurrent#filtered)() and [Concurrent Filter and Filter-Reduce](qtconcurrentfilter). ### template <typename OutputSequence, typename Iterator, typename KeepFunctor> OutputSequence QtConcurrent::blockingFiltered([QThreadPool](qthreadpool) \**pool*, Iterator *begin*, Iterator *end*, KeepFunctor &&*filterFunction*) Calls *filterFunction* once for each item from *begin* to *end* and returns a new Sequence of kept items. All calls to *filterFunction* are invoked from the threads taken from the [QThreadPool](qthreadpool) *pool*. If *filterFunction* returns `true`, a copy of the item is put in the new Sequence. Otherwise, the item will *not* appear in the new Sequence. **Note:** This function will block until the iterator reaches the end of the sequence being processed. **See also** [filtered](qtconcurrent#filtered)() and [Concurrent Filter and Filter-Reduce](qtconcurrentfilter). ### template <typename OutputSequence, typename Iterator, typename KeepFunctor> OutputSequence QtConcurrent::blockingFiltered(Iterator *begin*, Iterator *end*, KeepFunctor &&*filterFunction*) Calls *filterFunction* once for each item from *begin* to *end* and returns a new Sequence of kept items. If *filterFunction* returns `true`, a copy of the item is put in the new Sequence. Otherwise, the item will *not* appear in the new Sequence. **Note:** This function will block until the iterator reaches the end of the sequence being processed. **See also** [filtered](qtconcurrent#filtered)() and [Concurrent Filter and Filter-Reduce](qtconcurrentfilter). ### template <typename ResultType, typename Sequence, typename KeepFunctor, typename ReduceFunctor> ResultType QtConcurrent::blockingFilteredReduced([QThreadPool](qthreadpool) \**pool*, Sequence &&*sequence*, KeepFunctor &&*filterFunction*, ReduceFunctor &&*reduceFunction*, [QtConcurrent::ReduceOptions](qtconcurrent#ReduceOption-enum) *reduceOptions* = ReduceOptions(UnorderedReduce | SequentialReduce)) Calls *filterFunction* once for each item in *sequence*. All calls to *filterFunction* are invoked from the threads taken from the [QThreadPool](qthreadpool) *pool*. If *filterFunction* returns `true` for an item, that item is then passed to *reduceFunction*. In other words, the return value is the result of *reduceFunction* for each item where *filterFunction* returns `true`. Note that while *filterFunction* is called concurrently, only one thread at a time will call *reduceFunction*. The order in which *reduceFunction* is called is undefined if *reduceOptions* is [QtConcurrent::UnorderedReduce](qtconcurrent#ReduceOption-enum). If *reduceOptions* is [QtConcurrent::OrderedReduce](qtconcurrent#ReduceOption-enum), *reduceFunction* is called in the order of the original sequence. **Note:** This function will block until all items in the sequence have been processed. **See also** [filteredReduced](qtconcurrent#filteredReduced)() and [Concurrent Filter and Filter-Reduce](qtconcurrentfilter). ### template <typename ResultType, typename Sequence, typename KeepFunctor, typename ReduceFunctor> ResultType QtConcurrent::blockingFilteredReduced(Sequence &&*sequence*, KeepFunctor &&*filterFunction*, ReduceFunctor &&*reduceFunction*, [QtConcurrent::ReduceOptions](qtconcurrent#ReduceOption-enum) *reduceOptions* = ReduceOptions(UnorderedReduce | SequentialReduce)) Calls *filterFunction* once for each item in *sequence*. If *filterFunction* returns `true` for an item, that item is then passed to *reduceFunction*. In other words, the return value is the result of *reduceFunction* for each item where *filterFunction* returns `true`. Note that while *filterFunction* is called concurrently, only one thread at a time will call *reduceFunction*. The order in which *reduceFunction* is called is undefined if *reduceOptions* is [QtConcurrent::UnorderedReduce](qtconcurrent#ReduceOption-enum). If *reduceOptions* is [QtConcurrent::OrderedReduce](qtconcurrent#ReduceOption-enum), *reduceFunction* is called in the order of the original sequence. **Note:** This function will block until all items in the sequence have been processed. **See also** [filteredReduced](qtconcurrent#filteredReduced)() and [Concurrent Filter and Filter-Reduce](qtconcurrentfilter). ### template <typename ResultType, typename Sequence, typename KeepFunctor, typename ReduceFunctor, typename InitialValueType> ResultType QtConcurrent::blockingFilteredReduced([QThreadPool](qthreadpool) \**pool*, Sequence &&*sequence*, KeepFunctor &&*filterFunction*, ReduceFunctor &&*reduceFunction*, InitialValueType &&*initialValue*, [QtConcurrent::ReduceOptions](qtconcurrent#ReduceOption-enum) *reduceOptions* = ReduceOptions(UnorderedReduce | SequentialReduce)) Calls *filterFunction* once for each item in *sequence*. All calls to *filterFunction* are invoked from the threads taken from the [QThreadPool](qthreadpool) *pool*. If *filterFunction* returns `true` for an item, that item is then passed to *reduceFunction*. In other words, the return value is the result of *reduceFunction* for each item where *filterFunction* returns `true`. The result value is initialized to *initialValue* when the function is called, and the first call to *reduceFunction* will operate on this value. Note that while *filterFunction* is called concurrently, only one thread at a time will call *reduceFunction*. The order in which *reduceFunction* is called is undefined if *reduceOptions* is [QtConcurrent::UnorderedReduce](qtconcurrent#ReduceOption-enum). If *reduceOptions* is [QtConcurrent::OrderedReduce](qtconcurrent#ReduceOption-enum), *reduceFunction* is called in the order of the original sequence. **Note:** This function will block until all items in the sequence have been processed. **See also** [filteredReduced](qtconcurrent#filteredReduced)() and [Concurrent Filter and Filter-Reduce](qtconcurrentfilter). ### template <typename ResultType, typename Sequence, typename KeepFunctor, typename ReduceFunctor, typename InitialValueType> ResultType QtConcurrent::blockingFilteredReduced(Sequence &&*sequence*, KeepFunctor &&*filterFunction*, ReduceFunctor &&*reduceFunction*, InitialValueType &&*initialValue*, [QtConcurrent::ReduceOptions](qtconcurrent#ReduceOption-enum) *reduceOptions* = ReduceOptions(UnorderedReduce | SequentialReduce)) Calls *filterFunction* once for each item in *sequence*. If *filterFunction* returns `true` for an item, that item is then passed to *reduceFunction*. In other words, the return value is the result of *reduceFunction* for each item where *filterFunction* returns `true`. The result value is initialized to *initialValue* when the function is called, and the first call to *reduceFunction* will operate on this value. Note that while *filterFunction* is called concurrently, only one thread at a time will call *reduceFunction*. The order in which *reduceFunction* is called is undefined if *reduceOptions* is [QtConcurrent::UnorderedReduce](qtconcurrent#ReduceOption-enum). If *reduceOptions* is [QtConcurrent::OrderedReduce](qtconcurrent#ReduceOption-enum), *reduceFunction* is called in the order of the original sequence. **Note:** This function will block until all items in the sequence have been processed. **See also** [filteredReduced](qtconcurrent#filteredReduced)() and [Concurrent Filter and Filter-Reduce](qtconcurrentfilter). ### template <typename ResultType, typename Iterator, typename KeepFunctor, typename ReduceFunctor> ResultType QtConcurrent::blockingFilteredReduced([QThreadPool](qthreadpool) \**pool*, Iterator *begin*, Iterator *end*, KeepFunctor &&*filterFunction*, ReduceFunctor &&*reduceFunction*, [QtConcurrent::ReduceOptions](qtconcurrent#ReduceOption-enum) *reduceOptions* = ReduceOptions(UnorderedReduce | SequentialReduce)) Calls *filterFunction* once for each item from *begin* to *end*. All calls to *filterFunction* are invoked from the threads taken from the [QThreadPool](qthreadpool) *pool*. If *filterFunction* returns `true` for an item, that item is then passed to *reduceFunction*. In other words, the return value is the result of *reduceFunction* for each item where *filterFunction* returns `true`. Note that while *filterFunction* is called concurrently, only one thread at a time will call *reduceFunction*. The order in which *reduceFunction* is called is undefined if *reduceOptions* is [QtConcurrent::UnorderedReduce](qtconcurrent#ReduceOption-enum). If *reduceOptions* is [QtConcurrent::OrderedReduce](qtconcurrent#ReduceOption-enum), the *reduceFunction* is called in the order of the original sequence. **Note:** This function will block until the iterator reaches the end of the sequence being processed. **See also** [filteredReduced](qtconcurrent#filteredReduced)() and [Concurrent Filter and Filter-Reduce](qtconcurrentfilter). ### template <typename ResultType, typename Iterator, typename KeepFunctor, typename ReduceFunctor> ResultType QtConcurrent::blockingFilteredReduced(Iterator *begin*, Iterator *end*, KeepFunctor &&*filterFunction*, ReduceFunctor &&*reduceFunction*, [QtConcurrent::ReduceOptions](qtconcurrent#ReduceOption-enum) *reduceOptions* = ReduceOptions(UnorderedReduce | SequentialReduce)) Calls *filterFunction* once for each item from *begin* to *end*. If *filterFunction* returns `true` for an item, that item is then passed to *reduceFunction*. In other words, the return value is the result of *reduceFunction* for each item where *filterFunction* returns `true`. Note that while *filterFunction* is called concurrently, only one thread at a time will call *reduceFunction*. The order in which *reduceFunction* is called is undefined if *reduceOptions* is [QtConcurrent::UnorderedReduce](qtconcurrent#ReduceOption-enum). If *reduceOptions* is [QtConcurrent::OrderedReduce](qtconcurrent#ReduceOption-enum), the *reduceFunction* is called in the order of the original sequence. **Note:** This function will block until the iterator reaches the end of the sequence being processed. **See also** [filteredReduced](qtconcurrent#filteredReduced)() and [Concurrent Filter and Filter-Reduce](qtconcurrentfilter). ### template <typename ResultType, typename Iterator, typename KeepFunctor, typename ReduceFunctor, typename InitialValueType> ResultType QtConcurrent::blockingFilteredReduced([QThreadPool](qthreadpool) \**pool*, Iterator *begin*, Iterator *end*, KeepFunctor &&*filterFunction*, ReduceFunctor &&*reduceFunction*, InitialValueType &&*initialValue*, [QtConcurrent::ReduceOptions](qtconcurrent#ReduceOption-enum) *reduceOptions* = ReduceOptions(UnorderedReduce | SequentialReduce)) Calls *filterFunction* once for each item from *begin* to *end*. All calls to *filterFunction* are invoked from the threads taken from the [QThreadPool](qthreadpool) *pool*. If *filterFunction* returns `true` for an item, that item is then passed to *reduceFunction*. In other words, the return value is the result of *reduceFunction* for each item where *filterFunction* returns `true`. The result value is initialized to *initialValue* when the function is called, and the first call to *reduceFunction* will operate on this value. Note that while *filterFunction* is called concurrently, only one thread at a time will call *reduceFunction*. The order in which *reduceFunction* is called is undefined if *reduceOptions* is [QtConcurrent::UnorderedReduce](qtconcurrent#ReduceOption-enum). If *reduceOptions* is [QtConcurrent::OrderedReduce](qtconcurrent#ReduceOption-enum), the *reduceFunction* is called in the order of the original sequence. **Note:** This function will block until the iterator reaches the end of the sequence being processed. **See also** [filteredReduced](qtconcurrent#filteredReduced)() and [Concurrent Filter and Filter-Reduce](qtconcurrentfilter). ### template <typename ResultType, typename Iterator, typename KeepFunctor, typename ReduceFunctor, typename InitialValueType> ResultType QtConcurrent::blockingFilteredReduced(Iterator *begin*, Iterator *end*, KeepFunctor &&*filterFunction*, ReduceFunctor &&*reduceFunction*, InitialValueType &&*initialValue*, [QtConcurrent::ReduceOptions](qtconcurrent#ReduceOption-enum) *reduceOptions* = ReduceOptions(UnorderedReduce | SequentialReduce)) Calls *filterFunction* once for each item from *begin* to *end*. If *filterFunction* returns `true` for an item, that item is then passed to *reduceFunction*. In other words, the return value is the result of *reduceFunction* for each item where *filterFunction* returns `true`. The result value is initialized to *initialValue* when the function is called, and the first call to *reduceFunction* will operate on this value. Note that while *filterFunction* is called concurrently, only one thread at a time will call *reduceFunction*. The order in which *reduceFunction* is called is undefined if *reduceOptions* is [QtConcurrent::UnorderedReduce](qtconcurrent#ReduceOption-enum). If *reduceOptions* is [QtConcurrent::OrderedReduce](qtconcurrent#ReduceOption-enum), the *reduceFunction* is called in the order of the original sequence. **Note:** This function will block until the iterator reaches the end of the sequence being processed. **See also** [filteredReduced](qtconcurrent#filteredReduced)() and [Concurrent Filter and Filter-Reduce](qtconcurrentfilter). ### template <typename Sequence, typename MapFunctor> void QtConcurrent::blockingMap([QThreadPool](qthreadpool) \**pool*, Sequence &&*sequence*, MapFunctor *function*) Calls *function* once for each item in *sequence*. All calls to *function* are invoked from the threads taken from the [QThreadPool](qthreadpool) *pool*. The *function* takes a reference to the item, so that any modifications done to the item will appear in *sequence*. **Note:** This function will block until all items in the sequence have been processed. **See also** [map](qtconcurrent#map)() and [Concurrent Map and Map-Reduce](qtconcurrentmap). ### template <typename Sequence, typename MapFunctor> void QtConcurrent::blockingMap(Sequence &&*sequence*, MapFunctor &&*function*) Calls *function* once for each item in *sequence*. The *function* takes a reference to the item, so that any modifications done to the item will appear in *sequence*. **Note:** This function will block until all items in the sequence have been processed. **See also** [map](qtconcurrent#map)() and [Concurrent Map and Map-Reduce](qtconcurrentmap). ### template <typename Iterator, typename MapFunctor> void QtConcurrent::blockingMap([QThreadPool](qthreadpool) \**pool*, Iterator *begin*, Iterator *end*, MapFunctor &&*function*) Calls *function* once for each item from *begin* to *end*. All calls to *function* are invoked from the threads taken from the [QThreadPool](qthreadpool) *pool*. The *function* takes a reference to the item, so that any modifications done to the item will appear in the sequence which the iterators belong to. **Note:** This function will block until the iterator reaches the end of the sequence being processed. **See also** [map](qtconcurrent#map)() and [Concurrent Map and Map-Reduce](qtconcurrentmap). ### template <typename Iterator, typename MapFunctor> void QtConcurrent::blockingMap(Iterator *begin*, Iterator *end*, MapFunctor &&*function*) Calls *function* once for each item from *begin* to *end*. The *function* takes a reference to the item, so that any modifications done to the item will appear in the sequence which the iterators belong to. **Note:** This function will block until the iterator reaches the end of the sequence being processed. **See also** [map](qtconcurrent#map)() and [Concurrent Map and Map-Reduce](qtconcurrentmap). ### template <typename OutputSequence, typename InputSequence, typename MapFunctor> OutputSequence QtConcurrent::blockingMapped([QThreadPool](qthreadpool) \**pool*, InputSequence &&*sequence*, MapFunctor &&*function*) Calls *function* once for each item in *sequence* and returns an OutputSequence containing the results. All calls to *function* are invoked from the threads taken from the [QThreadPool](qthreadpool) *pool*. The type of the results will match the type returned by the MapFunctor. **Note:** This function will block until all items in the sequence have been processed. **See also** [mapped](qtconcurrent#mapped)() and [Concurrent Map and Map-Reduce](qtconcurrentmap). ### template <typename OutputSequence, typename InputSequence, typename MapFunctor> OutputSequence QtConcurrent::blockingMapped(InputSequence &&*sequence*, MapFunctor &&*function*) Calls *function* once for each item in *sequence* and returns an OutputSequence containing the results. The type of the results will match the type returned by the MapFunctor. **Note:** This function will block until all items in the sequence have been processed. **See also** [mapped](qtconcurrent#mapped)() and [Concurrent Map and Map-Reduce](qtconcurrentmap). ### template <typename Sequence, typename Iterator, typename MapFunctor> Sequence QtConcurrent::blockingMapped([QThreadPool](qthreadpool) \**pool*, Iterator *begin*, Iterator *end*, MapFunctor &&*function*) Calls *function* once for each item from *begin* to *end* and returns a container with the results. All calls to *function* are invoked from the threads taken from the [QThreadPool](qthreadpool) *pool*. You can specify the type of container as the a template argument, like this: ``` QList<int> ints = QtConcurrent::blockingMapped<QList<int> >(beginIterator, endIterator, fn); ``` **Note:** This function will block until the iterator reaches the end of the sequence being processed. **See also** [mapped](qtconcurrent#mapped)() and [Concurrent Map and Map-Reduce](qtconcurrentmap). ### template <typename Sequence, typename Iterator, typename MapFunctor> Sequence QtConcurrent::blockingMapped(Iterator *begin*, Iterator *end*, MapFunctor &&*function*) Calls *function* once for each item from *begin* to *end* and returns a container with the results. You can specify the type of container as the a template argument, like this: ``` QList<int> ints = QtConcurrent::blockingMapped<QList<int> >(beginIterator, endIterator, fn); ``` **Note:** This function will block until the iterator reaches the end of the sequence being processed. **See also** [mapped](qtconcurrent#mapped)() and [Concurrent Map and Map-Reduce](qtconcurrentmap). ### template <typename ResultType, typename Sequence, typename MapFunctor, typename ReduceFunctor> ResultType QtConcurrent::blockingMappedReduced([QThreadPool](qthreadpool) \**pool*, Sequence &&*sequence*, MapFunctor &&*mapFunction*, ReduceFunctor &&*reduceFunction*, [QtConcurrent::ReduceOptions](qtconcurrent#ReduceOption-enum) *reduceOptions* = ReduceOptions(UnorderedReduce | SequentialReduce)) Calls *mapFunction* once for each item in *sequence*. All calls to *mapFunction* are invoked from the threads taken from the [QThreadPool](qthreadpool) *pool*. The return value of each *mapFunction* is passed to *reduceFunction*. Note that while *mapFunction* is called concurrently, only one thread at a time will call *reduceFunction*. The order in which *reduceFunction* is called is determined by *reduceOptions*. **Note:** This function will block until all items in the sequence have been processed. **See also** [mapped](qtconcurrent#mapped)() and [Concurrent Map and Map-Reduce](qtconcurrentmap). ### template <typename ResultType, typename Sequence, typename MapFunctor, typename ReduceFunctor> ResultType QtConcurrent::blockingMappedReduced(Sequence &&*sequence*, MapFunctor &&*mapFunction*, ReduceFunctor &&*reduceFunction*, [QtConcurrent::ReduceOptions](qtconcurrent#ReduceOption-enum) *reduceOptions* = ReduceOptions(UnorderedReduce | SequentialReduce)) Calls *mapFunction* once for each item in *sequence*. The return value of each *mapFunction* is passed to *reduceFunction*. Note that while *mapFunction* is called concurrently, only one thread at a time will call *reduceFunction*. The order in which *reduceFunction* is called is determined by *reduceOptions*. **Note:** This function will block until all items in the sequence have been processed. **See also** [mapped](qtconcurrent#mapped)() and [Concurrent Map and Map-Reduce](qtconcurrentmap). ### template <typename ResultType, typename Sequence, typename MapFunctor, typename ReduceFunctor, typename InitialValueType> ResultType QtConcurrent::blockingMappedReduced([QThreadPool](qthreadpool) \**pool*, Sequence &&*sequence*, MapFunctor &&*mapFunction*, ReduceFunctor &&*reduceFunction*, InitialValueType &&*initialValue*, [QtConcurrent::ReduceOptions](qtconcurrent#ReduceOption-enum) *reduceOptions* = ReduceOptions(UnorderedReduce | SequentialReduce)) Calls *mapFunction* once for each item in *sequence*. All calls to *mapFunction* are invoked from the threads taken from the [QThreadPool](qthreadpool) *pool*. The return value of each *mapFunction* is passed to *reduceFunction*. The result value is initialized to *initialValue* when the function is called, and the first call to *reduceFunction* will operate on this value. Note that while *mapFunction* is called concurrently, only one thread at a time will call *reduceFunction*. The order in which *reduceFunction* is called is determined by *reduceOptions*. **Note:** This function will block until all items in the sequence have been processed. **See also** [mapped](qtconcurrent#mapped)() and [Concurrent Map and Map-Reduce](qtconcurrentmap). ### template <typename ResultType, typename Sequence, typename MapFunctor, typename ReduceFunctor, typename InitialValueType> ResultType QtConcurrent::blockingMappedReduced(Sequence &&*sequence*, MapFunctor &&*mapFunction*, ReduceFunctor &&*reduceFunction*, InitialValueType &&*initialValue*, [QtConcurrent::ReduceOptions](qtconcurrent#ReduceOption-enum) *reduceOptions* = ReduceOptions(UnorderedReduce | SequentialReduce)) Calls *mapFunction* once for each item in *sequence*. The return value of each *mapFunction* is passed to *reduceFunction*. The result value is initialized to *initialValue* when the function is called, and the first call to *reduceFunction* will operate on this value. Note that while *mapFunction* is called concurrently, only one thread at a time will call *reduceFunction*. The order in which *reduceFunction* is called is determined by *reduceOptions*. **Note:** This function will block until all items in the sequence have been processed. **See also** [mapped](qtconcurrent#mapped)() and [Concurrent Map and Map-Reduce](qtconcurrentmap). ### template <typename ResultType, typename Iterator, typename MapFunctor, typename ReduceFunctor> ResultType QtConcurrent::blockingMappedReduced([QThreadPool](qthreadpool) \**pool*, Iterator *begin*, Iterator *end*, MapFunctor &&*mapFunction*, ReduceFunctor &&*reduceFunction*, [QtConcurrent::ReduceOptions](qtconcurrent#ReduceOption-enum) *reduceOptions* = ReduceOptions(UnorderedReduce | SequentialReduce)) Calls *mapFunction* once for each item from *begin* to *end*. All calls to *mapFunction* are invoked from the threads taken from the [QThreadPool](qthreadpool) *pool*. The return value of each *mapFunction* is passed to *reduceFunction*. Note that while *mapFunction* is called concurrently, only one thread at a time will call *reduceFunction*. The order in which *reduceFunction* is called is undefined. **Note:** This function will block until the iterator reaches the end of the sequence being processed. **See also** [blockingMappedReduced](qtconcurrent#blockingMappedReduced)() and [Concurrent Map and Map-Reduce](qtconcurrentmap). ### template <typename ResultType, typename Iterator, typename MapFunctor, typename ReduceFunctor> ResultType QtConcurrent::blockingMappedReduced(Iterator *begin*, Iterator *end*, MapFunctor &&*mapFunction*, ReduceFunctor &&*reduceFunction*, [QtConcurrent::ReduceOptions](qtconcurrent#ReduceOption-enum) *reduceOptions* = ReduceOptions(UnorderedReduce | SequentialReduce)) Calls *mapFunction* once for each item from *begin* to *end*. The return value of each *mapFunction* is passed to *reduceFunction*. Note that while *mapFunction* is called concurrently, only one thread at a time will call *reduceFunction*. The order in which *reduceFunction* is called is undefined. **Note:** This function will block until the iterator reaches the end of the sequence being processed. **See also** [blockingMappedReduced](qtconcurrent#blockingMappedReduced)() and [Concurrent Map and Map-Reduce](qtconcurrentmap). ### template <typename ResultType, typename Iterator, typename MapFunctor, typename ReduceFunctor, typename InitialValueType> ResultType QtConcurrent::blockingMappedReduced([QThreadPool](qthreadpool) \**pool*, Iterator *begin*, Iterator *end*, MapFunctor &&*mapFunction*, ReduceFunctor &&*reduceFunction*, InitialValueType &&*initialValue*, [QtConcurrent::ReduceOptions](qtconcurrent#ReduceOption-enum) *reduceOptions* = ReduceOptions(UnorderedReduce | SequentialReduce)) Calls *mapFunction* once for each item from *begin* to *end*. All calls to *mapFunction* are invoked from the threads taken from the [QThreadPool](qthreadpool) *pool*. The return value of each *mapFunction* is passed to *reduceFunction*. The result value is initialized to *initialValue* when the function is called, and the first call to *reduceFunction* will operate on this value. Note that while *mapFunction* is called concurrently, only one thread at a time will call *reduceFunction*. The order in which *reduceFunction* is called is undefined. **Note:** This function will block until the iterator reaches the end of the sequence being processed. **See also** [blockingMappedReduced](qtconcurrent#blockingMappedReduced)() and [Concurrent Map and Map-Reduce](qtconcurrentmap). ### template <typename ResultType, typename Iterator, typename MapFunctor, typename ReduceFunctor, typename InitialValueType> ResultType QtConcurrent::blockingMappedReduced(Iterator *begin*, Iterator *end*, MapFunctor &&*mapFunction*, ReduceFunctor &&*reduceFunction*, InitialValueType &&*initialValue*, [QtConcurrent::ReduceOptions](qtconcurrent#ReduceOption-enum) *reduceOptions* = ReduceOptions(UnorderedReduce | SequentialReduce)) Calls *mapFunction* once for each item from *begin* to *end*. The return value of each *mapFunction* is passed to *reduceFunction*. The result value is initialized to *initialValue* when the function is called, and the first call to *reduceFunction* will operate on this value. Note that while *mapFunction* is called concurrently, only one thread at a time will call *reduceFunction*. The order in which *reduceFunction* is called is undefined. **Note:** This function will block until the iterator reaches the end of the sequence being processed. **See also** [blockingMappedReduced](qtconcurrent#blockingMappedReduced)() and [Concurrent Map and Map-Reduce](qtconcurrentmap). ### template <typename Sequence, typename KeepFunctor> [QFuture](qfuture)<void> QtConcurrent::filter([QThreadPool](qthreadpool) \**pool*, Sequence &*sequence*, KeepFunctor &&*filterFunction*) Calls *filterFunction* once for each item in *sequence*. All calls to *filterFunction* are invoked from the threads taken from the [QThreadPool](qthreadpool) *pool*. If *filterFunction* returns `true`, the item is kept in *sequence*; otherwise, the item is removed from *sequence*. Note that this method doesn't have an overload working with iterators, because it invalidates the iterators of the sequence it operates on. **See also** [Concurrent Filter and Filter-Reduce](qtconcurrentfilter). ### template <typename Sequence, typename KeepFunctor> [QFuture](qfuture)<void> QtConcurrent::filter(Sequence &*sequence*, KeepFunctor &&*filterFunction*) Calls *filterFunction* once for each item in *sequence*. If *filterFunction* returns `true`, the item is kept in *sequence*; otherwise, the item is removed from *sequence*. Note that this method doesn't have an overload working with iterators, because it invalidates the iterators of the sequence it operates on. **See also** [Concurrent Filter and Filter-Reduce](qtconcurrentfilter). ### template <typename Sequence, typename KeepFunctor> [QFuture](qfuture)<typename std::decay\_t<Sequence>::value\_type> QtConcurrent::filtered([QThreadPool](qthreadpool) \**pool*, Sequence &&*sequence*, KeepFunctor &&*filterFunction*) Calls *filterFunction* once for each item in *sequence* and returns a new Sequence of kept items. All calls to *filterFunction* are invoked from the threads taken from the [QThreadPool](qthreadpool) *pool*. If *filterFunction* returns `true`, a copy of the item is put in the new Sequence. Otherwise, the item will *not* appear in the new Sequence. **See also** [Concurrent Filter and Filter-Reduce](qtconcurrentfilter). ### template <typename Sequence, typename KeepFunctor> [QFuture](qfuture)<typename std::decay\_t<Sequence>::value\_type> QtConcurrent::filtered(Sequence &&*sequence*, KeepFunctor &&*filterFunction*) Calls *filterFunction* once for each item in *sequence* and returns a new Sequence of kept items. If *filterFunction* returns `true`, a copy of the item is put in the new Sequence. Otherwise, the item will *not* appear in the new Sequence. **See also** [Concurrent Filter and Filter-Reduce](qtconcurrentfilter). ### template <typename Iterator, typename KeepFunctor> [QFuture](qfuture)<typename qValueType<Iterator>::value\_type> QtConcurrent::filtered([QThreadPool](qthreadpool) \**pool*, Iterator *begin*, Iterator *end*, KeepFunctor &&*filterFunction*) Calls *filterFunction* once for each item from *begin* to *end* and returns a new Sequence of kept items. All calls to *filterFunction* are invoked from the threads taken from the [QThreadPool](qthreadpool) *pool*. If *filterFunction* returns `true`, a copy of the item is put in the new Sequence. Otherwise, the item will *not* appear in the new Sequence. **See also** [Concurrent Filter and Filter-Reduce](qtconcurrentfilter). ### template <typename Iterator, typename KeepFunctor> [QFuture](qfuture)<typename qValueType<Iterator>::value\_type> QtConcurrent::filtered(Iterator *begin*, Iterator *end*, KeepFunctor &&*filterFunction*) Calls *filterFunction* once for each item from *begin* to *end* and returns a new Sequence of kept items. If *filterFunction* returns `true`, a copy of the item is put in the new Sequence. Otherwise, the item will *not* appear in the new Sequence. **See also** [Concurrent Filter and Filter-Reduce](qtconcurrentfilter). ### template <typename ResultType, typename Sequence, typename KeepFunctor, typename ReduceFunctor> [QFuture](qfuture)<ResultType> QtConcurrent::filteredReduced([QThreadPool](qthreadpool) \**pool*, Sequence &&*sequence*, KeepFunctor &&*filterFunction*, ReduceFunctor &&*reduceFunction*, [QtConcurrent::ReduceOptions](qtconcurrent#ReduceOption-enum) *reduceOptions* = ReduceOptions(UnorderedReduce | SequentialReduce)) Calls *filterFunction* once for each item in *sequence*. All calls to *filterFunction* are invoked from the threads taken from the [QThreadPool](qthreadpool) *pool*. If *filterFunction* returns `true` for an item, that item is then passed to *reduceFunction*. In other words, the return value is the result of *reduceFunction* for each item where *filterFunction* returns `true`. Note that while *filterFunction* is called concurrently, only one thread at a time will call *reduceFunction*. The order in which *reduceFunction* is called is undefined if *reduceOptions* is [QtConcurrent::UnorderedReduce](qtconcurrent#ReduceOption-enum). If *reduceOptions* is [QtConcurrent::OrderedReduce](qtconcurrent#ReduceOption-enum), *reduceFunction* is called in the order of the original sequence. **See also** [Concurrent Filter and Filter-Reduce](qtconcurrentfilter). ### template <typename ResultType, typename Sequence, typename KeepFunctor, typename ReduceFunctor> [QFuture](qfuture)<ResultType> QtConcurrent::filteredReduced(Sequence &&*sequence*, KeepFunctor &&*filterFunction*, ReduceFunctor &&*reduceFunction*, [QtConcurrent::ReduceOptions](qtconcurrent#ReduceOption-enum) *reduceOptions* = ReduceOptions(UnorderedReduce | SequentialReduce)) Calls *filterFunction* once for each item in *sequence*. If *filterFunction* returns `true` for an item, that item is then passed to *reduceFunction*. In other words, the return value is the result of *reduceFunction* for each item where *filterFunction* returns `true`. Note that while *filterFunction* is called concurrently, only one thread at a time will call *reduceFunction*. The order in which *reduceFunction* is called is undefined if *reduceOptions* is [QtConcurrent::UnorderedReduce](qtconcurrent#ReduceOption-enum). If *reduceOptions* is [QtConcurrent::OrderedReduce](qtconcurrent#ReduceOption-enum), *reduceFunction* is called in the order of the original sequence. **See also** [Concurrent Filter and Filter-Reduce](qtconcurrentfilter). ### template <typename ResultType, typename Sequence, typename KeepFunctor, typename ReduceFunctor, typename InitialValueType> [QFuture](qfuture)<ResultType> QtConcurrent::filteredReduced([QThreadPool](qthreadpool) \**pool*, Sequence &&*sequence*, KeepFunctor &&*filterFunction*, ReduceFunctor &&*reduceFunction*, InitialValueType &&*initialValue*, [QtConcurrent::ReduceOptions](qtconcurrent#ReduceOption-enum) *reduceOptions* = ReduceOptions(UnorderedReduce | SequentialReduce)) Calls *filterFunction* once for each item in *sequence*. All calls to *filterFunction* are invoked from the threads taken from the [QThreadPool](qthreadpool) *pool*. If *filterFunction* returns `true` for an item, that item is then passed to *reduceFunction*. In other words, the return value is the result of *reduceFunction* for each item where *filterFunction* returns `true`. The result value is initialized to *initialValue* when the function is called, and the first call to *reduceFunction* will operate on this value. Note that while *filterFunction* is called concurrently, only one thread at a time will call *reduceFunction*. The order in which *reduceFunction* is called is undefined if *reduceOptions* is [QtConcurrent::UnorderedReduce](qtconcurrent#ReduceOption-enum). If *reduceOptions* is [QtConcurrent::OrderedReduce](qtconcurrent#ReduceOption-enum), *reduceFunction* is called in the order of the original sequence. **See also** [Concurrent Filter and Filter-Reduce](qtconcurrentfilter). ### template <typename ResultType, typename Sequence, typename KeepFunctor, typename ReduceFunctor, typename InitialValueType> [QFuture](qfuture)<ResultType> QtConcurrent::filteredReduced(Sequence &&*sequence*, KeepFunctor &&*filterFunction*, ReduceFunctor &&*reduceFunction*, InitialValueType &&*initialValue*, [QtConcurrent::ReduceOptions](qtconcurrent#ReduceOption-enum) *reduceOptions* = ReduceOptions(UnorderedReduce | SequentialReduce)) Calls *filterFunction* once for each item in *sequence*. If *filterFunction* returns `true` for an item, that item is then passed to *reduceFunction*. In other words, the return value is the result of *reduceFunction* for each item where *filterFunction* returns `true`. The result value is initialized to *initialValue* when the function is called, and the first call to *reduceFunction* will operate on this value. Note that while *filterFunction* is called concurrently, only one thread at a time will call *reduceFunction*. The order in which *reduceFunction* is called is undefined if *reduceOptions* is [QtConcurrent::UnorderedReduce](qtconcurrent#ReduceOption-enum). If *reduceOptions* is [QtConcurrent::OrderedReduce](qtconcurrent#ReduceOption-enum), *reduceFunction* is called in the order of the original sequence. **See also** [Concurrent Filter and Filter-Reduce](qtconcurrentfilter). ### template <typename ResultType, typename Iterator, typename KeepFunctor, typename ReduceFunctor> [QFuture](qfuture)<ResultType> QtConcurrent::filteredReduced([QThreadPool](qthreadpool) \**pool*, Iterator *begin*, Iterator *end*, KeepFunctor &&*filterFunction*, ReduceFunctor &&*reduceFunction*, [QtConcurrent::ReduceOptions](qtconcurrent#ReduceOption-enum) *reduceOptions* = ReduceOptions(UnorderedReduce | SequentialReduce)) Calls *filterFunction* once for each item from *begin* to *end*. All calls to *filterFunction* are invoked from the threads taken from the [QThreadPool](qthreadpool) *pool*. If *filterFunction* returns `true` for an item, that item is then passed to *reduceFunction*. In other words, the return value is the result of *reduceFunction* for each item where *filterFunction* returns `true`. Note that while *filterFunction* is called concurrently, only one thread at a time will call *reduceFunction*. The order in which *reduceFunction* is called is undefined if *reduceOptions* is [QtConcurrent::UnorderedReduce](qtconcurrent#ReduceOption-enum). If *reduceOptions* is [QtConcurrent::OrderedReduce](qtconcurrent#ReduceOption-enum), the *reduceFunction* is called in the order of the original sequence. **See also** [Concurrent Filter and Filter-Reduce](qtconcurrentfilter). ### template <typename ResultType, typename Iterator, typename KeepFunctor, typename ReduceFunctor> [QFuture](qfuture)<ResultType> QtConcurrent::filteredReduced(Iterator *begin*, Iterator *end*, KeepFunctor &&*filterFunction*, ReduceFunctor &&*reduceFunction*, [QtConcurrent::ReduceOptions](qtconcurrent#ReduceOption-enum) *reduceOptions* = ReduceOptions(UnorderedReduce | SequentialReduce)) Calls *filterFunction* once for each item from *begin* to *end*. If *filterFunction* returns `true` for an item, that item is then passed to *reduceFunction*. In other words, the return value is the result of *reduceFunction* for each item where *filterFunction* returns `true`. Note that while *filterFunction* is called concurrently, only one thread at a time will call *reduceFunction*. The order in which *reduceFunction* is called is undefined if *reduceOptions* is [QtConcurrent::UnorderedReduce](qtconcurrent#ReduceOption-enum). If *reduceOptions* is [QtConcurrent::OrderedReduce](qtconcurrent#ReduceOption-enum), the *reduceFunction* is called in the order of the original sequence. **See also** [Concurrent Filter and Filter-Reduce](qtconcurrentfilter). ### template <typename ResultType, typename Iterator, typename KeepFunctor, typename ReduceFunctor, typename InitialValueType> [QFuture](qfuture)<ResultType> QtConcurrent::filteredReduced([QThreadPool](qthreadpool) \**pool*, Iterator *begin*, Iterator *end*, KeepFunctor &&*filterFunction*, ReduceFunctor &&*reduceFunction*, InitialValueType &&*initialValue*, [QtConcurrent::ReduceOptions](qtconcurrent#ReduceOption-enum) *reduceOptions* = ReduceOptions(UnorderedReduce | SequentialReduce)) Calls *filterFunction* once for each item from *begin* to *end*. All calls to *filterFunction* are invoked from the threads taken from the [QThreadPool](qthreadpool) *pool*. If *filterFunction* returns `true` for an item, that item is then passed to *reduceFunction*. In other words, the return value is the result of *reduceFunction* for each item where *filterFunction* returns `true`. The result value is initialized to *initialValue* when the function is called, and the first call to *reduceFunction* will operate on this value. Note that while *filterFunction* is called concurrently, only one thread at a time will call *reduceFunction*. The order in which *reduceFunction* is called is undefined if *reduceOptions* is [QtConcurrent::UnorderedReduce](qtconcurrent#ReduceOption-enum). If *reduceOptions* is [QtConcurrent::OrderedReduce](qtconcurrent#ReduceOption-enum), the *reduceFunction* is called in the order of the original sequence. **See also** [Concurrent Filter and Filter-Reduce](qtconcurrentfilter). ### template <typename ResultType, typename Iterator, typename KeepFunctor, typename ReduceFunctor, typename InitialValueType> [QFuture](qfuture)<ResultType> QtConcurrent::filteredReduced(Iterator *begin*, Iterator *end*, KeepFunctor &&*filterFunction*, ReduceFunctor &&*reduceFunction*, InitialValueType &&*initialValue*, [QtConcurrent::ReduceOptions](qtconcurrent#ReduceOption-enum) *reduceOptions* = ReduceOptions(UnorderedReduce | SequentialReduce)) Calls *filterFunction* once for each item from *begin* to *end*. If *filterFunction* returns `true` for an item, that item is then passed to *reduceFunction*. In other words, the return value is the result of *reduceFunction* for each item where *filterFunction* returns `true`. The result value is initialized to *initialValue* when the function is called, and the first call to *reduceFunction* will operate on this value. Note that while *filterFunction* is called concurrently, only one thread at a time will call *reduceFunction*. The order in which *reduceFunction* is called is undefined if *reduceOptions* is [QtConcurrent::UnorderedReduce](qtconcurrent#ReduceOption-enum). If *reduceOptions* is [QtConcurrent::OrderedReduce](qtconcurrent#ReduceOption-enum), the *reduceFunction* is called in the order of the original sequence. **See also** [Concurrent Filter and Filter-Reduce](qtconcurrentfilter). ### template <typename Sequence, typename MapFunctor> [QFuture](qfuture)<void> QtConcurrent::map([QThreadPool](qthreadpool) \**pool*, Sequence &&*sequence*, MapFunctor &&*function*) Calls *function* once for each item in *sequence*. All calls to *function* are invoked from the threads taken from the [QThreadPool](qthreadpool) *pool*. The *function* takes a reference to the item, so that any modifications done to the item will appear in *sequence*. **See also** [Concurrent Map and Map-Reduce](qtconcurrentmap). ### template <typename Sequence, typename MapFunctor> [QFuture](qfuture)<void> QtConcurrent::map(Sequence &&*sequence*, MapFunctor &&*function*) Calls *function* once for each item in *sequence*. The *function* takes a reference to the item, so that any modifications done to the item will appear in *sequence*. **See also** [Concurrent Map and Map-Reduce](qtconcurrentmap). ### template <typename Iterator, typename MapFunctor> [QFuture](qfuture)<void> QtConcurrent::map([QThreadPool](qthreadpool) \**pool*, Iterator *begin*, Iterator *end*, MapFunctor &&*function*) Calls *function* once for each item from *begin* to *end*. All calls to *function* are invoked from the threads taken from the [QThreadPool](qthreadpool) *pool*. The *function* takes a reference to the item, so that any modifications done to the item will appear in the sequence which the iterators belong to. **See also** [Concurrent Map and Map-Reduce](qtconcurrentmap). ### template <typename Iterator, typename MapFunctor> [QFuture](qfuture)<void> QtConcurrent::map(Iterator *begin*, Iterator *end*, MapFunctor &&*function*) Calls *function* once for each item from *begin* to *end*. The *function* takes a reference to the item, so that any modifications done to the item will appear in the sequence which the iterators belong to. **See also** [Concurrent Map and Map-Reduce](qtconcurrentmap). ### template <typename Sequence, typename MapFunctor> [QFuture](qfuture)<QtPrivate::MapResultType<Sequence, MapFunctor> > QtConcurrent::mapped([QThreadPool](qthreadpool) \**pool*, Sequence &&*sequence*, MapFunctor &&*function*) Calls *function* once for each item in *sequence* and returns a future with each mapped item as a result. All calls to *function* are invoked from the threads taken from the [QThreadPool](qthreadpool) *pool*. You can use [QFuture::const\_iterator](qfuture-const-iterator) or [QFutureIterator](qfutureiterator) to iterate through the results. **See also** [Concurrent Map and Map-Reduce](qtconcurrentmap). ### template <typename Sequence, typename MapFunctor> [QFuture](qfuture)<QtPrivate::MapResultType<Sequence, MapFunctor> > QtConcurrent::mapped(Sequence &&*sequence*, MapFunctor &&*function*) Calls *function* once for each item in *sequence* and returns a future with each mapped item as a result. You can use [QFuture::const\_iterator](qfuture-const-iterator) or [QFutureIterator](qfutureiterator) to iterate through the results. **See also** [Concurrent Map and Map-Reduce](qtconcurrentmap). ### template <typename Iterator, typename MapFunctor> [QFuture](qfuture)<QtPrivate::MapResultType<Iterator, MapFunctor> > QtConcurrent::mapped([QThreadPool](qthreadpool) \**pool*, Iterator *begin*, Iterator *end*, MapFunctor &&*function*) Calls *function* once for each item from *begin* to *end* and returns a future with each mapped item as a result. All calls to *function* are invoked from the threads taken from the [QThreadPool](qthreadpool) *pool*. You can use [QFuture::const\_iterator](qfuture-const-iterator) or [QFutureIterator](qfutureiterator) to iterate through the results. **See also** [Concurrent Map and Map-Reduce](qtconcurrentmap). ### template <typename Iterator, typename MapFunctor> [QFuture](qfuture)<QtPrivate::MapResultType<Iterator, MapFunctor> > QtConcurrent::mapped(Iterator *begin*, Iterator *end*, MapFunctor &&*function*) Calls *function* once for each item from *begin* to *end* and returns a future with each mapped item as a result. You can use [QFuture::const\_iterator](qfuture-const-iterator) or [QFutureIterator](qfutureiterator) to iterate through the results. **See also** [Concurrent Map and Map-Reduce](qtconcurrentmap). ### template <typename ResultType, typename Sequence, typename MapFunctor, typename ReduceFunctor> [QFuture](qfuture)<ResultType> QtConcurrent::mappedReduced([QThreadPool](qthreadpool) \**pool*, Sequence &&*sequence*, MapFunctor &&*mapFunction*, ReduceFunctor &&*reduceFunction*, [QtConcurrent::ReduceOptions](qtconcurrent#ReduceOption-enum) *reduceOptions* = ReduceOptions(UnorderedReduce | SequentialReduce)) Calls *mapFunction* once for each item in *sequence*. All calls to *mapFunction* are invoked from the threads taken from the [QThreadPool](qthreadpool) *pool*. The return value of each *mapFunction* is passed to *reduceFunction*. Note that while *mapFunction* is called concurrently, only one thread at a time will call *reduceFunction*. The order in which *reduceFunction* is called is determined by *reduceOptions*. **See also** [Concurrent Map and Map-Reduce](qtconcurrentmap). ### template <typename ResultType, typename Sequence, typename MapFunctor, typename ReduceFunctor> [QFuture](qfuture)<ResultType> QtConcurrent::mappedReduced(Sequence &&*sequence*, MapFunctor &&*mapFunction*, ReduceFunctor &&*reduceFunction*, [QtConcurrent::ReduceOptions](qtconcurrent#ReduceOption-enum) *reduceOptions* = ReduceOptions(UnorderedReduce | SequentialReduce)) Calls *mapFunction* once for each item in *sequence*. The return value of each *mapFunction* is passed to *reduceFunction*. Note that while *mapFunction* is called concurrently, only one thread at a time will call *reduceFunction*. The order in which *reduceFunction* is called is determined by *reduceOptions*. **See also** [Concurrent Map and Map-Reduce](qtconcurrentmap). ### template <typename ResultType, typename Sequence, typename MapFunctor, typename ReduceFunctor, typename InitialValueType> [QFuture](qfuture)<ResultType> QtConcurrent::mappedReduced([QThreadPool](qthreadpool) \**pool*, Sequence &&*sequence*, MapFunctor &&*mapFunction*, ReduceFunctor &&*reduceFunction*, InitialValueType &&*initialValue*, [QtConcurrent::ReduceOptions](qtconcurrent#ReduceOption-enum) *reduceOptions* = ReduceOptions(UnorderedReduce | SequentialReduce)) Calls *mapFunction* once for each item in *sequence*. All calls to *mapFunction* are invoked from the threads taken from the [QThreadPool](qthreadpool) *pool*. The return value of each *mapFunction* is passed to *reduceFunction*. The result value is initialized to *initialValue* when the function is called, and the first call to *reduceFunction* will operate on this value. Note that while *mapFunction* is called concurrently, only one thread at a time will call *reduceFunction*. The order in which *reduceFunction* is called is determined by *reduceOptions*. **See also** [Concurrent Map and Map-Reduce](qtconcurrentmap). ### template <typename ResultType, typename Sequence, typename MapFunctor, typename ReduceFunctor, typename InitialValueType> [QFuture](qfuture)<ResultType> QtConcurrent::mappedReduced(Sequence &&*sequence*, MapFunctor &&*mapFunction*, ReduceFunctor &&*reduceFunction*, InitialValueType &&*initialValue*, [QtConcurrent::ReduceOptions](qtconcurrent#ReduceOption-enum) *reduceOptions* = ReduceOptions(UnorderedReduce | SequentialReduce)) Calls *mapFunction* once for each item in *sequence*. The return value of each *mapFunction* is passed to *reduceFunction*. The result value is initialized to *initialValue* when the function is called, and the first call to *reduceFunction* will operate on this value. Note that while *mapFunction* is called concurrently, only one thread at a time will call *reduceFunction*. The order in which *reduceFunction* is called is determined by *reduceOptions*. **See also** [Concurrent Map and Map-Reduce](qtconcurrentmap). ### template <typename ResultType, typename Iterator, typename MapFunctor, typename ReduceFunctor> [QFuture](qfuture)<ResultType> QtConcurrent::mappedReduced([QThreadPool](qthreadpool) \**pool*, Iterator *begin*, Iterator *end*, MapFunctor &&*mapFunction*, ReduceFunctor &&*reduceFunction*, [QtConcurrent::ReduceOptions](qtconcurrent#ReduceOption-enum) *reduceOptions* = ReduceOptions(UnorderedReduce | SequentialReduce)) Calls *mapFunction* once for each item from *begin* to *end*. All calls to *mapFunction* are invoked from the threads taken from the [QThreadPool](qthreadpool) *pool*. The return value of each *mapFunction* is passed to *reduceFunction*. Note that while *mapFunction* is called concurrently, only one thread at a time will call *reduceFunction*. By default, the order in which *reduceFunction* is called is undefined. **Note:** [QtConcurrent::OrderedReduce](qtconcurrent#ReduceOption-enum) results in the ordered reduction. **See also** [Concurrent Map and Map-Reduce](qtconcurrentmap). ### template <typename ResultType, typename Iterator, typename MapFunctor, typename ReduceFunctor> [QFuture](qfuture)<ResultType> QtConcurrent::mappedReduced(Iterator *begin*, Iterator *end*, MapFunctor &&*mapFunction*, ReduceFunctor &&*reduceFunction*, [QtConcurrent::ReduceOptions](qtconcurrent#ReduceOption-enum) *reduceOptions* = ReduceOptions(UnorderedReduce | SequentialReduce)) Calls *mapFunction* once for each item from *begin* to *end*. The return value of each *mapFunction* is passed to *reduceFunction*. Note that while *mapFunction* is called concurrently, only one thread at a time will call *reduceFunction*. By default, the order in which *reduceFunction* is called is undefined. **Note:** [QtConcurrent::OrderedReduce](qtconcurrent#ReduceOption-enum) results in the ordered reduction. **See also** [Concurrent Map and Map-Reduce](qtconcurrentmap). ### template <typename ResultType, typename Iterator, typename MapFunctor, typename ReduceFunctor, typename InitialValueType> [QFuture](qfuture)<ResultType> QtConcurrent::mappedReduced([QThreadPool](qthreadpool) \**pool*, Iterator *begin*, Iterator *end*, MapFunctor &&*mapFunction*, ReduceFunctor &&*reduceFunction*, InitialValueType &&*initialValue*, [QtConcurrent::ReduceOptions](qtconcurrent#ReduceOption-enum) *reduceOptions* = ReduceOptions(UnorderedReduce | SequentialReduce)) Calls *mapFunction* once for each item from *begin* to *end*. All calls to *mapFunction* are invoked from the threads taken from the [QThreadPool](qthreadpool) *pool*. The return value of each *mapFunction* is passed to *reduceFunction*. The result value is initialized to *initialValue* when the function is called, and the first call to *reduceFunction* will operate on this value. Note that while *mapFunction* is called concurrently, only one thread at a time will call *reduceFunction*. By default, the order in which *reduceFunction* is called is undefined. **Note:** [QtConcurrent::OrderedReduce](qtconcurrent#ReduceOption-enum) results in the ordered reduction. **See also** [Concurrent Map and Map-Reduce](qtconcurrentmap). ### template <typename ResultType, typename Iterator, typename MapFunctor, typename ReduceFunctor, typename InitialValueType> [QFuture](qfuture)<ResultType> QtConcurrent::mappedReduced(Iterator *begin*, Iterator *end*, MapFunctor &&*mapFunction*, ReduceFunctor &&*reduceFunction*, InitialValueType &&*initialValue*, [QtConcurrent::ReduceOptions](qtconcurrent#ReduceOption-enum) *reduceOptions* = ReduceOptions(UnorderedReduce | SequentialReduce)) Calls *mapFunction* once for each item from *begin* to *end*. The return value of each *mapFunction* is passed to *reduceFunction*. The result value is initialized to *initialValue* when the function is called, and the first call to *reduceFunction* will operate on this value. Note that while *mapFunction* is called concurrently, only one thread at a time will call *reduceFunction*. By default, the order in which *reduceFunction* is called is undefined. **Note:** [QtConcurrent::OrderedReduce](qtconcurrent#ReduceOption-enum) results in the ordered reduction. **See also** [Concurrent Map and Map-Reduce](qtconcurrentmap). ### template <typename T> [QFuture](qfuture)<T> QtConcurrent::run(Function *function*, ...) Equivalent to ``` QtConcurrent::run(QThreadPool::globalInstance(), function, ...); ``` Runs *function* in a separate thread. The thread is taken from the global [QThreadPool](qthreadpool). Note that *function* may not run immediately; *function* will only be run once a thread becomes available. In [basic mode](qtconcurrentrun#concurrent-run-basic-mode) T is the same type as the return value of *function*. Non-void return values can be accessed via the [QFuture::result](qfuture#result)() function. In [basic mode](qtconcurrentrun#concurrent-run-basic-mode) the [QFuture](qfuture) returned can only be used to query for the running/finished status and the return value of the function. In particular, canceling or pausing can be issued only if the computations behind the future has not been started. In [run with promise mode](qtconcurrentrun#concurrent-run-with-promise), the *function* is expected to return void and must take an additional argument of `QPromise<T> &` type, placed as a first argument in function's argument list. T is the result type and it is the same for the returned `QFuture<T>`. In [run with promise mode](qtconcurrentrun#concurrent-run-with-promise), similar to *basic* mode, the [QFuture](qfuture) returned can be used to query for the running/finished status and the value reported by the function. In addition, it may be used for suspending or canceling the running task, fetching multiple results from the called *function* or monitoring progress reported by the *function*. **See also** [Concurrent Run (basic mode)](qtconcurrentrun#concurrent-run-basic-mode) and [Concurrent Run With Promise](qtconcurrentrun#concurrent-run-with-promise). ### `[since 5.4]` template <typename T> [QFuture](qfuture)<T> QtConcurrent::run([QThreadPool](qthreadpool) \**pool*, Function *function*, ...) Runs *function* in a separate thread. The thread is taken from the [QThreadPool](qthreadpool) *pool*. Note that *function* may not run immediately; *function* will only be run once a thread becomes available. In [basic mode](qtconcurrentrun#concurrent-run-basic-mode) T is the same type as the return value of *function*. Non-void return values can be accessed via the [QFuture::result](qfuture#result)() function. In [basic mode](qtconcurrentrun#concurrent-run-basic-mode) the [QFuture](qfuture) returned can only be used to query for the running/finished status and the return value of the function. In particular, canceling or pausing can be issued only if the computations behind the future has not been started. In [run with promise mode](qtconcurrentrun#concurrent-run-with-promise), the *function* is expected to return void and must take an additional argument of `QPromise<T> &` type, placed as a first argument in function's argument list. T is the result type and it is the same for the returned `QFuture<T>`. In [run with promise mode](qtconcurrentrun#concurrent-run-with-promise), similar to *basic* mode, the [QFuture](qfuture) returned can be used to query for the running/finished status and the value reported by the function. In addition, it may be used for suspending or canceling the running task, fetching multiple results from the called *function* or monitoring progress reported by the *function*. This function was introduced in Qt 5.4. **See also** [Concurrent Run (basic mode)](qtconcurrentrun#concurrent-run-basic-mode) and [Concurrent Run With Promise](qtconcurrentrun#concurrent-run-with-promise). ### `[since 6.0]` template <typename Task> [QTaskBuilder](qtconcurrent-qtaskbuilder)<Task> QtConcurrent::task(Task &&*task*) Creates an instance of [QtConcurrent::QTaskBuilder](qtconcurrent-qtaskbuilder). This object can be used to adjust some parameters and run *task* in a separate thread. This function was introduced in Qt 6.0. **See also** [Concurrent Task](qtconcurrenttask) and [QtConcurrent::QTaskBuilder](qtconcurrent-qtaskbuilder).
programming_docs
qt QTexture3D Class QTexture3D Class ================ class [Qt3DRender](https://doc.qt.io/qt-6.2/qt3drender-module.html)::QTexture3D A [QAbstractTexture](qt3drender-qabstracttexture) with a Target3D target format. [More...](#details) | | | | --- | --- | | Header: | #include <Qt3DRender/QTexture> | | CMake: | find\_package(Qt6 COMPONENTS 3drender REQUIRED) target\_link\_libraries(mytarget PRIVATE Qt6::3drender) | | qmake: | QT += 3drender | | Since: | Qt 5.5 | | Instantiated By: | [Texture3D](qml-qt3d-render-texture3d) | | Inherits: | [Qt3DRender::QAbstractTexture](qt3drender-qabstracttexture) | * [List of all members, including inherited members](https://doc.qt.io/qt-6.2/qt3drender-qtexture3d-members.html) Public Functions ---------------- | | | | --- | --- | | | **[QTexture3D](qt3drender-qtexture3d#QTexture3D)**(Qt3DCore::QNode \**parent* = nullptr) | Detailed Description -------------------- Member Function Documentation ----------------------------- ### QTexture3D::QTexture3D([Qt3DCore::QNode](qt3dcore-qnode) \**parent* = nullptr) Constructs a new [Qt3DRender::QTexture3D](qt3drender-qtexture3d) instance with *parent* as parent. qt iterator Class iterator Class ============== class [QMap](qmap)::iterator The [QMap::iterator](qmap-iterator) class provides an STL-style non-const iterator for [QMap](qmap). [More...](#details) * [List of all members, including inherited members](https://doc.qt.io/qt-6.2/qmap-iterator-members.html) * [Deprecated members](https://doc.qt.io/qt-6.2/qmap-iterator-obsolete.html) Public Types ------------ | | | | --- | --- | | | **[iterator\_category](qmap-iterator#iterator_category-typedef)** | Public Functions ---------------- | | | | --- | --- | | | **[iterator](qmap-iterator#iterator-1)**() | | const Key & | **[key](qmap-iterator#key)**() const | | T & | **[value](qmap-iterator#value)**() const | | T & | **[operator\*](qmap-iterator#operator-2a)**() const | | iterator & | **[operator++](qmap-iterator#operator-2b-2b)**() | | iterator | **[operator++](qmap-iterator#operator-2b-2b-1)**(int) | | iterator & | **[operator--](qmap-iterator#operator--)**() | | iterator | **[operator--](qmap-iterator#operator---1)**(int) | | T \* | **[operator->](qmap-iterator#operator--gt)**() const | Related Non-Members ------------------- | | | | --- | --- | | bool | **[operator!=](qmap-iterator#operator-not-eq)**(const iterator &*lhs*, const iterator &*rhs*) | | bool | **[operator==](qmap-iterator#operator-eq-eq)**(const iterator &*lhs*, const iterator &*rhs*) | Detailed Description -------------------- [QMap](qmap) features both [STL-style iterators](containers#stl-style-iterators) and [Java-style iterators](java-style-iterators#java-style-iterators). The STL-style iterators are more low-level and more cumbersome to use; on the other hand, they are slightly faster and, for developers who already know STL, have the advantage of familiarity. [QMap](qmap)<Key, T>::iterator allows you to iterate over a [QMap](qmap) and to modify the value (but not the key) stored under a particular key. If you want to iterate over a const [QMap](qmap), you should use [QMap::const\_iterator](qmap-const-iterator). It is generally good practice to use [QMap::const\_iterator](qmap-const-iterator) on a non-const [QMap](qmap) as well, unless you need to change the [QMap](qmap) through the iterator. Const iterators are slightly faster, and can improve code readability. The default [QMap::iterator](qmap-iterator) constructor creates an uninitialized iterator. You must initialize it using a [QMap](qmap) function like [QMap::begin](qmap#begin)(), [QMap::end](qmap#end)(), or [QMap::find](qmap#find)() before you can start iterating. Here's a typical loop that prints all the (key, value) pairs stored in a map: ``` QMap<QString, int> map; map.insert("January", 1); map.insert("February", 2); ... map.insert("December", 12); QMap<QString, int>::iterator i; for (i = map.begin(); i != map.end(); ++i) cout << i.key() << ": " << i.value() << Qt::endl; ``` Unlike [QHash](qhash#qhash), which stores its items in an arbitrary order, [QMap](qmap) stores its items ordered by key. Let's see a few examples of things we can do with a [QMap::iterator](qmap-iterator) that we cannot do with a [QMap::const\_iterator](qmap-const-iterator). Here's an example that increments every value stored in the [QMap](qmap) by 2: ``` QMap<QString, int>::iterator i; for (i = map.begin(); i != map.end(); ++i) i.value() += 2; ``` Here's an example that removes all the items whose key is a string that starts with an underscore character: ``` QMap<QString, int>::iterator i = map.begin(); while (i != map.end()) { if (i.key().startsWith('_')) i = map.erase(i); else ++i; } ``` The call to [QMap::erase](qmap#erase)() removes the item pointed to by the iterator from the map, and returns an iterator to the next item. Here's another way of removing an item while iterating: ``` QMap<QString, int>::iterator i = map.begin(); while (i != map.end()) { QMap<QString, int>::iterator prev = i; ++i; if (prev.key().startsWith('_')) map.erase(prev); } ``` It might be tempting to write code like this: ``` // WRONG while (i != map.end()) { if (i.key().startsWith('_')) map.erase(i); ++i; } ``` However, this will potentially crash in `++i`, because `i` is a dangling iterator after the call to [erase](qmap#erase)(). Multiple iterators can be used on the same map. If you add items to the map, existing iterators will remain valid. If you remove items from the map, iterators that point to the removed items will become dangling iterators. **Warning:** Iterators on implicitly shared containers do not work exactly like STL-iterators. You should avoid copying a container while iterators are active on that container. For more information, read [Implicit sharing iterator problem](containers#implicit-sharing-iterator-problem). **See also** [QMap::const\_iterator](qmap-const-iterator), [QMap::key\_iterator](qmap-key-iterator), and [QMutableMapIterator](qmutablemapiterator). Member Type Documentation ------------------------- ### `[alias]` iterator::iterator\_category A synonym for *std::bidirectional\_iterator\_tag* indicating this iterator is a bidirectional iterator. Member Function Documentation ----------------------------- ### iterator::iterator() Constructs an uninitialized iterator. Functions like [key](qmap-iterator#key)(), [value](qmap-iterator#value)(), and operator++() must not be called on an uninitialized iterator. Use operator=() to assign a value to it before using it. **See also** [QMap::begin](qmap#begin)() and [QMap::end](qmap#end)(). ### const Key &iterator::key() const Returns the current item's key as a const reference. There is no direct way of changing an item's key through an iterator, although it can be done by calling [QMap::erase](qmap#erase)() followed by [QMap::insert](qmap#insert)(). **See also** [value](qmap-iterator#value)(). ### T &iterator::value() const Returns a modifiable reference to the current item's value. You can change the value of an item by using value() on the left side of an assignment, for example: ``` if (i.key() == "Hello") i.value() = "Bonjour"; ``` **See also** [key](qmap-iterator#key)() and [operator\*](qmap-iterator#operator-2a)(). ### T &iterator::operator\*() const Returns a modifiable reference to the current item's value. Same as [value](qmap-iterator#value)(). **See also** [key](qmap-iterator#key)(). ### iterator &iterator::operator++() The prefix ++ operator (`++i`) advances the iterator to the next item in the map and returns an iterator to the new current item. Calling this function on [QMap::end](qmap#end)() leads to undefined results. **See also** [operator--](qmap-iterator#operator--)(). ### iterator iterator::operator++(int) This is an overloaded function. The postfix ++ operator (`i++`) advances the iterator to the next item in the map and returns an iterator to the previously current item. ### iterator &iterator::operator--() The prefix -- operator (`--i`) makes the preceding item current and returns an iterator pointing to the new current item. Calling this function on [QMap::begin](qmap#begin)() leads to undefined results. **See also** [operator++](qmap-iterator#operator-2b-2b)(). ### iterator iterator::operator--(int) This is an overloaded function. The postfix -- operator (`i--`) makes the preceding item current and returns an iterator pointing to the previously current item. ### T \*iterator::operator->() const Returns a pointer to the current item's value. **See also** [value](qmap-iterator#value)(). Related Non-Members ------------------- ### bool operator!=(const iterator &*lhs*, const iterator &*rhs*) Returns `true` if *lhs* points to a different item than the *rhs* iterator; otherwise returns `false`. **See also** [operator==](qmap-iterator#operator-eq-eq)(). ### bool operator==(const iterator &*lhs*, const iterator &*rhs*) Returns `true` if *lhs* points to the same item as the *rhs* iterator; otherwise returns `false`. **See also** [operator!=](qmap-iterator#operator-not-eq)(). qt QTaggedIterator Class QTaggedIterator Class ===================== template <typename Iterator, typename IteratorCategory> class QTaggedIterator QTaggedIterator is a template class that wraps an iterator and exposes standard iterator traits. [More...](#details) | | | | --- | --- | | Header: | #include <QTaggedIterator> | | CMake: | find\_package(Qt6 COMPONENTS Core REQUIRED) target\_link\_libraries(mytarget PRIVATE Qt6::Core) | | qmake: | QT += core | | Since: | Qt 6.0 | * [List of all members, including inherited members](https://doc.qt.io/qt-6.2/qtaggediterator-members.html) Public Functions ---------------- | | | | --- | --- | | | **[QTaggedIterator](qtaggediterator#QTaggedIterator)**(Iterator &&*it*) | | bool | **[operator!=](qtaggediterator#operator-not-eq)**(const QTaggedIterator<Iterator, IteratorCategory> &*other*) const | | QTaggedIterator<Iterator, IteratorCategory> | **[operator+](qtaggediterator#operator-2b)**(qsizetype *j*) const | | QTaggedIterator<Iterator, IteratorCategory> & | **[operator++](qtaggediterator#operator-2b-2b)**() | | QTaggedIterator<Iterator, IteratorCategory> | **[operator++](qtaggediterator#operator-2b-2b-1)**(int *x*) | | QTaggedIterator<Iterator, IteratorCategory> & | **[operator+=](qtaggediterator#operator-2b-eq)**(qsizetype *j*) | | QTaggedIterator<Iterator, IteratorCategory> | **[operator-](qtaggediterator#operator-)**(qsizetype *j*) const | | qsizetype | **[operator-](qtaggediterator#operator--1)**(const QTaggedIterator<Iterator, IteratorCategory> &*j*) const | | QTaggedIterator<Iterator, IteratorCategory> & | **[operator--](qtaggediterator#operator--)**() | | QTaggedIterator<Iterator, IteratorCategory> | **[operator--](qtaggediterator#operator---1)**(int *x*) | | QTaggedIterator<Iterator, IteratorCategory> & | **[operator-=](qtaggediterator#operator--eq)**(qsizetype *j*) | | bool | **[operator==](qtaggediterator#operator-eq-eq)**(const QTaggedIterator<Iterator, IteratorCategory> &*other*) const | Related Non-Members ------------------- | | | | --- | --- | | QTaggedIterator<Iterator, IteratorCategory> | **[operator+](qtaggediterator#operator-2b-1)**(qsizetype *j*, const QTaggedIterator<Iterator, IteratorCategory> &*k*) | Detailed Description -------------------- In order to use an iterator any of the standard algorithms, its iterator traits need to be known. As [QSequentialIterable](qsequentialiterable) can work with many different kinds of containers, we cannot declare the traits in the iterator classes themselves. A QTaggedIterator gives you a way to explicitly declare a trait for a concrete instance of an iterator or [QConstIterator](qconstiterator). Member Function Documentation ----------------------------- ### QTaggedIterator::QTaggedIterator(Iterator &&*it*) Constructs a QTaggedIterator from an iterator or [QConstIterator](qconstiterator) *it*. Checks whether the IteratorCategory passed as template argument matches the run time capabilities of *it*; if there's no match, *it* is refused. ### bool QTaggedIterator::operator!=(const [QTaggedIterator](qtaggediterator#QTaggedIterator)<Iterator, IteratorCategory> &*other*) const Returns `true` if *other* points to a different item than this iterator; otherwise returns `false`. **See also** [operator==](qtaggediterator#operator-eq-eq)(). ### [QTaggedIterator](qtaggediterator#QTaggedIterator)<Iterator, IteratorCategory> QTaggedIterator::operator+(qsizetype *j*) const Returns an iterator to the item at *j* positions forward from this iterator. **See also** [operator-](qtaggediterator#operator-)() and [operator+=](qtaggediterator#operator-2b-eq)(). ### [QTaggedIterator](qtaggediterator#QTaggedIterator)<Iterator, IteratorCategory> &QTaggedIterator::operator++() The prefix ++ operator (`++it`) advances the iterator to the next item in the container and returns an iterator to the new current item. Calling this function on QSequentialIterable::end() leads to undefined results. **See also** [operator--](qtaggediterator#operator--)(). ### [QTaggedIterator](qtaggediterator#QTaggedIterator)<Iterator, IteratorCategory> QTaggedIterator::operator++(int *x*) This is an overloaded function. The postfix ++ operator (`it++`) advances the iterator to the next item in the container and returns an iterator to the previously current item. ### [QTaggedIterator](qtaggediterator#QTaggedIterator)<Iterator, IteratorCategory> &QTaggedIterator::operator+=(qsizetype *j*) Advances the iterator by *j* items. **See also** [operator-=](qtaggediterator#operator--eq)() and [operator+](qtaggediterator#operator-2b)(). ### [QTaggedIterator](qtaggediterator#QTaggedIterator)<Iterator, IteratorCategory> QTaggedIterator::operator-(qsizetype *j*) const Returns an iterator to the item at *j* positions backward from this iterator. If the container in the [QVariant](qvariant) does not support bi-directional iteration, calling this function leads to undefined results. **See also** [operator+](qtaggediterator#operator-2b)(), [operator-=](qtaggediterator#operator--eq)(), and [QIterable::canReverseIterate](qiterable#canReverseIterate)(). ### qsizetype QTaggedIterator::operator-(const [QTaggedIterator](qtaggediterator#QTaggedIterator)<Iterator, IteratorCategory> &*j*) const Returns the distance between this iterator and *j*. **See also** [operator+](qtaggediterator#operator-2b)(), [operator-=](qtaggediterator#operator--eq)(), and [QIterable::canReverseIterate](qiterable#canReverseIterate)(). ### [QTaggedIterator](qtaggediterator#QTaggedIterator)<Iterator, IteratorCategory> &QTaggedIterator::operator--() The prefix -- operator (`--it`) makes the preceding item current and returns an iterator to the new current item. Calling this function on QSequentialIterable::begin() leads to undefined results. If the container in the [QVariant](qvariant) does not support bi-directional iteration, calling this function leads to undefined results. **See also** [operator++](qtaggediterator#operator-2b-2b)() and [QIterable::canReverseIterate](qiterable#canReverseIterate)(). ### [QTaggedIterator](qtaggediterator#QTaggedIterator)<Iterator, IteratorCategory> QTaggedIterator::operator--(int *x*) This is an overloaded function. The postfix -- operator (`it--`) makes the preceding item current and returns an iterator to the previously current item. If the container in the [QVariant](qvariant) does not support bi-directional iteration, calling this function leads to undefined results. **See also** [QIterable::canReverseIterate](qiterable#canReverseIterate)(). ### [QTaggedIterator](qtaggediterator#QTaggedIterator)<Iterator, IteratorCategory> &QTaggedIterator::operator-=(qsizetype *j*) Makes the iterator go back by *j* items. If the container in the [QVariant](qvariant) does not support bi-directional iteration, calling this function leads to undefined results. **See also** [operator+=](qtaggediterator#operator-2b-eq)(), [operator-](qtaggediterator#operator-)(), and [QIterable::canReverseIterate](qiterable#canReverseIterate)(). ### bool QTaggedIterator::operator==(const [QTaggedIterator](qtaggediterator#QTaggedIterator)<Iterator, IteratorCategory> &*other*) const Returns `true` if *other* points to the same item as this iterator; otherwise returns `false`. **See also** [operator!=](qtaggediterator#operator-not-eq)(). Related Non-Members ------------------- ### [QTaggedIterator](qtaggediterator#QTaggedIterator)<Iterator, IteratorCategory> operator+(qsizetype *j*, const [QTaggedIterator](qtaggediterator#QTaggedIterator)<Iterator, IteratorCategory> &*k*) Returns an iterator to the item at *j* positions forward from iterator *k*. qt ImageCapture QML Type ImageCapture QML Type ===================== An interface for capturing camera images. [More...](#details) | | | | --- | --- | | Import Statement: | import QtMultimedia | * [List of all members, including inherited members](https://doc.qt.io/qt-6.2/qml-qtmultimedia-imagecapture-members.html) Properties ---------- * **[preview](qml-qtmultimedia-imagecapture#preview-prop)** : string * **[readyForCapture](qml-qtmultimedia-imagecapture#readyForCapture-prop)** : bool Signals ------- * **[errorOccurred](qml-qtmultimedia-imagecapture#errorOccurred-signal)**(*requestId*, *error*, *message*) * **[imageCaptured](qml-qtmultimedia-imagecapture#imageCaptured-signal)**(*requestId*, *previewImage*) * **[imageMetadataAvailable](qml-qtmultimedia-imagecapture#imageMetadataAvailable-signal)**(*requestId*, *key*, *value*) * **[imageSaved](qml-qtmultimedia-imagecapture#imageSaved-signal)**(*requestId*, *path*) Methods ------- * **[capture](qml-qtmultimedia-imagecapture#capture-method)**() * **[captureToFile](qml-qtmultimedia-imagecapture#captureToFile-method)**(*location*) * **[saveToFile](qml-qtmultimedia-imagecapture#saveToFile-method)**(*location*) Detailed Description -------------------- This type allows you to capture still images and be notified when they are available or saved to disk. ``` Item { width: 640 height: 360 CaptureSession { imageCapture : ImageCapture { id: imageCapture } camera: Camera { id: camera } videoOutput: videoOutput } VideoOutput { id: videoOutput anchors.fill: parent MouseArea { anchors.fill: parent; onClicked: imageCapture.capture(); } } Image { id: photoPreview source: imageCapture.preview // always shows the last captured image } } ``` Property Documentation ---------------------- ### preview : [string](qml-string) This property holds a url to the latest captured image. It can be connected to the source property of an [Image](qml-qtquick-image) element to show the last captured image. ``` CaptureSession { camera: Camera {} imageCapture: ImageCapture { id: capture } } Image { source: capture.preview } ``` **See also** [saveToFile](qml-qtmultimedia-imagecapture#saveToFile-method). ### readyForCapture : [bool](qml-bool) This property holds a bool value indicating whether the camera is ready to capture photos or not. Calling [capture](qml-qtmultimedia-imagecapture#capture-method)() or [captureToFile](qml-qtmultimedia-imagecapture#captureToFile-method)() while *ready* is `false` is not permitted and results in an error. Signal Documentation -------------------- ### errorOccurred(*requestId*, *error*, *message*) This signal is emitted when an error occurs during capture with *requestId*. *error* is an enumeration of type ImageCapture::Error. A descriptive message is available in *message*. **Note:** The corresponding handler is `onErrorOccurred`. ### imageCaptured(*requestId*, *previewImage*) This signal is emitted when an image with *requestId* has been captured but not yet saved to the filesystem. The *previewImage* parameter is the captured image. **Note:** The corresponding handler is `onImageCaptured`. **See also** [imageSaved](qml-qtmultimedia-imagecapture#imageSaved-signal) and [preview](https://doc.qt.io/qt-6.2/cameraoverview.html#preview). ### imageMetadataAvailable(*requestId*, *key*, *value*) This signal is emitted when the image with *requestId* has new metadata available with the key *key* and value *value*. **Note:** The corresponding handler is `onImageMetadataAvailable`. **See also** [imageCaptured](qml-qtmultimedia-imagecapture#imageCaptured-signal). ### imageSaved(*requestId*, *path*) This signal is emitted after the image with *requestId* has been written to the filesystem. The *path* is a local file path, not a URL. **Note:** The corresponding handler is `onImageSaved`. **See also** [imageCaptured](qml-qtmultimedia-imagecapture#imageCaptured-signal). Method Documentation -------------------- ### capture() Start image capture. The [imageCaptured](qml-qtmultimedia-imagecapture#imageCaptured-signal) and [imageSaved](qml-qtmultimedia-imagecapture#imageSaved-signal) signals will be emitted when the capture is complete. The captured image will be available through the preview property that can be used as the source for a QML Image item. The [saveToFile](qml-qtmultimedia-imagecapture#saveToFile-method)() method can then be used save the image. Camera saves all the capture parameters like exposure settings or image processing parameters, so changes to camera parameters after capture() is called do not affect previous capture requests. capture() returns the capture requestId parameter, used with imageExposed(), [imageCaptured](qml-qtmultimedia-imagecapture#imageCaptured-signal)(), [imageMetadataAvailable](qml-qtmultimedia-imagecapture#imageMetadataAvailable-signal)() and [imageSaved](qml-qtmultimedia-imagecapture#imageSaved-signal)() signals. **See also** [readyForCapture](qml-qtmultimedia-imagecapture#readyForCapture-prop) and [preview](https://doc.qt.io/qt-6.2/cameraoverview.html#preview). ### captureToFile(*location*) Does the same as [capture](qml-qtmultimedia-imagecapture#capture-method)() but additionally automatically saves the captured image to the specified *location*. **See also** [capture](qml-qtmultimedia-imagecapture#capture-method). ### saveToFile(*location*) Saves the last captured image to *location*. **See also** [capture](qml-qtmultimedia-imagecapture#capture-method) and [preview](https://doc.qt.io/qt-6.2/cameraoverview.html#preview).
programming_docs
qt CullFace QML Type CullFace QML Type ================= The CullFace type specifies whether front or back face culling is enabled. [More...](#details) | | | | --- | --- | | Import Statement: | import Qt3D.Render | | Since: | Qt 5.7 | | Instantiates: | [QCullFace](qt3drender-qcullface) | | Inherits: | [RenderState](qml-qt3d-render-renderstate) | * [List of all members, including inherited members](https://doc.qt.io/qt-6.2/qml-qt3d-render-cullface-members.html) Properties ---------- * **[mode](qml-qt3d-render-cullface#mode-prop)** : enumeration Detailed Description -------------------- CullFace sets whether the front or back facets are culled. Facets include triangles, quadrilaterals, polygons and rectangles. It can be added to the renderStates property of a [RenderPass](qml-qt3d-render-renderpass): ``` RenderPass { shaderProgram: ShaderProgram { // ... } renderStates: [ CullFace { mode: CullFace.Front } ] } ``` Or added to the renderStates property of a [RenderStateSet](qml-qt3d-render-renderstateset): ``` RenderStateSet { renderStates: [ CullFace { mode: CullFace.Front } ] } ``` **See also** [FrontFace](qml-qt3d-render-frontface). Property Documentation ---------------------- ### mode : [enumeration](qml-enumeration) Holds the culling mode used by [CullFace](qml-qt3d-render-cullface). Default is set to QCullFace.Back. * [CullFace](qml-qt3d-render-cullface).NoCulling - culling is disabled * [CullFace](qml-qt3d-render-cullface).Front - culling is enabled for front facing polygons * [CullFace](qml-qt3d-render-cullface).Back - culling is enabled for back facing polygons * [CullFace](qml-qt3d-render-cullface).FrontAndBack - culling is enabled for all polygons, but points and lines are drawn qt QStyleOptionMenuItem Class QStyleOptionMenuItem Class ========================== The QStyleOptionMenuItem class is used to describe the parameter necessary for drawing a menu item. [More...](#details) | | | | --- | --- | | Header: | #include <QStyleOptionMenuItem> | | CMake: | find\_package(Qt6 COMPONENTS Widgets REQUIRED) target\_link\_libraries(mytarget PRIVATE Qt6::Widgets) | | qmake: | QT += widgets | | Inherits: | [QStyleOption](qstyleoption) | * [List of all members, including inherited members](https://doc.qt.io/qt-6.2/qstyleoptionmenuitem-members.html) Public Types ------------ | | | | --- | --- | | enum | **[CheckType](qstyleoptionmenuitem#CheckType-enum)** { NotCheckable, Exclusive, NonExclusive } | | enum | **[MenuItemType](qstyleoptionmenuitem#MenuItemType-enum)** { Normal, DefaultItem, Separator, SubMenu, Scroller, …, EmptyArea } | | enum | **[StyleOptionType](qstyleoptionmenuitem#StyleOptionType-enum)** { Type } | | enum | **[StyleOptionVersion](qstyleoptionmenuitem#StyleOptionVersion-enum)** { Version } | Public Functions ---------------- | | | | --- | --- | | | **[QStyleOptionMenuItem](qstyleoptionmenuitem#QStyleOptionMenuItem-1)**(const QStyleOptionMenuItem &*other*) | | | **[QStyleOptionMenuItem](qstyleoptionmenuitem#QStyleOptionMenuItem)**() | Public Variables ---------------- | | | | --- | --- | | QStyleOptionMenuItem::CheckType | **[checkType](qstyleoptionmenuitem#checkType-var)** | | bool | **[checked](qstyleoptionmenuitem#checked-var)** | | QFont | **[font](qstyleoptionmenuitem#font-var)** | | QIcon | **[icon](qstyleoptionmenuitem#icon-var)** | | int | **[maxIconWidth](qstyleoptionmenuitem#maxIconWidth-var)** | | bool | **[menuHasCheckableItems](qstyleoptionmenuitem#menuHasCheckableItems-var)** | | QStyleOptionMenuItem::MenuItemType | **[menuItemType](qstyleoptionmenuitem#menuItemType-var)** | | QRect | **[menuRect](qstyleoptionmenuitem#menuRect-var)** | | int | **[reservedShortcutWidth](qstyleoptionmenuitem#reservedShortcutWidth-var)** | | QString | **[text](qstyleoptionmenuitem#text-var)** | Detailed Description -------------------- QStyleOptionMenuItem contains all the information that [QStyle](qstyle) functions need to draw the menu items from [QMenu](qmenu). It is also used for drawing other menu-related widgets. For performance reasons, there are few member functions and the access to the member variables is direct (i.e., using the `.` or `->` operator). This makes the structures straightforward to use and emphasizes that these are simply parameters used by the style functions. For an example demonstrating how style options can be used, see the [Styles](https://doc.qt.io/qt-6.2/qtwidgets-widgets-styles-example.html) example. **See also** [QStyleOption](qstyleoption). Member Type Documentation ------------------------- ### enum QStyleOptionMenuItem::CheckType This enum is used to indicate whether or not a check mark should be drawn for the item, or even if it should be drawn at all. | Constant | Value | Description | | --- | --- | --- | | `QStyleOptionMenuItem::NotCheckable` | `0` | The item is not checkable. | | `QStyleOptionMenuItem::Exclusive` | `1` | The item is an exclusive check item (like a radio button). | | `QStyleOptionMenuItem::NonExclusive` | `2` | The item is a non-exclusive check item (like a check box). | **See also** [checkType](qstyleoptionmenuitem#checkType-var), [QAction::checkable](qaction#checkable-prop), [QAction::checked](qaction#checked-prop), and [QActionGroup::exclusionPolicy](qactiongroup#exclusionPolicy-prop). ### enum QStyleOptionMenuItem::MenuItemType This enum indicates the type of menu item that the structure describes. | Constant | Value | Description | | --- | --- | --- | | `QStyleOptionMenuItem::Normal` | `0` | A normal menu item. | | `QStyleOptionMenuItem::DefaultItem` | `1` | A menu item that is the default action as specified with [QMenu::defaultAction](qmenu#defaultAction)(). | | `QStyleOptionMenuItem::Separator` | `2` | A menu separator. | | `QStyleOptionMenuItem::SubMenu` | `3` | Indicates the menu item points to a sub-menu. | | `QStyleOptionMenuItem::Scroller` | `4` | A popup menu scroller (currently only used on macOS). | | `QStyleOptionMenuItem::TearOff` | `5` | A tear-off handle for the menu. | | `QStyleOptionMenuItem::Margin` | `6` | The margin of the menu. | | `QStyleOptionMenuItem::EmptyArea` | `7` | The empty area of the menu. | **See also** [menuItemType](qstyleoptionmenuitem#menuItemType-var). ### enum QStyleOptionMenuItem::StyleOptionType This enum is used to hold information about the type of the style option, and is defined for each [QStyleOption](qstyleoption) subclass. | Constant | Value | Description | | --- | --- | --- | | `QStyleOptionMenuItem::Type` | `SO_MenuItem` | The type of style option provided ([SO\_MenuItem](qstyleoption#OptionType-enum) for this class). | The type is used internally by [QStyleOption](qstyleoption), its subclasses, and [qstyleoption\_cast](qstyleoption#qstyleoption_cast)() to determine the type of style option. In general you do not need to worry about this unless you want to create your own [QStyleOption](qstyleoption) subclass and your own styles. **See also** [StyleOptionVersion](qstyleoptionmenuitem#StyleOptionVersion-enum). ### enum QStyleOptionMenuItem::StyleOptionVersion This enum is used to hold information about the version of the style option, and is defined for each [QStyleOption](qstyleoption) subclass. | Constant | Value | Description | | --- | --- | --- | | `QStyleOptionMenuItem::Version` | `1` | 1 | The version is used by [QStyleOption](qstyleoption) subclasses to implement extensions without breaking compatibility. If you use [qstyleoption\_cast](qstyleoption#qstyleoption_cast)(), you normally do not need to check it. **See also** [StyleOptionType](qstyleoptionmenuitem#StyleOptionType-enum). Member Function Documentation ----------------------------- ### QStyleOptionMenuItem::QStyleOptionMenuItem(const [QStyleOptionMenuItem](qstyleoptionmenuitem#QStyleOptionMenuItem) &*other*) Constructs a copy of the *other* style option. ### QStyleOptionMenuItem::QStyleOptionMenuItem() Constructs a QStyleOptionMenuItem, initializing the members variables to their default values. Member Variable Documentation ----------------------------- ### [QStyleOptionMenuItem::CheckType](qstyleoptionmenuitem#CheckType-enum) QStyleOptionMenuItem::checkType This variable holds the type of checkmark of the menu item The default value is [NotCheckable](qstyleoptionmenuitem#CheckType-enum). **See also** [CheckType](qstyleoptionmenuitem#CheckType-enum). ### bool QStyleOptionMenuItem::checked This variable holds whether the menu item is checked or not The default value is false. ### [QFont](qfont) QStyleOptionMenuItem::font This variable holds the font used for the menu item text This is the font that should be used for drawing the menu text minus the shortcut. The shortcut is usually drawn using the painter's font. By default, the application's default font is used. ### [QIcon](qicon) QStyleOptionMenuItem::icon This variable holds the icon for the menu item The default value is an empty icon, i.e. an icon with neither a pixmap nor a filename. ### int QStyleOptionMenuItem::maxIconWidth This variable holds the maximum icon width for the icon in the menu item This can be used for drawing the icon into the correct place or properly aligning items. The variable must be set regardless of whether or not the menu item has an icon. The default value is 0. ### bool QStyleOptionMenuItem::menuHasCheckableItems This variable holds whether the menu as a whole has checkable items or not The default value is true. If this option is set to false, then the menu has no checkable items. This makes it possible for GUI styles to save some horizontal space that would normally be used for the check column. ### [QStyleOptionMenuItem::MenuItemType](qstyleoptionmenuitem#MenuItemType-enum) QStyleOptionMenuItem::menuItemType This variable holds the type of menu item The default value is [Normal](qstyleoptionmenuitem#MenuItemType-enum). **See also** [MenuItemType](qstyleoptionmenuitem#MenuItemType-enum). ### [QRect](qrect) QStyleOptionMenuItem::menuRect This variable holds the rectangle for the entire menu The default value is a null rectangle, i.e. a rectangle with both the width and the height set to 0. ### int QStyleOptionMenuItem::reservedShortcutWidth This variable holds the reserved width for the menu item's shortcut [QMenu](qmenu) sets it to the width occupied by the widest shortcut among all visible items within the menu. The default value is 0. ### [QString](qstring) QStyleOptionMenuItem::text This variable holds the text for the menu item Note that the text format is something like this "Menu text**\t**Shortcut". If the menu item doesn't have a shortcut, it will just contain the menu item's text. The default value is an empty string. qt QXYSeries Class QXYSeries Class =============== The QXYSeries class is a base class for line, spline, and scatter series. [More...](#details) | | | | --- | --- | | Header: | #include <QXYSeries> | | Instantiated By: | [XYSeries](qml-qtcharts-xyseries) | | Inherits: | [QAbstractSeries](qabstractseries) | | Inherited By: | [QLineSeries](qlineseries) and [QScatterSeries](qscatterseries) | * [List of all members, including inherited members](https://doc.qt.io/qt-6.2/qxyseries-members.html) * [Deprecated members](https://doc.qt.io/qt-6.2/qxyseries-obsolete.html) Public Types ------------ | | | | --- | --- | | enum class | **[PointConfiguration](qxyseries#PointConfiguration-enum)** { Color, Size, Visibility, LabelVisibility } | Properties ---------- | | | | --- | --- | | * **[bestFitLineColor](qxyseries#bestFitLineColor-prop)** : QColor * **[bestFitLineVisible](qxyseries#bestFitLineVisible-prop)** : bool * **[color](qxyseries#color-prop)** : QColor * **[pointLabelsClipping](qxyseries#pointLabelsClipping-prop)** : bool * **[pointLabelsColor](qxyseries#pointLabelsColor-prop)** : QColor | * **[pointLabelsFont](qxyseries#pointLabelsFont-prop)** : QFont * **[pointLabelsFormat](qxyseries#pointLabelsFormat-prop)** : QString * **[pointLabelsVisible](qxyseries#pointLabelsVisible-prop)** : bool * **[pointsVisible](qxyseries#pointsVisible-prop)** : bool * **[selectedColor](qxyseries#selectedColor-prop)** : QColor | Public Functions ---------------- | | | | --- | --- | | virtual | **[~QXYSeries](qxyseries#dtor.QXYSeries)**() | | void | **[append](qxyseries#append)**(qreal *x*, qreal *y*) | | void | **[append](qxyseries#append-1)**(const QPointF &*point*) | | void | **[append](qxyseries#append-2)**(const QList<QPointF> &*points*) | | const QPointF & | **[at](qxyseries#at)**(int *index*) const | | QColor | **[bestFitLineColor](qxyseries#bestFitLineColor-prop)**() const | | QPair<qreal, qreal> | **[bestFitLineEquation](qxyseries#bestFitLineEquation)**(bool &*ok*) const | | bool | **[bestFitLineVisible](qxyseries#bestFitLineVisible-prop)**() const | | QBrush | **[brush](qxyseries#brush)**() const | | void | **[clear](qxyseries#clear)**() | | void | **[clearPointConfiguration](qxyseries#clearPointConfiguration)**(const int *index*) | | void | **[clearPointConfiguration](qxyseries#clearPointConfiguration-1)**(const int *index*, const QXYSeries::PointConfiguration *key*) | | void | **[clearPointsConfiguration](qxyseries#clearPointsConfiguration)**() | | void | **[clearPointsConfiguration](qxyseries#clearPointsConfiguration-1)**(const QXYSeries::PointConfiguration *key*) | | virtual QColor | **[color](qxyseries#color)**() const | | void | **[colorBy](qxyseries#colorBy)**(const QList<qreal> &*sourceData*, const QLinearGradient &*gradient* = QLinearGradient()) | | int | **[count](qxyseries#count)**() const | | void | **[deselectAllPoints](qxyseries#deselectAllPoints)**() | | void | **[deselectPoint](qxyseries#deselectPoint)**(int *index*) | | void | **[deselectPoints](qxyseries#deselectPoints)**(const QList<int> &*indexes*) | | void | **[insert](qxyseries#insert)**(int *index*, const QPointF &*point*) | | bool | **[isPointSelected](qxyseries#isPointSelected)**(int *index*) | | const QImage & | **[lightMarker](qxyseries#lightMarker)**() const | | qreal | **[markerSize](qxyseries#markerSize)**() const | | QPen | **[pen](qxyseries#pen)**() const | | QHash<QXYSeries::PointConfiguration, QVariant> | **[pointConfiguration](qxyseries#pointConfiguration)**(const int *index*) const | | bool | **[pointLabelsClipping](qxyseries#pointLabelsClipping-prop)**() const | | QColor | **[pointLabelsColor](qxyseries#pointLabelsColor-prop)**() const | | QFont | **[pointLabelsFont](qxyseries#pointLabelsFont-prop)**() const | | QString | **[pointLabelsFormat](qxyseries#pointLabelsFormat-prop)**() const | | bool | **[pointLabelsVisible](qxyseries#pointLabelsVisible-prop)**() const | | QList<QPointF> | **[points](qxyseries#points)**() const | | QHash<int, QHash<QXYSeries::PointConfiguration, QVariant> > | **[pointsConfiguration](qxyseries#pointsConfiguration)**() const | | bool | **[pointsVisible](qxyseries#pointsVisible-prop)**() const | | void | **[remove](qxyseries#remove)**(qreal *x*, qreal *y*) | | void | **[remove](qxyseries#remove-1)**(const QPointF &*point*) | | void | **[remove](qxyseries#remove-2)**(int *index*) | | void | **[removePoints](qxyseries#removePoints)**(int *index*, int *count*) | | void | **[replace](qxyseries#replace)**(qreal *oldX*, qreal *oldY*, qreal *newX*, qreal *newY*) | | void | **[replace](qxyseries#replace-1)**(const QPointF &*oldPoint*, const QPointF &*newPoint*) | | void | **[replace](qxyseries#replace-2)**(int *index*, qreal *newX*, qreal *newY*) | | void | **[replace](qxyseries#replace-3)**(int *index*, const QPointF &*newPoint*) | | void | **[replace](qxyseries#replace-4)**(const QList<QPointF> &*points*) | | void | **[selectAllPoints](qxyseries#selectAllPoints)**() | | void | **[selectPoint](qxyseries#selectPoint)**(int *index*) | | void | **[selectPoints](qxyseries#selectPoints)**(const QList<int> &*indexes*) | | const QImage & | **[selectedLightMarker](qxyseries#selectedLightMarker)**() const | | QList<int> | **[selectedPoints](qxyseries#selectedPoints)**() const | | void | **[setBestFitLineColor](qxyseries#bestFitLineColor-prop)**(const QColor &*color*) | | void | **[setBestFitLineVisible](qxyseries#bestFitLineVisible-prop)**(bool *visible* = true) | | virtual void | **[setBrush](qxyseries#setBrush)**(const QBrush &*brush*) | | virtual void | **[setColor](qxyseries#color-prop)**(const QColor &*color*) | | void | **[setLightMarker](qxyseries#setLightMarker)**(const QImage &*lightMarker*) | | void | **[setMarkerSize](qxyseries#setMarkerSize)**(qreal *size*) | | virtual void | **[setPen](qxyseries#setPen)**(const QPen &*pen*) | | void | **[setPointConfiguration](qxyseries#setPointConfiguration)**(const int *index*, const QHash<QXYSeries::PointConfiguration, QVariant> &*configuration*) | | void | **[setPointConfiguration](qxyseries#setPointConfiguration-1)**(const int *index*, const QXYSeries::PointConfiguration *key*, const QVariant &*value*) | | void | **[setPointLabelsClipping](qxyseries#pointLabelsClipping-prop)**(bool *enabled* = true) | | void | **[setPointLabelsColor](qxyseries#pointLabelsColor-prop)**(const QColor &*color*) | | void | **[setPointLabelsFont](qxyseries#pointLabelsFont-prop)**(const QFont &*font*) | | void | **[setPointLabelsFormat](qxyseries#pointLabelsFormat-prop)**(const QString &*format*) | | void | **[setPointLabelsVisible](qxyseries#pointLabelsVisible-prop)**(bool *visible* = true) | | void | **[setPointSelected](qxyseries#setPointSelected)**(int *index*, bool *selected*) | | void | **[setPointsConfiguration](qxyseries#setPointsConfiguration)**(const QHash<int, QHash<QXYSeries::PointConfiguration, QVariant> > &*pointsConfiguration*) | | void | **[setPointsVisible](qxyseries#pointsVisible-prop)**(bool *visible* = true) | | void | **[setSelectedColor](qxyseries#selectedColor-prop)**(const QColor &*color*) | | void | **[setSelectedLightMarker](qxyseries#setSelectedLightMarker)**(const QImage &*selectedLightMarker*) | | void | **[sizeBy](qxyseries#sizeBy)**(const QList<qreal> &*sourceData*, const qreal *minSize*, const qreal *maxSize*) | | void | **[toggleSelection](qxyseries#toggleSelection)**(const QList<int> &*indexes*) | | QXYSeries & | **[operator<<](qxyseries#operator-lt-lt)**(const QPointF &*point*) | | QXYSeries & | **[operator<<](qxyseries#operator-lt-lt-1)**(const QList<QPointF> &*points*) | Signals ------- | | | | --- | --- | | void | **[bestFitLineColorChanged](qxyseries#bestFitLineColorChanged)**(const QColor &*color*) | | void | **[bestFitLineVisibilityChanged](qxyseries#bestFitLineVisibilityChanged)**(bool *visible*) | | void | **[clicked](qxyseries#clicked)**(const QPointF &*point*) | | void | **[colorChanged](qxyseries#colorChanged)**(QColor *color*) | | void | **[doubleClicked](qxyseries#doubleClicked)**(const QPointF &*point*) | | void | **[hovered](qxyseries#hovered)**(const QPointF &*point*, bool *state*) | | void | **[lightMarkerChanged](qxyseries#lightMarkerChanged)**(const QImage &*lightMarker*) | | void | **[markerSizeChanged](qxyseries#markerSizeChanged)**(qreal *size*) | | void | **[penChanged](qxyseries#penChanged)**(const QPen &*pen*) | | void | **[pointAdded](qxyseries#pointAdded)**(int *index*) | | void | **[pointLabelsClippingChanged](qxyseries#pointLabelsClippingChanged)**(bool *clipping*) | | void | **[pointLabelsColorChanged](qxyseries#pointLabelsColorChanged)**(const QColor &*color*) | | void | **[pointLabelsFontChanged](qxyseries#pointLabelsFontChanged)**(const QFont &*font*) | | void | **[pointLabelsFormatChanged](qxyseries#pointLabelsFormatChanged)**(const QString &*format*) | | void | **[pointLabelsVisibilityChanged](qxyseries#pointLabelsVisibilityChanged)**(bool *visible*) | | void | **[pointRemoved](qxyseries#pointRemoved)**(int *index*) | | void | **[pointReplaced](qxyseries#pointReplaced)**(int *index*) | | void | **[pointsRemoved](qxyseries#pointsRemoved)**(int *index*, int *count*) | | void | **[pointsReplaced](qxyseries#pointsReplaced)**() | | void | **[pressed](qxyseries#pressed)**(const QPointF &*point*) | | void | **[released](qxyseries#released)**(const QPointF &*point*) | | void | **[selectedColorChanged](qxyseries#selectedColor-prop)**(const QColor &*color*) | Detailed Description -------------------- QXYSeries supports displaying best fit line on a chart. Best fit line is a line through a chart that expresses the relationship between points. Member Type Documentation ------------------------- ### enum class QXYSeries::PointConfiguration This enum value describes the particular configuration of a point. | Constant | Value | Description | | --- | --- | --- | | `QXYSeries::PointConfiguration::Color` | `0` | This enum value can be used to change a point's color. If used together with [QXYSeries::setPointConfiguration](qxyseries#setPointConfiguration), the configuration's value should be a valid [QColor](qcolor). | | `QXYSeries::PointConfiguration::Size` | `1` | This enum value can be used to change a point's size. If used together with [QXYSeries::setPointConfiguration](qxyseries#setPointConfiguration), the configuration's value should be a number, such as `qreal` or `int`. | | `QXYSeries::PointConfiguration::Visibility` | `2` | This enum value can be used to hide or show the point. If used together with [QXYSeries::setPointConfiguration](qxyseries#setPointConfiguration), the configuration's value should be boolean. | | `QXYSeries::PointConfiguration::LabelVisibility` | `3` | This enum value can be used to hide or show the label of the point. If used together with [QXYSeries::setPointConfiguration](qxyseries#setPointConfiguration), the configuration's value should be boolean. | **See also** [setPointConfiguration](qxyseries#setPointConfiguration)(). Property Documentation ---------------------- ### `[since 6.2]` bestFitLineColor : [QColor](qcolor) This property holds the color of best fit line. This property was introduced in Qt 6.2. **Access functions:** | | | | --- | --- | | QColor | **bestFitLineColor**() const | | void | **setBestFitLineColor**(const QColor &*color*) | **Notifier signal:** | | | | --- | --- | | void | **[bestFitLineColorChanged](qxyseries#bestFitLineColorChanged)**(const QColor &*color*) | **See also** [bestFitLineEquation](qxyseries#bestFitLineEquation) and [bestFitLineVisible](qxyseries#bestFitLineVisible-prop). ### `[since 6.2]` bestFitLineVisible : bool This property holds the visibility of the best fit line. This property is `false` by default. This property was introduced in Qt 6.2. **Access functions:** | | | | --- | --- | | bool | **bestFitLineVisible**() const | | void | **setBestFitLineVisible**(bool *visible* = true) | **Notifier signal:** | | | | --- | --- | | void | **[bestFitLineVisibilityChanged](qxyseries#bestFitLineVisibilityChanged)**(bool *visible*) | **See also** [bestFitLineEquation](qxyseries#bestFitLineEquation). ### color : [QColor](qcolor) This property holds the color of the series. This is the line (pen) color in case of [QLineSeries](qlineseries) or [QSplineSeries](qsplineseries) and the fill (brush) color in case of [QScatterSeries](qscatterseries) or [QAreaSeries](qareaseries). **Access functions:** | | | | --- | --- | | virtual QColor | **[color](qxyseries#color)**() const | | virtual void | **setColor**(const QColor &*color*) | **Notifier signal:** | | | | --- | --- | | void | **[colorChanged](qxyseries#colorChanged)**(QColor *color*) | **See also** [pen](qxyseries#pen)() and [brush](qxyseries#brush)(). ### pointLabelsClipping : bool This property holds the clipping for data point labels. This property is `true` by default. The labels on the edge of the plot area are cut when clipping is enabled. **Access functions:** | | | | --- | --- | | bool | **pointLabelsClipping**() const | | void | **setPointLabelsClipping**(bool *enabled* = true) | **Notifier signal:** | | | | --- | --- | | void | **[pointLabelsClippingChanged](qxyseries#pointLabelsClippingChanged)**(bool *clipping*) | **See also** [pointLabelsVisible](qxyseries#pointLabelsVisible-prop). ### pointLabelsColor : [QColor](qcolor) This property holds the color used for data point labels. By default, the color is the color of the brush defined in theme for labels. **Access functions:** | | | | --- | --- | | QColor | **pointLabelsColor**() const | | void | **setPointLabelsColor**(const QColor &*color*) | **Notifier signal:** | | | | --- | --- | | void | **[pointLabelsColorChanged](qxyseries#pointLabelsColorChanged)**(const QColor &*color*) | **See also** [pointLabelsFormat](qxyseries#pointLabelsFormat-prop). ### pointLabelsFont : [QFont](qfont) This property holds the font used for data point labels. **Access functions:** | | | | --- | --- | | QFont | **pointLabelsFont**() const | | void | **setPointLabelsFont**(const QFont &*font*) | **Notifier signal:** | | | | --- | --- | | void | **[pointLabelsFontChanged](qxyseries#pointLabelsFontChanged)**(const QFont &*font*) | **See also** [pointLabelsFormat](qxyseries#pointLabelsFormat-prop). ### pointLabelsFormat : [QString](qstring) This property holds the format used for showing labels with data points. [QXYSeries](qxyseries) supports the following format tags: | | | | --- | --- | | @xPoint | The x-coordinate of the data point. | | @yPoint | The y-coordinate of the data point. | For example, the following usage of the format tags would produce labels that display the data point shown inside brackets separated by a comma (x, y): ``` series->setPointLabelsFormat("(@xPoint, @yPoint)"); ``` By default, the labels' format is set to `@xPoint, @yPoint`. The labels are shown on the plot area, and the labels on the edge of the plot area are cut. If the points are close to each other, the labels may overlap. **Access functions:** | | | | --- | --- | | QString | **pointLabelsFormat**() const | | void | **setPointLabelsFormat**(const QString &*format*) | **Notifier signal:** | | | | --- | --- | | void | **[pointLabelsFormatChanged](qxyseries#pointLabelsFormatChanged)**(const QString &*format*) | **See also** [pointLabelsVisible](qxyseries#pointLabelsVisible-prop), [pointLabelsFont](qxyseries#pointLabelsFont-prop), and [pointLabelsColor](qxyseries#pointLabelsColor-prop). ### pointLabelsVisible : bool This property holds the visibility of data point labels. This property is `false` by default. **Access functions:** | | | | --- | --- | | bool | **pointLabelsVisible**() const | | void | **setPointLabelsVisible**(bool *visible* = true) | **Notifier signal:** | | | | --- | --- | | void | **[pointLabelsVisibilityChanged](qxyseries#pointLabelsVisibilityChanged)**(bool *visible*) | **See also** [pointLabelsFormat](qxyseries#pointLabelsFormat-prop) and [pointLabelsClipping](qxyseries#pointLabelsClipping-prop). ### pointsVisible : bool This property holds whether the data points are visible and should be drawn. **Access functions:** | | | | --- | --- | | bool | **pointsVisible**() const | | void | **setPointsVisible**(bool *visible* = true) | ### `[since 6.2]` selectedColor : [QColor](qcolor) This property holds the color of the selected points. This is the fill (brush) color of points marked as selected. If not specified, value of [QXYSeries::color](qxyseries#color) is used as default. This property was introduced in Qt 6.2. **Access functions:** | | | | --- | --- | | virtual QColor | **[color](qxyseries#color)**() const | | void | **setSelectedColor**(const QColor &*color*) | **Notifier signal:** | | | | --- | --- | | void | **selectedColorChanged**(const QColor &*color*) | **See also** [color](qxyseries#color). Member Function Documentation ----------------------------- ### `[signal]` void QXYSeries::bestFitLineColorChanged(const [QColor](qcolor) &*color*) This signal is emitted when the color used for the best fit line changes to *color*. **Note:** Notifier signal for property [bestFitLineColor](qxyseries#bestFitLineColor-prop). ### `[signal]` void QXYSeries::bestFitLineVisibilityChanged(bool *visible*) This signal is emitted when the visibility of the best fit line changes to *visible*. **Note:** Notifier signal for property [bestFitLineVisible](qxyseries#bestFitLineVisible-prop). ### `[signal]` void QXYSeries::clicked(const [QPointF](qpointf) &*point*) This signal is emitted when the user triggers a mouse event by clicking the point *point* in the chart. **See also** [pressed](qxyseries#pressed)(), [released](qxyseries#released)(), and [doubleClicked](qxyseries#doubleClicked)(). ### `[signal]` void QXYSeries::colorChanged([QColor](qcolor) *color*) This signal is emitted when the line (pen) color changes to *color*. **Note:** Notifier signal for property [color](qxyseries#color). ### `[signal]` void QXYSeries::doubleClicked(const [QPointF](qpointf) &*point*) This signal is emitted when the user double-clicks the data point *point* in the chart. The *point* is the point where the first press was triggered. **See also** [pressed](qxyseries#pressed)(), [released](qxyseries#released)(), and [clicked](qxyseries#clicked)(). ### `[signal]` void QXYSeries::hovered(const [QPointF](qpointf) &*point*, bool *state*) This signal is emitted when a mouse is hovered over the point *point* in the chart. When the mouse moves over the point, *state* turns `true`, and when the mouse moves away again, it turns `false`. ### `[signal, since 6.2]` void QXYSeries::lightMarkerChanged(const [QImage](qimage) &*lightMarker*) This signal is emitted when the light marker image changes to *lightMarker*. This function was introduced in Qt 6.2. **See also** [QXYSeries::setLightMarker](qxyseries#setLightMarker)() and [;](qromancalendar). ### `[signal]` void QXYSeries::markerSizeChanged([qreal](qtglobal#qreal-typedef) *size*) This signal is emitted when the marker size changes to *size*. ### `[signal]` void QXYSeries::penChanged(const [QPen](qpen) &*pen*) This signal is emitted when the pen changes to *pen*. ### `[signal]` void QXYSeries::pointAdded(int *index*) This signal is emitted when a point is added at the position specified by *index*. **See also** [append](qxyseries#append)() and [insert](qxyseries#insert)(). ### `[signal]` void QXYSeries::pointLabelsClippingChanged(bool *clipping*) This signal is emitted when the clipping of the data point labels changes to *clipping*. **Note:** Notifier signal for property [pointLabelsClipping](qxyseries#pointLabelsClipping-prop). ### `[signal]` void QXYSeries::pointLabelsColorChanged(const [QColor](qcolor) &*color*) This signal is emitted when the color used for data point labels changes to *color*. **Note:** Notifier signal for property [pointLabelsColor](qxyseries#pointLabelsColor-prop). ### `[signal]` void QXYSeries::pointLabelsFontChanged(const [QFont](qfont) &*font*) This signal is emitted when the font used for data point labels changes to *font*. **Note:** Notifier signal for property [pointLabelsFont](qxyseries#pointLabelsFont-prop). ### `[signal]` void QXYSeries::pointLabelsFormatChanged(const [QString](qstring) &*format*) This signal is emitted when the format of data point labels changes to *format*. **Note:** Notifier signal for property [pointLabelsFormat](qxyseries#pointLabelsFormat-prop). ### `[signal]` void QXYSeries::pointLabelsVisibilityChanged(bool *visible*) This signal is emitted when the visibility of the data point labels changes to *visible*. **Note:** Notifier signal for property [pointLabelsVisible](qxyseries#pointLabelsVisible-prop). ### `[signal]` void QXYSeries::pointRemoved(int *index*) This signal is emitted when a point is removed from the position specified by *index*. **See also** [remove](qxyseries#remove)(). ### `[signal]` void QXYSeries::pointReplaced(int *index*) This signal is emitted when a point is replaced at the position specified by *index*. **See also** [replace](qxyseries#replace)(). ### `[signal]` void QXYSeries::pointsRemoved(int *index*, int *count*) This signal is emitted when the number of points specified by *count* is removed starting at the position specified by *index*. **See also** [removePoints](qxyseries#removePoints)() and [clear](qxyseries#clear)(). ### `[signal]` void QXYSeries::pointsReplaced() This signal is emitted when all points are replaced with other points. **See also** [replace](qxyseries#replace)(). ### `[signal]` void QXYSeries::pressed(const [QPointF](qpointf) &*point*) This signal is emitted when the user presses the data point *point* in the chart and holds down the mouse button. **See also** [clicked](qxyseries#clicked)(), [released](qxyseries#released)(), and [doubleClicked](qxyseries#doubleClicked)(). ### `[signal]` void QXYSeries::released(const [QPointF](qpointf) &*point*) This signal is emitted when the user releases the mouse press on the data point specified by *point*. **See also** [pressed](qxyseries#pressed)(), [clicked](qxyseries#clicked)(), and [doubleClicked](qxyseries#doubleClicked)(). ### `[virtual]` QXYSeries::~QXYSeries() Deletes the series. Series added to [QChart](qchart) instances are owned by them, and are deleted when the [QChart](qchart) instances are deleted. ### void QXYSeries::append([qreal](qtglobal#qreal-typedef) *x*, [qreal](qtglobal#qreal-typedef) *y*) Adds the data point with the coordinates *x* and *y* to the series. ### void QXYSeries::append(const [QPointF](qpointf) &*point*) This is an overloaded function. Adds the data point *point* to the series. ### void QXYSeries::append(const [QList](qlist)<[QPointF](qpointf)> &*points*) This is an overloaded function. Adds the list of data points specified by *points* to the series. ### const [QPointF](qpointf) &QXYSeries::at(int *index*) const Returns the data point at the position specified by *index* in the internal series of points. ### `[since 6.2]` QPair<[qreal](qtglobal#qreal-typedef), [qreal](qtglobal#qreal-typedef)> QXYSeries::bestFitLineEquation(bool &*ok*) const Returns a pair of numbers where the first number is a slope factor and the second number is intercept of a linear function for a best fit line. Those factors are calculated using Least Squares Method based on points passed to the series. Parameter *ok* is used to report a failure by setting its value to `false` and to report a success by setting its value to `true`. This function was introduced in Qt 6.2. **See also** [QXYSeries::bestFitLineVisible](qxyseries#bestFitLineVisible-prop)(). ### [QBrush](qbrush) QXYSeries::brush() const Returns the brush used to fill the data points for the series. **See also** [setBrush](qxyseries#setBrush)(). ### void QXYSeries::clear() Removes all points from the series. **See also** [pointsRemoved](qxyseries#pointsRemoved)(). ### `[since 6.2]` void QXYSeries::clearPointConfiguration(const int *index*) Removes the configuration of a point located at *index* and restores the default look derived from the series' settings. **Note:** It doesn't affect the configuration of other points. This function was introduced in Qt 6.2. **See also** [clearPointsConfiguration](qxyseries#clearPointsConfiguration)() and [setPointConfiguration](qxyseries#setPointConfiguration)(). ### `[since 6.2]` void QXYSeries::clearPointConfiguration(const int *index*, const [QXYSeries::PointConfiguration](qxyseries#PointConfiguration-enum) *key*) Removes the configuration property identified by *key* from the point at *index* and restores the default look derived from the series' settings. Removes the configuration type, such as color or size, specified by *key* from the point at *index* with configuration customizations, allowing that configuration property to be rendered as the default specified in the series' properties. **Note:** It doesn't affect the configuration of other points. This function was introduced in Qt 6.2. **See also** [clearPointsConfiguration](qxyseries#clearPointsConfiguration)() and [setPointConfiguration](qxyseries#setPointConfiguration)(). ### `[since 6.2]` void QXYSeries::clearPointsConfiguration() Removes the configuration of all points in the series and restores the default look derived from the series' settings. This function was introduced in Qt 6.2. **See also** [setPointConfiguration](qxyseries#setPointConfiguration)(). ### `[since 6.2]` void QXYSeries::clearPointsConfiguration(const [QXYSeries::PointConfiguration](qxyseries#PointConfiguration-enum) *key*) Removes the configuration property identified by *key* from all points and restores the default look derived from the series' settings. Removes the configuration type, such as color or size, specified by *key* from all points with configuration customizations, allowing that configuration property to be rendered as the default specified in the series properties. This function was introduced in Qt 6.2. **See also** [clearPointsConfiguration](qxyseries#clearPointsConfiguration)() and [setPointConfiguration](qxyseries#setPointConfiguration)(). ### `[since 6.2]` void QXYSeries::colorBy(const [QList](qlist)<[qreal](qtglobal#qreal-typedef)> &*sourceData*, const [QLinearGradient](qlineargradient) &*gradient* = QLinearGradient()) Sets the points' color according to a passed list of values. Values from *sourceData* are sorted and mapped to the *gradient*. If the series has a [QColorAxis](qcoloraxis) attached, then a gradient from the axis is going to be used. This function was introduced in Qt 6.2. **See also** [setPointConfiguration](qxyseries#setPointConfiguration)(), [pointConfiguration](qxyseries#pointConfiguration)(), and [QColorAxis](qcoloraxis). ### int QXYSeries::count() const Returns the number of data points in a series. ### `[since 6.2]` void QXYSeries::deselectAllPoints() Deselects all points in the series. **Note:** Emits QXYSeries::selectedPointsChanged This function was introduced in Qt 6.2. **See also** [setPointSelected](qxyseries#setPointSelected)(). ### `[since 6.2]` void QXYSeries::deselectPoint(int *index*) Deselects point at given *index*. **Note:** Emits QXYSeries::selectedPointsChanged This function was introduced in Qt 6.2. **See also** [setPointSelected](qxyseries#setPointSelected)(). ### `[since 6.2]` void QXYSeries::deselectPoints(const [QList](qlist)<int> &*indexes*) Marks multiple points passed in a *indexes* list as deselected. **Note:** Emits QXYSeries::selectedPointsChanged This function was introduced in Qt 6.2. **See also** [setPointSelected](qxyseries#setPointSelected)(). ### void QXYSeries::insert(int *index*, const [QPointF](qpointf) &*point*) Inserts the data point *point* in the series at the position specified by *index*. **See also** [pointAdded](qxyseries#pointAdded)(). ### `[since 6.2]` bool QXYSeries::isPointSelected(int *index*) Returns true if point at given *index* is among selected points and false otherwise. **Note:** Selected points are drawn using the selected color if it was specified. This function was introduced in Qt 6.2. **See also** [selectedPoints](qxyseries#selectedPoints)(), [setPointSelected](qxyseries#setPointSelected)(), and [setSelectedColor](qxyseries#selectedColor-prop)(). ### `[since 6.2]` const [QImage](qimage) &QXYSeries::lightMarker() const Gets the image used for drawing markers on each point of the series. The default value is QImage(), meaning no light marker will be painted. The light markers visualize the data points of this series and as such are an alternative to [setPointsVisible](qxyseries#pointsVisible-prop)(true). Both features can be enabled independently from each other. Unlike the elements of [QScatterSeries](qscatterseries) the light markers are not represented by [QGraphicsItem](qgraphicsitem), but are just painted (no objects created). However, the mouse-event-signals of [QXYSeries](qxyseries) behave the same way, meaning that you'll get the exact domain value of the point if you click/press/hover the light marker. You'll still get the in between domain value if you click on the line. The light markers are above the line in terms of painting as well as events. This function was introduced in Qt 6.2. **See also** [QXYSeries::setLightMarker](qxyseries#setLightMarker)(). ### `[since 6.2]` [qreal](qtglobal#qreal-typedef) QXYSeries::markerSize() const Gets the size of the marker used to render points in the series. The default size depends on the specific [QXYSeries](qxyseries) type. [QScatterSeries](qscatterseries) has a default of 15.0 [QLineSeries](qlineseries) has a default of the series pen size \* 1.5 This function was introduced in Qt 6.2. **See also** [setMarkerSize](qxyseries#setMarkerSize)() and [QScatterSeries::markerSize](qscatterseries#markerSize-prop). ### [QPen](qpen) QXYSeries::pen() const Returns the pen used to draw the outline of the data points for the series. **See also** [setPen](qxyseries#setPen)(). ### `[since 6.2]` [QHash](qhash)<[QXYSeries::PointConfiguration](qxyseries#PointConfiguration-enum), [QVariant](qvariant)> QXYSeries::pointConfiguration(const int *index*) const Returns a map representing the configuration of a point at *index*. With points configuration you can change various aspects of each point's look. This function was introduced in Qt 6.2. **See also** [setPointConfiguration](qxyseries#setPointConfiguration)(). ### [QList](qlist)<[QPointF](qpointf)> QXYSeries::points() const Returns the points in the series. ### `[since 6.2]` [QHash](qhash)<int, [QHash](qhash)<[QXYSeries::PointConfiguration](qxyseries#PointConfiguration-enum), [QVariant](qvariant)> > QXYSeries::pointsConfiguration() const Returns a map with points' indexes as keys and points' configuration as values. This function was introduced in Qt 6.2. **See also** [setPointsConfiguration](qxyseries#setPointsConfiguration)(), [setPointConfiguration](qxyseries#setPointConfiguration)(), and [pointConfiguration](qxyseries#pointConfiguration)(). ### void QXYSeries::remove([qreal](qtglobal#qreal-typedef) *x*, [qreal](qtglobal#qreal-typedef) *y*) Removes the point that has the coordinates *x* and *y* from the series. **See also** [pointRemoved](qxyseries#pointRemoved)(). ### void QXYSeries::remove(const [QPointF](qpointf) &*point*) Removes the data point *point* from the series. **See also** [pointRemoved](qxyseries#pointRemoved)(). ### void QXYSeries::remove(int *index*) Removes the point at the position specified by *index* from the series. **See also** [pointRemoved](qxyseries#pointRemoved)(). ### void QXYSeries::removePoints(int *index*, int *count*) Removes the number of points specified by *count* from the series starting at the position specified by *index*. **See also** [pointsRemoved](qxyseries#pointsRemoved)(). ### void QXYSeries::replace([qreal](qtglobal#qreal-typedef) *oldX*, [qreal](qtglobal#qreal-typedef) *oldY*, [qreal](qtglobal#qreal-typedef) *newX*, [qreal](qtglobal#qreal-typedef) *newY*) Replaces the point with the coordinates *oldX* and *oldY* with the point with the coordinates *newX* and *newY*. Does nothing if the old point does not exist. **See also** [pointReplaced](qxyseries#pointReplaced)(). ### void QXYSeries::replace(const [QPointF](qpointf) &*oldPoint*, const [QPointF](qpointf) &*newPoint*) Replaces the point specified by *oldPoint* with the one specified by *newPoint*. **See also** [pointReplaced](qxyseries#pointReplaced)(). ### void QXYSeries::replace(int *index*, [qreal](qtglobal#qreal-typedef) *newX*, [qreal](qtglobal#qreal-typedef) *newY*) Replaces the point at the position specified by *index* with the point that has the coordinates *newX* and *newY*. **See also** [pointReplaced](qxyseries#pointReplaced)(). ### void QXYSeries::replace(int *index*, const [QPointF](qpointf) &*newPoint*) Replaces the point at the position specified by *index* with the point specified by *newPoint*. **See also** [pointReplaced](qxyseries#pointReplaced)(). ### void QXYSeries::replace(const [QList](qlist)<[QPointF](qpointf)> &*points*) Replaces the current points with the points specified by *points*. **Note:** This is much faster than replacing data points one by one, or first clearing all data, and then appending the new data. Emits [QXYSeries::pointsReplaced](qxyseries#pointsReplaced)() when the points have been replaced. **See also** [pointsReplaced](qxyseries#pointsReplaced)(). ### `[since 6.2]` void QXYSeries::selectAllPoints() Marks all points in the series as selected, **Note:** Emits QXYSeries::selectedPointsChanged This function was introduced in Qt 6.2. **See also** [setPointSelected](qxyseries#setPointSelected)(). ### `[since 6.2]` void QXYSeries::selectPoint(int *index*) Marks point at *index* as selected. **Note:** Emits QXYSeries::selectedPointsChanged This function was introduced in Qt 6.2. **See also** [setPointSelected](qxyseries#setPointSelected)(). ### `[since 6.2]` void QXYSeries::selectPoints(const [QList](qlist)<int> &*indexes*) Marks multiple points passed in a *indexes* list as selected. **Note:** Emits QXYSeries::selectedPointsChanged This function was introduced in Qt 6.2. **See also** [setPointSelected](qxyseries#setPointSelected)(). ### `[since 6.2]` const [QImage](qimage) &QXYSeries::selectedLightMarker() const Returns the image used for drawing markers on selected series' points. The default value is QImage(), meaning usual [lightMarker](qxyseries#lightMarker)() will be painted. This is equivalent to [selectedColor](qxyseries#selectedColor-prop) if you prefer light markers over normal points, but still want to distinguish selected points. This function was introduced in Qt 6.2. **See also** [setSelectedLightMarker](qxyseries#setSelectedLightMarker)(), [lightMarker](qxyseries#lightMarker)(), [selectedColor](qxyseries#selectedColor-prop), and [setPointSelected](qxyseries#setPointSelected)(). ### `[since 6.2]` [QList](qlist)<int> QXYSeries::selectedPoints() const Returns a list of points indexes marked as selected. Selected points are visible regardless of points visibility. This function was introduced in Qt 6.2. **See also** [setPointSelected](qxyseries#setPointSelected)() and [pointsVisible](qxyseries#pointsVisible-prop)(). ### `[virtual]` void QXYSeries::setBrush(const [QBrush](qbrush) &*brush*) Sets the brush used for drawing points on the chart to *brush*. If the brush is not defined, the brush from the chart theme setting is used. **See also** [brush](qxyseries#brush)() and [QChart::setTheme](qchart#theme-prop)(). ### `[since 6.2]` void QXYSeries::setLightMarker(const [QImage](qimage) &*lightMarker*) Sets the image used for drawing markers on each point of the series as the value of *lightMarker*. The default value is a default-QImage() ([QImage::isNull](qimage#isNull)() == true), meaning no light marker will be painted. You can reset back to default (disabled) by calling this function with a null [QImage](qimage) (QImage()). The light markers visualize the data points of this series and as such are an alternative to `setPointsVisible(true)`. If a light marker is set with this method, visible points as set with `setPointsVisible(true)` are not displayed. Unlike the elements of [QScatterSeries](qscatterseries) the light markers are not represented by [QGraphicsItem](qgraphicsitem), but are just painted (no objects created). However, the mouse-event-signals of [QXYSeries](qxyseries) behave the same way, meaning that you'll get the exact domain value of the point if you click/press/hover the light marker. You'll still get the in between domain value if you click on the line. The light markers are above the line in terms of painting as well as events. This function was introduced in Qt 6.2. **See also** [QXYSeries::lightMarker](qxyseries#lightMarker)(). ### `[since 6.2]` void QXYSeries::setMarkerSize([qreal](qtglobal#qreal-typedef) *size*) Sets the *size* of the marker used to render points in the series. The default size is 15.0. This function was introduced in Qt 6.2. **See also** [QScatterSeries::markerSize](qscatterseries#markerSize-prop). ### `[virtual]` void QXYSeries::setPen(const [QPen](qpen) &*pen*) Sets the pen used for drawing points on the chart to *pen*. If the pen is not defined, the pen from the chart theme is used. **See also** [pen](qxyseries#pen)() and [QChart::setTheme](qchart#theme-prop)(). ### `[since 6.2]` void QXYSeries::setPointConfiguration(const int *index*, const [QHash](qhash)<[QXYSeries::PointConfiguration](qxyseries#PointConfiguration-enum), [QVariant](qvariant)> &*configuration*) Enables customizing the appearance of a point located at *index* with desired *configuration*. With points configuration you can change various aspects of every point's appearance. A point's configuration is represented as a hash map with [QXYSeries::pointConfiguration](qxyseries#pointConfiguration) keys and [QVariant](qvariant) values. For example: ``` QLineSeries *series = new QLineSeries(); series->setName("Customized serie"); series->setPointsVisible(true); *series << QPointF(0, 6) << QPointF(2, 4) << QPointF(3, 6) << QPointF(7, 4) << QPointF(10, 5) << QPointF(11, 1) << QPointF(13, 3) << QPointF(17, 6) << QPointF(18, 3) << QPointF(20, 2); QChart *chart = new QChart(); chart->addSeries(series); chart->createDefaultAxes(); QHash<QXYSeries::PointConfiguration, QVariant> conf; conf[QXYSeries::PointConfiguration::Color] = QColor(Qt::red); conf[QXYSeries::PointConfiguration::Size] = 8; conf[QXYSeries::PointConfiguration::LabelVisibility] = true; series->setPointConfiguration(4, conf); conf.remove(QXYSeries::PointConfiguration::LabelVisibility); series->setPointConfiguration(6, conf); ``` In this example, you can see a default [QLineSeries](qlineseries) with 10 points and with changed configuration of two points. Both changed points are red and visibly bigger than the others with a look derived from series. By default, points don't have labels, but the point at index 4 has the label thanks to the [QXYSeries::PointConfiguration::LabelVisibility](qxyseries#PointConfiguration-enum) configuration value. Below is an example of a chart created in this way: This function was introduced in Qt 6.2. **See also** [pointConfiguration](qxyseries#pointConfiguration)(), [pointsConfiguration](qxyseries#pointsConfiguration)(), and [clearPointsConfiguration](qxyseries#clearPointsConfiguration)(). ### `[since 6.2]` void QXYSeries::setPointConfiguration(const int *index*, const [QXYSeries::PointConfiguration](qxyseries#PointConfiguration-enum) *key*, const [QVariant](qvariant) &*value*) Enables customizing a particular aspect of a point's configuration. **Note:** Points configuration concept provides a flexible way to configure various aspects of a point's appearance. Thus, values need to have an elastic type such as [QVariant](qvariant). See [QXYSeries::PointConfiguration](qxyseries#PointConfiguration-enum) to see what *value* should be passed for certain *key*. This function was introduced in Qt 6.2. **See also** [pointsConfiguration](qxyseries#pointsConfiguration)(). ### `[since 6.2]` void QXYSeries::setPointSelected(int *index*, bool *selected*) Marks point at given *index* as either selected or deselected as specified by *selected*. **Note:** Selected points are drawn using the selected color if it was specified. Emits QXYSeries::selectedPointsChanged This function was introduced in Qt 6.2. **See also** [isPointSelected](qxyseries#isPointSelected)(), setPointSelected(), and [setSelectedColor](qxyseries#selectedColor-prop)(). ### `[since 6.2]` void QXYSeries::setPointsConfiguration(const [QHash](qhash)<int, [QHash](qhash)<[QXYSeries::PointConfiguration](qxyseries#PointConfiguration-enum), [QVariant](qvariant)> > &*pointsConfiguration*) Enables customizing the configuration of multiple points as specified by *pointsConfiguration*. This function was introduced in Qt 6.2. **See also** [pointsConfiguration](qxyseries#pointsConfiguration)(). ### `[since 6.2]` void QXYSeries::setSelectedLightMarker(const [QImage](qimage) &*selectedLightMarker*) Sets the image used for drawing markers on selected series's points to *selectedLightMarker*. The default value is QImage(), meaning usual [lightMarker](qxyseries#lightMarker)() will be painted. This is an equivalent for [selectedColor](qxyseries#selectedColor-prop) if you prefer light markers over normal points, but still want to distinguish selected points. This function was introduced in Qt 6.2. **See also** [selectedLightMarker](qxyseries#selectedLightMarker)(), [lightMarker](qxyseries#lightMarker)(), [selectedColor](qxyseries#selectedColor-prop), and [setPointSelected](qxyseries#setPointSelected)(). ### `[since 6.2]` void QXYSeries::sizeBy(const [QList](qlist)<[qreal](qtglobal#qreal-typedef)> &*sourceData*, const [qreal](qtglobal#qreal-typedef) *minSize*, const [qreal](qtglobal#qreal-typedef) *maxSize*) Sets the points' sizes according to a passed list of values. Values from *sourceData* are sorted and mapped to a point size which is between *minSize* and *maxSize*. **Note:** If *sourceData* length is smaller than number of points in the series, then size of the points at the end of the series will stay the same. This function was introduced in Qt 6.2. **See also** [setPointConfiguration](qxyseries#setPointConfiguration)() and [pointConfiguration](qxyseries#pointConfiguration)(). ### `[since 6.2]` void QXYSeries::toggleSelection(const [QList](qlist)<int> &*indexes*) Changes selection state of points at given *indexes* to the opposite one. Makes **Note:** Emits QXYSeries::selectedPointsChanged This function was introduced in Qt 6.2. **See also** [setPointSelected](qxyseries#setPointSelected)(). ### QXYSeries &QXYSeries::operator<<(const [QPointF](qpointf) &*point*) Stream operator for adding the data point *point* to the series. **See also** [append](qxyseries#append)(). ### QXYSeries &QXYSeries::operator<<(const [QList](qlist)<[QPointF](qpointf)> &*points*) Stream operator for adding the list of data points specified by *points* to the series. **See also** [append](qxyseries#append)().
programming_docs
qt Changes to Qt SerialPort Changes to Qt SerialPort ======================== Qt 6 is a result of the conscious effort to make the framework more efficient and easy to use. We try to maintain binary and source compatibility for all the public APIs in each release. But some changes were inevitable in an effort to make Qt a better framework. In this topic we summarize those changes in Qt SerialPort module, and provide guidance to handle them. Changes overview ---------------- The Qt SerialPort module is generally speaking source compatible with the Qt5 version and users of the library should be able to continue with no or minor changes to their project. Build system ------------ As with Qt6 in general, the Qt SerialPort module has cmake support in addition to qmake. qt QDir Class QDir Class ========== The QDir class provides access to directory structures and their contents. [More...](#details) | | | | --- | --- | | Header: | #include <QDir> | | CMake: | find\_package(Qt6 COMPONENTS Core REQUIRED) target\_link\_libraries(mytarget PRIVATE Qt6::Core) | | qmake: | QT += core | * [List of all members, including inherited members](https://doc.qt.io/qt-6.2/qdir-members.html) **Note:** All functions in this class are [reentrant](17-qdoc-commands-thread#reentrant). Public Types ------------ | | | | --- | --- | | enum | **[Filter](qdir#Filter-enum)** { Dirs, AllDirs, Files, Drives, NoSymLinks, …, CaseSensitive } | | flags | **[Filters](qdir#Filter-enum)** | | enum | **[SortFlag](qdir#SortFlag-enum)** { Name, Time, Size, Type, Unsorted, …, LocaleAware } | | flags | **[SortFlags](qdir#SortFlag-enum)** | Public Functions ---------------- | | | | --- | --- | | | **[QDir](qdir#QDir-4)**(const std::filesystem::path &*path*, const QString &*nameFilter*, QDir::SortFlags *sort* = SortFlags(Name | IgnoreCase), QDir::Filters *filters* = AllEntries) | | | **[QDir](qdir#QDir-3)**(const std::filesystem::path &*path*) | | | **[QDir](qdir#QDir-2)**(const QString &*path*, const QString &*nameFilter*, QDir::SortFlags *sort* = SortFlags(Name | IgnoreCase), QDir::Filters *filters* = AllEntries) | | | **[QDir](qdir#QDir-1)**(const QString &*path* = QString()) | | | **[QDir](qdir#QDir)**(const QDir &*dir*) | | QDir & | **[operator=](qdir#operator-eq-1)**(QDir &&*other*) | | QDir & | **[operator=](qdir#operator-eq)**(const QDir &*dir*) | | | **[~QDir](qdir#dtor.QDir)**() | | QString | **[absoluteFilePath](qdir#absoluteFilePath)**(const QString &*fileName*) const | | QString | **[absolutePath](qdir#absolutePath)**() const | | QString | **[canonicalPath](qdir#canonicalPath)**() const | | bool | **[cd](qdir#cd)**(const QString &*dirName*) | | bool | **[cdUp](qdir#cdUp)**() | | uint | **[count](qdir#count)**() const | | QString | **[dirName](qdir#dirName)**() const | | QFileInfoList | **[entryInfoList](qdir#entryInfoList)**(const QStringList &*nameFilters*, QDir::Filters *filters* = NoFilter, QDir::SortFlags *sort* = NoSort) const | | QFileInfoList | **[entryInfoList](qdir#entryInfoList-1)**(QDir::Filters *filters* = NoFilter, QDir::SortFlags *sort* = NoSort) const | | QStringList | **[entryList](qdir#entryList)**(const QStringList &*nameFilters*, QDir::Filters *filters* = NoFilter, QDir::SortFlags *sort* = NoSort) const | | QStringList | **[entryList](qdir#entryList-1)**(QDir::Filters *filters* = NoFilter, QDir::SortFlags *sort* = NoSort) const | | bool | **[exists](qdir#exists)**(const QString &*name*) const | | bool | **[exists](qdir#exists-1)**() const | | QString | **[filePath](qdir#filePath)**(const QString &*fileName*) const | | std::filesystem::path | **[filesystemAbsolutePath](qdir#filesystemAbsolutePath)**() const | | std::filesystem::path | **[filesystemCanonicalPath](qdir#filesystemCanonicalPath)**() const | | std::filesystem::path | **[filesystemPath](qdir#filesystemPath)**() const | | QDir::Filters | **[filter](qdir#filter)**() const | | bool | **[isAbsolute](qdir#isAbsolute)**() const | | bool | **[isEmpty](qdir#isEmpty)**(QDir::Filters *filters* = Filters(AllEntries | NoDotAndDotDot)) const | | bool | **[isReadable](qdir#isReadable)**() const | | bool | **[isRelative](qdir#isRelative)**() const | | bool | **[isRoot](qdir#isRoot)**() const | | bool | **[makeAbsolute](qdir#makeAbsolute)**() | | bool | **[mkdir](qdir#mkdir)**(const QString &*dirName*) const | | bool | **[mkpath](qdir#mkpath)**(const QString &*dirPath*) const | | QStringList | **[nameFilters](qdir#nameFilters)**() const | | QString | **[path](qdir#path)**() const | | void | **[refresh](qdir#refresh)**() const | | QString | **[relativeFilePath](qdir#relativeFilePath)**(const QString &*fileName*) const | | bool | **[remove](qdir#remove)**(const QString &*fileName*) | | bool | **[removeRecursively](qdir#removeRecursively)**() | | bool | **[rename](qdir#rename)**(const QString &*oldName*, const QString &*newName*) | | bool | **[rmdir](qdir#rmdir)**(const QString &*dirName*) const | | bool | **[rmpath](qdir#rmpath)**(const QString &*dirPath*) const | | void | **[setFilter](qdir#setFilter)**(QDir::Filters *filters*) | | void | **[setNameFilters](qdir#setNameFilters)**(const QStringList &*nameFilters*) | | void | **[setPath](qdir#setPath)**(const QString &*path*) | | void | **[setPath](qdir#setPath-1)**(const std::filesystem::path &*path*) | | void | **[setSorting](qdir#setSorting)**(QDir::SortFlags *sort*) | | QDir::SortFlags | **[sorting](qdir#sorting)**() const | | void | **[swap](qdir#swap)**(QDir &*other*) | | bool | **[operator!=](qdir#operator-not-eq)**(const QDir &*dir*) const | | bool | **[operator==](qdir#operator-eq-eq)**(const QDir &*dir*) const | | QString | **[operator[]](qdir#operator-5b-5d)**(int *pos*) const | Static Public Members --------------------- | | | | --- | --- | | void | **[addSearchPath](qdir#addSearchPath)**(const QString &*prefix*, const QString &*path*) | | void | **[addSearchPath](qdir#addSearchPath-1)**(const QString &*prefix*, const std::filesystem::path &*path*) | | QString | **[cleanPath](qdir#cleanPath)**(const QString &*path*) | | QDir | **[current](qdir#current)**() | | QString | **[currentPath](qdir#currentPath)**() | | QFileInfoList | **[drives](qdir#drives)**() | | QString | **[fromNativeSeparators](qdir#fromNativeSeparators)**(const QString &*pathName*) | | QDir | **[home](qdir#home)**() | | QString | **[homePath](qdir#homePath)**() | | bool | **[isAbsolutePath](qdir#isAbsolutePath)**(const QString &*path*) | | bool | **[isRelativePath](qdir#isRelativePath)**(const QString &*path*) | | QChar | **[listSeparator](qdir#listSeparator)**() | | bool | **[match](qdir#match)**(const QString &*filter*, const QString &*fileName*) | | bool | **[match](qdir#match-1)**(const QStringList &*filters*, const QString &*fileName*) | | QDir | **[root](qdir#root)**() | | QString | **[rootPath](qdir#rootPath)**() | | QStringList | **[searchPaths](qdir#searchPaths)**(const QString &*prefix*) | | QChar | **[separator](qdir#separator)**() | | bool | **[setCurrent](qdir#setCurrent)**(const QString &*path*) | | void | **[setSearchPaths](qdir#setSearchPaths)**(const QString &*prefix*, const QStringList &*searchPaths*) | | QDir | **[temp](qdir#temp)**() | | QString | **[tempPath](qdir#tempPath)**() | | QString | **[toNativeSeparators](qdir#toNativeSeparators)**(const QString &*pathName*) | Macros ------ | | | | --- | --- | | void | **[Q\_CLEANUP\_RESOURCE](qdir#Q_CLEANUP_RESOURCE)**(*name*) | | void | **[Q\_INIT\_RESOURCE](qdir#Q_INIT_RESOURCE)**(*name*) | Detailed Description -------------------- A QDir is used to manipulate path names, access information regarding paths and files, and manipulate the underlying file system. It can also be used to access Qt's [resource system](resources). Qt uses "/" as a universal directory separator in the same way that "/" is used as a path separator in URLs. If you always use "/" as a directory separator, Qt will translate your paths to conform to the underlying operating system. A QDir can point to a file using either a relative or an absolute path. Absolute paths begin with the directory separator (optionally preceded by a drive specification under Windows). Relative file names begin with a directory name or a file name and specify a path relative to the current directory. Examples of absolute paths: ``` QDir("/home/user/Documents") QDir("C:/Documents and Settings") ``` On Windows, the second example above will be translated to `C:\Documents and Settings` when used to access files. Examples of relative paths: ``` QDir("images/landscape.png") ``` You can use the [isRelative](qdir#isRelative)() or [isAbsolute](qdir#isAbsolute)() functions to check if a QDir is using a relative or an absolute file path. Call [makeAbsolute](qdir#makeAbsolute)() to convert a relative QDir to an absolute one. **Note:** Paths starting with a colon (*:*) are always considered absolute, as they denote a [QResource](qresource). ### Navigation and Directory Operations A directory's path can be obtained with the [path](qdir#path)() function, and a new path set with the [setPath](qdir#setPath)() function. The absolute path to a directory is found by calling [absolutePath](qdir#absolutePath)(). The name of a directory is found using the [dirName](qdir#dirName)() function. This typically returns the last element in the absolute path that specifies the location of the directory. However, it can also return "." if the QDir represents the current directory. ``` QDir("Documents/Letters/Applications").dirName() // "Applications" QDir().dirName() // "." ``` The path for a directory can also be changed with the [cd](qdir#cd)() and [cdUp](qdir#cdUp)() functions, both of which operate like familiar shell commands. When [cd](qdir#cd)() is called with the name of an existing directory, the QDir object changes directory so that it represents that directory instead. The [cdUp](qdir#cdUp)() function changes the directory of the QDir object so that it refers to its parent directory; i.e. cd("..") is equivalent to [cdUp](qdir#cdUp)(). Directories can be created with [mkdir](qdir#mkdir)(), renamed with [rename](qdir#rename)(), and removed with [rmdir](qdir#rmdir)(). You can test for the presence of a directory with a given name by using [exists](qdir#exists-1)(), and the properties of a directory can be tested with [isReadable](qdir#isReadable)(), [isAbsolute](qdir#isAbsolute)(), [isRelative](qdir#isRelative)(), and [isRoot](qdir#isRoot)(). The [refresh](qdir#refresh)() function re-reads the directory's data from disk. ### Files and Directory Contents Directories contain a number of entries, representing files, directories, and symbolic links. The number of entries in a directory is returned by [count](qdir#count)(). A string list of the names of all the entries in a directory can be obtained with [entryList](qdir#entryList)(). If you need information about each entry, use [entryInfoList](qdir#entryInfoList)() to obtain a list of [QFileInfo](qfileinfo) objects. Paths to files and directories within a directory can be constructed using [filePath](qdir#filePath)() and [absoluteFilePath](qdir#absoluteFilePath)(). The [filePath](qdir#filePath)() function returns a path to the specified file or directory relative to the path of the QDir object; [absoluteFilePath](qdir#absoluteFilePath)() returns an absolute path to the specified file or directory. Neither of these functions checks for the existence of files or directory; they only construct paths. ``` QDir directory("Documents/Letters"); QString path = directory.filePath("contents.txt"); QString absolutePath = directory.absoluteFilePath("contents.txt"); ``` Files can be removed by using the [remove](qdir#remove)() function. Directories cannot be removed in the same way as files; use [rmdir](qdir#rmdir)() to remove them instead. It is possible to reduce the number of entries returned by [entryList](qdir#entryList)() and [entryInfoList](qdir#entryInfoList)() by applying filters to a QDir object. You can apply a name filter to specify a pattern with wildcards that file names need to match, an attribute filter that selects properties of entries and can distinguish between files and directories, and a sort order. Name filters are lists of strings that are passed to [setNameFilters](qdir#setNameFilters)(). Attribute filters consist of a bitwise OR combination of Filters, and these are specified when calling [setFilter](qdir#setFilter)(). The sort order is specified using [setSorting](qdir#setSorting)() with a bitwise OR combination of [SortFlags](qdir#SortFlag-enum). You can test to see if a filename matches a filter using the [match](qdir#match)() function. Filter and sort order flags may also be specified when calling [entryList](qdir#entryList)() and [entryInfoList](qdir#entryInfoList)() in order to override previously defined behavior. ### The Current Directory and Other Special Paths Access to some common directories is provided with a number of static functions that return QDir objects. There are also corresponding functions for these that return strings: | QDir | [QString](qstring) | Return Value | | --- | --- | --- | | [current](qdir#current)() | [currentPath](qdir#currentPath)() | The application's working directory | | [home](qdir#home)() | [homePath](qdir#homePath)() | The user's home directory | | [root](qdir#root)() | [rootPath](qdir#rootPath)() | The root directory | | [temp](qdir#temp)() | [tempPath](qdir#tempPath)() | The system's temporary directory | The [setCurrent](qdir#setCurrent)() static function can also be used to set the application's working directory. If you want to find the directory containing the application's executable, see [QCoreApplication::applicationDirPath](qcoreapplication#applicationDirPath)(). The [drives](qdir#drives)() static function provides a list of root directories for each device that contains a filing system. On Unix systems this returns a list containing a single root directory "/"; on Windows the list will usually contain `C:/`, and possibly other drive letters such as `D:/`, depending on the configuration of the user's system. ### Path Manipulation and Strings Paths containing "." elements that reference the current directory at that point in the path, ".." elements that reference the parent directory, and symbolic links can be reduced to a canonical form using the [canonicalPath](qdir#canonicalPath)() function. Paths can also be simplified by using [cleanPath](qdir#cleanPath)() to remove redundant "/" and ".." elements. It is sometimes necessary to be able to show a path in the native representation for the user's platform. The static [toNativeSeparators](qdir#toNativeSeparators)() function returns a copy of the specified path in which each directory separator is replaced by the appropriate separator for the underlying operating system. ### Examples Check if a directory exists: ``` QDir dir("example"); if (!dir.exists()) qWarning("Cannot find the example directory"); ``` (We could also use the static convenience function [QFile::exists](qfile#exists-1)().) Traversing directories and reading a file: ``` QDir dir = QDir::root(); // "/" if (!dir.cd("tmp")) { // "/tmp" qWarning("Cannot find the \"/tmp\" directory"); } else { QFile file(dir.filePath("ex1.txt")); // "/tmp/ex1.txt" if (!file.open(QIODevice::ReadWrite)) qWarning("Cannot create the file %s", file.name()); } ``` A program that lists all the files in the current directory (excluding symbolic links), sorted by size, smallest first: ``` #include <QDir> #include <iostream> int main(int argc, char *argv[]) { QCoreApplication app(argc, argv); QDir dir; dir.setFilter(QDir::Files | QDir::Hidden | QDir::NoSymLinks); dir.setSorting(QDir::Size | QDir::Reversed); QFileInfoList list = dir.entryInfoList(); std::cout << " Bytes Filename" << std::endl; for (int i = 0; i < list.size(); ++i) { QFileInfo fileInfo = list.at(i); std::cout << qPrintable(QString("%1 %2").arg(fileInfo.size(), 10) .arg(fileInfo.fileName())); std::cout << std::endl; } return 0; } ``` **See also** [QFileInfo](qfileinfo), [QFile](qfile), [QFileDialog](qfiledialog), [QCoreApplication::applicationDirPath](qcoreapplication#applicationDirPath)(), and [Find Files Example](https://doc.qt.io/qt-6.2/qtwidgets-dialogs-findfiles-example.html). Member Type Documentation ------------------------- ### enum QDir::Filterflags QDir::Filters This enum describes the filtering options available to [QDir](qdir); e.g. for [entryList](qdir#entryList)() and [entryInfoList](qdir#entryInfoList)(). The filter value is specified by combining values from the following list using the bitwise OR operator: | Constant | Value | Description | | --- | --- | --- | | `QDir::Dirs` | `0x001` | List directories that match the filters. | | `QDir::AllDirs` | `0x400` | List all directories; i.e. don't apply the filters to directory names. | | `QDir::Files` | `0x002` | List files. | | `QDir::Drives` | `0x004` | List disk drives (ignored under Unix). | | `QDir::NoSymLinks` | `0x008` | Do not list symbolic links (ignored by operating systems that don't support symbolic links). | | `QDir::NoDotAndDotDot` | `NoDot | NoDotDot` | Do not list the special entries "." and "..". | | `QDir::NoDot` | `0x2000` | Do not list the special entry ".". | | `QDir::NoDotDot` | `0x4000` | Do not list the special entry "..". | | `QDir::AllEntries` | `Dirs | Files | Drives` | List directories, files, drives and symlinks (this does not list broken symlinks unless you specify System). | | `QDir::Readable` | `0x010` | List files for which the application has read access. The Readable value needs to be combined with Dirs or Files. | | `QDir::Writable` | `0x020` | List files for which the application has write access. The Writable value needs to be combined with Dirs or Files. | | `QDir::Executable` | `0x040` | List files for which the application has execute access. The Executable value needs to be combined with Dirs or Files. | | `QDir::Modified` | `0x080` | Only list files that have been modified (ignored on Unix). | | `QDir::Hidden` | `0x100` | List hidden files (on Unix, files starting with a "."). | | `QDir::System` | `0x200` | List system files (on Unix, FIFOs, sockets and device files are included; on Windows, `.lnk` files are included) | | `QDir::CaseSensitive` | `0x800` | The filter should be case sensitive. | Functions that use Filter enum values to filter lists of files and directories will include symbolic links to files and directories unless you set the NoSymLinks value. A default constructed [QDir](qdir) will not filter out files based on their permissions, so [entryList](qdir#entryList)() and [entryInfoList](qdir#entryInfoList)() will return all files that are readable, writable, executable, or any combination of the three. This makes the default easy to write, and at the same time useful. For example, setting the `Readable`, `Writable`, and `Files` flags allows all files to be listed for which the application has read access, write access or both. If the `Dirs` and `Drives` flags are also included in this combination then all drives, directories, all files that the application can read, write, or execute, and symlinks to such files/directories can be listed. To retrieve the permissions for a directory, use the [entryInfoList](qdir#entryInfoList)() function to get the associated [QFileInfo](qfileinfo) objects and then use the [QFileInfo::permissions](qfileinfo#permissions)() to obtain the permissions and ownership for each file. The Filters type is a typedef for [QFlags](qflags)<Filter>. It stores an OR combination of Filter values. ### enum QDir::SortFlagflags QDir::SortFlags This enum describes the sort options available to [QDir](qdir), e.g. for [entryList](qdir#entryList)() and [entryInfoList](qdir#entryInfoList)(). The sort value is specified by OR-ing together values from the following list: | Constant | Value | Description | | --- | --- | --- | | `QDir::Name` | `0x00` | Sort by name. | | `QDir::Time` | `0x01` | Sort by time (modification time). | | `QDir::Size` | `0x02` | Sort by file size. | | `QDir::Type` | `0x80` | Sort by file type (extension). | | `QDir::Unsorted` | `0x03` | Do not sort. | | `QDir::NoSort` | `-1` | Not sorted by default. | | `QDir::DirsFirst` | `0x04` | Put the directories first, then the files. | | `QDir::DirsLast` | `0x20` | Put the files first, then the directories. | | `QDir::Reversed` | `0x08` | Reverse the sort order. | | `QDir::IgnoreCase` | `0x10` | Sort case-insensitively. | | `QDir::LocaleAware` | `0x40` | Sort items appropriately using the current locale settings. | You can only specify one of the first four. If you specify both DirsFirst and Reversed, directories are still put first, but in reverse order; the files will be listed after the directories, again in reverse order. The SortFlags type is a typedef for [QFlags](qflags)<SortFlag>. It stores an OR combination of SortFlag values. Member Function Documentation ----------------------------- ### `[since 6.0]` QDir::QDir(const std::filesystem::path &*path*, const [QString](qstring) &*nameFilter*, [QDir::SortFlags](qdir#SortFlag-enum) *sort* = SortFlags(Name | IgnoreCase), [QDir::Filters](qdir#Filter-enum) *filters* = AllEntries) Constructs a QDir with path *path*, that filters its entries by name using *nameFilter* and by attributes using *filters*. It also sorts the names using *sort*. The default *nameFilter* is an empty string, which excludes nothing; the default *filters* is [AllEntries](qdir#Filter-enum), which also excludes nothing. The default *sort* is [Name](qdir#SortFlag-enum) | [IgnoreCase](qdir#SortFlag-enum), i.e. sort by name case-insensitively. If *path* is empty, QDir uses "." (the current directory). If *nameFilter* is an empty string, QDir uses the name filter "\*" (all files). **Note:** *path* need not exist. This function was introduced in Qt 6.0. **See also** [exists](qdir#exists-1)(), [setPath](qdir#setPath)(), [setNameFilters](qdir#setNameFilters)(), [setFilter](qdir#setFilter)(), and [setSorting](qdir#setSorting)(). ### `[since 6.0]` QDir::QDir(const std::filesystem::path &*path*) Constructs a QDir pointing to the given directory *path*. If path is empty the program's working directory, ("."), is used. This function was introduced in Qt 6.0. **See also** [currentPath](qdir#currentPath)(). ### QDir::QDir(const [QString](qstring) &*path*, const [QString](qstring) &*nameFilter*, [QDir::SortFlags](qdir#SortFlag-enum) *sort* = SortFlags(Name | IgnoreCase), [QDir::Filters](qdir#Filter-enum) *filters* = AllEntries) Constructs a QDir with path *path*, that filters its entries by name using *nameFilter* and by attributes using *filters*. It also sorts the names using *sort*. The default *nameFilter* is an empty string, which excludes nothing; the default *filters* is [AllEntries](qdir#Filter-enum), which also excludes nothing. The default *sort* is [Name](qdir#SortFlag-enum) | [IgnoreCase](qdir#SortFlag-enum), i.e. sort by name case-insensitively. If *path* is an empty string, QDir uses "." (the current directory). If *nameFilter* is an empty string, QDir uses the name filter "\*" (all files). **Note:** *path* need not exist. **See also** [exists](qdir#exists-1)(), [setPath](qdir#setPath)(), [setNameFilters](qdir#setNameFilters)(), [setFilter](qdir#setFilter)(), and [setSorting](qdir#setSorting)(). ### QDir::QDir(const [QString](qstring) &*path* = QString()) Constructs a QDir pointing to the given directory *path*. If path is empty the program's working directory, ("."), is used. **See also** [currentPath](qdir#currentPath)(). ### QDir::QDir(const [QDir](qdir#QDir) &*dir*) Constructs a QDir object that is a copy of the QDir object for directory *dir*. **See also** [operator=](qdir#operator-eq)(). ### `[since 5.2]` [QDir](qdir#QDir) &QDir::operator=([QDir](qdir#QDir) &&*other*) Move-assigns *other* to this [QDir](qdir) instance. This function was introduced in Qt 5.2. ### [QDir](qdir#QDir) &QDir::operator=(const [QDir](qdir#QDir) &*dir*) Makes a copy of the *dir* object and assigns it to this [QDir](qdir) object. ### QDir::~QDir() Destroys the [QDir](qdir) object frees up its resources. This has no effect on the underlying directory in the file system. ### [QString](qstring) QDir::absoluteFilePath(const [QString](qstring) &*fileName*) const Returns the absolute path name of a file in the directory. Does *not* check if the file actually exists in the directory; but see [exists](qdir#exists-1)(). Redundant multiple separators or "." and ".." directories in *fileName* are not removed (see [cleanPath](qdir#cleanPath)()). **See also** [relativeFilePath](qdir#relativeFilePath)(), [filePath](qdir#filePath)(), and [canonicalPath](qdir#canonicalPath)(). ### [QString](qstring) QDir::absolutePath() const Returns the absolute path (a path that starts with "/" or with a drive specification), which may contain symbolic links, but never contains redundant ".", ".." or multiple separators. **See also** [setPath](qdir#setPath)(), [canonicalPath](qdir#canonicalPath)(), [exists](qdir#exists-1)(), [cleanPath](qdir#cleanPath)(), [dirName](qdir#dirName)(), and [absoluteFilePath](qdir#absoluteFilePath)(). ### `[static]` void QDir::addSearchPath(const [QString](qstring) &*prefix*, const [QString](qstring) &*path*) Adds *path* to the search path for *prefix*. **See also** [setSearchPaths](qdir#setSearchPaths)(). ### `[static, since 6.0]` void QDir::addSearchPath(const [QString](qstring) &*prefix*, const std::filesystem::path &*path*) This is an overloaded function. This function was introduced in Qt 6.0. ### [QString](qstring) QDir::canonicalPath() const Returns the canonical path, i.e. a path without symbolic links or redundant "." or ".." elements. On systems that do not have symbolic links this function will always return the same string that [absolutePath](qdir#absolutePath)() returns. If the canonical path does not exist (normally due to dangling symbolic links) canonicalPath() returns an empty string. Example: ``` QString bin = "/local/bin"; // where /local/bin is a symlink to /usr/bin QDir binDir(bin); QString canonicalBin = binDir.canonicalPath(); // canonicalBin now equals "/usr/bin" QString ls = "/local/bin/ls"; // where ls is the executable "ls" QDir lsDir(ls); QString canonicalLs = lsDir.canonicalPath(); // canonicalLS now equals "/usr/bin/ls". ``` **See also** [path](qdir#path)(), [absolutePath](qdir#absolutePath)(), [exists](qdir#exists-1)(), [cleanPath](qdir#cleanPath)(), [dirName](qdir#dirName)(), and [absoluteFilePath](qdir#absoluteFilePath)(). ### bool QDir::cd(const [QString](qstring) &*dirName*) Changes the [QDir](qdir)'s directory to *dirName*. Returns `true` if the new directory exists; otherwise returns `false`. Note that the logical cd() operation is not performed if the new directory does not exist. Calling cd("..") is equivalent to calling [cdUp](qdir#cdUp)(). **See also** [cdUp](qdir#cdUp)(), [isReadable](qdir#isReadable)(), [exists](qdir#exists-1)(), and [path](qdir#path)(). ### bool QDir::cdUp() Changes directory by moving one directory up from the [QDir](qdir)'s current directory. Returns `true` if the new directory exists; otherwise returns `false`. Note that the logical cdUp() operation is not performed if the new directory does not exist. **See also** [cd](qdir#cd)(), [isReadable](qdir#isReadable)(), [exists](qdir#exists-1)(), and [path](qdir#path)(). ### `[static]` [QString](qstring) QDir::cleanPath(const [QString](qstring) &*path*) Returns *path* with directory separators normalized (that is, platform-native separators converted to "/") and redundant ones removed, and "."s and ".."s resolved (as far as possible). Symbolic links are kept. This function does not return the canonical path, but rather the simplest version of the input. For example, "./local" becomes "local", "local/../bin" becomes "bin" and "/local/usr/../bin" becomes "/local/bin". **See also** [absolutePath](qdir#absolutePath)() and [canonicalPath](qdir#canonicalPath)(). ### [uint](qtglobal#uint-typedef) QDir::count() const Returns the total number of directories and files in the directory. Equivalent to [entryList](qdir#entryList)().count(). **See also** [operator[]](qdir#operator-5b-5d)() and [entryList](qdir#entryList)(). ### `[static]` [QDir](qdir#QDir) QDir::current() Returns the application's current directory. The directory is constructed using the absolute path of the current directory, ensuring that its [path](qdir#path)() will be the same as its [absolutePath](qdir#absolutePath)(). **See also** [currentPath](qdir#currentPath)(), [setCurrent](qdir#setCurrent)(), [home](qdir#home)(), [root](qdir#root)(), and [temp](qdir#temp)(). ### `[static]` [QString](qstring) QDir::currentPath() Returns the absolute path of the application's current directory. The current directory is the last directory set with [QDir::setCurrent](qdir#setCurrent)() or, if that was never called, the directory at which this application was started at by the parent process. **See also** [current](qdir#current)(), [setCurrent](qdir#setCurrent)(), [homePath](qdir#homePath)(), [rootPath](qdir#rootPath)(), [tempPath](qdir#tempPath)(), and [QCoreApplication::applicationDirPath](qcoreapplication#applicationDirPath)(). ### [QString](qstring) QDir::dirName() const Returns the name of the directory; this is *not* the same as the path, e.g. a directory with the name "mail", might have the path "/var/spool/mail". If the directory has no name (e.g. it is the root directory) an empty string is returned. No check is made to ensure that a directory with this name actually exists; but see [exists](qdir#exists-1)(). **See also** [path](qdir#path)(), [filePath](qdir#filePath)(), [absolutePath](qdir#absolutePath)(), and [absoluteFilePath](qdir#absoluteFilePath)(). ### `[static]` [QFileInfoList](qfileinfo#QFileInfoList-typedef) QDir::drives() Returns a list of the root directories on this system. On Windows this returns a list of [QFileInfo](qfileinfo) objects containing "C:/", "D:/", etc. On other operating systems, it returns a list containing just one root directory (i.e. "/"). **See also** [root](qdir#root)() and [rootPath](qdir#rootPath)(). ### [QFileInfoList](qfileinfo#QFileInfoList-typedef) QDir::entryInfoList(const [QStringList](qstringlist) &*nameFilters*, [QDir::Filters](qdir#Filter-enum) *filters* = NoFilter, [QDir::SortFlags](qdir#SortFlag-enum) *sort* = NoSort) const Returns a list of [QFileInfo](qfileinfo) objects for all the files and directories in the directory, ordered according to the name and attribute filters previously set with [setNameFilters](qdir#setNameFilters)() and [setFilter](qdir#setFilter)(), and sorted according to the flags set with [setSorting](qdir#setSorting)(). The name filter, file attribute filter, and sorting specification can be overridden using the *nameFilters*, *filters*, and *sort* arguments. Returns an empty list if the directory is unreadable, does not exist, or if nothing matches the specification. **See also** [entryList](qdir#entryList)(), [setNameFilters](qdir#setNameFilters)(), [setSorting](qdir#setSorting)(), [setFilter](qdir#setFilter)(), [isReadable](qdir#isReadable)(), and [exists](qdir#exists-1)(). ### [QFileInfoList](qfileinfo#QFileInfoList-typedef) QDir::entryInfoList([QDir::Filters](qdir#Filter-enum) *filters* = NoFilter, [QDir::SortFlags](qdir#SortFlag-enum) *sort* = NoSort) const This is an overloaded function. Returns a list of [QFileInfo](qfileinfo) objects for all the files and directories in the directory, ordered according to the name and attribute filters previously set with [setNameFilters](qdir#setNameFilters)() and [setFilter](qdir#setFilter)(), and sorted according to the flags set with [setSorting](qdir#setSorting)(). The attribute filter and sorting specifications can be overridden using the *filters* and *sort* arguments. Returns an empty list if the directory is unreadable, does not exist, or if nothing matches the specification. **See also** [entryList](qdir#entryList)(), [setNameFilters](qdir#setNameFilters)(), [setSorting](qdir#setSorting)(), [setFilter](qdir#setFilter)(), [isReadable](qdir#isReadable)(), and [exists](qdir#exists-1)(). ### [QStringList](qstringlist) QDir::entryList(const [QStringList](qstringlist) &*nameFilters*, [QDir::Filters](qdir#Filter-enum) *filters* = NoFilter, [QDir::SortFlags](qdir#SortFlag-enum) *sort* = NoSort) const Returns a list of the names of all the files and directories in the directory, ordered according to the name and attribute filters previously set with [setNameFilters](qdir#setNameFilters)() and [setFilter](qdir#setFilter)(), and sorted according to the flags set with [setSorting](qdir#setSorting)(). The name filter, file attribute filter, and sorting specification can be overridden using the *nameFilters*, *filters*, and *sort* arguments. Returns an empty list if the directory is unreadable, does not exist, or if nothing matches the specification. **See also** [entryInfoList](qdir#entryInfoList)(), [setNameFilters](qdir#setNameFilters)(), [setSorting](qdir#setSorting)(), and [setFilter](qdir#setFilter)(). ### [QStringList](qstringlist) QDir::entryList([QDir::Filters](qdir#Filter-enum) *filters* = NoFilter, [QDir::SortFlags](qdir#SortFlag-enum) *sort* = NoSort) const This is an overloaded function. Returns a list of the names of all the files and directories in the directory, ordered according to the name and attribute filters previously set with [setNameFilters](qdir#setNameFilters)() and [setFilter](qdir#setFilter)(), and sorted according to the flags set with [setSorting](qdir#setSorting)(). The attribute filter and sorting specifications can be overridden using the *filters* and *sort* arguments. Returns an empty list if the directory is unreadable, does not exist, or if nothing matches the specification. **Note:** To list symlinks that point to non existing files, [System](qdir#Filter-enum) must be passed to the filter. **See also** [entryInfoList](qdir#entryInfoList)(), [setNameFilters](qdir#setNameFilters)(), [setSorting](qdir#setSorting)(), and [setFilter](qdir#setFilter)(). ### bool QDir::exists(const [QString](qstring) &*name*) const Returns `true` if the file called *name* exists; otherwise returns false. Unless *name* contains an absolute file path, the file name is assumed to be relative to the directory itself, so this function is typically used to check for the presence of files within a directory. **See also** [QFileInfo::exists](qfileinfo#exists)() and [QFile::exists](qfile#exists-1)(). ### bool QDir::exists() const This is an overloaded function. Returns `true` if the directory exists; otherwise returns `false`. (If a file with the same name is found this function will return false). The overload of this function that accepts an argument is used to test for the presence of files and directories within a directory. **See also** [QFileInfo::exists](qfileinfo#exists)() and [QFile::exists](qfile#exists-1)(). ### [QString](qstring) QDir::filePath(const [QString](qstring) &*fileName*) const Returns the path name of a file in the directory. Does *not* check if the file actually exists in the directory; but see [exists](qdir#exists-1)(). If the [QDir](qdir) is relative the returned path name will also be relative. Redundant multiple separators or "." and ".." directories in *fileName* are not removed (see [cleanPath](qdir#cleanPath)()). **See also** [dirName](qdir#dirName)(), [absoluteFilePath](qdir#absoluteFilePath)(), [isRelative](qdir#isRelative)(), and [canonicalPath](qdir#canonicalPath)(). ### `[since 6.0]` std::filesystem::path QDir::filesystemAbsolutePath() const Returns [absolutePath](qdir#absolutePath)() as `std::filesystem::path`. This function was introduced in Qt 6.0. **See also** [absolutePath](qdir#absolutePath)(). ### `[since 6.0]` std::filesystem::path QDir::filesystemCanonicalPath() const Returns [canonicalPath](qdir#canonicalPath)() as `std::filesystem::path`. This function was introduced in Qt 6.0. **See also** [canonicalPath](qdir#canonicalPath)(). ### `[since 6.0]` std::filesystem::path QDir::filesystemPath() const Returns [path](qdir#path)() as `std::filesystem::path`. This function was introduced in Qt 6.0. **See also** [path](qdir#path)(). ### [QDir::Filters](qdir#Filter-enum) QDir::filter() const Returns the value set by [setFilter](qdir#setFilter)() **See also** [setFilter](qdir#setFilter)(). ### `[static]` [QString](qstring) QDir::fromNativeSeparators(const [QString](qstring) &*pathName*) Returns *pathName* using '/' as file separator. On Windows, for instance, fromNativeSeparators("`c:\\winnt\\system32`") returns "c:/winnt/system32". The returned string may be the same as the argument on some operating systems, for example on Unix. **See also** [toNativeSeparators](qdir#toNativeSeparators)() and [separator](qdir#separator)(). ### `[static]` [QDir](qdir#QDir) QDir::home() Returns the user's home directory. The directory is constructed using the absolute path of the home directory, ensuring that its [path](qdir#path)() will be the same as its [absolutePath](qdir#absolutePath)(). See [homePath](qdir#homePath)() for details. **See also** [drives](qdir#drives)(), [current](qdir#current)(), [root](qdir#root)(), and [temp](qdir#temp)(). ### `[static]` [QString](qstring) QDir::homePath() Returns the absolute path of the user's home directory. Under Windows this function will return the directory of the current user's profile. Typically, this is: ``` C:/Documents and Settings/Username ``` Use the [toNativeSeparators](qdir#toNativeSeparators)() function to convert the separators to the ones that are appropriate for the underlying operating system. If the directory of the current user's profile does not exist or cannot be retrieved, the following alternatives will be checked (in the given order) until an existing and available path is found: 1. The path specified by the `USERPROFILE` environment variable. 2. The path formed by concatenating the `HOMEDRIVE` and `HOMEPATH` environment variables. 3. The path specified by the `HOME` environment variable. 4. The path returned by the [rootPath](qdir#rootPath)() function (which uses the `SystemDrive` environment variable) 5. The `C:/` directory. Under non-Windows operating systems the `HOME` environment variable is used if it exists, otherwise the path returned by the [rootPath](qdir#rootPath)(). **See also** [home](qdir#home)(), [currentPath](qdir#currentPath)(), [rootPath](qdir#rootPath)(), and [tempPath](qdir#tempPath)(). ### bool QDir::isAbsolute() const Returns `true` if the directory's path is absolute; otherwise returns `false`. See [isAbsolutePath](qdir#isAbsolutePath)(). **Note:** Paths starting with a colon (*:*) are always considered absolute, as they denote a [QResource](qresource). **See also** [isRelative](qdir#isRelative)(), [makeAbsolute](qdir#makeAbsolute)(), and [cleanPath](qdir#cleanPath)(). ### `[static]` bool QDir::isAbsolutePath(const [QString](qstring) &*path*) Returns `true` if *path* is absolute; returns `false` if it is relative. **Note:** Paths starting with a colon (*:*) are always considered absolute, as they denote a [QResource](qresource). **See also** [isAbsolute](qdir#isAbsolute)(), [isRelativePath](qdir#isRelativePath)(), [makeAbsolute](qdir#makeAbsolute)(), [cleanPath](qdir#cleanPath)(), and [QResource](qresource). ### `[since 5.9]` bool QDir::isEmpty([QDir::Filters](qdir#Filter-enum) *filters* = Filters(AllEntries | NoDotAndDotDot)) const Returns whether the directory is empty. Equivalent to `count() == 0` with filters `QDir::AllEntries | QDir::NoDotAndDotDot`, but faster as it just checks whether the directory contains at least one entry. **Note:** Unless you set the *filters* flags to include `QDir::NoDotAndDotDot` (as the default value does), no directory is empty. This function was introduced in Qt 5.9. **See also** [count](qdir#count)(), [entryList](qdir#entryList)(), and [setFilter](qdir#setFilter)(). ### bool QDir::isReadable() const Returns `true` if the directory is readable *and* we can open files by name; otherwise returns `false`. **Warning:** A false value from this function is not a guarantee that files in the directory are not accessible. **See also** [QFileInfo::isReadable](qfileinfo#isReadable)(). ### bool QDir::isRelative() const Returns `true` if the directory path is relative; otherwise returns false. (Under Unix a path is relative if it does not start with a "/"). **Note:** Paths starting with a colon (*:*) are always considered absolute, as they denote a [QResource](qresource). **See also** [makeAbsolute](qdir#makeAbsolute)(), [isAbsolute](qdir#isAbsolute)(), [isAbsolutePath](qdir#isAbsolutePath)(), and [cleanPath](qdir#cleanPath)(). ### `[static]` bool QDir::isRelativePath(const [QString](qstring) &*path*) Returns `true` if *path* is relative; returns `false` if it is absolute. **Note:** Paths starting with a colon (*:*) are always considered absolute, as they denote a [QResource](qresource). **See also** [isRelative](qdir#isRelative)(), [isAbsolutePath](qdir#isAbsolutePath)(), and [makeAbsolute](qdir#makeAbsolute)(). ### bool QDir::isRoot() const Returns `true` if the directory is the root directory; otherwise returns `false`. **Note:** If the directory is a symbolic link to the root directory this function returns `false`. If you want to test for this use [canonicalPath](qdir#canonicalPath)(), e.g. ``` QDir dir("/tmp/root_link"); dir = dir.canonicalPath(); if (dir.isRoot()) qWarning("It is a root link"); ``` **See also** [root](qdir#root)() and [rootPath](qdir#rootPath)(). ### `[static, since 5.6]` [QChar](qchar) QDir::listSeparator() Returns the native path list separator: ':' under Unix and ';' under Windows. This function was introduced in Qt 5.6. **See also** [separator](qdir#separator)(). ### bool QDir::makeAbsolute() Converts the directory path to an absolute path. If it is already absolute nothing happens. Returns `true` if the conversion succeeded; otherwise returns `false`. **See also** [isAbsolute](qdir#isAbsolute)(), [isAbsolutePath](qdir#isAbsolutePath)(), [isRelative](qdir#isRelative)(), and [cleanPath](qdir#cleanPath)(). ### `[static]` bool QDir::match(const [QString](qstring) &*filter*, const [QString](qstring) &*fileName*) Returns `true` if the *fileName* matches the wildcard (glob) pattern *filter*; otherwise returns `false`. The *filter* may contain multiple patterns separated by spaces or semicolons. The matching is case insensitive. **See also** [QRegularExpression::fromWildcard](qregularexpression#fromWildcard)(), [entryList](qdir#entryList)(), and [entryInfoList](qdir#entryInfoList)(). ### `[static]` bool QDir::match(const [QStringList](qstringlist) &*filters*, const [QString](qstring) &*fileName*) This is an overloaded function. Returns `true` if the *fileName* matches any of the wildcard (glob) patterns in the list of *filters*; otherwise returns `false`. The matching is case insensitive. **See also** [QRegularExpression::fromWildcard](qregularexpression#fromWildcard)(), [entryList](qdir#entryList)(), and [entryInfoList](qdir#entryInfoList)(). ### bool QDir::mkdir(const [QString](qstring) &*dirName*) const Creates a sub-directory called *dirName*. Returns `true` on success; otherwise returns `false`. If the directory already exists when this function is called, it will return false. **See also** [rmdir](qdir#rmdir)(). ### bool QDir::mkpath(const [QString](qstring) &*dirPath*) const Creates the directory path *dirPath*. The function will create all parent directories necessary to create the directory. Returns `true` if successful; otherwise returns `false`. If the path already exists when this function is called, it will return true. **See also** [rmpath](qdir#rmpath)(). ### [QStringList](qstringlist) QDir::nameFilters() const Returns the string list set by [setNameFilters](qdir#setNameFilters)() **See also** [setNameFilters](qdir#setNameFilters)(). ### [QString](qstring) QDir::path() const Returns the path. This may contain symbolic links, but never contains redundant ".", ".." or multiple separators. The returned path can be either absolute or relative (see [setPath](qdir#setPath)()). **See also** [setPath](qdir#setPath)(), [absolutePath](qdir#absolutePath)(), [exists](qdir#exists-1)(), [cleanPath](qdir#cleanPath)(), [dirName](qdir#dirName)(), [absoluteFilePath](qdir#absoluteFilePath)(), [toNativeSeparators](qdir#toNativeSeparators)(), and [makeAbsolute](qdir#makeAbsolute)(). ### void QDir::refresh() const Refreshes the directory information. ### [QString](qstring) QDir::relativeFilePath(const [QString](qstring) &*fileName*) const Returns the path to *fileName* relative to the directory. ``` QDir dir("/home/bob"); QString s; s = dir.relativeFilePath("images/file.jpg"); // s is "images/file.jpg" s = dir.relativeFilePath("/home/mary/file.txt"); // s is "../mary/file.txt" ``` **See also** [absoluteFilePath](qdir#absoluteFilePath)(), [filePath](qdir#filePath)(), and [canonicalPath](qdir#canonicalPath)(). ### bool QDir::remove(const [QString](qstring) &*fileName*) Removes the file, *fileName*. Returns `true` if the file is removed successfully; otherwise returns `false`. ### `[since 5.0]` bool QDir::removeRecursively() Removes the directory, including all its contents. Returns `true` if successful, otherwise false. If a file or directory cannot be removed, removeRecursively() keeps going and attempts to delete as many files and sub-directories as possible, then returns `false`. If the directory was already removed, the method returns `true` (expected result already reached). **Note:** This function is meant for removing a small application-internal directory (such as a temporary directory), but not user-visible directories. For user-visible operations, it is rather recommended to report errors more precisely to the user, to offer solutions in case of errors, to show progress during the deletion since it could take several minutes, etc. This function was introduced in Qt 5.0. ### bool QDir::rename(const [QString](qstring) &*oldName*, const [QString](qstring) &*newName*) Renames a file or directory from *oldName* to *newName*, and returns true if successful; otherwise returns `false`. On most file systems, rename() fails only if *oldName* does not exist, or if a file with the new name already exists. However, there are also other reasons why rename() can fail. For example, on at least one file system rename() fails if *newName* points to an open file. If *oldName* is a file (not a directory) that can't be renamed right away, Qt will try to copy *oldName* to *newName* and remove *oldName*. **See also** [QFile::rename](qfile#rename)(). ### bool QDir::rmdir(const [QString](qstring) &*dirName*) const Removes the directory specified by *dirName*. The directory must be empty for rmdir() to succeed. Returns `true` if successful; otherwise returns `false`. **See also** [mkdir](qdir#mkdir)(). ### bool QDir::rmpath(const [QString](qstring) &*dirPath*) const Removes the directory path *dirPath*. The function will remove all parent directories in *dirPath*, provided that they are empty. This is the opposite of mkpath(dirPath). Returns `true` if successful; otherwise returns `false`. **See also** [mkpath](qdir#mkpath)(). ### `[static]` [QDir](qdir#QDir) QDir::root() Returns the root directory. The directory is constructed using the absolute path of the root directory, ensuring that its [path](qdir#path)() will be the same as its [absolutePath](qdir#absolutePath)(). See [rootPath](qdir#rootPath)() for details. **See also** [drives](qdir#drives)(), [current](qdir#current)(), [home](qdir#home)(), and [temp](qdir#temp)(). ### `[static]` [QString](qstring) QDir::rootPath() Returns the absolute path of the root directory. For Unix operating systems this returns "/". For Windows file systems this normally returns "c:/". **See also** [root](qdir#root)(), [drives](qdir#drives)(), [currentPath](qdir#currentPath)(), [homePath](qdir#homePath)(), and [tempPath](qdir#tempPath)(). ### `[static]` [QStringList](qstringlist) QDir::searchPaths(const [QString](qstring) &*prefix*) Returns the search paths for *prefix*. **See also** [setSearchPaths](qdir#setSearchPaths)() and [addSearchPath](qdir#addSearchPath)(). ### `[static]` [QChar](qchar) QDir::separator() Returns the native directory separator: "/" under Unix and "\" under Windows. You do not need to use this function to build file paths. If you always use "/", Qt will translate your paths to conform to the underlying operating system. If you want to display paths to the user using their operating system's separator use [toNativeSeparators](qdir#toNativeSeparators)(). **See also** [listSeparator](qdir#listSeparator)(). ### `[static]` bool QDir::setCurrent(const [QString](qstring) &*path*) Sets the application's current working directory to *path*. Returns `true` if the directory was successfully changed; otherwise returns `false`. ``` QString absolute = "/local/bin"; QString relative = "local/bin"; QFileInfo absFile(absolute); QFileInfo relFile(relative); QDir::setCurrent(QDir::rootPath()); // absFile and relFile now point to the same file QDir::setCurrent("/tmp"); // absFile now points to "/local/bin", // while relFile points to "/tmp/local/bin" ``` **See also** [current](qdir#current)(), [currentPath](qdir#currentPath)(), [home](qdir#home)(), [root](qdir#root)(), and [temp](qdir#temp)(). ### void QDir::setFilter([QDir::Filters](qdir#Filter-enum) *filters*) Sets the filter used by [entryList](qdir#entryList)() and [entryInfoList](qdir#entryInfoList)() to *filters*. The filter is used to specify the kind of files that should be returned by [entryList](qdir#entryList)() and [entryInfoList](qdir#entryInfoList)(). See [QDir::Filter](qdir#Filter-enum). **See also** [filter](qdir#filter)() and [setNameFilters](qdir#setNameFilters)(). ### void QDir::setNameFilters(const [QStringList](qstringlist) &*nameFilters*) Sets the name filters used by [entryList](qdir#entryList)() and [entryInfoList](qdir#entryInfoList)() to the list of filters specified by *nameFilters*. Each name filter is a wildcard (globbing) filter that understands `*` and `?` wildcards. See [QRegularExpression::fromWildcard](qregularexpression#fromWildcard)(). For example, the following code sets three name filters on a [QDir](qdir) to ensure that only files with extensions typically used for C++ source files are listed: ``` QStringList filters; filters << "*.cpp" << "*.cxx" << "*.cc"; dir.setNameFilters(filters); ``` **See also** [nameFilters](qdir#nameFilters)() and [setFilter](qdir#setFilter)(). ### void QDir::setPath(const [QString](qstring) &*path*) Sets the path of the directory to *path*. The path is cleaned of redundant ".", ".." and of multiple separators. No check is made to see whether a directory with this path actually exists; but you can check for yourself using [exists](qdir#exists-1)(). The path can be either absolute or relative. Absolute paths begin with the directory separator "/" (optionally preceded by a drive specification under Windows). Relative file names begin with a directory name or a file name and specify a path relative to the current directory. An example of an absolute path is the string "/tmp/quartz", a relative path might look like "src/fatlib". **See also** [path](qdir#path)(), [absolutePath](qdir#absolutePath)(), [exists](qdir#exists-1)(), [cleanPath](qdir#cleanPath)(), [dirName](qdir#dirName)(), [absoluteFilePath](qdir#absoluteFilePath)(), [isRelative](qdir#isRelative)(), and [makeAbsolute](qdir#makeAbsolute)(). ### `[since 6.0]` void QDir::setPath(const std::filesystem::path &*path*) This is an overloaded function. This function was introduced in Qt 6.0. ### `[static]` void QDir::setSearchPaths(const [QString](qstring) &*prefix*, const [QStringList](qstringlist) &*searchPaths*) Sets or replaces Qt's search paths for file names with the prefix *prefix* to *searchPaths*. To specify a prefix for a file name, prepend the prefix followed by a single colon (e.g., "images:undo.png", "xmldocs:books.xml"). *prefix* can only contain letters or numbers (e.g., it cannot contain a colon, nor a slash). Qt uses this search path to locate files with a known prefix. The search path entries are tested in order, starting with the first entry. ``` QDir::setSearchPaths("icons", QStringList(QDir::homePath() + "/images")); QDir::setSearchPaths("docs", QStringList(":/embeddedDocuments")); ... QPixmap pixmap("icons:undo.png"); // will look for undo.png in QDir::homePath() + "/images" QFile file("docs:design.odf"); // will look in the :/embeddedDocuments resource path ``` File name prefix must be at least 2 characters long to avoid conflicts with Windows drive letters. Search paths may contain paths to [The Qt Resource System](resources). **See also** [searchPaths](qdir#searchPaths)(). ### void QDir::setSorting([QDir::SortFlags](qdir#SortFlag-enum) *sort*) Sets the sort order used by [entryList](qdir#entryList)() and [entryInfoList](qdir#entryInfoList)(). The *sort* is specified by OR-ing values from the enum [QDir::SortFlag](qdir#SortFlag-enum). **See also** [sorting](qdir#sorting)() and [SortFlag](qdir#SortFlag-enum). ### [QDir::SortFlags](qdir#SortFlag-enum) QDir::sorting() const Returns the value set by [setSorting](qdir#setSorting)() **See also** [setSorting](qdir#setSorting)() and [SortFlag](qdir#SortFlag-enum). ### `[since 5.0]` void QDir::swap([QDir](qdir#QDir) &*other*) Swaps this [QDir](qdir) instance with *other*. This function is very fast and never fails. This function was introduced in Qt 5.0. ### `[static]` [QDir](qdir#QDir) QDir::temp() Returns the system's temporary directory. The directory is constructed using the absolute canonical path of the temporary directory, ensuring that its [path](qdir#path)() will be the same as its [absolutePath](qdir#absolutePath)(). See [tempPath](qdir#tempPath)() for details. **See also** [drives](qdir#drives)(), [current](qdir#current)(), [home](qdir#home)(), and [root](qdir#root)(). ### `[static]` [QString](qstring) QDir::tempPath() Returns the absolute canonical path of the system's temporary directory. On Unix/Linux systems this is the path in the `TMPDIR` environment variable or `/tmp` if `TMPDIR` is not defined. On Windows this is usually the path in the `TEMP` or `TMP` environment variable. The path returned by this method doesn't end with a directory separator unless it is the root directory (of a drive). **See also** [temp](qdir#temp)(), [currentPath](qdir#currentPath)(), [homePath](qdir#homePath)(), and [rootPath](qdir#rootPath)(). ### `[static]` [QString](qstring) QDir::toNativeSeparators(const [QString](qstring) &*pathName*) Returns *pathName* with the '/' separators converted to separators that are appropriate for the underlying operating system. On Windows, toNativeSeparators("c:/winnt/system32") returns "c:\winnt\system32". The returned string may be the same as the argument on some operating systems, for example on Unix. **See also** [fromNativeSeparators](qdir#fromNativeSeparators)() and [separator](qdir#separator)(). ### bool QDir::operator!=(const [QDir](qdir#QDir) &*dir*) const Returns `true` if directory *dir* and this directory have different paths or different sort or filter settings; otherwise returns false. Example: ``` // The current directory is "/usr/local" QDir d1("/usr/local/bin"); d1.setFilter(QDir::Executable); QDir d2("bin"); if (d1 != d2) qDebug("They differ"); ``` ### bool QDir::operator==(const [QDir](qdir#QDir) &*dir*) const Returns `true` if directory *dir* and this directory have the same path and their sort and filter settings are the same; otherwise returns `false`. Example: ``` // The current directory is "/usr/local" QDir d1("/usr/local/bin"); QDir d2("bin"); if (d1 == d2) qDebug("They're the same"); ``` ### [QString](qstring) QDir::operator[](int *pos*) const Returns the file name at position *pos* in the list of file names. Equivalent to [entryList](qdir#entryList)().at(index). *pos* must be a valid index position in the list (i.e., 0 <= pos < [count](qdir#count)()). **See also** [count](qdir#count)() and [entryList](qdir#entryList)(). Macro Documentation ------------------- ### void Q\_CLEANUP\_RESOURCE(*name*) Unloads the resources specified by the `.qrc` file with the base name *name*. Normally, Qt resources are unloaded automatically when the application terminates, but if the resources are located in a plugin that is being unloaded, call Q\_CLEANUP\_RESOURCE() to force removal of your resources. **Note:** This macro cannot be used in a namespace. Please see the [Q\_INIT\_RESOURCE](qdir#Q_INIT_RESOURCE) documentation for a workaround. Example: ``` Q_CLEANUP_RESOURCE(myapp); ``` **See also** [Q\_INIT\_RESOURCE](qdir#Q_INIT_RESOURCE)() and [The Qt Resource System](resources). ### void Q\_INIT\_RESOURCE(*name*) Initializes the resources specified by the `.qrc` file with the specified base *name*. Normally, when resources are built as part of the application, the resources are loaded automatically at startup. The Q\_INIT\_RESOURCE() macro is necessary on some platforms for resources stored in a static library. For example, if your application's resources are listed in a file called `myapp.qrc`, you can ensure that the resources are initialized at startup by adding this line to your `main()` function: ``` Q_INIT_RESOURCE(myapp); ``` If the file name contains characters that cannot be part of a valid C++ function name (such as '-'), they have to be replaced by the underscore character ('\_'). **Note:** This macro cannot be used in a namespace. It should be called from main(). If that is not possible, the following workaround can be used to init the resource `myapp` from the function `MyNamespace::myFunction`: ``` inline void initMyResource() { Q_INIT_RESOURCE(myapp); } namespace MyNamespace { ... void myFunction() { initMyResource(); } } ``` **See also** [Q\_CLEANUP\_RESOURCE](qdir#Q_CLEANUP_RESOURCE)() and [The Qt Resource System](resources).
programming_docs
qt QtPositioning QML Type QtPositioning QML Type ====================== The QtPositioning global object provides useful functions for working with location-based types in QML. [More...](#details) | | | | --- | --- | | Import Statement: | import QtPositioning | | Since: | Qt 5.2 | * [List of all members, including inherited members](https://doc.qt.io/qt-6.2/qml-qtpositioning-qtpositioning-members.html) Methods ------- * geocircle **[circle](qml-qtpositioning-qtpositioning#circle-method-1)**(coordinate *center*, real *radius*) * geocircle **[circle](qml-qtpositioning-qtpositioning#circle-method)**() * point **[coordToMercator](qml-qtpositioning-qtpositioning#coordToMercator-method)**(coordinate *coord*) * coordinate **[coordinate](qml-qtpositioning-qtpositioning#coordinate-method-1)**(real *latitude*, real *longitude*, real *altitude*) * coordinate **[coordinate](qml-qtpositioning-qtpositioning#coordinate-method)**() * coordinate **[mercatorToCoord](qml-qtpositioning-qtpositioning#mercatorToCoord-method)**(point *mercator*) * geopath **[path](qml-qtpositioning-qtpositioning#path-method-1)**(list<coordinate> *coordinates*, real *width*) * geopath **[path](qml-qtpositioning-qtpositioning#path-method)**() * geopolygon **[polygon](qml-qtpositioning-qtpositioning#polygon-method-2)**(list<coordinate> *perimeter*, list<list<coordinate>> *holes*) * geopolygon **[polygon](qml-qtpositioning-qtpositioning#polygon-method-1)**(list<coordinate> *coordinates*) * geopolygon **[polygon](qml-qtpositioning-qtpositioning#polygon-method)**() * georectangle **[rectangle](qml-qtpositioning-qtpositioning#rectangle-method-2)**(coordinate *topLeft*, coordinate *bottomRight*) * georectangle **[rectangle](qml-qtpositioning-qtpositioning#rectangle-method-1)**(coordinate *center*, real *width*, real *height*) * georectangle **[rectangle](qml-qtpositioning-qtpositioning#rectangle-method)**() * geoshape **[shape](qml-qtpositioning-qtpositioning#shape-method)**() * geocircle **[shapeToCircle](qml-qtpositioning-qtpositioning#shapeToCircle-method)**(geoshape *shape*) * geopath **[shapeToPath](qml-qtpositioning-qtpositioning#shapeToPath-method)**(geoshape *shape*) * geopolygon **[shapeToPolygon](qml-qtpositioning-qtpositioning#shapeToPolygon-method)**(geoshape *shape*) * georectangle **[shapeToRectangle](qml-qtpositioning-qtpositioning#shapeToRectangle-method)**(geoshape *shape*) Detailed Description -------------------- ``` import QtPositioning Item { property var coordinate: QtPositioning.coordinate(-27.5, 153.1) } ``` Method Documentation -------------------- ### [geocircle](qml-geocircle) circle([coordinate](qml-qtpositioning-qtpositioning#coordinate-method) *center*, [real](qml-real) *radius*) Constructs a geocircle centered at *center* with a radius of *radius* meters. ### [geocircle](qml-geocircle) circle() Constructs an invalid geocircle. **See also** [geocircle](qml-geocircle). ### `[since 5.12]` [point](qml-point) coordToMercator([coordinate](qml-qtpositioning-qtpositioning#coordinate-method) *coord*) Converts a coordinate *coord* into a mercator coordinate and returns it. This method was introduced in Qt 5.12. **See also** [mercatorToCoord](qml-qtpositioning-qtpositioning#mercatorToCoord-method). ### [coordinate](qml-qtpositioning-qtpositioning#coordinate-method) coordinate([real](qml-real) *latitude*, [real](qml-real) *longitude*, [real](qml-real) *altitude*) Constructs a coordinate with the specified *latitude*, *longitude* and optional *altitude*. Both *latitude* and *longitude* must be valid, otherwise an invalid coordinate is returned. **See also** [coordinate](qml-qtpositioning-qtpositioning#coordinate-method). ### [coordinate](qml-qtpositioning-qtpositioning#coordinate-method) coordinate() Constructs an invalid coordinate. ### `[since 5.12]` [coordinate](qml-qtpositioning-qtpositioning#coordinate-method) mercatorToCoord([point](qml-point) *mercator*) Converts a *mercator* coordinate into a latitude-longitude coordinate. This method was introduced in Qt 5.12. **See also** [coordToMercator](qml-qtpositioning-qtpositioning#coordToMercator-method). ### `[since 5.9]` [geopath](qml-geopath) path([list](qml-list)<[coordinate](qml-qtpositioning-qtpositioning#coordinate-method)> *coordinates*, [real](qml-real) *width*) Constructs a geopath from coordinates and width. This method was introduced in Qt 5.9. **See also** [geopath](qml-geopath). ### `[since 5.9]` [geopath](qml-geopath) path() Constructs an empty geopath. This method was introduced in Qt 5.9. **See also** [geopath](qml-geopath). ### `[since 5.12]` [geopolygon](qml-geopolygon) polygon([list](qml-list)<[coordinate](qml-qtpositioning-qtpositioning#coordinate-method)> *perimeter*, [list](qml-list)<[list](qml-list)<[coordinate](qml-qtpositioning-qtpositioning#coordinate-method)>> *holes*) Constructs a polygon from coordinates for perimeter and inner holes. This method was introduced in Qt 5.12. **See also** [geopolygon](qml-geopolygon). ### `[since 5.10]` [geopolygon](qml-geopolygon) polygon([list](qml-list)<[coordinate](qml-qtpositioning-qtpositioning#coordinate-method)> *coordinates*) Constructs a polygon from coordinates. This method was introduced in Qt 5.10. **See also** [geopolygon](qml-geopolygon). ### `[since 5.10]` [geopolygon](qml-geopolygon) polygon() Constructs an empty polygon. This method was introduced in Qt 5.10. **See also** [geopolygon](qml-geopolygon). ### [georectangle](qml-georectangle) rectangle([coordinate](qml-qtpositioning-qtpositioning#coordinate-method) *topLeft*, [coordinate](qml-qtpositioning-qtpositioning#coordinate-method) *bottomRight*) Constructs a georectangle with its top left corner positioned at *topLeft* and its bottom right corner positioned at *bottomRight*. **See also** [georectangle](qml-georectangle). ### [georectangle](qml-georectangle) rectangle([coordinate](qml-qtpositioning-qtpositioning#coordinate-method) *center*, [real](qml-real) *width*, [real](qml-real) *height*) Constructs a georectangle centered at *center* with a width of *width* degrees and a hight of *height* degrees. **See also** [georectangle](qml-georectangle). ### [georectangle](qml-georectangle) rectangle() Constructs an invalid georectangle. **See also** [georectangle](qml-georectangle). ### [geoshape](qml-geoshape) shape() Constructs an invalid geoshape. **See also** [geoshape](qml-geoshape). ### `[since 5.5]` [geocircle](qml-geocircle) shapeToCircle([geoshape](qml-geoshape) *shape*) Converts *shape* to a geocircle. This method was introduced in Qt 5.5. **See also** [geocircle](qml-geocircle). ### `[since 5.9]` [geopath](qml-geopath) shapeToPath([geoshape](qml-geoshape) *shape*) Converts *shape* to a geopath. This method was introduced in Qt 5.9. **See also** [geopath](qml-geopath). ### `[since 5.10]` [geopolygon](qml-geopolygon) shapeToPolygon([geoshape](qml-geoshape) *shape*) Converts *shape* to a polygon. This method was introduced in Qt 5.10. **See also** [geopolygon](qml-geopolygon). ### `[since 5.5]` [georectangle](qml-georectangle) shapeToRectangle([geoshape](qml-geoshape) *shape*) Converts *shape* to a georectangle. This method was introduced in Qt 5.5. **See also** [georectangle](qml-georectangle). qt Qt Quick Controls Guidelines Qt Quick Controls Guidelines ============================ Qt Quick Controls offers a selection of controls that can be used to build complete interfaces in Qt Quick. Below you will find practical guidelines on how and when to use the controls. | | | | --- | --- | | [Button Controls](qtquickcontrols2-buttons) | Guidelines for button controls | | [Container Controls](qtquickcontrols2-containers) | Guidelines for container controls | | [Delegate Controls](qtquickcontrols2-delegates) | Guidelines for delegate controls | | [Indicator Controls](qtquickcontrols2-indicators) | Guidelines for indicator controls | | [Input Controls](qtquickcontrols2-input) | Guidelines for input controls | | [Menu Controls](qtquickcontrols2-menus) | Guidelines for menu controls | | [Navigation Controls](qtquickcontrols2-navigation) | Guidelines for navigation controls | | [Popup Controls](qtquickcontrols2-popups) | Guidelines for popup controls | | [Separator Controls](qtquickcontrols2-separators) | Guidelines for separator controls | Related Information ------------------- * [All Qt Quick Controls QML Types](https://doc.qt.io/qt-6.2/qtquick-controls2-qmlmodule.html) qt Desktop Integration Desktop Integration =================== Qt applications behave well in the user's desktop environment, but certain integrations require additional, and sometimes platform specific, techniques. Useful Classes -------------- Various classes in Qt are designed to help developers integrate applications into users' desktop environments. These classes enable developers to take advantage of native services while still using a cross-platform API. | | | | --- | --- | | [QDesktopServices](qdesktopservices) | Methods for accessing common desktop services | | [QSystemTrayIcon](qsystemtrayicon) | Icon for an application in the system tray | Opening External Resources -------------------------- Although Qt provides facilities to handle and display resources, such as [common image formats](qimageiohandler) and [HTML](qtextdocument), it is sometimes necessary to open files and external resources using external applications. [QDesktopServices](qdesktopservices) provides an interface to services offered by the user's desktop environment. In particular, the [openUrl](qdesktopservices#openUrl)() function is used to open resources using the appropriate application, which may have been specifically configured by the user. System Tray Icons ----------------- Many modern desktop environments feature docks or panels with *system trays* in which applications can install icons. Applications often use system tray icons to display status information, either by updating the icon itself or by showing information in "balloon messages". Additionally, many applications provide pop-up menus that can be accessed via their system tray icons. The [QSystemTrayIcon](qsystemtrayicon) class exposes all of the above features via an intuitive Qt-style API that can be used on all desktop platforms. Desktop Widgets --------------- On systems where the user's desktop is displayed using more than one screen, certain types of applications may need to obtain information about the configuration of the user's workspace to ensure that new windows and dialogs are opened in appropriate locations. The QDesktopWidget class can be used to monitor the positions of widgets and notify applications about changes to the way the desktop is split over the available screens. This enables applications to implement policies for positioning new windows so that, for example, they do not distract a user who is working on a specific task. qt QStyleOptionFrame Class QStyleOptionFrame Class ======================= The QStyleOptionFrame class is used to describe the parameters for drawing a frame. [More...](#details) | | | | --- | --- | | Header: | #include <QStyleOptionFrame> | | CMake: | find\_package(Qt6 COMPONENTS Widgets REQUIRED) target\_link\_libraries(mytarget PRIVATE Qt6::Widgets) | | qmake: | QT += widgets | | Inherits: | [QStyleOption](qstyleoption) | * [List of all members, including inherited members](https://doc.qt.io/qt-6.2/qstyleoptionframe-members.html) Public Types ------------ | | | | --- | --- | | enum | **[FrameFeature](qstyleoptionframe#FrameFeature-enum)** { None, Flat, Rounded } | | flags | **[FrameFeatures](qstyleoptionframe#FrameFeature-enum)** | | enum | **[StyleOptionType](qstyleoptionframe#StyleOptionType-enum)** { Type } | | enum | **[StyleOptionVersion](qstyleoptionframe#StyleOptionVersion-enum)** { Version } | Public Functions ---------------- | | | | --- | --- | | | **[QStyleOptionFrame](qstyleoptionframe#QStyleOptionFrame-1)**(const QStyleOptionFrame &*other*) | | | **[QStyleOptionFrame](qstyleoptionframe#QStyleOptionFrame)**() | Public Variables ---------------- | | | | --- | --- | | QStyleOptionFrame::FrameFeatures | **[features](qstyleoptionframe#features-var)** | | QFrame::Shape | **[frameShape](qstyleoptionframe#frameShape-var)** | | int | **[lineWidth](qstyleoptionframe#lineWidth-var)** | | int | **[midLineWidth](qstyleoptionframe#midLineWidth-var)** | Detailed Description -------------------- QStyleOptionFrame is used for drawing several built-in Qt widgets, including [QFrame](qframe), [QGroupBox](qgroupbox), [QLineEdit](qlineedit), and [QMenu](qmenu). For performance reasons, there are few member functions and the access to the member variables is direct (i.e., using the `.` or `->` operator). This makes the structures straightforward to use and emphasizes that these are simply parameters used by the style functions. An instance of the QStyleOptionFrame class has [type](qstyleoption#type-var) SO\_Frame and [version](qstyleoption#version-var) 3. The type is used internally by [QStyleOption](qstyleoption), its subclasses, and [qstyleoption\_cast](qstyleoption#qstyleoption_cast)() to determine the type of style option. In general you do not need to worry about this unless you want to create your own [QStyleOption](qstyleoption) subclass and your own styles. The version is used by [QStyleOption](qstyleoption) subclasses to implement extensions without breaking compatibility. If you use [qstyleoption\_cast](qstyleoption#qstyleoption_cast)(), you normally do not need to check it. For an example demonstrating how style options can be used, see the [Styles](https://doc.qt.io/qt-6.2/qtwidgets-widgets-styles-example.html) example. **See also** [QStyleOption](qstyleoption). Member Type Documentation ------------------------- ### enum QStyleOptionFrame::FrameFeatureflags QStyleOptionFrame::FrameFeatures This enum describes the different types of features a frame can have. | Constant | Value | Description | | --- | --- | --- | | `QStyleOptionFrame::None` | `0x00` | Indicates a normal frame. | | `QStyleOptionFrame::Flat` | `0x01` | Indicates a flat frame. | | `QStyleOptionFrame::Rounded` | `0x02` | Indicates a rounded frame. | The FrameFeatures type is a typedef for [QFlags](qflags)<FrameFeature>. It stores an OR combination of FrameFeature values. ### enum QStyleOptionFrame::StyleOptionType This enum is used to hold information about the type of the style option, and is defined for each [QStyleOption](qstyleoption) subclass. | Constant | Value | Description | | --- | --- | --- | | `QStyleOptionFrame::Type` | `SO_Frame` | The type of style option provided ([SO\_Frame](qstyleoption#OptionType-enum) for this class). | The type is used internally by [QStyleOption](qstyleoption), its subclasses, and [qstyleoption\_cast](qstyleoption#qstyleoption_cast)() to determine the type of style option. In general you do not need to worry about this unless you want to create your own [QStyleOption](qstyleoption) subclass and your own styles. **See also** [StyleOptionVersion](qstyleoptionframe#StyleOptionVersion-enum). ### enum QStyleOptionFrame::StyleOptionVersion This enum is used to hold information about the version of the style option, and is defined for each [QStyleOption](qstyleoption) subclass. | Constant | Value | Description | | --- | --- | --- | | `QStyleOptionFrame::Version` | `1` | 3 | The version is used by [QStyleOption](qstyleoption) subclasses to implement extensions without breaking compatibility. If you use [qstyleoption\_cast](qstyleoption#qstyleoption_cast)(), you normally do not need to check it. **See also** [StyleOptionType](qstyleoptionframe#StyleOptionType-enum). Member Function Documentation ----------------------------- ### QStyleOptionFrame::QStyleOptionFrame(const [QStyleOptionFrame](qstyleoptionframe#QStyleOptionFrame) &*other*) Constructs a copy of the *other* style option. ### QStyleOptionFrame::QStyleOptionFrame() Constructs a QStyleOptionFrame, initializing the members variables to their default values. Member Variable Documentation ----------------------------- ### [QStyleOptionFrame::FrameFeatures](qstyleoptionframe#FrameFeature-enum) QStyleOptionFrame::features This variable holds a bitwise OR of the features that describe this frame. **See also** [FrameFeature](qstyleoptionframe#FrameFeature-enum). ### [QFrame::Shape](qframe#Shape-enum) QStyleOptionFrame::frameShape This property holds the frame shape value of the frame. **See also** [QFrame::frameShape](qframe#frameShape-prop). ### int QStyleOptionFrame::lineWidth This variable holds the line width for drawing the frame The default value is 0. **See also** [QFrame::lineWidth](qframe#lineWidth-prop). ### int QStyleOptionFrame::midLineWidth This variable holds the mid-line width for drawing the frame This is usually used in drawing sunken or raised frames. The default value is 0. **See also** [QFrame::midLineWidth](qframe#midLineWidth-prop). qt QTextCharFormat Class QTextCharFormat Class ===================== The QTextCharFormat class provides formatting information for characters in a [QTextDocument](qtextdocument). [More...](#details) | | | | --- | --- | | Header: | #include <QTextCharFormat> | | CMake: | find\_package(Qt6 COMPONENTS Gui REQUIRED) target\_link\_libraries(mytarget PRIVATE Qt6::Gui) | | qmake: | QT += gui | | Inherits: | [QTextFormat](qtextformat) | | Inherited By: | [QTextImageFormat](qtextimageformat) and [QTextTableCellFormat](qtexttablecellformat) | * [List of all members, including inherited members](https://doc.qt.io/qt-6.2/qtextcharformat-members.html) * [Deprecated members](https://doc.qt.io/qt-6.2/qtextcharformat-obsolete.html) **Note:** All functions in this class are [reentrant](threads-reentrancy). Public Types ------------ | | | | --- | --- | | enum | **[FontPropertiesInheritanceBehavior](qtextcharformat#FontPropertiesInheritanceBehavior-enum)** { FontPropertiesSpecifiedOnly, FontPropertiesAll } | | enum | **[UnderlineStyle](qtextcharformat#UnderlineStyle-enum)** { NoUnderline, SingleUnderline, DashUnderline, DotLine, DashDotLine, …, SpellCheckUnderline } | | enum | **[VerticalAlignment](qtextcharformat#VerticalAlignment-enum)** { AlignNormal, AlignSuperScript, AlignSubScript, AlignMiddle, AlignBottom, …, AlignBaseline } | Public Functions ---------------- | | | | --- | --- | | | **[QTextCharFormat](qtextcharformat#QTextCharFormat)**() | | QString | **[anchorHref](qtextcharformat#anchorHref)**() const | | QStringList | **[anchorNames](qtextcharformat#anchorNames)**() const | | qreal | **[baselineOffset](qtextcharformat#baselineOffset)**() const | | QFont | **[font](qtextcharformat#font)**() const | | QFont::Capitalization | **[fontCapitalization](qtextcharformat#fontCapitalization)**() const | | QVariant | **[fontFamilies](qtextcharformat#fontFamilies)**() const | | bool | **[fontFixedPitch](qtextcharformat#fontFixedPitch)**() const | | QFont::HintingPreference | **[fontHintingPreference](qtextcharformat#fontHintingPreference)**() const | | bool | **[fontItalic](qtextcharformat#fontItalic)**() const | | bool | **[fontKerning](qtextcharformat#fontKerning)**() const | | qreal | **[fontLetterSpacing](qtextcharformat#fontLetterSpacing)**() const | | QFont::SpacingType | **[fontLetterSpacingType](qtextcharformat#fontLetterSpacingType)**() const | | bool | **[fontOverline](qtextcharformat#fontOverline)**() const | | qreal | **[fontPointSize](qtextcharformat#fontPointSize)**() const | | int | **[fontStretch](qtextcharformat#fontStretch)**() const | | bool | **[fontStrikeOut](qtextcharformat#fontStrikeOut)**() const | | QFont::StyleHint | **[fontStyleHint](qtextcharformat#fontStyleHint)**() const | | QVariant | **[fontStyleName](qtextcharformat#fontStyleName)**() const | | QFont::StyleStrategy | **[fontStyleStrategy](qtextcharformat#fontStyleStrategy)**() const | | bool | **[fontUnderline](qtextcharformat#fontUnderline)**() const | | int | **[fontWeight](qtextcharformat#fontWeight)**() const | | qreal | **[fontWordSpacing](qtextcharformat#fontWordSpacing)**() const | | bool | **[isAnchor](qtextcharformat#isAnchor)**() const | | bool | **[isValid](qtextcharformat#isValid)**() const | | void | **[setAnchor](qtextcharformat#setAnchor)**(bool *anchor*) | | void | **[setAnchorHref](qtextcharformat#setAnchorHref)**(const QString &*value*) | | void | **[setAnchorNames](qtextcharformat#setAnchorNames)**(const QStringList &*names*) | | void | **[setBaselineOffset](qtextcharformat#setBaselineOffset)**(qreal *baseline*) | | void | **[setFont](qtextcharformat#setFont)**(const QFont &*font*, QTextCharFormat::FontPropertiesInheritanceBehavior *behavior* = FontPropertiesAll) | | void | **[setFontCapitalization](qtextcharformat#setFontCapitalization)**(QFont::Capitalization *capitalization*) | | void | **[setFontFamilies](qtextcharformat#setFontFamilies)**(const QStringList &*families*) | | void | **[setFontFixedPitch](qtextcharformat#setFontFixedPitch)**(bool *fixedPitch*) | | void | **[setFontHintingPreference](qtextcharformat#setFontHintingPreference)**(QFont::HintingPreference *hintingPreference*) | | void | **[setFontItalic](qtextcharformat#setFontItalic)**(bool *italic*) | | void | **[setFontKerning](qtextcharformat#setFontKerning)**(bool *enable*) | | void | **[setFontLetterSpacing](qtextcharformat#setFontLetterSpacing)**(qreal *spacing*) | | void | **[setFontLetterSpacingType](qtextcharformat#setFontLetterSpacingType)**(QFont::SpacingType *letterSpacingType*) | | void | **[setFontOverline](qtextcharformat#setFontOverline)**(bool *overline*) | | void | **[setFontPointSize](qtextcharformat#setFontPointSize)**(qreal *size*) | | void | **[setFontStretch](qtextcharformat#setFontStretch)**(int *factor*) | | void | **[setFontStrikeOut](qtextcharformat#setFontStrikeOut)**(bool *strikeOut*) | | void | **[setFontStyleHint](qtextcharformat#setFontStyleHint)**(QFont::StyleHint *hint*, QFont::StyleStrategy *strategy* = QFont::PreferDefault) | | void | **[setFontStyleName](qtextcharformat#setFontStyleName)**(const QString &*styleName*) | | void | **[setFontStyleStrategy](qtextcharformat#setFontStyleStrategy)**(QFont::StyleStrategy *strategy*) | | void | **[setFontUnderline](qtextcharformat#setFontUnderline)**(bool *underline*) | | void | **[setFontWeight](qtextcharformat#setFontWeight)**(int *weight*) | | void | **[setFontWordSpacing](qtextcharformat#setFontWordSpacing)**(qreal *spacing*) | | void | **[setSubScriptBaseline](qtextcharformat#setSubScriptBaseline)**(qreal *baseline*) | | void | **[setSuperScriptBaseline](qtextcharformat#setSuperScriptBaseline)**(qreal *baseline*) | | void | **[setTextOutline](qtextcharformat#setTextOutline)**(const QPen &*pen*) | | void | **[setToolTip](qtextcharformat#setToolTip)**(const QString &*text*) | | void | **[setUnderlineColor](qtextcharformat#setUnderlineColor)**(const QColor &*color*) | | void | **[setUnderlineStyle](qtextcharformat#setUnderlineStyle)**(QTextCharFormat::UnderlineStyle *style*) | | void | **[setVerticalAlignment](qtextcharformat#setVerticalAlignment)**(QTextCharFormat::VerticalAlignment *alignment*) | | qreal | **[subScriptBaseline](qtextcharformat#subScriptBaseline)**() const | | qreal | **[superScriptBaseline](qtextcharformat#superScriptBaseline)**() const | | QPen | **[textOutline](qtextcharformat#textOutline)**() const | | QString | **[toolTip](qtextcharformat#toolTip)**() const | | QColor | **[underlineColor](qtextcharformat#underlineColor)**() const | | QTextCharFormat::UnderlineStyle | **[underlineStyle](qtextcharformat#underlineStyle)**() const | | QTextCharFormat::VerticalAlignment | **[verticalAlignment](qtextcharformat#verticalAlignment)**() const | Detailed Description -------------------- The character format of text in a document specifies the visual properties of the text, as well as information about its role in a hypertext document. The font used can be set by supplying a font to the [setFont](qtextcharformat#setFont)() function, and each aspect of its appearance can be adjusted to give the desired effect. [setFontFamilies](qtextcharformat#setFontFamilies)() and [setFontPointSize](qtextcharformat#setFontPointSize)() define the font's family (e.g. Times) and printed size; [setFontWeight](qtextcharformat#setFontWeight)() and [setFontItalic](qtextcharformat#setFontItalic)() provide control over the style of the font. [setFontUnderline](qtextcharformat#setFontUnderline)(), [setFontOverline](qtextcharformat#setFontOverline)(), [setFontStrikeOut](qtextcharformat#setFontStrikeOut)(), and [setFontFixedPitch](qtextcharformat#setFontFixedPitch)() provide additional effects for text. The color is set with [setForeground](qtextformat#setForeground)(). If the text is intended to be used as an anchor (for hyperlinks), this can be enabled with [setAnchor](qtextcharformat#setAnchor)(). The [setAnchorHref](qtextcharformat#setAnchorHref)() and [setAnchorNames](qtextcharformat#setAnchorNames)() functions are used to specify the information about the hyperlink's destination and the anchor's name. **See also** [QTextFormat](qtextformat), [QTextBlockFormat](qtextblockformat), [QTextTableFormat](qtexttableformat), and [QTextListFormat](qtextlistformat). Member Type Documentation ------------------------- ### `[since 5.3]` enum QTextCharFormat::FontPropertiesInheritanceBehavior This enum specifies how the [setFont](qtextcharformat#setFont)() function should behave with respect to unset font properties. | Constant | Value | Description | | --- | --- | --- | | `QTextCharFormat::FontPropertiesSpecifiedOnly` | `0` | If a property is not explicitly set, do not change the text format's property value. | | `QTextCharFormat::FontPropertiesAll` | `1` | If a property is not explicitly set, override the text format's property with a default value. | This enum was introduced or modified in Qt 5.3. **See also** [setFont](qtextcharformat#setFont)(). ### enum QTextCharFormat::UnderlineStyle This enum describes the different ways drawing underlined text. | Constant | Value | Description | | --- | --- | --- | | `QTextCharFormat::NoUnderline` | `0` | Text is draw without any underlining decoration. | | `QTextCharFormat::SingleUnderline` | `1` | A line is drawn using [Qt::SolidLine](qt#PenStyle-enum). | | `QTextCharFormat::DashUnderline` | `2` | Dashes are drawn using [Qt::DashLine](qt#PenStyle-enum). | | `QTextCharFormat::DotLine` | `3` | Dots are drawn using [Qt::DotLine](qt#PenStyle-enum); | | `QTextCharFormat::DashDotLine` | `4` | Dashes and dots are drawn using [Qt::DashDotLine](qt#PenStyle-enum). | | `QTextCharFormat::DashDotDotLine` | `5` | Underlines draw drawn using [Qt::DashDotDotLine](qt#PenStyle-enum). | | `QTextCharFormat::WaveUnderline` | `6` | The text is underlined using a wave shaped line. | | `QTextCharFormat::SpellCheckUnderline` | `7` | The underline is drawn depending on the SpellCheckUnderlineStyle theme hint of QPlatformTheme. By default this is mapped to WaveUnderline, on macOS it is mapped to DotLine. | **See also** [Qt::PenStyle](qt#PenStyle-enum). ### enum QTextCharFormat::VerticalAlignment This enum describes the ways that adjacent characters can be vertically aligned. | Constant | Value | Description | | --- | --- | --- | | `QTextCharFormat::AlignNormal` | `0` | Adjacent characters are positioned in the standard way for text in the writing system in use. | | `QTextCharFormat::AlignSuperScript` | `1` | Characters are placed above the base line for normal text. | | `QTextCharFormat::AlignSubScript` | `2` | Characters are placed below the base line for normal text. | | `QTextCharFormat::AlignMiddle` | `3` | The center of the object is vertically aligned with the base line. Currently, this is only implemented for inline objects. | | `QTextCharFormat::AlignBottom` | `5` | The bottom edge of the object is vertically aligned with the base line. | | `QTextCharFormat::AlignTop` | `4` | The top edge of the object is vertically aligned with the base line. | | `QTextCharFormat::AlignBaseline` | `6` | The base lines of the characters are aligned. | Member Function Documentation ----------------------------- ### QTextCharFormat::QTextCharFormat() Constructs a new character format object. ### [QString](qstring) QTextCharFormat::anchorHref() const Returns the text format's hypertext link, or an empty string if none has been set. **See also** [setAnchorHref](qtextcharformat#setAnchorHref)(). ### [QStringList](qstringlist) QTextCharFormat::anchorNames() const Returns the anchor names associated with this text format, or an empty string list if none has been set. If the anchor names are set, text with this format can be the destination of a hypertext link. **See also** [setAnchorNames](qtextcharformat#setAnchorNames)(). ### `[since 6.0]` [qreal](qtglobal#qreal-typedef) QTextCharFormat::baselineOffset() const Returns the the baseline offset in %. This function was introduced in Qt 6.0. **See also** [setBaselineOffset](qtextcharformat#setBaselineOffset)(), [setSubScriptBaseline](qtextcharformat#setSubScriptBaseline)(), [subScriptBaseline](qtextcharformat#subScriptBaseline)(), [setSuperScriptBaseline](qtextcharformat#setSuperScriptBaseline)(), and [superScriptBaseline](qtextcharformat#superScriptBaseline)(). ### [QFont](qfont) QTextCharFormat::font() const Returns the font for this character format. **See also** [setFont](qtextcharformat#setFont)(). ### [QFont::Capitalization](qfont#Capitalization-enum) QTextCharFormat::fontCapitalization() const Returns the current capitalization type of the font. **See also** [setFontCapitalization](qtextcharformat#setFontCapitalization)(). ### `[since 5.13]` [QVariant](qvariant) QTextCharFormat::fontFamilies() const Returns the text format's font families. This function was introduced in Qt 5.13. **See also** [setFontFamilies](qtextcharformat#setFontFamilies)() and [font](qtextcharformat#font)(). ### bool QTextCharFormat::fontFixedPitch() const Returns `true` if the text format's font is fixed pitch; otherwise returns `false`. **See also** [setFontFixedPitch](qtextcharformat#setFontFixedPitch)() and [font](qtextcharformat#font)(). ### [QFont::HintingPreference](qfont#HintingPreference-enum) QTextCharFormat::fontHintingPreference() const Returns the hinting preference set for this text format. **See also** [setFontHintingPreference](qtextcharformat#setFontHintingPreference)(), [font](qtextcharformat#font)(), and [QFont::hintingPreference](qfont#hintingPreference)(). ### bool QTextCharFormat::fontItalic() const Returns `true` if the text format's font is italic; otherwise returns `false`. **See also** [setFontItalic](qtextcharformat#setFontItalic)() and [font](qtextcharformat#font)(). ### bool QTextCharFormat::fontKerning() const Returns `true` if the font kerning is enabled. **See also** [setFontKerning](qtextcharformat#setFontKerning)() and [font](qtextcharformat#font)(). ### [qreal](qtglobal#qreal-typedef) QTextCharFormat::fontLetterSpacing() const Returns the current letter spacing. **See also** [setFontLetterSpacing](qtextcharformat#setFontLetterSpacing)(), [setFontLetterSpacingType](qtextcharformat#setFontLetterSpacingType)(), and [fontLetterSpacingType](qtextcharformat#fontLetterSpacingType)(). ### `[since 5.0]` [QFont::SpacingType](qfont#SpacingType-enum) QTextCharFormat::fontLetterSpacingType() const Returns the letter spacing type of this format.. This function was introduced in Qt 5.0. **See also** [setFontLetterSpacingType](qtextcharformat#setFontLetterSpacingType)(), [setFontLetterSpacing](qtextcharformat#setFontLetterSpacing)(), and [fontLetterSpacing](qtextcharformat#fontLetterSpacing)(). ### bool QTextCharFormat::fontOverline() const Returns `true` if the text format's font is overlined; otherwise returns `false`. **See also** [setFontOverline](qtextcharformat#setFontOverline)() and [font](qtextcharformat#font)(). ### [qreal](qtglobal#qreal-typedef) QTextCharFormat::fontPointSize() const Returns the font size used to display text in this format. **See also** [setFontPointSize](qtextcharformat#setFontPointSize)() and [font](qtextcharformat#font)(). ### `[since 5.0]` int QTextCharFormat::fontStretch() const Returns the current font stretching. This function was introduced in Qt 5.0. **See also** [setFontStretch](qtextcharformat#setFontStretch)(). ### bool QTextCharFormat::fontStrikeOut() const Returns `true` if the text format's font is struck out (has a horizontal line drawn through it); otherwise returns `false`. **See also** [setFontStrikeOut](qtextcharformat#setFontStrikeOut)() and [font](qtextcharformat#font)(). ### [QFont::StyleHint](qfont#StyleHint-enum) QTextCharFormat::fontStyleHint() const Returns the font style hint. **See also** [setFontStyleHint](qtextcharformat#setFontStyleHint)() and [font](qtextcharformat#font)(). ### `[since 5.13]` [QVariant](qvariant) QTextCharFormat::fontStyleName() const Returns the text format's font style name. This function was introduced in Qt 5.13. **See also** [setFontStyleName](qtextcharformat#setFontStyleName)(), [font](qtextcharformat#font)(), and [QFont::styleName](qfont#styleName)(). ### [QFont::StyleStrategy](qfont#StyleStrategy-enum) QTextCharFormat::fontStyleStrategy() const Returns the current font style strategy. **See also** [setFontStyleStrategy](qtextcharformat#setFontStyleStrategy)() and [font](qtextcharformat#font)(). ### bool QTextCharFormat::fontUnderline() const Returns `true` if the text format's font is underlined; otherwise returns `false`. **See also** [setFontUnderline](qtextcharformat#setFontUnderline)() and [font](qtextcharformat#font)(). ### int QTextCharFormat::fontWeight() const Returns the text format's font weight. **See also** [setFontWeight](qtextcharformat#setFontWeight)(), [font](qtextcharformat#font)(), and [QFont::Weight](qfont#Weight-enum). ### [qreal](qtglobal#qreal-typedef) QTextCharFormat::fontWordSpacing() const Returns the current word spacing value. **See also** [setFontWordSpacing](qtextcharformat#setFontWordSpacing)(). ### bool QTextCharFormat::isAnchor() const Returns `true` if the text is formatted as an anchor; otherwise returns `false`. **See also** [setAnchor](qtextcharformat#setAnchor)(), [setAnchorHref](qtextcharformat#setAnchorHref)(), and [setAnchorNames](qtextcharformat#setAnchorNames)(). ### bool QTextCharFormat::isValid() const Returns `true` if this character format is valid; otherwise returns false. ### void QTextCharFormat::setAnchor(bool *anchor*) If *anchor* is true, text with this format represents an anchor, and is formatted in the appropriate way; otherwise the text is formatted normally. (Anchors are hyperlinks which are often shown underlined and in a different color from plain text.) The way the text is rendered is independent of whether or not the format has a valid anchor defined. Use [setAnchorHref](qtextcharformat#setAnchorHref)(), and optionally [setAnchorNames](qtextcharformat#setAnchorNames)() to create a hypertext link. **See also** [isAnchor](qtextcharformat#isAnchor)(). ### void QTextCharFormat::setAnchorHref(const [QString](qstring) &*value*) Sets the hypertext link for the text format to the given *value*. This is typically a URL like "http://example.com/index.html". The anchor will be displayed with the *value* as its display text; if you want to display different text call [setAnchorNames](qtextcharformat#setAnchorNames)(). To format the text as a hypertext link use [setAnchor](qtextcharformat#setAnchor)(). **See also** [anchorHref](qtextcharformat#anchorHref)(). ### void QTextCharFormat::setAnchorNames(const [QStringList](qstringlist) &*names*) Sets the text format's anchor *names*. For the anchor to work as a hyperlink, the destination must be set with [setAnchorHref](qtextcharformat#setAnchorHref)() and the anchor must be enabled with [setAnchor](qtextcharformat#setAnchor)(). **See also** [anchorNames](qtextcharformat#anchorNames)(). ### `[since 6.0]` void QTextCharFormat::setBaselineOffset([qreal](qtglobal#qreal-typedef) *baseline*) Sets the base line (in % of height) of text to *baseline*. A positive value moves the text up, by the corresponding %; a negative value moves it down. The default value is 0. This function was introduced in Qt 6.0. **See also** [baselineOffset](qtextcharformat#baselineOffset)(), [setSubScriptBaseline](qtextcharformat#setSubScriptBaseline)(), [subScriptBaseline](qtextcharformat#subScriptBaseline)(), [setSuperScriptBaseline](qtextcharformat#setSuperScriptBaseline)(), and [superScriptBaseline](qtextcharformat#superScriptBaseline)(). ### `[since 5.3]` void QTextCharFormat::setFont(const [QFont](qfont) &*font*, [QTextCharFormat::FontPropertiesInheritanceBehavior](qtextcharformat#FontPropertiesInheritanceBehavior-enum) *behavior* = FontPropertiesAll) Sets the text format's *font*. If *behavior* is [QTextCharFormat::FontPropertiesAll](qtextcharformat#FontPropertiesInheritanceBehavior-enum), the font property that has not been explicitly set is treated like as it were set with default value; If *behavior* is [QTextCharFormat::FontPropertiesSpecifiedOnly](qtextcharformat#FontPropertiesInheritanceBehavior-enum), the font property that has not been explicitly set is ignored and the respective property value remains unchanged. This function was introduced in Qt 5.3. **See also** [font](qtextcharformat#font)(). ### void QTextCharFormat::setFontCapitalization([QFont::Capitalization](qfont#Capitalization-enum) *capitalization*) Sets the capitalization of the text that appears in this font to *capitalization*. A font's capitalization makes the text appear in the selected capitalization mode. **See also** [fontCapitalization](qtextcharformat#fontCapitalization)(). ### `[since 5.13]` void QTextCharFormat::setFontFamilies(const [QStringList](qstringlist) &*families*) Sets the text format's font *families*. This function was introduced in Qt 5.13. **See also** [fontFamilies](qtextcharformat#fontFamilies)() and [setFont](qtextcharformat#setFont)(). ### void QTextCharFormat::setFontFixedPitch(bool *fixedPitch*) If *fixedPitch* is true, sets the text format's font to be fixed pitch; otherwise a non-fixed pitch font is used. **See also** [fontFixedPitch](qtextcharformat#fontFixedPitch)() and [setFont](qtextcharformat#setFont)(). ### void QTextCharFormat::setFontHintingPreference([QFont::HintingPreference](qfont#HintingPreference-enum) *hintingPreference*) Sets the hinting preference of the text format's font to be *hintingPreference*. **See also** [fontHintingPreference](qtextcharformat#fontHintingPreference)(), [setFont](qtextcharformat#setFont)(), and [QFont::setHintingPreference](qfont#setHintingPreference)(). ### void QTextCharFormat::setFontItalic(bool *italic*) If *italic* is true, sets the text format's font to be italic; otherwise the font will be non-italic. **See also** [fontItalic](qtextcharformat#fontItalic)() and [setFont](qtextcharformat#setFont)(). ### void QTextCharFormat::setFontKerning(bool *enable*) Enables kerning for this font if *enable* is true; otherwise disables it. When kerning is enabled, glyph metrics do not add up anymore, even for Latin text. In other words, the assumption that width('a') + width('b') is equal to width("ab") is not neccesairly true. **See also** [fontKerning](qtextcharformat#fontKerning)() and [setFont](qtextcharformat#setFont)(). ### void QTextCharFormat::setFontLetterSpacing([qreal](qtglobal#qreal-typedef) *spacing*) Sets the letter spacing of this format to the given *spacing*. The meaning of the value depends on the font letter spacing type. For percentage spacing a value of 100 indicates default spacing; a value of 200 doubles the amount of space a letter takes. **See also** [fontLetterSpacing](qtextcharformat#fontLetterSpacing)(), [setFontLetterSpacingType](qtextcharformat#setFontLetterSpacingType)(), and [fontLetterSpacingType](qtextcharformat#fontLetterSpacingType)(). ### `[since 5.0]` void QTextCharFormat::setFontLetterSpacingType([QFont::SpacingType](qfont#SpacingType-enum) *letterSpacingType*) Sets the letter spacing type of this format to *letterSpacingType*. This function was introduced in Qt 5.0. **See also** [fontLetterSpacingType](qtextcharformat#fontLetterSpacingType)(), [setFontLetterSpacing](qtextcharformat#setFontLetterSpacing)(), and [fontLetterSpacing](qtextcharformat#fontLetterSpacing)(). ### void QTextCharFormat::setFontOverline(bool *overline*) If *overline* is true, sets the text format's font to be overlined; otherwise the font is displayed non-overlined. **See also** [fontOverline](qtextcharformat#fontOverline)() and [setFont](qtextcharformat#setFont)(). ### void QTextCharFormat::setFontPointSize([qreal](qtglobal#qreal-typedef) *size*) Sets the text format's font *size*. **See also** [fontPointSize](qtextcharformat#fontPointSize)() and [setFont](qtextcharformat#setFont)(). ### `[since 5.0]` void QTextCharFormat::setFontStretch(int *factor*) Sets the stretch factor for the font to *factor*. The stretch factor changes the width of all characters in the font by factor percent. For example, setting *factor* to 150 results in all characters in the font being 1.5 times (ie. 150%) wider. The default stretch factor is 100. The minimum stretch factor is 1, and the maximum stretch factor is 4000. The stretch factor is only applied to outline fonts. The stretch factor is ignored for bitmap fonts. This function was introduced in Qt 5.0. **See also** [fontStretch](qtextcharformat#fontStretch)(). ### void QTextCharFormat::setFontStrikeOut(bool *strikeOut*) If *strikeOut* is true, sets the text format's font with strike-out enabled (with a horizontal line through it); otherwise it is displayed without strikeout. **See also** [fontStrikeOut](qtextcharformat#fontStrikeOut)() and [setFont](qtextcharformat#setFont)(). ### void QTextCharFormat::setFontStyleHint([QFont::StyleHint](qfont#StyleHint-enum) *hint*, [QFont::StyleStrategy](qfont#StyleStrategy-enum) *strategy* = QFont::PreferDefault) Sets the font style *hint* and *strategy*. Qt does not support style hints on X11 since this information is not provided by the window system. **See also** [fontStyleHint](qtextcharformat#fontStyleHint)(), [setFont](qtextcharformat#setFont)(), and [QFont::setStyleHint](qfont#setStyleHint)(). ### `[since 5.13]` void QTextCharFormat::setFontStyleName(const [QString](qstring) &*styleName*) Sets the text format's font *styleName*. This function was introduced in Qt 5.13. **See also** [fontStyleName](qtextcharformat#fontStyleName)(), [setFont](qtextcharformat#setFont)(), and [QFont::setStyleName](qfont#setStyleName)(). ### void QTextCharFormat::setFontStyleStrategy([QFont::StyleStrategy](qfont#StyleStrategy-enum) *strategy*) Sets the font style *strategy*. **See also** [fontStyleStrategy](qtextcharformat#fontStyleStrategy)(), [setFont](qtextcharformat#setFont)(), and [QFont::setStyleStrategy](qfont#setStyleStrategy)(). ### void QTextCharFormat::setFontUnderline(bool *underline*) If *underline* is true, sets the text format's font to be underlined; otherwise it is displayed non-underlined. **See also** [fontUnderline](qtextcharformat#fontUnderline)() and [setFont](qtextcharformat#setFont)(). ### void QTextCharFormat::setFontWeight(int *weight*) Sets the text format's font weight to *weight*. **See also** [fontWeight](qtextcharformat#fontWeight)(), [setFont](qtextcharformat#setFont)(), and [QFont::Weight](qfont#Weight-enum). ### void QTextCharFormat::setFontWordSpacing([qreal](qtglobal#qreal-typedef) *spacing*) Sets the word spacing of this format to the given *spacing*, in pixels. **See also** [fontWordSpacing](qtextcharformat#fontWordSpacing)(). ### `[since 6.0]` void QTextCharFormat::setSubScriptBaseline([qreal](qtglobal#qreal-typedef) *baseline*) Sets the subscript's base line as a % of font height to *baseline*. The default value is 16.67% (1/6 of height) This function was introduced in Qt 6.0. **See also** [subScriptBaseline](qtextcharformat#subScriptBaseline)(), [setSuperScriptBaseline](qtextcharformat#setSuperScriptBaseline)(), [superScriptBaseline](qtextcharformat#superScriptBaseline)(), [setBaselineOffset](qtextcharformat#setBaselineOffset)(), and [baselineOffset](qtextcharformat#baselineOffset)(). ### `[since 6.0]` void QTextCharFormat::setSuperScriptBaseline([qreal](qtglobal#qreal-typedef) *baseline*) Sets the superscript's base line as a % of font height to *baseline*. The default value is 50% (1/2 of height). This function was introduced in Qt 6.0. **See also** [superScriptBaseline](qtextcharformat#superScriptBaseline)(), [setSubScriptBaseline](qtextcharformat#setSubScriptBaseline)(), [subScriptBaseline](qtextcharformat#subScriptBaseline)(), [setBaselineOffset](qtextcharformat#setBaselineOffset)(), and [baselineOffset](qtextcharformat#baselineOffset)(). ### void QTextCharFormat::setTextOutline(const [QPen](qpen) &*pen*) Sets the pen used to draw the outlines of characters to the given *pen*. **See also** [textOutline](qtextcharformat#textOutline)(). ### void QTextCharFormat::setToolTip(const [QString](qstring) &*text*) Sets the tool tip for a fragment of text to the given *text*. **See also** [toolTip](qtextcharformat#toolTip)(). ### void QTextCharFormat::setUnderlineColor(const [QColor](qcolor) &*color*) Sets the color used to draw underlines, overlines and strikeouts on the characters with this format to the *color* specified. **See also** [underlineColor](qtextcharformat#underlineColor)(). ### void QTextCharFormat::setUnderlineStyle([QTextCharFormat::UnderlineStyle](qtextcharformat#UnderlineStyle-enum) *style*) Sets the style of underlining the text to *style*. **See also** [underlineStyle](qtextcharformat#underlineStyle)(). ### void QTextCharFormat::setVerticalAlignment([QTextCharFormat::VerticalAlignment](qtextcharformat#VerticalAlignment-enum) *alignment*) Sets the vertical alignment used for the characters with this format to the *alignment* specified. **See also** [verticalAlignment](qtextcharformat#verticalAlignment)(). ### `[since 6.0]` [qreal](qtglobal#qreal-typedef) QTextCharFormat::subScriptBaseline() const Returns the subscript's base line as a % of font height. This function was introduced in Qt 6.0. **See also** [setSubScriptBaseline](qtextcharformat#setSubScriptBaseline)(), [setSuperScriptBaseline](qtextcharformat#setSuperScriptBaseline)(), [superScriptBaseline](qtextcharformat#superScriptBaseline)(), [setBaselineOffset](qtextcharformat#setBaselineOffset)(), and [baselineOffset](qtextcharformat#baselineOffset)(). ### `[since 6.0]` [qreal](qtglobal#qreal-typedef) QTextCharFormat::superScriptBaseline() const Returns the superscript's base line as a % of font height. This function was introduced in Qt 6.0. **See also** [setSuperScriptBaseline](qtextcharformat#setSuperScriptBaseline)(), [setSubScriptBaseline](qtextcharformat#setSubScriptBaseline)(), [subScriptBaseline](qtextcharformat#subScriptBaseline)(), [setBaselineOffset](qtextcharformat#setBaselineOffset)(), and [baselineOffset](qtextcharformat#baselineOffset)(). ### [QPen](qpen) QTextCharFormat::textOutline() const Returns the pen used to draw the outlines of characters in this format. **See also** [setTextOutline](qtextcharformat#setTextOutline)(). ### [QString](qstring) QTextCharFormat::toolTip() const Returns the tool tip that is displayed for a fragment of text. **See also** [setToolTip](qtextcharformat#setToolTip)(). ### [QColor](qcolor) QTextCharFormat::underlineColor() const Returns the color used to draw underlines, overlines and strikeouts on the characters with this format. **See also** [setUnderlineColor](qtextcharformat#setUnderlineColor)(). ### [QTextCharFormat::UnderlineStyle](qtextcharformat#UnderlineStyle-enum) QTextCharFormat::underlineStyle() const Returns the style of underlining the text. **See also** [setUnderlineStyle](qtextcharformat#setUnderlineStyle)(). ### [QTextCharFormat::VerticalAlignment](qtextcharformat#VerticalAlignment-enum) QTextCharFormat::verticalAlignment() const Returns the vertical alignment used for characters with this format. **See also** [setVerticalAlignment](qtextcharformat#setVerticalAlignment)().
programming_docs
qt PickResult QML Type PickResult QML Type =================== Contains the results of a pick. [More...](#details) | | | | --- | --- | | Import Statement: | import QtQuick3D | * [List of all members, including inherited members](https://doc.qt.io/qt-6.2/qml-qtquick3d-pickresult-members.html) Properties ---------- * **[distance](qml-qtquick3d-pickresult#distance-prop)** : float * **[normal](qml-qtquick3d-pickresult#normal-prop)** : vector3d * **[objectHit](qml-qtquick3d-pickresult#objectHit-prop)** : Model * **[position](qml-qtquick3d-pickresult#position-prop)** : vector3d * **[sceneNormal](qml-qtquick3d-pickresult#sceneNormal-prop)** : vector3d * **[scenePosition](qml-qtquick3d-pickresult#scenePosition-prop)** : vector3d * **[uvPosition](qml-qtquick3d-pickresult#uvPosition-prop)** : vector2d Detailed Description -------------------- Created as a return object to [View3D::pick](qml-qtquick3d-view3d#pick-method). Property Documentation ---------------------- ### [read-only] distance : float This property holds the distance between the pick origin and the hit position i.e. the length of the ray. In the case of using viewport coordinates for picking the pick origin will be the active camera's position. ### [read-only] normal : [vector3d](qml-vector3d) This property holds the normal of the face that was hit in local coordinate space. ### [read-only] objectHit : [Model](qml-qtquick3d-model) This property holds the model object hit by the pick. ### [read-only] position : [vector3d](qml-vector3d) This property holds the scene position of the hit in local coordinate space. ### [read-only] sceneNormal : [vector3d](qml-vector3d) This property holds the normal of the face that was hit in scene coordinate space. ### [read-only] scenePosition : [vector3d](qml-vector3d) This property holds the scene position of the hit. ### [read-only] uvPosition : [vector2d](qml-vector2d) This property holds the UV position of the hit. The UV position is calculated as the normalized local x and y coordinates of the hit point relative to the bounding volume. Useful for further picking against an offscreen-rendered object. qt QHashSeed Struct QHashSeed Struct ================ | | | | --- | --- | | Header: | #include <QHashSeed> | | CMake: | find\_package(Qt6 COMPONENTS Core REQUIRED) target\_link\_libraries(mytarget PRIVATE Qt6::Core) | | qmake: | QT += core | | Since: | Qt 6.2 | * [List of all members, including inherited members](https://doc.qt.io/qt-6.2/qhashseed-members.html) Public Functions ---------------- | | | | --- | --- | | | **[QHashSeed](qhashseed#QHashSeed)**(size\_t *data* = 0) | | size\_t | **[operator size\_t](qhashseed#operator-size_t)**() const | Static Public Members --------------------- | | | | --- | --- | | QHashSeed | **[globalSeed](qhashseed#globalSeed)**() | | void | **[resetRandomGlobalSeed](qhashseed#resetRandomGlobalSeed)**() | | void | **[setDeterministicGlobalSeed](qhashseed#setDeterministicGlobalSeed)**() | Detailed Description -------------------- The QHashSeed class is used to convey the [QHash](qhash#qhash) seed. This is used internally by [QHash](qhash#qhash) and provides three static member functions to allow users to obtain the hash and to reset it. [QHash](qhash#qhash) and the qHash() functions implement what is called as "salted hash". The intent is that different applications and different instances of the same application will produce different hashing values for the same input, thus causing the ordering of elements in [QHash](qhash#qhash) to be unpredictable by external observers. This improves the applications' resilience against attacks that attempt to force hashing tables into degenerate mode. Most applications will not need to deal directly with the hash seed, as [QHash](qhash#qhash) will do so when needed. However, applications may wish to use this for their own purposes in the same way as [QHash](qhash#qhash) does: as an application-global random value (but see [QRandomGenerator](qrandomgenerator) too). Note that the global hash seed may change during the application's lifetime, if the [resetRandomGlobalSeed](qhashseed#resetRandomGlobalSeed)() function is called. Users of the global hash need to store the value they are using and not rely on getting it again. This class also implements functionality to set the hash seed to a deterministic value, which the qHash() functions will take to mean that they should use a fixed hashing function on their data too. This functionality is only meant to be used in debugging applications. This behavior can also be controlled by setting the `QT_HASH_SEED` environment variable to the value zero (any other value is ignored). **See also** [QHash](qhash#qhash) and [QRandomGenerator](qrandomgenerator). Member Function Documentation ----------------------------- ### QHashSeed::QHashSeed(size\_t *data* = 0) Constructs a new QHashSeed object using *data* as the seed. ### `[static]` [QHashSeed](qhashseed#QHashSeed) QHashSeed::globalSeed() Returns the current global [QHash](qhash#qhash) seed. The value returned by this function will be zero if [setDeterministicGlobalSeed](qhashseed#setDeterministicGlobalSeed)() has been called or if the `QT_HASH_SEED` environment variable is set to zero. **Note:** This function is [thread-safe](threads-reentrancy). ### `[static]` void QHashSeed::resetRandomGlobalSeed() Reseeds the Qt hashing seed to a new, random value. Calling this function is not necessary, but long-running applications may want to do so after a long period of time in which information about its hash may have been exposed to potential attackers. If the environment variable `QT_HASH_SEED` is set to zero, calling this function will result in a no-op. Qt never calls this function during the execution of the application, but unless the `QT_HASH_SEED` variable is set to 0, the hash seed returned by [globalSeed](qhashseed#globalSeed)() will be a random value as if this function had been called. **Note:** This function is [thread-safe](threads-reentrancy). ### `[static]` void QHashSeed::setDeterministicGlobalSeed() Forces the Qt hash seed to a deterministic value (zero) and asks the qHash() functions to use a pre-determined hashing function. This mode is only useful for debugging and should not be used in production code. Regular operation can be restored by calling [resetRandomGlobalSeed](qhashseed#resetRandomGlobalSeed)(). **Note:** This function is [thread-safe](threads-reentrancy). ### size\_t QHashSeed::operator size\_t() const Converts the returned hash seed into a `size_t`. qt QIODeviceBase Class QIODeviceBase Class =================== Base class for [QIODevice](qiodevice) that provides flags describing the mode in which a device is opened. [More...](#details) | | | | --- | --- | | Header: | #include <[QIODevice](qiodevice)> | | CMake: | find\_package(Qt6 COMPONENTS Core REQUIRED) target\_link\_libraries(mytarget PRIVATE Qt6::Core) | | qmake: | QT += core | | Inherited By: | [QDataStream](qdatastream), [QDebug](qdebug), [QIODevice](qiodevice), and [QTextStream](qtextstream) | * [List of all members, including inherited members](https://doc.qt.io/qt-6.2/qiodevicebase-members.html) Public Types ------------ | | | | --- | --- | | flags | **[OpenMode](qiodevicebase#OpenModeFlag-enum)** | | enum | **[OpenModeFlag](qiodevicebase#OpenModeFlag-enum)** { NotOpen, ReadOnly, WriteOnly, ReadWrite, Append, …, ExistingOnly } | Detailed Description -------------------- Member Type Documentation ------------------------- ### enum QIODeviceBase::OpenModeFlagflags QIODeviceBase::OpenMode This enum is used with [QIODevice::open](qiodevice#open)() to describe the mode in which a device is opened. It is also returned by [QIODevice::openMode](qiodevice#openMode)(). | Constant | Value | Description | | --- | --- | --- | | `QIODeviceBase::NotOpen` | `0x0000` | The device is not open. | | `QIODeviceBase::ReadOnly` | `0x0001` | The device is open for reading. | | `QIODeviceBase::WriteOnly` | `0x0002` | The device is open for writing. Note that, for file-system subclasses (e.g. [QFile](qfile)), this mode implies Truncate unless combined with ReadOnly, Append or NewOnly. | | `QIODeviceBase::ReadWrite` | `ReadOnly | WriteOnly` | The device is open for reading and writing. | | `QIODeviceBase::Append` | `0x0004` | The device is opened in append mode so that all data is written to the end of the file. | | `QIODeviceBase::Truncate` | `0x0008` | If possible, the device is truncated before it is opened. All earlier contents of the device are lost. | | `QIODeviceBase::Text` | `0x0010` | When reading, the end-of-line terminators are translated to '\n'. When writing, the end-of-line terminators are translated to the local encoding, for example '\r\n' for Win32. | | `QIODeviceBase::Unbuffered` | `0x0020` | Any buffer in the device is bypassed. | | `QIODeviceBase::NewOnly` | `0x0040` | Fail if the file to be opened already exists. Create and open the file only if it does not exist. There is a guarantee from the operating system that you are the only one creating and opening the file. Note that this mode implies WriteOnly, and combining it with ReadWrite is allowed. This flag currently only affects [QFile](qfile). Other classes might use this flag in the future, but until then using this flag with any classes other than [QFile](qfile) may result in undefined behavior. (since Qt 5.11) | | `QIODeviceBase::ExistingOnly` | `0x0080` | Fail if the file to be opened does not exist. This flag must be specified alongside ReadOnly, WriteOnly, or ReadWrite. Note that using this flag with ReadOnly alone is redundant, as ReadOnly already fails when the file does not exist. This flag currently only affects [QFile](qfile). Other classes might use this flag in the future, but until then using this flag with any classes other than [QFile](qfile) may result in undefined behavior. (since Qt 5.11) | Certain flags, such as `Unbuffered` and `Truncate`, are meaningless when used with some subclasses. Some of these restrictions are implied by the type of device that is represented by a subclass. In other cases, the restriction may be due to the implementation, or may be imposed by the underlying platform; for example, [QTcpSocket](qtcpsocket) does not support `Unbuffered` mode, and limitations in the native API prevent [QFile](qfile) from supporting `Unbuffered` on Windows. The OpenMode type is a typedef for [QFlags](qflags)<OpenModeFlag>. It stores an OR combination of OpenModeFlag values. qt QGraphicsRotation Class QGraphicsRotation Class ======================= The QGraphicsRotation class provides a rotation transformation around a given axis. [More...](#details) | | | | --- | --- | | Header: | #include <QGraphicsRotation> | | CMake: | find\_package(Qt6 COMPONENTS Widgets REQUIRED) target\_link\_libraries(mytarget PRIVATE Qt6::Widgets) | | qmake: | QT += widgets | | Inherits: | [QGraphicsTransform](qgraphicstransform) | * [List of all members, including inherited members](https://doc.qt.io/qt-6.2/qgraphicsrotation-members.html) Properties ---------- * **[angle](qgraphicsrotation#angle-prop)** : qreal * **[axis](qgraphicsrotation#axis-prop)** : QVector3D * **[origin](qgraphicsrotation#origin-prop)** : QVector3D Public Functions ---------------- | | | | --- | --- | | | **[QGraphicsRotation](qgraphicsrotation#QGraphicsRotation)**(QObject \**parent* = nullptr) | | virtual | **[~QGraphicsRotation](qgraphicsrotation#dtor.QGraphicsRotation)**() | | qreal | **[angle](qgraphicsrotation#angle-prop)**() const | | QVector3D | **[axis](qgraphicsrotation#axis-prop)**() const | | QVector3D | **[origin](qgraphicsrotation#origin-prop)**() const | | void | **[setAngle](qgraphicsrotation#angle-prop)**(qreal) | | void | **[setAxis](qgraphicsrotation#axis-prop)**(const QVector3D &*axis*) | | void | **[setAxis](qgraphicsrotation#setAxis-1)**(Qt::Axis *axis*) | | void | **[setOrigin](qgraphicsrotation#origin-prop)**(const QVector3D &*point*) | Reimplemented Public Functions ------------------------------ | | | | --- | --- | | virtual void | **[applyTo](qgraphicsrotation#applyTo)**(QMatrix4x4 \**matrix*) const override | Signals ------- | | | | --- | --- | | void | **[angleChanged](qgraphicsrotation#angleChanged)**() | | void | **[axisChanged](qgraphicsrotation#axisChanged)**() | | void | **[originChanged](qgraphicsrotation#originChanged)**() | Detailed Description -------------------- You can provide the desired axis by assigning a [QVector3D](qvector3d) to the axis property or by passing a member if [Qt::Axis](qt#Axis-enum) to the [setAxis](qgraphicsrotation#axis-prop) convenience function. By default the axis is (0, 0, 1) i.e., rotation around the Z axis. The angle property, which is provided by QGraphicsRotation, now describes the number of degrees to rotate around this axis. QGraphicsRotation provides certain parameters to help control how the rotation should be applied. The origin is the point that the item is rotated around (i.e., it stays fixed relative to the parent as the rest of the item is rotated). By default the origin is [QPointF](qpointf)(0, 0). The angle property provides the number of degrees to rotate the item clockwise around the origin. This value also be negative, indicating a counter-clockwise rotation. For animation purposes it may also be useful to provide rotation angles exceeding (-360, 360) degrees, for instance to animate how an item rotates several times. Note: the final rotation is the combined effect of a rotation in 3D space followed by a projection back to 2D. If several rotations are performed in succession, they will not behave as expected unless they were all around the Z axis. **See also** [QGraphicsTransform](qgraphicstransform), [QGraphicsItem::setRotation](qgraphicsitem#setRotation)(), and [QTransform::rotate](qtransform#rotate)(). Property Documentation ---------------------- ### angle : [qreal](qtglobal#qreal-typedef) This property holds the angle for clockwise rotation, in degrees. The angle can be any real number; the default value is 0.0. A value of 180 will rotate 180 degrees, clockwise. If you provide a negative number, the item will be rotated counter-clockwise. Normally the rotation angle will be in the range (-360, 360), but you can also provide numbers outside of this range (e.g., a angle of 370 degrees gives the same result as 10 degrees). Setting the angle to NaN results in no rotation. **Access functions:** | | | | --- | --- | | qreal | **angle**() const | | void | **setAngle**(qreal) | **Notifier signal:** | | | | --- | --- | | void | **[angleChanged](qgraphicsrotation#angleChanged)**() | **See also** [origin](stylesheet-reference#origin). ### axis : [QVector3D](qvector3d) This property holds a rotation axis, specified by a vector in 3D space. This can be any axis in 3D space. By default the axis is (0, 0, 1), which is aligned with the Z axis. If you provide another axis, [QGraphicsRotation](qgraphicsrotation) will provide a transformation that rotates around this axis. For example, if you would like to rotate an item around its X axis, you could pass (1, 0, 0) as the axis. **Access functions:** | | | | --- | --- | | QVector3D | **axis**() const | | void | **setAxis**(const QVector3D &*axis*) | | void | **[setAxis](qgraphicsrotation#setAxis-1)**(Qt::Axis *axis*) | **Notifier signal:** | | | | --- | --- | | void | **[axisChanged](qgraphicsrotation#axisChanged)**() | **See also** [QTransform](qtransform) and [QGraphicsRotation::angle](qgraphicsrotation#angle-prop). ### origin : [QVector3D](qvector3d) This property holds the origin of the rotation in 3D space. All rotations will be done relative to this point (i.e., this point will stay fixed, relative to the parent, when the item is rotated). **Access functions:** | | | | --- | --- | | QVector3D | **origin**() const | | void | **setOrigin**(const QVector3D &*point*) | **Notifier signal:** | | | | --- | --- | | void | **[originChanged](qgraphicsrotation#originChanged)**() | **See also** [angle](qgraphicsrotation#angle-prop). Member Function Documentation ----------------------------- ### QGraphicsRotation::QGraphicsRotation([QObject](qobject#QObject) \**parent* = nullptr) Constructs a new QGraphicsRotation with the given *parent*. ### `[signal]` void QGraphicsRotation::angleChanged() This signal is emitted whenever the angle has changed. **Note:** Notifier signal for property [angle](qgraphicsrotation#angle-prop). **See also** [QGraphicsRotation::angle](qgraphicsrotation#angle-prop). ### `[signal]` void QGraphicsRotation::axisChanged() This signal is emitted whenever the axis of the object changes. **Note:** Notifier signal for property [axis](qgraphicsrotation#axis-prop). **See also** [QGraphicsRotation::axis](qgraphicsrotation#axis-prop). ### `[signal]` void QGraphicsRotation::originChanged() This signal is emitted whenever the origin has changed. **Note:** Notifier signal for property [origin](stylesheet-reference#origin). **See also** [QGraphicsRotation::origin](qgraphicsrotation#origin-prop). ### `[virtual]` QGraphicsRotation::~QGraphicsRotation() Destroys the graphics rotation. ### `[override virtual]` void QGraphicsRotation::applyTo([QMatrix4x4](qmatrix4x4) \**matrix*) const Reimplements: [QGraphicsTransform::applyTo(QMatrix4x4 \*matrix) const](qgraphicstransform#applyTo). ### void QGraphicsRotation::setAxis([Qt::Axis](qt#Axis-enum) *axis*) Convenience function to set the axis to *axis*. Note: the [Qt::YAxis](qt#Axis-enum) rotation for [QTransform](qtransform) is inverted from the correct mathematical rotation in 3D space. The [QGraphicsRotation](qgraphicsrotation) class implements a correct mathematical rotation. The following two sequences of code will perform the same transformation: ``` QTransform t; t.rotate(45, Qt::YAxis); QGraphicsRotation r; r.setAxis(Qt::YAxis); r.setAngle(-45); ``` **Note:** Setter function for property [axis](qgraphicsrotation#axis-prop). qt Building ActiveX servers in Qt Building ActiveX servers in Qt ============================== The [QAxServer](https://doc.qt.io/qt-6.2/qaxserver-module.html) module is part of the [ActiveQt](activeqt-index) framework. It consists of three classes: * [QAxFactory](qaxfactory) defines a factory for the creation of COM objects. * [QAxBindable](qaxbindable) provides an interface between the Qt widget and the COM object. * [QAxAggregated](qaxaggregated) can be subclassed to implement additional COM interfaces. Some [example implementations](activeqt-index#activeqt-examples) of ActiveX controls and COM objects are provided. Topics: Using the Library ----------------- To turn a standard Qt application into a COM server using the [QAxServer](https://doc.qt.io/qt-6.2/qaxserver-module.html) library you must add `axserver` to the QT variable in your `.pro` file. An out-of-process executable server is generated from a `.pro` file like this: ``` TEMPLATE = app QT += axserver RC_FILE = qaxserver.rc ... ``` To build an in-process server, use a `.pro` file like this: ``` TEMPLATE = lib QT += axserver CONFIG += dll DEF_FILE = qaxserver.def RC_FILE = qaxserver.rc ... ``` The files `qaxserver.rc` and `qaxserver.def` are part of the framework and can be used from their usual location (specify a path in the `.pro` file), or copied into the project directory. You can modify these files as long as it includes any file as the type library entry, ie. you can add version information or specify a different toolbox icon. Using the `axserver` module will cause the `qmake` tool to add the required build steps to the build system: * Link the binary against `qaxserver.lib` instead of `qtmain.lib` * Call the [idc](activeqt-idc) tool to generate an IDL file for the COM server * Compile the IDL into a type library using the MIDL tool (part of the compiler installation) * Attach the resulting type library as a binary resource to the server binary (again using the [idc](activeqt-idc) tool) * Register the server. This step may require administrative privileges and can be skipped by setting the `qaxserver_no_register` configuration. To skip the post-processing step, also set the `qaxserver_no_postlink` configuration. Additionally you can specify a version number using the `VERSION` variable, e.g. ``` TEMPLATE = lib VERSION = 2.5 ... ``` The version number specified will be used as the version of the type library and of the server when registering. ### Out-of-Process vs. In-Process Whether your COM server should run as a stand-alone executable or as a shared library in the client process depends mainly on the type of COM objects you want to provide in the server. An executable server has the advantage of being able to run as a stand-alone application, but adds considerable overhead to the communication between the COM client and the COM object. If the control has a programming error only the server process running the control will crash, and the client application will probably continue to run. Not all COM clients support executable servers. An in-process server is usually smaller and has faster startup time. The communication between client and server is done directly through virtual function calls and does not introduce the overhead required for remote procedure calls. However, if the server crashes the client application is likely to crash as well, and not every functionality is available for in-process servers (i.e. register in the COM's running-object-table). Both server types can use Qt either as a shared library, or statically linked into the server binary. ### Typical Errors During the Post-Build Steps For the ActiveQt specific post-processing steps to work the server has to meet some requirements: * All controls exposed can be created with nothing but a [QApplication](qapplication) instance being present * The initial linking of the server includes a temporary type library resource * All dependencies required to run the server are in the system path (or in the path used by the calling environment; note that Visual Studio has its own set of environment variables listed in the Tools|Options|Directories dialog). If those requirements are not met one ore more of the following errors are likely to occur: #### The Server Executable Crashes To generate the IDL the widgets exposed as ActiveX controls need to be instantiated (the constructor is called). At this point, nothing else but a [QApplication](qapplication) object exists. Your widget constructor must not rely on any other objects to be created, e.g. it should check for null-pointers. To debug your server run it with -dumpidl outputfile and check where it crashes. Note that no functions of the control are called. #### The Server Executable Is Not a Valid Win32 Application Attaching the type library corrupted the server binary. This is a bug in Windows and happens only with release builds. The first linking step has to link a dummy type library into the executable that can later be replaced by idc. Add a resource file with a type library to your project as demonstrated in the examples. #### "Unable to locate DLL" The build system needs to run the server executable to generate the interface definition, and to register the server. If a dynamic link library the server links against is not in the path this might fail (e.g. Visual Studio calls the server using the environment settings specified in the "Directories" option). Make sure that all DLLs and plugins required by your server are located in a directory that is listed in the path as printed in the error message box (see also [The Windows Deployment Tool](https://doc.qt.io/qt-6.2/windows-deployment.html#the-windows-deployment-tool)). #### "Cannot open file ..." The ActiveX server could not shut down properly when the last client stopped using it. It usually takes about two seconds for the application to terminate, but you might have to use the task manager to kill the process (e.g. when a client doesn't release the controls properly). #### The Control Cannot be Instantiated In this case, it may help to register the server as Administrator. Implementing Controls --------------------- To implement a COM object with Qt, create a subclass of [QObject](qobject) or any existing [QObject](qobject) subclass. If the class is a subclass of [QWidget](qwidget), the COM object will be an ActiveX control. ``` #include <QWidget> class MyActiveX : public QWidget { Q_OBJECT ``` The [Q\_OBJECT](qobject#Q_OBJECT) macro is required to provide the meta object information about the widget to the ActiveQt framework. ``` Q_CLASSINFO("ClassID", "{1D9928BD-4453-4bdd-903D-E525ED17FDE5}") Q_CLASSINFO("InterfaceID", "{99F6860E-2C5A-42ec-87F2-43396F4BE389}") Q_CLASSINFO("EventsID", "{0A3E9F27-E4F1-45bb-9E47-63099BCCD0E3}") ``` Use the [Q\_CLASSINFO](qobject#Q_CLASSINFO)() macro to specify the COM identifiers for the COM object. `ClassID` and `InterfaceID` are required, while `EventsID` is only necessary when your object has signals. To generate these identifiers, use system tools like `uuidgen` or `guidgen`. You can specify additional attributes for each of your classes; see [Class Information and Tuning](activeqt-server#class-information-and-tuning) for details. ``` Q_PROPERTY(int value READ value WRITE setValue) ``` Use the [Q\_PROPERTY](qobject#Q_PROPERTY)() macro to declare properties for the ActiveX control. Declare a standard constructor taking a parent object, and functions, signals and slots like for any [QObject](qobject) subclass. ``` public: MyActiveX(QWidget *parent = 0) ... int value() const; public slots: void setValue(int v); ... signals: void valueChange(int v); ... }; ``` The ActiveQt framework will expose properties and public slots as ActiveX properties and methods, and signals as ActiveX events, and convert between the Qt data types and the equivalent COM data types. ### Data Types The Qt data types that are supported for properties are: | Qt data type | COM property | | --- | --- | | bool | VARIANT\_BOOL | | [QString](qstring) | BSTR | | int | int | | uint | unsigned int | | double | double | | [qlonglong](qtglobal#qlonglong-typedef) | CY | | [qulonglong](qtglobal#qulonglong-typedef) | CY | | [QColor](qcolor) | OLE\_COLOR | | [QDate](qdate) | DATE | | [QDateTime](qdatetime) | DATE | | [QTime](qtime) | DATE | | [QFont](qfont) | IFontDisp\* | | [QPixmap](qpixmap) | IPictureDisp\* | | [QVariant](qvariant) | VARIANT | | QVariantList (same as [QList](qlist)<[QVariant](qvariant)>) | SAFEARRAY(VARIANT) | | [QStringList](qstringlist) | SAFEARRAY(BSTR) | | [QByteArray](qbytearray) | SAFEARRAY(BYTE) | | [QRect](qrect) | User defined type | | [QSize](qsize) | User defined type | | [QPoint](qpoint) | User defined type | The Qt data types that are supported for parameters in signals and slots are: | Qt data type | COM parameter | | --- | --- | | bool | [in] VARIANT\_BOOL | | bool& | [in, out] VARIANT\_BOOL\* | | [QString](qstring), const [QString](qstring)& | [in] BSTR | | [QString](qstring)& | [in, out] BSTR\* | | [QString](qstring)& | [in, out] BSTR\* | | int | [in] int | | int& | [in,out] int | | uint | [in] unsigned int | | uint& | [in, out] unsigned int\* | | double | [in] double | | double& | [in, out] double\* | | [QColor](qcolor), const [QColor](qcolor)& | [in] OLE\_COLOR | | [QColor](qcolor)& | [in, out] OLE\_COLOR\* | | [QDate](qdate), const [QDate](qdate)& | [in] DATE | | [QDate](qdate)& | [in, out] DATE\* | | [QDateTime](qdatetime), const [QDateTime](qdatetime)& | [in] DATE | | [QDateTime](qdatetime)& | [in, out] DATE\* | | [QFont](qfont), const [QFont](qfont)& | [in] IFontDisp\* | | [QFont](qfont)& | [in, out] IFontDisp\*\* | | [QPixmap](qpixmap), const [QPixmap](qpixmap)& | [in] IPictureDisp\* | | [QPixmap](qpixmap)& | [in, out] IPictureDisp\*\* | | [QList](qlist)<[QVariant](qvariant)>, const [QList](qlist)<[QVariant](qvariant)>& | [in] SAFEARRAY(VARIANT) | | [QList](qlist)<[QVariant](qvariant)>& | [in, out] SAFEARRAY(VARIANT)\* | | [QStringList](qstringlist), const [QStringList](qstringlist)& | [in] SAFEARRAY(BSTR) | | [QStringList](qstringlist)& | [in, out] SAFEARRAY(BSTR)\* | | [QByteArray](qbytearray), const [QByteArray](qbytearray)& | [in] SAFEARRAY(BYTE) | | [QByteArray](qbytearray)& | [in, out] SAFEARRAY(BYTE)\* | | [QObject](qobject)\* | [in] IDispatch\* | | [QRect](qrect)& | [in, out] struct [QRect](qrect) (user defined) | | [QSize](qsize)& | [in, out] struct [QSize](qsize) (user defined) | | [QPoint](qpoint)& | [in, out] struct [QPoint](qpoint) (user defined) | Also supported are exported enums and flags (see Q\_ENUMS() and Q\_FLAGS()). The in-parameter types are also supported as return values. Properties and signals/slots that have parameters using any other data types are ignored by the ActiveQt framework. ### Sub-Objects COM objects can have multiple sub-objects that can represent a sub element of the COM object. A COM object representing a multi-document spread sheet application can for example provide one sub-object for each spread sheet. Any [QObject](qobject) subclass can be used as the type for a sub object in ActiveX, as long as it is known to the [QAxFactory](qaxfactory). Then the type can be used in properties, or as the return type or parameter of a slot. ### Property Notification To make the properties bindable for the ActiveX client, use multiple inheritance from the [QAxBindable](qaxbindable) class: ``` #include <QAxBindable> #include <QWidget> class MyActiveX : public QWidget, public QAxBindable { Q_OBJECT ``` When implementing the property write functions, use the [QAxBindable](qaxbindable) class's requestPropertyChange() and propertyChanged() functions to allow ActiveX clients to bind to the control properties. Serving Controls ---------------- To make a COM server available to the COM system it must be registered in the system registry using five unique identifiers. These identifiers are provided by tools like `guidgen` or `uuidgen`. The registration information allows COM to localize the binary providing a requested ActiveX control, marshall remote procedure calls to the control and read type information about the methods and properties exposed by the control. To create the COM object when the client asks for it the server must export an implementation of a [QAxFactory](qaxfactory). The easist way to do this is to use a set of macros: ``` QAXFACTORY_BEGIN("{ad90301a-849e-4e8b-9a91-0a6dc5f6461f}", "{a8f21901-7ff7-4f6a-b939-789620c03d83}") QAXCLASS(MyWidget) QAXCLASS(MyWidget2) QAXTYPE(MySubType) QAXFACTORY_END() ``` This will export `MyWidget` and `MyWidget2` as COM objects that can be created by COM clients, and will register `MySubType` as a type that can be used in properties and parameters of `MyWidget` and `MyWidget2`. The [QAxFactory class documentation](qaxfactory) explains how to use this macro, and how to implement and use custom factories. For out-of-process executable servers you can implement a main() function to instantiate a [QApplication](qapplication) object and enter the event loop just like any normal Qt application. By default the application will start as a standard Qt application, but if you pass `-activex` on the command line it will start as an ActiveX server. Use [QAxFactory::isServer](qaxfactory#isServer)() to create and run a standard application interface, or to prevent a stand-alone execution: ``` #include <QApplication> #include <QAxFactory> int main(int argc, char *argv[]) { QApplication app(argc, argv); if (!QAxFactory::isServer()) { // create and show main window } return app.exec(); } ``` This is however not necessary as ActiveQt provides a default implementation of a main function. The default implementation calls [QAxFactory::startServer](qaxfactory#startServer)(), creates a [QApplication](qapplication) instance and calls exec(). To build the ActiveX server executable run `qmake` to generate the makefile, and use your compiler's make tool as for any other Qt application. The make process will also register the controls in the system registry by calling the resulting executable with the `-regserver` command line option. If the ActiveX server is an executable, the following command line options are supported: | Option | Result | | --- | --- | | `-regserver` | Registers the server in the system registry | | `-regserverperuser` | Registers the server in the system registry for the current user (since 5.14) | | `-unregserver` | Unregisters the server from the system registry | | `-unregserverperuser` | Unregisters the server from the system registry for the current user (since 5.14) | | `-activex` | Starts the application as an ActiveX server | | `-dumpidl <file> -version x.y` | Writes the server's IDL to the specified file. The type library will have version x.y | In-process servers can be registered using the `regsvr32` tool available on all Windows systems. ### Typical Compile-Time Problems The compiler/linker errors listed are based on those issued by the Microsoft Visual C++ 6.0 compiler. #### "No overloaded function takes 2 parameters" When the error occurs in code that uses the [QAXCLASS](qaxfactory#QAXCLASS)() or QAXFACTORY\_DEFAULT() macro, the widget class had no constructor that can be used by the default factory. Either add a standard widget constructor or implement a custom factory that doesn't require one. When the error occurs in code that uses the [QAXFACTORY\_EXPORT](qaxfactory#QAXFACTORY_EXPORT)() macro, the [QAxFactory](qaxfactory) subclass had no appropriate constructor. Provide a public class constructor like ``` MyFactory(const QUuid &, const QUuid &); ``` for your factory class. #### "Syntax error: bad suffix on number" The unique identifiers have not been passed as strings into the [QAXFACTORY\_EXPORT](qaxfactory#QAXFACTORY_EXPORT)(), [QAXFACTORY\_BEGIN](qaxfactory#QAXFACTORY_BEGIN)() or QAXFACTORY\_DEFAULT() macro. #### "Unresolved external symbol \_ucm\_instantiate" The server does not export an implementation of a [QAxFactory](qaxfactory). Use the [QAXFACTORY\_EXPORT](qaxfactory#QAXFACTORY_EXPORT)() macro in one of the project's implementation files to instantiate and export a factory, or use the [QAXCLASS](qaxfactory#QAXCLASS)() or QAXFACTORY\_DEFAULT() macro to use the default factory. #### "\_ucm\_initialize already defined in ..." The server exports more than one implementation of a [QAxFactory](qaxfactory), or exports the same implementation twice. If you use the default factory, the [QAXFACTORY\_BEGIN](qaxfactory#QAXFACTORY_BEGIN)() or QAXFACTORY\_DEFAULT() macro must only be used once in the project. Use a custom [QAxFactory](qaxfactory) implementation and the [QAXFACTORY\_EXPORT](qaxfactory#QAXFACTORY_EXPORT)() macro if the server provides multiple ActiveX controls. ### Distributing QAxServer Binaries ActiveX servers written with Qt can use Qt either as a shared library, or have Qt linked statically into the binary. Both ways will produce rather large packages (either the server binary itself becomes large, or you have to ship the Qt DLL). #### Installing Stand-Alone Servers When your ActiveX server can also run as a stand-alone application, run the server executable with the `-regserver` command line parameter after installing the executable on the target system. After that the controls provided by the server will be available to ActiveX clients. #### Installing In-Process Servers When your ActiveX server is part of an installation package, use the `regsvr32` tool provided by Microsoft to register the controls on the target system. If this tool is not present, load the DLL into your installer process, resolve the `DllRegisterServer` symbol and call the function: ``` HMODULE dll = LoadLibrary("myserver.dll"); typedef HRESULT(__stdcall *DllRegisterServerProc)(); DllRegisterServerProc DllRegisterServer = (DllRegisterServerProc)GetProcAddress(dll, "DllRegisterServer"); HRESULT res = E_FAIL; if (DllRegisterServer) res = DllRegisterServer(); if (res != S_OK) // error handling ``` #### Distributing Servers over the Internet If you want to use controls in your server in web-pages you need to make the server available to the browser used to view your page, and you need to specify the location of the server package in your page. To specify the location of a server, use the CODEBASE attribute in the OBJECT tag of your web-site. The value can point to the server file itself, to an INF file listing other files the server requires (e.g. the Qt DLL), or a compressed CAB archive. INF and CAB files are documented in almost every book available about ActiveX and COM programming as well as in the MSDN library and various other Online resources. The examples include INF files that can be used to build CAB archives: ``` [version] signature="$CHICAGO$" AdvancedINF=2.0 [Add.Code] simpleax.exe=simpleax.exe [simpleax.exe] file-win32-x86=thiscab clsid={DF16845C-92CD-4AAB-A982-EB9840E74669} RegisterServer=yes ``` The CABARC tool from Microsoft can easily generate CAB archives: ``` cabarc N simpleax.cab simpleax.exe simple.inf ``` The INF files assume a static build of Qt, so no dependencies to other DLLs are listed in the INF files. To distribute an ActiveX server depending on DLLs you must add the dependencies, and provide the library files with the archive. Using the Controls ------------------ To use the ActiveX controls, e.g. to embed them in a web page, use the `<object>` HTML tag. ``` <object ID="MyActiveX1" CLASSID="CLSID:ad90301a-849e-4e8b-9a91-0a6dc5f6461f"> ... <\object> ``` To initialize the control's properties, use ``` <object ID=...> <param name="name" value="value"> <\object> ``` If the web browser supports scripting use JavaScript, VBScript and forms to script the control. The [ActiveQt Examples](activeqt-index#activeqt-examples) include demonstration HTML pages for the example controls. ### Supported and Unsupported ActiveX Clients The following is largly based on our own experiements with ActiveX controls and client applications, and is by no means complete. #### Supported Clients These standard applications work with ActiveX controls developed with ActiveQt. Note that some clients support only in-process controls. * Internet Explorer * Microsoft ActiveX Control Test Container * Microsoft Visual Studio 6.0 * Microsoft Visual Studio.NET/2003 * Microsoft Visual Basic 6.0 * MFC- and ATL-based containers * Sybase PowerBuilder * ActiveQt based containers Microsoft Office applications are supported, but you need to register the controls as "Insertable" objects. Reimplement [QAxFactory::registerClass](qaxfactory#registerClass) to add this attribute to the COM class, or set the "Insertable" class info for your class to "yes" using the [Q\_CLASSINFO](qobject#Q_CLASSINFO) macro. #### Unsupported Clients We have not managed to make ActiveQt based COM objects work with the following client applications. * Borland C++ Builder (Versions 5 and 6) * Borland Delphi ### Typical Runtime Errors #### The Server Does Not Respond If the system is unable to start the server (check with the task manager whether the server runs a process), make sure that no DLL the server depends on is missing from the system path (e.g. the Qt DLL!). Use a dependency walker to view all dependencies of the server binary. If the server runs (e.g. the task manager lists a process), see the following section for information on debugging your server. #### The Object Cannot Be Created If the server could be built and registered correctly during the build process, but the object cannot be initiliazed e.g. by the OLE/COM Object Viewer application, make sure that no DLL the server depends on is missing from the system path (e.g. the Qt DLL). Use a dependency walker to view all dependencies of the server binary. If the server runs, see the following section for information on debugging your server. ### Debugging Runtime Errors To debug an in-process server in Visual Studio, set the server project as the active project, and specify a client "executable for debug session" in the project settings (e.g. use the ActiveX Test Container). You can set breakpoints in your code, and also step into ActiveQt and Qt code if you installed the debug version. To debug an executable server, run the application in a debugger and start with the command line parameter `-activex`. Then start your client and create an instance of your ActiveX control. COM will use the existing process for the next client trying to create an ActiveX control. Class Information and Tuning ---------------------------- To provide attributes for each COM class, use the [Q\_CLASSINFO](qobject#Q_CLASSINFO) macro, which is part of Qt's meta object system. | Key | Meaning of value | | --- | --- | | Version | The version of the class (1.0 is default) | | Description | A string describing the class. | | ClassID | The class ID. You must reimplement [QAxFactory::classID](qaxfactory#classID) if not specified. | | InterfaceID | The interface ID. You must reimplement [QAxFactory::interfaceID](qaxfactory#interfaceID) if not specified. | | EventsID | The event interface ID. No signals are exposed as COM events if not specified. | | DefaultProperty | The property specified represents the default property of this class. Ie. the default property of a push button would be "text". | | DefaultSignal | The signal specified respresents the default signal of this class. Ie. the default signal of a push button would be "clicked". | | LicenseKey | Object creation requires the specified license key. The key can be empty to require a licensed machine. By default classes are not licensed. Also see the following section. | | StockEvents | Objects expose stock events if value is "yes". See [QAxFactory::hasStockEvents](qaxfactory#hasStockEvents)() | | ToSuperClass | Objects expose functionality of all super-classes up to and including the class name in value. See [QAxFactory::exposeToSuperClass](qaxfactory#exposeToSuperClass)() | | Insertable | If the value is "yes" the class is registered to be "Insertable" and will be listed in OLE 2 containers (ie. Microsoft Office). This attribute is not be set by default. | | Aggregatable | If the value is "no" the class does not support aggregation. By default aggregation is supported. | | Creatable | If the value is "no" the class cannot be created by the client, and is only available through the API of another class (ie. the class is a sub-type). | | RegisterObject | If the value is "yes" objects of this class are registered with OLE and accessible from the running object table (ie. clients can connect to an already running instance of this class). This attribute is only supported in out-of-process servers. | | MIME | The object can handle data and files of the format specified in the value. The value has the format mime:extension:description. Multiple formats are separated by a semicolon. | | CoClassAlias | The classname used in the generated IDL and in the registry. This is esp. useful for C++ classes that live in a namespace - by default, ActiveQt just removes the "[::](qromancalendar)" to make the IDL compile. | | Implemented Categories | List of comma-separated Category ID (CATID) UUIDs. Generic mechanism for specifying additional container capabilities, in addition to "control", "insertable" etc. Typical CATIDs include `CATID_InternetAware` ("{0DE86A58-2BAA-11CF-A229-00AA003D7352}"), `CATID_SafeForScripting` ("{7DD95801-9882-11CF-9FA9-00AA006C42C4}") as well as user-defined CATID values. | Note that both keys and values are case sensitive. The following declares version 2.0 of a class that exposes only its own API, and is available in the "Insert Objects" dialog of Microsoft Office applications. ``` class MyActiveX : public QWidget { Q_OBJECT Q_CLASSINFO("Version", "2.0") Q_CLASSINFO("ClassID", "{7a4cffd8-cbcd-4ae9-ae7e-343e1e5710df}") Q_CLASSINFO("InterfaceID", "{6fb035bf-8019-48d8-be51-ef05427d8994}") Q_CLASSINFO("EventsID", "{c42fffdf-6557-47c9-817a-2da2228bc29c}") Q_CLASSINFO("Insertable", "yes") Q_CLASSINFO("ToSuperClass", "MyActiveX") Q_PROPERTY(...) public: MyActiveX(QWidget *parent = 0); ... }; ``` ### Developing Licensed Components If you develop components you might want to control who is able to instantiate those components. Since the server binary can be shipped to and registered on any client machine it is possible for anybody to use those components in his own software. Licensing components can be done using a variety of techniques, e.g. the code creating the control can provide a license key, or the machine on which the control is supposed to run needs to be licensed. To mark a Qt class as licensed specify a "LicenseKey" using the [Q\_CLASSINFO](qobject#Q_CLASSINFO)() macro. ``` class MyLicensedControl : public QWidget { Q_OBJECT Q_CLASSINFO("LicenseKey", "<key string>") ... }; ``` The key is required to be able to create an instance of `MyLicensedControl` on a machine that is not licensed itself. The licensed developer can now redistributes the server binary with his application, which creates the control using the value of "LicenseKey", while users of the application cannot create the control without the license key. If a single license key for the control is not sufficient (ie. you want differnet developers to receive different license keys) you can specify an empty key to indicate that the control requires a license, and reimplement [QAxFactory::validateLicenseKey](qaxfactory#validateLicenseKey)() to verify that a license exists on the system (ie. through a license file). ### More Interfaces ActiveX controls provided by ActiveQt servers support a minimal set of COM interfaces to implement the OLE specifications. When the ActiveX class inherits from the [QAxBindable](qaxbindable) class it can also implement additional COM interfaces. Create a new subclass of [QAxAggregated](qaxaggregated) and use multiple inheritance to subclass additional COM interface classes. ``` class AxImpl : public QAxAggregated, public ISomeCOMInterface { public: AxImpl() {} long queryInterface(const QUuid &iid, void **iface); // IUnknown QAXAGG_IUNKNOWN // ISomeCOMInterface ... } ``` Reimplement the [QAxAggregated::queryInterface](qaxaggregated#queryInterface)() function to support the additional COM interfaces. ``` long AxImpl::queryInterface(const QUuid &iid, void **iface) { *iface = 0; if (iid == IID_ISomeCOMInterface) *iface = (ISomeCOMInterface *)this; else return E_NOINTERFACE; AddRef(); return S_OK; } ``` Since `ISomeCOMInterface` is a subclass of `IUnknown` you will have to implement the `QueryInterface()`, `AddRef()`, and `Release()` functions. Use the QAXAGG\_IUNKNOWN macro in your class definition to do that. If you implement the `IUnknown` functions manually, delegate the calls to the interface pointer returned by the [QAxAggregated::controllingUnknown](qaxaggregated#controllingUnknown)() function, e.g. ``` HRESULT AxImpl::QueryInterface(REFIID iid, void **iface) { return controllingUnknown()->QueryInterface(iid, iface); } ``` Do not support the `IUnknown` interface itself in your [queryInterface](qaxaggregated#queryInterface)() implementation. Implement the methods of the COM interfaces, and use [QAxAggregated::object](qaxaggregated#object)() if you need to make calls to the [QObject](qobject) subclass implementing the control. In your [QAxBindable](qaxbindable) subclass, implement [QAxBindable::createAggregate](qaxbindable#createAggregate)() to return a new object of the [QAxAggregated](qaxaggregated) subclass. ``` class MyActiveX : public QWidget, public QAxBindable { Q_OBJECT public: MyActiveX(QWidget *parent); QAxAggregated *createAggregate() { return new AxImpl(); } }; ``` **See also** [ActiveQt Framework](activeqt-index).
programming_docs
qt Image QML Type Image QML Type ============== Displays an image. [More...](#details) | | | | --- | --- | | Import Statement: | import QtQuick | | Inherits: | [Item](qml-qtquick-item) | | Inherited By: | [AnimatedImage](qml-qtquick-animatedimage) | * [List of all members, including inherited members](https://doc.qt.io/qt-6.2/qml-qtquick-image-members.html) Properties ---------- * **[asynchronous](qml-qtquick-image#asynchronous-prop)** : bool * **[autoTransform](qml-qtquick-image#autoTransform-prop)** : bool * **[cache](qml-qtquick-image#cache-prop)** : bool * **[currentFrame](qml-qtquick-image#currentFrame-prop)** : int * **[fillMode](qml-qtquick-image#fillMode-prop)** : enumeration * **[frameCount](qml-qtquick-image#frameCount-prop)** : int * **[horizontalAlignment](qml-qtquick-image#horizontalAlignment-prop)** : enumeration * **[mipmap](qml-qtquick-image#mipmap-prop)** : bool * **[mirror](qml-qtquick-image#mirror-prop)** : bool * **[mirrorVertically](qml-qtquick-image#mirrorVertically-prop)** : bool * **[paintedHeight](qml-qtquick-image#paintedHeight-prop)** : real * **[paintedWidth](qml-qtquick-image#paintedWidth-prop)** : real * **[progress](qml-qtquick-image#progress-prop)** : real * **[smooth](qml-qtquick-image#smooth-prop)** : bool * **[source](qml-qtquick-image#source-prop)** : url * **[sourceClipRect](qml-qtquick-image#sourceClipRect-prop)** : rect * **[sourceSize](qml-qtquick-image#sourceSize-prop)** : size * **[status](qml-qtquick-image#status-prop)** : enumeration * **[verticalAlignment](qml-qtquick-image#verticalAlignment-prop)** : enumeration Detailed Description -------------------- The Image type displays an image. The source of the image is specified as a URL using the [source](qml-qtquick-image#source-prop) property. Images can be supplied in any of the standard image formats supported by Qt, including bitmap formats such as PNG and JPEG, and vector graphics formats such as SVG. If you need to display animated images, use [AnimatedSprite](qml-qtquick-animatedsprite) or [AnimatedImage](qml-qtquick-animatedimage). If the [width](qml-qtquick-item#width-prop) and [height](qml-qtquick-item#height-prop) properties are not specified, the Image automatically uses the size of the loaded image. By default, specifying the width and height of the item causes the image to be scaled to that size. This behavior can be changed by setting the [fillMode](qml-qtquick-image#fillMode-prop) property, allowing the image to be stretched and tiled instead. Example Usage ------------- The following example shows the simplest usage of the Image type. ``` import QtQuick 2.0 Image { source: "pics/qtlogo.png" } ``` Compressed Texture Files ------------------------ When supported by the implementation of the underlying graphics API at run time, images can also be supplied in compressed texture files. The content must be a simple RGB(A) format 2D texture. Supported compression schemes are only limited by the underlying driver and GPU. The following container file formats are supported: * `PKM` (since Qt 5.10) * `KTX` (since Qt 5.11) * `ASTC` (since Qt 5.13) **Note:** The intended vertical orientation of an image in a texture file is not generally well defined. Different texture compression tools have different defaults and options of when to perform vertical flipping of the input image. If an image from a texture file appears upside down, flipping may need to be toggled in the asset conditioning process. Alternatively, the Image element itself can be flipped by either applying a suitable transformation via the transform property or, more conveniently, by setting the [mirrorVertically](qml-qtquick-image#mirrorVertically-prop) property: ``` transform: [ Translate { y: -myImage.height }, Scale { yScale: -1 } ] ``` or ``` mirrorVertically: true ``` **Note:** Semi-transparent original images require alpha pre-multiplication prior to texture compression in order to be correctly displayed in Qt Quick. This can be done with the following ImageMagick command line: ``` convert foo.png \( +clone -alpha Extract \) -channel RGB -compose Multiply -composite foo_pm.png ``` Automatic Detection of File Extension ------------------------------------- If the [source](qml-qtquick-image#source-prop) URL indicates a non-existing local file or resource, the Image element attempts to auto-detect the file extension. If an existing file can be found by appending any of the supported image file extensions to the [source](qml-qtquick-image#source-prop) URL, then that file will be loaded. The file search attempts to look for compressed texture container file extensions first. If the search is unsuccessful, it attempts to search with the file extensions for the [conventional image file types](qimagereader#supportedImageFormats). For example: ``` // Assuming the "pics" directory contains the following files: // dog.jpg // cat.png // cat.pkm Image { source: "pics/cat.png" // loads cat.png } Image { source: "pics/dog" // loads dog.jpg } Image { source: "pics/cat" // normally loads cat.pkm, but if no OpenGL, loads cat.png instead. } ``` This functionality facilitates deploying different image asset file types on different target platforms. This can be useful in order to tune application performance and adapt to different graphics hardware. This functionality was introduced in Qt 5.11. Performance ----------- By default, locally available images are loaded immediately, and the user interface is blocked until loading is complete. If a large image is to be loaded, it may be preferable to load the image in a low priority thread, by enabling the [asynchronous](qml-qtquick-image#asynchronous-prop) property. If the image is obtained from a network rather than a local resource, it is automatically loaded asynchronously, and the [progress](qml-qtquick-image#progress-prop) and [status](qml-qtquick-image#status-prop) properties are updated as appropriate. Images are cached and shared internally, so if several Image items have the same [source](qml-qtquick-image#source-prop), only one copy of the image will be loaded. **Note**: Images are often the greatest user of memory in QML user interfaces. It is recommended that images which do not form part of the user interface have their size bounded via the [sourceSize](qml-qtquick-image#sourceSize-prop) property. This is especially important for content that is loaded from external sources or provided by the user. **See also** [Qt Quick Examples - Image Elements](https://doc.qt.io/qt-6.2/qtquick-imageelements-example.html), [QQuickImageProvider](qquickimageprovider), and [QImageReader::setAutoDetectImageFormat](qimagereader#setAutoDetectImageFormat)(). Property Documentation ---------------------- ### [since 5.14] currentFrame : [int](qml-int) [currentFrame](qml-qtquick-image#currentFrame-prop) is the frame that is currently visible. The default is `0`. You can set it to a number between `0` and `frameCount - 1` to display a different frame, if the image contains multiple frames. [frameCount](qml-qtquick-image#frameCount-prop) is the number of frames in the image. Most images have only one frame. This QML property was introduced in Qt 5.14. ### horizontalAlignment : [enumeration](qml-enumeration) Sets the horizontal and vertical alignment of the image. By default, the image is center aligned. The valid values for `horizontalAlignment` are `Image.AlignLeft`, `Image.AlignRight` and `Image.AlignHCenter`. The valid values for `verticalAlignment` are `Image.AlignTop`, `Image.AlignBottom` and `Image.AlignVCenter`. ### [read-only] paintedHeight : [real](qml-real) These properties hold the size of the image that is actually painted. In most cases it is the same as `width` and `height`, but when using an [Image.PreserveAspectFit](qml-qtquick-image#fillMode-prop) or an [Image.PreserveAspectCrop](qml-qtquick-image#fillMode-prop) `paintedWidth` or `paintedHeight` can be smaller or larger than `width` and `height` of the Image item. ### asynchronous : [bool](qml-bool) Specifies that images on the local filesystem should be loaded asynchronously in a separate thread. The default value is false, causing the user interface thread to block while the image is loaded. Setting *asynchronous* to true is useful where maintaining a responsive user interface is more desirable than having images immediately visible. Note that this property is only valid for images read from the local filesystem. Images loaded via a network resource (e.g. HTTP) are always loaded asynchronously. ### [since 5.5] autoTransform : [bool](qml-bool) This property holds whether the image should automatically apply image transformation metadata such as EXIF orientation. By default, this property is set to false. This property was introduced in Qt 5.5. ### cache : [bool](qml-bool) Specifies whether the image should be cached. The default value is true. Setting *cache* to false is useful when dealing with large images, to make sure that they aren't cached at the expense of small 'ui element' images. ### fillMode : [enumeration](qml-enumeration) Set this property to define what happens when the source image has a different size than the item. * Image.Stretch - the image is scaled to fit * Image.PreserveAspectFit - the image is scaled uniformly to fit without cropping * Image.PreserveAspectCrop - the image is scaled uniformly to fill, cropping if necessary * Image.Tile - the image is duplicated horizontally and vertically * Image.TileVertically - the image is stretched horizontally and tiled vertically * Image.TileHorizontally - the image is stretched vertically and tiled horizontally * Image.Pad - the image is not transformed | | | | --- | --- | | | Stretch (default) ``` Image { width: 130; height: 100 source: "qtlogo.png" } ``` | | | PreserveAspectFit ``` Image { width: 130; height: 100 fillMode: Image.PreserveAspectFit source: "qtlogo.png" } ``` | | | PreserveAspectCrop ``` Image { width: 130; height: 100 fillMode: Image.PreserveAspectCrop source: "qtlogo.png" clip: true } ``` | | | Tile ``` Image { width: 120; height: 120 fillMode: Image.Tile horizontalAlignment: Image.AlignLeft verticalAlignment: Image.AlignTop source: "qtlogo.png" } ``` | | | TileVertically ``` Image { width: 120; height: 120 fillMode: Image.TileVertically verticalAlignment: Image.AlignTop source: "qtlogo.png" } ``` | | | TileHorizontally ``` Image { width: 120; height: 120 fillMode: Image.TileHorizontally verticalAlignment: Image.AlignLeft source: "qtlogo.png" } ``` | Note that `clip` is `false` by default which means that the item might paint outside its bounding rectangle even if the fillMode is set to `PreserveAspectCrop`. **See also** [Qt Quick Examples - Image Elements](https://doc.qt.io/qt-6.2/qtquick-imageelements-example.html). ### [since 5.3] mipmap : [bool](qml-bool) This property holds whether the image uses mipmap filtering when scaled or transformed. Mipmap filtering gives better visual quality when scaling down compared to smooth, but it may come at a performance cost (both when initializing the image and during rendering). By default, this property is set to false. This property was introduced in Qt 5.3. **See also** [smooth](qml-qtquick-image#smooth-prop). ### mirror : [bool](qml-bool) This property holds whether the image should be horizontally inverted (effectively displaying a mirrored image). The default value is false. ### [since 6.2] mirrorVertically : [bool](qml-bool) This property holds whether the image should be vertically inverted (effectively displaying a mirrored image). The default value is false. This property was introduced in Qt 6.2. ### [read-only] progress : [real](qml-real) This property holds the progress of image loading, from 0.0 (nothing loaded) to 1.0 (finished). **See also** [status](qml-qtquick-image#status-prop). ### smooth : [bool](qml-bool) This property holds whether the image is smoothly filtered when scaled or transformed. Smooth filtering gives better visual quality, but it may be slower on some hardware. If the image is displayed at its natural size, this property has no visual or performance effect. By default, this property is set to true. **See also** [mipmap](qml-qtquick-image#mipmap-prop). ### source : [url](qml-url) Image can handle any image format supported by Qt, loaded from any URL scheme supported by Qt. The URL may be absolute, or relative to the URL of the component. **See also** [QQuickImageProvider](qquickimageprovider), [Compressed Texture Files](qml-qtquick-image#compressed-texture-files), and [Automatic Detection of File Extension](qml-qtquick-image#automatic-detection-of-file-extension). ### [since 5.15] sourceClipRect : [rect](qml-rect) This property, if set, holds the rectangular region of the source image to be loaded. The `sourceClipRect` works together with the [sourceSize](qml-qtquick-image#sourceSize-prop) property to conserve system resources when only a portion of an image needs to be loaded. ``` Rectangle { width: ... height: ... Image { anchors.fill: parent source: "reallyBigImage.svg" sourceSize.width: 1024 sourceSize.height: 1024 sourceClipRect: Qt.rect(100, 100, 512, 512) } } ``` In the above example, we conceptually scale the SVG graphic to 1024x1024 first, and then cut out a region of interest that is 512x512 pixels from a location 100 pixels from the top and left edges. Thus `sourceSize` determines the scale, but the actual output image is 512x512 pixels. Some image formats are able to conserve CPU time by rendering only the specified region. Others will need to load the entire image first and then clip it to the specified region. This property can be cleared to reload the entire image by setting `sourceClipRect` to `undefined`. **Note:** *Changing this property dynamically causes the image source to be reloaded, potentially even from the network, if it is not in the disk cache.* **Note:** Sub-pixel clipping is not supported: the given rectangle will be passed to [QImageReader::setScaledClipRect](qimagereader#setScaledClipRect)(). This property was introduced in Qt 5.15. ### sourceSize : [size](qml-size) This property holds the scaled width and height of the full-frame image. Unlike the [width](qml-qtquick-item#width-prop) and [height](qml-qtquick-item#height-prop) properties, which scale the painting of the image, this property sets the maximum number of pixels stored for the loaded image so that large images do not use more memory than necessary. For example, this ensures the image in memory is no larger than 1024x1024 pixels, regardless of the Image's [width](qml-qtquick-item#width-prop) and [height](qml-qtquick-item#height-prop) values: ``` Rectangle { width: ... height: ... Image { anchors.fill: parent source: "reallyBigImage.jpg" sourceSize.width: 1024 sourceSize.height: 1024 } } ``` If the image's actual size is larger than the sourceSize, the image is scaled down. If only one dimension of the size is set to greater than 0, the other dimension is set in proportion to preserve the source image's aspect ratio. (The [fillMode](qml-qtquick-image#fillMode-prop) is independent of this.) If both the sourceSize.width and sourceSize.height are set, the image will be scaled down to fit within the specified size (unless PreserveAspectCrop or PreserveAspectFit are used, then it will be scaled to match the optimal size for cropping/fitting), maintaining the image's aspect ratio. The actual size of the image after scaling is available via [Item::implicitWidth](qml-qtquick-item#implicitWidth-prop) and [Item::implicitHeight](qml-qtquick-item#implicitHeight-prop). If the source is an intrinsically scalable image (eg. SVG), this property determines the size of the loaded image regardless of intrinsic size. Avoid changing this property dynamically; rendering an SVG is *slow* compared to an image. If the source is a non-scalable image (eg. JPEG), the loaded image will be no greater than this property specifies. For some formats (currently only JPEG), the whole image will never actually be loaded into memory. If the [sourceClipRect](qml-qtquick-image#sourceClipRect-prop) property is also set, `sourceSize` determines the scale, but it will be clipped to the size of the clip rectangle. sourceSize can be cleared to the natural size of the image by setting sourceSize to `undefined`. **Note:** *Changing this property dynamically causes the image source to be reloaded, potentially even from the network, if it is not in the disk cache.* ### [read-only] status : [enumeration](qml-enumeration) This property holds the status of image loading. It can be one of: * Image.Null - no image has been set * Image.Ready - the image has been loaded * Image.Loading - the image is currently being loaded * Image.Error - an error occurred while loading the image Use this status to provide an update or respond to the status change in some way. For example, you could: * Trigger a state change: ``` State { name: 'loaded'; when: image.status == Image.Ready } ``` * Implement an `onStatusChanged` signal handler: ``` Image { id: image onStatusChanged: if (image.status == Image.Ready) console.log('Loaded') } ``` * Bind to the status value: ``` Text { text: image.status == Image.Ready ? 'Loaded' : 'Not loaded' } ``` **See also** [progress](qml-qtquick-image#progress-prop). qt User Guide User Guide ========== Overview -------- This document explains how to interact with the virtual keyboard. Opening the Keyboard -------------------- Once [properly installed](https://doc.qt.io/qt-6.2/qtvirtualkeyboard-deployment-guide.html), the virtual keyboard can be opened by clicking on a text input field. Language -------- The language can be changed by pressing the language key, which is illustrated with a "globe" icon: The current language is displayed on the space bar key. Handwriting ----------- The handwriting mode can be activated by pressing the handwriting key: ### Gestures | Gesture | T9 Write | MyScript Text SDK | | --- | --- | --- | | Backspace | | | | | Space | | | | | Enter | Gesture not available | | | | Reset word | | Gesture not available | Gesture not available | | Toggle input mode | | Gesture not available | Gesture not available | | Toggle text case | | Gesture not available | Gesture not available | qt qt_add_plugin qt\_add\_plugin =============== Creates a Qt plugin target. The command is defined in the `Core` component of the `Qt6` package. Load the package with: ``` find_package(Qt6 COMPONENTS Core REQUIRED) ``` Synopsis -------- ``` qt_add_plugin(target [SHARED | STATIC] [CLASS_NAME class_name] [OUTPUT_TARGETS variable_name] ) ``` If [versionless commands](https://doc.qt.io/qt-6.2/cmake-qt5-and-qt6-compatibility.html#versionless-commands) are disabled, use `qt6_add_plugin()` instead. It supports the same set of arguments as this command. Description ----------- Qt plugin targets have additional requirements over and above an ordinary CMake library target. The `qt_add_plugin()` command adds the necessary handling to ensure these requirements are met. It should be called rather than the built-in CMake `add_library()` command when defining a Qt plugin target. By default, the plugin will be created as a `STATIC` library if Qt was built statically, or as a `MODULE` library otherwise. You can override this default by explicitly providing the `STATIC` or `SHARED` option. **Note:** Non-static plugins are meant to be loaded dynamically at runtime, not linked to at build time. CMake differentiates between these two scenarios by providing the `MODULE` library type for dynamically loaded libraries, and the `SHARED` library type for libraries that may be linked to directly. This distinction is important for some toolchains (notably Visual Studio), due to the way symbol exports are handled. It may not be possible to link to `MODULE` libraries, and generating a `SHARED` library with no exported symbols can result in build-time errors. If the `SHARED` option is passed to `qt_add_plugin()`, it will therefore create a `MODULE` library rather than a `SHARED` library. Every Qt plugin has a class name. By default, this will be the same as the `target`, but it can be overridden with the `CLASS_NAME` option. The class name corresponds to the name of the C++ class that declares the metadata for the plugin. For static plugins, it is also the name passed to [Q\_IMPORT\_PLUGIN](qtplugin#Q_IMPORT_PLUGIN), which imports the plugin into an application and ensures it is available at run time. If the plugin is built statically, `qt_add_plugin()` may define additional internal targets. These facilitate automatic importing of the plugin for any executable or shared library that links to the plugin. If the project installs the plugin and intends to make it available for other projects to link to, the project should also install these internal targets. The names of these targets can be obtained by providing the `OUTPUT_TARGETS` option, followed by the name of a variable in which to return the target list.
programming_docs
qt SelectionListModel QML Type SelectionListModel QML Type =========================== Provides a data model for the selection lists. [More...](#details) | | | | --- | --- | | Import Statement: | import QtQuick.VirtualKeyboard | | Instantiates: | [QVirtualKeyboardSelectionListModel](qvirtualkeyboardselectionlistmodel) | * [List of all members, including inherited members](https://doc.qt.io/qt-6.2/qml-qtquick-virtualkeyboard-selectionlistmodel-members.html) Signals ------- * void **[activeItemChanged](qml-qtquick-virtualkeyboard-selectionlistmodel#activeItemChanged-signal)**(int *index*) * void **[itemSelected](qml-qtquick-virtualkeyboard-selectionlistmodel#itemSelected-signal)**(int *index*) Methods ------- * void **[removeItem](qml-qtquick-virtualkeyboard-selectionlistmodel#removeItem-method)**(int *index*) * void **[selectItem](qml-qtquick-virtualkeyboard-selectionlistmodel#selectItem-method)**(int *index*) Detailed Description -------------------- The SelectionListModel is a data model for word candidates provided by the input method. An instance of a SelectionListModel cannot be created directly. Instead, the [InputEngine](qml-qtquick-virtualkeyboard-inputengine) manages the instances and provides access to the model by [InputEngine::wordCandidateListModel](qml-qtquick-virtualkeyboard-inputengine#wordCandidateListModel-prop) property. The model exposes the following data roles for the list delegate: * `display` Display text for item. * `wordCompletionLength` Word completion length for item. * `dictionaryType` Dictionary type of the word, see [QVirtualKeyboardSelectionListModel::DictionaryType](qvirtualkeyboardselectionlistmodel#DictionaryType-enum). * `canRemoveSuggestion` A boolean indicating if the word can be removed from the dictionary. The [activeItemChanged](qml-qtquick-virtualkeyboard-selectionlistmodel#activeItemChanged-signal) signal indicates which item is currently highlighted by the input method. The view should respond to this signal by highlighting the corresponding item in the list. The user selection is handled by the [selectItem](qml-qtquick-virtualkeyboard-selectionlistmodel#selectItem-method)() method. The view should be invoke this method when the user selects an item from the list. Signal Documentation -------------------- ### void activeItemChanged([int](qml-int) *index*) This signal is emitted when the active item in the list changes. The UI should react to this signal by highlighting the item at *index* in the list. **Note:** The corresponding handler is `onActiveItemChanged`. ### void itemSelected([int](qml-int) *index*) This signal is emitted when an item at *index* is selected by the user. **Note:** The corresponding handler is `onItemSelected`. Method Documentation -------------------- ### void removeItem([int](qml-int) *index*) This method should be called when the user removes an item at position *index* from the list. The removal is forwarded to the input method for further processing. ### void selectItem([int](qml-int) *index*) This method should be called when the user selects an item at position *index* from the list. The selection is forwarded to the input method for further processing. qt Using the OpenSSL Dependency for GDS Support Using the OpenSSL Dependency for GDS Support ============================================ The GDS feature of Qt OPC UA requires the OpenSSL 1.1 headers and libraries. If OpenSSL is not installed to a path that is searched by default, the location of the headers and libraries must be passed to the build process. For example, if OpenSSL 1.1 has been installed to `/opt/openssl`, the locations must be passed as follows: ``` -DOPENSSL_ROOT_DIR=/opt/openssl/ ``` If GDS support is not required, it can be disabled by using the following parameters: ``` -DFEATURE_gds=OFF ``` In this case, OpenSSL is not required. qt QSGBasicGeometryNode Class QSGBasicGeometryNode Class ========================== The QSGBasicGeometryNode class serves as a baseclass for geometry based nodes. [More...](#details) | | | | --- | --- | | Header: | #include <QSGBasicGeometryNode> | | CMake: | find\_package(Qt6 COMPONENTS Quick REQUIRED) target\_link\_libraries(mytarget PRIVATE Qt6::Quick) | | qmake: | QT += quick | | Inherits: | [QSGNode](qsgnode) | | Inherited By: | [QSGClipNode](qsgclipnode) and [QSGGeometryNode](qsggeometrynode) | * [List of all members, including inherited members](https://doc.qt.io/qt-6.2/qsgbasicgeometrynode-members.html) Public Functions ---------------- | | | | --- | --- | | virtual | **[~QSGBasicGeometryNode](qsgbasicgeometrynode#dtor.QSGBasicGeometryNode)**() override | | const QSGGeometry \* | **[geometry](qsgbasicgeometrynode#geometry)**() const | | QSGGeometry \* | **[geometry](qsgbasicgeometrynode#geometry-1)**() | | void | **[setGeometry](qsgbasicgeometrynode#setGeometry)**(QSGGeometry \**geometry*) | Detailed Description -------------------- The QSGBasicGeometryNode class should not be used by itself. It is only encapsulates shared functionality between the [QSGGeometryNode](qsggeometrynode) and [QSGClipNode](qsgclipnode) classes. **Note:** All classes with QSG prefix should be used solely on the scene graph's rendering thread. See [Scene Graph and Rendering](qtquick-visualcanvas-scenegraph#scene-graph-and-rendering) for more information. Member Function Documentation ----------------------------- ### `[override virtual]` QSGBasicGeometryNode::~QSGBasicGeometryNode() Deletes this [QSGBasicGeometryNode](qsgbasicgeometrynode). If the node has the flag [QSGNode::OwnsGeometry](qsgnode#Flag-enum) set, it will also delete the geometry object it is pointing to. This flag is not set by default. ### const [QSGGeometry](qsggeometry) \*QSGBasicGeometryNode::geometry() const Returns this node's geometry. The geometry is null by default. **See also** [setGeometry](qsgbasicgeometrynode#setGeometry)(). ### [QSGGeometry](qsggeometry) \*QSGBasicGeometryNode::geometry() Returns this node's geometry. The geometry is null by default. ### void QSGBasicGeometryNode::setGeometry([QSGGeometry](qsggeometry) \**geometry*) Sets the geometry of this node to *geometry*. If the node has the flag [QSGNode::OwnsGeometry](qsgnode#Flag-enum) set, it will also delete the geometry object it is pointing to. This flag is not set by default. If the geometry is changed without calling setGeometry() again, the user must also mark the geometry as dirty using [QSGNode::markDirty](qsgnode#markDirty)(). **See also** [geometry](qsgbasicgeometrynode#geometry)() and [markDirty](qsgnode#markDirty)(). qt QItemEditorFactory Class QItemEditorFactory Class ======================== The QItemEditorFactory class provides widgets for editing item data in views and delegates. [More...](#details) | | | | --- | --- | | Header: | #include <QItemEditorFactory> | | CMake: | find\_package(Qt6 COMPONENTS Widgets REQUIRED) target\_link\_libraries(mytarget PRIVATE Qt6::Widgets) | | qmake: | QT += widgets | * [List of all members, including inherited members](https://doc.qt.io/qt-6.2/qitemeditorfactory-members.html) Public Functions ---------------- | | | | --- | --- | | | **[QItemEditorFactory](qitemeditorfactory#QItemEditorFactory)**() | | virtual | **[~QItemEditorFactory](qitemeditorfactory#dtor.QItemEditorFactory)**() | | virtual QWidget \* | **[createEditor](qitemeditorfactory#createEditor)**(int *userType*, QWidget \**parent*) const | | void | **[registerEditor](qitemeditorfactory#registerEditor)**(int *userType*, QItemEditorCreatorBase \**creator*) | | virtual QByteArray | **[valuePropertyName](qitemeditorfactory#valuePropertyName)**(int *userType*) const | Static Public Members --------------------- | | | | --- | --- | | const QItemEditorFactory \* | **[defaultFactory](qitemeditorfactory#defaultFactory)**() | | void | **[setDefaultFactory](qitemeditorfactory#setDefaultFactory)**(QItemEditorFactory \**factory*) | Detailed Description -------------------- When editing data in an item view, editors are created and displayed by a delegate. [QStyledItemDelegate](qstyleditemdelegate), which is the delegate by default installed on Qt's item views, uses a QItemEditorFactory to create editors for it. A default unique instance provided by QItemEditorFactory is used by all item delegates. If you set a new default factory with [setDefaultFactory](qitemeditorfactory#setDefaultFactory)(), the new factory will be used by existing and new delegates. A factory keeps a collection of [QItemEditorCreatorBase](qitemeditorcreatorbase) instances, which are specialized editors that produce editors for one particular [QVariant](qvariant) data type (All Qt models store their data in [QVariant](qvariant)s). ### Standard Editing Widgets The standard factory implementation provides editors for a variety of data types. These are created whenever a delegate needs to provide an editor for data supplied by a model. The following table shows the relationship between types and the standard editors provided. | Type | Editor Widget | | --- | --- | | bool | [QComboBox](qcombobox) | | double | [QDoubleSpinBox](qdoublespinbox) | | int | [QSpinBox](qspinbox) | | unsigned int | | [QDate](qdate) | [QDateEdit](qdateedit) | | [QDateTime](qdatetime) | [QDateTimeEdit](qdatetimeedit) | | [QPixmap](qpixmap) | [QLabel](qlabel) | | [QString](qstring) | [QLineEdit](qlineedit) | | [QTime](qtime) | [QTimeEdit](qtimeedit) | Additional editors can be registered with the [registerEditor](qitemeditorfactory#registerEditor)() function. **See also** [QStyledItemDelegate](qstyleditemdelegate), [Model/View Programming](model-view-programming), and [Color Editor Factory Example](https://doc.qt.io/qt-6.2/qtwidgets-itemviews-coloreditorfactory-example.html). Member Function Documentation ----------------------------- ### QItemEditorFactory::QItemEditorFactory() Constructs a new item editor factory. ### `[virtual]` QItemEditorFactory::~QItemEditorFactory() Destroys the item editor factory. ### `[virtual]` [QWidget](qwidget) \*QItemEditorFactory::createEditor(int *userType*, [QWidget](qwidget) \**parent*) const Creates an editor widget with the given *parent* for the specified *userType* of data, and returns it as a [QWidget](qwidget). **See also** [registerEditor](qitemeditorfactory#registerEditor)(). ### `[static]` const [QItemEditorFactory](qitemeditorfactory#QItemEditorFactory) \*QItemEditorFactory::defaultFactory() Returns the default item editor factory. **See also** [setDefaultFactory](qitemeditorfactory#setDefaultFactory)(). ### void QItemEditorFactory::registerEditor(int *userType*, [QItemEditorCreatorBase](qitemeditorcreatorbase) \**creator*) Registers an item editor creator specified by *creator* for the given *userType* of data. **Note:** The factory takes ownership of the item editor creator and will destroy it if a new creator for the same type is registered later. **See also** [createEditor](qitemeditorfactory#createEditor)(). ### `[static]` void QItemEditorFactory::setDefaultFactory([QItemEditorFactory](qitemeditorfactory#QItemEditorFactory) \**factory*) Sets the default item editor factory to the given *factory*. Both new and existing delegates will use the new factory. **See also** [defaultFactory](qitemeditorfactory#defaultFactory)(). ### `[virtual]` [QByteArray](qbytearray) QItemEditorFactory::valuePropertyName(int *userType*) const Returns the property name used to access data for the given *userType* of data. qt QOpcUaApplicationIdentity Class QOpcUaApplicationIdentity Class =============================== QOpcUaApplicationIdentity defines the identity of the application. [More...](#details) | | | | --- | --- | | Header: | #include <QOpcUaApplicationIdentity> | | qmake: | QT += opcua | | Since: | QtOpcUa 5.13 | * [List of all members, including inherited members](https://doc.qt.io/qt-6.2/qopcuaapplicationidentity-members.html) Public Functions ---------------- | | | | --- | --- | | | **[QOpcUaApplicationIdentity](qopcuaapplicationidentity#QOpcUaApplicationIdentity-1)**(const QOpcUaApplicationIdentity &*other*) | | QOpcUaApplicationIdentity & | **[operator=](qopcuaapplicationidentity#operator-eq)**(const QOpcUaApplicationIdentity &*rhs*) | | QString | **[applicationName](qopcuaapplicationidentity#applicationName)**() const | | QOpcUaApplicationDescription::ApplicationType | **[applicationType](qopcuaapplicationidentity#applicationType)**() const | | QString | **[applicationUri](qopcuaapplicationidentity#applicationUri)**() const | | bool | **[isValid](qopcuaapplicationidentity#isValid)**() const | | QString | **[productUri](qopcuaapplicationidentity#productUri)**() const | | void | **[setApplicationName](qopcuaapplicationidentity#setApplicationName)**(const QString &*value*) | | void | **[setApplicationType](qopcuaapplicationidentity#setApplicationType)**(QOpcUaApplicationDescription::ApplicationType *value*) | | void | **[setApplicationUri](qopcuaapplicationidentity#setApplicationUri)**(const QString &*value*) | | void | **[setProductUri](qopcuaapplicationidentity#setProductUri)**(const QString &*value*) | Detailed Description -------------------- This info must be configured using [QOpcUaClient::setApplicationIdentity](qopcuaclient#setApplicationIdentity). The application identity can be set up manually or derived from a certificate. ``` QOpcUaApplicationIdentity identity; const QString applicationUri = QStringLiteral("urn:%1:%2:%3") .arg(QHostInfo::localHostName()) .arg(QCoreApplication::organizationName()) .arg(QCoreApplication::applicationName()); const QString productUri = QStringLiteral("urn:%1:%2") .arg(QCoreApplication::organizationName()) .arg(QCoreApplication::applicationName()); identity.setProductUri(productUri); identity.setApplicationUri(applicationUri); identity.setApplicationName(QCoreApplication::applicationName()); identity.setApplicationType(QOpcUaApplicationDescription::Client); client->setApplicationIdentity(identity); ``` In case your application authenticates using certificates the application identity has to match the used certificate. In this case all information is extracted from the certificate given in the PKI configuration. ``` QOpcUaApplicationIdentity identity; identity = pkiConfig.applicationIdentity(); ``` Member Function Documentation ----------------------------- ### QOpcUaApplicationIdentity::QOpcUaApplicationIdentity(const QOpcUaApplicationIdentity &*other*) Constructs an application identity from *other*. ### QOpcUaApplicationIdentity &QOpcUaApplicationIdentity::operator=(const QOpcUaApplicationIdentity &*rhs*) Sets the values of *rhs* in this [QOpcUaApplicationIdentity](qopcuaapplicationidentity). ### [QString](qstring) QOpcUaApplicationIdentity::applicationName() const Returns the human readable name of the application. This does not need to be unique. **See also** [setApplicationName](qopcuaapplicationidentity#setApplicationName)(). ### [QOpcUaApplicationDescription::ApplicationType](qopcuaapplicationdescription#ApplicationType-enum) QOpcUaApplicationIdentity::applicationType() const Returns the application's type. **See also** [setApplicationType](qopcuaapplicationidentity#setApplicationType)(). ### [QString](qstring) QOpcUaApplicationIdentity::applicationUri() const Returns the application's application URI. This must be unique for each installation instance of the application and must match the ApplicationURI in the application's certificate. **See also** [setApplicationUri](qopcuaapplicationidentity#setApplicationUri)(). ### bool QOpcUaApplicationIdentity::isValid() const Returns true if the application identity contains valid data. ### [QString](qstring) QOpcUaApplicationIdentity::productUri() const Returns the application's productUri. This uniquely identifies the product. **See also** [setProductUri](qopcuaapplicationidentity#setProductUri)(). ### void QOpcUaApplicationIdentity::setApplicationName(const [QString](qstring) &*value*) Sets the application name to *value*. **See also** [applicationName](qopcuaapplicationidentity#applicationName)(). ### void QOpcUaApplicationIdentity::setApplicationType([QOpcUaApplicationDescription::ApplicationType](qopcuaapplicationdescription#ApplicationType-enum) *value*) Sets the type of the application. Client applications should set *value* to [Client](qopcuaapplicationdescription#ApplicationType-enum). The default value is [Client](qopcuaapplicationdescription#ApplicationType-enum). **See also** [applicationType](qopcuaapplicationidentity#applicationType)(). ### void QOpcUaApplicationIdentity::setApplicationUri(const [QString](qstring) &*value*) Sets the [applicationUri](qopcuaapplicationidentity#applicationUri) to *value*. **See also** [applicationUri](qopcuaapplicationidentity#applicationUri)() and [setApplicationName](qopcuaapplicationidentity#setApplicationName)(). ### void QOpcUaApplicationIdentity::setProductUri(const [QString](qstring) &*value*) Sets the [productUri](qopcuaapplicationidentity#productUri) to *value*. **See also** [productUri](qopcuaapplicationidentity#productUri)(). qt Pass QML Type Pass QML Type ============= Defines a render pass in an Effect. [More...](#details) | | | | --- | --- | | Import Statement: | import QtQuick3D | * [List of all members, including inherited members](https://doc.qt.io/qt-6.2/qml-qtquick3d-pass-members.html) Properties ---------- * **[commands](qml-qtquick3d-pass#commands-prop)** : list * **[output](qml-qtquick3d-pass#output-prop)** : Buffer * **[shaders](qml-qtquick3d-pass#shaders-prop)** : list Detailed Description -------------------- An [Effect](qml-qtquick3d-effect) may consist of multiple render passes. Each render pass has a setup phase where the list of [render commands](qml-qtquick3d-pass#commands-prop) are executed, a [output buffer](qml-qtquick3d-pass#output-prop) and a list of [shaders](qml-qtquick3d-pass#shaders-prop) to use for rendering the effect. See the documentation for [Effect](qml-qtquick3d-effect) for more details on how to set up multiple rendering passes. Property Documentation ---------------------- ### commands : [list](qml-list) Specifies the list of render [commands](qml-qtquick3d-command) of the pass. ### output : [Buffer](qml-qtquick3d-buffer) Specifies the output [buffer](qml-qtquick3d-buffer) of the pass. ### shaders : [list](qml-list) Specifies the list of [shaders](qml-qtquick3d-shader) of the pass. qt Buffer QML Type Buffer QML Type =============== Provides a data store for raw data to later be used as vertices or uniforms. [More...](#details) | | | | --- | --- | | Import Statement: | import Qt3D.Core | | Instantiates: | [QBuffer](qt3dcore-qbuffer) | * [List of all members, including inherited members](https://doc.qt.io/qt-6.2/qml-qt3d-core-buffer-members.html) Properties ---------- * **[usage](qml-qt3d-core-buffer#usage-prop)** : QBuffer::UsageType Detailed Description -------------------- Property Documentation ---------------------- ### usage : QBuffer::UsageType Holds the buffer usage. qt QClipboard Class QClipboard Class ================ The QClipboard class provides access to the window system clipboard. [More...](#details) | | | | --- | --- | | Header: | #include <QClipboard> | | CMake: | find\_package(Qt6 COMPONENTS Gui REQUIRED) target\_link\_libraries(mytarget PRIVATE Qt6::Gui) | | qmake: | QT += gui | | Inherits: | [QObject](qobject) | * [List of all members, including inherited members](https://doc.qt.io/qt-6.2/qclipboard-members.html) Public Types ------------ | | | | --- | --- | | enum | **[Mode](qclipboard#Mode-enum)** { Clipboard, Selection, FindBuffer } | Public Functions ---------------- | | | | --- | --- | | void | **[clear](qclipboard#clear)**(QClipboard::Mode *mode* = Clipboard) | | QImage | **[image](qclipboard#image)**(QClipboard::Mode *mode* = Clipboard) const | | const QMimeData \* | **[mimeData](qclipboard#mimeData)**(QClipboard::Mode *mode* = Clipboard) const | | bool | **[ownsClipboard](qclipboard#ownsClipboard)**() const | | bool | **[ownsFindBuffer](qclipboard#ownsFindBuffer)**() const | | bool | **[ownsSelection](qclipboard#ownsSelection)**() const | | QPixmap | **[pixmap](qclipboard#pixmap)**(QClipboard::Mode *mode* = Clipboard) const | | void | **[setImage](qclipboard#setImage)**(const QImage &*image*, QClipboard::Mode *mode* = Clipboard) | | void | **[setMimeData](qclipboard#setMimeData)**(QMimeData \**src*, QClipboard::Mode *mode* = Clipboard) | | void | **[setPixmap](qclipboard#setPixmap)**(const QPixmap &*pixmap*, QClipboard::Mode *mode* = Clipboard) | | void | **[setText](qclipboard#setText)**(const QString &*text*, QClipboard::Mode *mode* = Clipboard) | | bool | **[supportsFindBuffer](qclipboard#supportsFindBuffer)**() const | | bool | **[supportsSelection](qclipboard#supportsSelection)**() const | | QString | **[text](qclipboard#text)**(QClipboard::Mode *mode* = Clipboard) const | | QString | **[text](qclipboard#text-1)**(QString &*subtype*, QClipboard::Mode *mode* = Clipboard) const | Signals ------- | | | | --- | --- | | void | **[changed](qclipboard#changed)**(QClipboard::Mode *mode*) | | void | **[dataChanged](qclipboard#dataChanged)**() | | void | **[findBufferChanged](qclipboard#findBufferChanged)**() | | void | **[selectionChanged](qclipboard#selectionChanged)**() | Detailed Description -------------------- The clipboard offers a simple mechanism to copy and paste data between applications. QClipboard supports the same data types that [QDrag](qdrag) does, and uses similar mechanisms. For advanced clipboard usage read [Drag and Drop](dnd). There is a single QClipboard object in an application, accessible as [QGuiApplication::clipboard](qguiapplication#clipboard)(). Example: ``` QClipboard *clipboard = QGuiApplication::clipboard(); QString originalText = clipboard->text(); // etc. clipboard->setText(newText); ``` QClipboard features some convenience functions to access common data types: [setText](qclipboard#setText)() allows the exchange of Unicode text and [setPixmap](qclipboard#setPixmap)() and [setImage](qclipboard#setImage)() allows the exchange of QPixmaps and QImages between applications. The [setMimeData](qclipboard#setMimeData)() function is the ultimate in flexibility: it allows you to add any [QMimeData](qmimedata) into the clipboard. There are corresponding getters for each of these, e.g. [text](qclipboard#text)(), [image](qclipboard#image)() and [pixmap](qclipboard#pixmap)(). You can clear the clipboard by calling [clear](qclipboard#clear)(). A typical example of the use of these functions follows: ``` void DropArea::paste() { const QClipboard *clipboard = QApplication::clipboard(); const QMimeData *mimeData = clipboard->mimeData(); if (mimeData->hasImage()) { setPixmap(qvariant_cast<QPixmap>(mimeData->imageData())); } else if (mimeData->hasHtml()) { setText(mimeData->html()); setTextFormat(Qt::RichText); } else if (mimeData->hasText()) { setText(mimeData->text()); setTextFormat(Qt::PlainText); } else { setText(tr("Cannot display data")); } } ``` ### Notes for X11 Users * The X11 Window System has the concept of a separate selection and clipboard. When text is selected, it is immediately available as the global mouse selection. The global mouse selection may later be copied to the clipboard. By convention, the middle mouse button is used to paste the global mouse selection. * X11 also has the concept of ownership; if you change the selection within a window, X11 will only notify the owner and the previous owner of the change, i.e. it will not notify all applications that the selection or clipboard data changed. * Lastly, the X11 clipboard is event driven, i.e. the clipboard will not function properly if the event loop is not running. Similarly, it is recommended that the contents of the clipboard are stored or retrieved in direct response to user-input events, e.g. mouse button or key presses and releases. You should not store or retrieve the clipboard contents in response to timer or non-user-input events. * Since there is no standard way to copy and paste files between applications on X11, various MIME types and conventions are currently in use. For instance, Nautilus expects files to be supplied with a `x-special/gnome-copied-files` MIME type with data beginning with the cut/copy action, a newline character, and the URL of the file. ### Notes for macOS Users macOS supports a separate find buffer that holds the current search string in Find operations. This find clipboard can be accessed by specifying the [FindBuffer](qclipboard#Mode-enum) mode. ### Notes for Windows and macOS Users * Windows and macOS do not support the global mouse selection; they only supports the global clipboard, i.e. they only add text to the clipboard when an explicit copy or cut is made. * Windows and macOS does not have the concept of ownership; the clipboard is a fully global resource so all applications are notified of changes. **See also** [QGuiApplication](qguiapplication). Member Type Documentation ------------------------- ### enum QClipboard::Mode This enum type is used to control which part of the system clipboard is used by [QClipboard::mimeData](qclipboard#mimeData)(), [QClipboard::setMimeData](qclipboard#setMimeData)() and related functions. | Constant | Value | Description | | --- | --- | --- | | `QClipboard::Clipboard` | `0` | indicates that data should be stored and retrieved from the global clipboard. | | `QClipboard::Selection` | `1` | indicates that data should be stored and retrieved from the global mouse selection. Support for `Selection` is provided only on systems with a global mouse selection (e.g. X11). | | `QClipboard::FindBuffer` | `2` | indicates that data should be stored and retrieved from the Find buffer. This mode is used for holding search strings on macOS. | **See also** [QClipboard::supportsSelection](qclipboard#supportsSelection)(). Member Function Documentation ----------------------------- ### `[signal]` void QClipboard::changed([QClipboard::Mode](qclipboard#Mode-enum) *mode*) This signal is emitted when the data for the given clipboard *mode* is changed. **See also** [dataChanged](qclipboard#dataChanged)(), [selectionChanged](qclipboard#selectionChanged)(), and [findBufferChanged](qclipboard#findBufferChanged)(). ### `[signal]` void QClipboard::dataChanged() This signal is emitted when the clipboard data is changed. On macOS and with Qt version 4.3 or higher, clipboard changes made by other applications will only be detected when the application is activated. **See also** [findBufferChanged](qclipboard#findBufferChanged)(), [selectionChanged](qclipboard#selectionChanged)(), and [changed](qclipboard#changed)(). ### `[signal]` void QClipboard::findBufferChanged() This signal is emitted when the find buffer is changed. This only applies to macOS. With Qt version 4.3 or higher, clipboard changes made by other applications will only be detected when the application is activated. **See also** [dataChanged](qclipboard#dataChanged)(), [selectionChanged](qclipboard#selectionChanged)(), and [changed](qclipboard#changed)(). ### `[signal]` void QClipboard::selectionChanged() This signal is emitted when the selection is changed. This only applies to windowing systems that support selections, e.g. X11. Windows and macOS don't support selections. **See also** [dataChanged](qclipboard#dataChanged)(), [findBufferChanged](qclipboard#findBufferChanged)(), and [changed](qclipboard#changed)(). ### void QClipboard::clear([QClipboard::Mode](qclipboard#Mode-enum) *mode* = Clipboard) Clear the clipboard contents. The *mode* argument is used to control which part of the system clipboard is used. If *mode* is [QClipboard::Clipboard](qclipboard#Mode-enum), this function clears the global clipboard contents. If *mode* is [QClipboard::Selection](qclipboard#Mode-enum), this function clears the global mouse selection contents. If *mode* is [QClipboard::FindBuffer](qclipboard#Mode-enum), this function clears the search string buffer. **See also** [QClipboard::Mode](qclipboard#Mode-enum) and [supportsSelection](qclipboard#supportsSelection)(). ### [QImage](qimage) QClipboard::image([QClipboard::Mode](qclipboard#Mode-enum) *mode* = Clipboard) const Returns the clipboard image, or returns a null image if the clipboard does not contain an image or if it contains an image in an unsupported image format. The *mode* argument is used to control which part of the system clipboard is used. If *mode* is [QClipboard::Clipboard](qclipboard#Mode-enum), the image is retrieved from the global clipboard. If *mode* is [QClipboard::Selection](qclipboard#Mode-enum), the image is retrieved from the global mouse selection. **See also** [setImage](qclipboard#setImage)(), [pixmap](qclipboard#pixmap)(), [mimeData](qclipboard#mimeData)(), and [QImage::isNull](qimage#isNull)(). ### const [QMimeData](qmimedata) \*QClipboard::mimeData([QClipboard::Mode](qclipboard#Mode-enum) *mode* = Clipboard) const Returns a pointer to a [QMimeData](qmimedata) representation of the current clipboard data (can be `nullptr` if the given *mode* is not supported by the platform). The *mode* argument is used to control which part of the system clipboard is used. If *mode* is [QClipboard::Clipboard](qclipboard#Mode-enum), the data is retrieved from the global clipboard. If *mode* is [QClipboard::Selection](qclipboard#Mode-enum), the data is retrieved from the global mouse selection. If *mode* is [QClipboard::FindBuffer](qclipboard#Mode-enum), the data is retrieved from the search string buffer. The [text](qclipboard#text)(), [image](qclipboard#image)(), and [pixmap](qclipboard#pixmap)() functions are simpler wrappers for retrieving text, image, and pixmap data. **Note:** The pointer returned might become invalidated when the contents of the clipboard changes; either by calling one of the setter functions or externally by the system clipboard changing. **See also** [setMimeData](qclipboard#setMimeData)(). ### bool QClipboard::ownsClipboard() const Returns `true` if this clipboard object owns the clipboard data; otherwise returns `false`. ### bool QClipboard::ownsFindBuffer() const Returns `true` if this clipboard object owns the find buffer data; otherwise returns `false`. ### bool QClipboard::ownsSelection() const Returns `true` if this clipboard object owns the mouse selection data; otherwise returns `false`. ### [QPixmap](qpixmap) QClipboard::pixmap([QClipboard::Mode](qclipboard#Mode-enum) *mode* = Clipboard) const Returns the clipboard pixmap, or null if the clipboard does not contain a pixmap. Note that this can lose information. For example, if the image is 24-bit and the display is 8-bit, the result is converted to 8 bits, and if the image has an alpha channel, the result just has a mask. The *mode* argument is used to control which part of the system clipboard is used. If *mode* is [QClipboard::Clipboard](qclipboard#Mode-enum), the pixmap is retrieved from the global clipboard. If *mode* is [QClipboard::Selection](qclipboard#Mode-enum), the pixmap is retrieved from the global mouse selection. **See also** [setPixmap](qclipboard#setPixmap)(), [image](qclipboard#image)(), [mimeData](qclipboard#mimeData)(), and [QPixmap::convertFromImage](qpixmap#convertFromImage)(). ### void QClipboard::setImage(const [QImage](qimage) &*image*, [QClipboard::Mode](qclipboard#Mode-enum) *mode* = Clipboard) Copies the *image* into the clipboard. The *mode* argument is used to control which part of the system clipboard is used. If *mode* is [QClipboard::Clipboard](qclipboard#Mode-enum), the image is stored in the global clipboard. If *mode* is [QClipboard::Selection](qclipboard#Mode-enum), the data is stored in the global mouse selection. This is shorthand for: ``` QMimeData *data = new QMimeData; data->setImageData(image); clipboard->setMimeData(data, mode); ``` **See also** [image](qclipboard#image)(), [setPixmap](qclipboard#setPixmap)(), and [setMimeData](qclipboard#setMimeData)(). ### void QClipboard::setMimeData([QMimeData](qmimedata) \**src*, [QClipboard::Mode](qclipboard#Mode-enum) *mode* = Clipboard) Sets the clipboard data to *src*. Ownership of the data is transferred to the clipboard. If you want to remove the data either call [clear](qclipboard#clear)() or call setMimeData() again with new data. The *mode* argument is used to control which part of the system clipboard is used. If *mode* is [QClipboard::Clipboard](qclipboard#Mode-enum), the data is stored in the global clipboard. If *mode* is [QClipboard::Selection](qclipboard#Mode-enum), the data is stored in the global mouse selection. If *mode* is [QClipboard::FindBuffer](qclipboard#Mode-enum), the data is stored in the search string buffer. The [setText](qclipboard#setText)(), [setImage](qclipboard#setImage)() and [setPixmap](qclipboard#setPixmap)() functions are simpler wrappers for setting text, image and pixmap data respectively. **See also** [mimeData](qclipboard#mimeData)(). ### void QClipboard::setPixmap(const [QPixmap](qpixmap) &*pixmap*, [QClipboard::Mode](qclipboard#Mode-enum) *mode* = Clipboard) Copies *pixmap* into the clipboard. Note that this is slower than [setImage](qclipboard#setImage)() because it needs to convert the [QPixmap](qpixmap) to a [QImage](qimage) first. The *mode* argument is used to control which part of the system clipboard is used. If *mode* is [QClipboard::Clipboard](qclipboard#Mode-enum), the pixmap is stored in the global clipboard. If *mode* is [QClipboard::Selection](qclipboard#Mode-enum), the pixmap is stored in the global mouse selection. **See also** [pixmap](qclipboard#pixmap)(), [setImage](qclipboard#setImage)(), and [setMimeData](qclipboard#setMimeData)(). ### void QClipboard::setText(const [QString](qstring) &*text*, [QClipboard::Mode](qclipboard#Mode-enum) *mode* = Clipboard) Copies *text* into the clipboard as plain text. The *mode* argument is used to control which part of the system clipboard is used. If *mode* is [QClipboard::Clipboard](qclipboard#Mode-enum), the text is stored in the global clipboard. If *mode* is [QClipboard::Selection](qclipboard#Mode-enum), the text is stored in the global mouse selection. If *mode* is [QClipboard::FindBuffer](qclipboard#Mode-enum), the text is stored in the search string buffer. **See also** [text](qclipboard#text)() and [setMimeData](qclipboard#setMimeData)(). ### bool QClipboard::supportsFindBuffer() const Returns `true` if the clipboard supports a separate search buffer; otherwise returns `false`. ### bool QClipboard::supportsSelection() const Returns `true` if the clipboard supports mouse selection; otherwise returns `false`. ### [QString](qstring) QClipboard::text([QClipboard::Mode](qclipboard#Mode-enum) *mode* = Clipboard) const Returns the clipboard text as plain text, or an empty string if the clipboard does not contain any text. The *mode* argument is used to control which part of the system clipboard is used. If *mode* is [QClipboard::Clipboard](qclipboard#Mode-enum), the text is retrieved from the global clipboard. If *mode* is [QClipboard::Selection](qclipboard#Mode-enum), the text is retrieved from the global mouse selection. If *mode* is [QClipboard::FindBuffer](qclipboard#Mode-enum), the text is retrieved from the search string buffer. **See also** [setText](qclipboard#setText)() and [mimeData](qclipboard#mimeData)(). ### [QString](qstring) QClipboard::text([QString](qstring) &*subtype*, [QClipboard::Mode](qclipboard#Mode-enum) *mode* = Clipboard) const This is an overloaded function. Returns the clipboard text in subtype *subtype*, or an empty string if the clipboard does not contain any text. If *subtype* is null, any subtype is acceptable, and *subtype* is set to the chosen subtype. The *mode* argument is used to control which part of the system clipboard is used. If *mode* is [QClipboard::Clipboard](qclipboard#Mode-enum), the text is retrieved from the global clipboard. If *mode* is [QClipboard::Selection](qclipboard#Mode-enum), the text is retrieved from the global mouse selection. Common values for *subtype* are "plain" and "html". Note that calling this function repeatedly, for instance from a key event handler, may be slow. In such cases, you should use the `dataChanged()` signal instead. **See also** [setText](qclipboard#setText)() and [mimeData](qclipboard#mimeData)().
programming_docs
qt Camera QML Type Camera QML Type =============== Defines a view point through which the scene will be rendered. [More...](#details) | | | | --- | --- | | Import Statement: | import Qt3D.Render | | Since: | Qt 5.5 | | Instantiates: | [QCamera](qt3drender-qcamera) | | Inherits: | [Entity](qml-qt3d-core-entity) | * [List of all members, including inherited members](https://doc.qt.io/qt-6.2/qml-qt3d-render-camera-members.html) * [Deprecated members](https://doc.qt.io/qt-6.2/qml-qt3d-render-camera-obsolete.html) Properties ---------- * **[aspectRatio](qml-qt3d-render-camera#aspectRatio-prop)** : real * **[bottom](qml-qt3d-render-camera#bottom-prop)** : real * **[exposure](qml-qt3d-render-camera#exposure-prop)** : real * **[farPlane](qml-qt3d-render-camera#farPlane-prop)** : real * **[fieldOfView](qml-qt3d-render-camera#fieldOfView-prop)** : real * **[left](qml-qt3d-render-camera#left-prop)** : real * **[nearPlane](qml-qt3d-render-camera#nearPlane-prop)** : real * **[position](qml-qt3d-render-camera#position-prop)** : vector3d * **[projectionMatrix](qml-qt3d-render-camera#projectionMatrix-prop)** : matrix4x4 * **[projectionType](qml-qt3d-render-camera#projectionType-prop)** : enumeration * **[right](qml-qt3d-render-camera#right-prop)** : real * **[top](qml-qt3d-render-camera#top-prop)** : real * **[upVector](qml-qt3d-render-camera#upVector-prop)** : vector3d * **[viewCenter](qml-qt3d-render-camera#viewCenter-prop)** : vector3d * **[viewVector](qml-qt3d-render-camera#viewVector-prop)** : vector3d Methods ------- * void **[pan](qml-qt3d-render-camera#pan-method-1)**(real *angle*, vector3d *axis*) * void **[pan](qml-qt3d-render-camera#pan-method)**(real *angle*) * void **[panAboutViewCenter](qml-qt3d-render-camera#panAboutViewCenter-method-1)**(real *angle*, vector3d *axis*) * void **[panAboutViewCenter](qml-qt3d-render-camera#panAboutViewCenter-method)**(real *angle*) * quaternion **[panRotation](qml-qt3d-render-camera#panRotation-method)**(real *angle*) * void **[roll](qml-qt3d-render-camera#roll-method)**(real *angle*) * void **[rollAboutViewCenter](qml-qt3d-render-camera#rollAboutViewCenter-method)**(real *angle*) * quaternion **[rollRotation](qml-qt3d-render-camera#rollRotation-method)**(real *angle*) * void **[rotate](qml-qt3d-render-camera#rotate-method)**(quaternion *q*) * void **[rotateAboutViewCenter](qml-qt3d-render-camera#rotateAboutViewCenter-method)**(quaternion *q*) * quaternion **[rotation](qml-qt3d-render-camera#rotation-method)**(real *angle*, vector3d *axis*) * void **[tilt](qml-qt3d-render-camera#tilt-method)**(real *angle*) * void **[tiltAboutViewCenter](qml-qt3d-render-camera#tiltAboutViewCenter-method)**(real *angle*) * quaternion **[tiltRotation](qml-qt3d-render-camera#tiltRotation-method)**(real *angle*) * void **[translate](qml-qt3d-render-camera#translate-method)**(vector3d *vLocal*, enumeration *option*) * void **[translateWorld](qml-qt3d-render-camera#translateWorld-method)**(vector3d *vWorld*, enumeration *option*) * void **[viewAll](qml-qt3d-render-camera#viewAll-method)**() * void **[viewEntity](qml-qt3d-render-camera#viewEntity-method)**(Entity *entity*) * void **[viewSphere](qml-qt3d-render-camera#viewSphere-method)**(vector3d *center*, real *radius*) Detailed Description -------------------- Property Documentation ---------------------- ### aspectRatio : [real](qml-real) Holds the current aspect ratio of the camera. ### bottom : [real](qml-real) Holds the current bottom of the camera. This property is only relevant when [projectionType](qml-qt3d-render-camera#projectionType-prop) is [CameraLens](qml-qt3d-render-cameralens).OrthographicProjection. ### exposure : [real](qml-real) Holds the current exposure of the camera. The default value is 0.0. The [MetalRoughMaterial](qml-qt3d-extras-metalroughmaterial) in Qt 3D Extras is currently the only provided material that makes use of camera exposure. Negative values will cause the material to be darker, and positive values will cause it to be lighter. Custom materials may choose to interpret the value differently. ### farPlane : [real](qml-real) Holds the current camera far plane of the camera. Objects that are farther from the camera than the farPlane will not be rendered. ### fieldOfView : [real](qml-real) Holds the current vertical field of view of the camera in degrees. Along with [aspectRatio](qml-qt3d-render-camera#aspectRatio-prop), this property determines how much of the scene is visible to the camera. In that respect you might think of it as analogous to choosing a wide angle (wide horizontal field of view) or telephoto (narrow horizontal field of view) lens, depending on how much of a scene you want to capture. fieldOfView is only relevant when [projectionType](qml-qt3d-render-camera#projectionType-prop) is [CameraLens](qml-qt3d-render-cameralens).PerspectiveProjection. ### left : [real](qml-real) Holds the current left of the camera. This property is only relevant when [projectionType](qml-qt3d-render-camera#projectionType-prop) is [CameraLens](qml-qt3d-render-cameralens).OrthographicProjection. ### nearPlane : [real](qml-real) Holds the current camera near plane of the camera. Objects that are closer to the camera than the nearPlane will not be rendered. ### position : [vector3d](qml-vector3d) Holds the current position of the camera in coordinates relative to the parent entity. ### projectionMatrix : [matrix4x4](qml-matrix4x4) Holds the current projection matrix of the camera. ### projectionType : [enumeration](qml-enumeration) Holds the type of the camera projection. The default value is [CameraLens](qml-qt3d-render-cameralens).PerspectiveProjection. * [CameraLens](qml-qt3d-render-cameralens).OrthographicProjection - Parallel lines appear parallel. Objects appear the same size regardless of distance. * [CameraLens](qml-qt3d-render-cameralens).PerspectiveProjection - Parallel lines appear to meet in the distance. Objects appear to shrink the farther they are from the camera. * [CameraLens](qml-qt3d-render-cameralens).FrustumProjection * [CameraLens](qml-qt3d-render-cameralens).CustomProjection **See also** [Qt3DRender::QCameraLens::ProjectionType](qt3drender-qcameralens#ProjectionType-enum). ### right : [real](qml-real) Holds the current right of the camera. This property is only relevant when [projectionType](qml-qt3d-render-camera#projectionType-prop) is [CameraLens](qml-qt3d-render-cameralens).OrthographicProjection. ### top : [real](qml-real) Holds the current top of the camera. This property is only relevant when [projectionType](qml-qt3d-render-camera#projectionType-prop) is [CameraLens](qml-qt3d-render-cameralens).OrthographicProjection. ### upVector : [vector3d](qml-vector3d) Holds the current up vector of the camera in coordinates relative to the parent entity. The up vector indicates which direction the top of the camera is facing. Think of taking a picture: after positioning yourself and pointing the camera at your target, you might rotate the camera left or right, giving you a portrait or landscape (or angled!) shot. upVector allows you to control this type of movement. ### viewCenter : [vector3d](qml-vector3d) Holds the current view center of the camera in coordinates relative to the parent entity. Intuitively, the viewCenter is the location the camera is pointing at. ### [read-only] viewVector : [vector3d](qml-vector3d) Holds the camera's view vector in coordinates relative to the parent entity. This vector decribes the displacement from the camera ([position](qml-qt3d-render-camera#position-prop)) to its target ([viewCenter](qml-qt3d-render-camera#viewCenter-prop)). Method Documentation -------------------- ### void pan([real](qml-real) *angle*, [vector3d](qml-vector3d) *axis*) Adjusts the camera pan about view center by *angle* in degrees on *axis*. ### void pan([real](qml-real) *angle*) Adjusts the pan angle of the camera by *angle* in degrees. ### void panAboutViewCenter([real](qml-real) *angle*, [vector3d](qml-vector3d) *axis*) Adjusts the camera pan about view center by *angle* in degrees on *axis*. ### void panAboutViewCenter([real](qml-real) *angle*) Adjusts the camera pan about view center by *angle* in degrees. ### [quaternion](qml-quaternion) panRotation([real](qml-real) *angle*) Returns the calculated pan rotation in relation to the *angle* in degrees taken in to adjust the camera's pan or left/right rotation on the Y axis. ### void roll([real](qml-real) *angle*) Adjusts the camera roll by *angle* in degrees. ### void rollAboutViewCenter([real](qml-real) *angle*) Adjusts the camera roll about view center by *angle* in degrees. ### [quaternion](qml-quaternion) rollRotation([real](qml-real) *angle*) Returns the calculated roll rotation in relation to the *angle* in degrees taken in to adjust the camera's roll or lean left/right rotation on the Z axis. ### void rotate([quaternion](qml-quaternion) *q*) Rotates the camera with the use of a Quaternion in *q*. ### void rotateAboutViewCenter([quaternion](qml-quaternion) *q*) Rotates the camera about the view center with the use of a Quaternion in *q*. ### [quaternion](qml-quaternion) rotation([real](qml-real) *angle*, [vector3d](qml-vector3d) *axis*) Returns the calculated rotation in relation to the *angle* in degrees and chosen *axis* taken in. ### void tilt([real](qml-real) *angle*) Adjusts the tilt angle of the camera by *angle* in degrees. ### void tiltAboutViewCenter([real](qml-real) *angle*) Adjusts the camera tilt about view center by *angle* in degrees. ### [quaternion](qml-quaternion) tiltRotation([real](qml-real) *angle*) Returns the calculated tilt rotation in relation to the *angle* in degrees taken in to adjust the camera's tilt or up/down rotation on the X axis. ### void translate([vector3d](qml-vector3d) *vLocal*, [enumeration](qml-enumeration) *option*) Translates the camera's position and its view vector by *vLocal* in local coordinates. The *option* allows for toggling whether the view center should be translated. * Camera.TranslateViewCenter * Camera.DontTranslateViewCenter **See also** [Qt3DRender::QCamera::CameraTranslationOption](qt3drender-qcamera#CameraTranslationOption-enum). ### void translateWorld([vector3d](qml-vector3d) *vWorld*, [enumeration](qml-enumeration) *option*) Translates the camera's position and its view vector by *vWorld* in world coordinates. The *option* allows for toggling whether the view center should be translated. * Camera.TranslateViewCenter * Camera.DontTranslateViewCenter **See also** [Qt3DRender::QCamera::CameraTranslationOption](qt3drender-qcamera#CameraTranslationOption-enum). ### void viewAll() Rotates and moves the camera so that it's [viewCenter](qml-qt3d-render-camera#viewCenter-prop) is the center of the scene's bounding volume and the entire scene fits in the view port. **Note:** Only works if the lens is in perspective or orthographic projection mode. **See also** [Qt3D.Render::Camera::projectionType](qml-qt3d-render-camera#projectionType-prop). ### void viewEntity([Entity](qml-qt3d-core-entity) *entity*) Rotates and moves the camera so that it's [viewCenter](qml-qt3d-render-camera#viewCenter-prop) is the center of the entity's bounding volume and the entire *entity* fits in the view port. **Note:** Only works if the lens is in perspective or orthographic projection mode. **See also** [Qt3D.Render::Camera::projectionType](qml-qt3d-render-camera#projectionType-prop). ### void viewSphere([vector3d](qml-vector3d) *center*, [real](qml-real) *radius*) Rotates and moves the camera so that it's [viewCenter](qml-qt3d-render-camera#viewCenter-prop) is *center* and a sphere of *radius* fits in the view port. **Note:** Only works if the lens is in perspective or orthographic projection mode. **See also** [Qt3D.Render::Camera::projectionType](qml-qt3d-render-camera#projectionType-prop). qt Flickable QML Type Flickable QML Type ================== Provides a surface that can be "flicked". [More...](#details) | | | | --- | --- | | Import Statement: | import QtQuick | | Inherits: | [Item](qml-qtquick-item) | | Inherited By: | [GridView](qml-qtquick-gridview), [ListView](qml-qtquick-listview), and [TableView](qml-qtquick-tableview) | * [List of all members, including inherited members](https://doc.qt.io/qt-6.2/qml-qtquick-flickable-members.html) Properties ---------- * **[atXBeginning](qml-qtquick-flickable#atXBeginning-prop)** : bool * **[atXEnd](qml-qtquick-flickable#atXEnd-prop)** : bool * **[atYBeginning](qml-qtquick-flickable#atYBeginning-prop)** : bool * **[atYEnd](qml-qtquick-flickable#atYEnd-prop)** : bool * **[bottomMargin](qml-qtquick-flickable#bottomMargin-prop)** : real * **[boundsBehavior](qml-qtquick-flickable#boundsBehavior-prop)** : enumeration * **[boundsMovement](qml-qtquick-flickable#boundsMovement-prop)** : enumeration * **[contentHeight](qml-qtquick-flickable#contentHeight-prop)** : real * **[contentItem](qml-qtquick-flickable#contentItem-prop)** : Item * **[contentWidth](qml-qtquick-flickable#contentWidth-prop)** : real * **[contentX](qml-qtquick-flickable#contentX-prop)** : real * **[contentY](qml-qtquick-flickable#contentY-prop)** : real * **[dragging](qml-qtquick-flickable#dragging-prop)** : bool * **[draggingHorizontally](qml-qtquick-flickable#draggingHorizontally-prop)** : bool * **[draggingVertically](qml-qtquick-flickable#draggingVertically-prop)** : bool * **[flickDeceleration](qml-qtquick-flickable#flickDeceleration-prop)** : real * **[flickableDirection](qml-qtquick-flickable#flickableDirection-prop)** : enumeration * **[flicking](qml-qtquick-flickable#flicking-prop)** : bool * **[flickingHorizontally](qml-qtquick-flickable#flickingHorizontally-prop)** : bool * **[flickingVertically](qml-qtquick-flickable#flickingVertically-prop)** : bool * **[horizontalOvershoot](qml-qtquick-flickable#horizontalOvershoot-prop)** : real * **[horizontalVelocity](qml-qtquick-flickable#horizontalVelocity-prop)** : real * **[interactive](qml-qtquick-flickable#interactive-prop)** : bool * **[leftMargin](qml-qtquick-flickable#leftMargin-prop)** : real * **[maximumFlickVelocity](qml-qtquick-flickable#maximumFlickVelocity-prop)** : real * **[moving](qml-qtquick-flickable#moving-prop)** : bool * **[movingHorizontally](qml-qtquick-flickable#movingHorizontally-prop)** : bool * **[movingVertically](qml-qtquick-flickable#movingVertically-prop)** : bool * **[originX](qml-qtquick-flickable#originX-prop)** : real * **[originY](qml-qtquick-flickable#originY-prop)** : real * **[pixelAligned](qml-qtquick-flickable#pixelAligned-prop)** : bool * **[pressDelay](qml-qtquick-flickable#pressDelay-prop)** : int * **[rebound](qml-qtquick-flickable#rebound-prop)** : Transition * **[rightMargin](qml-qtquick-flickable#rightMargin-prop)** : real * **[synchronousDrag](qml-qtquick-flickable#synchronousDrag-prop)** : bool * **[topMargin](qml-qtquick-flickable#topMargin-prop)** : real * **[verticalOvershoot](qml-qtquick-flickable#verticalOvershoot-prop)** : real * **[verticalVelocity](qml-qtquick-flickable#verticalVelocity-prop)** : real * **[visibleArea](qml-qtquick-flickable#visibleArea-prop)** + **[visibleArea.heightRatio](qml-qtquick-flickable#visibleArea.heightRatio-prop)** : real + **[visibleArea.widthRatio](qml-qtquick-flickable#visibleArea.widthRatio-prop)** : real + **[visibleArea.xPosition](qml-qtquick-flickable#visibleArea.xPosition-prop)** : real + **[visibleArea.yPosition](qml-qtquick-flickable#visibleArea.yPosition-prop)** : real Signals ------- * **[flickEnded](qml-qtquick-flickable#flickEnded-signal)**() * **[flickStarted](qml-qtquick-flickable#flickStarted-signal)**() * **[movementEnded](qml-qtquick-flickable#movementEnded-signal)**() * **[movementStarted](qml-qtquick-flickable#movementStarted-signal)**() Methods ------- * **[cancelFlick](qml-qtquick-flickable#cancelFlick-method)**() * **[flick](qml-qtquick-flickable#flick-method)**(qreal *xVelocity*, qreal *yVelocity*) * **[resizeContent](qml-qtquick-flickable#resizeContent-method)**(real *width*, real *height*, QPointF *center*) * **[returnToBounds](qml-qtquick-flickable#returnToBounds-method)**() Detailed Description -------------------- The Flickable item places its children on a surface that can be dragged and flicked, causing the view onto the child items to scroll. This behavior forms the basis of Items that are designed to show large numbers of child items, such as [ListView](qml-qtquick-listview) and [GridView](qml-qtquick-gridview). In traditional user interfaces, views can be scrolled using standard controls, such as scroll bars and arrow buttons. In some situations, it is also possible to drag the view directly by pressing and holding a mouse button while moving the cursor. In touch-based user interfaces, this dragging action is often complemented with a flicking action, where scrolling continues after the user has stopped touching the view. Flickable does not automatically clip its contents. If it is not used as a full-screen item, you should consider setting the [clip](qml-qtquick-item#clip-prop) property to true. Example Usage ------------- ![](https://doc.qt.io/qt-6.2/images/flickable.gif) The following example shows a small view onto a large image in which the user can drag or flick the image in order to view different parts of it. ``` import QtQuick 2.0 Flickable { width: 200; height: 200 contentWidth: image.width; contentHeight: image.height Image { id: image; source: "bigImage.png" } } ``` Items declared as children of a Flickable are automatically parented to the Flickable's [contentItem](qml-qtquick-flickable#contentItem-prop). This should be taken into account when operating on the children of the Flickable; it is usually the children of `contentItem` that are relevant. For example, the bound of Items added to the Flickable will be available by `contentItem.childrenRect` Examples of contentX and contentY --------------------------------- The following images demonstrate a flickable being flicked in various directions and the resulting [contentX](qml-qtquick-flickable#contentX-prop) and [contentY](qml-qtquick-flickable#contentY-prop) values. The blue square represents the flickable's content, and the black border represents the bounds of the flickable. | | | | --- | --- | | | The `contentX` and `contentY` are both `0`. | | | The `contentX` and the `contentY` are both `50`. | | | The `contentX` is `-50` and the `contentY` is `50`. | | | The `contentX` and the `contentY` are both `-50`. | | | The `contentX` is `50` and the `contentY` is `-50`. | Limitations ----------- **Note:** Due to an implementation detail, items placed inside a Flickable cannot anchor to the Flickable. Instead, use [parent](qml-qtquick-item#parent-prop), which refers to the Flickable's [contentItem](qml-qtquick-flickable#contentItem-prop). The size of the content item is determined by [contentWidth](qml-qtquick-flickable#contentWidth-prop) and [contentHeight](qml-qtquick-flickable#contentHeight-prop). Property Documentation ---------------------- ### moving : [bool](qml-bool) These properties describe whether the view is currently moving horizontally, vertically or in either direction, due to the user either dragging or flicking the view. ### dragging : [bool](qml-bool) These properties describe whether the view is currently moving horizontally, vertically or in either direction, due to the user dragging the view. ### flicking : [bool](qml-bool) These properties describe whether the view is currently moving horizontally, vertically or in either direction, due to the user flicking the view. ### originX : [real](qml-real) These properties hold the origin of the content. This value always refers to the top-left position of the content regardless of layout direction. This is usually (0,0), however [ListView](qml-qtquick-listview) and [GridView](qml-qtquick-gridview) may have an arbitrary origin due to delegate size variation, or item insertion/removal outside the visible region. **See also** [contentX](qml-qtquick-flickable#contentX-prop) and [contentY](qml-qtquick-flickable#contentY-prop). ### bottomMargin : [real](qml-real) These properties hold the margins around the content. This space is reserved in addition to the [contentWidth](qml-qtquick-flickable#contentWidth-prop) and [contentHeight](qml-qtquick-flickable#contentHeight-prop). ### contentHeight : [real](qml-real) The dimensions of the content (the surface controlled by Flickable). This should typically be set to the combined size of the items placed in the Flickable. The following snippet shows how these properties are used to display an image that is larger than the Flickable item itself: ``` import QtQuick 2.0 Flickable { width: 200; height: 200 contentWidth: image.width; contentHeight: image.height Image { id: image; source: "bigImage.png" } } ``` In some cases, the content dimensions can be automatically set based on the [childrenRect.width](qml-qtquick-item#childrenRect.width-prop) and [childrenRect.height](qml-qtquick-item#childrenRect.height-prop) properties of the [contentItem](qml-qtquick-flickable#contentItem-prop). For example, the previous snippet could be rewritten with: ``` contentWidth: contentItem.childrenRect.width; contentHeight: contentItem.childrenRect.height ``` Though this assumes that the origin of the childrenRect is 0,0. ### atXBeginning : [bool](qml-bool) These properties are true if the flickable view is positioned at the beginning, or end respectively. ### horizontalVelocity : [real](qml-real) The instantaneous velocity of movement along the x and y axes, in pixels/sec. The reported velocity is smoothed to avoid erratic output. Note that for views with a large content size (more than 10 times the view size), the velocity of the flick may exceed the velocity of the touch in the case of multiple quick consecutive flicks. This allows the user to flick faster through large content. ### contentX : [real](qml-real) These properties hold the surface coordinate currently at the top-left corner of the Flickable. For example, if you flick an image up 100 pixels, `contentY` will increase by 100. **Note:** If you flick back to the origin (the top-left corner), after the rebound animation, `contentX` will settle to the same value as `originX`, and `contentY` to `originY`. These are usually (0,0), however [ListView](qml-qtquick-listview) and [GridView](qml-qtquick-gridview) may have an arbitrary origin due to delegate size variation, or item insertion/removal outside the visible region. So if you want to implement something like a vertical scrollbar, one way is to use `y: (contentY - originY) * (height / contentHeight)` for the position; another way is to use the normalized values in [visibleArea](qml-qtquick-flickable#visibleArea-prop). **See also** [Examples of contentX and contentY](qml-qtquick-flickable#examples-of-contentx-and-contenty), [originX](qml-qtquick-flickable#originX-prop), and [originY](qml-qtquick-flickable#originY-prop). ### boundsBehavior : [enumeration](qml-enumeration) This property holds whether the surface may be dragged beyond the Flickable's boundaries, or overshoot the Flickable's boundaries when flicked. When the [boundsMovement](qml-qtquick-flickable#boundsMovement-prop) is `Flickable.FollowBoundsBehavior`, a value other than `Flickable.StopAtBounds` will give a feeling that the edges of the view are soft, rather than a hard physical boundary. The `boundsBehavior` can be one of: * Flickable.StopAtBounds - the contents can not be dragged beyond the boundary of the flickable, and flicks will not overshoot. * Flickable.DragOverBounds - the contents can be dragged beyond the boundary of the Flickable, but flicks will not overshoot. * Flickable.OvershootBounds - the contents can overshoot the boundary when flicked, but the content cannot be dragged beyond the boundary of the flickable. (since `QtQuick 2.5`) * Flickable.DragAndOvershootBounds (default) - the contents can be dragged beyond the boundary of the Flickable, and can overshoot the boundary when flicked. **See also** [horizontalOvershoot](qml-qtquick-flickable#horizontalOvershoot-prop), [verticalOvershoot](qml-qtquick-flickable#verticalOvershoot-prop), and [boundsMovement](qml-qtquick-flickable#boundsMovement-prop). ### [since 5.10] boundsMovement : [enumeration](qml-enumeration) This property holds whether the flickable will give a feeling that the edges of the view are soft, rather than a hard physical boundary. The `boundsMovement` can be one of: * Flickable.StopAtBounds - this allows implementing custom edge effects where the contents do not follow drags or flicks beyond the bounds of the flickable. The values of [horizontalOvershoot](qml-qtquick-flickable#horizontalOvershoot-prop) and [verticalOvershoot](qml-qtquick-flickable#verticalOvershoot-prop) can be utilized to implement custom edge effects. * Flickable.FollowBoundsBehavior (default) - whether the contents follow drags or flicks beyond the bounds of the flickable is determined by [boundsBehavior](qml-qtquick-flickable#boundsBehavior-prop). The following example keeps the contents within bounds and instead applies a flip effect when flicked over horizontal bounds: ``` Flickable { id: flickable boundsMovement: Flickable.StopAtBounds boundsBehavior: Flickable.DragAndOvershootBounds transform: Rotation { axis { x: 0; y: 1; z: 0 } origin.x: flickable.width / 2 origin.y: flickable.height / 2 angle: Math.min(30, Math.max(-30, flickable.horizontalOvershoot)) } } ``` The following example keeps the contents within bounds and instead applies an opacity effect when dragged over vertical bounds: ``` Flickable { boundsMovement: Flickable.StopAtBounds boundsBehavior: Flickable.DragOverBounds opacity: Math.max(0.5, 1.0 - Math.abs(verticalOvershoot) / height) } ``` This property was introduced in Qt 5.10. **See also** [boundsBehavior](qml-qtquick-flickable#boundsBehavior-prop), [verticalOvershoot](qml-qtquick-flickable#verticalOvershoot-prop), and [horizontalOvershoot](qml-qtquick-flickable#horizontalOvershoot-prop). ### contentItem : [Item](qml-qtquick-item) The internal item that contains the Items to be moved in the Flickable. Items declared as children of a Flickable are automatically parented to the Flickable's contentItem. Items created dynamically need to be explicitly parented to the *contentItem*: ``` Flickable { id: myFlickable function addItem(file) { var component = Qt.createComponent(file) component.createObject(myFlickable.contentItem); } } ``` ### flickDeceleration : [real](qml-real) This property holds the rate at which a flick will decelerate: the higher the number, the faster it slows down when the user stops flicking via touch, touchpad or mouse wheel. For example 0.0001 is nearly "frictionless", and 10000 feels quite "sticky". The default value is platform dependent. Values of zero or less are not allowed. **Note:** For touchpad flicking, some platforms drive Flickable directly by sending QWheelEvents with [QWheelEvent::phase](qwheelevent#phase)() being `Qt::ScrollMomentum`, after the user has released all fingers from the touchpad. In that case, the operating system is controlling the deceleration, and this property has no effect. **Note:** For mouse wheel scrolling, and for gesture scrolling on touchpads that do not have a momentum phase, extremely large values of flickDeceleration can make Flickable very resistant to scrolling, especially if [maximumFlickVelocity](qml-qtquick-flickable#maximumFlickVelocity-prop) is too small. ### flickableDirection : [enumeration](qml-enumeration) This property determines which directions the view can be flicked. * Flickable.AutoFlickDirection (default) - allows flicking vertically if the *contentHeight* is not equal to the *height* of the Flickable. Allows flicking horizontally if the *contentWidth* is not equal to the *width* of the Flickable. * Flickable.AutoFlickIfNeeded - allows flicking vertically if the *contentHeight* is greater than the *height* of the Flickable. Allows flicking horizontally if the *contentWidth* is greater than to the *width* of the Flickable. (since `QtQuick 2.7`) * Flickable.HorizontalFlick - allows flicking horizontally. * Flickable.VerticalFlick - allows flicking vertically. * Flickable.HorizontalAndVerticalFlick - allows flicking in both directions. ### [since 5.9] horizontalOvershoot : [real](qml-real) This property holds the horizontal overshoot, that is, the horizontal distance by which the contents has been dragged or flicked past the bounds of the flickable. The value is negative when the content is dragged or flicked beyond the beginning, and positive when beyond the end; `0.0` otherwise. Whether the values are reported for dragging and/or flicking is determined by [boundsBehavior](qml-qtquick-flickable#boundsBehavior-prop). The overshoot distance is reported even when [boundsMovement](qml-qtquick-flickable#boundsMovement-prop) is `Flickable.StopAtBounds`. This property was introduced in Qt 5.9. **See also** [verticalOvershoot](qml-qtquick-flickable#verticalOvershoot-prop), [boundsBehavior](qml-qtquick-flickable#boundsBehavior-prop), and [boundsMovement](qml-qtquick-flickable#boundsMovement-prop). ### interactive : [bool](qml-bool) This property describes whether the user can interact with the Flickable. A user cannot drag or flick a Flickable that is not interactive. By default, this property is true. This property is useful for temporarily disabling flicking. This allows special interaction with Flickable's children; for example, you might want to freeze a flickable map while scrolling through a pop-up dialog that is a child of the Flickable. ### maximumFlickVelocity : [real](qml-real) This property holds the maximum velocity that the user can flick the view in pixels/second. The default value is platform dependent. ### pixelAligned : [bool](qml-bool) This property sets the alignment of [contentX](qml-qtquick-flickable#contentX-prop) and [contentY](qml-qtquick-flickable#contentY-prop) to pixels (`true`) or subpixels (`false`). Enable pixelAligned to optimize for still content or moving content with high constrast edges, such as one-pixel-wide lines, text or vector graphics. Disable pixelAligned when optimizing for animation quality. The default is `false`. ### pressDelay : [int](qml-int) This property holds the time to delay (ms) delivering a press to children of the Flickable. This can be useful where reacting to a press before a flicking action has undesirable effects. If the flickable is dragged/flicked before the delay times out the press event will not be delivered. If the button is released within the timeout, both the press and release will be delivered. Note that for nested Flickables with pressDelay set, the pressDelay of outer Flickables is overridden by the innermost Flickable. If the drag exceeds the platform drag threshold, the press event will be delivered regardless of this property. **See also** [QStyleHints](qstylehints). ### rebound : [Transition](qml-qtquick-transition) This holds the transition to be applied to the content view when it snaps back to the bounds of the flickable. The transition is triggered when the view is flicked or dragged past the edge of the content area, or when [returnToBounds](qml-qtquick-flickable#returnToBounds-method)() is called. ``` import QtQuick 2.0 Flickable { width: 150; height: 150 contentWidth: 300; contentHeight: 300 rebound: Transition { NumberAnimation { properties: "x,y" duration: 1000 easing.type: Easing.OutBounce } } Rectangle { width: 300; height: 300 gradient: Gradient { GradientStop { position: 0.0; color: "lightsteelblue" } GradientStop { position: 1.0; color: "blue" } } } } ``` When the above view is flicked beyond its bounds, it will return to its bounds using the transition specified: If this property is not set, a default animation is applied. ### [since 5.12] synchronousDrag : [bool](qml-bool) If this property is set to true, then when the mouse or touchpoint moves far enough to begin dragging the content, the content will jump, such that the content pixel which was under the cursor or touchpoint when pressed remains under that point. The default is `false`, which provides a smoother experience (no jump) at the cost that some of the drag distance is "lost" at the beginning. This property was introduced in Qt 5.12. ### [since 5.9] verticalOvershoot : [real](qml-real) This property holds the vertical overshoot, that is, the vertical distance by which the contents has been dragged or flicked past the bounds of the flickable. The value is negative when the content is dragged or flicked beyond the beginning, and positive when beyond the end; `0.0` otherwise. Whether the values are reported for dragging and/or flicking is determined by [boundsBehavior](qml-qtquick-flickable#boundsBehavior-prop). The overshoot distance is reported even when [boundsMovement](qml-qtquick-flickable#boundsMovement-prop) is `Flickable.StopAtBounds`. This property was introduced in Qt 5.9. **See also** [horizontalOvershoot](qml-qtquick-flickable#horizontalOvershoot-prop), [boundsBehavior](qml-qtquick-flickable#boundsBehavior-prop), and [boundsMovement](qml-qtquick-flickable#boundsMovement-prop). ### visibleArea.heightRatio : [real](qml-real) These properties describe the position and size of the currently viewed area. The size is defined as the percentage of the full view currently visible, scaled to 0.0 - 1.0. The page position is usually in the range 0.0 (beginning) to 1.0 minus size ratio (end), i.e. `yPosition` is in the range 0.0 to 1.0-`heightRatio`. However, it is possible for the contents to be dragged outside of the normal range, resulting in the page positions also being outside the normal range. These properties are typically used to draw a scrollbar. For example: ``` Rectangle { width: 200; height: 200 Flickable { id: flickable ... } Rectangle { id: scrollbar anchors.right: flickable.right y: flickable.visibleArea.yPosition * flickable.height width: 10 height: flickable.visibleArea.heightRatio * flickable.height color: "black" } } ``` **See also** [UI Components: Scrollbar Example](https://doc.qt.io/qt-6.2/qtquick-customitems-scrollbar-example.html). Signal Documentation -------------------- ### flickEnded() This signal is emitted when the view stops moving due to a flick. **Note:** The corresponding handler is `onFlickEnded`. ### flickStarted() This signal is emitted when the view is flicked. A flick starts from the point that the mouse or touch is released, while still in motion. **Note:** The corresponding handler is `onFlickStarted`. ### movementEnded() This signal is emitted when the view stops moving due to user interaction or a generated [flick](qml-qtquick-flickable#flick-method)(). If a flick was active, this signal will be emitted once the flick stops. If a flick was not active, this signal will be emitted when the user stops dragging - i.e. a mouse or touch release. **Note:** The corresponding handler is `onMovementEnded`. ### movementStarted() This signal is emitted when the view begins moving due to user interaction or a generated [flick](qml-qtquick-flickable#flick-method)(). **Note:** The corresponding handler is `onMovementStarted`. Method Documentation -------------------- ### cancelFlick() Cancels the current flick animation. ### flick(qreal *xVelocity*, qreal *yVelocity*) Flicks the content with *xVelocity* horizontally and *yVelocity* vertically in pixels/sec. Calling this method will update the corresponding moving and flicking properties and signals, just like a real flick. ### resizeContent([real](qml-real) *width*, [real](qml-real) *height*, QPointF *center*) Resizes the content to *width* x *height* about *center*. This does not scale the contents of the Flickable - it only resizes the [contentWidth](qml-qtquick-flickable#contentWidth-prop) and [contentHeight](qml-qtquick-flickable#contentHeight-prop). Resizing the content may result in the content being positioned outside the bounds of the Flickable. Calling [returnToBounds](qml-qtquick-flickable#returnToBounds-method)() will move the content back within legal bounds. ### returnToBounds() Ensures the content is within legal bounds. This may be called to ensure that the content is within legal bounds after manually positioning the content.
programming_docs
qt Material QML Type Material QML Type ================= Abstract base type providing functionality common to materials. [More...](#details) | | | | --- | --- | | Import Statement: | import QtQuick3D | | Inherits: | [Object3D](qml-qtquick3d-object3d) | | Inherited By: | [CustomMaterial](qml-qtquick3d-custommaterial), [DefaultMaterial](qml-qtquick3d-defaultmaterial), and [PrincipledMaterial](qml-qtquick3d-principledmaterial) | * [List of all members, including inherited members](https://doc.qt.io/qt-6.2/qml-qtquick3d-material-members.html) Properties ---------- * **[cullMode](qml-qtquick3d-material#cullMode-prop)** : enumeration * **[depthDrawMode](qml-qtquick3d-material#depthDrawMode-prop)** : enumeration * **[lightProbe](qml-qtquick3d-material#lightProbe-prop)** : Texture Detailed Description -------------------- Property Documentation ---------------------- ### cullMode : [enumeration](qml-enumeration) This property defines whether primitive culling is enabled, and, when enabled, which primitives are discarded. The default value is Material.BackFaceCulling. A triangle is considered front-facing if it has a counter-clockwise winding, meaning its vertices in framebuffer coordinates are in counter-clockwise order. | Constant | Description | | --- | --- | | `Material.BackFaceCulling` | Back-facing triangles are discarded. | | `Material.FrontFaceCulling` | Front-facing triangles are discarded. | | `Material.NoCulling` | No triangles are discarded. | ### depthDrawMode : [enumeration](qml-enumeration) This property determines if and when depth rendering takes place for this material. The default behavior when [SceneEnvironment::depthTestEnabled](qml-qtquick3d-sceneenvironment#depthTestEnabled-prop) is set to `true` is that during the main render pass only opaque materials will write to the depth buffer. This property makes it possible to change this behavior to fine tune the rendering of a material. The default value is Material.OqaqueOnlyDepthDraw | Constant | Description | | --- | --- | | `Material.OpaqueOnlyDepthDraw` | Depth rendering is only performed if the material is opaque. | | `Material.AlwaysDepthDraw` | Depth rendering is always performed regardless of the material type. | | `Material.NeverDepthDraw` | Depth rendering is never performed. | | `Material.OpaquePrePassDepthDraw` | Depth rendering is performed in a separate depth pass, but only opaque values are written. This mode also enables transparent materials to be used in combination with shadows. | **Note:** If [SceneEnvironment::depthPrePassEnabled](qml-qtquick3d-sceneenvironment#depthPrePassEnabled-prop) is set to `true` then all depth writes will take place as a result of the depth prepass, but it is still necessary to explicitly set `Material.OpaquePrePassDepthDraw` to only write the opaque fragments in the depth and shadow passes. ### lightProbe : [Texture](qml-qtquick3d-texture) This property defines a Texture for overriding or setting an image based lighting Texture for use with this material only. **Note:** Setting a light probe on the material will override the [scene's light probe](qml-qtquick3d-sceneenvironment#lightProbe-prop) for models using this material. **See also** [SceneEnvironment::lightProbe](qml-qtquick3d-sceneenvironment#lightProbe-prop). qt Basic Style Basic Style =========== The Basic style is a basic all-round style. The Basic style is a simple and light-weight style that offers the maximum performance for Qt Quick Controls. It is built with a minimal amount of Qt Quick primitives, and keeps animations and transitions to the minimum. The style is selected by default when running Qt Quick Controls applications. It is built into the module's resources, so by default it is shipped with any application that depends on the Qt Quick Controls module **Note:** The Basic style is used as a fallback for other styles. If a style does not implement a certain control, the Basic style implementation of that control is selected. **See also** [Material Style](qtquickcontrols2-material), [Universal Style](qtquickcontrols2-universal) Related Information ------------------- * [Styling Qt Quick Controls](qtquickcontrols2-styles) qt QMqttConnectionProperties Class QMqttConnectionProperties Class =============================== The QMqttConnectionProperties class represents configuration options a [QMqttClient](qmqttclient) can pass to the server when invoking [QMqttClient::connectToHost](qmqttclient#connectToHost)(). [More...](#details) | | | | --- | --- | | Header: | #include <QMqttConnectionProperties> | | qmake: | QT += mqtt | | Since: | Qt 5.12 | | Inherited By: | [QMqttServerConnectionProperties](qmqttserverconnectionproperties) | * [List of all members, including inherited members](https://doc.qt.io/qt-6.2/qmqttconnectionproperties-members.html) Public Functions ---------------- | | | | --- | --- | | QByteArray | **[authenticationData](qmqttconnectionproperties#authenticationData)**() const | | QString | **[authenticationMethod](qmqttconnectionproperties#authenticationMethod)**() const | | quint32 | **[maximumPacketSize](qmqttconnectionproperties#maximumPacketSize)**() const | | quint16 | **[maximumReceive](qmqttconnectionproperties#maximumReceive)**() const | | quint16 | **[maximumTopicAlias](qmqttconnectionproperties#maximumTopicAlias)**() const | | bool | **[requestProblemInformation](qmqttconnectionproperties#requestProblemInformation)**() const | | bool | **[requestResponseInformation](qmqttconnectionproperties#requestResponseInformation)**() const | | quint32 | **[sessionExpiryInterval](qmqttconnectionproperties#sessionExpiryInterval)**() const | | void | **[setAuthenticationData](qmqttconnectionproperties#setAuthenticationData)**(const QByteArray &*authData*) | | void | **[setAuthenticationMethod](qmqttconnectionproperties#setAuthenticationMethod)**(const QString &*authMethod*) | | void | **[setMaximumPacketSize](qmqttconnectionproperties#setMaximumPacketSize)**(quint32 *packetSize*) | | void | **[setMaximumReceive](qmqttconnectionproperties#setMaximumReceive)**(quint16 *maximumReceive*) | | void | **[setMaximumTopicAlias](qmqttconnectionproperties#setMaximumTopicAlias)**(quint16 *alias*) | | void | **[setRequestProblemInformation](qmqttconnectionproperties#setRequestProblemInformation)**(bool *problem*) | | void | **[setRequestResponseInformation](qmqttconnectionproperties#setRequestResponseInformation)**(bool *response*) | | void | **[setSessionExpiryInterval](qmqttconnectionproperties#setSessionExpiryInterval)**(quint32 *expiry*) | | void | **[setUserProperties](qmqttconnectionproperties#setUserProperties)**(const QMqttUserProperties &*properties*) | | QMqttUserProperties | **[userProperties](qmqttconnectionproperties#userProperties)**() const | Detailed Description -------------------- **Note:** Connection properties are part of the MQTT 5.0 specification and cannot be used when connecting with a lower protocol level. See [QMqttClient::ProtocolVersion](qmqttclient#ProtocolVersion-enum) for more information. Member Function Documentation ----------------------------- ### [QByteArray](qbytearray) QMqttConnectionProperties::authenticationData() const Returns the authentication data. **See also** [setAuthenticationData](qmqttconnectionproperties#setAuthenticationData)(). ### [QString](qstring) QMqttConnectionProperties::authenticationMethod() const Returns the authentication method. **See also** [setAuthenticationMethod](qmqttconnectionproperties#setAuthenticationMethod)(). ### [quint32](qtglobal#quint32-typedef) QMqttConnectionProperties::maximumPacketSize() const Returns the maximum packet size the client can receive. **See also** [setMaximumPacketSize](qmqttconnectionproperties#setMaximumPacketSize)(). ### [quint16](qtglobal#quint16-typedef) QMqttConnectionProperties::maximumReceive() const Returns the maximum amount of QoS 1 and QoS 2 publications that the client (when obtained from [QMqttClient::connectionProperties](qmqttclient#connectionProperties)()) or the server (when obtained from [QMqttClient::serverConnectionProperties](qmqttclient#serverConnectionProperties)()) is willing to process concurrently for this session. **See also** [setMaximumReceive](qmqttconnectionproperties#setMaximumReceive)(). ### [quint16](qtglobal#quint16-typedef) QMqttConnectionProperties::maximumTopicAlias() const Returns the maximum topic alias ID the client can use. **See also** [setMaximumTopicAlias](qmqttconnectionproperties#setMaximumTopicAlias)(). ### bool QMqttConnectionProperties::requestProblemInformation() const Returns whether the client should receive problem information. **See also** [setRequestProblemInformation](qmqttconnectionproperties#setRequestProblemInformation)(). ### bool QMqttConnectionProperties::requestResponseInformation() const Returns whether the client should receive response information. **See also** [setRequestResponseInformation](qmqttconnectionproperties#setRequestResponseInformation)(). ### [quint32](qtglobal#quint32-typedef) QMqttConnectionProperties::sessionExpiryInterval() const Returns the session expiry interval. **See also** [setSessionExpiryInterval](qmqttconnectionproperties#setSessionExpiryInterval)(). ### void QMqttConnectionProperties::setAuthenticationData(const [QByteArray](qbytearray) &*authData*) Sets the authentication data to *authData*. Authentication data can only be used if an authentication method has been specified. **See also** [authenticationData](qmqttconnectionproperties#authenticationData)() and [authenticationMethod](qmqttconnectionproperties#authenticationMethod)(). ### void QMqttConnectionProperties::setAuthenticationMethod(const [QString](qstring) &*authMethod*) Sets the authentication method to *authMethod*. **See also** [authenticationMethod](qmqttconnectionproperties#authenticationMethod)() and [authenticationData](qmqttconnectionproperties#authenticationData)(). ### void QMqttConnectionProperties::setMaximumPacketSize([quint32](qtglobal#quint32-typedef) *packetSize*) Sets the maximum packet size to *packetSize*. The maximum packet size specifies the maximum size one packet can contain. This includes the packet header and its properties. If no maximum packet size is specified, no limit is imposed beyond the limitations of the protocol itself. **See also** [maximumPacketSize](qmqttconnectionproperties#maximumPacketSize)(). ### void QMqttConnectionProperties::setMaximumReceive([quint16](qtglobal#quint16-typedef) *maximumReceive*) Sets the maximum amount of QoS 1 and QoS 2 publications that the client is willing to process concurrently for this session to *maximumReceive*. A maximum receive value of 0 is not allowed. **See also** [maximumReceive](qmqttconnectionproperties#maximumReceive)(). ### void QMqttConnectionProperties::setMaximumTopicAlias([quint16](qtglobal#quint16-typedef) *alias*) Sets the maximum topic alias to *alias*. The maximum topic alias specifies the highest value that the client will accept from the server. The client uses this value to limit the number of topic aliases it is willing to hold for the connection. The default value is 0. 0 indicates that the client does not accept any topic aliases on this connection. **See also** [maximumTopicAlias](qmqttconnectionproperties#maximumTopicAlias)(). ### void QMqttConnectionProperties::setRequestProblemInformation(bool *problem*) Sets the request problem information to *problem*. A client uses this to request the server to return additional information in case of failure. Types of failure include connection and message management on the server side. The default value is `false`, which indicates that the client must not receive any problem information for anything but connection management. The server still may send problem information for connection handling. If the value is `true`, the server may return problem information. Problem information is available in user properties or reason strings of the property classes. **See also** [requestProblemInformation](qmqttconnectionproperties#requestProblemInformation)(). ### void QMqttConnectionProperties::setRequestResponseInformation(bool *response*) Sets the request response information to *response*. A client uses this to request the server to return response information after the connection request has been handled. The default value is `false`, which indicates that the client must not return any response information. If the value is `true`, the server may return response information, but is not enforced to do so. **See also** [requestResponseInformation](qmqttconnectionproperties#requestResponseInformation)(). ### void QMqttConnectionProperties::setSessionExpiryInterval([quint32](qtglobal#quint32-typedef) *expiry*) Sets the session expiry interval to *expiry*. The session expiry interval specifies the number of seconds a server holds information on the client state after a connection has been closed. The default value is 0, which specifies that the session is closed when the network connection ends. If the value is specified as maximum of quint32, then the session does not expire. **See also** [sessionExpiryInterval](qmqttconnectionproperties#sessionExpiryInterval)(). ### void QMqttConnectionProperties::setUserProperties(const [QMqttUserProperties](qmqttuserproperties) &*properties*) Sets the user properties of the connection to *properties*. The default value is to not send any user information. **See also** [userProperties](qmqttconnectionproperties#userProperties)(). ### [QMqttUserProperties](qmqttuserproperties) QMqttConnectionProperties::userProperties() const Returns the user properties for the connection. **See also** [setUserProperties](qmqttconnectionproperties#setUserProperties)(). qt MouseDevice QML Type MouseDevice QML Type ==================== Delegates mouse events to the attached [MouseHandler](qml-qt3d-input-mousehandler) objects. [More...](#details) | | | | --- | --- | | Import Statement: | import Qt3D.Input | | Since: | Qt 5.5 | | Instantiates: | [QMouseDevice](qt3dinput-qmousedevice) | * [List of all members, including inherited members](https://doc.qt.io/qt-6.2/qml-qt3d-input-mousedevice-members.html) Properties ---------- * **[sensitivity](qml-qt3d-input-mousedevice#sensitivity-prop)** : real * **[updateAxesContinuously](qml-qt3d-input-mousedevice#updateAxesContinuously-prop)** : bool Detailed Description -------------------- A MouseDevice delegates mouse events from physical mouse device to [MouseHandler](qml-qt3d-input-mousehandler) objects. The sensitivity of the mouse can be controlled with the [MouseDevice::sensitivity](qml-qt3d-input-mousedevice#sensitivity-prop) property, which specifies the rate in which the logical mouse coordinates change in response to physical movement of the mouse. **See also** [MouseHandler](qml-qt3d-input-mousehandler). Property Documentation ---------------------- ### sensitivity : [real](qml-real) Holds the current sensitivity of the mouse device. Default is 0.1. ### [since 5.15] updateAxesContinuously : [bool](qml-bool) If `true`, axes will be updated anytime they change regardless of whether any mouse button is being pressed. Otherwise, axes are updated only when one of the mouse buttons is being pressed. The default value is `false`. This property was introduced in Qt 5.15. qt VectorDirection3D QML Type VectorDirection3D QML Type ========================== For specifying a direction towards the target direction. [More...](#details) | | | | --- | --- | | Import Statement: | import QtQuick3D.Particles3D | | Since: | Qt 6.2 | | Inherits: | [Direction3D](qml-qtquick3d-particles3d-direction3d) | * [List of all members, including inherited members](https://doc.qt.io/qt-6.2/qml-qtquick3d-particles3d-vectordirection3d-members.html) Properties ---------- * **[direction](qml-qtquick3d-particles3d-vectordirection3d#direction-prop)** : vector3d * **[directionVariation](qml-qtquick3d-particles3d-vectordirection3d#directionVariation-prop)** : vector3d * **[normalized](qml-qtquick3d-particles3d-vectordirection3d#normalized-prop)** : bool Detailed Description -------------------- This element sets emitted particle velocity towards the target direction vector. The length of the direction vector is used as the velocity magnitude. For example, to emit particles towards some random direction within x: 50..150, y: -20..20, z: 0: ``` ParticleEmitter3D { ... velocity: VectorDirection3D { direction: Qt.vector3d(100, 0, 0) directionVariation: Qt.vector3d(50, 20, 0) } } ``` Property Documentation ---------------------- ### direction : [vector3d](qml-vector3d) This property defines the direction for particles target. The default value is `(0, 100, 0)` (upwards on the y-axis). **See also** [directionVariation](qml-qtquick3d-particles3d-vectordirection3d#directionVariation-prop). ### directionVariation : [vector3d](qml-vector3d) This property defines the direction variation for particles target. The default value is `(0, 0, 0)` (no variation). **See also** [direction](qml-qtquick3d-particles3d-vectordirection3d#direction-prop). ### normalized : [bool](qml-bool) This property defines if the direction should be normalized after applying the variation. When this is false, variation affects the magnitude of the particles velocity. When set to true, variation affects the direction, but the magnitude is determined by the original direction length. The default value is `false`. qt Using a Designer UI File in Your Qt for Python Application Using a Designer UI File in Your Qt for Python Application ========================================================== Converting the Form to Python Code ---------------------------------- To demonstrate, we use the Qt Widgets animation easing example. The application consists of one source file, `easing.py`, a UI file `form.ui`, a resource file `easing.qrc` and the project file, `easing.pyproject` file in the YAML format: ``` { "files": ["easing.qrc", "ui_form.py", "easing.py", "easing_rc.py", "form.ui"] } ``` The UI file is converted to Python code building the form using the [User Interface Compiler (uic)](uic): ``` uic -g python form.ui > ui_form.py ``` Since the top level widget is named `Form`, this results in a Python class named `Ui_Form` being generated. It provides a function `setupUi()`, taking the widget as parameter, which is called to create the UI elements: ``` from ui_form import Ui_Form ... class Window(QtWidgets.QWidget): def __init__(self, parent=None): super(Window, self).__init__(parent) self.m_ui = Ui_Form() self.m_ui.setupUi(self) ``` Later on, the widgets can be accessed via the `Ui_Form` class: ``` self.m_ui.graphicsView.setScene(self.m_scene) ``` Besides `setupUi()`, `Ui_Form` provides another method `retranslateUi()`, which can be called in reaction to a [QEvent](qevent) of type [QEvent](qevent).LanguageChange, which indicates a change in the application language. ### The UiTools Approach The [QUiLoader](quiloader) class provides a form loader object to construct the user interface at runtime. This user interface can be retrieved from any [QIODevice](qiodevice), e.g., a [QFile](qfile) object. The [QUiLoader::load](quiloader#load)() function constructs the form widget using the user interface description contained in the file. It is demonstrated by the uiloader example: ``` from PySide2.QtUiTools import QUiLoader if __name__ == '__main__': # Some code to obtain the form file name, ui_file_name app = QApplication(sys.argv) ui_file = QFile(ui_file_name) if not ui_file.open(QIODevice.ReadOnly): print("Cannot open {}: {}".format(ui_file_name, ui_file.errorString())) sys.exit(-1) loader = QUiLoader() widget = loader.load(ui_file, None) ui_file.close() if not widget: print(loader.errorString()) sys.exit(-1) widget.show() sys.exit(app.exec_()) ```
programming_docs
qt QSequentialAnimationGroup Class QSequentialAnimationGroup Class =============================== The QSequentialAnimationGroup class provides a sequential group of animations. [More...](#details) | | | | --- | --- | | Header: | #include <QSequentialAnimationGroup> | | CMake: | find\_package(Qt6 COMPONENTS Core REQUIRED) target\_link\_libraries(mytarget PRIVATE Qt6::Core) | | qmake: | QT += core | | Inherits: | [QAnimationGroup](qanimationgroup) | * [List of all members, including inherited members](https://doc.qt.io/qt-6.2/qsequentialanimationgroup-members.html) Properties ---------- * **[currentAnimation](qsequentialanimationgroup#currentAnimation-prop)** : QAbstractAnimation\* Public Functions ---------------- | | | | --- | --- | | | **[QSequentialAnimationGroup](qsequentialanimationgroup#QSequentialAnimationGroup)**(QObject \**parent* = nullptr) | | virtual | **[~QSequentialAnimationGroup](qsequentialanimationgroup#dtor.QSequentialAnimationGroup)**() | | QPauseAnimation \* | **[addPause](qsequentialanimationgroup#addPause)**(int *msecs*) | | QAbstractAnimation \* | **[currentAnimation](qsequentialanimationgroup#currentAnimation-prop)**() const | | QPauseAnimation \* | **[insertPause](qsequentialanimationgroup#insertPause)**(int *index*, int *msecs*) | Reimplemented Public Functions ------------------------------ | | | | --- | --- | | virtual int | **[duration](qsequentialanimationgroup#duration)**() const override | Signals ------- | | | | --- | --- | | void | **[currentAnimationChanged](qsequentialanimationgroup#currentAnimationChanged)**(QAbstractAnimation \**current*) | Reimplemented Protected Functions --------------------------------- | | | | --- | --- | | virtual bool | **[event](qsequentialanimationgroup#event)**(QEvent \**event*) override | | virtual void | **[updateCurrentTime](qsequentialanimationgroup#updateCurrentTime)**(int *currentTime*) override | | virtual void | **[updateDirection](qsequentialanimationgroup#updateDirection)**(QAbstractAnimation::Direction *direction*) override | | virtual void | **[updateState](qsequentialanimationgroup#updateState)**(QAbstractAnimation::State *newState*, QAbstractAnimation::State *oldState*) override | Detailed Description -------------------- QSequentialAnimationGroup is a [QAnimationGroup](qanimationgroup) that runs its animations in sequence, i.e., it starts one animation after another has finished playing. The animations are played in the order they are added to the group (using [addAnimation](qanimationgroup#addAnimation)() or [insertAnimation](qanimationgroup#insertAnimation)()). The animation group finishes when its last animation has finished. At each moment there is at most one animation that is active in the group; it is returned by [currentAnimation](qsequentialanimationgroup#currentAnimation-prop)(). An empty group has no current animation. A sequential animation group can be treated as any other animation, i.e., it can be started, stopped, and added to other groups. You can also call [addPause](qsequentialanimationgroup#addPause)() or [insertPause](qsequentialanimationgroup#insertPause)() to add a pause to a sequential animation group. ``` QSequentialAnimationGroup *group = new QSequentialAnimationGroup; group->addAnimation(anim1); group->addAnimation(anim2); group->start(); ``` In this example, `anim1` and `anim2` are two already set up [QPropertyAnimation](qpropertyanimation)s. **See also** [QAnimationGroup](qanimationgroup), [QAbstractAnimation](qabstractanimation), and [The Animation Framework](https://doc.qt.io/qt-6.2/animation-overview.html). Property Documentation ---------------------- ### `[bindable read-only]` currentAnimation : [QAbstractAnimation](qabstractanimation#QAbstractAnimation)\* **Note:** This property supports [QProperty](qproperty) bindings. This property holds the animation in the current time. Member Function Documentation ----------------------------- ### QSequentialAnimationGroup::QSequentialAnimationGroup([QObject](qobject#QObject) \**parent* = nullptr) Constructs a QSequentialAnimationGroup. *parent* is passed to [QObject](qobject)'s constructor. ### `[signal]` void QSequentialAnimationGroup::currentAnimationChanged([QAbstractAnimation](qabstractanimation#QAbstractAnimation) \**current*) [QSequentialAnimationGroup](qsequentialanimationgroup) emits this signal when [currentAnimation](qsequentialanimationgroup#currentAnimation-prop) has been changed. *current* is the current animation. **Note:** Notifier signal for property [currentAnimation](qsequentialanimationgroup#currentAnimation-prop). **See also** [currentAnimation](qsequentialanimationgroup#currentAnimation-prop)(). ### `[virtual]` QSequentialAnimationGroup::~QSequentialAnimationGroup() Destroys the animation group. It will also destroy all its animations. ### [QPauseAnimation](qpauseanimation) \*QSequentialAnimationGroup::addPause(int *msecs*) Adds a pause of *msecs* to this animation group. The pause is considered as a special type of animation, thus [animationCount](qanimationgroup#animationCount) will be increased by one. **See also** [insertPause](qsequentialanimationgroup#insertPause)() and [QAnimationGroup::addAnimation](qanimationgroup#addAnimation)(). ### `[override virtual]` int QSequentialAnimationGroup::duration() const Reimplements: [QAbstractAnimation::duration() const](qabstractanimation#duration). ### `[override virtual protected]` bool QSequentialAnimationGroup::event([QEvent](qevent) \**event*) Reimplements: [QAnimationGroup::event](qanimationgroup#event)(QEvent \*event). ### [QPauseAnimation](qpauseanimation) \*QSequentialAnimationGroup::insertPause(int *index*, int *msecs*) Inserts a pause of *msecs* milliseconds at *index* in this animation group. **See also** [addPause](qsequentialanimationgroup#addPause)() and [QAnimationGroup::insertAnimation](qanimationgroup#insertAnimation)(). ### `[override virtual protected]` void QSequentialAnimationGroup::updateCurrentTime(int *currentTime*) Reimplements: [QAbstractAnimation::updateCurrentTime](qabstractanimation#updateCurrentTime)(int currentTime). ### `[override virtual protected]` void QSequentialAnimationGroup::updateDirection([QAbstractAnimation::Direction](qabstractanimation#Direction-enum) *direction*) Reimplements: [QAbstractAnimation::updateDirection](qabstractanimation#updateDirection)(QAbstractAnimation::Direction direction). ### `[override virtual protected]` void QSequentialAnimationGroup::updateState([QAbstractAnimation::State](qabstractanimation#State-enum) *newState*, [QAbstractAnimation::State](qabstractanimation#State-enum) *oldState*) Reimplements: [QAbstractAnimation::updateState](qabstractanimation#updateState)(QAbstractAnimation::State newState, QAbstractAnimation::State oldState). qt WebEngineSettings QML Type WebEngineSettings QML Type ========================== Allows configuration of browser properties and attributes. [More...](#details) | | | | --- | --- | | Import Statement: | import QtWebEngine | | Since: | QtWebEngine 1.1 | * [List of all members, including inherited members](https://doc.qt.io/qt-6.2/qml-qtwebengine-webenginesettings-members.html) Properties ---------- * **[accelerated2dCanvasEnabled](qml-qtwebengine-webenginesettings#accelerated2dCanvasEnabled-prop)** : bool * **[allowGeolocationOnInsecureOrigins](qml-qtwebengine-webenginesettings#allowGeolocationOnInsecureOrigins-prop)** : bool * **[allowRunningInsecureContent](qml-qtwebengine-webenginesettings#allowRunningInsecureContent-prop)** : bool * **[allowWindowActivationFromJavaScript](qml-qtwebengine-webenginesettings#allowWindowActivationFromJavaScript-prop)** : bool * **[autoLoadIconsForPage](qml-qtwebengine-webenginesettings#autoLoadIconsForPage-prop)** : bool * **[autoLoadImages](qml-qtwebengine-webenginesettings#autoLoadImages-prop)** : bool * **[defaultTextEncoding](qml-qtwebengine-webenginesettings#defaultTextEncoding-prop)** : string * **[dnsPrefetchEnabled](qml-qtwebengine-webenginesettings#dnsPrefetchEnabled-prop)** : bool * **[errorPageEnabled](qml-qtwebengine-webenginesettings#errorPageEnabled-prop)** : bool * **[focusOnNavigationEnabled](qml-qtwebengine-webenginesettings#focusOnNavigationEnabled-prop)** : bool * **[fullscreenSupportEnabled](qml-qtwebengine-webenginesettings#fullscreenSupportEnabled-prop)** : bool * **[hyperlinkAuditingEnabled](qml-qtwebengine-webenginesettings#hyperlinkAuditingEnabled-prop)** : bool * **[javascriptCanAccessClipboard](qml-qtwebengine-webenginesettings#javascriptCanAccessClipboard-prop)** : bool * **[javascriptCanOpenWindows](qml-qtwebengine-webenginesettings#javascriptCanOpenWindows-prop)** : bool * **[javascriptCanPaste](qml-qtwebengine-webenginesettings#javascriptCanPaste-prop)** : bool * **[javascriptEnabled](qml-qtwebengine-webenginesettings#javascriptEnabled-prop)** : bool * **[linksIncludedInFocusChain](qml-qtwebengine-webenginesettings#linksIncludedInFocusChain-prop)** : bool * **[localContentCanAccessFileUrls](qml-qtwebengine-webenginesettings#localContentCanAccessFileUrls-prop)** : bool * **[localContentCanAccessRemoteUrls](qml-qtwebengine-webenginesettings#localContentCanAccessRemoteUrls-prop)** : bool * **[localStorageEnabled](qml-qtwebengine-webenginesettings#localStorageEnabled-prop)** : bool * **[pdfViewerEnabled](qml-qtwebengine-webenginesettings#pdfViewerEnabled-prop)** : bool * **[playbackRequiresUserGesture](qml-qtwebengine-webenginesettings#playbackRequiresUserGesture-prop)** : bool * **[pluginsEnabled](qml-qtwebengine-webenginesettings#pluginsEnabled-prop)** : bool * **[printElementBackgrounds](qml-qtwebengine-webenginesettings#printElementBackgrounds-prop)** : bool * **[screenCaptureEnabled](qml-qtwebengine-webenginesettings#screenCaptureEnabled-prop)** : bool * **[showScrollBars](qml-qtwebengine-webenginesettings#showScrollBars-prop)** : bool * **[spatialNavigationEnabled](qml-qtwebengine-webenginesettings#spatialNavigationEnabled-prop)** : bool * **[touchIconsEnabled](qml-qtwebengine-webenginesettings#touchIconsEnabled-prop)** : bool * **[unknownUrlSchemePolicy](qml-qtwebengine-webenginesettings#unknownUrlSchemePolicy-prop)** : enumeration * **[webGLEnabled](qml-qtwebengine-webenginesettings#webGLEnabled-prop)** : bool * **[webRTCPublicInterfacesOnly](qml-qtwebengine-webenginesettings#webRTCPublicInterfacesOnly-prop)** : bool Detailed Description -------------------- The WebEngineSettings type can be used to configure browser properties and generic attributes, such as JavaScript support, focus behavior, and access to remote content. This type is uncreatable, but the default settings for all web engine views can be accessed by using the [WebEngine.settings](qml-qtwebengine-webengine#settings-prop) property. Each web engine view can have individual settings that can be accessed by using the [WebEngineView.settings](qml-qtwebengine-webengineview#settings-prop) property. Property Documentation ---------------------- ### [since QtWebEngine 1.3] accelerated2dCanvasEnabled : [bool](qml-bool) Specifies whether the HTML 5 2D canvas should be an OpenGL framebuffer. This makes many painting operations faster, but slows down pixel access. Enabled by default if available. This property was introduced in QtWebEngine 1.3. ### [since QtWebEngine 1.5] allowGeolocationOnInsecureOrigins : [bool](qml-bool) Since Qt 5.7, only secure origins such as HTTPS have been able to request Geolocation features. This provides an override to allow non secure origins to access Geolocation again. Disabled by default. This property was introduced in QtWebEngine 1.5. ### [since QtWebEngine 1.4] allowRunningInsecureContent : [bool](qml-bool) By default, HTTPS pages cannot run JavaScript, CSS, plugins or web-sockets from HTTP URLs. This used to be possible and this provides an override to get the old behavior. Disabled by default. This property was introduced in QtWebEngine 1.4. ### [since QtWebEngine 1.6] allowWindowActivationFromJavaScript : [bool](qml-bool) Allows the window.focus() method in JavaScript. Disallowed by default. This property was introduced in QtWebEngine 1.6. ### [since QtWebEngine 1.3] autoLoadIconsForPage : [bool](qml-bool) Automatically downloads icons for web pages. Enabled by default. This property was introduced in QtWebEngine 1.3. ### autoLoadImages : [bool](qml-bool) Automatically loads images on web pages. Enabled by default. ### [since QtWebEngine 1.2] defaultTextEncoding : [string](qml-string) Sets the default encoding. The value must be a string describing an encoding such as "utf-8" or "iso-8859-1". If left empty, a default value will be used. This property was introduced in QtWebEngine 1.2. ### [since QtWebEngine 1.8] dnsPrefetchEnabled : [bool](qml-bool) Enables speculative prefetching of DNS records for HTML links before they are activated. Disabled by default. This property was introduced in QtWebEngine 1.8. ### errorPageEnabled : [bool](qml-bool) Enables displaying the built-in error pages of Chromium. Enabled by default. ### [since QtWebEngine 1.4] focusOnNavigationEnabled : [bool](qml-bool) Focus is given to the view whenever a navigation operation occurs (load, stop, reload, reload and bypass cache, forward, backward, set content, and so on). Disabled by default. This property was introduced in QtWebEngine 1.4. ### [since QtWebEngine 1.2] fullscreenSupportEnabled : [bool](qml-bool) Tells the web engine whether fullscreen is supported in this application or not. Disabled by default. This property was introduced in QtWebEngine 1.2. ### hyperlinkAuditingEnabled : [bool](qml-bool) Enables support for the `ping` attribute for hyperlinks. Disabled by default. ### javascriptCanAccessClipboard : [bool](qml-bool) Allows JavaScript programs to read from or write to the clipboard. Writing to the clipboard is always allowed if it is specifically requested by the user. To enable also the pasting of clipboard content from JavaScript, use [javascriptCanPaste](qml-qtwebengine-webenginesettings#javascriptCanPaste-prop). Disabled by default. ### javascriptCanOpenWindows : [bool](qml-bool) Allows JavaScript programs to open popup windows without user interaction. Enabled by default. ### [since QtWebEngine 1.7] javascriptCanPaste : [bool](qml-bool) Enables JavaScript `execCommand("paste")`. This also requires enabling [javascriptCanAccessClipboard](qml-qtwebengine-webenginesettings#javascriptCanAccessClipboard-prop). Disabled by default. This property was introduced in QtWebEngine 1.7. ### javascriptEnabled : [bool](qml-bool) Enables the running of JavaScript programs. Enabled by default. ### linksIncludedInFocusChain : [bool](qml-bool) Includes hyperlinks in the keyboard focus chain. Enabled by default. ### localContentCanAccessFileUrls : [bool](qml-bool) Allows locally loaded documents to access other local URLs. Enabled by default. ### localContentCanAccessRemoteUrls : [bool](qml-bool) Allows locally loaded documents to access remote URLs. Disabled by default. ### localStorageEnabled : [bool](qml-bool) Enables support for the HTML 5 local storage feature. Enabled by default. ### [since QtWebEngine 1.9] pdfViewerEnabled : [bool](qml-bool) Specifies that PDF documents will be opened in the internal PDF viewer instead of being downloaded. Enabled by default. This property was introduced in QtWebEngine 1.9. ### [since QtWebEngine 1.7] playbackRequiresUserGesture : [bool](qml-bool) Inhibits playback of media content until the user interacts with the page. By default, Qt [WebEngine](qml-qtwebengine-webengine) uses Chromium settings, as described in [Autoplay Policy Changes](https://developers.google.com/web/updates/2017/09/autoplay-policy-changes). To overwrite the default behavior, this property must be set to `false`. **Note:** The behavior is similar to Chrome on Android when enabled, and similar to Chrome on desktops when disabled. This property was introduced in QtWebEngine 1.7. ### pluginsEnabled : [bool](qml-bool) Enables support for Pepper plugins, such as the Flash player. Disabled by default. **See also** [Pepper Plugin API](qtwebengine-features#pepper-plugin-api). ### [since QtWebEngine 1.4] printElementBackgrounds : [bool](qml-bool) Turns on printing of CSS backgrounds when printing a web page. Enabled by default. This property was introduced in QtWebEngine 1.4. ### [since QtWebEngine 1.3] screenCaptureEnabled : [bool](qml-bool) Tells the web engine whether screen capture is supported in this application or not. Disabled by default. This property was introduced in QtWebEngine 1.3. ### [since QtWebEngine 1.6] showScrollBars : [bool](qml-bool) Shows scroll bars. Enabled by default. This property was introduced in QtWebEngine 1.6. ### spatialNavigationEnabled : [bool](qml-bool) Enables the Spatial Navigation feature, which means the ability to navigate between focusable elements, such as hyperlinks and form controls, on a web page by using the Left, Right, Up and Down arrow keys. For example, if a user presses the Right key, heuristics determine whether there is an element they might be trying to reach towards the right and which element they probably want. Disabled by default. ### [since QtWebEngine 1.3] touchIconsEnabled : [bool](qml-bool) Enables support for touch icons and precomposed touch icons. Disabled by default. This property was introduced in QtWebEngine 1.3. ### [since QtWebEngine 1.7] unknownUrlSchemePolicy : [enumeration](qml-enumeration) Specifies how navigation requests to URLs with unknown schemes are handled. | Constant | Description | | --- | --- | | `WebEngineSettings.DisallowUnknownUrlSchemes` | Disallows all navigation requests to URLs with unknown schemes. | | `WebEngineSettings.AllowUnknownUrlSchemesFromUserInteraction` | Allows navigation requests to URLs with unknown schemes that are issued from user-interaction (like a mouse-click), whereas other navigation requests (for example from JavaScript) are suppressed. | | `WebEngineSettings.AllowAllUnknownUrlSchemes` | Allows all navigation requests to URLs with unknown schemes. | Default value is `WebEngineSettings.AllowUnknownUrlSchemesFromUserInteraction`. This property was introduced in QtWebEngine 1.7. ### [since QtWebEngine 1.3] webGLEnabled : [bool](qml-bool) Enables support for HTML 5 WebGL. Enabled by default if available. This property was introduced in QtWebEngine 1.3. ### [since QtWebEngine 1.7] webRTCPublicInterfacesOnly : [bool](qml-bool) Limits WebRTC to public IP addresses only. When disabled WebRTC may also use local network IP addresses, but remote hosts can also see your local network IP address. Disabled by default. This property was introduced in QtWebEngine 1.7. qt Qt Positioning Qt Positioning ============== The Qt Positioning API provides positioning information via QML and C++ interfaces. Currently the API is supported on [Android](android), [iOS](ios), [macOS](macos), [Linux](linux), and [Windows](windows) (with GPS receivers exposed as a serial port providing NMEA sentences or using `Windows.Devices.Geolocation`). Overview -------- The Qt Positioning API gives developers the ability to determine a position by using a variety of possible sources, including satellite, or wifi, or text file, and so on. That information can then be used to for example determine a position on a map. In addition satellite information can be retrieved and area based monitoring can be performed. Using the Module ---------------- Using a Qt module requires linking against the module library, either directly or through other dependencies. Several build tools have dedicated support for this, including [CMake](http://www.cmake.org/cmake/help/documentation.html) and [qmake](resources#qmake). ### Building with CMake Use the `find_package()` command to locate the needed module components in the `Qt6` package: ``` find_package(Qt6 COMPONENTS Positioning REQUIRED) target_link_libraries(mytarget PRIVATE Qt6::Positioning) ``` See also the [Build with CMake](cmake-manual) overview. ### Building with qmake To configure the module for building with qmake, add the module as a value of the `QT` variable in the project's .pro file: ``` QT += positioning ``` ### Getting Started To load the Qt Positioning module, add the following statement to your .qml files ``` import QtPositioning ``` For C++ projects include the header appropriate for the current use case, for example applications using routes may use ``` #include <QGeoCoordinate> ``` Module Evolution ---------------- [Changes to Qt Positioning](qtpositioning-changes-qt6) lists important changes in the module API and functionality that were done for the Qt 6 series of Qt. Licenses -------- Qt Positioning is available under commercial licenses from [The Qt Company](http://www.qt.io/about-us/). In addition, it is available under free software licenses. Since Qt 5.4, these free software licenses are [GNU Lesser General Public License, version 3](http://www.gnu.org/licenses/lgpl-3.0.html), or the [GNU General Public License, version 2](http://www.gnu.org/licenses/gpl-2.0.html). See [Qt Licensing](https://doc.qt.io/qt-6.2/licensing.html) for further details. Articles and Guides ------------------- * [Positioning introduction for C++](location-positioning-cpp) * [Positioning introduction for QML](location-positioning-qml) * [Qt Positioning Plugins](qtpositioning-plugins) * [Interfaces between C++ and QML Code in Qt Positioning](positioning-cpp-qml) * [Qt Positioning on Android](qtpositioning-android) Reference --------- * [Qt Positioning C++ Classes](https://doc.qt.io/qt-6.2/qtpositioning-module.html) * [Qt Positioning QML Types](https://doc.qt.io/qt-6.2/qtpositioning-qmlmodule.html) Examples -------- * [Qt Positioning Examples](https://doc.qt.io/qt-6.2/qtpositioning-examples.html)
programming_docs
qt RenderStateSet QML Type RenderStateSet QML Type ======================= The RenderStateSet [FrameGraph](qml-qt3d-render-framegraphnode) node offers a way of specifying a set of [RenderState](qml-qt3d-render-renderstate) objects to be applied during the execution of a framegraph branch. [More...](#details) | | | | --- | --- | | Import Statement: | import Qt3D.Render | | Since: | Qt 5.5 | | Instantiates: | [QRenderStateSet](qt3drender-qrenderstateset) | | Inherits: | [FrameGraphNode](qml-qt3d-render-framegraphnode) | * [List of all members, including inherited members](https://doc.qt.io/qt-6.2/qml-qt3d-render-renderstateset-members.html) Properties ---------- * **[renderStates](qml-qt3d-render-renderstateset#renderStates-prop)** : list<RenderState> Detailed Description -------------------- States set on a RenderStateSet are set globally, contrary to the per-material states that can be set on a [RenderPass](qml-qt3d-render-renderpass). By default, an empty RenderStateSet will result in all render states being disabled when executed. Adding a [RenderState](qml-qt3d-render-renderstate) state explicitly enables that render state at runtime. The RenderStateSet is enabled when added to the active frame graph: ``` import Qt3D.Core 2.0 import Qt3D.Render 2.0 import Qt3D.Extras 2.0 Entity { id: rootNode components: [ RenderSettings { activeFrameGraph: RenderSurfaceSelector { ClearBuffers { buffers : ClearBuffers.ColorDepthBuffer CameraSelector { camera: Camera { position: Qt.vector3d(10, 0, 0) viewCenter: Qt.vector3d(0, 0, 0) } RenderStateSet { renderStates: [ CullFace { mode: CullFace.Back } ] } } } } } ] Entity { id: sphereEntity components: [ GeometryRenderer { view: SphereMesh {} }, PhongMaterial {} ] } } ``` **See also** [RenderState](qml-qt3d-render-renderstate) and [RenderPass](qml-qt3d-render-renderpass). Property Documentation ---------------------- ### renderStates : [list](qml-list)<[RenderState](qml-qt3d-render-renderstate)> Holds the list of [RenderState](qml-qt3d-render-renderstate) objects used by the [RenderStateSet](qml-qt3d-render-renderstateset). qt Qt State Machine QML Guide Qt State Machine QML Guide ========================== Qt State Machine QML APIs provide types for creating and executing state graphs in QML. It is similar to the C++ State Machine framework based on Harel's [Statecharts: A visual formalism for complex systems](http://www.wisdom.weizmann.ac.il/~dharel/SCANNED.PAPERS/Statecharts.pdf), which is also the basis for UML state diagrams. Like its [C++ counterpart](https://doc.qt.io/qt-6.2/qtstatemachine-module.html), the framework provides an API and execution model based on [State Chart XML (SCXML)](http://www.w3.org/TR/scxml/) to embed the elements and semantics of statecharts in QML applications. For user interfaces with multiple visual states, independent of the application's logical state, consider using QML States and Transitions. For the full list of QML types provided by the framework to create event-driven state machines, see: [Qt State Machine QML Types](https://doc.qt.io/qt-6.2/qtqml-statemachine-qmlmodule.html) Using Both QtQuick and QtQml.StateMachine Imports ------------------------------------------------- **Warning:** If you're attempting to import both [QtQuick](https://doc.qt.io/qt-6.2/qtquick-module.html) and *[QtQml](https://doc.qt.io/qt-6.2/qtqml-module.html).[StateMachine](qml-qtqml-statemachine-statemachine)* in one single QML file, make sure to import *[QtQml](https://doc.qt.io/qt-6.2/qtqml-module.html).[StateMachine](qml-qtqml-statemachine-statemachine)* *last*. This way, the *State* type is provided by the Declarative State Machine Framework and not by [QtQuick](https://doc.qt.io/qt-6.2/qtquick-module.html): ``` import QtQuick import QtQml.StateMachine StateMachine { State { // okay, is of type QtQml.StateMachine.State } } ``` Alternatively, you can import *[QtQml](https://doc.qt.io/qt-6.2/qtqml-module.html).[StateMachine](qml-qtqml-statemachine-statemachine)* into a separate namespace to avoid any ambiguity with [QtQuick](https://doc.qt.io/qt-6.2/qtquick-module.html)'s *State* item: ``` import QtQuick import QtQml.StateMachine as DSM DSM.StateMachine { DSM.State { // ... } } ``` A Simple State Machine ---------------------- To demonstrate the core functionality of the State Machine API, let's look at an example: A state machine with three states, `s1`, `s2` and `s3`. The state machine is controlled by a single Button; when the button is clicked, the machine transitions to another state. Initially, the state machine is in state `s1`. The following is a state chart showing the different states in our example. The following snippet shows the code needed to create such a state machine. ``` Button { anchors.fill: parent id: button // change the button label to the active state id text: s1.active ? "s1" : s2.active ? "s2" : "s3" } StateMachine { id: stateMachine // set the initial state initialState: s1 // start the state machine running: true State { id: s1 // create a transition from s1 to s2 when the button is clicked SignalTransition { targetState: s2 signal: button.clicked } // do something when the state enters/exits onEntered: console.log("s1 entered") onExited: console.log("s1 exited") } State { id: s2 // create a transition from s2 to s3 when the button is clicked SignalTransition { targetState: s3 signal: button.clicked } // do something when the state enters/exits onEntered: console.log("s2 entered") onExited: console.log("s2 exited") } State { id: s3 // create a transition from s3 to s1 when the button is clicked SignalTransition { targetState: s1 signal: button.clicked } // do something when the state enters/exits onEntered: console.log("s3 entered") onExited: console.log("s3 exited") } } ``` The state machine runs asynchronously to become part of your application's event loop. State Machines That Finish -------------------------- The state machine defined in the previous section never finishes. In order for a state machine to be able to finish, it needs to have a top-level *final* state ([FinalState](qml-qtqml-statemachine-finalstate) object). When the state machine enters the top-level final state, the machine emits the [finished](qml-qtqml-statemachine-state#finished-signal) signal and halts. All you need to do to introduce a final state in the graph is create a [FinalState](qml-qtqml-statemachine-finalstate) object and use it as the target of one or more transitions. Sharing Transitions ------------------- Assume we wanted the user to be able to quit the application at any time by clicking a Quit button. In order to achieve this, we need to create a final state and make it the target of a transition associated with the Quit button's *clicked()* signal. We could add a transition for each state; however, this seems redundant and one would also have to remember to add such a transition from every new state that is added in the future. We can achieve the same behavior (namely that clicking the Quit button quits the state machine, regardless of which state the state machine is in) by grouping states `s1`, `s2` and `s3`. This is done by creating a new top-level state and making the three original states children of the new state. The following diagram shows the new state machine. The three original states have been renamed `s11`, `s12` and `s13` to reflect that they are now childrens of the new top-level state, `s1`. Child states implicitly inherit the transitions of their parent state. This means it is now sufficient to add a single transition from `s1` to the final state, `s2`. New states added to `s1` will automatically inherit this transition. All that's needed to group states is to specify the proper parent when the state is created. You also need to specify which of the child states is the initial one (the child state the state machine should enter when the parent state is the target of a transition). ``` Row { anchors.fill: parent spacing: 2 Button { id: button // change the button label to the active state id text: s11.active ? "s11" : s12.active ? "s12" : "s13" } Button { id: quitButton text: "quit" } } StateMachine { id: stateMachine // set the initial state initialState: s1 // start the state machine running: true State { id: s1 // set the initial state initialState: s11 // create a transition from s1 to s2 when the button is clicked SignalTransition { targetState: s2 signal: quitButton.clicked } // do something when the state enters/exits onEntered: console.log("s1 entered") onExited: console.log("s1 exited") State { id: s11 // create a transition from s11 to s12 when the button is clicked SignalTransition { targetState: s12 signal: button.clicked } // do something when the state enters/exits onEntered: console.log("s11 entered") onExited: console.log("s11 exited") } State { id: s12 // create a transition from s12 to s13 when the button is clicked SignalTransition { targetState: s13 signal: button.clicked } // do something when the state enters/exits onEntered: console.log("s12 entered") onExited: console.log("s12 exited") } State { id: s13 // create a transition from s13 to s11 when the button is clicked SignalTransition { targetState: s11 signal: button.clicked } // do something when the state enters/exits onEntered: console.log("s13 entered") onExited: console.log("s13 exited") } } FinalState { id: s2 onEntered: console.log("s2 entered") onExited: console.log("s2 exited") } onFinished: Qt.quit() } ``` In this case we want the application to quit when the state machine is finished, so the machine's *finished()* signal is connected to the application's *quit()* slot. A child state can override an inherited transition. For example, the following code adds a transition that effectively causes the Quit button to be ignored when the state machine is in state, `s12`. ``` State { id: s12 // create a transition from s12 to s13 when the button is clicked SignalTransition { targetState: s13 signal: button.clicked } // ignore Quit button when we are in state 12 SignalTransition { targetState: s12 signal: quitButton.clicked } // do something when the state enters/exits onEntered: console.log("s12 entered") onExited: console.log("s12 exited") } ``` A transition can have any state as its target irrespective of where the target state is in the state hierarchy. Using History States -------------------- Imagine that we wanted to add an "interrupt" mechanism to the example discussed in the previous section; the user should be able to click a button to have the state machine perform some non-related task, after which the state machine should resume whatever it was doing before (i.e. return to the old state, which is one of the three states in this case). Such behavior can easily be modeled using *history states*. A history state ([HistoryState](qml-qtqml-statemachine-historystate) object) is a pseudo-state that represents the child state that the parent state was in before it exited last. A history state is created as a child of the state for which we wish to record the current child state; when the state machine detects the presence of such a state at runtime, it automatically records the current (real) child state when the parent state exits. A transition to the history state is in fact a transition to the child state that the state machine had previously saved; the state machine automatically "forwards" the transition to the real child state. The following diagram shows the state machine after the interrupt mechanism has been added. The following code shows how it can be implemented; in this example we simply display a message box when `s3` is entered, then immediately return to the previous child state of `s1` via the history state. ``` Row { anchors.fill: parent spacing: 2 Button { id: button // change the button label to the active state id text: s11.active ? "s11" : s12.active ? "s12" : s13.active ? "s13" : "s3" } Button { id: interruptButton text: s1.active ? "Interrupt" : "Resume" } Button { id: quitButton text: "quit" } } StateMachine { id: stateMachine // set the initial state initialState: s1 // start the state machine running: true State { id: s1 // set the initial state initialState: s11 // create a transition from s1 to s2 when the button is clicked SignalTransition { targetState: s2 signal: quitButton.clicked } // do something when the state enters/exits onEntered: console.log("s1 entered") onExited: console.log("s1 exited") State { id: s11 // create a transition from s1 to s2 when the button is clicked SignalTransition { targetState: s12 signal: button.clicked } // do something when the state enters/exits onEntered: console.log("s11 entered") onExited: console.log("s11 exited") } State { id: s12 // create a transition from s2 to s3 when the button is clicked SignalTransition { targetState: s13 signal: button.clicked } // do something when the state enters/exits onEntered: console.log("s12 entered") onExited: console.log("s12 exited") } State { id: s13 // create a transition from s3 to s1 when the button is clicked SignalTransition { targetState: s1 signal: button.clicked } // do something when the state enters/exits onEntered: console.log("s13 entered") onExited: console.log("s13 exited") } // create a transition from s1 to s3 when the button is clicked SignalTransition { targetState: s3 signal: interruptButton.clicked } HistoryState { id: s1h } } FinalState { id: s2 onEntered: console.log("s2 entered") onExited: console.log("s2 exited") } State { id: s3 SignalTransition { targetState: s1h signal: interruptButton.clicked } // do something when the state enters/exits onEntered: console.log("s3 entered") onExited: console.log("s3 exited") } onFinished: Qt.quit() } ``` Using Parallel States --------------------- Assume that you wanted to model a set of mutually exclusive properties of a car in a single state machine. Let's say the properties we are interested in are Clean vs Dirty, and Moving vs Not moving. It would take four mutually exclusive states and eight transitions to represent the states and freely move between all possible combinations as shown in the following state chart. If we added a third property (say, Red vs Blue), the total number of states would double, to eight; and if we added a fourth property (say, Enclosed vs Convertible), the total number of states would double again, to 16. This exponential increase can be reduced using parallel states, which enables linear growth in the number of states and transitions as we add more properties. Furthermore, states can be added to or removed from the parallel state without affecting any of their sibling states. The following state chart shows the different paralles states for the car example. To create a parallel state group, set childMode to [QState](qstate).ParallelStates. ``` State { id: s1 childMode: QState.ParallelStates State { id: s11 } State { id: s12 } } ``` When a parallel state group is entered, all its child states will be simultaneously entered. Transitions within the individual child states operate normally. However, any of the child states may take a transition which exits the parent state. When this happens, the parent state and all of its child states are exited. The parallelism in the State Machine framework follows an interleaved semantics. All parallel operations will be executed in a single, atomic step of the event processing, so no event can interrupt the parallel operations. However, events will still be processed sequentially, as the machine itself is single threaded. For example, consider the situation where there are two transitions that exit the same parallel state group, and their conditions become true simultaneously. In this case, the event that is processed last of the two will not have any effect. Exiting a Composite State ------------------------- A child state can be final (a [FinalState](qml-qtqml-statemachine-finalstate) object); when a final child state is entered, the parent state emits the [State::finished](qml-qtqml-statemachine-state#finished-signal) signal. The following diagram shows a composite state `s1` which does some processing before entering a final state: When `s1` 's final state is entered, `s1` will automatically emit [finished](qml-qtqml-statemachine-state#finished-signal). We use a signal transition to cause this event to trigger a state change: ``` State { id: s1 SignalTransition { targetState: s2 signal: s1.finished } } ``` Using final states in composite states is useful when you want to hide the internal details of a composite state. The outside world should be able to enter the state and get a notification when the state has completed its work, without the need to know the internal details. This is a very powerful abstraction and encapsulation mechanism when building complex (deeply nested) state machines. (In the above example, you could of course create a transition directly from `s1` 's `done` state rather than relying on `s1` 's finished() signal, but with the consequence that implementation details of `s1` are exposed and depended on). For parallel state groups, the [State::finished](qml-qtqml-statemachine-state#finished-signal) signal is emitted when *all* the child states have entered final states. Targetless Transitions ---------------------- A transition need not have a target state. A transition without a target can be triggered the same way as any other transition; the difference is that it doesn't cause any state changes. This allows you to react to a signal or event when your machine is in a certain state, without having to leave that state. For example: ``` Button { id: button text: "button" StateMachine { id: stateMachine initialState: s1 running: true State { id: s1 SignalTransition { signal: button.clicked onTriggered: console.log("button pressed") } } } } ``` The "button pressed" message will be displayed each time the button is clicked, but the state machine will remain in its current state (s1). If the target state were explicitly set to s1, s1 would be exited and re-entered each time (the [QAbstractState::entered](qml-qtqml-statemachine-qabstractstate#entered-signal) and [QAbstractState::exited](qml-qtqml-statemachine-qabstractstate#exited-signal) signals would be emitted). Related Information ------------------- * [Qt State Machine QML Types](https://doc.qt.io/qt-6.2/qtqml-statemachine-qmlmodule.html) * [Qt State Machine Overview](https://doc.qt.io/qt-6.2/qtstatemachine-overview.html)
programming_docs
qt HumiditySensor QML Type HumiditySensor QML Type ======================= The HumiditySensor element reports on humidity. [More...](#details) | | | | --- | --- | | Import Statement: | import QtSensors | | Since: | QtSensors 5.9 | | Inherits: | [Sensor](qml-qtsensors-sensor) | * [List of all members, including inherited members](https://doc.qt.io/qt-6.2/qml-qtsensors-humiditysensor-members.html) Detailed Description -------------------- The HumiditySensor element reports on humidity. This element wraps the [QHumiditySensor](qhumiditysensor) class. Please see the documentation for [QHumiditySensor](qhumiditysensor) for details. **See also** [HumidityReading](qml-qtsensors-humidityreading). qt QAbstractFormBuilder Class QAbstractFormBuilder Class ========================== The QAbstractFormBuilder class provides a default implementation for classes that create user interfaces at run-time. [More...](#details) | | | | --- | --- | | Header: | #include <QAbstractFormBuilder> | | CMake: | find\_package(Qt6 COMPONENTS Designer REQUIRED) target\_link\_libraries(mytarget PRIVATE Qt6::Designer) | | qmake: | QT += designer | | Inherited By: | [QFormBuilder](qformbuilder) | * [List of all members, including inherited members](https://doc.qt.io/qt-6.2/qabstractformbuilder-members.html) Public Functions ---------------- | | | | --- | --- | | | **[QAbstractFormBuilder](qabstractformbuilder#QAbstractFormBuilder-2)**() | | virtual | **[~QAbstractFormBuilder](qabstractformbuilder#dtor.QAbstractFormBuilder)**() | | QString | **[errorString](qabstractformbuilder#errorString)**() const | | virtual QWidget \* | **[load](qabstractformbuilder#load)**(QIODevice \**device*, QWidget \**parent* = nullptr) | | virtual void | **[save](qabstractformbuilder#save)**(QIODevice \**device*, QWidget \**widget*) | | void | **[setWorkingDirectory](qabstractformbuilder#setWorkingDirectory)**(const QDir &*directory*) | | QDir | **[workingDirectory](qabstractformbuilder#workingDirectory)**() const | Detailed Description -------------------- QAbstractFormBuilder provides a standard interface and a default implementation for constructing forms from user interface files. It is not intended to be instantiated directly. Use the [QFormBuilder](qformbuilder) class to create user interfaces from UI files at run-time. For example: ``` MyForm::MyForm(QWidget *parent) : QWidget(parent) { QFormBuilder builder; QFile file(":/forms/myWidget.ui"); file.open(QFile::ReadOnly); QWidget *myWidget = builder.load(&file, this); file.close(); QVBoxLayout *layout = new QVBoxLayout; layout->addWidget(myWidget); setLayout(layout); } ``` To override certain aspects of the form builder's behavior, subclass QAbstractFormBuilder and reimplement the relevant virtual functions: * [load](qabstractformbuilder#load)() handles reading of UI format files from arbitrary QIODevices, and construction of widgets from the XML data that they contain. * [save](qabstractformbuilder#save)() handles saving of widget details in UI format to arbitrary QIODevices. * [workingDirectory](qabstractformbuilder#workingDirectory)() and [setWorkingDirectory](qabstractformbuilder#setWorkingDirectory)() control the directory in which forms are held. The form builder looks for other resources on paths relative to this directory. The [QFormBuilder](qformbuilder) class is typically used by custom components and applications that embed *Qt Designer*. Standalone applications that need to dynamically generate user interfaces at run-time use the [QUiLoader](quiloader), found in the [Qt UI Tools](qtuitools-index) module. **See also** [Qt UI Tools](qtuitools-index). Member Function Documentation ----------------------------- ### QAbstractFormBuilder::QAbstractFormBuilder() Constructs a new form builder. ### `[virtual]` QAbstractFormBuilder::~QAbstractFormBuilder() Destroys the form builder. ### `[since 5.0]` [QString](qstring) QAbstractFormBuilder::errorString() const Returns a human-readable description of the last error occurred in [load](qabstractformbuilder#load)(). This function was introduced in Qt 5.0. **See also** [load](qabstractformbuilder#load)(). ### `[virtual]` [QWidget](qwidget) \*QAbstractFormBuilder::load([QIODevice](qiodevice) \**device*, [QWidget](qwidget) \**parent* = nullptr) Loads an XML representation of a widget from the given *device*, and constructs a new widget with the specified *parent*. **See also** [save](qabstractformbuilder#save)() and [errorString](qabstractformbuilder#errorString)(). ### `[virtual]` void QAbstractFormBuilder::save([QIODevice](qiodevice) \**device*, [QWidget](qwidget) \**widget*) Saves an XML representation of the given *widget* to the specified *device* in the standard UI file format. **Note:** Unlike when saving a form in Qt Designer, all property values are written. This is because, the state of whether a property value was modified or not isn't stored in the Qt property system. The widget that is being saved, could have been created dynamically, not loaded via [load](qabstractformbuilder#load)(), so in this case the form builder isn't aware of the list of changed properties. Also, there's no generic way to do this for widgets that were created dynamically. Therefore, you should remove properties that are not required from your resulting XML files, before loading them. Alternatively, if you already know which properties you want to save when you call this method, you can overload `computeProperties()` and return a filtered list of required properties. Otherwise, unexpected behavior may occur as some of these properties may depend on each other. **See also** [load](qabstractformbuilder#load)(). ### void QAbstractFormBuilder::setWorkingDirectory(const [QDir](qdir) &*directory*) Sets the current working directory of the form builder to the specified *directory*. **See also** [workingDirectory](qabstractformbuilder#workingDirectory)(). ### [QDir](qdir) QAbstractFormBuilder::workingDirectory() const Returns the current working directory of the form builder. **See also** [setWorkingDirectory](qabstractformbuilder#setWorkingDirectory)(). qt QAuthenticator Class QAuthenticator Class ==================== The QAuthenticator class provides an authentication object. [More...](#details) | | | | --- | --- | | Header: | #include <QAuthenticator> | | CMake: | find\_package(Qt6 COMPONENTS Network REQUIRED) target\_link\_libraries(mytarget PRIVATE Qt6::Network) | | qmake: | QT += network | * [List of all members, including inherited members](https://doc.qt.io/qt-6.2/qauthenticator-members.html) **Note:** All functions in this class are [reentrant](threads-reentrancy). Public Functions ---------------- | | | | --- | --- | | | **[QAuthenticator](qauthenticator#QAuthenticator-1)**(const QAuthenticator &*other*) | | | **[QAuthenticator](qauthenticator#QAuthenticator)**() | | QAuthenticator & | **[operator=](qauthenticator#operator-eq)**(const QAuthenticator &*other*) | | | **[~QAuthenticator](qauthenticator#dtor.QAuthenticator)**() | | bool | **[isNull](qauthenticator#isNull)**() const | | QVariant | **[option](qauthenticator#option)**(const QString &*opt*) const | | QVariantHash | **[options](qauthenticator#options)**() const | | QString | **[password](qauthenticator#password)**() const | | QString | **[realm](qauthenticator#realm)**() const | | void | **[setOption](qauthenticator#setOption)**(const QString &*opt*, const QVariant &*value*) | | void | **[setPassword](qauthenticator#setPassword)**(const QString &*password*) | | void | **[setUser](qauthenticator#setUser)**(const QString &*user*) | | QString | **[user](qauthenticator#user)**() const | | bool | **[operator!=](qauthenticator#operator-not-eq)**(const QAuthenticator &*other*) const | | bool | **[operator==](qauthenticator#operator-eq-eq)**(const QAuthenticator &*other*) const | Detailed Description -------------------- The QAuthenticator class is usually used in the [authenticationRequired](qnetworkaccessmanager#authenticationRequired)() and [proxyAuthenticationRequired](qnetworkaccessmanager#proxyAuthenticationRequired)() signals of [QNetworkAccessManager](qnetworkaccessmanager) and [QAbstractSocket](qabstractsocket). The class provides a way to pass back the required authentication information to the socket when accessing services that require authentication. QAuthenticator supports the following authentication methods: * Basic * NTLM version 2 * Digest-MD5 * SPNEGO/Negotiate ### Options In addition to the username and password required for authentication, a QAuthenticator object can also contain additional options. The [options](qauthenticator#options)() function can be used to query incoming options sent by the server; the [setOption](qauthenticator#setOption)() function can be used to set outgoing options, to be processed by the authenticator calculation. The options accepted and provided depend on the authentication type (see method()). The following tables list known incoming options as well as accepted outgoing options. The list of incoming options is not exhaustive, since servers may include additional information at any time. The list of outgoing options is exhaustive, however, and no unknown options will be treated or sent back to the server. #### Basic | Option | Direction | Type | Description | | --- | --- | --- | --- | | `realm` | Incoming | [QString](qstring) | Contains the realm of the authentication, the same as [realm](qauthenticator#realm)() | The Basic authentication mechanism supports no outgoing options. #### NTLM version 2 The NTLM authentication mechanism currently supports no incoming or outgoing options. On Windows, if no *user* has been set, domain\user credentials will be searched for on the local system to enable Single-Sign-On functionality. #### Digest-MD5 | Option | Direction | Type | Description | | --- | --- | --- | --- | | `realm` | Incoming | [QString](qstring) | Contains the realm of the authentication, the same as [realm](qauthenticator#realm)() | The Digest-MD5 authentication mechanism supports no outgoing options. #### SPNEGO/Negotiate This authentication mechanism currently supports no incoming or outgoing options. **See also** [QSslSocket](qsslsocket). Member Function Documentation ----------------------------- ### QAuthenticator::QAuthenticator(const [QAuthenticator](qauthenticator#QAuthenticator) &*other*) Constructs a copy of *other*. ### QAuthenticator::QAuthenticator() Constructs an empty authentication object. ### [QAuthenticator](qauthenticator#QAuthenticator) &QAuthenticator::operator=(const [QAuthenticator](qauthenticator#QAuthenticator) &*other*) Assigns the contents of *other* to this authenticator. ### QAuthenticator::~QAuthenticator() Destructs the object. ### bool QAuthenticator::isNull() const Returns `true` if the object has not been initialized. Returns `false` if non-const member functions have been called, or the content was constructed or copied from another initialized [QAuthenticator](qauthenticator) object. ### [QVariant](qvariant) QAuthenticator::option(const [QString](qstring) &*opt*) const Returns the value related to option *opt* if it was set by the server. See the [Options section](qauthenticator#qauthenticator-options) for more information on incoming options. If option *opt* isn't found, an invalid [QVariant](qvariant) will be returned. **See also** [setOption](qauthenticator#setOption)(), [options](qauthenticator#options)(), and [QAuthenticator options](qauthenticator#qauthenticator-options). ### QVariantHash QAuthenticator::options() const Returns all incoming options set in this [QAuthenticator](qauthenticator) object by parsing the server reply. See the [Options section](qauthenticator#qauthenticator-options) for more information on incoming options. **See also** [option](qauthenticator#option)() and [QAuthenticator options](qauthenticator#qauthenticator-options). ### [QString](qstring) QAuthenticator::password() const Returns the password used for authentication. **See also** [setPassword](qauthenticator#setPassword)(). ### [QString](qstring) QAuthenticator::realm() const Returns the realm requiring authentication. ### void QAuthenticator::setOption(const [QString](qstring) &*opt*, const [QVariant](qvariant) &*value*) Sets the outgoing option *opt* to value *value*. See the [Options section](qauthenticator#qauthenticator-options) for more information on outgoing options. **See also** [options](qauthenticator#options)(), [option](qauthenticator#option)(), and [QAuthenticator options](qauthenticator#qauthenticator-options). ### void QAuthenticator::setPassword(const [QString](qstring) &*password*) Sets the *password* used for authentication. **See also** [password](qauthenticator#password)() and [QNetworkAccessManager::authenticationRequired](qnetworkaccessmanager#authenticationRequired)(). ### void QAuthenticator::setUser(const [QString](qstring) &*user*) Sets the *user* used for authentication. **See also** [user](qauthenticator#user)() and [QNetworkAccessManager::authenticationRequired](qnetworkaccessmanager#authenticationRequired)(). ### [QString](qstring) QAuthenticator::user() const Returns the user used for authentication. **See also** [setUser](qauthenticator#setUser)(). ### bool QAuthenticator::operator!=(const [QAuthenticator](qauthenticator#QAuthenticator) &*other*) const Returns `true` if this authenticator is different from *other*; otherwise returns `false`. ### bool QAuthenticator::operator==(const [QAuthenticator](qauthenticator#QAuthenticator) &*other*) const Returns `true` if this authenticator is identical to *other*; otherwise returns `false`. qt QGraphicsSceneContextMenuEvent Class QGraphicsSceneContextMenuEvent Class ==================================== The QGraphicsSceneContextMenuEvent class provides context menu events in the graphics view framework. [More...](#details) | | | | --- | --- | | Header: | #include <QGraphicsSceneContextMenuEvent> | | CMake: | find\_package(Qt6 COMPONENTS Widgets REQUIRED) target\_link\_libraries(mytarget PRIVATE Qt6::Widgets) | | qmake: | QT += widgets | | Inherits: | [QGraphicsSceneEvent](qgraphicssceneevent) | * [List of all members, including inherited members](https://doc.qt.io/qt-6.2/qgraphicsscenecontextmenuevent-members.html) Public Types ------------ | | | | --- | --- | | enum | **[Reason](qgraphicsscenecontextmenuevent#Reason-enum)** { Mouse, Keyboard, Other } | Public Functions ---------------- | | | | --- | --- | | virtual | **[~QGraphicsSceneContextMenuEvent](qgraphicsscenecontextmenuevent#dtor.QGraphicsSceneContextMenuEvent)**() | | Qt::KeyboardModifiers | **[modifiers](qgraphicsscenecontextmenuevent#modifiers)**() const | | QPointF | **[pos](qgraphicsscenecontextmenuevent#pos)**() const | | QGraphicsSceneContextMenuEvent::Reason | **[reason](qgraphicsscenecontextmenuevent#reason)**() const | | QPointF | **[scenePos](qgraphicsscenecontextmenuevent#scenePos)**() const | | QPoint | **[screenPos](qgraphicsscenecontextmenuevent#screenPos)**() const | Detailed Description -------------------- A [QContextMenuEvent](qcontextmenuevent) received by a [QGraphicsView](qgraphicsview) is translated into a QGraphicsSceneContextMenuEvent. The [QContextMenuEvent::globalPos](qcontextmenuevent#globalPos)() is translated into item, scene, and screen coordinates ([pos](qgraphicsscenecontextmenuevent#pos)(), [scenePos](qgraphicsscenecontextmenuevent#scenePos)(), and [screenPos](qgraphicsscenecontextmenuevent#screenPos)()). **See also** [QGraphicsSceneMouseEvent](qgraphicsscenemouseevent), [QGraphicsSceneWheelEvent](qgraphicsscenewheelevent), and [QContextMenuEvent](qcontextmenuevent). Member Type Documentation ------------------------- ### enum QGraphicsSceneContextMenuEvent::Reason This enum describes the reason why the context event was sent. | Constant | Value | Description | | --- | --- | --- | | `QGraphicsSceneContextMenuEvent::Mouse` | `0` | The mouse caused the event to be sent. On most platforms, this means the right mouse button was clicked. | | `QGraphicsSceneContextMenuEvent::Keyboard` | `1` | The keyboard caused this event to be sent. On Windows and macOS, this means the menu button was pressed. | | `QGraphicsSceneContextMenuEvent::Other` | `2` | The event was sent by some other means (i.e. not by the mouse or keyboard). | Member Function Documentation ----------------------------- ### `[virtual]` QGraphicsSceneContextMenuEvent::~QGraphicsSceneContextMenuEvent() Destroys the event. ### [Qt::KeyboardModifiers](qt#KeyboardModifier-enum) QGraphicsSceneContextMenuEvent::modifiers() const Returns the keyboard modifiers in use when the context menu was requested. ### [QPointF](qpointf) QGraphicsSceneContextMenuEvent::pos() const Returns the position of the mouse cursor in item coordinates at the moment the context menu was requested. **See also** [scenePos](qgraphicsscenecontextmenuevent#scenePos)() and [screenPos](qgraphicsscenecontextmenuevent#screenPos)(). ### [QGraphicsSceneContextMenuEvent::Reason](qgraphicsscenecontextmenuevent#Reason-enum) QGraphicsSceneContextMenuEvent::reason() const Returns the reason for the context menu event. **See also** [QGraphicsSceneContextMenuEvent::Reason](qgraphicsscenecontextmenuevent#Reason-enum). ### [QPointF](qpointf) QGraphicsSceneContextMenuEvent::scenePos() const Returns the position of the mouse cursor in scene coordinates at the moment the context menu was requested. **See also** [pos](qgraphicsscenecontextmenuevent#pos)() and [screenPos](qgraphicsscenecontextmenuevent#screenPos)(). ### [QPoint](qpoint) QGraphicsSceneContextMenuEvent::screenPos() const Returns the position of the mouse cursor in screen coordinates at the moment the context menu was requested. **See also** [pos](qgraphicsscenecontextmenuevent#pos)() and [scenePos](qgraphicsscenecontextmenuevent#scenePos)(). qt QWebEngineHistoryModel Class QWebEngineHistoryModel Class ============================ A data model that represents the history of a web engine page. [More...](#details) | | | | --- | --- | | Header: | #include <QWebEngineHistoryModel> | | CMake: | find\_package(Qt6 COMPONENTS WebEngineCore REQUIRED) target\_link\_libraries(mytarget PRIVATE Qt6::WebEngineCore) | | qmake: | QT += webenginecore | | Since: | Qt 6.2 | | Instantiated By: | [WebEngineHistoryModel](qml-qtwebengine-webenginehistorymodel) | | Inherits: | [QAbstractListModel](qabstractlistmodel) | * [List of all members, including inherited members](https://doc.qt.io/qt-6.2/qwebenginehistorymodel-members.html) Public Types ------------ | | | | --- | --- | | enum | **[Roles](qwebenginehistorymodel#Roles-enum)** { UrlRole, TitleRole, OffsetRole, IconUrlRole } | Detailed Description -------------------- The QWebEngineHistoryModel type exposes the *title*, *url*, *icon*, and *offset* roles. The *title*, *url* and *icon* specify the title, URL, and favicon of the visited page. The *offset* specifies the position of the page in respect to the current page (0). A positive number indicates that the page was visited after the current page, whereas a negative number indicates that the page was visited before the current page. This type is uncreatable, but it can be accessed by using the [QWebEngineHistory::itemsModel](qwebenginehistory#itemsModel), [QWebEngineHistory::backItemsModel](qwebenginehistory#backItemsModel), [QWebEngineHistory::forwardItemsModel](qwebenginehistory#forwardItemsModel) methods. **See also** [QWebEngineHistory](qwebenginehistory). Member Type Documentation ------------------------- ### enum QWebEngineHistoryModel::Roles This enum describes specific roles, which history data model supports. | Constant | Value | Description | | --- | --- | --- | | `QWebEngineHistoryModel::UrlRole` | `Qt::UserRole` | URL of the visited page | | `QWebEngineHistoryModel::TitleRole` | `257` | Title of the visited page | | `QWebEngineHistoryModel::OffsetRole` | `258` | The offset of the page in respect to the current page (0) | | `QWebEngineHistoryModel::IconUrlRole` | `259` | Favicon of the visited page |
programming_docs
qt QSortPolicy Class QSortPolicy Class ================= class [Qt3DRender](https://doc.qt.io/qt-6.2/qt3drender-module.html)::QSortPolicy Provides storage for the sort types to be used. [More...](#details) | | | | --- | --- | | Header: | #include <QSortPolicy> | | CMake: | find\_package(Qt6 COMPONENTS 3drender REQUIRED) target\_link\_libraries(mytarget PRIVATE Qt6::3drender) | | qmake: | QT += 3drender | | Since: | Qt 5.7 | | Instantiated By: | [SortPolicy](qml-qt3d-render-sortpolicy) | | Inherits: | [Qt3DRender::QFrameGraphNode](qt3drender-qframegraphnode) | * [List of all members, including inherited members](https://doc.qt.io/qt-6.2/qt3drender-qsortpolicy-members.html) Public Types ------------ | | | | --- | --- | | enum | **[SortType](qt3drender-qsortpolicy#SortType-enum)** { StateChangeCost, BackToFront, Material, FrontToBack, Texture, Uniform } | Properties ---------- * **[sortTypes](qt3drender-qsortpolicy#sortTypes-prop)** : QList<int> Public Functions ---------------- | | | | --- | --- | | | **[QSortPolicy](qt3drender-qsortpolicy#QSortPolicy)**(Qt3DCore::QNode \**parent* = nullptr) | | QList<Qt3DRender::QSortPolicy::SortType> | **[sortTypes](qt3drender-qsortpolicy#sortTypes)**() const | | QList<int> | **[sortTypesInt](qt3drender-qsortpolicy#sortTypes-prop)**() const | Public Slots ------------ | | | | --- | --- | | void | **[setSortTypes](qt3drender-qsortpolicy#sortTypes-prop)**(const QList<int> &*sortTypesInt*) | | void | **[setSortTypes](qt3drender-qsortpolicy#sortTypes-prop)**(const QList<Qt3DRender::QSortPolicy::SortType> &*sortTypes*) | Signals ------- | | | | --- | --- | | void | **[sortTypesChanged](qt3drender-qsortpolicy#sortTypes-prop)**(const QList<int> &*sortTypes*) | | void | **[sortTypesChanged](qt3drender-qsortpolicy#sortTypes-prop)**(const QList<Qt3DRender::QSortPolicy::SortType> &*sortTypes*) | Detailed Description -------------------- A [Qt3DRender::QSortPolicy](qt3drender-qsortpolicy) class stores the sorting type used by the FrameGraph. The sort types determine how drawable entities are sorted before drawing to determine the drawing order. When QSortPolicy is present in the FrameGraph, the sorting mechanism is determined by the [sortTypes](qt3drender-qsortpolicy#sortTypes) list. Multiple sort types can be used simultaneously. If QSortPolicy is not present in the FrameGraph, entities are drawn in the order they appear in the entity hierarchy. Member Type Documentation ------------------------- ### enum QSortPolicy::SortType This enum type describes the available sort types. | Constant | Value | Description | | --- | --- | --- | | `Qt3DRender::QSortPolicy::StateChangeCost` | `(1 << 0)` | sort the objects so as to minimize the cost of changing from the currently rendered state | | `Qt3DRender::QSortPolicy::BackToFront` | `(1 << 1)` | sort the objects from back to front based on inverted z order. More accurately, the sorting key is the z component of the projection of the camera-to-object-center vector onto the camera's view vector. | | `Qt3DRender::QSortPolicy::Material` | `(1 << 2)` | sort the objects based on their material (shader) value. | | `Qt3DRender::QSortPolicy::FrontToBack` | `(1 << 3)` | sort the objects from front to back. The opposite of BackToFront. | | `Qt3DRender::QSortPolicy::Texture (since Qt 5.14)` | `(1 << 4)` | sort the objects to minimize texture changes. | | `Qt3DRender::QSortPolicy::Uniform (since Qt 5.15)` | `(1 << 5)` | sort the objects to minimize uniform changes. | Property Documentation ---------------------- ### sortTypes : [QList](qlist)<int> Specifies the sorting types to be used. **Access functions:** | | | | --- | --- | | QList<int> | **sortTypesInt**() const | | void | **setSortTypes**(const QList<Qt3DRender::QSortPolicy::SortType> &*sortTypes*) | | void | **setSortTypes**(const QList<int> &*sortTypesInt*) | **Notifier signal:** | | | | --- | --- | | void | **sortTypesChanged**(const QList<Qt3DRender::QSortPolicy::SortType> &*sortTypes*) | | void | **sortTypesChanged**(const QList<int> &*sortTypes*) | Member Function Documentation ----------------------------- ### QSortPolicy::QSortPolicy([Qt3DCore::QNode](qt3dcore-qnode) \**parent* = nullptr) Constructs QSortPolicy with given *parent*. ### [QList](qlist)<[Qt3DRender::QSortPolicy::SortType](qt3drender-qsortpolicy#SortType-enum)> QSortPolicy::sortTypes() const Returns the current sort types in use **See also** [setSortTypes](qt3drender-qsortpolicy#sortTypes-prop)(). qt Column QML Type Column QML Type =============== Positions its children in a column. [More...](#details) | | | | --- | --- | | Import Statement: | import QtQuick | | Inherits: | [Item](qml-qtquick-item) | * [List of all members, including inherited members](https://doc.qt.io/qt-6.2/qml-qtquick-column-members.html) Properties ---------- * **[add](qml-qtquick-column#add-prop)** : Transition * **[bottomPadding](qml-qtquick-column#bottomPadding-prop)** : real * **[leftPadding](qml-qtquick-column#leftPadding-prop)** : real * **[move](qml-qtquick-column#move-prop)** : Transition * **[padding](qml-qtquick-column#padding-prop)** : real * **[populate](qml-qtquick-column#populate-prop)** : Transition * **[rightPadding](qml-qtquick-column#rightPadding-prop)** : real * **[spacing](qml-qtquick-column#spacing-prop)** : real * **[topPadding](qml-qtquick-column#topPadding-prop)** : real Signals ------- * **[positioningComplete](qml-qtquick-column#positioningComplete-signal)**() Methods ------- * **[forceLayout](qml-qtquick-column#forceLayout-method)**() Detailed Description -------------------- Column is a type that positions its child items along a single column. It can be used as a convenient way to vertically position a series of items without using [anchors](qtquick-positioning-anchors). Below is a Column that contains three rectangles of various sizes: ``` Column { spacing: 2 Rectangle { color: "red"; width: 50; height: 50 } Rectangle { color: "green"; width: 20; height: 50 } Rectangle { color: "blue"; width: 50; height: 20 } } ``` The Column automatically positions these items in a vertical formation, like this: If an item within a Column is not [visible](qml-qtquick-item#visible-prop), or if it has a width or height of 0, the item will not be laid out and it will not be visible within the column. Also, since a Column automatically positions its children vertically, a child item within a Column should not set its [y](qml-qtquick-item#y-prop) position or vertically anchor itself using the [top](qml-qtquick-item#anchors.top-prop), [bottom](qml-qtquick-item#anchors.bottom-prop), [anchors.verticalCenter](qml-qtquick-item#anchors.verticalCenter-prop), [fill](qml-qtquick-item#anchors.fill-prop) or [centerIn](qml-qtquick-item#anchors.centerIn-prop) anchors. If you need to perform these actions, consider positioning the items without the use of a Column. Note that items in a Column can use the [Positioner](qml-qtquick-positioner) attached property to access more information about its position within the Column. For more information on using Column and other related positioner-types, see [Item Positioners](qtquick-positioning-layouts). Using Transitions ----------------- A Column animate items using specific transitions when items are added to or moved within a Column. For example, the Column below sets the [move](qml-qtquick-column#move-prop) property to a specific [Transition](https://doc.qt.io/qt-6.2/qmlexampletoggleswitch.html#transition): ``` Column { spacing: 2 Rectangle { color: "red"; width: 50; height: 50 } Rectangle { id: greenRect; color: "green"; width: 20; height: 50 } Rectangle { color: "blue"; width: 50; height: 20 } move: Transition { NumberAnimation { properties: "x,y"; duration: 1000 } } focus: true Keys.onSpacePressed: greenRect.visible = !greenRect.visible } ``` When the Space key is pressed, the [visible](qml-qtquick-item#visible-prop) value of the green [Rectangle](qml-qtquick-rectangle) is toggled. As it appears and disappears, the blue [Rectangle](qml-qtquick-rectangle) moves within the Column, and the [move](qml-qtquick-column#move-prop) transition is automatically applied to the blue [Rectangle](qml-qtquick-rectangle): **See also** [Row](qml-qtquick-row), [Grid](qml-qtquick-grid), [Flow](qml-qtquick-flow), [Positioner](qml-qtquick-positioner), [ColumnLayout](qml-qtquick-layouts-columnlayout), and [Qt Quick Examples - Positioners](https://doc.qt.io/qt-6.2/qtquick-positioners-example.html). Property Documentation ---------------------- ### [since 5.6] bottomPadding : [real](qml-real) These properties hold the padding around the content. This QML property was introduced in Qt 5.6. ### add : [Transition](qml-qtquick-transition) This property holds the transition to be run for items that are added to this positioner. For a positioner, this applies to: * Items that are created or reparented as a child of the positioner after the positioner has been created * Child items that change their [Item::visible](qml-qtquick-item#visible-prop) property from false to true, and thus are now visible The transition can use the [ViewTransition](qml-qtquick-viewtransition) property to access more details about the item that is being added. See the [ViewTransition](qml-qtquick-viewtransition) documentation for more details and examples on using these transitions. **Note:** This transition is not applied to the items that are already part of the positioner at the time of its creation. In this case, the [populate](qml-qtquick-column#populate-prop) transition is applied instead. **See also** [populate](qml-qtquick-column#populate-prop), [ViewTransition](qml-qtquick-viewtransition), and [Qt Quick Examples - Positioners](https://doc.qt.io/qt-6.2/qtquick-positioners-example.html). ### move : [Transition](qml-qtquick-transition) This property holds the transition to run for items that have moved within the positioner. For a positioner, this applies to: * Child items that move when they are displaced due to the addition, removal or rearrangement of other items in the positioner * Child items that are repositioned due to the resizing of other items in the positioner The transition can use the [ViewTransition](qml-qtquick-viewtransition) property to access more details about the item that is being moved. Note, however, that for this move transition, the [ViewTransition](qml-qtquick-viewtransition).targetIndexes and [ViewTransition](qml-qtquick-viewtransition).targetItems lists are only set when this transition is triggered by the addition of other items in the positioner; in other cases, these lists will be empty. See the [ViewTransition](qml-qtquick-viewtransition) documentation for more details and examples on using these transitions. **See also** [add](qml-qtquick-column#add-prop), [populate](qml-qtquick-column#populate-prop), [ViewTransition](qml-qtquick-viewtransition), and [Qt Quick Examples - Positioners](https://doc.qt.io/qt-6.2/qtquick-positioners-example.html). ### populate : [Transition](qml-qtquick-transition) This property holds the transition to be run for items that are part of this positioner at the time of its creation. The transition is run when the positioner is first created. The transition can use the [ViewTransition](qml-qtquick-viewtransition) property to access more details about the item that is being added. See the [ViewTransition](qml-qtquick-viewtransition) documentation for more details and examples on using these transitions. **See also** [add](qml-qtquick-column#add-prop), [ViewTransition](qml-qtquick-viewtransition), and [Qt Quick Examples - Positioners](https://doc.qt.io/qt-6.2/qtquick-positioners-example.html). ### spacing : [real](qml-real) The spacing is the amount in pixels left empty between adjacent items. The default spacing is 0. **See also** [Grid::spacing](qml-qtquick-grid#spacing-prop). Signal Documentation -------------------- ### `[since 5.9]` positioningComplete() This signal is emitted when positioning has been completed. **Note:** The corresponding handler is `onPositioningComplete`. This signal was introduced in Qt 5.9. Method Documentation -------------------- ### `[since 5.9]` forceLayout() Column typically positions its children once per frame. This means that inside script blocks it is possible for the underlying children to have changed, but the Column to have not yet been updated accordingly. This method forces the Column to immediately respond to any outstanding changes in its children. **Note**: methods in general should only be called after the Component has completed. This method was introduced in Qt 5.9. qt QSslConfiguration Class QSslConfiguration Class ======================= The QSslConfiguration class holds the configuration and state of an SSL connection. [More...](#details) | | | | --- | --- | | Header: | #include <QSslConfiguration> | | CMake: | find\_package(Qt6 COMPONENTS Network REQUIRED) target\_link\_libraries(mytarget PRIVATE Qt6::Network) | | qmake: | QT += network | * [List of all members, including inherited members](https://doc.qt.io/qt-6.2/qsslconfiguration-members.html) **Note:** All functions in this class are [reentrant](threads-reentrancy). Public Types ------------ | | | | --- | --- | | enum | **[NextProtocolNegotiationStatus](qsslconfiguration#NextProtocolNegotiationStatus-enum)** { NextProtocolNegotiationNone, NextProtocolNegotiationNegotiated, NextProtocolNegotiationUnsupported } | Public Functions ---------------- | | | | --- | --- | | | **[QSslConfiguration](qsslconfiguration#QSslConfiguration-1)**(const QSslConfiguration &*other*) | | | **[QSslConfiguration](qsslconfiguration#QSslConfiguration)**() | | QSslConfiguration & | **[operator=](qsslconfiguration#operator-eq-1)**(const QSslConfiguration &*other*) | | | **[~QSslConfiguration](qsslconfiguration#dtor.QSslConfiguration)**() | | void | **[addCaCertificate](qsslconfiguration#addCaCertificate)**(const QSslCertificate &*certificate*) | | bool | **[addCaCertificates](qsslconfiguration#addCaCertificates)**(const QString &*path*, QSsl::EncodingFormat *format* = QSsl::Pem, QSslCertificate::PatternSyntax *syntax* = QSslCertificate::PatternSyntax::FixedString) | | void | **[addCaCertificates](qsslconfiguration#addCaCertificates-1)**(const QList<QSslCertificate> &*certificates*) | | QList<QByteArray> | **[allowedNextProtocols](qsslconfiguration#allowedNextProtocols)**() const | | QMap<QByteArray, QVariant> | **[backendConfiguration](qsslconfiguration#backendConfiguration)**() const | | QList<QSslCertificate> | **[caCertificates](qsslconfiguration#caCertificates)**() const | | QList<QSslCipher> | **[ciphers](qsslconfiguration#ciphers)**() const | | QSslDiffieHellmanParameters | **[diffieHellmanParameters](qsslconfiguration#diffieHellmanParameters)**() const | | bool | **[dtlsCookieVerificationEnabled](qsslconfiguration#dtlsCookieVerificationEnabled)**() const | | QList<QSslEllipticCurve> | **[ellipticCurves](qsslconfiguration#ellipticCurves)**() const | | QSslKey | **[ephemeralServerKey](qsslconfiguration#ephemeralServerKey)**() const | | bool | **[handshakeMustInterruptOnError](qsslconfiguration#handshakeMustInterruptOnError)**() const | | bool | **[isNull](qsslconfiguration#isNull)**() const | | QSslCertificate | **[localCertificate](qsslconfiguration#localCertificate)**() const | | QList<QSslCertificate> | **[localCertificateChain](qsslconfiguration#localCertificateChain)**() const | | bool | **[missingCertificateIsFatal](qsslconfiguration#missingCertificateIsFatal)**() const | | QByteArray | **[nextNegotiatedProtocol](qsslconfiguration#nextNegotiatedProtocol)**() const | | QSslConfiguration::NextProtocolNegotiationStatus | **[nextProtocolNegotiationStatus](qsslconfiguration#nextProtocolNegotiationStatus)**() const | | bool | **[ocspStaplingEnabled](qsslconfiguration#ocspStaplingEnabled)**() const | | QSslCertificate | **[peerCertificate](qsslconfiguration#peerCertificate)**() const | | QList<QSslCertificate> | **[peerCertificateChain](qsslconfiguration#peerCertificateChain)**() const | | int | **[peerVerifyDepth](qsslconfiguration#peerVerifyDepth)**() const | | QSslSocket::PeerVerifyMode | **[peerVerifyMode](qsslconfiguration#peerVerifyMode)**() const | | QByteArray | **[preSharedKeyIdentityHint](qsslconfiguration#preSharedKeyIdentityHint)**() const | | QSslKey | **[privateKey](qsslconfiguration#privateKey)**() const | | QSsl::SslProtocol | **[protocol](qsslconfiguration#protocol)**() const | | QSslCipher | **[sessionCipher](qsslconfiguration#sessionCipher)**() const | | QSsl::SslProtocol | **[sessionProtocol](qsslconfiguration#sessionProtocol)**() const | | QByteArray | **[sessionTicket](qsslconfiguration#sessionTicket)**() const | | int | **[sessionTicketLifeTimeHint](qsslconfiguration#sessionTicketLifeTimeHint)**() const | | void | **[setAllowedNextProtocols](qsslconfiguration#setAllowedNextProtocols)**(const QList<QByteArray> &*protocols*) | | void | **[setBackendConfiguration](qsslconfiguration#setBackendConfiguration)**(const QMap<QByteArray, QVariant> &*backendConfiguration* = QMap<QByteArray, QVariant>()) | | void | **[setBackendConfigurationOption](qsslconfiguration#setBackendConfigurationOption)**(const QByteArray &*name*, const QVariant &*value*) | | void | **[setCaCertificates](qsslconfiguration#setCaCertificates)**(const QList<QSslCertificate> &*certificates*) | | void | **[setCiphers](qsslconfiguration#setCiphers)**(const QList<QSslCipher> &*ciphers*) | | void | **[setCiphers](qsslconfiguration#setCiphers-1)**(const QString &*ciphers*) | | void | **[setDiffieHellmanParameters](qsslconfiguration#setDiffieHellmanParameters)**(const QSslDiffieHellmanParameters &*dhparams*) | | void | **[setDtlsCookieVerificationEnabled](qsslconfiguration#setDtlsCookieVerificationEnabled)**(bool *enable*) | | void | **[setEllipticCurves](qsslconfiguration#setEllipticCurves)**(const QList<QSslEllipticCurve> &*curves*) | | void | **[setHandshakeMustInterruptOnError](qsslconfiguration#setHandshakeMustInterruptOnError)**(bool *interrupt*) | | void | **[setLocalCertificate](qsslconfiguration#setLocalCertificate)**(const QSslCertificate &*certificate*) | | void | **[setLocalCertificateChain](qsslconfiguration#setLocalCertificateChain)**(const QList<QSslCertificate> &*localChain*) | | void | **[setMissingCertificateIsFatal](qsslconfiguration#setMissingCertificateIsFatal)**(bool *cannotRecover*) | | void | **[setOcspStaplingEnabled](qsslconfiguration#setOcspStaplingEnabled)**(bool *enabled*) | | void | **[setPeerVerifyDepth](qsslconfiguration#setPeerVerifyDepth)**(int *depth*) | | void | **[setPeerVerifyMode](qsslconfiguration#setPeerVerifyMode)**(QSslSocket::PeerVerifyMode *mode*) | | void | **[setPreSharedKeyIdentityHint](qsslconfiguration#setPreSharedKeyIdentityHint)**(const QByteArray &*hint*) | | void | **[setPrivateKey](qsslconfiguration#setPrivateKey)**(const QSslKey &*key*) | | void | **[setProtocol](qsslconfiguration#setProtocol)**(QSsl::SslProtocol *protocol*) | | void | **[setSessionTicket](qsslconfiguration#setSessionTicket)**(const QByteArray &*sessionTicket*) | | void | **[setSslOption](qsslconfiguration#setSslOption)**(QSsl::SslOption *option*, bool *on*) | | void | **[swap](qsslconfiguration#swap)**(QSslConfiguration &*other*) | | bool | **[testSslOption](qsslconfiguration#testSslOption)**(QSsl::SslOption *option*) const | | bool | **[operator!=](qsslconfiguration#operator-not-eq)**(const QSslConfiguration &*other*) const | | bool | **[operator==](qsslconfiguration#operator-eq-eq)**(const QSslConfiguration &*other*) const | Static Public Members --------------------- | | | | --- | --- | | const char [] | **[NextProtocolHttp1\_1](qsslconfiguration#NextProtocolHttp1_1-var)** | | QSslConfiguration | **[defaultConfiguration](qsslconfiguration#defaultConfiguration)**() | | QSslConfiguration | **[defaultDtlsConfiguration](qsslconfiguration#defaultDtlsConfiguration)**() | | void | **[setDefaultConfiguration](qsslconfiguration#setDefaultConfiguration)**(const QSslConfiguration &*configuration*) | | void | **[setDefaultDtlsConfiguration](qsslconfiguration#setDefaultDtlsConfiguration)**(const QSslConfiguration &*configuration*) | | QList<QSslCipher> | **[supportedCiphers](qsslconfiguration#supportedCiphers)**() | | QList<QSslEllipticCurve> | **[supportedEllipticCurves](qsslconfiguration#supportedEllipticCurves)**() | | QList<QSslCertificate> | **[systemCaCertificates](qsslconfiguration#systemCaCertificates)**() | Detailed Description -------------------- QSslConfiguration is used by Qt networking classes to relay information about an open SSL connection and to allow the application to control certain features of that connection. The settings that QSslConfiguration currently supports are: * The SSL/TLS protocol to be used * The certificate to be presented to the peer during connection and its associated private key * The ciphers allowed to be used for encrypting the connection * The list of Certificate Authorities certificates that are used to validate the peer's certificate These settings are applied only during the connection handshake. Setting them after the connection has been established has no effect. The state that QSslConfiguration supports are: * The certificate the peer presented during handshake, along with the chain leading to a CA certificate * The cipher used to encrypt this session The state can only be obtained once the SSL connection starts, but not necessarily before it's done. Some settings may change during the course of the SSL connection without need to restart it (for instance, the cipher can be changed over time). State in QSslConfiguration objects cannot be changed. QSslConfiguration can be used with [QSslSocket](qsslsocket) and the Network Access API. Note that changing settings in QSslConfiguration is not enough to change the settings in the related SSL connection. You must call setSslConfiguration on a modified QSslConfiguration object to achieve that. The following example illustrates how to change the protocol to TLSv1\_0 in a [QSslSocket](qsslsocket) object: ``` QSslConfiguration config = sslSocket.sslConfiguration(); config.setProtocol(QSsl::TlsV1_0); sslSocket.setSslConfiguration(config); ``` **See also** [QSsl::SslProtocol](qssl#SslProtocol-enum), [QSslCertificate](qsslcertificate), [QSslCipher](qsslcipher), [QSslKey](qsslkey), [QSslSocket](qsslsocket), [QNetworkAccessManager](qnetworkaccessmanager), [QSslSocket::sslConfiguration](qsslsocket#sslConfiguration)(), and [QSslSocket::setSslConfiguration](qsslsocket#setSslConfiguration)(). Member Type Documentation ------------------------- ### enum QSslConfiguration::NextProtocolNegotiationStatus Describes the status of the Next Protocol Negotiation (NPN) or Application-Layer Protocol Negotiation (ALPN). | Constant | Value | Description | | --- | --- | --- | | `QSslConfiguration::NextProtocolNegotiationNone` | `0` | No application protocol has been negotiated (yet). | | `QSslConfiguration::NextProtocolNegotiationNegotiated` | `1` | A next protocol has been negotiated (see [nextNegotiatedProtocol](qsslconfiguration#nextNegotiatedProtocol)()). | | `QSslConfiguration::NextProtocolNegotiationUnsupported` | `2` | The client and server could not agree on a common next application protocol. | Member Function Documentation ----------------------------- ### QSslConfiguration::QSslConfiguration(const [QSslConfiguration](qsslconfiguration#QSslConfiguration) &*other*) Copies the configuration and state of *other*. If *other* is null, this object will be null too. ### QSslConfiguration::QSslConfiguration() Constructs an empty SSL configuration. This configuration contains no valid settings and the state will be empty. [isNull](qsslconfiguration#isNull)() will return true after this constructor is called. Once any setter methods are called, [isNull](qsslconfiguration#isNull)() will return false. ### [QSslConfiguration](qsslconfiguration#QSslConfiguration) &QSslConfiguration::operator=(const [QSslConfiguration](qsslconfiguration#QSslConfiguration) &*other*) Copies the configuration and state of *other*. If *other* is null, this object will be null too. ### QSslConfiguration::~QSslConfiguration() Releases any resources held by [QSslConfiguration](qsslconfiguration). ### `[since 5.15]` void QSslConfiguration::addCaCertificate(const [QSslCertificate](qsslcertificate) &*certificate*) Adds *certificate* to this configuration's CA certificate database. The certificate database must be set prior to the SSL handshake. The CA certificate database is used by the socket during the handshake phase to validate the peer's certificate. **Note:** The default configuration uses the system CA certificate database. If that is not available (as is commonly the case on iOS), the default database is empty. This function was introduced in Qt 5.15. **See also** [caCertificates](qsslconfiguration#caCertificates)(), [setCaCertificates](qsslconfiguration#setCaCertificates)(), and [addCaCertificates](qsslconfiguration#addCaCertificates)(). ### `[since 5.15]` bool QSslConfiguration::addCaCertificates(const [QString](qstring) &*path*, [QSsl::EncodingFormat](qssl#EncodingFormat-enum) *format* = QSsl::Pem, [QSslCertificate::PatternSyntax](qsslcertificate#PatternSyntax-enum) *syntax* = QSslCertificate::PatternSyntax::FixedString) Searches all files in the *path* for certificates encoded in the specified *format* and adds them to this socket's CA certificate database. *path* must be a file or a pattern matching one or more files, as specified by *syntax*. Returns `true` if one or more certificates are added to the socket's CA certificate database; otherwise returns `false`. The CA certificate database is used by the socket during the handshake phase to validate the peer's certificate. For more precise control, use [addCaCertificate](qsslconfiguration#addCaCertificate)(). This function was introduced in Qt 5.15. **See also** [addCaCertificate](qsslconfiguration#addCaCertificate)() and [QSslCertificate::fromPath](qsslcertificate#fromPath)(). ### `[since 5.15]` void QSslConfiguration::addCaCertificates(const [QList](qlist)<[QSslCertificate](qsslcertificate)> &*certificates*) Adds *certificates* to this configuration's CA certificate database. The certificate database must be set prior to the SSL handshake. The CA certificate database is used by the socket during the handshake phase to validate the peer's certificate. **Note:** The default configuration uses the system CA certificate database. If that is not available (as is commonly the case on iOS), the default database is empty. This function was introduced in Qt 5.15. **See also** [caCertificates](qsslconfiguration#caCertificates)(), [setCaCertificates](qsslconfiguration#setCaCertificates)(), and [addCaCertificate](qsslconfiguration#addCaCertificate)(). ### `[since 5.3]` [QList](qlist)<[QByteArray](qbytearray)> QSslConfiguration::allowedNextProtocols() const This function returns the allowed protocols to be negotiated with the server through the Next Protocol Negotiation (NPN) or Application-Layer Protocol Negotiation (ALPN) TLS extension, as set by [setAllowedNextProtocols](qsslconfiguration#setAllowedNextProtocols)(). This function was introduced in Qt 5.3. **See also** [nextNegotiatedProtocol](qsslconfiguration#nextNegotiatedProtocol)(), [nextProtocolNegotiationStatus](qsslconfiguration#nextProtocolNegotiationStatus)(), [setAllowedNextProtocols](qsslconfiguration#setAllowedNextProtocols)(), and [QSslConfiguration::NextProtocolHttp1\_1](qsslconfiguration#NextProtocolHttp1_1-var). ### `[since 5.11]` [QMap](qmap)<[QByteArray](qbytearray), [QVariant](qvariant)> QSslConfiguration::backendConfiguration() const Returns the backend-specific configuration. Only options set by [setBackendConfigurationOption](qsslconfiguration#setBackendConfigurationOption)() or [setBackendConfiguration](qsslconfiguration#setBackendConfiguration)() will be returned. The internal standard configuration of the backend is not reported. This function was introduced in Qt 5.11. **See also** [setBackendConfigurationOption](qsslconfiguration#setBackendConfigurationOption)() and [setBackendConfiguration](qsslconfiguration#setBackendConfiguration)(). ### [QList](qlist)<[QSslCertificate](qsslcertificate)> QSslConfiguration::caCertificates() const Returns this connection's CA certificate database. The CA certificate database is used by the socket during the handshake phase to validate the peer's certificate. It can be modified prior to the handshake with [setCaCertificates](qsslconfiguration#setCaCertificates)(), or with [addCaCertificate](qsslconfiguration#addCaCertificate)() and [addCaCertificates](qsslconfiguration#addCaCertificates)(). **See also** [setCaCertificates](qsslconfiguration#setCaCertificates)(), [addCaCertificate](qsslconfiguration#addCaCertificate)(), and [addCaCertificates](qsslconfiguration#addCaCertificates)(). ### [QList](qlist)<[QSslCipher](qsslcipher)> QSslConfiguration::ciphers() const Returns this connection's current cryptographic cipher suite. This list is used during the handshake phase for choosing a session cipher. The returned list of ciphers is ordered by descending preference. (i.e., the first cipher in the list is the most preferred cipher). The session cipher will be the first one in the list that is also supported by the peer. By default, the handshake phase can choose any of the ciphers supported by this system's SSL libraries, which may vary from system to system. The list of ciphers supported by this system's SSL libraries is returned by [supportedCiphers](qsslconfiguration#supportedCiphers)(). You can restrict the list of ciphers used for choosing the session cipher for this socket by calling [setCiphers](qsslconfiguration#setCiphers)() with a subset of the supported ciphers. You can revert to using the entire set by calling [setCiphers](qsslconfiguration#setCiphers)() with the list returned by [supportedCiphers](qsslconfiguration#supportedCiphers)(). **Note:** This is not currently supported in the Schannel backend. **See also** [setCiphers](qsslconfiguration#setCiphers)() and [supportedCiphers](qsslconfiguration#supportedCiphers)(). ### `[static]` [QSslConfiguration](qsslconfiguration#QSslConfiguration) QSslConfiguration::defaultConfiguration() Returns the default SSL configuration to be used in new SSL connections. The default SSL configuration consists of: * no local certificate and no private key * protocol [SecureProtocols](qssl#SslProtocol-enum) * the system's default CA certificate list * the cipher list equal to the list of the SSL libraries' supported SSL ciphers that are 128 bits or more **See also** [supportedCiphers](qsslconfiguration#supportedCiphers)() and [setDefaultConfiguration](qsslconfiguration#setDefaultConfiguration)(). ### `[static]` [QSslConfiguration](qsslconfiguration#QSslConfiguration) QSslConfiguration::defaultDtlsConfiguration() Returns the default DTLS configuration to be used in new DTLS connections. The default DTLS configuration consists of: * no local certificate and no private key * protocol DtlsV1\_2OrLater * the system's default CA certificate list * the cipher list equal to the list of the SSL libraries' supported TLS 1.2 ciphers that use 128 or more secret bits for the cipher. **See also** [setDefaultDtlsConfiguration](qsslconfiguration#setDefaultDtlsConfiguration)(). ### `[since 5.8]` [QSslDiffieHellmanParameters](qssldiffiehellmanparameters) QSslConfiguration::diffieHellmanParameters() const Retrieves the current set of Diffie-Hellman parameters. If no Diffie-Hellman parameters have been set, the [QSslConfiguration](qsslconfiguration) object defaults to using the 1024-bit MODP group from RFC 2409. This function was introduced in Qt 5.8. **See also** [setDiffieHellmanParameters](qsslconfiguration#setDiffieHellmanParameters)(). ### bool QSslConfiguration::dtlsCookieVerificationEnabled() const This function returns true if DTLS cookie verification was enabled on a server-side socket. **See also** [setDtlsCookieVerificationEnabled](qsslconfiguration#setDtlsCookieVerificationEnabled)(). ### `[since 5.5]` [QList](qlist)<[QSslEllipticCurve](qsslellipticcurve)> QSslConfiguration::ellipticCurves() const Returns this connection's current list of elliptic curves. This list is used during the handshake phase for choosing an elliptic curve (when using an elliptic curve cipher). The returned list of curves is ordered by descending preference (i.e., the first curve in the list is the most preferred one). By default, the handshake phase can choose any of the curves supported by this system's SSL libraries, which may vary from system to system. The list of curves supported by this system's SSL libraries is returned by QSslSocket::supportedEllipticCurves(). You can restrict the list of curves used for choosing the session cipher for this socket by calling [setEllipticCurves](qsslconfiguration#setEllipticCurves)() with a subset of the supported ciphers. You can revert to using the entire set by calling [setEllipticCurves](qsslconfiguration#setEllipticCurves)() with the list returned by QSslSocket::supportedEllipticCurves(). This function was introduced in Qt 5.5. **See also** [setEllipticCurves](qsslconfiguration#setEllipticCurves). ### `[since 5.7]` [QSslKey](qsslkey) QSslConfiguration::ephemeralServerKey() const Returns the ephemeral server key used for cipher algorithms with forward secrecy, e.g. DHE-RSA-AES128-SHA. The ephemeral key is only available when running in client mode, i.e. [QSslSocket::SslClientMode](qsslsocket#SslMode-enum). When running in server mode or using a cipher algorithm without forward secrecy a null key is returned. The ephemeral server key will be set before emitting the encrypted() signal. This function was introduced in Qt 5.7. ### `[since 6.0]` bool QSslConfiguration::handshakeMustInterruptOnError() const Returns true if a verification callback will emit [QSslSocket::handshakeInterruptedOnError](qsslsocket#handshakeInterruptedOnError)() early, before concluding the handshake. **Note:** This function always returns false for all backends but OpenSSL. This function was introduced in Qt 6.0. **See also** [setHandshakeMustInterruptOnError](qsslconfiguration#setHandshakeMustInterruptOnError)(), [QSslSocket::handshakeInterruptedOnError](qsslsocket#handshakeInterruptedOnError)(), and [QSslSocket::continueInterruptedHandshake](qsslsocket#continueInterruptedHandshake)(). ### bool QSslConfiguration::isNull() const Returns `true` if this is a null [QSslConfiguration](qsslconfiguration) object. A [QSslConfiguration](qsslconfiguration) object is null if it has been default-constructed and no setter methods have been called. **See also** [setProtocol](qsslconfiguration#setProtocol)(), [setLocalCertificate](qsslconfiguration#setLocalCertificate)(), [setPrivateKey](qsslconfiguration#setPrivateKey)(), [setCiphers](qsslconfiguration#setCiphers)(), and [setCaCertificates](qsslconfiguration#setCaCertificates)(). ### [QSslCertificate](qsslcertificate) QSslConfiguration::localCertificate() const Returns the certificate to be presented to the peer during the SSL handshake process. **See also** [setLocalCertificate](qsslconfiguration#setLocalCertificate)(). ### `[since 5.1]` [QList](qlist)<[QSslCertificate](qsslcertificate)> QSslConfiguration::localCertificateChain() const Returns the certificate chain to be presented to the peer during the SSL handshake process. This function was introduced in Qt 5.1. **See also** [setLocalCertificateChain](qsslconfiguration#setLocalCertificateChain)() and [localCertificate](qsslconfiguration#localCertificate)(). ### `[since 6.0]` bool QSslConfiguration::missingCertificateIsFatal() const Returns true if errors with code [QSslError::NoPeerCertificate](qsslerror#SslError-enum) cannot be ignored. **Note:** Always returns false for all TLS backends but OpenSSL. This function was introduced in Qt 6.0. **See also** [QSslSocket::ignoreSslErrors](qsslsocket#ignoreSslErrors)() and [setMissingCertificateIsFatal](qsslconfiguration#setMissingCertificateIsFatal)(). ### `[since 5.3]` [QByteArray](qbytearray) QSslConfiguration::nextNegotiatedProtocol() const This function returns the protocol negotiated with the server if the Next Protocol Negotiation (NPN) or Application-Layer Protocol Negotiation (ALPN) TLS extension was enabled. In order for the NPN/ALPN extension to be enabled, [setAllowedNextProtocols](qsslconfiguration#setAllowedNextProtocols)() needs to be called explicitly before connecting to the server. If no protocol could be negotiated or the extension was not enabled, this function returns a [QByteArray](qbytearray) which is null. This function was introduced in Qt 5.3. **See also** [setAllowedNextProtocols](qsslconfiguration#setAllowedNextProtocols)() and [nextProtocolNegotiationStatus](qsslconfiguration#nextProtocolNegotiationStatus)(). ### `[since 5.3]` [QSslConfiguration::NextProtocolNegotiationStatus](qsslconfiguration#NextProtocolNegotiationStatus-enum) QSslConfiguration::nextProtocolNegotiationStatus() const This function returns the status of the Next Protocol Negotiation (NPN) or Application-Layer Protocol Negotiation (ALPN). If the feature has not been enabled through [setAllowedNextProtocols](qsslconfiguration#setAllowedNextProtocols)(), this function returns [NextProtocolNegotiationNone](qsslconfiguration#NextProtocolNegotiationStatus-enum). The status will be set before emitting the encrypted() signal. This function was introduced in Qt 5.3. **See also** [setAllowedNextProtocols](qsslconfiguration#setAllowedNextProtocols)(), [allowedNextProtocols](qsslconfiguration#allowedNextProtocols)(), [nextNegotiatedProtocol](qsslconfiguration#nextNegotiatedProtocol)(), and [QSslConfiguration::NextProtocolNegotiationStatus](qsslconfiguration#NextProtocolNegotiationStatus-enum). ### `[since 5.13]` bool QSslConfiguration::ocspStaplingEnabled() const Returns true if OCSP stapling was enabled by setOCSPStaplingEnabled(), otherwise false (which is the default value). This function was introduced in Qt 5.13. **See also** [setOcspStaplingEnabled](qsslconfiguration#setOcspStaplingEnabled)(). ### [QSslCertificate](qsslcertificate) QSslConfiguration::peerCertificate() const Returns the peer's digital certificate (i.e., the immediate certificate of the host you are connected to), or a null certificate, if the peer has not assigned a certificate. The peer certificate is checked automatically during the handshake phase, so this function is normally used to fetch the certificate for display or for connection diagnostic purposes. It contains information about the peer, including its host name, the certificate issuer, and the peer's public key. Because the peer certificate is set during the handshake phase, it is safe to access the peer certificate from a slot connected to the [QSslSocket::sslErrors](qsslsocket#sslErrors)() signal, [QNetworkReply::sslErrors](qnetworkreply#sslErrors)() signal, or the [QSslSocket::encrypted](qsslsocket#encrypted)() signal. If a null certificate is returned, it can mean the SSL handshake failed, or it can mean the host you are connected to doesn't have a certificate, or it can mean there is no connection. If you want to check the peer's complete chain of certificates, use [peerCertificateChain](qsslconfiguration#peerCertificateChain)() to get them all at once. **See also** [peerCertificateChain](qsslconfiguration#peerCertificateChain)(), [QSslSocket::sslErrors](qsslsocket#sslErrors)(), [QSslSocket::ignoreSslErrors](qsslsocket#ignoreSslErrors)(), [QNetworkReply::sslErrors](qnetworkreply#sslErrors)(), and [QNetworkReply::ignoreSslErrors](qnetworkreply#ignoreSslErrors)(). ### [QList](qlist)<[QSslCertificate](qsslcertificate)> QSslConfiguration::peerCertificateChain() const Returns the peer's chain of digital certificates, starting with the peer's immediate certificate and ending with the CA's certificate. Peer certificates are checked automatically during the handshake phase. This function is normally used to fetch certificates for display, or for performing connection diagnostics. Certificates contain information about the peer and the certificate issuers, including host name, issuer names, and issuer public keys. Because the peer certificate is set during the handshake phase, it is safe to access the peer certificate from a slot connected to the [QSslSocket::sslErrors](qsslsocket#sslErrors)() signal, [QNetworkReply::sslErrors](qnetworkreply#sslErrors)() signal, or the [QSslSocket::encrypted](qsslsocket#encrypted)() signal. If an empty list is returned, it can mean the SSL handshake failed, or it can mean the host you are connected to doesn't have a certificate, or it can mean there is no connection. If you want to get only the peer's immediate certificate, use [peerCertificate](qsslconfiguration#peerCertificate)(). **See also** [peerCertificate](qsslconfiguration#peerCertificate)(), [QSslSocket::sslErrors](qsslsocket#sslErrors)(), [QSslSocket::ignoreSslErrors](qsslsocket#ignoreSslErrors)(), [QNetworkReply::sslErrors](qnetworkreply#sslErrors)(), and [QNetworkReply::ignoreSslErrors](qnetworkreply#ignoreSslErrors)(). ### int QSslConfiguration::peerVerifyDepth() const Returns the maximum number of certificates in the peer's certificate chain to be checked during the SSL handshake phase, or 0 (the default) if no maximum depth has been set, indicating that the whole certificate chain should be checked. The certificates are checked in issuing order, starting with the peer's own certificate, then its issuer's certificate, and so on. **See also** [setPeerVerifyDepth](qsslconfiguration#setPeerVerifyDepth)() and [peerVerifyMode](qsslconfiguration#peerVerifyMode)(). ### [QSslSocket::PeerVerifyMode](qsslsocket#PeerVerifyMode-enum) QSslConfiguration::peerVerifyMode() const Returns the verify mode. This mode decides whether [QSslSocket](qsslsocket) should request a certificate from the peer (i.e., the client requests a certificate from the server, or a server requesting a certificate from the client), and whether it should require that this certificate is valid. The default mode is AutoVerifyPeer, which tells [QSslSocket](qsslsocket) to use VerifyPeer for clients, QueryPeer for servers. **See also** [setPeerVerifyMode](qsslconfiguration#setPeerVerifyMode)(). ### `[since 5.8]` [QByteArray](qbytearray) QSslConfiguration::preSharedKeyIdentityHint() const Returns the identity hint. This function was introduced in Qt 5.8. **See also** [setPreSharedKeyIdentityHint](qsslconfiguration#setPreSharedKeyIdentityHint)(). ### [QSslKey](qsslkey) QSslConfiguration::privateKey() const Returns the [SSL key](qsslkey) assigned to this connection or a null key if none has been assigned yet. **See also** [setPrivateKey](qsslconfiguration#setPrivateKey)() and [localCertificate](qsslconfiguration#localCertificate)(). ### [QSsl::SslProtocol](qssl#SslProtocol-enum) QSslConfiguration::protocol() const Returns the protocol setting for this SSL configuration. **See also** [setProtocol](qsslconfiguration#setProtocol)(). ### [QSslCipher](qsslcipher) QSslConfiguration::sessionCipher() const Returns the socket's cryptographic [cipher](qsslcipher), or a null cipher if the connection isn't encrypted. The socket's cipher for the session is set during the handshake phase. The cipher is used to encrypt and decrypt data transmitted through the socket. The SSL infrastructure also provides functions for setting the ordered list of ciphers from which the handshake phase will eventually select the session cipher. This ordered list must be in place before the handshake phase begins. **See also** [ciphers](qsslconfiguration#ciphers)(), [setCiphers](qsslconfiguration#setCiphers)(), and [supportedCiphers](qsslconfiguration#supportedCiphers)(). ### `[since 5.4]` [QSsl::SslProtocol](qssl#SslProtocol-enum) QSslConfiguration::sessionProtocol() const Returns the socket's SSL/TLS protocol or UnknownProtocol if the connection isn't encrypted. The socket's protocol for the session is set during the handshake phase. This function was introduced in Qt 5.4. **See also** [protocol](qsslconfiguration#protocol)() and [setProtocol](qsslconfiguration#setProtocol)(). ### `[since 5.2]` [QByteArray](qbytearray) QSslConfiguration::sessionTicket() const If [QSsl::SslOptionDisableSessionPersistence](qssl#SslOption-enum) was turned off, this function returns the session ticket used in the SSL handshake in ASN.1 format, suitable to e.g. be persisted to disk. If no session ticket was used or [QSsl::SslOptionDisableSessionPersistence](qssl#SslOption-enum) was not turned off, this function returns an empty [QByteArray](qbytearray). **Note:** When persisting the session ticket to disk or similar, be careful not to expose the session to a potential attacker, as knowledge of the session allows for eavesdropping on data encrypted with the session parameters. This function was introduced in Qt 5.2. **See also** [setSessionTicket](qsslconfiguration#setSessionTicket)(), [QSsl::SslOptionDisableSessionPersistence](qssl#SslOption-enum), [setSslOption](qsslconfiguration#setSslOption)(), and [QSslSocket::newSessionTicketReceived](qsslsocket#newSessionTicketReceived)(). ### `[since 5.2]` int QSslConfiguration::sessionTicketLifeTimeHint() const If [QSsl::SslOptionDisableSessionPersistence](qssl#SslOption-enum) was turned off, this function returns the session ticket life time hint sent by the server (which might be 0). If the server did not send a session ticket (e.g. when resuming a session or when the server does not support it) or [QSsl::SslOptionDisableSessionPersistence](qssl#SslOption-enum) was not turned off, this function returns -1. This function was introduced in Qt 5.2. **See also** [sessionTicket](qsslconfiguration#sessionTicket)(), [QSsl::SslOptionDisableSessionPersistence](qssl#SslOption-enum), [setSslOption](qsslconfiguration#setSslOption)(), and [QSslSocket::newSessionTicketReceived](qsslsocket#newSessionTicketReceived)(). ### `[since 5.3]` void QSslConfiguration::setAllowedNextProtocols(const [QList](qlist)<[QByteArray](qbytearray)> &*protocols*) This function sets the allowed *protocols* to be negotiated with the server through the Next Protocol Negotiation (NPN) or Application-Layer Protocol Negotiation (ALPN) TLS extension; each element in *protocols* must define one allowed protocol. The function must be called explicitly before connecting to send the NPN/ALPN extension in the SSL handshake. Whether or not the negotiation succeeded can be queried through [nextProtocolNegotiationStatus](qsslconfiguration#nextProtocolNegotiationStatus)(). This function was introduced in Qt 5.3. **See also** [nextNegotiatedProtocol](qsslconfiguration#nextNegotiatedProtocol)(), [nextProtocolNegotiationStatus](qsslconfiguration#nextProtocolNegotiationStatus)(), [allowedNextProtocols](qsslconfiguration#allowedNextProtocols)(), and [QSslConfiguration::NextProtocolHttp1\_1](qsslconfiguration#NextProtocolHttp1_1-var). ### `[since 5.11]` void QSslConfiguration::setBackendConfiguration(const [QMap](qmap)<[QByteArray](qbytearray), [QVariant](qvariant)> &*backendConfiguration* = QMap<QByteArray, QVariant>()) Sets or clears the backend-specific configuration. Without a *backendConfiguration* parameter this function will clear the backend-specific configuration. More information about the supported options is available in the documentation of [setBackendConfigurationOption](qsslconfiguration#setBackendConfigurationOption)(). This function was introduced in Qt 5.11. **See also** [backendConfiguration](qsslconfiguration#backendConfiguration)() and [setBackendConfigurationOption](qsslconfiguration#setBackendConfigurationOption)(). ### `[since 5.11]` void QSslConfiguration::setBackendConfigurationOption(const [QByteArray](qbytearray) &*name*, const [QVariant](qvariant) &*value*) Sets the option *name* in the backend-specific configuration to *value*. Options supported by the OpenSSL (>= 1.0.2) backend are available in the [supported configuration file commands](https://www.openssl.org/docs/manmaster/man3/SSL_CONF_cmd.html#SUPPORTED-CONFIGURATION-FILE-COMMANDS) documentation. The expected type for the *value* parameter is a [QByteArray](qbytearray) for all options. The [examples](https://www.openssl.org/docs/manmaster/man3/SSL_CONF_cmd.html#EXAMPLES) show how to use some of the options. **Note:** The backend-specific configuration will be applied after the general configuration. Using the backend-specific configuration to set a general configuration option again will overwrite the general configuration option. This function was introduced in Qt 5.11. **See also** [backendConfiguration](qsslconfiguration#backendConfiguration)() and [setBackendConfiguration](qsslconfiguration#setBackendConfiguration)(). ### void QSslConfiguration::setCaCertificates(const [QList](qlist)<[QSslCertificate](qsslcertificate)> &*certificates*) Sets this socket's CA certificate database to be *certificates*. The certificate database must be set prior to the SSL handshake. The CA certificate database is used by the socket during the handshake phase to validate the peer's certificate. **Note:** The default configuration uses the system CA certificate database. If that is not available (as is commonly the case on iOS), the default database is empty. **See also** [caCertificates](qsslconfiguration#caCertificates)(), [addCaCertificates](qsslconfiguration#addCaCertificates)(), and [addCaCertificate](qsslconfiguration#addCaCertificate)(). ### void QSslConfiguration::setCiphers(const [QList](qlist)<[QSslCipher](qsslcipher)> &*ciphers*) Sets the cryptographic cipher suite for this socket to *ciphers*, which must contain a subset of the ciphers in the list returned by [supportedCiphers](qsslconfiguration#supportedCiphers)(). Restricting the cipher suite must be done before the handshake phase, where the session cipher is chosen. **Note:** This is not currently supported in the Schannel backend. **See also** [ciphers](qsslconfiguration#ciphers)() and [supportedCiphers](qsslconfiguration#supportedCiphers)(). ### `[since 6.0]` void QSslConfiguration::setCiphers(const [QString](qstring) &*ciphers*) Sets the cryptographic cipher suite for this configuration to *ciphers*, which is a colon-separated list of cipher suite names. The ciphers are listed in order of preference, starting with the most preferred cipher. For example: ``` QSslConfiguration tlsConfig = QSslConfiguration::defaultConfiguration(); tlsConfig.setCiphers(QStringLiteral("DHE-RSA-AES256-SHA:DHE-DSS-AES256-SHA:AES256-SHA")); ``` Each cipher name in *ciphers* must be the name of a cipher in the list returned by [supportedCiphers](qsslconfiguration#supportedCiphers)(). Restricting the cipher suite must be done before the handshake phase, where the session cipher is chosen. **Note:** This is not currently supported in the Schannel backend. This function was introduced in Qt 6.0. **See also** [ciphers](qsslconfiguration#ciphers)(). ### `[static]` void QSslConfiguration::setDefaultConfiguration(const [QSslConfiguration](qsslconfiguration#QSslConfiguration) &*configuration*) Sets the default SSL configuration to be used in new SSL connections to be *configuration*. Existing connections are not affected by this call. **See also** [supportedCiphers](qsslconfiguration#supportedCiphers)() and [defaultConfiguration](qsslconfiguration#defaultConfiguration)(). ### `[static]` void QSslConfiguration::setDefaultDtlsConfiguration(const [QSslConfiguration](qsslconfiguration#QSslConfiguration) &*configuration*) Sets the default DTLS configuration to be used in new DTLS connections to be *configuration*. Existing connections are not affected by this call. **See also** [defaultDtlsConfiguration](qsslconfiguration#defaultDtlsConfiguration)(). ### `[since 5.8]` void QSslConfiguration::setDiffieHellmanParameters(const [QSslDiffieHellmanParameters](qssldiffiehellmanparameters) &*dhparams*) Sets a custom set of Diffie-Hellman parameters to be used by this socket when functioning as a server to *dhparams*. If no Diffie-Hellman parameters have been set, the [QSslConfiguration](qsslconfiguration) object defaults to using the 1024-bit MODP group from RFC 2409. This function was introduced in Qt 5.8. **See also** [diffieHellmanParameters](qsslconfiguration#diffieHellmanParameters)(). ### void QSslConfiguration::setDtlsCookieVerificationEnabled(bool *enable*) This function enables DTLS cookie verification when *enable* is true. **See also** [dtlsCookieVerificationEnabled](qsslconfiguration#dtlsCookieVerificationEnabled)(). ### `[since 5.5]` void QSslConfiguration::setEllipticCurves(const [QList](qlist)<[QSslEllipticCurve](qsslellipticcurve)> &*curves*) Sets the list of elliptic curves to be used by this socket to *curves*, which must contain a subset of the curves in the list returned by [supportedEllipticCurves](qsslconfiguration#supportedEllipticCurves)(). Restricting the elliptic curves must be done before the handshake phase, where the session cipher is chosen. This function was introduced in Qt 5.5. **See also** [ellipticCurves](qsslconfiguration#ellipticCurves). ### `[since 6.0]` void QSslConfiguration::setHandshakeMustInterruptOnError(bool *interrupt*) If *interrupt* is true and the underlying backend supports this option, errors found during certificate verification are reported immediately by emitting [QSslSocket::handshakeInterruptedOnError](qsslsocket#handshakeInterruptedOnError)(). This allows to stop the unfinished handshake and send a proper alert message to a peer. No special action is required from the application in this case. [QSslSocket](qsslsocket) will close the connection after sending the alert message. If the application after inspecting the error wants to continue the handshake, it must call [QSslSocket::continueInterruptedHandshake](qsslsocket#continueInterruptedHandshake)() from its slot function. The signal-slot connection must be direct. **Note:** When interrupting handshake is enabled, errors that would otherwise be reported by [QSslSocket::peerVerifyError](qsslsocket#peerVerifyError)() are instead only reported by [QSslSocket::handshakeInterruptedOnError](qsslsocket#handshakeInterruptedOnError)(). **Note:** Even if the handshake was continued, these errors will be reported when emitting [QSslSocket::sslErrors](qsslsocket#sslErrors)() signal (and thus must be ignored in the corresponding function slot). This function was introduced in Qt 6.0. **See also** [handshakeMustInterruptOnError](qsslconfiguration#handshakeMustInterruptOnError)(), [QSslSocket::handshakeInterruptedOnError](qsslsocket#handshakeInterruptedOnError)(), and [QSslSocket::continueInterruptedHandshake](qsslsocket#continueInterruptedHandshake)(). ### void QSslConfiguration::setLocalCertificate(const [QSslCertificate](qsslcertificate) &*certificate*) Sets the certificate to be presented to the peer during SSL handshake to be *certificate*. Setting the certificate once the connection has been established has no effect. A certificate is the means of identification used in the SSL process. The local certificate is used by the remote end to verify the local user's identity against its list of Certification Authorities. In most cases, such as in HTTP web browsing, only servers identify to the clients, so the client does not send a certificate. **See also** [localCertificate](qsslconfiguration#localCertificate)(). ### `[since 5.1]` void QSslConfiguration::setLocalCertificateChain(const [QList](qlist)<[QSslCertificate](qsslcertificate)> &*localChain*) Sets the certificate chain to be presented to the peer during the SSL handshake to be *localChain*. Setting the certificate chain once the connection has been established has no effect. A certificate is the means of identification used in the SSL process. The local certificate is used by the remote end to verify the local user's identity against its list of Certification Authorities. In most cases, such as in HTTP web browsing, only servers identify to the clients, so the client does not send a certificate. Unlike [QSslConfiguration::setLocalCertificate](qsslconfiguration#setLocalCertificate)() this method allows you to specify any intermediate certificates required in order to validate your certificate. The first item in the list must be the leaf certificate. This function was introduced in Qt 5.1. **See also** [localCertificateChain](qsslconfiguration#localCertificateChain)(). ### `[since 6.0]` void QSslConfiguration::setMissingCertificateIsFatal(bool *cannotRecover*) If *cannotRecover* is true, and verification mode in use is [QSslSocket::VerifyPeer](qsslsocket#PeerVerifyMode-enum) or [QSslSocket::AutoVerifyPeer](qsslsocket#PeerVerifyMode-enum) (for a client-side socket), the missing peer's certificate would be treated as an unrecoverable error that cannot be ignored. A proper alert message will be sent to the peer before closing the connection. **Note:** Only available if Qt was configured and built with OpenSSL backend. This function was introduced in Qt 6.0. **See also** [QSslSocket::ignoreSslErrors](qsslsocket#ignoreSslErrors)(), [QSslSocket::PeerVerifyMode](qsslsocket#PeerVerifyMode-enum), and [missingCertificateIsFatal](qsslconfiguration#missingCertificateIsFatal)(). ### `[since 5.13]` void QSslConfiguration::setOcspStaplingEnabled(bool *enabled*) If *enabled* is true, client [QSslSocket](qsslsocket) will send a certificate status request to its peer when initiating a handshake. During the handshake [QSslSocket](qsslsocket) will verify the server's response. This value must be set before the handshake starts. This function was introduced in Qt 5.13. **See also** [ocspStaplingEnabled](qsslconfiguration#ocspStaplingEnabled)(). ### void QSslConfiguration::setPeerVerifyDepth(int *depth*) Sets the maximum number of certificates in the peer's certificate chain to be checked during the SSL handshake phase, to *depth*. Setting a depth of 0 means that no maximum depth is set, indicating that the whole certificate chain should be checked. The certificates are checked in issuing order, starting with the peer's own certificate, then its issuer's certificate, and so on. **See also** [peerVerifyDepth](qsslconfiguration#peerVerifyDepth)() and [setPeerVerifyMode](qsslconfiguration#setPeerVerifyMode)(). ### void QSslConfiguration::setPeerVerifyMode([QSslSocket::PeerVerifyMode](qsslsocket#PeerVerifyMode-enum) *mode*) Sets the verify mode to *mode*. This mode decides whether [QSslSocket](qsslsocket) should request a certificate from the peer (i.e., the client requests a certificate from the server, or a server requesting a certificate from the client), and whether it should require that this certificate is valid. The default mode is AutoVerifyPeer, which tells [QSslSocket](qsslsocket) to use VerifyPeer for clients, QueryPeer for servers. **See also** [peerVerifyMode](qsslconfiguration#peerVerifyMode)(). ### `[since 5.8]` void QSslConfiguration::setPreSharedKeyIdentityHint(const [QByteArray](qbytearray) &*hint*) Sets the identity hint for a preshared key authentication to *hint*. This will affect the next initiated handshake; calling this function on an already-encrypted socket will not affect the socket's identity hint. The identity hint is used in [QSslSocket::SslServerMode](qsslsocket#SslMode-enum) only! This function was introduced in Qt 5.8. **See also** [preSharedKeyIdentityHint](qsslconfiguration#preSharedKeyIdentityHint)(). ### void QSslConfiguration::setPrivateKey(const [QSslKey](qsslkey) &*key*) Sets the connection's private [key](qsslkey) to *key*. The private key and the local [certificate](qsslcertificate) are used by clients and servers that must prove their identity to SSL peers. Both the key and the local certificate are required if you are creating an SSL server socket. If you are creating an SSL client socket, the key and local certificate are required if your client must identify itself to an SSL server. **See also** [privateKey](qsslconfiguration#privateKey)() and [setLocalCertificate](qsslconfiguration#setLocalCertificate)(). ### void QSslConfiguration::setProtocol([QSsl::SslProtocol](qssl#SslProtocol-enum) *protocol*) Sets the protocol setting for this configuration to be *protocol*. Setting the protocol once the connection has already been established has no effect. **See also** [protocol](qsslconfiguration#protocol)(). ### `[since 5.2]` void QSslConfiguration::setSessionTicket(const [QByteArray](qbytearray) &*sessionTicket*) Sets the session ticket to be used in an SSL handshake. [QSsl::SslOptionDisableSessionPersistence](qssl#SslOption-enum) must be turned off for this to work, and *sessionTicket* must be in ASN.1 format as returned by [sessionTicket](qsslconfiguration#sessionTicket)(). This function was introduced in Qt 5.2. **See also** [sessionTicket](qsslconfiguration#sessionTicket)(), [QSsl::SslOptionDisableSessionPersistence](qssl#SslOption-enum), [setSslOption](qsslconfiguration#setSslOption)(), and [QSslSocket::newSessionTicketReceived](qsslsocket#newSessionTicketReceived)(). ### void QSslConfiguration::setSslOption([QSsl::SslOption](qssl#SslOption-enum) *option*, bool *on*) Enables or disables an SSL compatibility *option*. If *on* is true, the *option* is enabled. If *on* is false, the *option* is disabled. **See also** [testSslOption](qsslconfiguration#testSslOption)(). ### `[static, since 5.5]` [QList](qlist)<[QSslCipher](qsslcipher)> QSslConfiguration::supportedCiphers() Returns the list of cryptographic ciphers supported by this system. This list is set by the system's SSL libraries and may vary from system to system. This function was introduced in Qt 5.5. **See also** [ciphers](qsslconfiguration#ciphers)() and [setCiphers](qsslconfiguration#setCiphers)(). ### `[static, since 5.5]` [QList](qlist)<[QSslEllipticCurve](qsslellipticcurve)> QSslConfiguration::supportedEllipticCurves() Returns the list of elliptic curves supported by this system. This list is set by the system's SSL libraries and may vary from system to system. This function was introduced in Qt 5.5. **See also** [ellipticCurves](qsslconfiguration#ellipticCurves)() and [setEllipticCurves](qsslconfiguration#setEllipticCurves)(). ### `[since 5.0]` void QSslConfiguration::swap([QSslConfiguration](qsslconfiguration#QSslConfiguration) &*other*) Swaps this SSL configuration instance with *other*. This function is very fast and never fails. This function was introduced in Qt 5.0. ### `[static, since 5.5]` [QList](qlist)<[QSslCertificate](qsslcertificate)> QSslConfiguration::systemCaCertificates() This function provides the CA certificate database provided by the operating system. The CA certificate database returned by this function is used to initialize the database returned by [caCertificates](qsslconfiguration#caCertificates)() on the default [QSslConfiguration](qsslconfiguration). This function was introduced in Qt 5.5. **See also** [caCertificates](qsslconfiguration#caCertificates)(), [setCaCertificates](qsslconfiguration#setCaCertificates)(), [defaultConfiguration](qsslconfiguration#defaultConfiguration)(), [addCaCertificate](qsslconfiguration#addCaCertificate)(), and [addCaCertificates](qsslconfiguration#addCaCertificates)(). ### bool QSslConfiguration::testSslOption([QSsl::SslOption](qssl#SslOption-enum) *option*) const Returns `true` if the specified SSL compatibility *option* is enabled. **See also** [setSslOption](qsslconfiguration#setSslOption)(). ### bool QSslConfiguration::operator!=(const [QSslConfiguration](qsslconfiguration#QSslConfiguration) &*other*) const Returns `true` if this [QSslConfiguration](qsslconfiguration) differs from *other*. Two [QSslConfiguration](qsslconfiguration) objects are considered different if any state or setting is different. **See also** [operator==](qsslconfiguration#operator-eq-eq)(). ### bool QSslConfiguration::operator==(const [QSslConfiguration](qsslconfiguration#QSslConfiguration) &*other*) const Returns `true` if this [QSslConfiguration](qsslconfiguration) object is equal to *other*. Two [QSslConfiguration](qsslconfiguration) objects are considered equal if they have the exact same settings and state. **See also** [operator!=](qsslconfiguration#operator-not-eq)(). Member Variable Documentation ----------------------------- ### const char [] QSslConfiguration::NextProtocolHttp1\_1 This variable holds the value used for negotiating HTTP 1.1 during the Next Protocol Negotiation.
programming_docs
qt qfloat16 Class qfloat16 Class ============== Provides 16-bit floating point support. [More...](#details) | | | | --- | --- | | Header: | #include <QFloat16> | | CMake: | find\_package(Qt6 COMPONENTS Core REQUIRED) target\_link\_libraries(mytarget PRIVATE Qt6::Core) | | qmake: | QT += core | | Since: | Qt 5.9 | * [List of all members, including inherited members](https://doc.qt.io/qt-6.2/qfloat16-members.html) Public Functions ---------------- | | | | --- | --- | | | **[qfloat16](qfloat16#qfloat16-1)**(Qt::Initialization) | | qfloat16 | **[copySign](qfloat16#copySign)**(qfloat16 *sign*) const | | bool | **[isNormal](qfloat16#isNormal)**() const | Related Non-Members ------------------- | | | | --- | --- | | void | **[qFloatFromFloat16](qfloat16#qFloatFromFloat16)**(float \**out*, const qfloat16 \**in*, qsizetype *len*) | | void | **[qFloatToFloat16](qfloat16#qFloatToFloat16)**(qfloat16 \**out*, const float \**in*, qsizetype *len*) | | int | **[qFpClassify](qfloat16#qFpClassify)**(qfloat16 *val*) | | bool | **[qFuzzyCompare](qfloat16#qFuzzyCompare)**(qfloat16 *p1*, qfloat16 *p2*) | | bool | **[qIsFinite](qfloat16#qIsFinite)**(qfloat16 *f*) | | bool | **[qIsInf](qfloat16#qIsInf)**(qfloat16 *f*) | | bool | **[qIsNaN](qfloat16#qIsNaN)**(qfloat16 *f*) | | qint64 | **[qRound64](qfloat16#qRound64)**(qfloat16 *value*) | | int | **[qRound](qfloat16#qRound)**(qfloat16 *value*) | Detailed Description -------------------- The `qfloat16` class provides support for half-precision (16-bit) floating point data. It is fully compliant with IEEE 754 as a storage type. This implies that any arithmetic operation on a `qfloat16` instance results in the value first being converted to a `float`. This conversion to and from `float` is performed by hardware when possible, but on processors that do not natively support half-precision, the conversion is performed through a sequence of lookup table operations. `qfloat16` should be treated as if it were a POD (plain old data) type. Consequently, none of the supported operations need any elaboration beyond stating that it supports all arithmetic operators incident to floating point types. **Note:** On x86 and x86-64 that to get hardware accelerated conversions you must compile with F16C or AVX2 enabled, or use [qFloatToFloat16](qfloat16#qFloatToFloat16)() and [qFloatFromFloat16](qfloat16#qFloatFromFloat16)() which will detect F16C at runtime. Member Function Documentation ----------------------------- ### `[since 6.1]` qfloat16::qfloat16(Qt::Initialization) Constructs a qfloat16 without initializing the value. This function was introduced in Qt 6.1. ### `[since 5.15]` qfloat16 qfloat16::copySign(qfloat16 *sign*) const Returns a qfloat16 with the sign of *sign* but the rest of its value taken from this qfloat16. Serves as qfloat16's equivalent of std::copysign(). This function was introduced in Qt 5.15. ### `[since 5.14]` bool qfloat16::isNormal() const Returns `true` if this `qfloat16` value is finite and in normal form. This function was introduced in Qt 5.14. **See also** [qFpClassify](qfloat16#qFpClassify)(). Related Non-Members ------------------- ### `[since 5.11]` void qFloatFromFloat16(float \**out*, const qfloat16 \**in*, qsizetype *len*) Converts *len* qfloat16 from *in* to floats and stores them in *out*. Both *in* and *out* must have *len* allocated entries. This function is faster than converting values one by one, and will do runtime F16C detection on x86 and x86-64 hardware. This function was introduced in Qt 5.11. ### `[since 5.11]` void qFloatToFloat16(qfloat16 \**out*, const float \**in*, qsizetype *len*) Converts *len* floats from *in* to qfloat16 and stores them in *out*. Both *in* and *out* must have *len* allocated entries. This function is faster than converting values one by one, and will do runtime F16C detection on x86 and x86-64 hardware. This function was introduced in Qt 5.11. ### `[since 5.14]` int qFpClassify(qfloat16 *val*) This function overloads [qFpClassify](qtglobal#qFpClassify-1)(float). Returns the floating-point class of *val*. This function was introduced in Qt 5.14. ### bool qFuzzyCompare(qfloat16 *p1*, qfloat16 *p2*) This function overloads [qFuzzyCompare](qtglobal#qFuzzyCompare-1)(float, float). Compares the floating point value *p1* and *p2* and returns `true` if they are considered equal, otherwise `false`. The two numbers are compared in a relative way, where the exactness is stronger the smaller the numbers are. ### bool qIsFinite(qfloat16 *f*) This function overloads qIsFinite(float). Returns true if the `qfloat16` *f* is a finite number. ### bool qIsInf(qfloat16 *f*) This function overloads qIsInf(float). Returns true if the `qfloat16` *f* is equivalent to infinity. ### bool qIsNaN(qfloat16 *f*) This function overloads qIsNaN(float). Returns true if the `qfloat16` *f* is not a number (NaN). ### [qint64](qtglobal#qint64-typedef) qRound64(qfloat16 *value*) This function overloads [qRound64](qtglobal#qRound64-1)(float). Rounds *value* to the nearest 64-bit integer. ### int qRound(qfloat16 *value*) This function overloads [qRound](qtglobal#qRound-1)(float). Rounds *value* to the nearest integer. qt QPrinter Class QPrinter Class ============== The QPrinter class is a paint device that paints on a printer. [More...](#details) | | | | --- | --- | | Header: | #include <QPrinter> | | CMake: | find\_package(Qt6 COMPONENTS PrintSupport REQUIRED) target\_link\_libraries(mytarget PRIVATE Qt6::PrintSupport) | | qmake: | QT += printsupport | | Inherits: | [QPagedPaintDevice](qpagedpaintdevice) | * [List of all members, including inherited members](https://doc.qt.io/qt-6.2/qprinter-members.html) **Note:** All functions in this class are [reentrant](threads-reentrancy). Public Types ------------ | | | | --- | --- | | enum | **[ColorMode](qprinter#ColorMode-enum)** { Color, GrayScale } | | enum | **[DuplexMode](qprinter#DuplexMode-enum)** { DuplexNone, DuplexAuto, DuplexLongSide, DuplexShortSide } | | enum | **[OutputFormat](qprinter#OutputFormat-enum)** { NativeFormat, PdfFormat } | | enum | **[PageOrder](qprinter#PageOrder-enum)** { FirstPageFirst, LastPageFirst } | | enum | **[PaperSource](qprinter#PaperSource-enum)** { Auto, Cassette, Envelope, EnvelopeManual, FormSource, …, LastPaperSource } | | enum | **[PrintRange](qprinter#PrintRange-enum)** { AllPages, Selection, PageRange, CurrentPage } | | enum | **[PrinterMode](qprinter#PrinterMode-enum)** { ScreenResolution, PrinterResolution, HighResolution } | | enum | **[PrinterState](qprinter#PrinterState-enum)** { Idle, Active, Aborted, Error } | | enum | **[Unit](qprinter#Unit-enum)** { Millimeter, Point, Inch, Pica, Didot, …, DevicePixel } | Public Functions ---------------- | | | | --- | --- | | | **[QPrinter](qprinter#QPrinter-1)**(const QPrinterInfo &*printer*, QPrinter::PrinterMode *mode* = ScreenResolution) | | | **[QPrinter](qprinter#QPrinter)**(QPrinter::PrinterMode *mode* = ScreenResolution) | | virtual | **[~QPrinter](qprinter#dtor.QPrinter)**() | | bool | **[abort](qprinter#abort)**() | | bool | **[collateCopies](qprinter#collateCopies)**() const | | QPrinter::ColorMode | **[colorMode](qprinter#colorMode)**() const | | int | **[copyCount](qprinter#copyCount)**() const | | QString | **[creator](qprinter#creator)**() const | | QString | **[docName](qprinter#docName)**() const | | QPrinter::DuplexMode | **[duplex](qprinter#duplex)**() const | | bool | **[fontEmbeddingEnabled](qprinter#fontEmbeddingEnabled)**() const | | int | **[fromPage](qprinter#fromPage)**() const | | bool | **[fullPage](qprinter#fullPage)**() const | | bool | **[isValid](qprinter#isValid)**() const | | QString | **[outputFileName](qprinter#outputFileName)**() const | | QPrinter::OutputFormat | **[outputFormat](qprinter#outputFormat)**() const | | QPrinter::PageOrder | **[pageOrder](qprinter#pageOrder)**() const | | QRectF | **[pageRect](qprinter#pageRect)**(QPrinter::Unit *unit*) const | | QRectF | **[paperRect](qprinter#paperRect)**(QPrinter::Unit *unit*) const | | QPrinter::PaperSource | **[paperSource](qprinter#paperSource)**() const | | QPagedPaintDevice::PdfVersion | **[pdfVersion](qprinter#pdfVersion)**() const | | QPrintEngine \* | **[printEngine](qprinter#printEngine)**() const | | QString | **[printProgram](qprinter#printProgram)**() const | | QPrinter::PrintRange | **[printRange](qprinter#printRange)**() const | | QString | **[printerName](qprinter#printerName)**() const | | QString | **[printerSelectionOption](qprinter#printerSelectionOption)**() const | | QPrinter::PrinterState | **[printerState](qprinter#printerState)**() const | | int | **[resolution](qprinter#resolution)**() const | | void | **[setCollateCopies](qprinter#setCollateCopies)**(bool *collate*) | | void | **[setColorMode](qprinter#setColorMode)**(QPrinter::ColorMode *newColorMode*) | | void | **[setCopyCount](qprinter#setCopyCount)**(int *count*) | | void | **[setCreator](qprinter#setCreator)**(const QString &*creator*) | | void | **[setDocName](qprinter#setDocName)**(const QString &*name*) | | void | **[setDuplex](qprinter#setDuplex)**(QPrinter::DuplexMode *duplex*) | | void | **[setFontEmbeddingEnabled](qprinter#setFontEmbeddingEnabled)**(bool *enable*) | | void | **[setFromTo](qprinter#setFromTo)**(int *from*, int *to*) | | void | **[setFullPage](qprinter#setFullPage)**(bool *fp*) | | void | **[setOutputFileName](qprinter#setOutputFileName)**(const QString &*fileName*) | | void | **[setOutputFormat](qprinter#setOutputFormat)**(QPrinter::OutputFormat *format*) | | void | **[setPageOrder](qprinter#setPageOrder)**(QPrinter::PageOrder *pageOrder*) | | void | **[setPaperSource](qprinter#setPaperSource)**(QPrinter::PaperSource *source*) | | void | **[setPdfVersion](qprinter#setPdfVersion)**(QPagedPaintDevice::PdfVersion *version*) | | void | **[setPrintProgram](qprinter#setPrintProgram)**(const QString &*printProg*) | | void | **[setPrintRange](qprinter#setPrintRange)**(QPrinter::PrintRange *range*) | | void | **[setPrinterName](qprinter#setPrinterName)**(const QString &*name*) | | void | **[setPrinterSelectionOption](qprinter#setPrinterSelectionOption)**(const QString &*option*) | | void | **[setResolution](qprinter#setResolution)**(int *dpi*) | | QList<QPrinter::PaperSource> | **[supportedPaperSources](qprinter#supportedPaperSources)**() const | | QList<int> | **[supportedResolutions](qprinter#supportedResolutions)**() const | | bool | **[supportsMultipleCopies](qprinter#supportsMultipleCopies)**() const | | int | **[toPage](qprinter#toPage)**() const | Reimplemented Public Functions ------------------------------ | | | | --- | --- | | virtual bool | **[newPage](qprinter#newPage)**() override | | virtual QPaintEngine \* | **[paintEngine](qprinter#paintEngine)**() const override | Protected Functions ------------------- | | | | --- | --- | | void | **[setEngines](qprinter#setEngines)**(QPrintEngine \**printEngine*, QPaintEngine \**paintEngine*) | Detailed Description -------------------- This device represents a series of pages of printed output, and is used in almost exactly the same way as other paint devices such as [QWidget](qwidget) and [QPixmap](qpixmap). A set of additional functions are provided to manage device-specific features, such as orientation and resolution, and to step through the pages in a document as it is generated. When printing directly to a printer on Windows or macOS, QPrinter uses the built-in printer drivers. On X11, QPrinter uses the [Common Unix Printing System (CUPS)](http://www.cups.org/) to send PDF output to the printer. As an alternative, the [printProgram](qprinter#printProgram)() function can be used to specify the command or utility to use instead of the system default. Note that setting parameters like paper size and resolution on an invalid printer is undefined. You can use [QPrinter::isValid](qprinter#isValid)() to verify this before changing any parameters. QPrinter supports a number of parameters, most of which can be changed by the end user through a [print dialog](qprintdialog). In general, QPrinter passes these functions onto the underlying [QPrintEngine](qprintengine). The most important parameters are: * [setPageLayout](qpagedpaintdevice#setPageLayout)() tells QPrinter which page orientation to use, and what size to expect from the printer. * [setResolution](qprinter#setResolution)() tells QPrinter what resolution you wish the printer to provide, in dots per inch (DPI). * [setFullPage](qprinter#setFullPage)() tells QPrinter whether you want to deal with the full page or just with the part the printer can draw on. * [setCopyCount](qprinter#setCopyCount)() tells QPrinter how many copies of the document it should print. Many of these functions can only be called before the actual printing begins (i.e., before [QPainter::begin](qpainter#begin)() is called). This usually makes sense because, for example, it's not possible to change the number of copies when you are halfway through printing. There are also some settings that the user sets (through the printer dialog) and that applications are expected to obey. See [QAbstractPrintDialog](qabstractprintdialog)'s documentation for more details. When [QPainter::begin](qpainter#begin)() is called, the QPrinter it operates on is prepared for a new page, enabling the [QPainter](qpainter) to be used immediately to paint the first page in a document. Once the first page has been painted, [newPage](qprinter#newPage)() can be called to request a new blank page to paint on, or [QPainter::end](qpainter#end)() can be called to finish printing. The second page and all following pages are prepared using a call to [newPage](qprinter#newPage)() before they are painted. The first page in a document does not need to be preceded by a call to [newPage](qprinter#newPage)(). You only need to calling [newPage](qprinter#newPage)() after [QPainter::begin](qpainter#begin)() if you need to insert a blank page at the beginning of a printed document. Similarly, calling [newPage](qprinter#newPage)() after the last page in a document is painted will result in a trailing blank page appended to the end of the printed document. If you want to abort the print job, [abort](qprinter#abort)() will try its best to stop printing. It may cancel the entire job or just part of it. Since QPrinter can print to any [QPrintEngine](qprintengine) subclass, it is possible to extend printing support to cover new types of printing subsystem by subclassing [QPrintEngine](qprintengine) and reimplementing its interface. **See also** [QPrintDialog](qprintdialog) and [Qt Print Support](qtprintsupport-index). Member Type Documentation ------------------------- ### enum QPrinter::ColorMode This enum type is used to indicate whether [QPrinter](qprinter) should print in color or not. | Constant | Value | Description | | --- | --- | --- | | `QPrinter::Color` | `1` | print in color if available, otherwise in grayscale. | | `QPrinter::GrayScale` | `0` | print in grayscale, even on color printers. | ### enum QPrinter::DuplexMode This enum is used to indicate whether printing will occur on one or both sides of each sheet of paper (simplex or duplex printing). | Constant | Value | Description | | --- | --- | --- | | `QPrinter::DuplexNone` | `0` | Single sided (simplex) printing only. | | `QPrinter::DuplexAuto` | `1` | The printer's default setting is used to determine whether duplex printing is used. | | `QPrinter::DuplexLongSide` | `2` | Both sides of each sheet of paper are used for printing. The paper is turned over its longest edge before the second side is printed | | `QPrinter::DuplexShortSide` | `3` | Both sides of each sheet of paper are used for printing. The paper is turned over its shortest edge before the second side is printed | ### enum QPrinter::OutputFormat The OutputFormat enum is used to describe the format [QPrinter](qprinter) should use for printing. | Constant | Value | Description | | --- | --- | --- | | `QPrinter::NativeFormat` | `0` | [QPrinter](qprinter) will print output using a method defined by the platform it is running on. This mode is the default when printing directly to a printer. | | `QPrinter::PdfFormat` | `1` | [QPrinter](qprinter) will generate its output as a searchable PDF file. This mode is the default when printing to a file. | **See also** [outputFormat](qprinter#outputFormat)(), [setOutputFormat](qprinter#setOutputFormat)(), and [setOutputFileName](qprinter#setOutputFileName)(). ### enum QPrinter::PageOrder This enum type is used by [QPrinter](qprinter) to tell the application program how to print. | Constant | Value | Description | | --- | --- | --- | | `QPrinter::FirstPageFirst` | `0` | the lowest-numbered page should be printed first. | | `QPrinter::LastPageFirst` | `1` | the highest-numbered page should be printed first. | ### enum QPrinter::PaperSource This enum type specifies what paper source [QPrinter](qprinter) is to use. [QPrinter](qprinter) does not check that the paper source is available; it just uses this information to try and set the paper source. Whether it will set the paper source depends on whether the printer has that particular source. **Warning:** This is currently only implemented for Windows. | Constant | Value | Description | | --- | --- | --- | | `QPrinter::Auto` | `6` | | | `QPrinter::Cassette` | `11` | | | `QPrinter::Envelope` | `4` | | | `QPrinter::EnvelopeManual` | `5` | | | `QPrinter::FormSource` | `12` | | | `QPrinter::LargeCapacity` | `10` | | | `QPrinter::LargeFormat` | `9` | | | `QPrinter::Lower` | `1` | | | `QPrinter::MaxPageSource` | `13` | Deprecated, use LastPaperSource instead | | `QPrinter::Middle` | `2` | | | `QPrinter::Manual` | `3` | | | `QPrinter::OnlyOne` | `0` | | | `QPrinter::Tractor` | `7` | | | `QPrinter::SmallFormat` | `8` | | | `QPrinter::Upper` | `OnlyOne` | | | `QPrinter::CustomSource` | `14` | A PaperSource defined by the printer that is unknown to Qt | | `QPrinter::LastPaperSource` | `CustomSource` | The highest valid PaperSource value, currently CustomSource | ### enum QPrinter::PrintRange Used to specify the print range selection option. | Constant | Value | Description | | --- | --- | --- | | `QPrinter::AllPages` | `0` | All pages should be printed. | | `QPrinter::Selection` | `1` | Only the selection should be printed. | | `QPrinter::PageRange` | `2` | The specified page range should be printed. | | `QPrinter::CurrentPage` | `3` | Only the current page should be printed. | **See also** [setPrintRange](qprinter#setPrintRange)(), [printRange](qprinter#printRange)(), and [QAbstractPrintDialog::PrintRange](qabstractprintdialog#PrintRange-enum). ### enum QPrinter::PrinterMode This enum describes the mode the printer should work in. It basically presets a certain resolution and working mode. | Constant | Value | Description | | --- | --- | --- | | `QPrinter::ScreenResolution` | `0` | Sets the resolution of the print device to the screen resolution. This has the big advantage that the results obtained when painting on the printer will match more or less exactly the visible output on the screen. It is the easiest to use, as font metrics on the screen and on the printer are the same. This is the default value. ScreenResolution will produce a lower quality output than HighResolution and should only be used for drafts. | | `QPrinter::PrinterResolution` | `1` | This value is deprecated. It is equivalent to ScreenResolution on Unix and HighResolution on Windows and Mac. Due to the difference between ScreenResolution and HighResolution, use of this value may lead to non-portable printer code. | | `QPrinter::HighResolution` | `2` | On Windows, sets the printer resolution to that defined for the printer in use. For PDF printing, sets the resolution of the PDF driver to 1200 dpi. | **Note:** When rendering text on a [QPrinter](qprinter) device, it is important to realize that the size of text, when specified in points, is independent of the resolution specified for the device itself. Therefore, it may be useful to specify the font size in pixels when combining text with graphics to ensure that their relative sizes are what you expect. ### enum QPrinter::PrinterState | Constant | Value | | --- | --- | | `QPrinter::Idle` | `0` | | `QPrinter::Active` | `1` | | `QPrinter::Aborted` | `2` | | `QPrinter::Error` | `3` | ### enum QPrinter::Unit This enum type is used to specify the measurement unit for page and paper sizes. | Constant | Value | | --- | --- | | `QPrinter::Millimeter` | `0` | | `QPrinter::Point` | `1` | | `QPrinter::Inch` | `2` | | `QPrinter::Pica` | `3` | | `QPrinter::Didot` | `4` | | `QPrinter::Cicero` | `5` | | `QPrinter::DevicePixel` | `6` | Note the difference between Point and DevicePixel. The Point unit is defined to be 1/72th of an inch, while the DevicePixel unit is resolution dependant and is based on the actual pixels, or dots, on the printer. Member Function Documentation ----------------------------- ### QPrinter::QPrinter(const [QPrinterInfo](qprinterinfo) &*printer*, [QPrinter::PrinterMode](qprinter#PrinterMode-enum) *mode* = ScreenResolution) Creates a new printer object with the given *printer* and *mode*. ### QPrinter::QPrinter([QPrinter::PrinterMode](qprinter#PrinterMode-enum) *mode* = ScreenResolution) Creates a new printer object with the given *mode*. ### `[virtual]` QPrinter::~QPrinter() Destroys the printer object and frees any allocated resources. If the printer is destroyed while a print job is in progress this may or may not affect the print job. ### bool QPrinter::abort() Aborts the current print run. Returns `true` if the print run was successfully aborted and [printerState](qprinter#printerState)() will return [QPrinter::Aborted](qprinter#PrinterState-enum); otherwise returns `false`. It is not always possible to abort a print job. For example, all the data has gone to the printer but the printer cannot or will not cancel the job when asked to. ### bool QPrinter::collateCopies() const Returns `true` if collation is turned on when multiple copies is selected. Returns `false` if it is turned off when multiple copies is selected. When collating is turned off the printing of each individual page will be repeated the numCopies() amount before the next page is started. With collating turned on all pages are printed before the next copy of those pages is started. **See also** [setCollateCopies](qprinter#setCollateCopies)(). ### [QPrinter::ColorMode](qprinter#ColorMode-enum) QPrinter::colorMode() const Returns the current color mode. **See also** [setColorMode](qprinter#setColorMode)(). ### int QPrinter::copyCount() const Returns the number of copies that will be printed. The default value is 1. **See also** [setCopyCount](qprinter#setCopyCount)() and [supportsMultipleCopies](qprinter#supportsMultipleCopies)(). ### [QString](qstring) QPrinter::creator() const Returns the name of the application that created the document. **See also** [setCreator](qprinter#setCreator)(). ### [QString](qstring) QPrinter::docName() const Returns the document name. **See also** [setDocName](qprinter#setDocName)() and [QPrintEngine::PrintEnginePropertyKey](qprintengine#PrintEnginePropertyKey-enum). ### [QPrinter::DuplexMode](qprinter#DuplexMode-enum) QPrinter::duplex() const Returns the current duplex mode. **See also** [setDuplex](qprinter#setDuplex)(). ### bool QPrinter::fontEmbeddingEnabled() const Returns `true` if font embedding is enabled. **See also** [setFontEmbeddingEnabled](qprinter#setFontEmbeddingEnabled)(). ### int QPrinter::fromPage() const Returns the number of the first page in a range of pages to be printed (the "from page" setting). Pages in a document are numbered according to the convention that the first page is page 1. By default, this function returns a special value of 0, meaning that the "from page" setting is unset. **Note:** If fromPage() and [toPage](qprinter#toPage)() both return 0, this indicates that *the whole document will be printed*. **See also** [setFromTo](qprinter#setFromTo)(), [toPage](qprinter#toPage)(), and [pageRanges](qpagedpaintdevice#pageRanges)(). ### bool QPrinter::fullPage() const Returns `true` if the origin of the printer's coordinate system is at the corner of the page and false if it is at the edge of the printable area. See [setFullPage](qprinter#setFullPage)() for details and caveats. **See also** [setFullPage](qprinter#setFullPage)() and [QPagedPaintDevice::pageLayout](qpagedpaintdevice#pageLayout)(). ### bool QPrinter::isValid() const Returns `true` if the printer currently selected is a valid printer in the system, or a pure PDF printer; otherwise returns `false`. To detect other failures check the output of [QPainter::begin](qpainter#begin)() or [QPrinter::newPage](qprinter#newPage)(). ``` QPrinter printer; printer.setOutputFormat(QPrinter::PdfFormat); printer.setOutputFileName("/foobar/nonwritable.pdf"); QPainter painter; if (! painter.begin(&printer)) { // failed to open file qWarning("failed to open file, is it writable?"); return 1; } painter.drawText(10, 10, "Test"); if (! printer.newPage()) { qWarning("failed in flushing page to disk, disk full?"); return 1; } painter.drawText(10, 10, "Test 2"); painter.end(); ``` **See also** [setPrinterName](qprinter#setPrinterName)(). ### `[override virtual]` bool QPrinter::newPage() Reimplements: [QPagedPaintDevice::newPage](qpagedpaintdevice#newPage)(). Tells the printer to eject the current page and to continue printing on a new page. Returns `true` if this was successful; otherwise returns `false`. Calling newPage() on an inactive [QPrinter](qprinter) object will always fail. ### [QString](qstring) QPrinter::outputFileName() const Returns the name of the output file. By default, this is an empty string (indicating that the printer shouldn't print to file). **See also** [setOutputFileName](qprinter#setOutputFileName)() and [QPrintEngine::PrintEnginePropertyKey](qprintengine#PrintEnginePropertyKey-enum). ### [QPrinter::OutputFormat](qprinter#OutputFormat-enum) QPrinter::outputFormat() const Returns the output format for this printer. **See also** [setOutputFormat](qprinter#setOutputFormat)(). ### [QPrinter::PageOrder](qprinter#PageOrder-enum) QPrinter::pageOrder() const Returns the current page order. The default page order is `FirstPageFirst`. **See also** [setPageOrder](qprinter#setPageOrder)(). ### [QRectF](qrectf) QPrinter::pageRect([QPrinter::Unit](qprinter#Unit-enum) *unit*) const Returns the page's rectangle in *unit*; this is usually smaller than the [paperRect](qprinter#paperRect)() since the page normally has margins between its borders and the paper. **See also** [QPagedPaintDevice::pageLayout](qpagedpaintdevice#pageLayout)(). ### `[override virtual]` [QPaintEngine](qpaintengine) \*QPrinter::paintEngine() const Reimplements: [QPaintDevice::paintEngine() const](qpaintdevice#paintEngine). Returns the paint engine used by the printer. ### [QRectF](qrectf) QPrinter::paperRect([QPrinter::Unit](qprinter#Unit-enum) *unit*) const Returns the paper's rectangle in *unit*; this is usually larger than the [pageRect](qprinter#pageRect)(). **See also** [pageRect](qprinter#pageRect)(). ### [QPrinter::PaperSource](qprinter#PaperSource-enum) QPrinter::paperSource() const Returns the printer's paper source. This is `Manual` or a printer tray or paper cassette. **See also** [setPaperSource](qprinter#setPaperSource)(). ### `[since 5.10]` [QPagedPaintDevice::PdfVersion](qpagedpaintdevice#PdfVersion-enum) QPrinter::pdfVersion() const Returns the PDF version for this printer. The default is `PdfVersion_1_4`. This function was introduced in Qt 5.10. **See also** [setPdfVersion](qprinter#setPdfVersion)(). ### [QPrintEngine](qprintengine) \*QPrinter::printEngine() const Returns the print engine used by the printer. ### [QString](qstring) QPrinter::printProgram() const Returns the name of the program that sends the print output to the printer. The default is to return an empty string; meaning that [QPrinter](qprinter) will try to be smart in a system-dependent way. On X11 only, you can set it to something different to use a specific print program. On the other platforms, this returns an empty string. **See also** [setPrintProgram](qprinter#setPrintProgram)() and [setPrinterSelectionOption](qprinter#setPrinterSelectionOption)(). ### [QPrinter::PrintRange](qprinter#PrintRange-enum) QPrinter::printRange() const Returns the page range of the [QPrinter](qprinter). After the print setup dialog has been opened, this function returns the value selected by the user. **See also** [setPrintRange](qprinter#setPrintRange)(). ### [QString](qstring) QPrinter::printerName() const Returns the printer name. This value is initially set to the name of the default printer. **See also** [setPrinterName](qprinter#setPrinterName)(). ### [QString](qstring) QPrinter::printerSelectionOption() const Returns the printer options selection string. This is useful only if the print command has been explicitly set. The default value (an empty string) implies that the printer should be selected in a system-dependent manner. Any other value implies that the given value should be used. This function always returns an empty string on Windows and Mac. **See also** [setPrinterSelectionOption](qprinter#setPrinterSelectionOption)() and [setPrintProgram](qprinter#setPrintProgram)(). ### [QPrinter::PrinterState](qprinter#PrinterState-enum) QPrinter::printerState() const Returns the current state of the printer. This may not always be accurate (for example if the printer doesn't have the capability of reporting its state to the operating system). ### int QPrinter::resolution() const Returns the current assumed resolution of the printer, as set by [setResolution](qprinter#setResolution)() or by the printer driver. **See also** [setResolution](qprinter#setResolution)(). ### void QPrinter::setCollateCopies(bool *collate*) Sets the default value for collation checkbox when the print dialog appears. If *collate* is true, it will enable setCollateCopiesEnabled(). The default value is false. This value will be changed by what the user presses in the print dialog. **See also** [collateCopies](qprinter#collateCopies)(). ### void QPrinter::setColorMode([QPrinter::ColorMode](qprinter#ColorMode-enum) *newColorMode*) Sets the printer's color mode to *newColorMode*, which can be either `Color` or `GrayScale`. **See also** [colorMode](qprinter#colorMode)(). ### void QPrinter::setCopyCount(int *count*) Sets the number of copies to be printed to *count*. The printer driver reads this setting and prints the specified number of copies. **See also** [copyCount](qprinter#copyCount)() and [supportsMultipleCopies](qprinter#supportsMultipleCopies)(). ### void QPrinter::setCreator(const [QString](qstring) &*creator*) Sets the name of the application that created the document to *creator*. This function is only applicable to the X11 version of Qt. If no creator name is specified, the creator will be set to "Qt" followed by some version number. **See also** [creator](qprinter#creator)(). ### void QPrinter::setDocName(const [QString](qstring) &*name*) Sets the document name to *name*. On X11, the document name is for example used as the default output filename in [QPrintDialog](qprintdialog). Note that the document name does not affect the file name if the printer is printing to a file. Use the setOutputFile() function for this. **See also** [docName](qprinter#docName)() and [QPrintEngine::PrintEnginePropertyKey](qprintengine#PrintEnginePropertyKey-enum). ### void QPrinter::setDuplex([QPrinter::DuplexMode](qprinter#DuplexMode-enum) *duplex*) Enables double sided printing based on the *duplex* mode. **See also** [duplex](qprinter#duplex)(). ### `[protected]` void QPrinter::setEngines([QPrintEngine](qprintengine) \**printEngine*, [QPaintEngine](qpaintengine) \**paintEngine*) This function is used by subclasses of [QPrinter](qprinter) to specify custom print and paint engines (*printEngine* and *paintEngine*, respectively). [QPrinter](qprinter) does not take ownership of the engines, so you need to manage these engine instances yourself. Note that changing the engines will reset the printer state and all its properties. **See also** [printEngine](qprinter#printEngine)(), [paintEngine](qprinter#paintEngine)(), and [setOutputFormat](qprinter#setOutputFormat)(). ### void QPrinter::setFontEmbeddingEnabled(bool *enable*) Enabled or disables font embedding depending on *enable*. **See also** [fontEmbeddingEnabled](qprinter#fontEmbeddingEnabled)(). ### void QPrinter::setFromTo(int *from*, int *to*) Sets the range of pages to be printed to cover the pages with numbers specified by *from* and *to*, where *from* corresponds to the first page in the range and *to* corresponds to the last. **Note:** Pages in a document are numbered according to the convention that the first page is page 1. However, if *from* and *to* are both set to 0, the *whole document will be printed*. This function is mostly used to set a default value that the user can override in the print dialog when you call setup(). **See also** [fromPage](qprinter#fromPage)(), [toPage](qprinter#toPage)(), and [pageRanges](qpagedpaintdevice#pageRanges)(). ### void QPrinter::setFullPage(bool *fp*) If *fp* is true, enables support for painting over the entire page; otherwise restricts painting to the printable area reported by the device. By default, full page printing is disabled. In this case, the origin of the [QPrinter](qprinter)'s coordinate system coincides with the top-left corner of the printable area. If full page printing is enabled, the origin of the [QPrinter](qprinter)'s coordinate system coincides with the top-left corner of the paper itself. In this case, the [device metrics](qpaintdevice#PaintDeviceMetric-enum) will report the exact same dimensions as indicated by {[QPageSize](qpagesize)}. It may not be possible to print on the entire physical page because of the printer's margins, so the application must account for the margins itself. **See also** [fullPage](qprinter#fullPage)(), [QPagedPaintDevice::pageLayout](qpagedpaintdevice#pageLayout)(), and [QPagedPaintDevice::setPageSize](qpagedpaintdevice#setPageSize)(). ### void QPrinter::setOutputFileName(const [QString](qstring) &*fileName*) Sets the name of the output file to *fileName*. Setting a null or empty name (0 or "") disables printing to a file. Setting a non-empty name enables printing to a file. This can change the value of [outputFormat](qprinter#outputFormat)(). If the file name has the ".pdf" suffix PDF is generated. If the file name has a suffix other than ".pdf", the output format used is the one set with [setOutputFormat](qprinter#setOutputFormat)(). [QPrinter](qprinter) uses Qt's cross-platform PDF print engines respectively. If you can produce this format natively, for example macOS can generate PDF's from its print engine, set the output format back to [NativeFormat](qprinter#OutputFormat-enum). **See also** [outputFileName](qprinter#outputFileName)() and [setOutputFormat](qprinter#setOutputFormat)(). ### void QPrinter::setOutputFormat([QPrinter::OutputFormat](qprinter#OutputFormat-enum) *format*) Sets the output format for this printer to *format*. If *format* is the same value as currently set then no change will be made. If *format* is [NativeFormat](qprinter#OutputFormat-enum) then the [printerName](qprinter#printerName) will be set to the default printer. If there are no valid printers configured then no change will be made. If you want to set [NativeFormat](qprinter#OutputFormat-enum) with a specific [printerName](qprinter#printerName) then use [setPrinterName](qprinter#setPrinterName)(). **See also** [outputFormat](qprinter#outputFormat)() and [setPrinterName](qprinter#setPrinterName)(). ### void QPrinter::setPageOrder([QPrinter::PageOrder](qprinter#PageOrder-enum) *pageOrder*) Sets the page order to *pageOrder*. The page order can be [QPrinter::FirstPageFirst](qprinter#PageOrder-enum) or [QPrinter::LastPageFirst](qprinter#PageOrder-enum). The application is responsible for reading the page order and printing accordingly. This function is mostly useful for setting a default value that the user can override in the print dialog. This function is only supported under X11. **See also** [pageOrder](qprinter#pageOrder)(). ### void QPrinter::setPaperSource([QPrinter::PaperSource](qprinter#PaperSource-enum) *source*) Sets the paper source setting to *source*. Windows only: This option can be changed while printing and will take effect from the next call to [newPage](qprinter#newPage)() **See also** [paperSource](qprinter#paperSource)(). ### `[since 5.10]` void QPrinter::setPdfVersion([QPagedPaintDevice::PdfVersion](qpagedpaintdevice#PdfVersion-enum) *version*) Sets the PDF version for this printer to *version*. If *version* is the same value as currently set then no change will be made. This function was introduced in Qt 5.10. **See also** [pdfVersion](qprinter#pdfVersion)(). ### void QPrinter::setPrintProgram(const [QString](qstring) &*printProg*) Sets the name of the program that should do the print job to *printProg*. On X11, this function sets the program to call with the PDF output. On other platforms, it has no effect. **See also** [printProgram](qprinter#printProgram)(). ### void QPrinter::setPrintRange([QPrinter::PrintRange](qprinter#PrintRange-enum) *range*) Sets the print range option in to be *range*. **See also** [printRange](qprinter#printRange)(). ### void QPrinter::setPrinterName(const [QString](qstring) &*name*) Sets the printer name to *name*. If the *name* is empty then the output format will be set to [PdfFormat](qprinter#OutputFormat-enum). If the *name* is not a valid printer then no change will be made. If the *name* is a valid printer then the output format will be set to [NativeFormat](qprinter#OutputFormat-enum). **See also** [printerName](qprinter#printerName)(), [isValid](qprinter#isValid)(), and [setOutputFormat](qprinter#setOutputFormat)(). ### void QPrinter::setPrinterSelectionOption(const [QString](qstring) &*option*) Sets the printer to use *option* to select the printer. *option* is null by default (which implies that Qt should be smart enough to guess correctly), but it can be set to other values to use a specific printer selection option. If the printer selection option is changed while the printer is active, the current print job may or may not be affected. This function has no effect on Windows or Mac. **See also** [printerSelectionOption](qprinter#printerSelectionOption)() and [setPrintProgram](qprinter#setPrintProgram)(). ### void QPrinter::setResolution(int *dpi*) Requests that the printer prints at *dpi* or as near to *dpi* as possible. This setting affects the coordinate system as returned by, for example [QPainter::viewport](qpainter#viewport)(). This function must be called before [QPainter::begin](qpainter#begin)() to have an effect on all platforms. **See also** [resolution](qprinter#resolution)() and [QPagedPaintDevice::setPageSize](qpagedpaintdevice#setPageSize)(). ### [QList](qlist)<[QPrinter::PaperSource](qprinter#PaperSource-enum)> QPrinter::supportedPaperSources() const Returns the supported paper sizes for this printer. The values will be either a value that matches an entry in the [QPrinter::PaperSource](qprinter#PaperSource-enum) enum or a driver spesific value. The driver spesific values are greater than the constant DMBIN\_USER declared in wingdi.h. **Warning:** This function is only available in windows. ### [QList](qlist)<int> QPrinter::supportedResolutions() const Returns a list of the resolutions (a list of dots-per-inch integers) that the printer says it supports. For X11 where all printing is directly to PDF, this function will always return a one item list containing only the PDF resolution, i.e., 72 (72 dpi -- but see [PrinterMode](qprinter#PrinterMode-enum)). ### bool QPrinter::supportsMultipleCopies() const Returns `true` if the printer supports printing multiple copies of the same document in one job; otherwise false is returned. On most systems this function will return true. However, on X11 systems that do not support CUPS, this function will return false. That means the application has to handle the number of copies by printing the same document the required number of times. **See also** [setCopyCount](qprinter#setCopyCount)() and [copyCount](qprinter#copyCount)(). ### int QPrinter::toPage() const Returns the number of the last page in a range of pages to be printed (the "to page" setting). Pages in a document are numbered according to the convention that the first page is page 1. By default, this function returns a special value of 0, meaning that the "to page" setting is unset. **Note:** If [fromPage](qprinter#fromPage)() and toPage() both return 0, this indicates that *the whole document will be printed*. The programmer is responsible for reading this setting and printing accordingly. **See also** [setFromTo](qprinter#setFromTo)(), [fromPage](qprinter#fromPage)(), and [pageRanges](qpagedpaintdevice#pageRanges)().
programming_docs
qt QSqlIndex Class QSqlIndex Class =============== The QSqlIndex class provides functions to manipulate and describe database indexes. [More...](#details) | | | | --- | --- | | Header: | #include <QSqlIndex> | | CMake: | find\_package(Qt6 COMPONENTS Sql REQUIRED) target\_link\_libraries(mytarget PRIVATE Qt6::Sql) | | qmake: | QT += sql | | Inherits: | [QSqlRecord](qsqlrecord) | * [List of all members, including inherited members](https://doc.qt.io/qt-6.2/qsqlindex-members.html) Public Functions ---------------- | | | | --- | --- | | | **[QSqlIndex](qsqlindex#QSqlIndex-1)**(const QSqlIndex &*other*) | | | **[QSqlIndex](qsqlindex#QSqlIndex)**(const QString &*cursorname* = QString(), const QString &*name* = QString()) | | QSqlIndex & | **[operator=](qsqlindex#operator-eq)**(const QSqlIndex &*other*) | | | **[~QSqlIndex](qsqlindex#dtor.QSqlIndex)**() | | void | **[append](qsqlindex#append)**(const QSqlField &*field*) | | void | **[append](qsqlindex#append-1)**(const QSqlField &*field*, bool *desc*) | | QString | **[cursorName](qsqlindex#cursorName)**() const | | bool | **[isDescending](qsqlindex#isDescending)**(int *i*) const | | QString | **[name](qsqlindex#name)**() const | | void | **[setCursorName](qsqlindex#setCursorName)**(const QString &*cursorName*) | | void | **[setDescending](qsqlindex#setDescending)**(int *i*, bool *desc*) | | void | **[setName](qsqlindex#setName)**(const QString &*name*) | Detailed Description -------------------- An *index* refers to a single table or view in a database. Information about the fields that comprise the index can be used to generate SQL statements. Member Function Documentation ----------------------------- ### QSqlIndex::QSqlIndex(const [QSqlIndex](qsqlindex#QSqlIndex) &*other*) Constructs a copy of *other*. ### QSqlIndex::QSqlIndex(const [QString](qstring) &*cursorname* = QString(), const [QString](qstring) &*name* = QString()) Constructs an empty index using the cursor name *cursorname* and index name *name*. ### [QSqlIndex](qsqlindex#QSqlIndex) &QSqlIndex::operator=(const [QSqlIndex](qsqlindex#QSqlIndex) &*other*) Sets the index equal to *other*. ### QSqlIndex::~QSqlIndex() Destroys the object and frees any allocated resources. ### void QSqlIndex::append(const [QSqlField](qsqlfield) &*field*) Appends the field *field* to the list of indexed fields. The field is appended with an ascending sort order. ### void QSqlIndex::append(const [QSqlField](qsqlfield) &*field*, bool *desc*) This is an overloaded function. Appends the field *field* to the list of indexed fields. The field is appended with an ascending sort order, unless *desc* is true. ### [QString](qstring) QSqlIndex::cursorName() const Returns the name of the cursor which the index is associated with. **See also** [setCursorName](qsqlindex#setCursorName)(). ### bool QSqlIndex::isDescending(int *i*) const Returns `true` if field *i* in the index is sorted in descending order; otherwise returns `false`. ### [QString](qstring) QSqlIndex::name() const Returns the name of the index. **See also** [setName](qsqlindex#setName)(). ### void QSqlIndex::setCursorName(const [QString](qstring) &*cursorName*) Sets the name of the cursor that the index is associated with to *cursorName*. **See also** [cursorName](qsqlindex#cursorName)(). ### void QSqlIndex::setDescending(int *i*, bool *desc*) If *desc* is true, field *i* is sorted in descending order. Otherwise, field *i* is sorted in ascending order (the default). If the field does not exist, nothing happens. **See also** [isDescending](qsqlindex#isDescending)(). ### void QSqlIndex::setName(const [QString](qstring) &*name*) Sets the name of the index to *name*. **See also** [name](qsqlindex#name)(). qt QPickTriangleEvent Class QPickTriangleEvent Class ======================== class [Qt3DRender](https://doc.qt.io/qt-6.2/qt3drender-module.html)::QPickTriangleEvent The QPickTriangleEvent class holds information when a triangle is picked. [More...](#details) | | | | --- | --- | | Header: | #include <QPickTriangleEvent> | | CMake: | find\_package(Qt6 COMPONENTS 3drender REQUIRED) target\_link\_libraries(mytarget PRIVATE Qt6::3drender) | | qmake: | QT += 3drender | | Since: | Qt 5.7 | | Instantiated By: | [PickTriangleEvent](qml-qt3d-render-picktriangleevent) | | Inherits: | [Qt3DRender::QPickEvent](qt3drender-qpickevent) | * [List of all members, including inherited members](https://doc.qt.io/qt-6.2/qt3drender-qpicktriangleevent-members.html) Properties ---------- | | | | --- | --- | | * **[triangleIndex](qt3drender-qpicktriangleevent#triangleIndex-prop)** : const uint * **[uvw](qt3drender-qpicktriangleevent#uvw-prop)** : const QVector3D * **[vertex1Index](qt3drender-qpicktriangleevent#vertex1Index-prop)** : const uint | * **[vertex2Index](qt3drender-qpicktriangleevent#vertex2Index-prop)** : const uint * **[vertex3Index](qt3drender-qpicktriangleevent#vertex3Index-prop)** : const uint | Public Functions ---------------- | | | | --- | --- | | | **[QPickTriangleEvent](qt3drender-qpicktriangleevent#QPickTriangleEvent-1)**(const QPointF &*position*, const QVector3D &*worldIntersection*, const QVector3D &*localIntersection*, float *distance*, uint *triangleIndex*, uint *vertex1Index*, uint *vertex2Index*, uint *vertex3Index*) | | | **[QPickTriangleEvent](qt3drender-qpicktriangleevent#QPickTriangleEvent)**() | | uint | **[triangleIndex](qt3drender-qpicktriangleevent#triangleIndex)**() const | | QVector3D | **[uvw](qt3drender-qpicktriangleevent#uvw)**() const | | uint | **[vertex1Index](qt3drender-qpicktriangleevent#vertex1Index)**() const | | uint | **[vertex2Index](qt3drender-qpicktriangleevent#vertex2Index)**() const | | uint | **[vertex3Index](qt3drender-qpicktriangleevent#vertex3Index)**() const | Detailed Description -------------------- When QPickingSettings::pickMode() is set to [QPickingSettings::TrianglePicking](qt3drender-qpickingsettings#PickMethod-enum), the signals on [QObjectPicker](qt3drender-qobjectpicker) will carry an instance of QPickTriangleEvent. This contains the details of the triangle that was picked. **Note:** In the case of indexed rendering, the point indices are relative to the array of coordinates, not the array of indices. **See also** [QPickingSettings](qt3drender-qpickingsettings), [QPickEvent](qt3drender-qpickevent), and [QObjectPicker](qt3drender-qobjectpicker). Property Documentation ---------------------- ### `[read-only]` triangleIndex : const [uint](qtglobal#uint-typedef) Specifies the triangle index of the event **Access functions:** | | | | --- | --- | | uint | **[triangleIndex](qt3drender-qpicktriangleevent#triangleIndex)**() const | ### `[read-only]` uvw : const [QVector3D](qvector3d) **Access functions:** | | | | --- | --- | | QVector3D | **[uvw](qt3drender-qpicktriangleevent#uvw)**() const | ### `[read-only]` vertex1Index : const [uint](qtglobal#uint-typedef) Specifies the index of the first vertex in the triangle **Access functions:** | | | | --- | --- | | uint | **[vertex1Index](qt3drender-qpicktriangleevent#vertex1Index)**() const | ### `[read-only]` vertex2Index : const [uint](qtglobal#uint-typedef) Specifies the index of the second vertex in the triangle **Access functions:** | | | | --- | --- | | uint | **[vertex2Index](qt3drender-qpicktriangleevent#vertex2Index)**() const | ### `[read-only]` vertex3Index : const [uint](qtglobal#uint-typedef) Specifies the index of the third vertex in the triangle **Access functions:** | | | | --- | --- | | uint | **[vertex3Index](qt3drender-qpicktriangleevent#vertex3Index)**() const | Member Function Documentation ----------------------------- ### QPickTriangleEvent::QPickTriangleEvent(const [QPointF](qpointf) &*position*, const [QVector3D](qvector3d) &*worldIntersection*, const [QVector3D](qvector3d) &*localIntersection*, float *distance*, [uint](qtglobal#uint-typedef) *triangleIndex*, [uint](qtglobal#uint-typedef) *vertex1Index*, [uint](qtglobal#uint-typedef) *vertex2Index*, [uint](qtglobal#uint-typedef) *vertex3Index*) \* [QPickTriangleEvent::QPickTriangleEvent](qt3drender-qpicktriangleevent) Constructs a new [QPickEvent](qt3drender-qpickevent) with the given parameters \* *position*, \* *worldIntersection*, \* *localIntersection*, \* *distance*, \* *triangleIndex*, \* *vertex1Index*, \* *vertex2Index* and \* *vertex3Index* ### QPickTriangleEvent::QPickTriangleEvent() Constructs a new [QPickEvent](qt3drender-qpickevent). ### [uint](qtglobal#uint-typedef) QPickTriangleEvent::triangleIndex() const QPickTriangleEvent::triangleIndex Returns the index of the picked triangle **Note:** Getter function for property triangleIndex. ### [QVector3D](qvector3d) QPickTriangleEvent::uvw() const Returns the 3D coordinates u,v, and w. **Note:** Getter function for property uvw. ### [uint](qtglobal#uint-typedef) QPickTriangleEvent::vertex1Index() const QPickTriangleEvent::vertex1Index Returns the index of the first point of the picked triangle **Note:** Getter function for property vertex1Index. ### [uint](qtglobal#uint-typedef) QPickTriangleEvent::vertex2Index() const QPickTriangleEvent::vertex2Index Returns the index of the second point of the picked triangle **Note:** Getter function for property vertex2Index. ### [uint](qtglobal#uint-typedef) QPickTriangleEvent::vertex3Index() const QPickTriangleEvent::vertex3Index Returns index of third point of picked triangle **Note:** Getter function for property vertex3Index. qt ModelParticle3D QML Type ModelParticle3D QML Type ======================== Particle using a Qt Quick 3D Model. [More...](#details) | | | | --- | --- | | Import Statement: | import QtQuick3D.Particles3D | | Since: | Qt 6.2 | | Inherits: | [Particle3D](qml-qtquick3d-particles3d-particle3d) | * [List of all members, including inherited members](https://doc.qt.io/qt-6.2/qml-qtquick3d-particles3d-modelparticle3d-members.html) Properties ---------- * **[delegate](qml-qtquick3d-particles3d-modelparticle3d#delegate-prop)** : Component * **[instanceTable](qml-qtquick3d-particles3d-modelparticle3d#instanceTable-prop)** : Instancing Detailed Description -------------------- The ModelParticle3D is a logical particle element that creates particles from a Qt Quick 3D [Model](qml-qtquick3d-model) component. Property Documentation ---------------------- ### delegate : [Component](qml-qtqml-component) The delegate provides a template defining each object instantiated by the particle. For example, to allocate 200 red cube particles: ``` Component { id: particleComponent Model { source: "#Cube" scale: Qt.vector3d(0.2, 0.2, 0.2) materials: DefaultMaterial { } } } ModelParticle3D { id: particleRed delegate: particleComponent maxAmount: 200 color: "#ff0000" } ``` ### instanceTable : [Instancing](qml-qtquick3d-instancing) The instanceTable provides access to the [Instancing](qml-qtquick3d-custommaterial#instancing) table of the model particle. [ModelParticle3D](qml-qtquick3d-particles3d-modelparticle3d) uses an internal instance table to implement efficient rendering. This table can be applied to the [instancing](qml-qtquick3d-model#instancing-prop) property of models that are not part of the particle system. It is also possible to use this feature to provide an instancing table without showing any particles. This is done by omitting the [delegate](qml-qtquick3d-particles3d-modelparticle3d#delegate-prop) property. For example: ``` ParticleSystem3D { id: psystem ModelParticle3D { id: particleRed maxAmount: 200 color: "#ff0000" colorVariation: Qt.vector4d(0.5,0.5,0.5,0.5) } ParticleEmitter3D { particle: particleRed velocity: VectorDirection3D { direction: Qt.vector3d(-20, 200, 0) directionVariation: Qt.vector3d(20, 20, 20) } particleScale: 0.2 emitRate: 20 lifeSpan: 2000 } } Model { source: "#Sphere" instancing: particleRed.instanceTable materials: PrincipledMaterial { baseColor: "yellow" } } ``` qt QAccessibleStateChangeEvent Class QAccessibleStateChangeEvent Class ================================= The QAccessibleStateChangeEvent notfies the accessibility framework that the state of an object has changed. [More...](#details) | | | | --- | --- | | Header: | #include <QAccessibleStateChangeEvent> | | CMake: | find\_package(Qt6 COMPONENTS Gui REQUIRED) target\_link\_libraries(mytarget PRIVATE Qt6::Gui) | | qmake: | QT += gui | | Inherits: | [QAccessibleEvent](qaccessibleevent) | * [List of all members, including inherited members](https://doc.qt.io/qt-6.2/qaccessiblestatechangeevent-members.html) Public Functions ---------------- | | | | --- | --- | | | **[QAccessibleStateChangeEvent](qaccessiblestatechangeevent#QAccessibleStateChangeEvent-1)**(QAccessibleInterface \**iface*, QAccessible::State *state*) | | | **[QAccessibleStateChangeEvent](qaccessiblestatechangeevent#QAccessibleStateChangeEvent)**(QObject \**object*, QAccessible::State *state*) | | QAccessible::State | **[changedStates](qaccessiblestatechangeevent#changedStates)**() const | Detailed Description -------------------- This class is used with [QAccessible::updateAccessibility](qaccessible#updateAccessibility)(). **See also** [QAccessibleInterface::state](qaccessibleinterface#state)(). Member Function Documentation ----------------------------- ### QAccessibleStateChangeEvent::QAccessibleStateChangeEvent([QAccessibleInterface](qaccessibleinterface) \**iface*, [QAccessible::State](qaccessible-state) *state*) Constructs a new QAccessibleStateChangeEvent. *iface* is the interface associated with the event *state* is the state of the accessible object. ### QAccessibleStateChangeEvent::QAccessibleStateChangeEvent([QObject](qobject) \**object*, [QAccessible::State](qaccessible-state) *state*) Constructs a new QAccessibleStateChangeEvent for *object*. The difference to the object's previous state is in *state*. ### [QAccessible::State](qaccessible-state) QAccessibleStateChangeEvent::changedStates() const Returns the states that have been changed. Keep in mind that the returned states are the ones that have changed. To find out about the state of an object, use [QAccessibleInterface::state](qaccessibleinterface#state)(). For example, if an object used to have the focus but loses it, the object's state will have focused set to `false`. This event on the other hand tells about the change and has focused set to `true` since the focus state is changed from `true` to `false`. qt QSGNode Class QSGNode Class ============= The QSGNode class is the base class for all nodes in the scene graph. [More...](#details) | | | | --- | --- | | Header: | #include <QSGNode> | | CMake: | find\_package(Qt6 COMPONENTS Quick REQUIRED) target\_link\_libraries(mytarget PRIVATE Qt6::Quick) | | qmake: | QT += quick | | Inherited By: | [QSGBasicGeometryNode](qsgbasicgeometrynode), [QSGOpacityNode](qsgopacitynode), [QSGRenderNode](qsgrendernode), and [QSGTransformNode](qsgtransformnode) | * [List of all members, including inherited members](https://doc.qt.io/qt-6.2/qsgnode-members.html) Public Types ------------ | | | | --- | --- | | flags | **[DirtyState](qsgnode#DirtyStateBit-enum)** | | enum | **[DirtyStateBit](qsgnode#DirtyStateBit-enum)** { DirtyMatrix, DirtyNodeAdded, DirtyNodeRemoved, DirtyGeometry, DirtyMaterial, …, DirtySubtreeBlocked } | | enum | **[Flag](qsgnode#Flag-enum)** { OwnedByParent, UsePreprocess, OwnsGeometry, OwnsMaterial, OwnsOpaqueMaterial, InternalReserved } | | flags | **[Flags](qsgnode#Flag-enum)** | | enum | **[NodeType](qsgnode#NodeType-enum)** { BasicNodeType, GeometryNodeType, TransformNodeType, ClipNodeType, OpacityNodeType, RenderNodeType } | Public Functions ---------------- | | | | --- | --- | | | **[QSGNode](qsgnode#QSGNode)**() | | virtual | **[~QSGNode](qsgnode#dtor.QSGNode)**() | | void | **[appendChildNode](qsgnode#appendChildNode)**(QSGNode \**node*) | | QSGNode \* | **[childAtIndex](qsgnode#childAtIndex)**(int *i*) const | | int | **[childCount](qsgnode#childCount)**() const | | QSGNode \* | **[firstChild](qsgnode#firstChild)**() const | | QSGNode::Flags | **[flags](qsgnode#flags)**() const | | void | **[insertChildNodeAfter](qsgnode#insertChildNodeAfter)**(QSGNode \**node*, QSGNode \**after*) | | void | **[insertChildNodeBefore](qsgnode#insertChildNodeBefore)**(QSGNode \**node*, QSGNode \**before*) | | virtual bool | **[isSubtreeBlocked](qsgnode#isSubtreeBlocked)**() const | | QSGNode \* | **[lastChild](qsgnode#lastChild)**() const | | void | **[markDirty](qsgnode#markDirty)**(QSGNode::DirtyState *bits*) | | QSGNode \* | **[nextSibling](qsgnode#nextSibling)**() const | | QSGNode \* | **[parent](qsgnode#parent)**() const | | void | **[prependChildNode](qsgnode#prependChildNode)**(QSGNode \**node*) | | virtual void | **[preprocess](qsgnode#preprocess)**() | | QSGNode \* | **[previousSibling](qsgnode#previousSibling)**() const | | void | **[removeAllChildNodes](qsgnode#removeAllChildNodes)**() | | void | **[removeChildNode](qsgnode#removeChildNode)**(QSGNode \**node*) | | void | **[setFlag](qsgnode#setFlag)**(QSGNode::Flag *f*, bool *enabled* = true) | | void | **[setFlags](qsgnode#setFlags)**(QSGNode::Flags *f*, bool *enabled* = true) | | QSGNode::NodeType | **[type](qsgnode#type)**() const | Detailed Description -------------------- The QSGNode class can be used as a child container. Children are added with the [appendChildNode](qsgnode#appendChildNode)(), [prependChildNode](qsgnode#prependChildNode)(), [insertChildNodeBefore](qsgnode#insertChildNodeBefore)() and [insertChildNodeAfter](qsgnode#insertChildNodeAfter)(). The order of nodes is important as geometry nodes are rendered according to their ordering in the scene graph. The scene graph nodes contains a mechanism to describe which parts of the scene has changed. This includes the combined matrices, accumulated opacity, changes to the node hierarchy, and so on. This information can be used for optimizations inside the scene graph renderer. For the renderer to properly render the nodes, it is important that users call [QSGNode::markDirty](qsgnode#markDirty)() with the correct flags when nodes are changed. Most of the functions on the node classes will implicitly call [markDirty](qsgnode#markDirty)(). For example, [QSGNode::appendChildNode](qsgnode#appendChildNode)() will call [markDirty](qsgnode#markDirty)() passing in [QSGNode::DirtyNodeAdded](qsgnode#DirtyStateBit-enum). If nodes change every frame, the [preprocess](qsgnode#preprocess)() function can be used to apply changes to a node for every frame it is rendered. The use of [preprocess](qsgnode#preprocess)() must be explicitly enabled by setting the [QSGNode::UsePreprocess](qsgnode#Flag-enum) flag on the node. The virtual [isSubtreeBlocked](qsgnode#isSubtreeBlocked)() function can be used to disable a subtree all together. Nodes in a blocked subtree will not be preprocessed() and not rendered. **Note:** All classes with QSG prefix should be used solely on the scene graph's rendering thread. See [Scene Graph and Rendering](qtquick-visualcanvas-scenegraph#scene-graph-and-rendering) for more information. Member Type Documentation ------------------------- ### enum QSGNode::DirtyStateBitflags QSGNode::DirtyState Used in [QSGNode::markDirty](qsgnode#markDirty)() to indicate how the scene graph has changed. | Constant | Value | Description | | --- | --- | --- | | `QSGNode::DirtyMatrix` | `0x0100` | The matrix in a [QSGTransformNode](qsgtransformnode) has changed. | | `QSGNode::DirtyNodeAdded` | `0x0400` | A node was added. | | `QSGNode::DirtyNodeRemoved` | `0x0800` | A node was removed. | | `QSGNode::DirtyGeometry` | `0x1000` | The geometry of a [QSGGeometryNode](qsggeometrynode) has changed. | | `QSGNode::DirtyMaterial` | `0x2000` | The material of a [QSGGeometryNode](qsggeometrynode) has changed. | | `QSGNode::DirtyOpacity` | `0x4000` | The opacity of a [QSGOpacityNode](qsgopacitynode) has changed. | | `QSGNode::DirtySubtreeBlocked` | `0x0080` | The subtree has been blocked. | The DirtyState type is a typedef for [QFlags](qflags)<DirtyStateBit>. It stores an OR combination of DirtyStateBit values. **See also** [QSGNode::markDirty](qsgnode#markDirty)(). ### enum QSGNode::Flagflags QSGNode::Flags The QSGNode::Flag enum describes flags on the [QSGNode](qsgnode) | Constant | Value | Description | | --- | --- | --- | | `QSGNode::OwnedByParent` | `0x0001` | The node is owned by its parent and will be deleted when the parent is deleted. | | `QSGNode::UsePreprocess` | `0x0002` | The node's virtual [preprocess](qsgnode#preprocess)() function will be called before rendering starts. | | `QSGNode::OwnsGeometry` | `0x00010000` | Only valid for [QSGGeometryNode](qsggeometrynode) and [QSGClipNode](qsgclipnode). The node has ownership over the [QSGGeometry](qsggeometry) instance and will delete it when the node is destroyed or a geometry is assigned. | | `QSGNode::OwnsMaterial` | `0x00020000` | Only valid for [QSGGeometryNode](qsggeometrynode). The node has ownership over the material and will delete it when the node is destroyed or a material is assigned. | | `QSGNode::OwnsOpaqueMaterial` | `0x00040000` | Only valid for [QSGGeometryNode](qsggeometrynode). The node has ownership over the opaque material and will delete it when the node is destroyed or a material is assigned. | | `QSGNode::InternalReserved` | `0x01000000` | Reserved for internal use. | The Flags type is a typedef for [QFlags](qflags)<Flag>. It stores an OR combination of Flag values. ### enum QSGNode::NodeType Can be used to figure out the type of node. | Constant | Value | Description | | --- | --- | --- | | `QSGNode::BasicNodeType` | `0` | The type of [QSGNode](qsgnode) | | `QSGNode::GeometryNodeType` | `1` | The type of [QSGGeometryNode](qsggeometrynode) | | `QSGNode::TransformNodeType` | `2` | The type of [QSGTransformNode](qsgtransformnode) | | `QSGNode::ClipNodeType` | `3` | The type of [QSGClipNode](qsgclipnode) | | `QSGNode::OpacityNodeType` | `4` | The type of [QSGOpacityNode](qsgopacitynode) | | `QSGNode::RenderNodeType` | `6` | The type of [QSGRenderNode](qsgrendernode) | **See also** [type](qsgnode#type)(). Member Function Documentation ----------------------------- ### QSGNode::QSGNode() Constructs a new node ### `[virtual]` QSGNode::~QSGNode() Destroys the node. Every child of this node that has the flag [QSGNode::OwnedByParent](qsgnode#Flag-enum) set, will also be deleted. ### void QSGNode::appendChildNode([QSGNode](qsgnode#QSGNode) \**node*) Appends *node* to this node's list of children. Ordering of nodes is important as geometry nodes will be rendered in the order they are added to the scene graph. ### [QSGNode](qsgnode#QSGNode) \*QSGNode::childAtIndex(int *i*) const Returns the child at index *i*. Children are stored internally as a linked list, so iterating over the children via the index is suboptimal. ### int QSGNode::childCount() const Returns the number of child nodes. ### [QSGNode](qsgnode#QSGNode) \*QSGNode::firstChild() const Returns the first child of this node. The children are stored in a linked list. ### [QSGNode::Flags](qsgnode#Flag-enum) QSGNode::flags() const Returns the set of flags for this node. **See also** [setFlags](qsgnode#setFlags)(). ### void QSGNode::insertChildNodeAfter([QSGNode](qsgnode#QSGNode) \**node*, [QSGNode](qsgnode#QSGNode) \**after*) Inserts *node* to this node's list of children after the node specified with *after*. Ordering of nodes is important as geometry nodes will be rendered in the order they are added to the scene graph. ### void QSGNode::insertChildNodeBefore([QSGNode](qsgnode#QSGNode) \**node*, [QSGNode](qsgnode#QSGNode) \**before*) Inserts *node* to this node's list of children before the node specified with *before*. Ordering of nodes is important as geometry nodes will be rendered in the order they are added to the scene graph. ### `[virtual]` bool QSGNode::isSubtreeBlocked() const Returns whether this node and its subtree is available for use. Blocked subtrees will not get their dirty states updated and they will not be rendered. The [QSGOpacityNode](qsgopacitynode) will return a blocked subtree when accumulated opacity is 0, for instance. ### [QSGNode](qsgnode#QSGNode) \*QSGNode::lastChild() const Returns the last child of this node. The children are stored as a linked list. ### void QSGNode::markDirty([QSGNode::DirtyState](qsgnode#DirtyStateBit-enum) *bits*) Notifies all connected renderers that the node has dirty *bits*. ### [QSGNode](qsgnode#QSGNode) \*QSGNode::nextSibling() const Returns the node after this in the parent's list of children. The children are stored as a linked list. ### [QSGNode](qsgnode#QSGNode) \*QSGNode::parent() const Returns the parent node of this node. ### void QSGNode::prependChildNode([QSGNode](qsgnode#QSGNode) \**node*) Prepends *node* to this node's the list of children. Ordering of nodes is important as geometry nodes will be rendered in the order they are added to the scene graph. ### `[virtual]` void QSGNode::preprocess() Override this function to do processing on the node before it is rendered. Preprocessing needs to be explicitly enabled by setting the flag [QSGNode::UsePreprocess](qsgnode#Flag-enum). The flag needs to be set before the node is added to the scene graph and will cause the preprocess() function to be called for every frame the node is rendered. **Warning:** Beware of deleting nodes while they are being preprocessed. It is possible, with a small performance hit, to delete a single node during its own preprocess call. Deleting a subtree which has nodes that also use preprocessing may result in a segmentation fault. This is done for performance reasons. ### [QSGNode](qsgnode#QSGNode) \*QSGNode::previousSibling() const Returns the node before this in the parent's list of children. The children are stored as a linked list. ### void QSGNode::removeAllChildNodes() Removes all child nodes from this node's list of children. ### void QSGNode::removeChildNode([QSGNode](qsgnode#QSGNode) \**node*) Removes *node* from this node's list of children. ### void QSGNode::setFlag([QSGNode::Flag](qsgnode#Flag-enum) *f*, bool *enabled* = true) Sets the flag *f* on this node if *enabled* is true; otherwise clears the flag. **See also** [flags](qsgnode#flags)(). ### void QSGNode::setFlags([QSGNode::Flags](qsgnode#Flag-enum) *f*, bool *enabled* = true) Sets the flags *f* on this node if *enabled* is true; otherwise clears the flags. **See also** [flags](qsgnode#flags)(). ### [QSGNode::NodeType](qsgnode#NodeType-enum) QSGNode::type() const Returns the type of this node. The node type must be one of the predefined types defined in [QSGNode::NodeType](qsgnode#NodeType-enum) and can safely be used to cast to the corresponding class.
programming_docs
qt QMetaClassInfo Class QMetaClassInfo Class ==================== The QMetaClassInfo class provides additional information about a class. [More...](#details) | | | | --- | --- | | Header: | #include <QMetaClassInfo> | | CMake: | find\_package(Qt6 COMPONENTS Core REQUIRED) target\_link\_libraries(mytarget PRIVATE Qt6::Core) | | qmake: | QT += core | * [List of all members, including inherited members](https://doc.qt.io/qt-6.2/qmetaclassinfo-members.html) Public Functions ---------------- | | | | --- | --- | | const char \* | **[name](qmetaclassinfo#name)**() const | | const char \* | **[value](qmetaclassinfo#value)**() const | Detailed Description -------------------- Class information items are simple *name*--*value* pairs that are specified using [Q\_CLASSINFO](qobject#Q_CLASSINFO)() in the source code. The information can be retrieved using [name](qmetaclassinfo#name)() and [value](qmetaclassinfo#value)(). For example: ``` class MyClass { Q_OBJECT Q_CLASSINFO("author", "Sabrina Schweinsteiger") Q_CLASSINFO("url", "http://doc.moosesoft.co.uk/1.0/") public: ... }; ``` This mechanism is free for you to use in your Qt applications. Qt doesn't use it for any of its classes. **See also** [QMetaObject](qmetaobject). Member Function Documentation ----------------------------- ### const char \*QMetaClassInfo::name() const Returns the name of this item. **See also** [value](qmetaclassinfo#value)(). ### const char \*QMetaClassInfo::value() const Returns the value of this item. **See also** [name](qmetaclassinfo#name)(). qt QBluetoothServiceInfo Class QBluetoothServiceInfo Class =========================== The QBluetoothServiceInfo class enables access to the attributes of a Bluetooth service. [More...](#details) | | | | --- | --- | | Header: | #include <QBluetoothServiceInfo> | | qmake: | QT += bluetooth | | Since: | Qt 5.2 | * [List of all members, including inherited members](https://doc.qt.io/qt-6.2/qbluetoothserviceinfo-members.html) Public Types ------------ | | | | --- | --- | | class | **[Alternative](qbluetoothserviceinfo-alternative)** | | class | **[Sequence](qbluetoothserviceinfo-sequence)** | | enum | **[AttributeId](qbluetoothserviceinfo#AttributeId-enum)** { ServiceRecordHandle, ServiceClassIds, ServiceRecordState, ServiceId, ProtocolDescriptorList, …, ServiceProvider } | | enum | **[Protocol](qbluetoothserviceinfo#Protocol-enum)** { UnknownProtocol, L2capProtocol, RfcommProtocol } | Public Functions ---------------- | | | | --- | --- | | | **[QBluetoothServiceInfo](qbluetoothserviceinfo#QBluetoothServiceInfo-1)**(const QBluetoothServiceInfo &*other*) | | | **[QBluetoothServiceInfo](qbluetoothserviceinfo#QBluetoothServiceInfo)**() | | QBluetoothServiceInfo & | **[operator=](qbluetoothserviceinfo#operator-eq)**(const QBluetoothServiceInfo &*other*) | | | **[~QBluetoothServiceInfo](qbluetoothserviceinfo#dtor.QBluetoothServiceInfo)**() | | QVariant | **[attribute](qbluetoothserviceinfo#attribute)**(quint16 *attributeId*) const | | QList<quint16> | **[attributes](qbluetoothserviceinfo#attributes)**() const | | bool | **[contains](qbluetoothserviceinfo#contains)**(quint16 *attributeId*) const | | QBluetoothDeviceInfo | **[device](qbluetoothserviceinfo#device)**() const | | bool | **[isComplete](qbluetoothserviceinfo#isComplete)**() const | | bool | **[isRegistered](qbluetoothserviceinfo#isRegistered)**() const | | bool | **[isValid](qbluetoothserviceinfo#isValid)**() const | | QBluetoothServiceInfo::Sequence | **[protocolDescriptor](qbluetoothserviceinfo#protocolDescriptor)**(QBluetoothUuid::ProtocolUuid *protocol*) const | | int | **[protocolServiceMultiplexer](qbluetoothserviceinfo#protocolServiceMultiplexer)**() const | | bool | **[registerService](qbluetoothserviceinfo#registerService)**(const QBluetoothAddress &*localAdapter* = QBluetoothAddress()) | | void | **[removeAttribute](qbluetoothserviceinfo#removeAttribute)**(quint16 *attributeId*) | | int | **[serverChannel](qbluetoothserviceinfo#serverChannel)**() const | | quint8 | **[serviceAvailability](qbluetoothserviceinfo#serviceAvailability)**() const | | QList<QBluetoothUuid> | **[serviceClassUuids](qbluetoothserviceinfo#serviceClassUuids)**() const | | QString | **[serviceDescription](qbluetoothserviceinfo#serviceDescription)**() const | | QString | **[serviceName](qbluetoothserviceinfo#serviceName)**() const | | QString | **[serviceProvider](qbluetoothserviceinfo#serviceProvider)**() const | | QBluetoothUuid | **[serviceUuid](qbluetoothserviceinfo#serviceUuid)**() const | | void | **[setAttribute](qbluetoothserviceinfo#setAttribute)**(quint16 *attributeId*, const QVariant &*value*) | | void | **[setAttribute](qbluetoothserviceinfo#setAttribute-1)**(quint16 *attributeId*, const QBluetoothUuid &*value*) | | void | **[setAttribute](qbluetoothserviceinfo#setAttribute-2)**(quint16 *attributeId*, const QBluetoothServiceInfo::Sequence &*value*) | | void | **[setAttribute](qbluetoothserviceinfo#setAttribute-3)**(quint16 *attributeId*, const QBluetoothServiceInfo::Alternative &*value*) | | void | **[setDevice](qbluetoothserviceinfo#setDevice)**(const QBluetoothDeviceInfo &*device*) | | void | **[setServiceAvailability](qbluetoothserviceinfo#setServiceAvailability)**(quint8 *availability*) | | void | **[setServiceDescription](qbluetoothserviceinfo#setServiceDescription)**(const QString &*description*) | | void | **[setServiceName](qbluetoothserviceinfo#setServiceName)**(const QString &*name*) | | void | **[setServiceProvider](qbluetoothserviceinfo#setServiceProvider)**(const QString &*provider*) | | void | **[setServiceUuid](qbluetoothserviceinfo#setServiceUuid)**(const QBluetoothUuid &*uuid*) | | QBluetoothServiceInfo::Protocol | **[socketProtocol](qbluetoothserviceinfo#socketProtocol)**() const | | bool | **[unregisterService](qbluetoothserviceinfo#unregisterService)**() | Detailed Description -------------------- QBluetoothServiceInfo provides information about a service offered by a Bluetooth device. In addition it can be used to register new services on the local device. Note that such a registration only affects the Bluetooth SDP entries. Any server listening for incoming connections (e.g an RFCOMM server) must be started before [registerService](qbluetoothserviceinfo#registerService)() is called. Deregistration must happen in the reverse order. QBluetoothServiceInfo is not a value type in the traditional sense. All copies of the same service info object share the same data as they do not detach upon changing them. This ensures that two copies can (de)register the same Bluetooth service. On iOS, this class cannot be used because the platform does not expose an API which may permit access to QBluetoothServiceInfo related features. Member Type Documentation ------------------------- ### enum QBluetoothServiceInfo::AttributeId Bluetooth service attributes. Please check the Bluetooth Core Specification for a more detailed description of these attributes. | Constant | Value | Description | | --- | --- | --- | | `QBluetoothServiceInfo::ServiceRecordHandle` | `0x0000` | Specifies a service record from which attributes can be retrieved. | | `QBluetoothServiceInfo::ServiceClassIds` | `0x0001` | UUIDs of service classes that the service conforms to. The most common service classes are defined in ([QBluetoothUuid::ServiceClassUuid](qbluetoothuuid#ServiceClassUuid-enum)) | | `QBluetoothServiceInfo::ServiceRecordState` | `0x0002` | Attibute changes when any other service attribute is added, deleted or modified. | | `QBluetoothServiceInfo::ServiceId` | `0x0003` | UUID that uniquely identifies the service. | | `QBluetoothServiceInfo::ProtocolDescriptorList` | `0x0004` | List of protocols used by the service. The most common protocol Uuids are defined in [QBluetoothUuid::ProtocolUuid](qbluetoothuuid#ProtocolUuid-enum) | | `QBluetoothServiceInfo::BrowseGroupList` | `0x0005` | List of browse groups the service is in. | | `QBluetoothServiceInfo::LanguageBaseAttributeIdList` | `0x0006` | List of language base attribute IDs to support human-readable attributes. | | `QBluetoothServiceInfo::ServiceInfoTimeToLive` | `0x0007` | Number of seconds for which the service record is expected to remain valid and unchanged. | | `QBluetoothServiceInfo::ServiceAvailability` | `0x0008` | Value indicating the availability of the service. | | `QBluetoothServiceInfo::BluetoothProfileDescriptorList` | `0x0009` | List of profiles to which the service conforms. | | `QBluetoothServiceInfo::DocumentationUrl` | `0x000A` | URL that points to the documentation on the service.. | | `QBluetoothServiceInfo::ClientExecutableUrl` | `0x000B` | URL that refers to the location of an application that can be used to utilize the service. | | `QBluetoothServiceInfo::IconUrl` | `0x000C` | URL to the location of the icon representing the service. | | `QBluetoothServiceInfo::AdditionalProtocolDescriptorList` | `0x000D` | Additional protocols used by the service. This attribute extends `ProtocolDescriptorList`. | | `QBluetoothServiceInfo::PrimaryLanguageBase` | `0x0100` | Base index for primary language text descriptors. | | `QBluetoothServiceInfo::ServiceName` | `PrimaryLanguageBase + 0x0000` | Name of the Bluetooth service in the primary language. | | `QBluetoothServiceInfo::ServiceDescription` | `PrimaryLanguageBase + 0x0001` | Description of the Bluetooth service in the primary language. | | `QBluetoothServiceInfo::ServiceProvider` | `PrimaryLanguageBase + 0x0002` | Name of the company / entity that provides the Bluetooth service primary language. | **Note:** On Windows ServiceClassIds and ProtocolDescriptorList are automatically set to default values when a service is created. Manually setting values for these attributes will not work and might lead to unexpected results on this platform. ### enum QBluetoothServiceInfo::Protocol This enum describes the socket protocol used by the service. | Constant | Value | Description | | --- | --- | --- | | `QBluetoothServiceInfo::UnknownProtocol` | `0` | The service uses an unknown socket protocol. | | `QBluetoothServiceInfo::L2capProtocol` | `1` | The service uses the L2CAP socket protocol. This protocol is not supported for direct socket connections on Android. | | `QBluetoothServiceInfo::RfcommProtocol` | `2` | The service uses the RFCOMM socket protocol. | Member Function Documentation ----------------------------- ### QBluetoothServiceInfo::QBluetoothServiceInfo(const [QBluetoothServiceInfo](qbluetoothserviceinfo#QBluetoothServiceInfo) &*other*) Construct a new QBluetoothServiceInfo that is a copy of *other*. The two copies continue to share the same underlying data which does not detach upon write. ### QBluetoothServiceInfo::QBluetoothServiceInfo() Construct a new invalid QBluetoothServiceInfo; ### [QBluetoothServiceInfo](qbluetoothserviceinfo#QBluetoothServiceInfo) &QBluetoothServiceInfo::operator=(const [QBluetoothServiceInfo](qbluetoothserviceinfo#QBluetoothServiceInfo) &*other*) Makes a copy of the *other* and assigns it to this [QBluetoothServiceInfo](qbluetoothserviceinfo) object. The two copies continue to share the same service and registration details. ### QBluetoothServiceInfo::~QBluetoothServiceInfo() Destroys the [QBluetoothServiceInfo](qbluetoothserviceinfo) object. ### [QVariant](qvariant) QBluetoothServiceInfo::attribute([quint16](qtglobal#quint16-typedef) *attributeId*) const Returns the value of the attribute *attributeId*. **See also** [setAttribute](qbluetoothserviceinfo#setAttribute)(). ### [QList](qlist)<[quint16](qtglobal#quint16-typedef)> QBluetoothServiceInfo::attributes() const Returns a list of all attribute ids that the [QBluetoothServiceInfo](qbluetoothserviceinfo) object has. ### bool QBluetoothServiceInfo::contains([quint16](qtglobal#quint16-typedef) *attributeId*) const Returns true if the [QBluetoothServiceInfo](qbluetoothserviceinfo) object contains the attribute *attributeId*, otherwise returns false. ### [QBluetoothDeviceInfo](qbluetoothdeviceinfo) QBluetoothServiceInfo::device() const Returns the address of the Bluetooth device that provides this service. **See also** [setDevice](qbluetoothserviceinfo#setDevice)(). ### bool QBluetoothServiceInfo::isComplete() const Returns true if the [QBluetoothServiceInfo](qbluetoothserviceinfo) object is considered complete, otherwise returns false. A complete [QBluetoothServiceInfo](qbluetoothserviceinfo) object contains a [ProtocolDescriptorList](qbluetoothserviceinfo#AttributeId-enum) attribute. ### bool QBluetoothServiceInfo::isRegistered() const Returns true if the service information is registered with the platform's Service Discovery Protocol (SDP) implementation, otherwise returns false. ### bool QBluetoothServiceInfo::isValid() const Returns true if the [QBluetoothServiceInfo](qbluetoothserviceinfo) object is valid, otherwise returns false. An invalid [QBluetoothServiceInfo](qbluetoothserviceinfo) object will have no attributes. ### [QBluetoothServiceInfo::Sequence](qbluetoothserviceinfo-sequence) QBluetoothServiceInfo::protocolDescriptor([QBluetoothUuid::ProtocolUuid](qbluetoothuuid#ProtocolUuid-enum) *protocol*) const Returns the protocol parameters as a [QBluetoothServiceInfo::Sequence](qbluetoothserviceinfo-sequence) for protocol *protocol*. An empty [QBluetoothServiceInfo::Sequence](qbluetoothserviceinfo-sequence) is returned if *protocol* is not supported. ### int QBluetoothServiceInfo::protocolServiceMultiplexer() const This is a convenience function. Returns the protocol/service multiplexer for services which support the L2CAP protocol, otherwise returns -1. This function is equivalent to extracting the information from [QBluetoothServiceInfo::Sequence](qbluetoothserviceinfo-sequence) returned by [QBluetoothServiceInfo::attribute](qbluetoothserviceinfo#attribute)([QBluetoothServiceInfo::ProtocolDescriptorList](qbluetoothserviceinfo#AttributeId-enum)). ### bool QBluetoothServiceInfo::registerService(const [QBluetoothAddress](qbluetoothaddress) &*localAdapter* = QBluetoothAddress()) Registers this service with the platform's Service Discovery Protocol (SDP) implementation, making it findable by other devices when they perform service discovery. Returns true if the service is successfully registered, otherwise returns false. Once registered changes to the record cannot be made. The service must be unregistered and registered again with the changes. The *localAdapter* parameter determines the local Bluetooth adapter under which the service should be registered. If *localAdapter* is `null` the default Bluetooth adapter will be used. If this service info object is already registered via a local adapter and this is function is called using a different local adapter, the previous registration is removed and the service reregistered using the new adapter. ### void QBluetoothServiceInfo::removeAttribute([quint16](qtglobal#quint16-typedef) *attributeId*) Removes the attribute *attributeId* from the [QBluetoothServiceInfo](qbluetoothserviceinfo) object. If the service information is already registered with the platforms SDP database, the database entry will not be updated until [registerService](qbluetoothserviceinfo#registerService)() was called again. ### int QBluetoothServiceInfo::serverChannel() const This is a convenience function. Returns the server channel for services which support the RFCOMM protocol, otherwise returns -1. This function is equivalent to extracting the information from [QBluetoothServiceInfo::Sequence](qbluetoothserviceinfo-sequence) returned by [QBluetoothServiceInfo::attribute](qbluetoothserviceinfo#attribute)(QBluetootherServiceInfo::ProtocolDescriptorList). ### [quint8](qtglobal#quint8-typedef) QBluetoothServiceInfo::serviceAvailability() const This is a convenience function. It is equivalent to calling attribute([QBluetoothServiceInfo::ServiceAvailability](qbluetoothserviceinfo#AttributeId-enum)).toUInt(). Returns the availability of the service. **See also** [setServiceAvailability](qbluetoothserviceinfo#setServiceAvailability)() and [attribute](qbluetoothserviceinfo#attribute)(). ### [QList](qlist)<[QBluetoothUuid](qbluetoothuuid)> QBluetoothServiceInfo::serviceClassUuids() const Returns a list of UUIDs describing the service classes that this service conforms to. This is a convenience function. It is equivalent to calling attribute([QBluetoothServiceInfo::ServiceClassIds](qbluetoothserviceinfo#AttributeId-enum)).value<[QBluetoothServiceInfo::Sequence](qbluetoothserviceinfo-sequence)>() and subsequently iterating over its [QBluetoothUuid](qbluetoothuuid) entries. **See also** [attribute](qbluetoothserviceinfo#attribute)(). ### [QString](qstring) QBluetoothServiceInfo::serviceDescription() const This is a convenience function. It is equivalent to calling attribute([QBluetoothServiceInfo::ServiceDescription](qbluetoothserviceinfo#AttributeId-enum)).toString(). Returns the service description in the primary language. **See also** [setServiceDescription](qbluetoothserviceinfo#setServiceDescription)() and [attribute](qbluetoothserviceinfo#attribute)(). ### [QString](qstring) QBluetoothServiceInfo::serviceName() const This is a convenience function. It is equivalent to calling attribute([QBluetoothServiceInfo::ServiceName](qbluetoothserviceinfo#AttributeId-enum)).toString(). Returns the service name in the primary language. **See also** [setServiceName](qbluetoothserviceinfo#setServiceName)() and [attribute](qbluetoothserviceinfo#attribute)(). ### [QString](qstring) QBluetoothServiceInfo::serviceProvider() const This is a convenience function. It is equivalent to calling attribute([QBluetoothServiceInfo::ServiceProvider](qbluetoothserviceinfo#AttributeId-enum)).toString(). Returns the service provider in the primary language. **See also** [setServiceProvider](qbluetoothserviceinfo#setServiceProvider)() and [attribute](qbluetoothserviceinfo#attribute)(). ### [QBluetoothUuid](qbluetoothuuid) QBluetoothServiceInfo::serviceUuid() const This is a convenience function. It is equivalent to calling attribute([QBluetoothServiceInfo::ServiceId](qbluetoothserviceinfo#AttributeId-enum)).value<[QBluetoothUuid](qbluetoothuuid)>(). Returns the custom UUID of the service. This UUID may be null. UUIDs based on [Bluetooth SIG standards](https://bluetooth.org) should be retrieved via [serviceClassUuids](qbluetoothserviceinfo#serviceClassUuids)(). **See also** [setServiceUuid](qbluetoothserviceinfo#setServiceUuid)() and [attribute](qbluetoothserviceinfo#attribute)(). ### void QBluetoothServiceInfo::setAttribute([quint16](qtglobal#quint16-typedef) *attributeId*, const [QVariant](qvariant) &*value*) Sets the attribute identified by *attributeId* to *value*. If the service information is already registered with the platform's SDP database, the database entry will not be updated until [registerService](qbluetoothserviceinfo#registerService)() was called again. **Note:** If an attribute expectes a byte-encoded value (e.g. Bluetooth HID services), it should be set as [QByteArray](qbytearray). **See also** [attribute](qbluetoothserviceinfo#attribute)(), [isRegistered](qbluetoothserviceinfo#isRegistered)(), and [registerService](qbluetoothserviceinfo#registerService)(). ### void QBluetoothServiceInfo::setAttribute([quint16](qtglobal#quint16-typedef) *attributeId*, const [QBluetoothUuid](qbluetoothuuid) &*value*) This is a convenience function. Sets the attribute identified by *attributeId* to *value*. If the service information is already registered with the platform's SDP database, the database entry will not be updated until [registerService](qbluetoothserviceinfo#registerService)() was called again. ### void QBluetoothServiceInfo::setAttribute([quint16](qtglobal#quint16-typedef) *attributeId*, const [QBluetoothServiceInfo::Sequence](qbluetoothserviceinfo-sequence) &*value*) This is a convenience function. Sets the attribute identified by *attributeId* to *value*. If the service information is already registered with the platform's SDP database, the database entry will not be updated until [registerService](qbluetoothserviceinfo#registerService)() was called again. ### void QBluetoothServiceInfo::setAttribute([quint16](qtglobal#quint16-typedef) *attributeId*, const [QBluetoothServiceInfo::Alternative](qbluetoothserviceinfo-alternative) &*value*) This is a convenience function. Sets the attribute identified by *attributeId* to *value*. If the service information is already registered with the platform's SDP database, the database entry will not be updated until [registerService](qbluetoothserviceinfo#registerService)() was called again. ### void QBluetoothServiceInfo::setDevice(const [QBluetoothDeviceInfo](qbluetoothdeviceinfo) &*device*) Sets the Bluetooth device that provides this service to *device*. **See also** [device](qbluetoothserviceinfo#device)(). ### void QBluetoothServiceInfo::setServiceAvailability([quint8](qtglobal#quint8-typedef) *availability*) This is a convenience function. It is equivalent to calling [setAttribute](qbluetoothserviceinfo#setAttribute)([QBluetoothServiceInfo::ServiceAvailability](qbluetoothserviceinfo#AttributeId-enum), availability). Sets the availabiltiy of the service to *availability*. **See also** [serviceAvailability](qbluetoothserviceinfo#serviceAvailability)() and [setAttribute](qbluetoothserviceinfo#setAttribute)(). ### void QBluetoothServiceInfo::setServiceDescription(const [QString](qstring) &*description*) This is a convenience function. It is equivalent to calling [setAttribute](qbluetoothserviceinfo#setAttribute)([QBluetoothServiceInfo::ServiceDescription](qbluetoothserviceinfo#AttributeId-enum), description). Sets the service description in the primary language to *description*. **See also** [serviceDescription](qbluetoothserviceinfo#serviceDescription)() and [setAttribute](qbluetoothserviceinfo#setAttribute)(). ### void QBluetoothServiceInfo::setServiceName(const [QString](qstring) &*name*) This is a convenience function. It is equivalent to calling [setAttribute](qbluetoothserviceinfo#setAttribute)([QBluetoothServiceInfo::ServiceName](qbluetoothserviceinfo#AttributeId-enum), name). Sets the service name in the primary language to *name*. **See also** [serviceName](qbluetoothserviceinfo#serviceName)() and [setAttribute](qbluetoothserviceinfo#setAttribute)(). ### void QBluetoothServiceInfo::setServiceProvider(const [QString](qstring) &*provider*) This is a convenience function. It is equivalent to calling [setAttribute](qbluetoothserviceinfo#setAttribute)([QBluetoothServiceInfo::ServiceProvider](qbluetoothserviceinfo#AttributeId-enum), provider). Sets the service provider in the primary language to *provider*. **See also** [serviceProvider](qbluetoothserviceinfo#serviceProvider)() and [setAttribute](qbluetoothserviceinfo#setAttribute)(). ### void QBluetoothServiceInfo::setServiceUuid(const [QBluetoothUuid](qbluetoothuuid) &*uuid*) This is a convenience function. It is equivalent to calling [setAttribute](qbluetoothserviceinfo#setAttribute)([QBluetoothServiceInfo::ServiceId](qbluetoothserviceinfo#AttributeId-enum), uuid). Sets the custom service UUID to *uuid*. This function should not be used to set a standardized service UUID. **See also** [serviceUuid](qbluetoothserviceinfo#serviceUuid)() and [setAttribute](qbluetoothserviceinfo#setAttribute)(). ### [QBluetoothServiceInfo::Protocol](qbluetoothserviceinfo#Protocol-enum) QBluetoothServiceInfo::socketProtocol() const Returns the protocol that the [QBluetoothServiceInfo](qbluetoothserviceinfo) object uses. ### bool QBluetoothServiceInfo::unregisterService() Unregisters this service with the platform's Service Discovery Protocol (SDP) implementation. After this, the service will no longer be findable by other devices through service discovery. Returns true if the service is successfully unregistered, otherwise returns false.
programming_docs
qt qt_android_add_apk_target qt\_android\_add\_apk\_target ============================= Defines a build target that runs androiddeployqt to produce an APK. The command is defined in the `Core` component of the `Qt6` package. Load the package with: ``` find_package(Qt6 COMPONENTS Core REQUIRED) ``` **Note:** This command is in technology preview and may change in future releases. **Note:** This command should only be called if targeting the Android platform. Synopsis -------- ``` qt_android_add_apk_target(target) ``` If [versionless commands](https://doc.qt.io/qt-6.2/cmake-qt5-and-qt6-compatibility.html#versionless-commands) are disabled, use `qt6_android_add_apk_target()` instead. It supports the same set of arguments as this command. Description ----------- The `<target>_make_apk` custom target created by this command takes an Android deployment settings file and generates an APK by running `androiddeployqt`. The location of the settings file is taken from the `target`'s `QT_ANDROID_DEPLOYMENT_SETTINGS_FILE` property. This file is typically created by [qt\_android\_generate\_deployment\_settings()](https://doc.qt.io/qt-6.2/qt-android-generate-deployment-settings.html#qt6-android-generate-deployment-settings). The `.apk` file will be generated in an `android-build` subdirectory below the CMake build directory of the `target`. The `<target>_make_apk` target will be automatically added as a dependency of the `apk` build target, which will be created if it doesn't already exist. This can be disabled by setting the `QT_NO_GLOBAL_APK_TARGET` variable to true. Example ------- ``` qt_android_generate_deployment_settings(myapp) qt_android_add_apk_target(myapp) ``` The above commands define the build targets `myapp_make_apk` and `apk`, which can be used to generate just the `myapp` APK or all APKs in the project respectively. **See also** [qt\_android\_generate\_deployment\_settings()](https://doc.qt.io/qt-6.2/qt-android-generate-deployment-settings.html#qt6-android-generate-deployment-settings) and [qt\_finalize\_target()](qt-finalize-target#qt6-finalize-target). qt Imagine Style Imagine Style ============= The Imagine Style is based on configurable image assets. [More...](qtquickcontrols2-imagine#detailed-desc-imagine) | | | | --- | --- | | Import Statement: | import QtQuick.Controls.Imagine 2.12 | | Since: | Qt 5.10 | Attached Properties ------------------- * [**path**](qtquickcontrols2-imagine#imagine-path-attached-prop) : string Detailed Description -------------------- The Imagine style is based on image assets. The style comes with a default set of images, but the images can be easily changed by providing a directory with images using a predefined naming convention. The Imagine style with the default images To run an application with the Imagine style, see [Using Styles in Qt Quick Controls](qtquickcontrols2-styles#using-styles-in-qt-quick-controls). ### File Names The image files are named using the following convention: `<control>-<element>-<states>` The `<control>` and `<element>` sections are mandatory, but the `<states>` section is optional. For example, if a single file named `"button-background.9.png"` is provided for [Button](qml-qtquick-controls2-button), it will be used for every state that `Button` supports. It is up to the developer to decide the set of states that they will provide images for. However, it is recommended to provide images for the most common control states where possible, such as `disabled`, `pressed`, etc. This will ensure that interactive controls visually behave as the end user would expect them to. ### Element Reference The following table lists which elements are supported for each control, along with the possible states for that element, and the file extension that it expects. An element is an image that represents a certain visual part of the control. For example, `Button`'s `"background"` element represents its [background](qml-qtquick-controls2-control#background-prop). | Control | Element | States | Extension | | --- | --- | --- | --- | | [ApplicationWindow](qtquickcontrols-changes-qt6#applicationwindow) | background | active | .9.png (or .png) | | [BusyIndicator](qml-qtquick-controls2-busyindicator) | animation | disabled, running, mirrored, hovered | .webp | | | background | same as above | .webp | | [Button](qml-qtquick-controls2-button) | background | disabled, pressed, checked, checkable, focused, highlighted, flat, mirrored, hovered | .9.png | | [CheckBox](qml-qtquick-controls2-checkbox) | background | disabled, pressed, checked, partially-checked, focused, mirrored, hovered | .9.png (or .png) | | | indicator | same as above | .png | | [CheckDelegate](qml-qtquick-controls2-checkdelegate) | background | disabled, pressed, checked, partially-checked, focused, highlighted, mirrored, hovered | .9.png (or .png) | | | indicator | same as above | .png | | [ComboBox](qtquickcontrols-changes-qt6#combobox) | background | disabled, pressed, editable, open, focused, mirrored, hovered, flat | .9.png (or .png) | | | indicator | same as above | .png | | | popup | same as above | .9.png (or .png) | | [DelayButton](qml-qtquick-controls2-delaybutton) | background | disabled, pressed, checked, checkable, focused, mirrored, hovered | .9.png (or .png) | | | progress | same as above | .9.png (or .png) | | | mask | same as above | .9.png (or .png) | | [Dial](qml-qtquick-controls2-dial) | background | disabled, pressed, focused, mirrored, hovered | .9.png (or .png) | | | handle | same as above | .9.png (or .png) | | [Dialog](qtquickcontrols-changes-qt6#dialog) | background | modal, dim | .9.png (or .png) | | | title | same as above | .9.png (or .png) | | | overlay | modal | .9.png (or .png) | | [DialogButtonBox](qml-qtquick-controls2-dialogbuttonbox) | background | disabled, mirrored | .9.png (or .png) | | [Drawer](qml-qtquick-controls2-drawer) | background | modal, dim, top, left, right, bottom | .9.png (or .png) | | | overlay | modal | .9.png (or .png) | | [Frame](qml-qtquick-controls2-frame) | background | disabled, mirrored | .9.png (or .png) | | [GroupBox](qml-qtquick-controls2-groupbox) | background | disabled, mirrored | .9.png (or .png) | | | title | same as above | .9.png (or .png) | | [ItemDelegate](qml-qtquick-controls2-itemdelegate) | background | disabled, pressed, focused, highlighted, mirrored, hovered | .9.png (or .png) | | [Label](qml-qtquick-controls2-label) | background | disabled, mirrored, hovered | .9.png (or .png) | | [Menu](qtquickcontrols-changes-qt6#menu) | background | modal, dim | .9.png (or .png) | | | overlay | modal | .9.png (or .png) | | [MenuItem](qml-qtquick-controls2-menuitem) | arrow | disabled, pressed, checked, focused, highlighted, mirrored, hovered | .png | | | background | same as above | .9.png (or .png) | | | indicator | same as above | .png | | [MenuSeparator](qml-qtquick-controls2-menuseparator) | background | disabled, mirrored | .9.png (or .png) | | | separator | same as above | .9.png (or .png) | | [Page](qml-qtquick-controls2-page) | background | disabled, mirrored | .9.png (or .png) | | [PageIndicator](qml-qtquick-controls2-pageindicator) | background | disabled, mirrored, hovered | .9.png (or .png) | | | delegate | disabled, pressed, current, mirrored, hovered | .png | | [Pane](qml-qtquick-controls2-pane) | background | disabled, mirrored | .9.png (or .png) | | [Popup](qml-qtquick-controls2-popup) | background | modal, dim | .9.png (or .png) | | | overlay | modal | .9.png (or .png) | | [ProgressBar](qml-qtquick-controls2-progressbar) | animation | disabled, mirrored, hovered | .png | | | background | disabled, indeterminate, mirrored, hovered | .9.png (or .png) | | | mask | same as above | .9.png (or .png) | | | progress | same as above | .9.png (or .png) | | [RadioButton](qml-qtquick-controls2-radiobutton) | background | disabled, pressed, checked, focused, mirrored, hovered | .9.png (or .png) | | | indicator | same as above | .png | | [RadioDelegate](qml-qtquick-controls2-radiodelegate) | background | disabled, pressed, checked, focused, highlighted, mirrored, hovered | .9.png (or .png) | | | indicator | same as above | .png | | [RangeSlider](qml-qtquick-controls2-rangeslider) | background | vertical, horizontal, disabled, focused, mirrored, hovered | .9.png (or .png) | | [RangeSlider](qml-qtquick-controls2-rangeslider) | progress | same as above | .9.png (or .png) | | | handle | first, second, vertical, horizontal, disabled, pressed, focused, mirrored, hovered | .png | | [RoundButton](qml-qtquick-controls2-roundbutton) | background | disabled, pressed, checked, checkable, focused, highlighted, flat, mirrored, hovered | .9.png (or .png) | | [ScrollBar](qml-qtquick-controls2-scrollbar) | background | vertical, horizontal, disabled, interactive, pressed, mirrored, hovered | .9.png (or .png) | | | handle | same as above | .9.png (or .png) | | [ScrollIndicator](qml-qtquick-controls2-scrollindicator) | background | vertical, horizontal, disabled, mirrored, hovered | .9.png (or .png) | | | handle | same as above | .9.png (or .png) | | [ScrollView](qml-qtquick-controls2-scrollview) | background | disabled, mirrored | .9.png (or .png) | | [Slider](qml-qtquick-controls2-slider) | background | vertical, horizontal, disabled, pressed, focused, mirrored, hovered | .9.png (or .png) | | | handle | same as above | .9.png (or .png) | | | progress | same as above | .9.png (or .png) | | [SpinBox](qml-qtquick-controls2-spinbox) | background | disabled, editable, focused, mirrored, hovered | .9.png (or .png) | | | editor | disabled, focused, mirrored, hovered | .9.png (or .png) | | | indicator | up, down, disabled, editable, pressed, focused, mirrored, hovered | .9.png (or .png) | | [StackView](qtquickcontrols-changes-qt6#stackview) | background | disabled, mirrored | .9.png (or .png) | | [SwipeDelegate](qml-qtquick-controls2-swipedelegate) | background | disabled, pressed, focused, highlighted, mirrored, hovered | .9.png (or .png) | | [SwipeView](qml-qtquick-controls2-swipeview) | background | vertical, horizontal, disabled, interactive, focused, mirrored | .9.png (or .png) | | [Switch](qml-qtquick-controls2-switch) | background | disabled, pressed, checked, focused, mirrored, hovered | .9.png (or .png) | | | handle | same as above | .9.png (or .png) | | | indicator | same as above | .9.png (or .png) | | [SwitchDelegate](qml-qtquick-controls2-switchdelegate) | background | disabled, pressed, checked, focused, highlighted, mirrored, hovered | .9.png (or .png) | | | handle | same as above | .9.png (or .png) | | | indicator | same as above | .9.png (or .png) | | [TabBar](qml-qtquick-controls2-tabbar) | background | disabled, header, footer, mirrored | .9.png (or .png) | | [TabButton](qml-qtquick-controls2-tabbutton) | background | disabled, pressed, checked, focused, mirrored, hovered | .9.png (or .png) | | [TextArea](qml-qtquick-controls2-textarea) | background | disabled, focused, mirrored, hovered | .9.png (or .png) | | [TextField](qml-qtquick-controls2-textfield) | background | disabled, focused, mirrored, hovered | .9.png (or .png) | | [ToolBar](qml-qtquick-controls2-toolbar) | background | disabled, header, footer, mirrored | .9.png (or .png) | | [ToolButton](qml-qtquick-controls2-toolbutton) | background | disabled, pressed, checked, checkable, focused, highlighted, flat, mirrored, hovered | .9.png (or .png) | | [ToolSeparator](qml-qtquick-controls2-toolseparator) | background | vertical, horizontal, disabled, mirrored | .9.png (or .png) | | | separator | same as above | .9.png (or .png) | | [ToolTip](qtquickcontrols-changes-qt6#tooltip) | background | | .9.png (or .png) | | [Tumbler](qtquickcontrols-changes-qt6#tumbler) | background | disabled, focused, mirrored, hovered | .9.png (or .png) | ### Asset Examples The following table lists examples of assets (taken from the default Imagine style assets) for all controls. The list is not exhaustive, as not all elements need assets, but it can be used as a guide when creating your own assets. | Control | Element | States | Asset | Notes | | --- | --- | --- | --- | --- | | [ApplicationWindow](qtquickcontrols-changes-qt6#applicationwindow) | background | | | [See footnote](qtquickcontrols2-imagine#sup1) 1 | | | overlay | | | [See footnote](qtquickcontrols2-imagine#sup1) 1 | | | overlay | modal | | [See footnote](qtquickcontrols2-imagine#sup1) 1 | | [Button](qml-qtquick-controls2-button) | background | | | | | | background | disabled | | | | | background | focused | | | | | background | pressed | | | | | background | checked | | | | | background | checked, disabled | | | | | background | checked, focused | | | | | background | checked, hovered | | | | | background | highlighted | | | | | background | highlighted, disabled | | | | | background | highlighted, focused | | | | | background | highlighted, hovered | | | | | background | highlighted, pressed | | | | | background | highlighted, checked | | | | | background | hovered | | | | | background | flat | | | | | background | flat, disabled | | | | | background | flat, hovered | | | | | background | flat, pressed | | | | | background | flat, checked | | | | [CheckBox](qml-qtquick-controls2-checkbox) | indicator | | | | | | indicator | disabled | | | | | indicator | pressed | | | | | indicator | checked | | | | | indicator | checked, pressed | | | | | indicator | checked, hovered | | | | | indicator | checked, focused | | | | | indicator | partially, checked | | | | | indicator | partially, checked, pressed | | | | | indicator | partially, checked, focused | | | | | indicator | partially, checked, hovered | | | | | indicator | focused | | | | | indicator | hovered | | | | [CheckDelegate](qml-qtquick-controls2-checkdelegate) | background | | | | | | background | disabled | | | | | background | pressed | | | | | background | focused | | | | | background | hovered | | | | | indicator | | | | | | indicator | disabled | | | | | indicator | pressed | | | | | indicator | checked | | | | | indicator | checked, pressed | | | | | indicator | checked, focused | | | | | indicator | checked, hovered | | | | | indicator | focused | | | | | indicator | hovered | | | | | indicator | partially, checked | | | | | indicator | partially, checked, pressed | | | | | indicator | partially, checked, focused | | | | | indicator | partially, checked, hovered | | | | | indicator | hovered | | | | [ComboBox](qtquickcontrols-changes-qt6#combobox) | background | | | | | | background | disabled | | | | | background | focused | | | | | background | hovered | | | | | background | pressed | | | | | background | open | | | | | background | editable | | | | | background | editable, focused | | | | | background | editable, disabled | | | | | indicator | | | | | | indicator | disabled | | | | | indicator | editable | | | | | indicator | editable, disabled | | | | | indicator | editable, mirrored | | | | | indicator | editable, mirrored, disabled | | | | | popup | | | | | [DelayButton](qml-qtquick-controls2-delaybutton) | background | | | | | | background | disabled | | | | | background | disabled, checked | | | | | background | focused | | | | | background | pressed | | | | | background | checked | | | | | background | checked, focused | | | | | background | checked, hovered | | | | | background | hovered | | | | | progress | | | | | | progress | disabled | | | | | mask | | | | | [Dial](qml-qtquick-controls2-dial) | background | | | | | | background | disabled | | | | | background | focused | | | | | handle | | | | | | handle | disabled | | | | | handle | focused | | | | | handle | focused, pressed | | | | | handle | focused, hovered | | | | | handle | pressed | | | | | handle | hovered | | | | [Dialog](qtquickcontrols-changes-qt6#dialog) | background | | | | | | overlay | | | [See footnote](qtquickcontrols2-imagine#sup1) 1 | | | overlay | modal | | [See footnote](qtquickcontrols2-imagine#sup1) 1 | | [DialogButtonBox](qml-qtquick-controls2-dialogbuttonbox) | background | | | | | [Drawer](qml-qtquick-controls2-drawer) | background | left | | | | | background | right | | | | | background | top | | | | | background | bottom | | | | | overlay | | | [See footnote](qtquickcontrols2-imagine#sup1) 1 | | | overlay | modal | | [See footnote](qtquickcontrols2-imagine#sup1) 1 | | [Frame](qml-qtquick-controls2-frame) | background | | | | | [GroupBox](qml-qtquick-controls2-groupbox) | background | | | | | | title | | | | | [ItemDelegate](qml-qtquick-controls2-itemdelegate) | background | | | | | | background | disabled | | | | | background | pressed | | | | | background | focused | | | | | background | hovered | | | | | background | highlighted | | | | [Menu](qtquickcontrols-changes-qt6#menu) | background | | | | | [MenuItem](qml-qtquick-controls2-menuitem) | background | | | | | | background | highlighted | | | | | arrow | | | | | | arrow | mirrored | | | | | arrow | disabled | | | | | arrow | mirrored, disabled | | | | | indicator | | | | | | indicator | disabled | | | | | indicator | pressed | | | | | indicator | checked | | | | | indicator | checked, pressed | | | | | indicator | checked, focused | | | | | indicator | checked, hovered | | | | | indicator | focused | | | | | indicator | hovered | | | | [MenuSeparator](qml-qtquick-controls2-menuseparator) | separator | | | | | [Page](qml-qtquick-controls2-page) | background | | | [See footnote](qtquickcontrols2-imagine#sup1) 1 | | [PageIndicator](qml-qtquick-controls2-pageindicator) | delegate | | | | | | delegate | disabled | | | | | delegate | disabled, current | | | | | delegate | pressed | | | | | delegate | current | | | | [Pane](qml-qtquick-controls2-pane) | background | | | | | [Popup](qml-qtquick-controls2-popup) | background | | | [See footnote](qtquickcontrols2-imagine#sup1) 1 | | | overlay | | | [See footnote](qtquickcontrols2-imagine#sup1) 1 | | | overlay | modal | | | | [ProgressBar](qml-qtquick-controls2-progressbar) | background | | | | | | progress | | | | | | mask | | | | | [RadioButton](qml-qtquick-controls2-radiobutton) | indicator | | | | | | indicator | disabled | | | | | indicator | pressed | | | | | indicator | checked | | | | | indicator | checked, focused | | | | | indicator | checked, hovered | | | | | indicator | checked, pressed | | | | | indicator | focused | | | | | indicator | hovered | | | | [RadioDelegate](qml-qtquick-controls2-radiodelegate) | background | | | | | | background | disabled | | | | | background | pressed | | | | | background | focused | | | | | background | hovered | | | | | indicator | | | | | | indicator | disabled | | | | | indicator | pressed | | | | | indicator | checked | | | | | indicator | checked, focused | | | | | indicator | checked, hovered | | | | | indicator | checked, pressed | | | | | indicator | focused | | | | | indicator | hovered | | | | [RangeSlider](qml-qtquick-controls2-rangeslider) | background | vertical | | | | | background | horizontal | | | | | progress | vertical | | | | | progress | vertical, disabled | | | | | progress | horizontal | | | | | progress | horizontal, disabled | | | | | handle | | | | | | handle | disabled | | | | | handle | focused | | | | | handle | focused, hovered | | | | | handle | focused, pressed | | | | | handle | hovered | | | | | handle | pressed | | | | [RoundButton](qml-qtquick-controls2-roundbutton) | background | | | | | | background | disabled | | | | | background | disabled, checked | | | | | background | focused | | | | | background | pressed | | | | | background | checked | | | | | background | checked, focused | | | | | background | checked, hovered | | | | | background | highlighted | | | | | background | highlighted, pressed | | | | | background | highlighted, focused | | | | | background | highlighted, hovered | | | | | background | hovered | | | | [ScrollBar](qml-qtquick-controls2-scrollbar) | handle | | | | | | handle | disabled | | | | | handle | interactive | | | | | handle | interactive, disabled | | | | | handle | interactive, pressed | | | | | handle | interactive, hovered | | | | [ScrollIndicator](qml-qtquick-controls2-scrollindicator) | handle | | | | | [Slider](qml-qtquick-controls2-slider) | background | vertical | | | | | background | horizontal | | | | | progress | vertical | | | | | progress | vertical, disabled | | | | | progress | horizontal | | | | | progress | horizontal, disabled | | | | | handle | | | | | | handle | disabled | | | | | handle | focused | | | | | handle | focused, hovered | | | | | handle | focused, pressed | | | | | handle | hovered | | | | | handle | pressed | | | | [SpinBox](qml-qtquick-controls2-spinbox) | background | | | | | | background | disabled | | | | | background | focused | | | | | background | editable | | | | | indicator | up | | | | | indicator | up, disabled | | | | | indicator | up, pressed | | | | | indicator | up, focused | | | | | indicator | up, mirrored | | | | | indicator | up, hovered | | | | | indicator | up, editable | | | | | indicator | up, editable, pressed | | | | | indicator | up, editable, focused | | | | | indicator | up, editable, mirrored | | | | | indicator | up, editable, hovered | | | | | indicator | down | | | | | indicator | down, disabled | | | | | indicator | down, pressed | | | | | indicator | down, focused | | | | | indicator | down, mirrored | | | | | indicator | down, hovered | | | | | indicator | down, editable | | | | | indicator | down, editable, pressed | | | | | indicator | down, editable, focused | | | | | indicator | down, editable, mirrored | | | | | indicator | down, editable, hovered | | | | [SwipeDelegate](qml-qtquick-controls2-swipedelegate) | background | | | | | | background | disabled | | | | | background | pressed | | | | | background | focused | | | | | background | hovered | | | | [Switch](qml-qtquick-controls2-switch) | indicator | | | | | | indicator | disabled | | | | | indicator | pressed | | | | | indicator | checked | | | | | indicator | checked, focused | | | | | indicator | checked, hovered | | | | | indicator | checked, pressed | | | | | indicator | focused | | | | | indicator | hovered | | | | | handle | | | | | | handle | disabled | | | | | handle | pressed | | | | [SwitchDelegate](qml-qtquick-controls2-switchdelegate) | background | | | | | | background | disabled | | | | | background | pressed | | | | | background | focused | | | | | background | hovered | | | | | indicator | | | | | | indicator | disabled | | | | | indicator | pressed | | | | | indicator | checked | | | | | indicator | checked, focused | | | | | indicator | checked, hovered | | | | | indicator | checked, pressed | | | | | indicator | focused | | | | | indicator | hovered | | | | | handle | | | | | | handle | disabled | | | | [TabBar](qml-qtquick-controls2-tabbar) | background | | | | | [TabButton](qml-qtquick-controls2-tabbutton) | background | | | | | | background | disabled | | | | | background | pressed | | | | | background | checked | | | | | background | hovered | | | | | background | disabled, checked | | | | [TextArea](qml-qtquick-controls2-textarea) | background | | | | | | background | disabled | | | | | background | focused | | | | [TextField](qml-qtquick-controls2-textfield) | background | | | | | | background | disabled | | | | | background | focused | | | | [ToolBar](qml-qtquick-controls2-toolbar) | background | | | | | [ToolButton](qml-qtquick-controls2-toolbutton) | background | | | | | | background | disabled, checked | | | | | background | focused | | | | | background | pressed | | | | | background | checked | | | | | background | checked, focused | | | | | background | checked, hovered | | | | | background | hovered | | | | [ToolSeparator](qml-qtquick-controls2-toolseparator) | separator | horizontal | | | | | separator | vertical | | | | [ToolTip](qtquickcontrols-changes-qt6#tooltip) | background | | | | 1 A 1x1 image containing one color, stretched to fill the control. ### 9-Patch Images The Imagine style uses [9-patch images](https://developer.android.com/guide/topics/graphics/2d-graphics.html#nine-patch) in order to give designers control over how a particular element responds to being resized. Here is an example of a 9-patch image that represents a [Button](qml-qtquick-controls2-button)'s [background](qml-qtquick-controls2-control#background-prop), alongside a magnified version (to make it easier to see the 9-patch lines): The content of the image is 44 pixels wide by 32 pixels high. Every 9-patch image needs a one pixel thick line (collectively referred to as "9-patch lines") around every side, so the actual size of the image becomes 46 pixels wide by 34 pixels high. Note that the 9-patch lines must be one pixel thick regardless of the target DPI of the image. For example, the 9-patch lines for button-background.9.png and [email protected] must both be one pixel thick. The 9-patch lines must be black, and the remaining areas must be transparent or white: #### Stretchable Areas The 9-patch lines on the top and left edges determine which parts of the image are stretched when it is resized. Below are examples of the 9-patch image being resized to one and a half times its original size in various dimensions: Notice how the the rounded corners keep their original size, as they are outside the range of the lines. #### Padding Areas The 9-patch lines on the right and bottom edges determine how much space is available for the control's [contentItem](qml-qtquick-controls2-control#contentItem-prop), which means it can also be thought of as controlling the [padding](qml-qtquick-controls2-control#padding-prop). For a diagram that illustrates padding, see [Control Layout](qml-qtquick-controls2-control#control-layout). Below are more examples of the 9-patch image being resized, but this time demonstrating how the padding 9-patch lines work. The `contentItem` can take up as much space as it needs within the shaded areas. If the padding lines are left out, the `contentItem` will take as much space as it needs without exceeding the stretchable areas. #### Inset Areas In some cases it is necessary for a control to have a drop shadow, for example. However, if we were to add a drop shadow to the button above, it would affect its size, which presents problems for both layouting and mouse/touch input boundaries. Inset areas accounts for this by telling the control that a certain area of the 9-patch image should go outside of the control: In the image below, the dashed line represents the button's clickable area, as well as the space that it will take up in a layout. The shadow is marked by the striped area behind it: #### Exporting 9-Patch Images Various vector and bitmap editors can be used to create 9-patch images suitable for use with the Imagine style. The following sections briefly explain the export process for each editor, and the last section explains how to ensure the exported images are 9-patch-conformant. ##### Illustrator See Adobe's [Asset Export panel](https://helpx.adobe.com/in/illustrator/using/collect-assets-export-for-screens.html#panel) documentation. ##### Inkscape The [Inkscape 9-Patch Export Extension](https://github.com/mitchcurtis/inkscape-9-patch-export) can be used to export assets with Inkscape. ##### Photoshop See Adobe's [Generate image assets from layers](https://helpx.adobe.com/photoshop/using/generate-assets-layers.html) documentation. ##### Sketch See Sketch's [Exporting](https://sketchapp.com/docs/exporting/) documentation. Qt Quick Controls also provides a [plugin](http://code.qt.io/cgit/qt/qtdeclarative.git/tree/src/quickcontrols2/imagine/design) for Sketch that automatically fixes the thickness of the 9-patch lines after the assets are exported. To install this file, double-click on it. Once Sketch has confirmed that the 9-patch export plugin has been installed, the plugin will automatically process images when they are exported. ##### Fixing 9-Patch Lines When exporting 9-patch images in several DPI variants (`@2x`, `@3x`, etc.), the 9-patch lines will typically be scaled up along with the image. There are several ways to fix this, but perhaps the simplest approach is to use [ImageMagick's mogrify](https://www.imagemagick.org/script/mogrify.php) tool. The tool has a `-shave` feature that can be used to crop the image to reduce the thickness of the 9-patch lines: ``` mogrify -shave 1x1 -path path/to/images *@2x.9.png mogrify -shave 2x2 -path path/to/images *@3x.9.png mogrify -shave 3x3 -path path/to/images *@4x.9.png ``` Regular DPI images (those without the `@Nx` prefix) are not affected, so it is only necessary to run the command on images intended for high DPI displays. ### Animated Images The [WebP](https://developers.google.com/speed/webp/) and GIF animated image formats are supported by the Imagine style. ### Customization #### Path The Imagine style allows customizing the [path](qtquickcontrols2-imagine#imagine-path-attached-prop) that is used to do the image asset selection. The path can be specified for any window or item, and it automatically propagates to children in the same manner as [fonts](qml-qtquick-controls2-control#font-prop). In the following example, the window and all three radio buttons appear with dark image assets (files that are located in "qrc:/themes/dark"). | | | | --- | --- | | ``` import QtQuick 2.12 import QtQuick.Controls 2.12 import QtQuick.Controls.Imagine 2.12 ApplicationWindow { visible: true Imagine.path: "qrc:/themes/dark" Column { anchors.centerIn: parent RadioButton { text: qsTr("Small") } RadioButton { text: qsTr("Medium"); checked: true } RadioButton { text: qsTr("Large") } } } ``` | | In addition to specifying the path in QML, it is also possible to specify it via an [environment variable](qtquickcontrols2-imagine#imagine-customization-environment-variable) or in a [configuration file](qtquickcontrols2-imagine#imagine-customization-configuration-file). Attributes specified in QML take precedence over all other methods. ##### Configuration File | Variable | Description | | --- | --- | | `Path` | Specifies the [path](qtquickcontrols2-imagine#imagine-path-attached-prop) to the directory that contains the Imagine style assets. If not specified, the built-in assets are used.For example, to specify a path to a directory stored in the [resource system](resources): ``` [Imagine] Path=:/imagine-assets ``` To specify a relative path to a local directory: ``` [Imagine] Path=imagine-assets ``` **Note:** Due to a technical limitation, the path should not be named *"imagine"* if it is relative to the `qtquickcontrols2.conf` file. | See [Qt Quick Controls Configuration File](qtquickcontrols2-configuration) for more details about the configuration file. ##### Environment Variables | Variable | Description | | --- | --- | | `QT_QUICK_CONTROLS_IMAGINE_PATH` | Specifies the path to the directory that contains the Imagine style assets. If not specified, the built-in assets are used.For example, to specify a path to a directory stored in the [resource system](resources): ``` QT_QUICK_CONTROLS_IMAGINE_PATH=:/imagine-assets ``` To specify a relative path to a local directory: ``` QT_QUICK_CONTROLS_IMAGINE_PATH=imagine-assets ``` **Note:** Due to a technical limitation, the path should not be named *"imagine"* if it is relative to the `qtquickcontrols2.conf` file. | See [Supported Environment Variables in Qt Quick Controls](qtquickcontrols2-environment) for the full list of supported environment variables. #### Palette The Imagine style supports palette customization via the [palette](qml-qtquick-item#palette-prop) property and the [qtquickcontrols2.conf](qtquickcontrols2-configuration#palette-configuration) file. As with other styles, the exact [palette roles](qml-qtquick-palette) that the Imagine style uses are style-dependent. However, as most of the visual appearance of controls (for example: backgrounds) are managed through image assets, only the roles that are typically used for text will have an effect. #### Font Custom fonts can be set via the [font](qml-qtquick-controls2-control#font-prop) property and the [configuration](qtquickcontrols2-configuration#font-configuration) file. ### Dependency The Imagine style must be separately imported to gain access to the attributes that are specific to the Imagine style. It should be noted that regardless of the references to the Imagine style, the same application code runs with any other style. Imagine-specific attributes only have an effect when the application is run with the Imagine style. If the Imagine style is imported in a QML file that is always loaded, the Imagine style must be deployed with the application in order to be able to run the application regardless of which style the application is run with. By using [file selectors](qtquickcontrols2-fileselectors), style-specific tweaks can be applied without creating a hard dependency to a style. **See also** [Styling Qt Quick Controls](qtquickcontrols2-styles) Attached Property Documentation ------------------------------- ### Imagine.path : string This attached property holds the path to the image assets... ``` Button { Imagine.path: "qrc:/themes/dark" } ``` Related Information ------------------- * [Styling Qt Quick Controls](qtquickcontrols2-styles) * [Automotive Example](https://doc.qt.io/qt-6.2/qtquickcontrols-imagine-automotive-example.html) * [Music Player Example](https://doc.qt.io/qt-6.2/qtquickcontrols-imagine-musicplayer-example.html)
programming_docs
qt QAndroidBinder Class QAndroidBinder Class ==================== Wraps the most important methods of Android Binder class. [More...](#details) | | | | --- | --- | | Header: | #include <QAndroidBinder> | | CMake: | find\_package(Qt6 COMPONENTS Core REQUIRED) target\_link\_libraries(mytarget PRIVATE Qt6::Core) | | qmake: | QT += core | | Since: | Qt 6.2 | **This class is under development and is subject to change.** * [List of all members, including inherited members](https://doc.qt.io/qt-6.2/qandroidbinder-members.html) Public Types ------------ | | | | --- | --- | | enum class | **[CallType](qandroidbinder#CallType-enum)** { Normal, OneWay } | Public Functions ---------------- | | | | --- | --- | | | **[QAndroidBinder](qandroidbinder#QAndroidBinder-1)**(const QJniObject &*binder*) | | | **[QAndroidBinder](qandroidbinder#QAndroidBinder)**() | | QJniObject | **[handle](qandroidbinder#handle)**() const | | virtual bool | **[onTransact](qandroidbinder#onTransact)**(int *code*, const QAndroidParcel &*data*, const QAndroidParcel &*reply*, QAndroidBinder::CallType *flags*) | | bool | **[transact](qandroidbinder#transact)**(int *code*, const QAndroidParcel &*data*, QAndroidParcel \**reply* = nullptr, QAndroidBinder::CallType *flags* = CallType::Normal) const | Detailed Description -------------------- The QAndroidBinder is a convenience class that wraps the most important [Android Binder](https://developer.android.com/reference/android/os/Binder.html) methods. Member Type Documentation ------------------------- ### enum class QAndroidBinder::CallType This enum is used with [QAndroidBinder::transact](qandroidbinder#transact)() to describe the mode in which the IPC call is performed. | Constant | Value | Description | | --- | --- | --- | | `QAndroidBinder::CallType::Normal` | `0` | normal IPC, meaning that the caller waits the result from the callee | | `QAndroidBinder::CallType::OneWay` | `1` | one-way IPC, meaning that the caller returns immediately, without waiting for a result from the callee | Member Function Documentation ----------------------------- ### QAndroidBinder::QAndroidBinder(const [QJniObject](qjniobject) &*binder*) Creates a new object from the *binder* Java object. **See also** [transact](qandroidbinder#transact). ### QAndroidBinder::QAndroidBinder() Creates a new object which can be used to perform IPC. **See also** [onTransact](qandroidbinder#onTransact) and [transact](qandroidbinder#transact). ### [QJniObject](qjniobject) QAndroidBinder::handle() const The return value is useful to call other Java API which are not covered by this wrapper ### `[virtual]` bool QAndroidBinder::onTransact(int *code*, const [QAndroidParcel](qandroidparcel) &*data*, const [QAndroidParcel](qandroidparcel) &*reply*, [QAndroidBinder::CallType](qandroidbinder#CallType-enum) *flags*) Default implementation is a stub that returns false. The user should override this method to get the transact data from the caller. The *code* is the action to perform. The *data* is the marshaled data sent by the caller. The *reply* is the marshaled data to be sent to the caller. The *flags* are the additional operation flags. **Warning:** This method is called from Binder's thread which is different from the thread that this object was created. **See also** [transact](qandroidbinder#transact). ### bool QAndroidBinder::transact(int *code*, const [QAndroidParcel](qandroidparcel) &*data*, [QAndroidParcel](qandroidparcel) \**reply* = nullptr, [QAndroidBinder::CallType](qandroidbinder#CallType-enum) *flags* = CallType::Normal) const Performs an IPC call The *code* is the action to perform. Should be between [FIRST\_CALL\_TRANSACTION](https://developer.android.com/reference/android/os/IBinder.html#FIRST_CALL_TRANSACTION) and [LAST\_CALL\_TRANSACTION](https://developer.android.com/reference/android/os/IBinder.html#LAST_CALL_TRANSACTION). The *data* is the marshaled data to send to the target. The *reply* (if specified) is the marshaled data to be received from the target. May be **nullptr** if you are not interested in the return value. The *flags* are the additional operation flags. Returns true on success qt WavefrontMesh QML Type WavefrontMesh QML Type ====================== The WavefrontMesh provides a mesh based on a Wavefront .obj file. [More...](#details) | | | | --- | --- | | Import Statement: | import Qt.labs.wavefrontmesh | | Since: | Qt 5.12 | * [List of all members, including inherited members](https://doc.qt.io/qt-6.2/qml-qt-labs-wavefrontmesh-wavefrontmesh-members.html) Properties ---------- * **[lastError](qml-qt-labs-wavefrontmesh-wavefrontmesh#lastError-prop)** : enumeration * **[projectionPlaneV](qml-qt-labs-wavefrontmesh-wavefrontmesh#projectionPlaneV-prop)** : vector3d * **[projectionPlaneW](qml-qt-labs-wavefrontmesh-wavefrontmesh#projectionPlaneW-prop)** : vector3d * **[source](qml-qt-labs-wavefrontmesh-wavefrontmesh#source-prop)** : url Detailed Description -------------------- WavefrontMesh reads the geometry from a Wavefront .obj file and generates a two-dimensional [geometry](qsggeometry) from this. If the .obj file contains a three-dimensional shape, it will be orthographically projected, onto a plane. If defined, this is given by [projectionPlaneV](qml-qt-labs-wavefrontmesh-wavefrontmesh#projectionPlaneV-prop) and [projectionPlaneW](qml-qt-labs-wavefrontmesh-wavefrontmesh#projectionPlaneW-prop). Otherwise, the first face encountered in the data will be used to determine the projection plane. If the file contains texture coordinates, these will also be used. Otherwise, the vertexes of the object will be normalized and used. The mesh can be used in a [ShaderEffect](qml-qtquick-shadereffect) to define the shaded geometry. The geometry will be normalized before use, so the position and scale of the input objects have no impact on the result. **Note:** Some Wavefront exporters will change the source scene's coordinate system before exporting it. This can cause unexpected results when Qt applies the projection. If the visual results are not as you expect, try checking the export parameters and the documentation of the editor tool to see if this is the case. For instance, the following example takes an .obj file containing a standard torus and visualizes the automatically generated texture coordinates. | | | | --- | --- | | | ``` import QtQuick 2.\1 import Qt.labs.wavefrontmesh 1.\1 ShaderEffect { width: 200 height: 200 mesh: WavefrontMesh { source: "torus.obj" projectionPlaneV: Qt.vector3d(0, 1, 0) projectionPlaneW: Qt.vector3d(1, 0, 0) } vertexShader: " uniform highp mat4 qt_Matrix; attribute highp vec4 qt_Vertex; attribute highp vec2 qt_MultiTexCoord0; varying highp vec2 coord; void main() { coord = qt_MultiTexCoord0; gl_Position = qt_Matrix * qt_Vertex; }" fragmentShader: " varying highp vec2 coord; uniform lowp float qt_Opacity; void main() { gl_FragColor = vec4(coord.x, coord.y, 0.0, 1.0); }" } ``` | **Note:** Since the input is a 3D torus, we need to define the projection plane. This would not be necessary when using a 2D shape as input. We use the XY plane in this case, because of the orientation of the input. Property Documentation ---------------------- ### lastError : [enumeration](qml-enumeration) This property holds the last error, if any, that occurred when parsing the source or building the mesh. * [WavefrontMesh](qml-qt-labs-wavefrontmesh-wavefrontmesh).NoError No error has occurred. * [WavefrontMesh](qml-qt-labs-wavefrontmesh-wavefrontmesh).InvalidSourceError The source was not recognized as a valid .obj file. * [WavefrontMesh](qml-qt-labs-wavefrontmesh-wavefrontmesh).UnsupportedFaceShapeError The faces in the source is of an unsupported type. [WavefrontMesh](qml-qt-labs-wavefrontmesh-wavefrontmesh) only supports triangles and convex quads. * [WavefrontMesh](qml-qt-labs-wavefrontmesh-wavefrontmesh).UnsupportedIndexSizeError The source shape is too large. Only 16 bit indexes are supported. * [WavefrontMesh](qml-qt-labs-wavefrontmesh-wavefrontmesh).FileNotFoundError The source file was not found. * [WavefrontMesh](qml-qt-labs-wavefrontmesh-wavefrontmesh).MissingPositionAttributeError The 'qt\_Vertex' attribute is missing from the shaders. * [WavefrontMesh](qml-qt-labs-wavefrontmesh-wavefrontmesh).MissingTextureCoordinateAttributeError The texture coordinate attribute in the shaders is wrongly named. Use 'qt\_MultiTexCoord0'. * [WavefrontMesh](qml-qt-labs-wavefrontmesh-wavefrontmesh).MissingPositionAndTextureCoordinateAttributesError Both the 'qt\_Vertex' and 'qt\_MultiTexCoord0' attributes are missing from the shaders. * [WavefrontMesh](qml-qt-labs-wavefrontmesh-wavefrontmesh).TooManyAttributesError The shaders expect too many attributes (maximum is two: Position, 'qt\_Vertex', and texture coordinate, 'qt\_MultiTexCoord0'). * [WavefrontMesh](qml-qt-labs-wavefrontmesh-wavefrontmesh).InvalidPlaneDefinitionError The V and W vectors in the plane cannot be null, nor parallel to each other. ### projectionPlaneV : [vector3d](qml-vector3d) Since the Wavefront .obj format describes an object in 3D space, the coordinates have to be projected into 2D before they can be displayed in Qt Quick. This will be done in [WavefrontMesh](qml-qt-labs-wavefrontmesh-wavefrontmesh) by an orthographic projection onto an appropriate plane. The projectionPlaneV is one of two vectors in the plane in 3D space. If either this, or [projectionPlaneW](qml-qt-labs-wavefrontmesh-wavefrontmesh#projectionPlaneW-prop) is set to (0, 0, 0) (the default), then the plane will be detected based on the first encountered face in the data set. **Note:** projectionPlaneV and [projectionPlaneW](qml-qt-labs-wavefrontmesh-wavefrontmesh#projectionPlaneW-prop) cannot be parallel vectors. ### projectionPlaneW : [vector3d](qml-vector3d) Since the Wavefront .obj format describes an object in 3D space, the coordinates have to be projected into 2D before they can be displayed in Qt Quick. This will be done in [WavefrontMesh](qml-qt-labs-wavefrontmesh-wavefrontmesh) by an orthographic projection onto an appropriate plane. The projectionPlaneW is one of two vectors in the plane in 3D space. If either this, or [projectionPlaneV](qml-qt-labs-wavefrontmesh-wavefrontmesh#projectionPlaneV-prop) is set to (0, 0, 0) (the default), then the plane will be detected based on the first encountered face in the data set. **Note:** [projectionPlaneV](qml-qt-labs-wavefrontmesh-wavefrontmesh#projectionPlaneV-prop) and projectionPlaneW cannot be parallel vectors. ### source : [url](qml-url) This property holds the URL of the source. This must be either a local file or in qrc. The source will be read as a Wavefront .obj file and the geometry will be updated. qt FirstPersonCameraController QML Type FirstPersonCameraController QML Type ==================================== The FirstPersonCameraController allows controlling the scene camera from the first person perspective. [More...](#details) | | | | --- | --- | | Import Statement: | import Qt3D.Extras | | Since: | Qt 5.7 | | Inherits: | [Entity](qml-qt3d-core-entity) | * [List of all members, including inherited members](https://doc.qt.io/qt-6.2/qml-qt3d-extras-firstpersoncameracontroller-members.html) Properties ---------- * **[acceleration](qml-qt3d-extras-firstpersoncameracontroller#acceleration-prop)** : real * **[camera](qml-qt3d-extras-firstpersoncameracontroller#camera-prop)** : Camera * **[deceleration](qml-qt3d-extras-firstpersoncameracontroller#deceleration-prop)** : real * **[linearSpeed](qml-qt3d-extras-firstpersoncameracontroller#linearSpeed-prop)** : real * **[lookSpeed](qml-qt3d-extras-firstpersoncameracontroller#lookSpeed-prop)** : real Detailed Description -------------------- The FirstPersonCameraController allows controlling the scene camera from the first person perspective. The controls are: | Input | Action | | --- | --- | | Left mouse button | While the left mouse button is pressed, mouse movement along x-axis pans the camera and movement along y-axis tilts it. | | Shift key | Turns the fine motion control active while pressed. Makes mouse pan and tilt less sensitive. | | Arrow keys | Move the camera horizontally relative to camera viewport. | | Page up and page down keys | Move the camera vertically relative to camera viewport. | Property Documentation ---------------------- ### acceleration : [real](qml-real) Holds the current acceleration. Specifies the rate at which the camera linear speed increases when a key is held. If the acceleration is negative, the linear speed stays constant. Defaults to -1.0. ### camera : [Camera](qml-qt3d-render-camera) Holds the currently controlled camera. ### deceleration : [real](qml-real) Specifies the rate at which the camera linear speed decreases when a key is released. If the deceleration is negative, the linear speed stays constant. Defaults to -1.0. ### linearSpeed : [real](qml-real) Holds the current linear speed of the camera controller. Linear speed determines the movement speed of the camera. ### lookSpeed : [real](qml-real) Holds the current look speed of the camera controller. The look speed determines the turn rate of the camera pan and tilt. qt QNetworkProxyFactory Class QNetworkProxyFactory Class ========================== The QNetworkProxyFactory class provides fine-grained proxy selection. [More...](#details) | | | | --- | --- | | Header: | #include <QNetworkProxyFactory> | | CMake: | find\_package(Qt6 COMPONENTS Network REQUIRED) target\_link\_libraries(mytarget PRIVATE Qt6::Network) | | qmake: | QT += network | * [List of all members, including inherited members](https://doc.qt.io/qt-6.2/qnetworkproxyfactory-members.html) Public Functions ---------------- | | | | --- | --- | | | **[QNetworkProxyFactory](qnetworkproxyfactory#QNetworkProxyFactory)**() | | virtual | **[~QNetworkProxyFactory](qnetworkproxyfactory#dtor.QNetworkProxyFactory)**() | | virtual QList<QNetworkProxy> | **[queryProxy](qnetworkproxyfactory#queryProxy)**(const QNetworkProxyQuery &*query* = QNetworkProxyQuery()) = 0 | Static Public Members --------------------- | | | | --- | --- | | QList<QNetworkProxy> | **[proxyForQuery](qnetworkproxyfactory#proxyForQuery)**(const QNetworkProxyQuery &*query*) | | void | **[setApplicationProxyFactory](qnetworkproxyfactory#setApplicationProxyFactory)**(QNetworkProxyFactory \**factory*) | | void | **[setUseSystemConfiguration](qnetworkproxyfactory#setUseSystemConfiguration)**(bool *enable*) | | QList<QNetworkProxy> | **[systemProxyForQuery](qnetworkproxyfactory#systemProxyForQuery)**(const QNetworkProxyQuery &*query* = QNetworkProxyQuery()) | | bool | **[usesSystemConfiguration](qnetworkproxyfactory#usesSystemConfiguration)**() | Detailed Description -------------------- QNetworkProxyFactory is an extension to [QNetworkProxy](qnetworkproxy), allowing applications to have a more fine-grained control over which proxy servers are used, depending on the socket requesting the proxy. This allows an application to apply different settings, according to the protocol or destination hostname, for instance. QNetworkProxyFactory can be set globally for an application, in which case it will override any global proxies set with [QNetworkProxy::setApplicationProxy](qnetworkproxy#setApplicationProxy)(). If set globally, any sockets created with Qt will query the factory to determine the proxy to be used. A factory can also be set in certain frameworks that support multiple connections, such as [QNetworkAccessManager](qnetworkaccessmanager). When set on such object, the factory will be queried for sockets created by that framework only. ### System Proxies You can configure a factory to use the system proxy's settings. Call the [setUseSystemConfiguration](qnetworkproxyfactory#setUseSystemConfiguration)() function with true to enable this behavior, or false to disable it. Similarly, you can use a factory to make queries directly to the system proxy by calling its [systemProxyForQuery](qnetworkproxyfactory#systemProxyForQuery)() function. **Warning:** Depending on the configuration of the user's system, the use of system proxy features on certain platforms may be subject to limitations. The [systemProxyForQuery](qnetworkproxyfactory#systemProxyForQuery)() documentation contains a list of these limitations for those platforms that are affected. Member Function Documentation ----------------------------- ### QNetworkProxyFactory::QNetworkProxyFactory() Creates a QNetworkProxyFactory object. Since QNetworkProxyFactory is an abstract class, you cannot create objects of type QNetworkProxyFactory directly. ### `[virtual]` QNetworkProxyFactory::~QNetworkProxyFactory() Destroys the [QNetworkProxyFactory](qnetworkproxyfactory) object. ### `[static]` [QList](qlist)<[QNetworkProxy](qnetworkproxy)> QNetworkProxyFactory::proxyForQuery(const [QNetworkProxyQuery](qnetworkproxyquery) &*query*) This function takes the query request, *query*, examines the details of the type of socket or request and returns a list of [QNetworkProxy](qnetworkproxy) objects that indicate the proxy servers to be used, in order of preference. ### `[pure virtual]` [QList](qlist)<[QNetworkProxy](qnetworkproxy)> QNetworkProxyFactory::queryProxy(const [QNetworkProxyQuery](qnetworkproxyquery) &*query* = QNetworkProxyQuery()) This function takes the query request, *query*, examines the details of the type of socket or request and returns a list of [QNetworkProxy](qnetworkproxy) objects that indicate the proxy servers to be used, in order of preference. When reimplementing this class, take care to return at least one element. If you cannot determine a better proxy alternative, use [QNetworkProxy::DefaultProxy](qnetworkproxy#ProxyType-enum), which tells the code querying for a proxy to use a higher alternative. For example, if this factory is set to a [QNetworkAccessManager](qnetworkaccessmanager) object, DefaultProxy will tell it to query the application-level proxy settings. If this factory is set as the application proxy factory, DefaultProxy and NoProxy will have the same meaning. ### `[static]` void QNetworkProxyFactory::setApplicationProxyFactory([QNetworkProxyFactory](qnetworkproxyfactory#QNetworkProxyFactory) \**factory*) Sets the application-wide proxy factory to be *factory*. This function will take ownership of that object and will delete it when necessary. The application-wide proxy is used as a last-resort when all other proxy selection requests returned [QNetworkProxy::DefaultProxy](qnetworkproxy#ProxyType-enum). For example, [QTcpSocket](qtcpsocket) objects can have a proxy set with QTcpSocket::setProxy, but if none is set, the proxy factory class set with this function will be queried. If you set a proxy factory with this function, any application level proxies set with [QNetworkProxy::setApplicationProxy](qnetworkproxy#setApplicationProxy) will be overridden, and [usesSystemConfiguration](qnetworkproxyfactory#usesSystemConfiguration)() will return `false`. **See also** [QNetworkProxy::setApplicationProxy](qnetworkproxy#setApplicationProxy)(), [QAbstractSocket::proxy](qabstractsocket#proxy)(), and [QAbstractSocket::setProxy](qabstractsocket#setProxy)(). ### `[static]` void QNetworkProxyFactory::setUseSystemConfiguration(bool *enable*) Enables the use of the platform-specific proxy settings, and only those. See [systemProxyForQuery](qnetworkproxyfactory#systemProxyForQuery)() for more information. Calling this function with *enable* set to `true` resets any proxy or [QNetworkProxyFactory](qnetworkproxyfactory) that is already set. **Note:** See the [systemProxyForQuery](qnetworkproxyfactory#systemProxyForQuery)() documentation for a list of limitations related to the use of system proxies. ### `[static]` [QList](qlist)<[QNetworkProxy](qnetworkproxy)> QNetworkProxyFactory::systemProxyForQuery(const [QNetworkProxyQuery](qnetworkproxyquery) &*query* = QNetworkProxyQuery()) This function takes the query request, *query*, examines the details of the type of socket or request and returns a list of [QNetworkProxy](qnetworkproxy) objects that indicate the proxy servers to be used, in order of preference. This function can be used to determine the platform-specific proxy settings. This function will use the libraries provided by the operating system to determine the proxy for a given connection, if such libraries exist. If they don't, this function will just return a [QNetworkProxy](qnetworkproxy) of type [QNetworkProxy::NoProxy](qnetworkproxy#ProxyType-enum). On Windows, this function will use the WinHTTP DLL functions. Despite its name, Microsoft suggests using it for all applications that require network connections, not just HTTP. This will respect the proxy settings set on the registry with the proxycfg.exe tool. If those settings are not found, this function will attempt to obtain Internet Explorer's settings and use them. On macOS, this function will obtain the proxy settings using the SystemConfiguration framework from Apple. It will apply the FTP, HTTP and HTTPS proxy configurations for queries that contain the protocol tag "ftp", "http" and "https", respectively. If the SOCKS proxy is enabled in that configuration, this function will use the SOCKS server for all queries. If SOCKS isn't enabled, it will use the HTTPS proxy for all TcpSocket and UrlRequest queries. On other systems, this function will pick up proxy settings from the "http\_proxy" environment variable. This variable must be a URL using one of the following schemes: "http", "socks5" or "socks5h". #### Limitations These are the limitations for the current version of this function. Future versions of Qt may lift some of the limitations listed here. * On macOS, this function will ignore the Proxy Auto Configuration settings, since it cannot execute the associated ECMAScript code. * On Windows platforms, this function may take several seconds to execute depending on the configuration of the user's system. ### `[static, since 5.8]` bool QNetworkProxyFactory::usesSystemConfiguration() Returns whether the use of platform-specific proxy settings are enabled. This function was introduced in Qt 5.8.
programming_docs
qt QGenericPluginFactory Class QGenericPluginFactory Class =========================== The QGenericPluginFactory class creates plugin drivers. [More...](#details) | | | | --- | --- | | Header: | #include <QGenericPluginFactory> | | CMake: | find\_package(Qt6 COMPONENTS Gui REQUIRED) target\_link\_libraries(mytarget PRIVATE Qt6::Gui) | | qmake: | QT += gui | * [List of all members, including inherited members](https://doc.qt.io/qt-6.2/qgenericpluginfactory-members.html) Static Public Members --------------------- | | | | --- | --- | | QObject \* | **[create](qgenericpluginfactory#create)**(const QString &*key*, const QString &*specification*) | | QStringList | **[keys](qgenericpluginfactory#keys)**() | Detailed Description -------------------- **See also** [QGenericPlugin](qgenericplugin). Member Function Documentation ----------------------------- ### `[static]` [QObject](qobject) \*QGenericPluginFactory::create(const [QString](qstring) &*key*, const [QString](qstring) &*specification*) Creates the driver specified by *key*, using the given *specification*. Note that the keys are case-insensitive. **See also** [keys](qgenericpluginfactory#keys)(). ### `[static]` [QStringList](qstringlist) QGenericPluginFactory::keys() Returns the list of valid keys, i.e. the available mouse drivers. **See also** [create](qgenericpluginfactory#create)(). qt Implicit Sharing Implicit Sharing ================ Many C++ classes in Qt use implicit data sharing to maximize resource usage and minimize copying. Implicitly shared classes are both safe and efficient when passed as arguments, because only a pointer to the data is passed around, and the data is copied only if and when a function writes to it, i.e., *copy-on-write*. Overview -------- A shared class consists of a pointer to a shared data block that contains a reference count and the data. When a shared object is created, it sets the reference count to 1. The reference count is incremented whenever a new object references the shared data, and decremented when the object dereferences the shared data. The shared data is deleted when the reference count becomes zero. When dealing with shared objects, there are two ways of copying an object. We usually speak about *deep* and *shallow* copies. A deep copy implies duplicating an object. A shallow copy is a reference copy, i.e. just a pointer to a shared data block. Making a deep copy can be expensive in terms of memory and CPU. Making a shallow copy is very fast, because it only involves setting a pointer and incrementing the reference count. Object assignment (with operator=()) for implicitly shared objects is implemented using shallow copies. The benefit of sharing is that a program does not need to duplicate data unnecessarily, which results in lower memory use and less copying of data. Objects can easily be assigned, sent as function arguments, and returned from functions. Implicit sharing mostly takes place behind the scenes; the programmer rarely needs to worry about it. However, Qt's container iterators have different behavior than those from the STL. Read [Implicit sharing iterator problem](containers#implicit-sharing-iterator-problem). In multithreaded applications, implicit sharing takes place, as explained in [Threads and Implicitly Shared Classes](https://doc.qt.io/qt-6.2/threads-modules.html#threads-and-implicitly-shared-classes). When implementing your own implicitly shared classes, use the [QSharedData](qshareddata) and [QSharedDataPointer](qshareddatapointer) classes. Implicit Sharing in Detail -------------------------- Implicit sharing automatically detaches the object from a shared block if the object is about to change and the reference count is greater than one. (This is often called *copy-on-write* or *value semantics*.) An implicitly shared class has control of its internal data. In any member functions that modify its data, it automatically detaches before modifying the data. Notice, however, the special case with container iterators; see [Implicit sharing iterator problem](containers#implicit-sharing-iterator-problem). The [QPen](qpen) class, which uses implicit sharing, detaches from the shared data in all member functions that change the internal data. Code fragment: ``` void QPen::setStyle(Qt::PenStyle style) { detach(); // detach from common data d->style = style; // set the style member } void QPen::detach() { if (d->ref != 1) { ... // perform a deep copy } } ``` List of Classes --------------- The classes listed below automatically detach from common data if an object is about to be changed. The programmer will not even notice that the objects are shared. Thus you should treat separate instances of them as separate objects. They will always behave as separate objects but with the added benefit of sharing data whenever possible. For this reason, you can pass instances of these classes as arguments to functions by value without concern for the copying overhead. Example: ``` QPixmap p1, p2; p1.load("image.bmp"); p2 = p1; // p1 and p2 share data QPainter paint; paint.begin(&p2); // cuts p2 loose from p1 paint.drawText(0,50, "Hi"); paint.end(); ``` In this example, `p1` and `p2` share data until [QPainter::begin](qpainter#begin)() is called for `p2`, because painting a pixmap will modify it. **Warning:** Be careful with copying an implicitly shared container ([QMap](qmap), [QList](qlist), etc.) while you use [STL-style iterator](containers#stl-style-iterators). See [Implicit sharing iterator problem](containers#implicit-sharing-iterator-problem). | | | | --- | --- | | [QBitArray](qbitarray) | Array of bits | | [QBitmap](qbitmap) | Monochrome (1-bit depth) pixmaps | | [QBrush](qbrush) | Defines the fill pattern of shapes drawn by QPainter | | [QByteArray](qbytearray) | Array of bytes | | [QByteArrayList](qbytearraylist) | List of byte arrays | | [QByteArrayView](qbytearrayview) | View on an array of bytes with a read-only subset of the QByteArray API | | [QCache](qcache) | Template class that provides a cache | | [QCollator](qcollator) | Compares strings according to a localized collation algorithm | | [QCollatorSortKey](qcollatorsortkey) | Can be used to speed up string collation | | [QCommandLineOption](qcommandlineoption) | Defines a possible command-line option | | [QContiguousCache](qcontiguouscache) | Template class that provides a contiguous cache | | [QCursor](qcursor) | Mouse cursor with an arbitrary shape | | [QDBusPendingCall](qdbuspendingcall) | Refers to one pending asynchronous call | | [QDBusUnixFileDescriptor](qdbusunixfiledescriptor) | Holds one Unix file descriptor | | [QDateTime](qdatetime) | Date and time functions | | [QDebug](qdebug) | Output stream for debugging information | | [QDir](qdir) | Access to directory structures and their contents | | [QDnsDomainNameRecord](qdnsdomainnamerecord) | Stores information about a domain name record | | [QDnsHostAddressRecord](qdnshostaddressrecord) | Stores information about a host address record | | [QDnsMailExchangeRecord](qdnsmailexchangerecord) | Stores information about a DNS MX record | | [QDnsServiceRecord](qdnsservicerecord) | Stores information about a DNS SRV record | | [QDnsTextRecord](qdnstextrecord) | Stores information about a DNS TXT record | | [QFileInfo](qfileinfo) | System-independent file information | | [QFont](qfont) | Specifies a query for a font used for drawing text | | [QFontInfo](qfontinfo) | General information about fonts | | [QFontMetrics](qfontmetrics) | Font metrics information | | [QFontMetricsF](qfontmetricsf) | Font metrics information | | [QGeoAreaMonitorInfo](qgeoareamonitorinfo) | Describes the parameters of an area or region to be monitored for proximity | | [QGeoPositionInfo](qgeopositioninfo) | Contains information gathered on a global position, direction and velocity at a particular point in time | | [QGeoSatelliteInfo](qgeosatelliteinfo) | Contains basic information about a satellite | | [QGlyphRun](https://doc.qt.io/qt-6.2/qglyphrun.html) | Direct access to the internal glyphs in a font | | [QGradient](qgradient) | Used in combination with QBrush to specify gradient fills | | [QHash](qhash) | Template class that provides a hash-table-based dictionary | | [QHostAddress](qhostaddress) | IP address | | [QHttp2Configuration](qhttp2configuration) | Controls HTTP/2 parameters and settings | | [QHttpPart](qhttppart) | Holds a body part to be used inside a HTTP multipart MIME message | | [QIcon](qicon) | Scalable icons in different modes and states | | [QImage](qimage) | Hardware-independent image representation that allows direct access to the pixel data, and can be used as a paint device | | [QJsonArray](qjsonarray) | Encapsulates a JSON array | | [QJsonDocument](qjsondocument) | Way to read and write JSON documents | | [QJsonObject](qjsonobject) | Encapsulates a JSON object | | [QJsonParseError](qjsonparseerror) | Used to report errors during JSON parsing | | [QJsonValue](qjsonvalue) | Encapsulates a value in JSON | | [QKeySequence](qkeysequence) | Encapsulates a key sequence as used by shortcuts | | [QLinkedList](qlinkedlist) | Template class that provides linked lists | | [QList](qlist) | Template class that provides a dynamic array | | [QLocale](qlocale) | Converts between numbers and their string representations in various languages | | [QLowEnergyAdvertisingData](qlowenergyadvertisingdata) | Represents the data to be broadcast during Bluetooth Low Energy advertising | | [QLowEnergyAdvertisingParameters](qlowenergyadvertisingparameters) | Represents the parameters used for Bluetooth Low Energy advertising | | [QLowEnergyCharacteristicData](qlowenergycharacteristicdata) | Used to set up GATT service data | | [QLowEnergyConnectionParameters](qlowenergyconnectionparameters) | Used when requesting or reporting an update of the parameters of a Bluetooth LE connection | | [QLowEnergyDescriptorData](qlowenergydescriptordata) | Used to create GATT service data | | [QLowEnergyServiceData](qlowenergyservicedata) | Used to set up GATT service data | | [QMap](qmap) | Template class that provides an associative array | | [QMimeType](qmimetype) | Describes types of file or data, represented by a MIME type string | | [QMqttTopicFilter](https://doc.qt.io/qt-6.2/qmqtttopicfilter.html) | Represents a MQTT topic filter | | [QMqttTopicName](https://doc.qt.io/qt-6.2/qmqtttopicname.html) | Represents a MQTT topic name | | [QMultiHash](qmultihash) | Convenience QHash subclass that provides multi-valued hashes | | [QMultiMap](qmultimap) | Template class that provides an associative array with multiple equivalent keys | | [QNetworkAddressEntry](qnetworkaddressentry) | Stores one IP address supported by a network interface, along with its associated netmask and broadcast address | | [QNetworkCacheMetaData](qnetworkcachemetadata) | Cache information | | [QNetworkCookie](qnetworkcookie) | Holds one network cookie | | [QNetworkInterface](qnetworkinterface) | Listing of the host's IP addresses and network interfaces | | [QNetworkProxy](qnetworkproxy) | Network layer proxy | | [QNetworkProxyQuery](qnetworkproxyquery) | Used to query the proxy settings for a socket | | [QNetworkRequest](qnetworkrequest) | Holds a request to be sent with QNetworkAccessManager | | [QOpenGLDebugMessage](qopengldebugmessage) | Wraps an OpenGL debug message | | [QPageRanges](qpageranges) | Represents a collection of page ranges | | [QPainterPath](qpainterpath) | Container for painting operations, enabling graphical shapes to be constructed and reused | | [QPalette](qpalette) | Contains color groups for each widget state | | [QPen](qpen) | Defines how a QPainter should draw lines and outlines of shapes | | [QPersistentModelIndex](qpersistentmodelindex) | Used to locate data in a data model | | [QPicture](qpicture) | Paint device that records and replays QPainter commands | | [QPixmap](qpixmap) | Off-screen image representation that can be used as a paint device | | [QPolygon](qpolygon) | List of points using integer precision | | [QPolygonF](qpolygonf) | List of points using floating point precision | | [QProcessEnvironment](qprocessenvironment) | Holds the environment variables that can be passed to a program | | [QQueue](qqueue) | Generic container that provides a queue | | [QRawFont](qrawfont) | Access to a single physical instance of a font | | [QRegExp](qregexp) | Pattern matching using regular expressions | | [QRegion](qregion) | Specifies a clip region for a painter | | [QRegularExpression](qregularexpression) | Pattern matching using regular expressions | | [QRegularExpressionMatch](qregularexpressionmatch) | The results of a matching a QRegularExpression against a string | | [QRegularExpressionMatchIterator](qregularexpressionmatchiterator) | Iterator on the results of a global match of a QRegularExpression object against a string | | [QSet](qset) | Template class that provides a hash-table-based set | | [QSqlField](qsqlfield) | Manipulates the fields in SQL database tables and views | | [QSqlQuery](qsqlquery) | Means of executing and manipulating SQL statements | | [QSqlRecord](qsqlrecord) | Encapsulates a database record | | [QSslCertificate](qsslcertificate) | Convenient API for an X509 certificate | | [QSslCertificateExtension](qsslcertificateextension) | API for accessing the extensions of an X509 certificate | | [QSslCipher](qsslcipher) | Represents an SSL cryptographic cipher | | [QSslConfiguration](qsslconfiguration) | Holds the configuration and state of an SSL connection | | [QSslDiffieHellmanParameters](qssldiffiehellmanparameters) | Interface for Diffie-Hellman parameters for servers | | [QSslError](qsslerror) | SSL error | | [QSslKey](qsslkey) | Interface for private and public keys | | [QSslPreSharedKeyAuthenticator](qsslpresharedkeyauthenticator) | Authentication data for pre shared keys (PSK) ciphersuites | | [QStack](qstack) | Template class that provides a stack | | [QStaticText](qstatictext) | Enables optimized drawing of text when the text and its layout is updated rarely | | [QStorageInfo](qstorageinfo) | Provides information about currently mounted storage and drives | | [QString](qstring) | Unicode character string | | [QStringList](qstringlist) | List of strings | | [QTextBlockFormat](qtextblockformat) | Formatting information for blocks of text in a QTextDocument | | [QTextBoundaryFinder](qtextboundaryfinder) | Way of finding Unicode text boundaries in a string | | [QTextCharFormat](qtextcharformat) | Formatting information for characters in a QTextDocument | | [QTextCursor](qtextcursor) | Offers an API to access and modify QTextDocuments | | [QTextDocumentFragment](qtextdocumentfragment) | Represents a piece of formatted text from a QTextDocument | | [QTextFormat](qtextformat) | Formatting information for a QTextDocument | | [QTextFrameFormat](qtextframeformat) | Formatting information for frames in a QTextDocument | | [QTextImageFormat](qtextimageformat) | Formatting information for images in a QTextDocument | | [QTextListFormat](qtextlistformat) | Formatting information for lists in a QTextDocument | | [QTextTableCellFormat](qtexttablecellformat) | Formatting information for table cells in a QTextDocument | | [QTextTableFormat](qtexttableformat) | Formatting information for tables in a QTextDocument | | [QUrl](qurl) | Convenient interface for working with URLs | | [QUrlQuery](qurlquery) | Way to manipulate a key-value pairs in a URL's query | | [QVariant](qvariant) | Acts like a union for the most common Qt data types | qt QSystemTrayIcon Class QSystemTrayIcon Class ===================== The QSystemTrayIcon class provides an icon for an application in the system tray. [More...](#details) | | | | --- | --- | | Header: | #include <QSystemTrayIcon> | | CMake: | find\_package(Qt6 COMPONENTS Widgets REQUIRED) target\_link\_libraries(mytarget PRIVATE Qt6::Widgets) | | qmake: | QT += widgets | | Inherits: | [QObject](qobject) | * [List of all members, including inherited members](https://doc.qt.io/qt-6.2/qsystemtrayicon-members.html) Public Types ------------ | | | | --- | --- | | enum | **[ActivationReason](qsystemtrayicon#ActivationReason-enum)** { Unknown, Context, DoubleClick, Trigger, MiddleClick } | | enum | **[MessageIcon](qsystemtrayicon#MessageIcon-enum)** { NoIcon, Information, Warning, Critical } | Properties ---------- * **[icon](qsystemtrayicon#icon-prop)** : QIcon * **[toolTip](qsystemtrayicon#toolTip-prop)** : QString * **[visible](qsystemtrayicon#visible-prop)** : bool Public Functions ---------------- | | | | --- | --- | | | **[QSystemTrayIcon](qsystemtrayicon#QSystemTrayIcon-1)**(const QIcon &*icon*, QObject \**parent* = nullptr) | | | **[QSystemTrayIcon](qsystemtrayicon#QSystemTrayIcon)**(QObject \**parent* = nullptr) | | virtual | **[~QSystemTrayIcon](qsystemtrayicon#dtor.QSystemTrayIcon)**() | | QMenu \* | **[contextMenu](qsystemtrayicon#contextMenu)**() const | | QRect | **[geometry](qsystemtrayicon#geometry)**() const | | QIcon | **[icon](qsystemtrayicon#icon-prop)**() const | | bool | **[isVisible](qsystemtrayicon#visible-prop)**() const | | void | **[setContextMenu](qsystemtrayicon#setContextMenu)**(QMenu \**menu*) | | void | **[setIcon](qsystemtrayicon#icon-prop)**(const QIcon &*icon*) | | void | **[setToolTip](qsystemtrayicon#toolTip-prop)**(const QString &*tip*) | | QString | **[toolTip](qsystemtrayicon#toolTip-prop)**() const | Public Slots ------------ | | | | --- | --- | | void | **[hide](qsystemtrayicon#hide)**() | | void | **[setVisible](qsystemtrayicon#visible-prop)**(bool *visible*) | | void | **[show](qsystemtrayicon#show)**() | | void | **[showMessage](qsystemtrayicon#showMessage)**(const QString &*title*, const QString &*message*, QSystemTrayIcon::MessageIcon *icon* = QSystemTrayIcon::Information, int *millisecondsTimeoutHint* = 10000) | | void | **[showMessage](qsystemtrayicon#showMessage-1)**(const QString &*title*, const QString &*message*, const QIcon &*icon*, int *millisecondsTimeoutHint* = 10000) | Signals ------- | | | | --- | --- | | void | **[activated](qsystemtrayicon#activated)**(QSystemTrayIcon::ActivationReason *reason*) | | void | **[messageClicked](qsystemtrayicon#messageClicked)**() | Static Public Members --------------------- | | | | --- | --- | | bool | **[isSystemTrayAvailable](qsystemtrayicon#isSystemTrayAvailable)**() | | bool | **[supportsMessages](qsystemtrayicon#supportsMessages)**() | Reimplemented Protected Functions --------------------------------- | | | | --- | --- | | virtual bool | **[event](qsystemtrayicon#event)**(QEvent \**e*) override | Detailed Description -------------------- Modern operating systems usually provide a special area on the desktop, called the *system tray* or *notification area*, where long-running applications can display icons and short messages. The QSystemTrayIcon class can be used on the following platforms: * All supported versions of Windows. * All window managers and independent tray implementations for X11 that implement the [http://standards.freedesktop.org/systemtray-spec/systemtray-spec-0.2.html freedesktop.org](http://standards.freedesktop.org/systemtray-spec/systemtray-spec-0.2.html%20freedesktop.org) XEmbed system tray specification. * All X11 desktop environments that implement the D-Bus <http://www.freedesktop.org/wiki/Specifications/StatusNotifierItem/StatusNotifierItem> specification, including recent versions of KDE and Unity. * All supported versions of macOS. To check whether a system tray is present on the user's desktop, call the [QSystemTrayIcon::isSystemTrayAvailable](qsystemtrayicon#isSystemTrayAvailable)() static function. To add a system tray entry, create a QSystemTrayIcon object, call [setContextMenu](qsystemtrayicon#setContextMenu)() to provide a context menu for the icon, and call [show](qsystemtrayicon#show)() to make it visible in the system tray. Status notification messages ("balloon messages") can be displayed at any time using [showMessage](qsystemtrayicon#showMessage)(). If the system tray is unavailable when a system tray icon is constructed, but becomes available later, QSystemTrayIcon will automatically add an entry for the application in the system tray if the icon is [visible](qsystemtrayicon#visible-prop). The [activated](qsystemtrayicon#activated)() signal is emitted when the user activates the icon. Only on X11, when a tooltip is requested, the QSystemTrayIcon receives a [QHelpEvent](qhelpevent) of type [QEvent::ToolTip](qevent#Type-enum). Additionally, the QSystemTrayIcon receives wheel events of type [QEvent::Wheel](qevent#Type-enum). These are not supported on any other platform. **See also** [QDesktopServices](qdesktopservices), [Desktop Integration](desktop-integration), and [System Tray Icon Example](https://doc.qt.io/qt-6.2/qtwidgets-desktop-systray-example.html). Member Type Documentation ------------------------- ### enum QSystemTrayIcon::ActivationReason This enum describes the reason the system tray was activated. | Constant | Value | Description | | --- | --- | --- | | `QSystemTrayIcon::Unknown` | `0` | Unknown reason | | `QSystemTrayIcon::Context` | `1` | The context menu for the system tray entry was requested | | `QSystemTrayIcon::DoubleClick` | `2` | The system tray entry was double clicked. | **Note:** On macOS, a double click will only be emitted if no context menu is set, since the menu opens on mouse press | Constant | Value | Description | | --- | --- | --- | | `QSystemTrayIcon::Trigger` | `3` | The system tray entry was clicked | | `QSystemTrayIcon::MiddleClick` | `4` | The system tray entry was clicked with the middle mouse button | **See also** [activated](qsystemtrayicon#activated)(). ### enum QSystemTrayIcon::MessageIcon This enum describes the icon that is shown when a balloon message is displayed. | Constant | Value | Description | | --- | --- | --- | | `QSystemTrayIcon::NoIcon` | `0` | No icon is shown. | | `QSystemTrayIcon::Information` | `1` | An information icon is shown. | | `QSystemTrayIcon::Warning` | `2` | A standard warning icon is shown. | | `QSystemTrayIcon::Critical` | `3` | A critical warning icon is shown. | **See also** [QMessageBox](qmessagebox). Property Documentation ---------------------- ### icon : [QIcon](qicon) This property holds the system tray icon On Windows, the system tray icon size is 16x16; on X11, the preferred size is 22x22. The icon will be scaled to the appropriate size as necessary. **Access functions:** | | | | --- | --- | | QIcon | **icon**() const | | void | **setIcon**(const QIcon &*icon*) | ### toolTip : [QString](qstring) This property holds the tooltip for the system tray entry On some systems, the tooltip's length is limited. The tooltip will be truncated if necessary. **Access functions:** | | | | --- | --- | | QString | **toolTip**() const | | void | **setToolTip**(const QString &*tip*) | ### visible : bool This property holds whether the system tray entry is visible Setting this property to true or calling [show](qsystemtrayicon#show)() makes the system tray icon visible; setting this property to false or calling [hide](qsystemtrayicon#hide)() hides it. **Access functions:** | | | | --- | --- | | bool | **isVisible**() const | | void | **setVisible**(bool *visible*) | Member Function Documentation ----------------------------- ### QSystemTrayIcon::QSystemTrayIcon(const [QIcon](qicon) &*icon*, [QObject](qobject#QObject) \**parent* = nullptr) Constructs a QSystemTrayIcon object with the given *icon* and *parent*. The icon is initially invisible. **See also** [visible](qsystemtrayicon#visible-prop). ### QSystemTrayIcon::QSystemTrayIcon([QObject](qobject#QObject) \**parent* = nullptr) Constructs a QSystemTrayIcon object with the given *parent*. The icon is initially invisible. **See also** [visible](qsystemtrayicon#visible-prop). ### `[signal]` void QSystemTrayIcon::activated([QSystemTrayIcon::ActivationReason](qsystemtrayicon#ActivationReason-enum) *reason*) This signal is emitted when the user activates the system tray icon. *reason* specifies the reason for activation. [QSystemTrayIcon::ActivationReason](qsystemtrayicon#ActivationReason-enum) enumerates the various reasons. **See also** [QSystemTrayIcon::ActivationReason](qsystemtrayicon#ActivationReason-enum). ### `[slot]` void QSystemTrayIcon::hide() Hides the system tray entry. **See also** [show](qsystemtrayicon#show)() and [visible](qsystemtrayicon#visible-prop). ### `[signal]` void QSystemTrayIcon::messageClicked() This signal is emitted when the message displayed using [showMessage](qsystemtrayicon#showMessage)() was clicked by the user. **Note:** We follow Microsoft Windows behavior, so the signal is also emitted when the user clicks on a tray icon with a balloon message displayed. **See also** [activated](qsystemtrayicon#activated)(). ### `[slot]` void QSystemTrayIcon::show() Shows the icon in the system tray. **See also** [hide](qsystemtrayicon#hide)() and [visible](qsystemtrayicon#visible-prop). ### `[slot]` void QSystemTrayIcon::showMessage(const [QString](qstring) &*title*, const [QString](qstring) &*message*, [QSystemTrayIcon::MessageIcon](qsystemtrayicon#MessageIcon-enum) *icon* = QSystemTrayIcon::Information, int *millisecondsTimeoutHint* = 10000) Shows a balloon message for the entry with the given *title*, *message* and *icon* for the time specified in *millisecondsTimeoutHint*. *title* and *message* must be plain text strings. Message can be clicked by the user; the [messageClicked](qsystemtrayicon#messageClicked)() signal will emitted when this occurs. Note that display of messages are dependent on the system configuration and user preferences, and that messages may not appear at all. Hence, it should not be relied upon as the sole means for providing critical information. On Windows, the *millisecondsTimeoutHint* is usually ignored by the system when the application has focus. Has been turned into a slot in Qt 5.2. **See also** [show](qsystemtrayicon#show)() and [supportsMessages](qsystemtrayicon#supportsMessages)(). ### `[slot, since 5.9]` void QSystemTrayIcon::showMessage(const [QString](qstring) &*title*, const [QString](qstring) &*message*, const [QIcon](qicon) &*icon*, int *millisecondsTimeoutHint* = 10000) This function overloads showMessage(). Shows a balloon message for the entry with the given *title*, *message*, and custom icon *icon* for the time specified in *millisecondsTimeoutHint*. This function was introduced in Qt 5.9. ### `[virtual]` QSystemTrayIcon::~QSystemTrayIcon() Removes the icon from the system tray and frees all allocated resources. ### [QMenu](qmenu) \*QSystemTrayIcon::contextMenu() const Returns the current context menu for the system tray entry. **See also** [setContextMenu](qsystemtrayicon#setContextMenu)(). ### `[override virtual protected]` bool QSystemTrayIcon::event([QEvent](qevent) \**e*) Reimplements: [QObject::event](qobject#event)(QEvent \*e). ### [QRect](qrect) QSystemTrayIcon::geometry() const Returns the geometry of the system tray icon in screen coordinates. **See also** [visible](qsystemtrayicon#visible-prop). ### `[static]` bool QSystemTrayIcon::isSystemTrayAvailable() Returns `true` if the system tray is available; otherwise returns `false`. If the system tray is currently unavailable but becomes available later, [QSystemTrayIcon](qsystemtrayicon) will automatically add an entry in the system tray if it is [visible](qsystemtrayicon#visible-prop). ### void QSystemTrayIcon::setContextMenu([QMenu](qmenu) \**menu*) Sets the specified *menu* to be the context menu for the system tray icon. The menu will pop up when the user requests the context menu for the system tray icon by clicking the mouse button. On macOS, this is currently converted to a NSMenu, so the aboutToHide() signal is not emitted. **Note:** The system tray icon does not take ownership of the menu. You must ensure that it is deleted at the appropriate time by, for example, creating the menu with a suitable parent object. **See also** [contextMenu](qsystemtrayicon#contextMenu)(). ### `[static]` bool QSystemTrayIcon::supportsMessages() Returns `true` if the system tray supports balloon messages; otherwise returns `false`. **See also** [showMessage](qsystemtrayicon#showMessage)().
programming_docs
qt Positioning with Anchors Positioning with Anchors ======================== In addition to the more traditional [Grid](qml-qtquick-grid), [Row](qml-qtquick-row), and [Column](qml-qtquick-column), Qt Quick also provides a way to layout items using the concept of *anchors*. Each item can be thought of as having a set of 7 invisible "anchor lines": [left](qml-qtquick-item#anchors.left-prop), [horizontalCenter](qml-qtquick-item#anchors.horizontalCenter-prop), [right](qml-qtquick-item#anchors.right-prop), [top](qml-qtquick-item#anchors.top-prop), [verticalCenter](qml-qtquick-item#anchors.verticalCenter-prop), [baseline](qml-qtquick-item#anchors.baseline-prop), and [bottom](qml-qtquick-item#anchors.bottom-prop). The baseline (not pictured above) corresponds to the imaginary line on which text would sit. For items with no text it is the same as *top*. The Qt Quick anchoring system allows you to define relationships between the anchor lines of different items. For example, you can write: ``` Rectangle { id: rect1; ... } Rectangle { id: rect2; anchors.left: rect1.right; ... } ``` In this case, the left edge of *rect2* is bound to the right edge of *rect1*, producing the following: You can specify multiple anchors. For example: ``` Rectangle { id: rect1; ... } Rectangle { id: rect2; anchors.left: rect1.right; anchors.top: rect1.bottom; ... } ``` By specifying multiple horizontal or vertical anchors you can control the size of an item. Below, *rect2* is anchored to the right of *rect1* and the left of *rect3*. If either of the blue rectangles are moved, *rect2* will stretch and shrink as necessary: ``` Rectangle { id: rect1; x: 0; ... } Rectangle { id: rect2; anchors.left: rect1.right; anchors.right: rect3.left; ... } Rectangle { id: rect3; x: 150; ... } ``` There are also some convenience anchors. anchors.fill is a convenience that is the same as setting the left,right,top and bottom anchors to the left,right,top and bottom of the target item. anchors.centerIn is another convenience anchor, and is the same as setting the verticalCenter and horizontalCenter anchors to the verticalCenter and horizontalCenter of the target item. Anchor Margins and Offsets -------------------------- The anchoring system also allows *margins* and *offsets* to be specified for an item's anchors. Margins specify the amount of empty space to leave to the outside of an item's anchor, while offsets allow positioning to be manipulated using the center anchor lines. An item can specify its anchor margins individually through [leftMargin](qml-qtquick-item#anchors.leftMargin-prop), [rightMargin](qml-qtquick-item#anchors.rightMargin-prop), [topMargin](qml-qtquick-item#anchors.topMargin-prop) and [bottomMargin](qml-qtquick-item#anchors.bottomMargin-prop), or use [anchors.margins](qml-qtquick-item#anchors.margins-prop) to specify the same margin value for all four edges. Anchor offsets are specified using [horizontalCenterOffset](qml-qtquick-item#anchors.horizontalCenterOffset-prop), [verticalCenterOffset](qml-qtquick-item#anchors.verticalCenterOffset-prop) and [baselineOffset](qml-qtquick-item#anchors.baselineOffset-prop). The following example specifies a left margin: ``` Rectangle { id: rect1; ... } Rectangle { id: rect2; anchors.left: rect1.right; anchors.leftMargin: 5; ... } ``` In this case, a margin of 5 pixels is reserved to the left of *rect2*, producing the following: **Note:** Anchor margins only apply to anchors; they are *not* a generic means of applying margins to an [Item](qml-qtquick-item). If an anchor margin is specified for an edge but the item is not anchored to any item on that edge, the margin is not applied. Changing Anchors ---------------- Qt Quick provides the [AnchorChanges](qml-qtquick-anchorchanges) type for specifying the anchors in a state. ``` State { name: "anchorRight" AnchorChanges { target: rect2 anchors.right: parent.right anchors.left: undefined //remove the left anchor } } ``` [AnchorChanges](qml-qtquick-anchorchanges) can be animated using the [AnchorAnimation](qml-qtquick-anchoranimation) type. ``` Transition { AnchorAnimation {} //animates any AnchorChanges in the corresponding state change } ``` Anchors can also be changed imperatively within JavaScript. However, these changes should be carefully ordered, or they may produce unexpected outcomes. The following example illustrates the issue: | | | | --- | --- | | ``` //bad code Rectangle { width: 50 anchors.left: parent.left function reanchorToRight() { anchors.right = parent.right anchors.left = undefined } } ``` | | When `reanchorToRight` is called, the function first sets the right anchor. At that point, both left and right anchors are set, and the item will be stretched horizontally to fill its parent. When the left anchor is unset, the new width will remain. Thus when updating anchors within JavaScript, you should first unset any anchors that are no longer required, and only then set any new anchors that are required, as shown below: | | | | --- | --- | | ``` Rectangle { width: 50 anchors.left: parent.left function reanchorToRight() { anchors.left = undefined anchors.right = parent.right } } ``` | | Because the evaluation order of bindings is not defined, it is not recommended to change anchors via conditional bindings, as this can lead to the ordering issue described above. In the following example the Rectangle will eventually grow to the full width of its parent, because both left and right anchors will be simultaneously set during binding update. ``` //bad code Rectangle { width: 50; height: 50 anchors.left: state == "right" ? undefined : parent.left; anchors.right: state == "right" ? parent.right : undefined; } ``` This should be rewritten to use [AnchorChanges](qml-qtquick-anchorchanges) instead, as [AnchorChanges](qml-qtquick-anchorchanges) will automatically handle ordering issues internally. Restrictions ------------ For performance reasons, you can only anchor an item to its siblings and direct parent. For example, the following anchor is invalid and would produce a warning: ``` //bad code Item { id: group1 Rectangle { id: rect1; ... } } Item { id: group2 Rectangle { id: rect2; anchors.left: rect1.right; ... } // invalid anchor! } ``` Also, anchor-based layouts cannot be mixed with absolute positioning. If an item specifies its [x](qml-qtquick-item#x-prop) position and also sets [anchors.left](qml-qtquick-item#anchors.left-prop), or anchors its left and right edges but additionally sets a [width](qml-qtquick-item#width-prop), the result is undefined, as it would not be clear whether the item should use anchoring or absolute positioning. The same can be said for setting an item's [y](qml-qtquick-item#y-prop) and [height](qml-qtquick-item#height-prop) with [anchors.top](qml-qtquick-item#anchors.top-prop) and [anchors.bottom](qml-qtquick-item#anchors.bottom-prop), or setting [anchors.fill](qml-qtquick-item#anchors.fill-prop) as well as [width](qml-qtquick-item#width-prop) or [height](qml-qtquick-item#height-prop). The same applies when using positioners such as Row and Grid, which may set the item's [x](qml-qtquick-item#x-prop) and [y](qml-qtquick-item#y-prop) properties. If you wish to change from using anchor-based to absolute positioning, you can clear an anchor value by setting it to `undefined`. qt QAbstractOAuth2 Class QAbstractOAuth2 Class ===================== The QAbstractOAuth2 class is the base of all implementations of OAuth 2 authentication methods. [More...](#details) | | | | --- | --- | | Header: | #include <QAbstractOAuth2> | | CMake: | find\_package(Qt6 COMPONENTS NetworkAuth REQUIRED) target\_link\_libraries(mytarget PRIVATE Qt6::NetworkAuth) | | qmake: | QT += networkauth | | Since: | Qt 5.8 | | Inherits: | [QAbstractOAuth](qabstractoauth) | | Inherited By: | [QOAuth2AuthorizationCodeFlow](qoauth2authorizationcodeflow) | * [List of all members, including inherited members](https://doc.qt.io/qt-6.2/qabstractoauth2-members.html) Properties ---------- | | | | --- | --- | | * **[clientIdentifierSharedKey](qabstractoauth2#clientIdentifierSharedKey-prop)** : QString * **[expiration](qabstractoauth2#expiration-prop)** : const QDateTime * **[scope](qabstractoauth2#scope-prop)** : QString | * **[state](qabstractoauth2#state-prop)** : QString * **[userAgent](qabstractoauth2#userAgent-prop)** : QString | Public Functions ---------------- | | | | --- | --- | | | **[QAbstractOAuth2](qabstractoauth2#QAbstractOAuth2-1)**(QNetworkAccessManager \**manager*, QObject \**parent* = nullptr) | | | **[QAbstractOAuth2](qabstractoauth2#QAbstractOAuth2)**(QObject \**parent* = nullptr) | | virtual | **[~QAbstractOAuth2](qabstractoauth2#dtor.QAbstractOAuth2)**() | | QString | **[clientIdentifierSharedKey](qabstractoauth2#clientIdentifierSharedKey-prop)**() const | | virtual QUrl | **[createAuthenticatedUrl](qabstractoauth2#createAuthenticatedUrl)**(const QUrl &*url*, const QVariantMap &*parameters* = QVariantMap()) | | QDateTime | **[expirationAt](qabstractoauth2#expiration-prop)**() const | | virtual QNetworkReply \* | **[post](qabstractoauth2#post-1)**(const QUrl &*url*, const QByteArray &*data*) | | virtual QNetworkReply \* | **[post](qabstractoauth2#post-2)**(const QUrl &*url*, QHttpMultiPart \**multiPart*) | | virtual QNetworkReply \* | **[put](qabstractoauth2#put-1)**(const QUrl &*url*, const QByteArray &*data*) | | virtual QNetworkReply \* | **[put](qabstractoauth2#put-2)**(const QUrl &*url*, QHttpMultiPart \**multiPart*) | | QString | **[refreshToken](qabstractoauth2#refreshToken)**() const | | QString | **[responseType](qabstractoauth2#responseType)**() const | | QString | **[scope](qabstractoauth2#scope-prop)**() const | | void | **[setClientIdentifierSharedKey](qabstractoauth2#clientIdentifierSharedKey-prop)**(const QString &*clientIdentifierSharedKey*) | | void | **[setRefreshToken](qabstractoauth2#setRefreshToken)**(const QString &*refreshToken*) | | void | **[setScope](qabstractoauth2#scope-prop)**(const QString &*scope*) | | void | **[setState](qabstractoauth2#state-prop)**(const QString &*state*) | | void | **[setUserAgent](qabstractoauth2#userAgent-prop)**(const QString &*userAgent*) | | QString | **[state](qabstractoauth2#state-prop)**() const | | QString | **[userAgent](qabstractoauth2#userAgent-prop)**() const | Reimplemented Public Functions ------------------------------ | | | | --- | --- | | virtual QNetworkReply \* | **[deleteResource](qabstractoauth2#deleteResource)**(const QUrl &*url*, const QVariantMap &*parameters* = QVariantMap()) override | | virtual QNetworkReply \* | **[get](qabstractoauth2#get)**(const QUrl &*url*, const QVariantMap &*parameters* = QVariantMap()) override | | virtual QNetworkReply \* | **[head](qabstractoauth2#head)**(const QUrl &*url*, const QVariantMap &*parameters* = QVariantMap()) override | | virtual QNetworkReply \* | **[post](qabstractoauth2#post)**(const QUrl &*url*, const QVariantMap &*parameters* = QVariantMap()) override | | virtual void | **[prepareRequest](qabstractoauth2#prepareRequest)**(QNetworkRequest \**request*, const QByteArray &*verb*, const QByteArray &*body* = QByteArray()) override | | virtual QNetworkReply \* | **[put](qabstractoauth2#put)**(const QUrl &*url*, const QVariantMap &*parameters* = QVariantMap()) override | Signals ------- | | | | --- | --- | | void | **[authorizationCallbackReceived](qabstractoauth2#authorizationCallbackReceived)**(const QVariantMap &*data*) | | void | **[clientIdentifierSharedKeyChanged](qabstractoauth2#clientIdentifierSharedKey-prop)**(const QString &*clientIdentifierSharedKey*) | | void | **[error](qabstractoauth2#error)**(const QString &*error*, const QString &*errorDescription*, const QUrl &*uri*) | | void | **[expirationAtChanged](qabstractoauth2#expiration-prop)**(const QDateTime &*expiration*) | | void | **[refreshTokenChanged](qabstractoauth2#refreshToken-prop)**(const QString &*refreshToken*) | | void | **[scopeChanged](qabstractoauth2#scope-prop)**(const QString &*scope*) | | void | **[stateChanged](qabstractoauth2#state-prop)**(const QString &*state*) | | void | **[userAgentChanged](qabstractoauth2#userAgent-prop)**(const QString &*userAgent*) | Detailed Description -------------------- The class defines the basic interface of the OAuth 2 authentication classes. By inheriting this class, you can create custom authentication methods using the OAuth 2 standard for different web services. A description of how OAuth 2 works can be found in: [The OAuth 2.0 Authorization Framework](https://tools.ietf.org/html/rfc6749) Property Documentation ---------------------- ### clientIdentifierSharedKey : [QString](qstring) This property holds the client shared key used as a password if the server requires authentication to request the token. **Access functions:** | | | | --- | --- | | QString | **clientIdentifierSharedKey**() const | | void | **setClientIdentifierSharedKey**(const QString &*clientIdentifierSharedKey*) | **Notifier signal:** | | | | --- | --- | | void | **clientIdentifierSharedKeyChanged**(const QString &*clientIdentifierSharedKey*) | ### `[read-only]` expiration : const [QDateTime](qdatetime) This property holds the expiration time of the current access token. **Access functions:** | | | | --- | --- | | QDateTime | **expirationAt**() const | **Notifier signal:** | | | | --- | --- | | void | **expirationAtChanged**(const QDateTime &*expiration*) | ### scope : [QString](qstring) This property holds the desired scope which defines the permissions requested by the client. **Access functions:** | | | | --- | --- | | QString | **scope**() const | | void | **setScope**(const QString &*scope*) | **Notifier signal:** | | | | --- | --- | | void | **scopeChanged**(const QString &*scope*) | ### state : [QString](qstring) This property holds the string sent to the server during authentication. The state is used to identify and validate the request when the callback is received. **Access functions:** | | | | --- | --- | | QString | **state**() const | | void | **setState**(const QString &*state*) | **Notifier signal:** | | | | --- | --- | | void | **stateChanged**(const QString &*state*) | ### userAgent : [QString](qstring) This property holds the User-Agent header used to create the network requests. The default value is "QtOAuth/1.0 (+https://www.qt.io)". **Access functions:** | | | | --- | --- | | QString | **userAgent**() const | | void | **setUserAgent**(const QString &*userAgent*) | **Notifier signal:** | | | | --- | --- | | void | **userAgentChanged**(const QString &*userAgent*) | Member Function Documentation ----------------------------- ### QAbstractOAuth2::QAbstractOAuth2([QNetworkAccessManager](qnetworkaccessmanager) \**manager*, [QObject](qobject#QObject) \**parent* = nullptr) Constructs a QAbstractOAuth2 object using *parent* as parent and sets *manager* as the network access manager. ### QAbstractOAuth2::QAbstractOAuth2([QObject](qobject#QObject) \**parent* = nullptr) Constructs a QAbstractOAuth2 object using *parent* as parent. ### `[signal]` void QAbstractOAuth2::authorizationCallbackReceived(const QVariantMap &*data*) Signal emitted when the reply server receives the authorization callback from the server: *data* contains the values received from the server. ### `[signal]` void QAbstractOAuth2::error(const [QString](qstring) &*error*, const [QString](qstring) &*errorDescription*, const [QUrl](qurl) &*uri*) Signal emitted when the server responds to the request with an error: *error* is the name of the error; *errorDescription* describes the error and *uri* is an optional URI containing more information about the error. ### `[virtual]` QAbstractOAuth2::~QAbstractOAuth2() Destroys the [QAbstractOAuth2](qabstractoauth2) instance. ### `[virtual invokable]` [QUrl](qurl) QAbstractOAuth2::createAuthenticatedUrl(const [QUrl](qurl) &*url*, const QVariantMap &*parameters* = QVariantMap()) The returned URL is based on *url*, combining it with the given *parameters* and the access token. **Note:** This function can be invoked via the meta-object system and from QML. See [Q\_INVOKABLE](qobject#Q_INVOKABLE). ### `[override virtual invokable]` [QNetworkReply](qnetworkreply) \*QAbstractOAuth2::deleteResource(const [QUrl](qurl) &*url*, const QVariantMap &*parameters* = QVariantMap()) Reimplements: [QAbstractOAuth::deleteResource](qabstractoauth#deleteResource)(const QUrl &url, const QVariantMap &parameters). Sends an authenticated DELETE request and returns a new [QNetworkReply](qnetworkreply). The *url* and *parameters* are used to create the request. **See also**: [Hypertext Transfer Protocol -- HTTP/1.1: DELETE](https://tools.ietf.org/html/rfc2616#section-9.7) **Note:** This function can be invoked via the meta-object system and from QML. See [Q\_INVOKABLE](qobject#Q_INVOKABLE). ### `[override virtual invokable]` [QNetworkReply](qnetworkreply) \*QAbstractOAuth2::get(const [QUrl](qurl) &*url*, const QVariantMap &*parameters* = QVariantMap()) Reimplements: [QAbstractOAuth::get](qabstractoauth#get)(const QUrl &url, const QVariantMap &parameters). Sends an authenticated GET request and returns a new [QNetworkReply](qnetworkreply). The *url* and *parameters* are used to create the request. **See also**: [Hypertext Transfer Protocol -- HTTP/1.1: GET](https://tools.ietf.org/html/rfc2616#section-9.3) **Note:** This function can be invoked via the meta-object system and from QML. See [Q\_INVOKABLE](qobject#Q_INVOKABLE). ### `[override virtual invokable]` [QNetworkReply](qnetworkreply) \*QAbstractOAuth2::head(const [QUrl](qurl) &*url*, const QVariantMap &*parameters* = QVariantMap()) Reimplements: [QAbstractOAuth::head](qabstractoauth#head)(const QUrl &url, const QVariantMap &parameters). Sends an authenticated HEAD request and returns a new [QNetworkReply](qnetworkreply). The *url* and *parameters* are used to create the request. **See also**: [Hypertext Transfer Protocol -- HTTP/1.1: HEAD](https://tools.ietf.org/html/rfc2616#section-9.4) **Note:** This function can be invoked via the meta-object system and from QML. See [Q\_INVOKABLE](qobject#Q_INVOKABLE). ### `[override virtual invokable]` [QNetworkReply](qnetworkreply) \*QAbstractOAuth2::post(const [QUrl](qurl) &*url*, const QVariantMap &*parameters* = QVariantMap()) Reimplements: [QAbstractOAuth::post](qabstractoauth#post)(const QUrl &url, const QVariantMap &parameters). Sends an authenticated POST request and returns a new [QNetworkReply](qnetworkreply). The *url* and *parameters* are used to create the request. **See also**: [Hypertext Transfer Protocol -- HTTP/1.1: POST](https://tools.ietf.org/html/rfc2616#section-9.5) **Note:** This function can be invoked via the meta-object system and from QML. See [Q\_INVOKABLE](qobject#Q_INVOKABLE). ### `[virtual invokable, since 5.10]` [QNetworkReply](qnetworkreply) \*QAbstractOAuth2::post(const [QUrl](qurl) &*url*, const [QByteArray](qbytearray) &*data*) This is an overloaded function. Sends an authenticated POST request and returns a new [QNetworkReply](qnetworkreply). The *url* and *data* are used to create the request. {Hypertext Transfer Protocol -- HTTP/1.1: POST} **Note:** This function can be invoked via the meta-object system and from QML. See [Q\_INVOKABLE](qobject#Q_INVOKABLE). This function was introduced in Qt 5.10. **See also** [post](qabstractoauth2#post)() and <https://tools.ietf.org/html/rfc2616#section-9.6>. ### `[virtual invokable, since 5.10]` [QNetworkReply](qnetworkreply) \*QAbstractOAuth2::post(const [QUrl](qurl) &*url*, [QHttpMultiPart](qhttpmultipart) \**multiPart*) This is an overloaded function. Sends an authenticated POST request and returns a new [QNetworkReply](qnetworkreply). The *url* and *multiPart* are used to create the request. {Hypertext Transfer Protocol -- HTTP/1.1: POST} **Note:** This function can be invoked via the meta-object system and from QML. See [Q\_INVOKABLE](qobject#Q_INVOKABLE). This function was introduced in Qt 5.10. **See also** [post](qabstractoauth2#post)(), [QHttpMultiPart](qhttpmultipart), and <https://tools.ietf.org/html/rfc2616#section-9.6>. ### `[override virtual]` void QAbstractOAuth2::prepareRequest([QNetworkRequest](qnetworkrequest) \**request*, const [QByteArray](qbytearray) &*verb*, const [QByteArray](qbytearray) &*body* = QByteArray()) Reimplements: [QAbstractOAuth::prepareRequest](qabstractoauth#prepareRequest)(QNetworkRequest \*request, const QByteArray &verb, const QByteArray &body). ### `[override virtual invokable]` [QNetworkReply](qnetworkreply) \*QAbstractOAuth2::put(const [QUrl](qurl) &*url*, const QVariantMap &*parameters* = QVariantMap()) Reimplements: [QAbstractOAuth::put](qabstractoauth#put)(const QUrl &url, const QVariantMap &parameters). Sends an authenticated PUT request and returns a new [QNetworkReply](qnetworkreply). The *url* and *parameters* are used to create the request. **See also**: [Hypertext Transfer Protocol -- HTTP/1.1: PUT](https://tools.ietf.org/html/rfc2616#section-9.6) **Note:** This function can be invoked via the meta-object system and from QML. See [Q\_INVOKABLE](qobject#Q_INVOKABLE). ### `[virtual invokable, since 5.10]` [QNetworkReply](qnetworkreply) \*QAbstractOAuth2::put(const [QUrl](qurl) &*url*, const [QByteArray](qbytearray) &*data*) This is an overloaded function. Sends an authenticated PUT request and returns a new [QNetworkReply](qnetworkreply). The *url* and *data* are used to create the request. {Hypertext Transfer Protocol -- HTTP/1.1: PUT} **Note:** This function can be invoked via the meta-object system and from QML. See [Q\_INVOKABLE](qobject#Q_INVOKABLE). This function was introduced in Qt 5.10. **See also** [put](qabstractoauth2#put)() and <https://tools.ietf.org/html/rfc2616#section-9.6>. ### `[virtual invokable, since 5.10]` [QNetworkReply](qnetworkreply) \*QAbstractOAuth2::put(const [QUrl](qurl) &*url*, [QHttpMultiPart](qhttpmultipart) \**multiPart*) This is an overloaded function. Sends an authenticated PUT request and returns a new [QNetworkReply](qnetworkreply). The *url* and *multiPart* are used to create the request. {Hypertext Transfer Protocol -- HTTP/1.1: PUT} **Note:** This function can be invoked via the meta-object system and from QML. See [Q\_INVOKABLE](qobject#Q_INVOKABLE). This function was introduced in Qt 5.10. **See also** [put](qabstractoauth2#put)(), [QHttpMultiPart](qhttpmultipart), and <https://tools.ietf.org/html/rfc2616#section-9.6>. ### [QString](qstring) QAbstractOAuth2::refreshToken() const Gets the current refresh token. Refresh tokens usually have longer lifespans than access tokens, so it makes sense to save them for later use. Returns the current refresh token or an empty string, if there is no refresh token available. **Note:** Getter function for property refreshToken. **See also** [setRefreshToken](qabstractoauth2#setRefreshToken)(). ### [QString](qstring) QAbstractOAuth2::responseType() const Returns the [response\_type](https://tools.ietf.org/html/rfc6749#section-3.1.1) used. ### void QAbstractOAuth2::setRefreshToken(const [QString](qstring) &*refreshToken*) Sets the new refresh token *refreshToken* to be used. A custom refresh token can be used to refresh the access token via this method and then the access token can be refreshed via [QOAuth2AuthorizationCodeFlow::refreshAccessToken](qoauth2authorizationcodeflow#refreshAccessToken)(). **Note:** Setter function for property [refreshToken](qabstractoauth2#refreshToken). **See also** [refreshToken](qabstractoauth2#refreshToken)().
programming_docs
qt Object3D QML Type Object3D QML Type ================= Abstract base type of all 3D nodes and resources. [More...](#details) | | | | --- | --- | | Import Statement: | import QtQuick3D | | Instantiates: | [QQuick3DObject](qquick3dobject) | | Inherits: | [QtObject](qml-qtqml-qtobject) | | Inherited By: | [Effect](qml-qtquick3d-effect), [Geometry](qml-qtquick3d-geometry), [InstanceListEntry](qml-qtquick3d-instancelistentry), [InstanceRange](qml-qtquick3d-helpers-instancerange), [Instancing](qml-qtquick3d-instancing), [Material](qml-qtquick3d-material), [Node](qml-qtquick3d-node), [Particle3D](qml-qtquick3d-particles3d-particle3d), [SceneEnvironment](qml-qtquick3d-sceneenvironment), [Texture](qml-qtquick3d-texture), and [TextureData](qml-qtquick3d-texturedata) | * [List of all members, including inherited members](https://doc.qt.io/qt-6.2/qml-qtquick3d-object3d-members.html) Properties ---------- * **[children](qml-qtquick3d-object3d#children-prop)** : list<Object3D> * **[data](qml-qtquick3d-object3d#data-prop)** : list<Object> * **[parent](qml-qtquick3d-object3d#parent-prop)** : Object3D * **[resources](qml-qtquick3d-object3d#resources-prop)** : list<Object> * **[state](qml-qtquick3d-object3d#state-prop)** : string * **[states](qml-qtquick3d-object3d#states-prop)** : list<State> * **[transitions](qml-qtquick3d-object3d#transitions-prop)** : list<Transition> Detailed Description -------------------- Object3D is the base class for all Qt Quick 3D types. This includes: * Spatial types that represent objects in the 3D scene, these will normally have a position and/or a direction. For example, [Model](qml-qtquick3d-model), [Camera](https://doc.qt.io/qt-6.2/qtquick3d-intro-example.html#camera), or [Light](qml-qtquick3d-light). Such types inherit from [Node](qml-qtquick3d-node), which in turn inherits from Object3D. * Resource types that do not themselves represent an object in the 3D world, but rather serve as components to [Node](qml-qtquick3d-node) subclasses, providing data of some kind. This includes, among others, [Material](qml-qtquick3d-material), [Geometry](quick3d-asset-conditioning-3d-assets#geometry), and [Texture](qml-qtquick3d-texture). In addition to the above types, Object3D can also serve as the parent for [Qt Quick items](qml-qtquick-item), as well as arbitrary [QObject](qobject) instances. For more information on adding 2D items to the 3D scene, refer to [Qt Quick 3D Scenes with 2D Content](qtquick3d-2d). **See also** [Node](qml-qtquick3d-node). Property Documentation ---------------------- ### children : [list](qml-list)<[Object3D](qml-qtquick3d-object3d)> The children property contains the list of visual children of this object. The resources property contains non-visual resources that you want to reference by name. It is not generally necessary to refer to these properties when adding child objects or resources, as the default [data](qml-qtquick3d-object3d#data-prop) property will automatically assign child objects to the `children` and `resources` properties as appropriate. See the [QtQuick3D::Object3D::data](qml-qtquick3d-object3d#data-prop) documentation for details. **Note:** QtQuick3D::Object3D::resources does not return a list of 3D resources despite the name. The name comes from the semantics of [QQuickItem](qquickitem). 3D resources are subclasses of QQuickObjec3D and thus will be returned in the list of QtQuick3D::Objec3D::children. ### [default] data : [list](qml-list)<Object> The data property allows you to freely mix [Object3D](qml-qtquick3d-object3d) children and resources in an object. If you assign a [Object3D](qml-qtquick3d-object3d) to the data list it becomes a child and if you assign any other object type, it is added as a resource. So you can write: ``` Object3D { Node {} DirectionalLight {} Timer {} } ``` instead of: ``` Item { children: [ Node {}, DirectionalLight {} ] resources: [ Timer {} ] } ``` It should not generally be necessary to refer to the `data` property, as it is the default property for [Object3D](qml-qtquick3d-object3d) and thus all child objects are automatically assigned to this property. ### parent : [Object3D](qml-qtquick3d-object3d) This property holds the parent of the [Object3D](qml-qtquick3d-object3d) in a 3D scene. **Note:** An [Object3D](qml-qtquick3d-object3d)'s parent may not necessarily be the same as its object parent. This is necessary because the object parent may be an item that is not of type [Object3D](qml-qtquick3d-object3d), for example the root object in a scene. ### state : [string](qml-string) This property holds the name of the current state of the object. If the item is in its default state, that is, no explicit state has been set, then this property holds an empty string. Likewise, you can return an item to its default state by setting this property to an empty string. **See also** [Qt Quick States](qtquick-statesanimations-states). ### states : [list](qml-list)<[State](qml-qtquick-state)> This property holds the list of possible states for this object. To change the state of this object, set the [state](qml-qtquick3d-object3d#state-prop) property to one of these states, or set the [state](qml-qtquick3d-object3d#state-prop) property to an empty string to revert the object to its default state. This property is specified as a list of [State](qml-qtquick-state) objects. For example, below is an QtQuick3D::Node with "above\_state" and "below\_state" states: ``` import QtQuick import QtQuick3D Node { id: root y: 0 states: [ State { name: "above_state" PropertyChanges { target: root; y: 100 } }, State { name: "below_state" PropertyChanges { target: root; y: -100 } } ] } ``` See [Qt Quick States](qtquick-statesanimations-states) and [Animation and Transitions in Qt Quick](qtquick-statesanimations-animations) for more details on using states and transitions. **Note:** This property works the same as QtQuick::Item::states but is necessary because QtQuick3D::Object3D is not a QtQuick::Item subclass. **See also** [QtQuick3D::Object3D::transitions](qml-qtquick3d-object3d#transitions-prop). ### transitions : [list](qml-list)<[Transition](qml-qtquick-transition)> This property holds the list of transitions for this object. These define the transitions to be applied to the object whenever it changes its [state](qml-qtquick3d-object3d#state-prop). This property is specified as a list of [Transition](https://doc.qt.io/qt-6.2/qmlexampletoggleswitch.html#transition) objects. For example: ``` import QtQuick import QtQuick3D Node { transitions: [ Transition { //... }, Transition { //... } ] } ``` See [Qt Quick States](qtquick-statesanimations-states) and [Animation and Transitions in Qt Quick](qtquick-statesanimations-animations) for more details on using states and transitions. **Note:** This property works the same as QtQuick::Item::transitions but is necessary because QtQuick3D::Object3D is not a QtQuick::Item subclass. **See also** [QtQuick3D::Object3D::states](qml-qtquick3d-object3d#states-prop). qt QStringList Class QStringList Class ================= The QStringList class provides a list of strings. [More...](#details) | | | | --- | --- | | Header: | #include <QStringList> | | CMake: | find\_package(Qt6 COMPONENTS Core REQUIRED) target\_link\_libraries(mytarget PRIVATE Qt6::Core) | | qmake: | QT += core | | Inherits: | [QList](qlist) | * [List of all members, including inherited members](https://doc.qt.io/qt-6.2/qstringlist-members.html) **Note:** All functions in this class are [reentrant](17-qdoc-commands-thread#reentrant). Public Functions ---------------- | | | | --- | --- | | | **[QStringList](qstringlist#QStringList-2)**(QList<QString> &&*other*) | | | **[QStringList](qstringlist#QStringList-1)**(const QList<QString> &*other*) | | | **[QStringList](qstringlist#QStringList)**(const QString &*str*) | | QStringList & | **[operator=](qstringlist#operator-eq-1)**(QList<QString> &&*other*) | | QStringList & | **[operator=](qstringlist#operator-eq)**(const QList<QString> &*other*) | | bool | **[contains](qstringlist#contains)**(const QString &*str*, Qt::CaseSensitivity *cs* = Qt::CaseSensitive) const | | bool | **[contains](qstringlist#contains-1)**(QLatin1String *str*, Qt::CaseSensitivity *cs* = Qt::CaseSensitive) const | | bool | **[contains](qstringlist#contains-2)**(QStringView *str*, Qt::CaseSensitivity *cs* = Qt::CaseSensitive) const | | QStringList | **[filter](qstringlist#filter)**(const QString &*str*, Qt::CaseSensitivity *cs* = Qt::CaseSensitive) const | | QStringList | **[filter](qstringlist#filter-1)**(QStringView *str*, Qt::CaseSensitivity *cs* = Qt::CaseSensitive) const | | QStringList | **[filter](qstringlist#filter-2)**(const QRegularExpression &*re*) const | | qsizetype | **[indexOf](qstringlist#indexOf-1)**(const QRegularExpression &*re*, qsizetype *from* = 0) const | | QString | **[join](qstringlist#join)**(const QString &*separator*) const | | QString | **[join](qstringlist#join-1)**(QStringView *separator*) const | | QString | **[join](qstringlist#join-2)**(QLatin1String *separator*) const | | QString | **[join](qstringlist#join-3)**(QChar *separator*) const | | qsizetype | **[lastIndexOf](qstringlist#lastIndexOf-1)**(const QRegularExpression &*re*, qsizetype *from* = -1) const | | qsizetype | **[removeDuplicates](qstringlist#removeDuplicates)**() | | QStringList & | **[replaceInStrings](qstringlist#replaceInStrings)**(const QString &*before*, const QString &*after*, Qt::CaseSensitivity *cs* = Qt::CaseSensitive) | | QStringList & | **[replaceInStrings](qstringlist#replaceInStrings-1)**(QStringView *before*, QStringView *after*, Qt::CaseSensitivity *cs* = Qt::CaseSensitive) | | QStringList & | **[replaceInStrings](qstringlist#replaceInStrings-2)**(const QString &*before*, QStringView *after*, Qt::CaseSensitivity *cs* = Qt::CaseSensitive) | | QStringList & | **[replaceInStrings](qstringlist#replaceInStrings-3)**(QStringView *before*, const QString &*after*, Qt::CaseSensitivity *cs* = Qt::CaseSensitive) | | QStringList & | **[replaceInStrings](qstringlist#replaceInStrings-4)**(const QRegularExpression &*re*, const QString &*after*) | | void | **[sort](qstringlist#sort)**(Qt::CaseSensitivity *cs* = Qt::CaseSensitive) | | QStringList | **[operator+](qstringlist#operator-2b)**(const QStringList &*other*) const | | QStringList & | **[operator<<](qstringlist#operator-lt-lt)**(const QString &*str*) | | QStringList & | **[operator<<](qstringlist#operator-lt-lt-1)**(const QStringList &*other*) | | QStringList & | **[operator<<](qstringlist#operator-lt-lt-2)**(const QList<QString> &*other*) | Related Non-Members ------------------- | | | | --- | --- | | | **[QMutableStringListIterator](qstringlist#QMutableStringListIterator-typedef)** | | | **[QStringListIterator](qstringlist#QStringListIterator-typedef)** | Detailed Description -------------------- QStringList inherits from [QList](qlist)<[QString](qstring)>. Like [QList](qlist), QStringList is [implicitly shared](implicit-sharing). It provides fast index-based access as well as fast insertions and removals. Passing string lists as value parameters is both fast and safe. All of [QList](qlist)'s functionality also applies to QStringList. For example, you can use [isEmpty](qlist#isEmpty)() to test whether the list is empty, and you can call functions like [append](qlist#append)(), [prepend](qlist#prepend)(), [insert](qlist#insert)(), [replace](qlist#replace)(), [removeAll](qlist#removeAll)(), [removeAt](qlist#removeAt)(), [removeFirst](qlist#removeFirst)(), [removeLast](qlist#removeLast)(), and [removeOne](qlist#removeOne)() to modify a QStringList. In addition, QStringList provides a few convenience functions that make handling lists of strings easier: ### Initializing The default constructor creates an empty list. You can use the initializer-list constructor to create a list with elements: ``` QStringList fonts = { "Arial", "Helvetica", "Times" }; ``` ### Adding Strings Strings can be added to a list using the [insert](qlist#insert)(), [append](qlist#append)(), [operator+=](qlist#operator-2b-eq)() and [operator<<](qstringlist#operator-lt-lt)() functions. [operator<<](qstringlist#operator-lt-lt)() can be used to conveniently add multiple elements to a list: ``` fonts << "Courier" << "Verdana"; ``` ### Iterating Over the Strings To iterate over a list, you can either use index positions or [QList](qlist)'s Java-style and STL-style iterator types: Indexing: ``` for (int i = 0; i < fonts.size(); ++i) cout << fonts.at(i).toLocal8Bit().constData() << Qt::endl; ``` Java-style iterator: ``` QStringListIterator javaStyleIterator(fonts); while (javaStyleIterator.hasNext()) cout << javaStyleIterator.next().toLocal8Bit().constData() << Qt::endl; ``` STL-style iterator: ``` QStringList::const_iterator constIterator; for (constIterator = fonts.constBegin(); constIterator != fonts.constEnd(); ++constIterator) cout << (*constIterator).toLocal8Bit().constData() << Qt::endl; ``` The QStringListIterator class is simply a type definition for [QListIterator](qlistiterator)<[QString](qstring)>. QStringList also provide the QMutableStringListIterator class which is a type definition for [QMutableListIterator](qmutablelistiterator)<[QString](qstring)>. ### Manipulating the Strings QStringList provides several functions allowing you to manipulate the contents of a list. You can concatenate all the strings in a string list into a single string (with an optional separator) using the [join](qstringlist#join)() function. For example: ``` QString str = fonts.join(", "); // str == "Arial, Helvetica, Times, Courier" ``` The argument to join can be a single character or a string. To break up a string into a string list, use the [QString::split](qstring#split)() function: ``` QStringList list; list = str.split(','); // list: ["Arial", "Helvetica", "Times", "Courier"] ``` The argument to split can be a single character, a string or a [QRegularExpression](qregularexpression). In addition, the [operator+](qstringlist#operator-2b)() function allows you to concatenate two string lists into one. To sort a string list, use the [sort](qstringlist#sort)() function. [QString](qstring) list also provides the [filter](qstringlist#filter)() function which lets you to extract a new list which contains only those strings which contain a particular substring (or match a particular regular expression): ``` QStringList monospacedFonts = fonts.filter(QRegularExpression("Courier|Fixed")); ``` The [contains](qstringlist#contains)() function tells you whether the list contains a given string, while the [indexOf](qstringlist#indexOf-1)() function returns the index of the first occurrence of the given string. The [lastIndexOf](qstringlist#lastIndexOf-1)() function on the other hand, returns the index of the last occurrence of the string. Finally, the [replaceInStrings](qstringlist#replaceInStrings)() function calls [QString::replace](qstring#replace)() on each string in the string list in turn. For example: ``` QStringList files; files << "$QTDIR/src/moc/moc.y" << "$QTDIR/src/moc/moc.l" << "$QTDIR/include/qconfig.h"; files.replaceInStrings("$QTDIR", "/usr/lib/qt"); // files: [ "/usr/lib/qt/src/moc/moc.y", ...] ``` **See also** [QString](qstring). Member Function Documentation ----------------------------- ### `[since 5.4]` QStringList::QStringList(QList<[QString](qstring)> &&*other*) This is an overloaded function. Move-constructs from [QList](qlist)<[QString](qstring)>. After a successful construction, *other* will be empty. This function was introduced in Qt 5.4. ### QStringList::QStringList(const QList<[QString](qstring)> &*other*) Constructs a copy of *other*. This operation takes [constant time](containers#constant-time), because QStringList is [implicitly shared](implicit-sharing). This makes returning a QStringList from a function very fast. If a shared instance is modified, it will be copied (copy-on-write), and that takes [linear time](containers#linear-time). **See also** [operator=](qstringlist#operator-eq)(). ### QStringList::QStringList(const [QString](qstring) &*str*) Constructs a string list that contains the given string, *str*. Longer lists are easily created like this: ``` QStringList longerList = (QStringList() << str1 << str2 << str3); ``` **See also** [append](qlist#append)(). ### `[since 5.4]` [QStringList](qstringlist#QStringList) &QStringList::operator=(QList<[QString](qstring)> &&*other*) This is an overloaded function. Move assignment operator from [QList](qlist)<[QString](qstring)>. Moves the *other* list of strings to this string list. After the operation, *other* will be empty. This function was introduced in Qt 5.4. ### `[since 5.4]` [QStringList](qstringlist#QStringList) &QStringList::operator=(const QList<[QString](qstring)> &*other*) Copy assignment operator from [QList](qlist)<[QString](qstring)>. Assigns the *other* list of strings to this string list. After the operation, *other* and `*this` will be equal. This function was introduced in Qt 5.4. ### bool QStringList::contains(const [QString](qstring) &*str*, [Qt::CaseSensitivity](qt#CaseSensitivity-enum) *cs* = Qt::CaseSensitive) const Returns `true` if the list contains the string *str*; otherwise returns `false`. The search is case insensitive if *cs* is [Qt::CaseInsensitive](qt#CaseSensitivity-enum); the search is case sensitive by default. **See also** [indexOf](qstringlist#indexOf-1)(), [lastIndexOf](qstringlist#lastIndexOf-1)(), and [QString::contains](qstring#contains)(). ### `[since 5.10]` bool QStringList::contains([QLatin1String](qlatin1string) *str*, [Qt::CaseSensitivity](qt#CaseSensitivity-enum) *cs* = Qt::CaseSensitive) const This is an overloaded function. Returns `true` if the list contains the string *str*; otherwise returns `false`. The search is case insensitive if *cs* is [Qt::CaseInsensitive](qt#CaseSensitivity-enum); the search is case sensitive by default. This function was introduced in Qt 5.10. **See also** [indexOf](qstringlist#indexOf-1)(), [lastIndexOf](qstringlist#lastIndexOf-1)(), and [QString::contains](qstring#contains)(). ### `[since 5.12]` bool QStringList::contains([QStringView](qstringview) *str*, [Qt::CaseSensitivity](qt#CaseSensitivity-enum) *cs* = Qt::CaseSensitive) const This is an overloaded function. Returns `true` if the list contains the string *str*; otherwise returns `false`. The search is case insensitive if *cs* is [Qt::CaseInsensitive](qt#CaseSensitivity-enum); the search is case sensitive by default. This function was introduced in Qt 5.12. ### [QStringList](qstringlist#QStringList) QStringList::filter(const [QString](qstring) &*str*, [Qt::CaseSensitivity](qt#CaseSensitivity-enum) *cs* = Qt::CaseSensitive) const Returns a list of all the strings containing the substring *str*. If *cs* is [Qt::CaseSensitive](qt#CaseSensitivity-enum) (the default), the string comparison is case sensitive; otherwise the comparison is case insensitive. ``` QStringList list; list << "Bill Murray" << "John Doe" << "Bill Clinton"; QStringList result; result = list.filter("Bill"); // result: ["Bill Murray", "Bill Clinton"] ``` This is equivalent to ``` QStringList result; foreach (const QString &str, list) { if (str.contains("Bill")) result += str; } ``` **See also** [contains](qstringlist#contains)(). ### `[since 5.14]` [QStringList](qstringlist#QStringList) QStringList::filter([QStringView](qstringview) *str*, [Qt::CaseSensitivity](qt#CaseSensitivity-enum) *cs* = Qt::CaseSensitive) const This is an overloaded function. This function was introduced in Qt 5.14. ### `[since 5.0]` [QStringList](qstringlist#QStringList) QStringList::filter(const [QRegularExpression](qregularexpression) &*re*) const This is an overloaded function. Returns a list of all the strings that match the regular expression *re*. This function was introduced in Qt 5.0. ### `[since 5.0]` qsizetype QStringList::indexOf(const [QRegularExpression](qregularexpression) &*re*, qsizetype *from* = 0) const This is an overloaded function. Returns the index position of the first exact match of *re* in the list, searching forward from index position *from*. Returns -1 if no item matched. This function was introduced in Qt 5.0. **See also** [lastIndexOf](qstringlist#lastIndexOf-1)(). ### [QString](qstring) QStringList::join(const [QString](qstring) &*separator*) const Joins all the string list's strings into a single string with each element separated by the given *separator* (which can be an empty string). **See also** [QString::split](qstring#split)(). ### `[since 5.14]` [QString](qstring) QStringList::join([QStringView](qstringview) *separator*) const This is an overloaded function. This function was introduced in Qt 5.14. ### `[since 5.8]` [QString](qstring) QStringList::join([QLatin1String](qlatin1string) *separator*) const This function overloads join(). This function was introduced in Qt 5.8. ### `[since 5.0]` [QString](qstring) QStringList::join([QChar](qchar) *separator*) const This function overloads join(). This function was introduced in Qt 5.0. ### `[since 5.0]` qsizetype QStringList::lastIndexOf(const [QRegularExpression](qregularexpression) &*re*, qsizetype *from* = -1) const This is an overloaded function. Returns the index position of the last exact match of *re* in the list, searching backward from index position *from*. If *from* is -1 (the default), the search starts at the last item. Returns -1 if no item matched. This function was introduced in Qt 5.0. **See also** [indexOf](qstringlist#indexOf-1)(). ### qsizetype QStringList::removeDuplicates() This function removes duplicate entries from a list. The entries do not have to be sorted. They will retain their original order. Returns the number of removed entries. ### [QStringList](qstringlist#QStringList) &QStringList::replaceInStrings(const [QString](qstring) &*before*, const [QString](qstring) &*after*, [Qt::CaseSensitivity](qt#CaseSensitivity-enum) *cs* = Qt::CaseSensitive) Returns a string list where every string has had the *before* text replaced with the *after* text wherever the *before* text is found. The *before* text is matched case-sensitively or not depending on the *cs* flag. For example: ``` QStringList list; list << "alpha" << "beta" << "gamma" << "epsilon"; list.replaceInStrings("a", "o"); // list == ["olpho", "beto", "gommo", "epsilon"] ``` **See also** [QString::replace](qstring#replace)(). ### `[since 5.14]` [QStringList](qstringlist#QStringList) &QStringList::replaceInStrings([QStringView](qstringview) *before*, [QStringView](qstringview) *after*, [Qt::CaseSensitivity](qt#CaseSensitivity-enum) *cs* = Qt::CaseSensitive) This is an overloaded function. This function was introduced in Qt 5.14. ### `[since 5.14]` [QStringList](qstringlist#QStringList) &QStringList::replaceInStrings(const [QString](qstring) &*before*, [QStringView](qstringview) *after*, [Qt::CaseSensitivity](qt#CaseSensitivity-enum) *cs* = Qt::CaseSensitive) This is an overloaded function. This function was introduced in Qt 5.14. ### `[since 5.14]` [QStringList](qstringlist#QStringList) &QStringList::replaceInStrings([QStringView](qstringview) *before*, const [QString](qstring) &*after*, [Qt::CaseSensitivity](qt#CaseSensitivity-enum) *cs* = Qt::CaseSensitive) This is an overloaded function. This function was introduced in Qt 5.14. ### `[since 5.0]` [QStringList](qstringlist#QStringList) &QStringList::replaceInStrings(const [QRegularExpression](qregularexpression) &*re*, const [QString](qstring) &*after*) This is an overloaded function. Replaces every occurrence of the regular expression *re*, in each of the string lists's strings, with *after*. Returns a reference to the string list. For example: ``` QStringList list; list << "alpha" << "beta" << "gamma" << "epsilon"; list.replaceInStrings(QRegularExpression("^a"), "o"); // list == ["olpha", "beta", "gamma", "epsilon"] ``` For regular expressions that contain capturing groups, occurrences of **\1**, **\2**, ..., in *after* are replaced with the string captured by the corresponding capturing group. For example: ``` QStringList list; list << "Bill Clinton" << "Murray, Bill"; list.replaceInStrings(QRegularExpression("^(.*), (.*)$"), "\\2 \\1"); // list == ["Bill Clinton", "Bill Murray"] ``` This function was introduced in Qt 5.0. ### void QStringList::sort([Qt::CaseSensitivity](qt#CaseSensitivity-enum) *cs* = Qt::CaseSensitive) Sorts the list of strings in ascending order. If *cs* is [Qt::CaseSensitive](qt#CaseSensitivity-enum) (the default), the string comparison is case sensitive; otherwise the comparison is case insensitive. Sorting is performed using the STL's std::sort() algorithm, which averages [linear-logarithmic time](containers#linear-logarithmic-time), i.e. O(*n* log *n*). If you want to sort your strings in an arbitrary order, consider using the [QMap](qmap) class. For example, you could use a [QMap](qmap)<[QString](qstring), [QString](qstring)> to create a case-insensitive ordering (e.g. with the keys being lower-case versions of the strings, and the values being the strings), or a [QMap](qmap)<int, [QString](qstring)> to sort the strings by some integer index. ### [QStringList](qstringlist#QStringList) QStringList::operator+(const [QStringList](qstringlist#QStringList) &*other*) const Returns a string list that is the concatenation of this string list with the *other* string list. **See also** [append](qlist#append)(). ### [QStringList](qstringlist#QStringList) &QStringList::operator<<(const [QString](qstring) &*str*) Appends the given string, *str*, to this string list and returns a reference to the string list. **See also** [append](qlist#append)(). ### [QStringList](qstringlist#QStringList) &QStringList::operator<<(const [QStringList](qstringlist#QStringList) &*other*) This is an overloaded function. Appends the *other* string list to the string list and returns a reference to the latter string list. ### `[since 5.4]` [QStringList](qstringlist#QStringList) &QStringList::operator<<(const QList<[QString](qstring)> &*other*) This is an overloaded function. Appends the *other* string list to the string list and returns a reference to the latter string list. This function was introduced in Qt 5.4. Related Non-Members ------------------- ### `[alias]` QMutableStringListIterator The QStringListIterator type definition provides a Java-style non-const iterator for [QStringList](qstringlist). [QStringList](qstringlist) provides both [Java-style iterators](java-style-iterators#java-style-iterators) and [STL-style iterators](containers#stl-style-iterators). The Java-style non-const iterator is simply a type definition for [QMutableListIterator](qmutablelistiterator)<[QString](qstring)>. **See also** [QStringListIterator](qstringlist#QStringListIterator-typedef) and [QStringList::iterator](qlist-iterator). ### `[alias]` QStringListIterator The QStringListIterator type definition provides a Java-style const iterator for [QStringList](qstringlist). [QStringList](qstringlist) provides both [Java-style iterators](java-style-iterators#java-style-iterators) and [STL-style iterators](containers#stl-style-iterators). The Java-style const iterator is simply a type definition for [QListIterator](qlistiterator)<[QString](qstring)>. **See also** [QMutableStringListIterator](qstringlist#QMutableStringListIterator-typedef) and [QStringList::const\_iterator](qlist-const-iterator).
programming_docs
qt CylinderMesh QML Type CylinderMesh QML Type ===================== A cylindrical mesh. [More...](#details) | | | | --- | --- | | Import Statement: | import Qt3D.Extras | | Instantiates: | [QCylinderMesh](qt3dextras-qcylindermesh) | * [List of all members, including inherited members](https://doc.qt.io/qt-6.2/qml-qt3d-extras-cylindermesh-members.html) Properties ---------- * **[length](qml-qt3d-extras-cylindermesh#length-prop)** : real * **[radius](qml-qt3d-extras-cylindermesh#radius-prop)** : real * **[rings](qml-qt3d-extras-cylindermesh#rings-prop)** : int * **[slices](qml-qt3d-extras-cylindermesh#slices-prop)** : int Detailed Description -------------------- Property Documentation ---------------------- ### length : [real](qml-real) Holds the length of the cylinder. ### radius : [real](qml-real) Holds the radius of the cylinder. ### rings : [int](qml-int) Holds the number of rings in the mesh. ### slices : [int](qml-int) Holds the number of slices in the mesh. qt QVirtualKeyboardExtensionPlugin Class QVirtualKeyboardExtensionPlugin Class ===================================== Extension plugin for the Qt Virtual Keyboard. [More...](#details) | | | | --- | --- | | Header: | #include <QVirtualKeyboardExtensionPlugin> | | CMake: | find\_package(Qt6 COMPONENTS VirtualKeyboard REQUIRED) target\_link\_libraries(mytarget PRIVATE Qt6::VirtualKeyboard) | | qmake: | QT += virtualkeyboard | | Inherits: | [QObject](qobject) | * [List of all members, including inherited members](https://doc.qt.io/qt-6.2/qvirtualkeyboardextensionplugin-members.html) Public Functions ---------------- | | | | --- | --- | | virtual void | **[registerTypes](qvirtualkeyboardextensionplugin#registerTypes)**(const char \**uri*) const | Detailed Description -------------------- Extension plugin allows customizing and extending the Qt Virtual Keyboard functionality. Extension plugin can provide additional keyboard layouts and input methods. Virtual keyboard loads all the extension plugins at startup. It searches for `plugins/virtualkeyboard` directory and matches the metadata found in the plugin. If there are two or more extension plugins with the same `Name`, it loads the one with the highest `Version` number. **See also** [Virtual Keyboard Extension Plugin](technical-guide#virtual-keyboard-extension-plugin). Member Function Documentation ----------------------------- ### `[virtual]` void QVirtualKeyboardExtensionPlugin::registerTypes(const char \**uri*) const If the plugin metadata contains `InputMethod` field defining an input method name, Qt Virtual Keyboard will call registerTypes() for registering the input method as QML type. The type must be registered with a *uri* if the input method is used by the default keyboard layouts. If the input method type is only used in private layouts (known only by the plugin), the uri can be omitted and chosen freely. qt KeyboardLayout QML Type KeyboardLayout QML Type ======================= Keyboard layout. [More...](#details) | | | | --- | --- | | Import Statement: | import QtQuick.VirtualKeyboard | | Inherits: | [ColumnLayout](qml-qtquick-layouts-columnlayout) | * [List of all members, including inherited members](https://doc.qt.io/qt-6.2/qml-qtquick-virtualkeyboard-keyboardlayout-members.html) Properties ---------- * **[inputMethod](qml-qtquick-virtualkeyboard-keyboardlayout#inputMethod-prop)** : var * **[inputMode](qml-qtquick-virtualkeyboard-keyboardlayout#inputMode-prop)** : int * **[keyWeight](qml-qtquick-virtualkeyboard-keyboardlayout#keyWeight-prop)** : real * **[sharedLayouts](qml-qtquick-virtualkeyboard-keyboardlayout#sharedLayouts-prop)** : var * **[smallTextVisible](qml-qtquick-virtualkeyboard-keyboardlayout#smallTextVisible-prop)** : bool Methods ------- * **[createInputMethod](qml-qtquick-virtualkeyboard-keyboardlayout#createInputMethod-method)**() Detailed Description -------------------- This type is the root element of the keyboard layout. Use this element to build a new keyboard layout. Example: ``` import QtQuick import QtQuick.Layouts import QtQuick.VirtualKeyboard // file: layouts/en_GB/main.qml KeyboardLayout { KeyboardRow { Key { key: Qt.Key_Q text: "q" } Key { key: Qt.Key_W text: "w" } Key { key: Qt.Key_E text: "e" } Key { key: Qt.Key_R text: "r" } Key { key: Qt.Key_T text: "t" } Key { key: Qt.Key_Y text: "y" } } } ``` Property Documentation ---------------------- ### inputMethod : [var](qml-var) Sets the input method to be used in this layout. This property allows a custom input method to be used in this layout. ### inputMode : [int](qml-int) Sets the input mode to be used in this layout. By default, the virtual keyboard attempts to preserve the current input mode when switching to a different keyboard layout. If the current input mode is not valid in the current context, the default input mode is specified by the input method. ### keyWeight : [real](qml-real) Sets the key weight for all children keys. The default value is inherited from the parent element in the layout hierarchy. ### sharedLayouts : [var](qml-var) List of layout names which share the input method created by the [createInputMethod](qml-qtquick-virtualkeyboard-keyboardlayout#createInputMethod-method)() function. If the list is empty (the default) the input method is not shared with any other layout and will be destroyed when the layout changes. The list should contain only the name of the layout type, e.g., ['symbols']. The current layout does not have to be included in the list. ### [since QtQuick.VirtualKeyboard 2.0] smallTextVisible : [bool](qml-bool) Sets the `smallTextVisible` for all children keys. The default value is inherited from the parent element in the layout hierarchy. This property was introduced in QtQuick.VirtualKeyboard 2.0. Method Documentation -------------------- ### createInputMethod() This function may be overridden by the keyboard layout to create the input method object dynamically. The default implementation returns `null`. The input method object created by this function can outlive keyboard layout transitions in certain cases. In particular, this applies to the transitions between the layouts listed in the [sharedLayouts](qml-qtquick-virtualkeyboard-keyboardlayout#sharedLayouts-prop) property. qt QSet Class QSet Class ========== template <typename T> class QSet The QSet class is a template class that provides a hash-table-based set. [More...](#details) | | | | --- | --- | | Header: | #include <QSet> | | CMake: | find\_package(Qt6 COMPONENTS Core REQUIRED) target\_link\_libraries(mytarget PRIVATE Qt6::Core) | | qmake: | QT += core | * [List of all members, including inherited members](https://doc.qt.io/qt-6.2/qset-members.html) **Note:** All functions in this class are [reentrant](17-qdoc-commands-thread#reentrant). Public Types ------------ | | | | --- | --- | | class | **[const\_iterator](qset-const-iterator)** | | class | **[iterator](qset-iterator)** | | | **[ConstIterator](qset#ConstIterator-typedef)** | | | **[Iterator](qset#Iterator-typedef)** | | | **[const\_pointer](qset#const_pointer-typedef)** | | | **[const\_reference](qset#const_reference-typedef)** | | | **[difference\_type](qset#difference_type-typedef)** | | | **[key\_type](qset#key_type-typedef)** | | | **[pointer](qset#pointer-typedef)** | | | **[reference](qset#reference-typedef)** | | | **[size\_type](qset#size_type-typedef)** | | | **[value\_type](qset#value_type-typedef)** | Public Functions ---------------- | | | | --- | --- | | | **[QSet](qset#QSet-2)**(InputIterator *first*, InputIterator *last*) | | | **[QSet](qset#QSet-1)**(std::initializer\_list<T> *list*) | | | **[QSet](qset#QSet)**() | | QSet::const\_iterator | **[begin](qset#begin)**() const | | QSet::iterator | **[begin](qset#begin-1)**() | | qsizetype | **[capacity](qset#capacity)**() const | | QSet::const\_iterator | **[cbegin](qset#cbegin)**() const | | QSet::const\_iterator | **[cend](qset#cend)**() const | | void | **[clear](qset#clear)**() | | QSet::const\_iterator | **[constBegin](qset#constBegin)**() const | | QSet::const\_iterator | **[constEnd](qset#constEnd)**() const | | QSet::const\_iterator | **[constFind](qset#constFind)**(const T &*value*) const | | bool | **[contains](qset#contains)**(const T &*value*) const | | bool | **[contains](qset#contains-1)**(const QSet<T> &*other*) const | | qsizetype | **[count](qset#count)**() const | | bool | **[empty](qset#empty)**() const | | QSet::const\_iterator | **[end](qset#end)**() const | | QSet::iterator | **[end](qset#end-1)**() | | QSet::iterator | **[erase](qset#erase)**(QSet::const\_iterator *pos*) | | QSet::const\_iterator | **[find](qset#find)**(const T &*value*) const | | QSet::iterator | **[find](qset#find-1)**(const T &*value*) | | QSet::iterator | **[insert](qset#insert)**(const T &*value*) | | QSet::iterator | **[insert](qset#insert-2)**(QSet::const\_iterator *it*, const T &*value*) | | QSet<T> & | **[intersect](qset#intersect)**(const QSet<T> &*other*) | | bool | **[intersects](qset#intersects)**(const QSet<T> &*other*) const | | bool | **[isEmpty](qset#isEmpty)**() const | | bool | **[remove](qset#remove)**(const T &*value*) | | void | **[reserve](qset#reserve)**(qsizetype *size*) | | qsizetype | **[size](qset#size)**() const | | void | **[squeeze](qset#squeeze)**() | | QSet<T> & | **[subtract](qset#subtract)**(const QSet<T> &*other*) | | void | **[swap](qset#swap)**(QSet<T> &*other*) | | QSet<T> & | **[unite](qset#unite)**(const QSet<T> &*other*) | | QList<T> | **[values](qset#values)**() const | | bool | **[operator!=](qset#operator-not-eq)**(const QSet<T> &*other*) const | | QSet<T> | **[operator&](qset#operator-and)**(const QSet<T> &*other*) const | | QSet<T> & | **[operator&=](qset#operator-and-eq)**(const QSet<T> &*other*) | | QSet<T> & | **[operator&=](qset#operator-and-eq-1)**(const T &*value*) | | QSet<T> | **[operator+](qset#operator-2b)**(const QSet<T> &*other*) const | | QSet<T> & | **[operator+=](qset#operator-2b-eq)**(const QSet<T> &*other*) | | QSet<T> & | **[operator+=](qset#operator-2b-eq-1)**(const T &*value*) | | QSet<T> | **[operator-](qset#operator-)**(const QSet<T> &*other*) const | | QSet<T> & | **[operator-=](qset#operator--eq)**(const QSet<T> &*other*) | | QSet<T> & | **[operator-=](qset#operator--eq-1)**(const T &*value*) | | QSet<T> & | **[operator<<](qset#operator-lt-lt)**(const T &*value*) | | bool | **[operator==](qset#operator-eq-eq)**(const QSet<T> &*other*) const | | QSet<T> | **[operator|](qset#operator-7c)**(const QSet<T> &*other*) const | | QSet<T> & | **[operator|=](qset#operator-7c-eq)**(const QSet<T> &*other*) | | QSet<T> & | **[operator|=](qset#operator-7c-eq-1)**(const T &*value*) | Related Non-Members ------------------- | | | | --- | --- | | qsizetype | **[erase\_if](qset#erase_if)**(QSet<T> &*set*, Predicate *pred*) | | QDataStream & | **[operator<<](qset#operator-lt-lt-1)**(QDataStream &*out*, const QSet<T> &*set*) | | QDataStream & | **[operator>>](qset#operator-gt-gt)**(QDataStream &*in*, QSet<T> &*set*) | Detailed Description -------------------- QSet<T> is one of Qt's generic [container classes](containers). It stores values in an unspecified order and provides very fast lookup of the values. Internally, QSet<T> is implemented as a [QHash](qhash#qhash). Here's an example QSet with [QString](qstring) values: ``` QSet<QString> set; ``` To insert a value into the set, use [insert](qset#insert)(): ``` set.insert("one"); set.insert("three"); set.insert("seven"); ``` Another way to insert items into the set is to use [operator<<](qset#operator-lt-lt)(): ``` set << "twelve" << "fifteen" << "nineteen"; ``` To test whether an item belongs to the set or not, use [contains](qset#contains)(): ``` if (!set.contains("ninety-nine")) ... ``` If you want to navigate through all the values stored in a QSet, you can use an iterator. QSet supports both [Java-style iterators](java-style-iterators#java-style-iterators) ([QSetIterator](qsetiterator) and [QMutableSetIterator](qmutablesetiterator)) and [STL-style iterators](containers#stl-style-iterators) ([QSet::iterator](qset-iterator) and [QSet::const\_iterator](qset-const-iterator)). Here's how to iterate over a QSet<[QWidget](qwidget) \*> using a Java-style iterator: ``` QSetIterator<QWidget *> i(set); while (i.hasNext()) qDebug() << i.next(); ``` Here's the same code, but using an STL-style iterator: ``` QSet<QWidget *>::const_iterator i = set.constBegin(); while (i != set.constEnd()) { qDebug() << *i; ++i; } ``` QSet is unordered, so an iterator's sequence cannot be assumed to be predictable. If ordering by key is required, use a [QMap](qmap). To navigate through a QSet, you can also use [foreach](containers#foreach): ``` QSet<QString> set; ... foreach (const QString &value, set) qDebug() << value; ``` Items can be removed from the set using [remove](qset#remove)(). There is also a [clear](qset#clear)() function that removes all items. QSet's value data type must be an [assignable data type](containers#assignable-data-type). You cannot, for example, store a [QWidget](qwidget) as a value; instead, store a [QWidget](qwidget) \*. In addition, the type must provide `operator==()`, and there must also be a global qHash() function that returns a hash value for an argument of the key's type. See the [QHash](qhash#qhash) documentation for a list of types supported by qHash(). Internally, QSet uses a hash table to perform lookups. The hash table automatically grows and shrinks to provide fast lookups without wasting memory. You can still control the size of the hash table by calling [reserve](qset#reserve)(), if you already know approximately how many elements the QSet will contain, but this isn't necessary to obtain good performance. You can also call [capacity](qset#capacity)() to retrieve the hash table's size. **See also** [QSetIterator](qsetiterator), [QMutableSetIterator](qmutablesetiterator), [QHash](qhash#qhash), and [QMap](qmap). Member Type Documentation ------------------------- ### QSet::ConstIterator Qt-style synonym for [QSet::const\_iterator](qset-const-iterator). ### QSet::Iterator Qt-style synonym for [QSet::iterator](qset-iterator). ### QSet::const\_pointer Typedef for const T \*. Provided for STL compatibility. ### QSet::const\_reference Typedef for const T &. Provided for STL compatibility. ### QSet::difference\_type Typedef for const ptrdiff\_t. Provided for STL compatibility. ### QSet::key\_type Typedef for T. Provided for STL compatibility. ### QSet::pointer Typedef for T \*. Provided for STL compatibility. ### QSet::reference Typedef for T &. Provided for STL compatibility. ### QSet::size\_type Typedef for int. Provided for STL compatibility. ### QSet::value\_type Typedef for T. Provided for STL compatibility. Member Function Documentation ----------------------------- ### [QSet](qset#QSet)<T> QSet::operator+(const [QSet](qset#QSet)<T> &*other*) const ### [QSet](qset#QSet)<T> QSet::operator|(const [QSet](qset#QSet)<T> &*other*) const Returns a new [QSet](qset) that is the union of this set and the *other* set. **See also** [unite](qset#unite)(), [operator|=](qset#operator-7c-eq)(), [operator&](qset#operator-and)(), and [operator-](qset#operator-)(). ### [QSet](qset#QSet)<T> &QSet::operator+=(const [QSet](qset#QSet)<T> &*other*) ### [QSet](qset#QSet)<T> &QSet::operator|=(const [QSet](qset#QSet)<T> &*other*) Same as [unite(*other*)](qset#unite). **See also** [operator|](qset#operator-7c)(), [operator&=](qset#operator-and-eq)(), and [operator-=](qset#operator--eq)(). ### [QSet](qset#QSet)<T> &QSet::operator+=(const T &*value*) ### [QSet](qset#QSet)<T> &QSet::operator<<(const T &*value*) ### [QSet](qset#QSet)<T> &QSet::operator|=(const T &*value*) Inserts a new item *value* and returns a reference to the set. If *value* already exists in the set, the set is left unchanged. **See also** [insert](qset#insert)(). ### `[since 5.14]` template <typename InputIterator> QSet::QSet(InputIterator *first*, InputIterator *last*) Constructs a set with the contents in the iterator range [*first*, *last*). The value type of `InputIterator` must be convertible to `T`. **Note:** If the range [*first*, *last*) contains duplicate elements, the first one is retained. This function was introduced in Qt 5.14. ### `[since 5.1]` QSet::QSet(std::initializer\_list<T> *list*) Constructs a set with a copy of each of the elements in the initializer list *list*. This function was introduced in Qt 5.1. ### QSet::QSet() Constructs an empty set. **See also** [clear](qset#clear)(). ### [QSet::const\_iterator](qset-const-iterator) QSet::begin() const Returns a const [STL-style iterator](containers#stl-style-iterators) positioned at the first item in the set. **See also** [constBegin](qset#constBegin)() and [end](qset#end)(). ### [QSet::iterator](qset-iterator) QSet::begin() This is an overloaded function. Returns a non-const [STL-style iterator](containers#stl-style-iterators) positioned at the first item in the set. ### qsizetype QSet::capacity() const Returns the number of buckets in the set's internal hash table. The sole purpose of this function is to provide a means of fine tuning [QSet](qset)'s memory usage. In general, you will rarely ever need to call this function. If you want to know how many items are in the set, call [size](qset#size)(). **See also** [reserve](qset#reserve)() and [squeeze](qset#squeeze)(). ### `[since 5.0]` [QSet::const\_iterator](qset-const-iterator) QSet::cbegin() const Returns a const [STL-style iterator](containers#stl-style-iterators) positioned at the first item in the set. This function was introduced in Qt 5.0. **See also** [begin](qset#begin)() and [cend](qset#cend)(). ### `[since 5.0]` [QSet::const\_iterator](qset-const-iterator) QSet::cend() const Returns a const [STL-style iterator](containers#stl-style-iterators) pointing to the imaginary item after the last item in the set. This function was introduced in Qt 5.0. **See also** [cbegin](qset#cbegin)() and [end](qset#end)(). ### void QSet::clear() Removes all elements from the set. **See also** [remove](qset#remove)(). ### [QSet::const\_iterator](qset-const-iterator) QSet::constBegin() const Returns a const [STL-style iterator](containers#stl-style-iterators) positioned at the first item in the set. **See also** [begin](qset#begin)() and [constEnd](qset#constEnd)(). ### [QSet::const\_iterator](qset-const-iterator) QSet::constEnd() const Returns a const [STL-style iterator](containers#stl-style-iterators) pointing to the imaginary item after the last item in the set. **See also** [constBegin](qset#constBegin)() and [end](qset#end)(). ### [QSet::const\_iterator](qset-const-iterator) QSet::constFind(const T &*value*) const Returns a const iterator positioned at the item *value* in the set. If the set contains no item *value*, the function returns [constEnd](qset#constEnd)(). **See also** [find](qset#find)() and [contains](qset#contains)(). ### bool QSet::contains(const T &*value*) const Returns `true` if the set contains item *value*; otherwise returns false. **See also** [insert](qset#insert)(), [remove](qset#remove)(), and [find](qset#find)(). ### bool QSet::contains(const [QSet](qset#QSet)<T> &*other*) const Returns `true` if the set contains all items from the *other* set; otherwise returns `false`. **See also** [insert](qset#insert)(), [remove](qset#remove)(), and [find](qset#find)(). ### qsizetype QSet::count() const Same as [size](qset#size)(). ### bool QSet::empty() const Returns `true` if the set is empty. This function is provided for STL compatibility. It is equivalent to [isEmpty](qset#isEmpty)(). ### [QSet::const\_iterator](qset-const-iterator) QSet::end() const Returns a const [STL-style iterator](containers#stl-style-iterators) positioned at the imaginary item after the last item in the set. **See also** [constEnd](qset#constEnd)() and [begin](qset#begin)(). ### [QSet::iterator](qset-iterator) QSet::end() This is an overloaded function. Returns a non-const [STL-style iterator](containers#stl-style-iterators) pointing to the imaginary item after the last item in the set. ### `[since 5.7]` [QSet::iterator](qset-iterator) QSet::erase([QSet::const\_iterator](qset-const-iterator) *pos*) Removes the item at the iterator position *pos* from the set, and returns an iterator positioned at the next item in the set. Unlike [remove](qset#remove)(), this function never causes [QSet](qset) to rehash its internal data structure. This means that it can safely be called while iterating, and won't affect the order of items in the set. **Note:** The iterator *pos* *must* be valid and dereferenceable. Calling this method on any other iterator, including its own [end](qset#end)(), results in undefined behavior. In particular, even the [begin](qset#begin)() iterator of an empty set cannot be dereferenced. This function was introduced in Qt 5.7. **See also** [remove](qset#remove)() and [find](qset#find)(). ### [QSet::const\_iterator](qset-const-iterator) QSet::find(const T &*value*) const Returns a const iterator positioned at the item *value* in the set. If the set contains no item *value*, the function returns [constEnd](qset#constEnd)(). **See also** [constFind](qset#constFind)() and [contains](qset#contains)(). ### [QSet::iterator](qset-iterator) QSet::find(const T &*value*) This is an overloaded function. Returns a non-const iterator positioned at the item *value* in the set. If the set contains no item *value*, the function returns [end](qset#end)(). ### [QSet::iterator](qset-iterator) QSet::insert(const T &*value*) Inserts item *value* into the set, if *value* isn't already in the set, and returns an iterator pointing at the inserted item. **See also** [operator<<](qset#operator-lt-lt)(), [remove](qset#remove)(), and [contains](qset#contains)(). ### `[since 6.1]` [QSet::iterator](qset-iterator) QSet::insert([QSet::const\_iterator](qset-const-iterator) *it*, const T &*value*) This is an overloaded function. Inserts item *value* into the set, if *value* isn't already in the set, and returns an iterator pointing at the inserted item. The iterator *it* is ignored. This function is provided for compatibility with the STL. This function was introduced in Qt 6.1. **See also** [operator<<](qset#operator-lt-lt)(), [remove](qset#remove)(), and [contains](qset#contains)(). ### [QSet](qset#QSet)<T> &QSet::intersect(const [QSet](qset#QSet)<T> &*other*) Removes all items from this set that are not contained in the *other* set. A reference to this set is returned. **See also** [intersects](qset#intersects)(), [operator&=](qset#operator-and-eq)(), [unite](qset#unite)(), and [subtract](qset#subtract)(). ### `[since 5.6]` bool QSet::intersects(const [QSet](qset#QSet)<T> &*other*) const Returns `true` if this set has at least one item in common with *other*. This function was introduced in Qt 5.6. **See also** [contains](qset#contains)() and [intersect](qset#intersect)(). ### bool QSet::isEmpty() const Returns `true` if the set contains no elements; otherwise returns false. **See also** [size](qset#size)(). ### bool QSet::remove(const T &*value*) Removes any occurrence of item *value* from the set. Returns true if an item was actually removed; otherwise returns `false`. **See also** [contains](qset#contains)() and [insert](qset#insert)(). ### void QSet::reserve(qsizetype *size*) Ensures that the set's internal hash table consists of at least *size* buckets. This function is useful for code that needs to build a huge set and wants to avoid repeated reallocation. For example: ``` QSet<QString> set; set.reserve(20000); for (int i = 0; i < 20000; ++i) set.insert(values[i]); ``` Ideally, *size* should be slightly more than the maximum number of elements expected in the set. *size* doesn't have to be prime, because [QSet](qset) will use a prime number internally anyway. If *size* is an underestimate, the worst that will happen is that the [QSet](qset) will be a bit slower. In general, you will rarely ever need to call this function. [QSet](qset)'s internal hash table automatically shrinks or grows to provide good performance without wasting too much memory. **See also** [squeeze](qset#squeeze)() and [capacity](qset#capacity)(). ### qsizetype QSet::size() const Returns the number of items in the set. **See also** [isEmpty](qset#isEmpty)() and [count](qset#count)(). ### void QSet::squeeze() Reduces the size of the set's internal hash table to save memory. The sole purpose of this function is to provide a means of fine tuning [QSet](qset)'s memory usage. In general, you will rarely ever need to call this function. **See also** [reserve](qset#reserve)() and [capacity](qset#capacity)(). ### [QSet](qset#QSet)<T> &QSet::subtract(const [QSet](qset#QSet)<T> &*other*) Removes all items from this set that are contained in the *other* set. Returns a reference to this set. **See also** [operator-=](qset#operator--eq)(), [unite](qset#unite)(), and [intersect](qset#intersect)(). ### void QSet::swap([QSet](qset#QSet)<T> &*other*) Swaps set *other* with this set. This operation is very fast and never fails. ### [QSet](qset#QSet)<T> &QSet::unite(const [QSet](qset#QSet)<T> &*other*) Each item in the *other* set that isn't already in this set is inserted into this set. A reference to this set is returned. **See also** [operator|=](qset#operator-7c-eq)(), [intersect](qset#intersect)(), and [subtract](qset#subtract)(). ### [QList](qlist)<T> QSet::values() const Returns a new [QList](qlist) containing the elements in the set. The order of the elements in the [QList](qlist) is undefined. **Note:** Since Qt 5.14, range constructors are available for Qt's generic [container classes](containers) and should be used in place of this method. This function creates a new list, in [linear time](containers#linear-time). The time and memory use that entails can be avoided by iterating from [constBegin](qset#constBegin)() to [constEnd](qset#constEnd)(). ### bool QSet::operator!=(const [QSet](qset#QSet)<T> &*other*) const Returns `true` if the *other* set is not equal to this set; otherwise returns `false`. Two sets are considered equal if they contain the same elements. This function requires the value type to implement `operator==()`. **See also** [operator==](qset#operator-eq-eq)(). ### [QSet](qset#QSet)<T> QSet::operator&(const [QSet](qset#QSet)<T> &*other*) const Returns a new [QSet](qset) that is the intersection of this set and the *other* set. **See also** [intersect](qset#intersect)(), [operator&=](qset#operator-and-eq)(), [operator|](qset#operator-7c)(), and [operator-](qset#operator-)(). ### [QSet](qset#QSet)<T> &QSet::operator&=(const [QSet](qset#QSet)<T> &*other*) Same as [intersect(*other*)](qset#intersect). **See also** [operator&](qset#operator-and)(), [operator|=](qset#operator-7c-eq)(), and [operator-=](qset#operator--eq)(). ### [QSet](qset#QSet)<T> &QSet::operator&=(const T &*value*) This is an overloaded function. Same as [intersect(*other*)](qset#intersect), if we consider *other* to be a set that contains the singleton *value*. ### [QSet](qset#QSet)<T> QSet::operator-(const [QSet](qset#QSet)<T> &*other*) const Returns a new [QSet](qset) that is the set difference of this set and the *other* set, i.e., this set - *other* set. **See also** [subtract](qset#subtract)(), [operator-=](qset#operator--eq)(), [operator|](qset#operator-7c)(), and [operator&](qset#operator-and)(). ### [QSet](qset#QSet)<T> &QSet::operator-=(const [QSet](qset#QSet)<T> &*other*) Same as [subtract(*other*)](qset#subtract). **See also** [operator-](qset#operator-)(), [operator|=](qset#operator-7c-eq)(), and [operator&=](qset#operator-and-eq)(). ### [QSet](qset#QSet)<T> &QSet::operator-=(const T &*value*) Removes the occurrence of item *value* from the set, if it is found, and returns a reference to the set. If the *value* is not contained the set, nothing is removed. **See also** [remove](qset#remove)(). ### bool QSet::operator==(const [QSet](qset#QSet)<T> &*other*) const Returns `true` if the *other* set is equal to this set; otherwise returns `false`. Two sets are considered equal if they contain the same elements. This function requires the value type to implement `operator==()`. **See also** [operator!=](qset#operator-not-eq)(). Related Non-Members ------------------- ### `[since 6.1]` template <typename T, typename Predicate> qsizetype erase\_if([QSet](qset#QSet)<T> &*set*, Predicate *pred*) Removes all elements for which the predicate *pred* returns true from the set *set*. Returns the number of elements removed, if any. This function was introduced in Qt 6.1. ### template <typename T> [QDataStream](qdatastream) &operator<<([QDataStream](qdatastream) &*out*, const [QSet](qset#QSet)<T> &*set*) Writes the *set* to stream *out*. This function requires the value type to implement `operator<<()`. **See also** [Format of the QDataStream operators](datastreamformat). ### template <typename T> [QDataStream](qdatastream) &operator>>([QDataStream](qdatastream) &*in*, [QSet](qset#QSet)<T> &*set*) Reads a set from stream *in* into *set*. This function requires the value type to implement `operator>>()`. **See also** [Format of the QDataStream operators](datastreamformat).
programming_docs
qt qt_add_statecharts qt\_add\_statecharts ==================== Description ----------- The `qt6_add_statecharts` macro instructs CMake to invoke the qscxmlc tool to read the provided .scxml files and produce C++ source and header files, that contain the classes that implement the state machines as defined in SCXML. Synopsis -------- ``` qt6_add_statecharts(<TARGET> file1.scxml [file2.scxml ...] [OPTIONS ...]) ``` For further instructions, options and examples please refer to [Using the Qt SCXML Compiler (qscxmlc)](qscxmlc) qt QWebEngineHistory Class QWebEngineHistory Class ======================= The QWebEngineHistory class represents the history of a web engine page. [More...](#details) | | | | --- | --- | | Header: | #include <QWebEngineHistory> | | CMake: | find\_package(Qt6 COMPONENTS WebEngineCore REQUIRED) target\_link\_libraries(mytarget PRIVATE Qt6::WebEngineCore) | | qmake: | QT += webenginecore | | Since: | Qt 5.4 | | Instantiated By: | [WebEngineHistory](qml-qtwebengine-webenginehistory) | | Inherits: | [QObject](qobject) | * [List of all members, including inherited members](https://doc.qt.io/qt-6.2/qwebenginehistory-members.html) Public Functions ---------------- | | | | --- | --- | | void | **[back](qwebenginehistory#back)**() | | QWebEngineHistoryItem | **[backItem](qwebenginehistory#backItem)**() const | | QList<QWebEngineHistoryItem> | **[backItems](qwebenginehistory#backItems)**(int *maxItems*) const | | QWebEngineHistoryModel \* | **[backItemsModel](qwebenginehistory#backItemsModel)**() const | | bool | **[canGoBack](qwebenginehistory#canGoBack)**() const | | bool | **[canGoForward](qwebenginehistory#canGoForward)**() const | | void | **[clear](qwebenginehistory#clear)**() | | int | **[count](qwebenginehistory#count)**() const | | QWebEngineHistoryItem | **[currentItem](qwebenginehistory#currentItem)**() const | | int | **[currentItemIndex](qwebenginehistory#currentItemIndex)**() const | | void | **[forward](qwebenginehistory#forward)**() | | QWebEngineHistoryItem | **[forwardItem](qwebenginehistory#forwardItem)**() const | | QList<QWebEngineHistoryItem> | **[forwardItems](qwebenginehistory#forwardItems)**(int *maxItems*) const | | QWebEngineHistoryModel \* | **[forwardItemsModel](qwebenginehistory#forwardItemsModel)**() const | | void | **[goToItem](qwebenginehistory#goToItem)**(const QWebEngineHistoryItem &*item*) | | QWebEngineHistoryItem | **[itemAt](qwebenginehistory#itemAt)**(int *i*) const | | QList<QWebEngineHistoryItem> | **[items](qwebenginehistory#items)**() const | | QWebEngineHistoryModel \* | **[itemsModel](qwebenginehistory#itemsModel)**() const | Related Non-Members ------------------- | | | | --- | --- | | QDataStream & | **[operator<<](qwebenginehistory#operator-lt-lt-1)**(QDataStream &*stream*, const QWebEngineHistory &*history*) | | QDataStream & | **[operator>>](qwebenginehistory#operator-gt-gt-1)**(QDataStream &*stream*, QWebEngineHistory &*history*) | Detailed Description -------------------- Each web engine page contains a history of visited pages that can be accessed by [QWebEnginePage::history](qwebenginepage#history)(). The history uses the concept of a *current item*, dividing the pages visited into those that can be visited by navigating *back* and *forward* using the [back](qwebenginehistory#back)() and [forward](qwebenginehistory#forward)() functions. The current item can be obtained by calling [currentItem](qwebenginehistory#currentItem)(), and an arbitrary item in the history can be made the current item by passing it to [goToItem](qwebenginehistory#goToItem)(). A list of items describing the pages that can be visited by going back can be obtained by calling the [backItems](qwebenginehistory#backItems)() function; similarly, items describing the pages ahead of the current page can be obtained with the [forwardItems](qwebenginehistory#forwardItems)() function. The total list of items is obtained with the [items](qwebenginehistory#items)() function. Also, the following [QWebEngineHistoryModel](qwebenginehistorymodel) data model objects are provided: * `backItemsModel()`, which contains the URLs of visited pages. * `forwardItemsModel()`, which contains the URLs of the pages that were visited after visiting the current page. * `itemsModel()`, which contains the URLs of the back and forward items, as well as the URL of the current page. Just as with containers, functions are available to examine the history in terms of a list. Arbitrary items in the history can be obtained with [itemAt](qwebenginehistory#itemAt)(), the total number of items is given by [count](qwebenginehistory#count)(), and the history can be cleared with the [clear](qwebenginehistory#clear)() function. QWebEngineHistory's state can be saved to a [QDataStream](qdatastream) using the >> operator and loaded by using the << operator. **See also** [QWebEngineHistoryItem](qwebenginehistoryitem) and [QWebEnginePage](qtwebengine-changes-qt6#qwebenginepage). Member Function Documentation ----------------------------- ### void QWebEngineHistory::back() Sets the current item to be the previous item in the history and goes to the corresponding page; that is, goes back one history item. **See also** [forward](qwebenginehistory#forward)() and [goToItem](qwebenginehistory#goToItem)(). ### [QWebEngineHistoryItem](qwebenginehistoryitem) QWebEngineHistory::backItem() const Returns the item before the current item in the history. ### [QList](qlist)<[QWebEngineHistoryItem](qwebenginehistoryitem)> QWebEngineHistory::backItems(int *maxItems*) const Returns the list of items in the backwards history list. At most *maxItems* entries are returned. **See also** [forwardItems](qwebenginehistory#forwardItems)(). ### [QWebEngineHistoryModel](qwebenginehistorymodel) \*QWebEngineHistory::backItemsModel() const Return the data model, which represents URLs of visited pages. **Note:** Getter function for property [backItems](qwebenginehistory#backItems). ### bool QWebEngineHistory::canGoBack() const Returns `true` if there is an item preceding the current item in the history; otherwise returns `false`. **See also** [canGoForward](qwebenginehistory#canGoForward)(). ### bool QWebEngineHistory::canGoForward() const Returns `true` if we have an item to go forward to; otherwise returns `false`. **See also** [canGoBack](qwebenginehistory#canGoBack)(). ### `[invokable]` void QWebEngineHistory::clear() Clears the history. **Note:** This function can be invoked via the meta-object system and from QML. See [Q\_INVOKABLE](qobject#Q_INVOKABLE). **See also** [count](qwebenginehistory#count)() and [items](qwebenginehistory#items)(). ### int QWebEngineHistory::count() const Returns the total number of items in the history. ### [QWebEngineHistoryItem](qwebenginehistoryitem) QWebEngineHistory::currentItem() const Returns the current item in the history. ### int QWebEngineHistory::currentItemIndex() const Returns the index of the current item in history. ### void QWebEngineHistory::forward() Sets the current item to be the next item in the history and goes to the corresponding page; that is, goes forward one history item. **See also** [back](qwebenginehistory#back)() and [goToItem](qwebenginehistory#goToItem)(). ### [QWebEngineHistoryItem](qwebenginehistoryitem) QWebEngineHistory::forwardItem() const Returns the item after the current item in the history. ### [QList](qlist)<[QWebEngineHistoryItem](qwebenginehistoryitem)> QWebEngineHistory::forwardItems(int *maxItems*) const Returns the list of items in the forward history list. At most *maxItems* entries are returned. **See also** [backItems](qwebenginehistory#backItems)(). ### [QWebEngineHistoryModel](qwebenginehistorymodel) \*QWebEngineHistory::forwardItemsModel() const Return the data model, which represents URLs of the pages that were visited after visiting the current page. **Note:** Getter function for property [forwardItems](qwebenginehistory#forwardItems). ### void QWebEngineHistory::goToItem(const [QWebEngineHistoryItem](qwebenginehistoryitem) &*item*) Sets the current item to be the specified *item* in the history and goes to the page. **See also** [back](qwebenginehistory#back)() and [forward](qwebenginehistory#forward)(). ### [QWebEngineHistoryItem](qwebenginehistoryitem) QWebEngineHistory::itemAt(int *i*) const Returns the item at index *i* in the history. ### [QList](qlist)<[QWebEngineHistoryItem](qwebenginehistoryitem)> QWebEngineHistory::items() const Returns a list of all items currently in the history. **See also** [count](qwebenginehistory#count)() and [clear](qwebenginehistory#clear)(). ### [QWebEngineHistoryModel](qwebenginehistorymodel) \*QWebEngineHistory::itemsModel() const Returns the data model, which represents URLs of back items, forward items, and the current item in the history. **Note:** Getter function for property [items](qwebenginehistory#items). Related Non-Members ------------------- ### [QDataStream](qdatastream) &operator<<([QDataStream](qdatastream) &*stream*, const QWebEngineHistory &*history*) Saves the web engine history *history* into *stream*. ### [QDataStream](qdatastream) &operator>>([QDataStream](qdatastream) &*stream*, QWebEngineHistory &*history*) Loads the web engine history from *stream* into *history*. qt iterator Class iterator Class ============== class [QTextFrame](qtextframe)::iterator The iterator class provides an iterator for reading the contents of a [QTextFrame](qtextframe). [More...](#details) * [List of all members, including inherited members](https://doc.qt.io/qt-6.2/qtextframe-iterator-members.html) Public Functions ---------------- | | | | --- | --- | | | **[iterator](qtextframe-iterator#iterator-1)**() | | bool | **[atEnd](qtextframe-iterator#atEnd)**() const | | QTextBlock | **[currentBlock](qtextframe-iterator#currentBlock)**() const | | QTextFrame \* | **[currentFrame](qtextframe-iterator#currentFrame)**() const | | QTextFrame \* | **[parentFrame](qtextframe-iterator#parentFrame)**() const | | bool | **[operator!=](qtextframe-iterator#operator-not-eq)**(const iterator &*other*) const | | iterator & | **[operator++](qtextframe-iterator#operator-2b-2b)**() | | iterator | **[operator++](qtextframe-iterator#operator-2b-2b-1)**(int) | | iterator & | **[operator--](qtextframe-iterator#operator--)**() | | iterator | **[operator--](qtextframe-iterator#operator---1)**(int) | | bool | **[operator==](qtextframe-iterator#operator-eq-eq)**(const iterator &*other*) const | Detailed Description -------------------- A frame consists of an arbitrary sequence of [QTextBlock](qtextblock)s and child [QTextFrame](qtextframe)s. This class provides a way to iterate over the child objects of a frame, and read their contents. It does not provide a way to modify the contents of the frame. Member Function Documentation ----------------------------- ### iterator::iterator() Constructs an invalid iterator. ### bool iterator::atEnd() const Returns `true` if the current item is the last item in the text frame. ### [QTextBlock](qtextblock) iterator::currentBlock() const Returns the current block the iterator points to. If the iterator points to a child frame, the returned block is invalid. **See also** [currentFrame](qtextframe-iterator#currentFrame)(). ### [QTextFrame](qtextframe#QTextFrame) \*iterator::currentFrame() const Returns the current frame pointed to by the iterator, or `nullptr` if the iterator currently points to a block. **See also** [currentBlock](qtextframe-iterator#currentBlock)(). ### [QTextFrame](qtextframe#QTextFrame) \*iterator::parentFrame() const Returns the parent frame of the current frame. **See also** [currentFrame](qtextframe-iterator#currentFrame)() and [QTextFrame::parentFrame](qtextframe#parentFrame)(). ### bool iterator::operator!=(const iterator &*other*) const Returns true if the iterator is different from the *other* iterator; otherwise returns `false`. ### iterator &iterator::operator++() Moves the iterator to the next frame or block. **See also** [currentBlock](qtextframe-iterator#currentBlock)() and [currentFrame](qtextframe-iterator#currentFrame)(). ### iterator iterator::operator++(int) The postfix ++ operator (`i++`) advances the iterator to the next item in the text frame, and returns an iterator to the old item. ### iterator &iterator::operator--() Moves the iterator to the previous frame or block. **See also** [currentBlock](qtextframe-iterator#currentBlock)() and [currentFrame](qtextframe-iterator#currentFrame)(). ### iterator iterator::operator--(int) The postfix -- operator (`i--`) makes the preceding item in the current frame, and returns an iterator to the old item. ### bool iterator::operator==(const iterator &*other*) const Returns true if the iterator is the same as the *other* iterator; otherwise returns `false`. qt QTextTableCellFormat Class QTextTableCellFormat Class ========================== The QTextTableCellFormat class provides formatting information for table cells in a [QTextDocument](qtextdocument). [More...](#details) | | | | --- | --- | | Header: | #include <QTextTableCellFormat> | | CMake: | find\_package(Qt6 COMPONENTS Gui REQUIRED) target\_link\_libraries(mytarget PRIVATE Qt6::Gui) | | qmake: | QT += gui | | Inherits: | [QTextCharFormat](qtextcharformat) | * [List of all members, including inherited members](https://doc.qt.io/qt-6.2/qtexttablecellformat-members.html) **Note:** All functions in this class are [reentrant](threads-reentrancy). Public Functions ---------------- | | | | --- | --- | | | **[QTextTableCellFormat](qtexttablecellformat#QTextTableCellFormat)**() | | qreal | **[bottomBorder](qtexttablecellformat#bottomBorder)**() const | | QBrush | **[bottomBorderBrush](qtexttablecellformat#bottomBorderBrush)**() const | | QTextFrameFormat::BorderStyle | **[bottomBorderStyle](qtexttablecellformat#bottomBorderStyle)**() const | | qreal | **[bottomPadding](qtexttablecellformat#bottomPadding)**() const | | bool | **[isValid](qtexttablecellformat#isValid)**() const | | qreal | **[leftBorder](qtexttablecellformat#leftBorder)**() const | | QBrush | **[leftBorderBrush](qtexttablecellformat#leftBorderBrush)**() const | | QTextFrameFormat::BorderStyle | **[leftBorderStyle](qtexttablecellformat#leftBorderStyle)**() const | | qreal | **[leftPadding](qtexttablecellformat#leftPadding)**() const | | qreal | **[rightBorder](qtexttablecellformat#rightBorder)**() const | | QBrush | **[rightBorderBrush](qtexttablecellformat#rightBorderBrush)**() const | | QTextFrameFormat::BorderStyle | **[rightBorderStyle](qtexttablecellformat#rightBorderStyle)**() const | | qreal | **[rightPadding](qtexttablecellformat#rightPadding)**() const | | void | **[setBorder](qtexttablecellformat#setBorder)**(qreal *width*) | | void | **[setBorderBrush](qtexttablecellformat#setBorderBrush)**(const QBrush &*brush*) | | void | **[setBorderStyle](qtexttablecellformat#setBorderStyle)**(QTextFrameFormat::BorderStyle *style*) | | void | **[setBottomBorder](qtexttablecellformat#setBottomBorder)**(qreal *width*) | | void | **[setBottomBorderBrush](qtexttablecellformat#setBottomBorderBrush)**(const QBrush &*brush*) | | void | **[setBottomBorderStyle](qtexttablecellformat#setBottomBorderStyle)**(QTextFrameFormat::BorderStyle *style*) | | void | **[setBottomPadding](qtexttablecellformat#setBottomPadding)**(qreal *padding*) | | void | **[setLeftBorder](qtexttablecellformat#setLeftBorder)**(qreal *width*) | | void | **[setLeftBorderBrush](qtexttablecellformat#setLeftBorderBrush)**(const QBrush &*brush*) | | void | **[setLeftBorderStyle](qtexttablecellformat#setLeftBorderStyle)**(QTextFrameFormat::BorderStyle *style*) | | void | **[setLeftPadding](qtexttablecellformat#setLeftPadding)**(qreal *padding*) | | void | **[setPadding](qtexttablecellformat#setPadding)**(qreal *padding*) | | void | **[setRightBorder](qtexttablecellformat#setRightBorder)**(qreal *width*) | | void | **[setRightBorderBrush](qtexttablecellformat#setRightBorderBrush)**(const QBrush &*brush*) | | void | **[setRightBorderStyle](qtexttablecellformat#setRightBorderStyle)**(QTextFrameFormat::BorderStyle *style*) | | void | **[setRightPadding](qtexttablecellformat#setRightPadding)**(qreal *padding*) | | void | **[setTopBorder](qtexttablecellformat#setTopBorder)**(qreal *width*) | | void | **[setTopBorderBrush](qtexttablecellformat#setTopBorderBrush)**(const QBrush &*brush*) | | void | **[setTopBorderStyle](qtexttablecellformat#setTopBorderStyle)**(QTextFrameFormat::BorderStyle *style*) | | void | **[setTopPadding](qtexttablecellformat#setTopPadding)**(qreal *padding*) | | qreal | **[topBorder](qtexttablecellformat#topBorder)**() const | | QBrush | **[topBorderBrush](qtexttablecellformat#topBorderBrush)**() const | | QTextFrameFormat::BorderStyle | **[topBorderStyle](qtexttablecellformat#topBorderStyle)**() const | | qreal | **[topPadding](qtexttablecellformat#topPadding)**() const | Detailed Description -------------------- The table cell format of a table cell in a document specifies the visual properties of the table cell. The padding properties of a table cell are controlled by [setLeftPadding](qtexttablecellformat#setLeftPadding)(), [setRightPadding](qtexttablecellformat#setRightPadding)(), [setTopPadding](qtexttablecellformat#setTopPadding)(), and [setBottomPadding](qtexttablecellformat#setBottomPadding)(). All the paddings can be set at once using [setPadding](qtexttablecellformat#setPadding)(). **See also** [QTextFormat](qtextformat), [QTextBlockFormat](qtextblockformat), [QTextTableFormat](qtexttableformat), and [QTextCharFormat](qtextcharformat). Member Function Documentation ----------------------------- ### QTextTableCellFormat::QTextTableCellFormat() Constructs a new table cell format object. ### `[since 5.14]` [qreal](qtglobal#qreal-typedef) QTextTableCellFormat::bottomBorder() const Returns the bottom border width of the table cell. This function was introduced in Qt 5.14. **See also** [setBottomBorder](qtexttablecellformat#setBottomBorder)(). ### `[since 5.14]` [QBrush](qbrush) QTextTableCellFormat::bottomBorderBrush() const Returns the bottom border brush of the table cell. This function was introduced in Qt 5.14. **See also** [setBottomBorderBrush](qtexttablecellformat#setBottomBorderBrush)(). ### `[since 5.14]` [QTextFrameFormat::BorderStyle](qtextframeformat#BorderStyle-enum) QTextTableCellFormat::bottomBorderStyle() const Returns the bottom border style of the table cell. This function was introduced in Qt 5.14. **See also** [setBottomBorderStyle](qtexttablecellformat#setBottomBorderStyle)(). ### [qreal](qtglobal#qreal-typedef) QTextTableCellFormat::bottomPadding() const Gets the bottom padding of the table cell. **See also** [setBottomPadding](qtexttablecellformat#setBottomPadding)(), [leftPadding](qtexttablecellformat#leftPadding)(), [rightPadding](qtexttablecellformat#rightPadding)(), and [topPadding](qtexttablecellformat#topPadding)(). ### bool QTextTableCellFormat::isValid() const Returns `true` if this table cell format is valid; otherwise returns `false`. ### `[since 5.14]` [qreal](qtglobal#qreal-typedef) QTextTableCellFormat::leftBorder() const Returns the left border width of the table cell. This function was introduced in Qt 5.14. **See also** [setLeftBorder](qtexttablecellformat#setLeftBorder)(). ### `[since 5.14]` [QBrush](qbrush) QTextTableCellFormat::leftBorderBrush() const Returns the left border brush of the table cell. This function was introduced in Qt 5.14. **See also** [setLeftBorderBrush](qtexttablecellformat#setLeftBorderBrush)(). ### `[since 5.14]` [QTextFrameFormat::BorderStyle](qtextframeformat#BorderStyle-enum) QTextTableCellFormat::leftBorderStyle() const Returns the left border style of the table cell. This function was introduced in Qt 5.14. **See also** [setLeftBorderStyle](qtexttablecellformat#setLeftBorderStyle)(). ### [qreal](qtglobal#qreal-typedef) QTextTableCellFormat::leftPadding() const Gets the left padding of the table cell. **See also** [setLeftPadding](qtexttablecellformat#setLeftPadding)(), [rightPadding](qtexttablecellformat#rightPadding)(), [topPadding](qtexttablecellformat#topPadding)(), and [bottomPadding](qtexttablecellformat#bottomPadding)(). ### `[since 5.14]` [qreal](qtglobal#qreal-typedef) QTextTableCellFormat::rightBorder() const Returns the right border width of the table cell. This function was introduced in Qt 5.14. **See also** [setRightBorder](qtexttablecellformat#setRightBorder)(). ### `[since 5.14]` [QBrush](qbrush) QTextTableCellFormat::rightBorderBrush() const Returns the right border brush of the table cell. This function was introduced in Qt 5.14. **See also** [setRightBorderBrush](qtexttablecellformat#setRightBorderBrush)(). ### `[since 5.14]` [QTextFrameFormat::BorderStyle](qtextframeformat#BorderStyle-enum) QTextTableCellFormat::rightBorderStyle() const Returns the right border style of the table cell. This function was introduced in Qt 5.14. **See also** [setRightBorderStyle](qtexttablecellformat#setRightBorderStyle)(). ### [qreal](qtglobal#qreal-typedef) QTextTableCellFormat::rightPadding() const Gets the right padding of the table cell. **See also** [setRightPadding](qtexttablecellformat#setRightPadding)(), [leftPadding](qtexttablecellformat#leftPadding)(), [topPadding](qtexttablecellformat#topPadding)(), and [bottomPadding](qtexttablecellformat#bottomPadding)(). ### `[since 5.14]` void QTextTableCellFormat::setBorder([qreal](qtglobal#qreal-typedef) *width*) Sets the left, right, top, and bottom border *width* of the table cell. This function was introduced in Qt 5.14. **See also** [setLeftBorder](qtexttablecellformat#setLeftBorder)(), [setRightBorder](qtexttablecellformat#setRightBorder)(), [setTopBorder](qtexttablecellformat#setTopBorder)(), [setBottomBorder](qtexttablecellformat#setBottomBorder)(), and [QTextTableFormat::setBorderCollapse](qtexttableformat#setBorderCollapse). ### `[since 5.14]` void QTextTableCellFormat::setBorderBrush(const [QBrush](qbrush) &*brush*) Sets the left, right, top, and bottom border *brush* of the table cell. This function was introduced in Qt 5.14. **See also** [setLeftBorderBrush](qtexttablecellformat#setLeftBorderBrush)(), [setRightBorderBrush](qtexttablecellformat#setRightBorderBrush)(), [setTopBorderBrush](qtexttablecellformat#setTopBorderBrush)(), [setBottomBorderBrush](qtexttablecellformat#setBottomBorderBrush)(), and [QTextTableFormat::setBorderCollapse](qtexttableformat#setBorderCollapse). ### `[since 5.14]` void QTextTableCellFormat::setBorderStyle([QTextFrameFormat::BorderStyle](qtextframeformat#BorderStyle-enum) *style*) Sets the left, right, top, and bottom border *style* of the table cell. This function was introduced in Qt 5.14. **See also** [setLeftBorderStyle](qtexttablecellformat#setLeftBorderStyle)(), [setRightBorderStyle](qtexttablecellformat#setRightBorderStyle)(), [setTopBorderStyle](qtexttablecellformat#setTopBorderStyle)(), [setBottomBorderStyle](qtexttablecellformat#setBottomBorderStyle)(), and [QTextTableFormat::setBorderCollapse](qtexttableformat#setBorderCollapse). ### `[since 5.14]` void QTextTableCellFormat::setBottomBorder([qreal](qtglobal#qreal-typedef) *width*) Sets the bottom border *width* of the table cell. This function was introduced in Qt 5.14. **See also** [bottomBorder](qtexttablecellformat#bottomBorder)() and [QTextTableFormat::setBorderCollapse](qtexttableformat#setBorderCollapse). ### `[since 5.14]` void QTextTableCellFormat::setBottomBorderBrush(const [QBrush](qbrush) &*brush*) Sets the bottom border *brush* of the table cell. This function was introduced in Qt 5.14. **See also** [bottomBorderBrush](qtexttablecellformat#bottomBorderBrush)() and [QTextTableFormat::setBorderCollapse](qtexttableformat#setBorderCollapse). ### `[since 5.14]` void QTextTableCellFormat::setBottomBorderStyle([QTextFrameFormat::BorderStyle](qtextframeformat#BorderStyle-enum) *style*) Sets the bottom border *style* of the table cell. This function was introduced in Qt 5.14. **See also** [bottomBorderStyle](qtexttablecellformat#bottomBorderStyle)() and [QTextTableFormat::setBorderCollapse](qtexttableformat#setBorderCollapse). ### void QTextTableCellFormat::setBottomPadding([qreal](qtglobal#qreal-typedef) *padding*) Sets the bottom *padding* of the table cell. **See also** [bottomPadding](qtexttablecellformat#bottomPadding)(), [setLeftPadding](qtexttablecellformat#setLeftPadding)(), [setRightPadding](qtexttablecellformat#setRightPadding)(), and [setTopPadding](qtexttablecellformat#setTopPadding)(). ### `[since 5.14]` void QTextTableCellFormat::setLeftBorder([qreal](qtglobal#qreal-typedef) *width*) Sets the left border *width* of the table cell. This function was introduced in Qt 5.14. **See also** [leftBorder](qtexttablecellformat#leftBorder)() and [QTextTableFormat::setBorderCollapse](qtexttableformat#setBorderCollapse). ### `[since 5.14]` void QTextTableCellFormat::setLeftBorderBrush(const [QBrush](qbrush) &*brush*) Sets the left border *brush* of the table cell. This function was introduced in Qt 5.14. **See also** [leftBorderBrush](qtexttablecellformat#leftBorderBrush)() and [QTextTableFormat::setBorderCollapse](qtexttableformat#setBorderCollapse). ### `[since 5.14]` void QTextTableCellFormat::setLeftBorderStyle([QTextFrameFormat::BorderStyle](qtextframeformat#BorderStyle-enum) *style*) Sets the left border *style* of the table cell. This function was introduced in Qt 5.14. **See also** [leftBorderStyle](qtexttablecellformat#leftBorderStyle)() and [QTextTableFormat::setBorderCollapse](qtexttableformat#setBorderCollapse). ### void QTextTableCellFormat::setLeftPadding([qreal](qtglobal#qreal-typedef) *padding*) Sets the left *padding* of the table cell. **See also** [leftPadding](qtexttablecellformat#leftPadding)(), [setRightPadding](qtexttablecellformat#setRightPadding)(), [setTopPadding](qtexttablecellformat#setTopPadding)(), and [setBottomPadding](qtexttablecellformat#setBottomPadding)(). ### void QTextTableCellFormat::setPadding([qreal](qtglobal#qreal-typedef) *padding*) Sets the left, right, top, and bottom *padding* of the table cell. **See also** [setLeftPadding](qtexttablecellformat#setLeftPadding)(), [setRightPadding](qtexttablecellformat#setRightPadding)(), [setTopPadding](qtexttablecellformat#setTopPadding)(), and [setBottomPadding](qtexttablecellformat#setBottomPadding)(). ### `[since 5.14]` void QTextTableCellFormat::setRightBorder([qreal](qtglobal#qreal-typedef) *width*) Sets the right border *width* of the table cell. This function was introduced in Qt 5.14. **See also** [rightBorder](qtexttablecellformat#rightBorder)() and [QTextTableFormat::setBorderCollapse](qtexttableformat#setBorderCollapse). ### `[since 5.14]` void QTextTableCellFormat::setRightBorderBrush(const [QBrush](qbrush) &*brush*) Sets the right border *brush* of the table cell. This function was introduced in Qt 5.14. **See also** [rightBorderBrush](qtexttablecellformat#rightBorderBrush)() and [QTextTableFormat::setBorderCollapse](qtexttableformat#setBorderCollapse). ### `[since 5.14]` void QTextTableCellFormat::setRightBorderStyle([QTextFrameFormat::BorderStyle](qtextframeformat#BorderStyle-enum) *style*) Sets the right border *style* of the table cell. This function was introduced in Qt 5.14. **See also** [rightBorderStyle](qtexttablecellformat#rightBorderStyle)() and [QTextTableFormat::setBorderCollapse](qtexttableformat#setBorderCollapse). ### void QTextTableCellFormat::setRightPadding([qreal](qtglobal#qreal-typedef) *padding*) Sets the right *padding* of the table cell. **See also** [rightPadding](qtexttablecellformat#rightPadding)(), [setLeftPadding](qtexttablecellformat#setLeftPadding)(), [setTopPadding](qtexttablecellformat#setTopPadding)(), and [setBottomPadding](qtexttablecellformat#setBottomPadding)(). ### `[since 5.14]` void QTextTableCellFormat::setTopBorder([qreal](qtglobal#qreal-typedef) *width*) Sets the top border *width* of the table cell. This function was introduced in Qt 5.14. **See also** [topBorder](qtexttablecellformat#topBorder)() and [QTextTableFormat::setBorderCollapse](qtexttableformat#setBorderCollapse). ### `[since 5.14]` void QTextTableCellFormat::setTopBorderBrush(const [QBrush](qbrush) &*brush*) Sets the top border *brush* of the table cell. This function was introduced in Qt 5.14. **See also** [topBorderBrush](qtexttablecellformat#topBorderBrush)() and [QTextTableFormat::setBorderCollapse](qtexttableformat#setBorderCollapse). ### `[since 5.14]` void QTextTableCellFormat::setTopBorderStyle([QTextFrameFormat::BorderStyle](qtextframeformat#BorderStyle-enum) *style*) Sets the top border *style* of the table cell. This function was introduced in Qt 5.14. **See also** [topBorderStyle](qtexttablecellformat#topBorderStyle)() and [QTextTableFormat::setBorderCollapse](qtexttableformat#setBorderCollapse). ### void QTextTableCellFormat::setTopPadding([qreal](qtglobal#qreal-typedef) *padding*) Sets the top *padding* of the table cell. **See also** [topPadding](qtexttablecellformat#topPadding)(), [setLeftPadding](qtexttablecellformat#setLeftPadding)(), [setRightPadding](qtexttablecellformat#setRightPadding)(), and [setBottomPadding](qtexttablecellformat#setBottomPadding)(). ### `[since 5.14]` [qreal](qtglobal#qreal-typedef) QTextTableCellFormat::topBorder() const Returns the top border width of the table cell. This function was introduced in Qt 5.14. **See also** [setTopBorder](qtexttablecellformat#setTopBorder)(). ### `[since 5.14]` [QBrush](qbrush) QTextTableCellFormat::topBorderBrush() const Returns the top border brush of the table cell. This function was introduced in Qt 5.14. **See also** [setTopBorderBrush](qtexttablecellformat#setTopBorderBrush)(). ### `[since 5.14]` [QTextFrameFormat::BorderStyle](qtextframeformat#BorderStyle-enum) QTextTableCellFormat::topBorderStyle() const Returns the top border style of the table cell. This function was introduced in Qt 5.14. **See also** [setTopBorderStyle](qtexttablecellformat#setTopBorderStyle)(). ### [qreal](qtglobal#qreal-typedef) QTextTableCellFormat::topPadding() const Gets the top padding of the table cell. **See also** [setTopPadding](qtexttablecellformat#setTopPadding)(), [leftPadding](qtexttablecellformat#leftPadding)(), [rightPadding](qtexttablecellformat#rightPadding)(), and [bottomPadding](qtexttablecellformat#bottomPadding)().
programming_docs
qt <QtGlobal> - Global Qt Declarations <QtGlobal> - Global Qt Declarations =================================== The <QtGlobal> header file includes the fundamental global declarations. It is included by most other Qt header files. [More...](#details) | | | | --- | --- | | Header: | #include <QtGlobal> | * [Deprecated members](https://doc.qt.io/qt-6.2/qtglobal-obsolete.html) Types ----- | | | | --- | --- | | | **[QFunctionPointer](qtglobal#QFunctionPointer-typedef)** | | | **[QtMessageHandler](qtglobal#QtMessageHandler-typedef)** | | enum | **[QtMsgType](qtglobal#QtMsgType-enum)** { QtDebugMsg, QtInfoMsg, QtWarningMsg, QtCriticalMsg, QtFatalMsg, QtSystemMsg } | | | **[qint8](qtglobal#qint8-typedef)** | | | **[qint16](qtglobal#qint16-typedef)** | | | **[qint32](qtglobal#qint32-typedef)** | | | **[qint64](qtglobal#qint64-typedef)** | | | **[qintptr](qtglobal#qintptr-typedef)** | | | **[qlonglong](qtglobal#qlonglong-typedef)** | | | **[qptrdiff](qtglobal#qptrdiff-typedef)** | | | **[qreal](qtglobal#qreal-typedef)** | | | **[qsizetype](qtglobal#qsizetype-typedef)** | | | **[quint8](qtglobal#quint8-typedef)** | | | **[quint16](qtglobal#quint16-typedef)** | | | **[quint32](qtglobal#quint32-typedef)** | | | **[quint64](qtglobal#quint64-typedef)** | | | **[quintptr](qtglobal#quintptr-typedef)** | | | **[qulonglong](qtglobal#qulonglong-typedef)** | | | **[uchar](qtglobal#uchar-typedef)** | | | **[uint](qtglobal#uint-typedef)** | | | **[ulong](qtglobal#ulong-typedef)** | | | **[ushort](qtglobal#ushort-typedef)** | Functions --------- | | | | --- | --- | | | | | | | | T | **[qAbs](qtglobal#qAbs)**(const T &*t*) | | typename std::add\_const<T>::type & | **[qAsConst](qtglobal#qAsConst)**(T &*t*) | | void | **[qAsConst](qtglobal#qAsConst-1)**(const T &&*t*) | | const T & | **[qBound](qtglobal#qBound)**(const T &*min*, const T &*val*, const T &*max*) | | auto | **[qConstOverload](qtglobal#qConstOverload)**(T *memberFunctionPointer*) | | QString | **[qEnvironmentVariable](qtglobal#qEnvironmentVariable)**(const char \**varName*, const QString &*defaultValue*) | | QString | **[qEnvironmentVariable](qtglobal#qEnvironmentVariable-1)**(const char \**varName*) | | int | **[qEnvironmentVariableIntValue](qtglobal#qEnvironmentVariableIntValue)**(const char \**varName*, bool \**ok* = nullptr) | | bool | **[qEnvironmentVariableIsEmpty](qtglobal#qEnvironmentVariableIsEmpty)**(const char \**varName*) | | bool | **[qEnvironmentVariableIsSet](qtglobal#qEnvironmentVariableIsSet)**(const char \**varName*) | | T | **[qExchange](qtglobal#qExchange)**(T &*obj*, U &&*newValue*) | | quint32 | **[qFloatDistance](qtglobal#qFloatDistance)**(float *a*, float *b*) | | quint64 | **[qFloatDistance](qtglobal#qFloatDistance-1)**(double *a*, double *b*) | | QString | **[qFormatLogMessage](qtglobal#qFormatLogMessage)**(QtMsgType *type*, const QMessageLogContext &*context*, const QString &*str*) | | int | **[qFpClassify](qtglobal#qFpClassify)**(double *val*) | | int | **[qFpClassify](qtglobal#qFpClassify-1)**(float *val*) | | bool | **[qFuzzyCompare](qtglobal#qFuzzyCompare)**(double *p1*, double *p2*) | | bool | **[qFuzzyCompare](qtglobal#qFuzzyCompare-1)**(float *p1*, float *p2*) | | bool | **[qFuzzyIsNull](qtglobal#qFuzzyIsNull)**(double *d*) | | bool | **[qFuzzyIsNull](qtglobal#qFuzzyIsNull-1)**(float *f*) | | double | **[qInf](qtglobal#qInf)**() | | QtMessageHandler | **[qInstallMessageHandler](qtglobal#qInstallMessageHandler)**(QtMessageHandler *handler*) | | bool | **[qIsFinite](qtglobal#qIsFinite)**(double *d*) | | bool | **[qIsFinite](qtglobal#qIsFinite-1)**(float *f*) | | bool | **[qIsInf](qtglobal#qIsInf)**(double *d*) | | bool | **[qIsInf](qtglobal#qIsInf-1)**(float *f*) | | bool | **[qIsNaN](qtglobal#qIsNaN)**(double *d*) | | bool | **[qIsNaN](qtglobal#qIsNaN-1)**(float *f*) | | const T & | **[qMax](qtglobal#qMax)**(const T &*a*, const T &*b*) | | const T & | **[qMin](qtglobal#qMin)**(const T &*a*, const T &*b*) | | auto | **[qNonConstOverload](qtglobal#qNonConstOverload)**(T *memberFunctionPointer*) | | auto | **[qOverload](qtglobal#qOverload)**(T *functionPointer*) | | double | **[qQNaN](qtglobal#qQNaN)**() | | qint64 | **[qRound64](qtglobal#qRound64)**(double *d*) | | qint64 | **[qRound64](qtglobal#qRound64-1)**(float *d*) | | int | **[qRound](qtglobal#qRound)**(double *d*) | | int | **[qRound](qtglobal#qRound-1)**(float *d*) | | double | **[qSNaN](qtglobal#qSNaN)**() | | void | **[qSetMessagePattern](qtglobal#qSetMessagePattern)**(const QString &*pattern*) | | std::underlying\_type\_t<Enum> | **[qToUnderlying](qtglobal#qToUnderlying)**(Enum *e*) | | const char \* | **[qVersion](qtglobal#qVersion)**() | | T \* | **[q\_check\_ptr](qtglobal#q_check_ptr)**(T \**p*) | | QByteArray | **[qgetenv](qtglobal#qgetenv)**(const char \**varName*) | | bool | **[qputenv](qtglobal#qputenv)**(const char \**varName*, const QByteArray &*value*) | | QString | **[qtTrId](qtglobal#qtTrId)**(const char \**id*, int *n* = -1) | | bool | **[qunsetenv](qtglobal#qunsetenv)**(const char \**varName*) | Macros ------ | | | | --- | --- | | | | | | | | | | | | | | | **[PRIXQUINTPTR](qtglobal#PRIXQUINTPTR)** | | | **[PRIdQINTPTR](qtglobal#PRIdQINTPTR)** | | | **[PRIdQPTRDIFF](qtglobal#PRIdQPTRDIFF)** | | | **[PRIdQSIZETYPE](qtglobal#PRIdQSIZETYPE)** | | | **[PRIiQINTPTR](qtglobal#PRIiQINTPTR)** | | | **[PRIiQPTRDIFF](qtglobal#PRIiQPTRDIFF)** | | | **[PRIiQSIZETYPE](qtglobal#PRIiQSIZETYPE)** | | | **[PRIoQUINTPTR](qtglobal#PRIoQUINTPTR)** | | | **[PRIuQUINTPTR](qtglobal#PRIuQUINTPTR)** | | | **[PRIxQUINTPTR](qtglobal#PRIxQUINTPTRx)** | | | **[QT\_DEPRECATED\_WARNINGS](qtglobal#QT_DEPRECATED_WARNINGS)** | | | **[QT\_DISABLE\_DEPRECATED\_BEFORE](qtglobal#QT_DISABLE_DEPRECATED_BEFORE)** | | | **[QT\_NO\_DEPRECATED\_WARNINGS](qtglobal#QT_NO_DEPRECATED_WARNINGS)** | | | **[QT\_POINTER\_SIZE](qtglobal#QT_POINTER_SIZE)** | | | **[QT\_REQUIRE\_VERSION](qtglobal#QT_REQUIRE_VERSION)**(int *argc*, char \*\**argv*, const char \**version*) | | | **[QT\_TRANSLATE\_NOOP3](qtglobal#QT_TRANSLATE_NOOP3)**(*context*, *sourceText*, *disambiguation*) | | | **[QT\_TRANSLATE\_NOOP](qtglobal#QT_TRANSLATE_NOOP)**(*context*, *sourceText*) | | | **[QT\_TRANSLATE\_N\_NOOP3](qtglobal#QT_TRANSLATE_N_NOOP3)**(*context*, *sourceText*, *comment*) | | | **[QT\_TRANSLATE\_N\_NOOP](qtglobal#QT_TRANSLATE_N_NOOP)**(*context*, *sourceText*) | | | **[QT\_TRID\_NOOP](qtglobal#QT_TRID_NOOP)**(*id*) | | | **[QT\_TR\_NOOP](qtglobal#QT_TR_NOOP)**(*sourceText*) | | | **[QT\_TR\_N\_NOOP](qtglobal#QT_TR_N_NOOP)**(*sourceText*) | | | **[QT\_VERSION](qtglobal#QT_VERSION)** | | | **[QT\_VERSION\_CHECK](qtglobal#QT_VERSION_CHECK)** | | | **[QT\_VERSION\_STR](qtglobal#QT_VERSION_STR)** | | void | **[Q\_ASSERT](qtglobal#Q_ASSERT)**(bool *test*) | | void | **[Q\_ASSERT\_X](qtglobal#Q_ASSERT_X)**(bool *test*, const char \**where*, const char \**what*) | | void | **[Q\_ASSUME](qtglobal#Q_ASSUME)**(bool *expr*) | | | **[Q\_BIG\_ENDIAN](qtglobal#Q_BIG_ENDIAN)** | | | **[Q\_BYTE\_ORDER](qtglobal#Q_BYTE_ORDER)** | | | **[Q\_CC\_BOR](qtglobal#Q_CC_BOR)** | | | **[Q\_CC\_CDS](qtglobal#Q_CC_CDS)** | | | **[Q\_CC\_CLANG](qtglobal#Q_CC_CLANG)** | | | **[Q\_CC\_COMEAU](qtglobal#Q_CC_COMEAU)** | | | **[Q\_CC\_DEC](qtglobal#Q_CC_DEC)** | | | **[Q\_CC\_EDG](qtglobal#Q_CC_EDG)** | | | **[Q\_CC\_GHS](qtglobal#Q_CC_GHS)** | | | **[Q\_CC\_GNU](qtglobal#Q_CC_GNU)** | | | **[Q\_CC\_HIGHC](qtglobal#Q_CC_HIGHC)** | | | **[Q\_CC\_HPACC](qtglobal#Q_CC_HPACC)** | | | **[Q\_CC\_INTEL](qtglobal#Q_CC_INTEL)** | | | **[Q\_CC\_KAI](qtglobal#Q_CC_KAI)** | | | **[Q\_CC\_MIPS](qtglobal#Q_CC_MIPS)** | | | **[Q\_CC\_MSVC](qtglobal#Q_CC_MSVC)** | | | **[Q\_CC\_OC](qtglobal#Q_CC_OC)** | | | **[Q\_CC\_PGI](qtglobal#Q_CC_PGI)** | | | **[Q\_CC\_SUN](qtglobal#Q_CC_SUN)** | | | **[Q\_CC\_SYM](qtglobal#Q_CC_SYM)** | | | **[Q\_CC\_USLC](qtglobal#Q_CC_USLC)** | | | **[Q\_CC\_WAT](qtglobal#Q_CC_WAT)** | | void | **[Q\_CHECK\_PTR](qtglobal#Q_CHECK_PTRx)**(void \**pointer*) | | | **[Q\_DECLARE\_TYPEINFO](qtglobal#Q_DECLARE_TYPEINFO)**(*Type*, *Flags*) | | | **[Q\_DECL\_CONSTEXPR](qtglobal#Q_DECL_CONSTEXPR)** | | | **[Q\_DECL\_EXPORT](qtglobal#Q_DECL_EXPORT)** | | | **[Q\_DECL\_IMPORT](qtglobal#Q_DECL_IMPORT)** | | | **[Q\_DECL\_NOEXCEPT](qtglobal#Q_DECL_NOEXCEPT)** | | | **[Q\_DECL\_NOEXCEPT\_EXPR](qtglobal#Q_DECL_NOEXCEPT_EXPR)**(*x*) | | | **[Q\_DECL\_NOTHROW](qtglobal#Q_DECL_NOTHROW)** | | | **[Q\_DECL\_RELAXED\_CONSTEXPR](qtglobal#Q_DECL_RELAXED_CONSTEXPR)** | | void | **[Q\_FALLTHROUGH](qtglobal#Q_FALLTHROUGH)** | | | **[Q\_FOREACH](qtglobal#Q_FOREACH)**(*variable*, *container*) | | | **[Q\_FOREVER](qtglobal#Q_FOREVER)** | | | **[Q\_FORWARD\_DECLARE\_CF\_TYPE](qtglobal#Q_FORWARD_DECLARE_CF_TYPE)**(*type*) | | | **[Q\_FORWARD\_DECLARE\_MUTABLE\_CF\_TYPE](qtglobal#Q_FORWARD_DECLARE_MUTABLE_CF_TYPE)**(*type*) | | | **[Q\_FORWARD\_DECLARE\_OBJC\_CLASS](qtglobal#Q_FORWARD_DECLARE_OBJC_CLASS)**(*classname*) | | const char\* | **[Q\_FUNC\_INFO](qtglobal#Q_FUNC_INFO)** | | qint64 | **[Q\_INT64\_C](qtglobal#Q_INT64_C)**(*literal*) | | | **[Q\_LIKELY](qtglobal#Q_LIKELY)**(*expr*) | | | **[Q\_LITTLE\_ENDIAN](qtglobal#Q_LITTLE_ENDIAN)** | | | **[Q\_OS\_AIX](qtglobal#Q_OS_AIX)** | | | **[Q\_OS\_ANDROID](qtglobal#Q_OS_ANDROID)** | | | **[Q\_OS\_BSD4](qtglobal#Q_OS_BSD4)** | | | **[Q\_OS\_CYGWIN](qtglobal#Q_OS_CYGWIN)** | | | **[Q\_OS\_DARWIN](qtglobal#Q_OS_DARWIN)** | | | **[Q\_OS\_FREEBSD](qtglobal#Q_OS_FREEBSD)** | | | **[Q\_OS\_HPUX](qtglobal#Q_OS_HPUX)** | | | **[Q\_OS\_HURD](qtglobal#Q_OS_HURD)** | | | **[Q\_OS\_IOS](qtglobal#Q_OS_IOS)** | | | **[Q\_OS\_LINUX](qtglobal#Q_OS_LINUX)** | | | **[Q\_OS\_LYNX](qtglobal#Q_OS_LYNX)** | | | **[Q\_OS\_MAC](qtglobal#Q_OS_MAC)** | | | **[Q\_OS\_MACOS](qtglobal#Q_OS_MACOS)** | | | **[Q\_OS\_NETBSD](qtglobal#Q_OS_NETBSD)** | | | **[Q\_OS\_OPENBSD](qtglobal#Q_OS_OPENBSD)** | | | **[Q\_OS\_OSX](qtglobal#Q_OS_OSX)** | | | **[Q\_OS\_QNX](qtglobal#Q_OS_QNX)** | | | **[Q\_OS\_SOLARIS](qtglobal#Q_OS_SOLARIS)** | | | **[Q\_OS\_TVOS](qtglobal#Q_OS_TVOS)** | | | **[Q\_OS\_UNIX](qtglobal#Q_OS_UNIX)** | | | **[Q\_OS\_WASM](qtglobal#Q_OS_WASM)** | | | **[Q\_OS\_WATCHOS](qtglobal#Q_OS_WATCHOS)** | | | **[Q\_OS\_WIN32](qtglobal#Q_OS_WIN32)** | | | **[Q\_OS\_WIN64](qtglobal#Q_OS_WIN64)** | | | **[Q\_OS\_WIN](qtglobal#Q_OS_WIN)** | | | **[Q\_OS\_WINDOWS](qtglobal#Q_OS_WINDOWS)** | | | **[Q\_PROCESSOR\_X86](qtglobal#Q_PROCESSOR_X86)** | | | **[Q\_PROCESSOR\_S390](qtglobal#Q_PROCESSOR_S390)** | | | **[Q\_PROCESSOR\_ALPHA](qtglobal#Q_PROCESSOR_ALPHA)** | | | **[Q\_PROCESSOR\_ARM](qtglobal#Q_PROCESSOR_ARM)** | | | **[Q\_PROCESSOR\_ARM\_V5](qtglobal#Q_PROCESSOR_ARM_V5)** | | | **[Q\_PROCESSOR\_ARM\_V6](qtglobal#Q_PROCESSOR_ARM_V6)** | | | **[Q\_PROCESSOR\_ARM\_V7](qtglobal#Q_PROCESSOR_ARM_V7)** | | | **[Q\_PROCESSOR\_AVR32](qtglobal#Q_PROCESSOR_AVR32)** | | | **[Q\_PROCESSOR\_BLACKFIN](qtglobal#Q_PROCESSOR_BLACKFIN)** | | | **[Q\_PROCESSOR\_IA64](qtglobal#Q_PROCESSOR_IA64)** | | | **[Q\_PROCESSOR\_MIPS](qtglobal#Q_PROCESSOR_MIPS)** | | | **[Q\_PROCESSOR\_MIPS\_32](qtglobal#Q_PROCESSOR_MIPS_32)** | | | **[Q\_PROCESSOR\_MIPS\_64](qtglobal#Q_PROCESSOR_MIPS_64)** | | | **[Q\_PROCESSOR\_MIPS\_I](qtglobal#Q_PROCESSOR_MIPS_I)** | | | **[Q\_PROCESSOR\_MIPS\_II](qtglobal#Q_PROCESSOR_MIPS_II)** | | | **[Q\_PROCESSOR\_MIPS\_III](qtglobal#Q_PROCESSOR_MIPS_III)** | | | **[Q\_PROCESSOR\_MIPS\_IV](qtglobal#Q_PROCESSOR_MIPS_IV)** | | | **[Q\_PROCESSOR\_MIPS\_V](qtglobal#Q_PROCESSOR_MIPS_V)** | | | **[Q\_PROCESSOR\_POWER](qtglobal#Q_PROCESSOR_POWER)** | | | **[Q\_PROCESSOR\_POWER\_32](qtglobal#Q_PROCESSOR_POWER_32)** | | | **[Q\_PROCESSOR\_POWER\_64](qtglobal#Q_PROCESSOR_POWER_64)** | | | **[Q\_PROCESSOR\_RISCV](qtglobal#Q_PROCESSOR_RISCV)** | | | **[Q\_PROCESSOR\_RISCV\_32](qtglobal#Q_PROCESSOR_RISCV_32)** | | | **[Q\_PROCESSOR\_RISCV\_64](qtglobal#Q_PROCESSOR_RISCV_64)** | | | **[Q\_PROCESSOR\_S390\_X](qtglobal#Q_PROCESSOR_S390_X)** | | | **[Q\_PROCESSOR\_SH](qtglobal#Q_PROCESSOR_SH)** | | | **[Q\_PROCESSOR\_SH\_4A](qtglobal#Q_PROCESSOR_SH_4A)** | | | **[Q\_PROCESSOR\_SPARC](qtglobal#Q_PROCESSOR_SPARC)** | | | **[Q\_PROCESSOR\_SPARC\_V9](qtglobal#Q_PROCESSOR_SPARC_V9)** | | | **[Q\_PROCESSOR\_X86\_32](qtglobal#Q_PROCESSOR_X86_32)** | | | **[Q\_PROCESSOR\_X86\_64](qtglobal#Q_PROCESSOR_X86_64)** | | quint64 | **[Q\_UINT64\_C](qtglobal#Q_UINT64_C)**(*literal*) | | | **[Q\_UNLIKELY](qtglobal#Q_UNLIKELY)**(*expr*) | | void | **[Q\_UNREACHABLE](qtglobal#Q_UNREACHABLE)** | | | **[Q\_UNUSED](qtglobal#Q_UNUSED)**(*name*) | | | **[foreach](qtglobal#foreach)**(*variable*, *container*) | | | **[forever](qtglobal#forever)** | | | **[qCritical](qtglobal#qCritical)**(const char \**message*, ...) | | | **[qDebug](qtglobal#qDebug)**(const char \**message*, ...) | | | **[qFatal](qtglobal#qFatal)**(const char \**message*, ...) | | | **[qInfo](qtglobal#qInfo)**(const char \**message*, ...) | | const char \* | **[qPrintable](qtglobal#qPrintable)**(const QString &*str*) | | const wchar\_t \* | **[qUtf16Printable](qtglobal#qUtf16Printable)**(const QString &*str*) | | const char \* | **[qUtf8Printable](qtglobal#qUtf8Printable)**(const QString &*str*) | | | **[qWarning](qtglobal#qWarning)**(const char \**message*, ...) | Detailed Description -------------------- The global declarations include [types](qtglobal#types), [functions](qtglobal#functions) and [macros](qtglobal#macros). The type definitions are partly convenience definitions for basic types (some of which guarantee certain bit-sizes on all platforms supported by Qt), partly types related to Qt message handling. The functions are related to generating messages, Qt version handling and comparing and adjusting object values. And finally, some of the declared macros enable programmers to add compiler or platform specific code to their applications, while others are convenience macros for larger operations. #### Types The header file declares several type definitions that guarantee a specified bit-size on all platforms supported by Qt for various basic types, for example [qint8](qtglobal#qint8-typedef) which is a signed char guaranteed to be 8-bit on all platforms supported by Qt. The header file also declares the [qlonglong](qtglobal#qlonglong-typedef) type definition for `long long int` (`__int64` on Windows). Several convenience type definitions are declared: [qreal](qtglobal#qreal-typedef) for `double` or `float`, [uchar](qtglobal#uchar-typedef) for `unsigned` char, [uint](qtglobal#uint-typedef) for `unsigned` int, [ulong](qtglobal#ulong-typedef) for `unsigned` long and [ushort](qtglobal#ushort-typedef) for `unsigned` short. Finally, the [QtMsgType](qtglobal#QtMsgType-enum) definition identifies the various messages that can be generated and sent to a Qt message handler; [QtMessageHandler](qtglobal#QtMessageHandler-typedef) is a type definition for a pointer to a function with the signature `void myMessageHandler(QtMsgType, const QMessageLogContext &, const char *)`. [QMessageLogContext](qmessagelogcontext) class contains the line, file, and function the message was logged at. This information is created by the [QMessageLogger](qmessagelogger) class. #### Functions The <QtGlobal> header file contains several functions comparing and adjusting an object's value. These functions take a template type as argument: You can retrieve the absolute value of an object using the [qAbs](qtglobal#qAbs)() function, and you can bound a given object's value by given minimum and maximum values using the [qBound](qtglobal#qBound)() function. You can retrieve the minimum and maximum of two given objects using [qMin](qtglobal#qMin)() and [qMax](qtglobal#qMax)() respectively. All these functions return a corresponding template type; the template types can be replaced by any other type. Example: ``` int myValue = 10; int minValue = 2; int maxValue = 6; int boundedValue = qBound(minValue, myValue, maxValue); // boundedValue == 6 ``` <QtGlobal> also contains functions that generate messages from the given string argument: [qDebug](qtglobal#qDebug)(), [qInfo](qtglobal#qInfo)(), [qWarning](qtglobal#qWarning)(), [qCritical](qtglobal#qCritical)(), and [qFatal](qtglobal#qFatal)(). These functions call the message handler with the given message. Example: ``` if (!driver()->isOpen() || driver()->isOpenError()) { qWarning("QSqlQuery::exec: database not open"); return false; } ``` The remaining functions are [qRound](qtglobal#qRound)() and [qRound64](qtglobal#qRound64)(), which both accept a `double` or `float` value as their argument returning the value rounded up to the nearest integer and 64-bit integer respectively, the [qInstallMessageHandler](qtglobal#qInstallMessageHandler)() function which installs the given [QtMessageHandler](qtglobal#QtMessageHandler-typedef), and the [qVersion](qtglobal#qVersion)() function which returns the version number of Qt at run-time as a string. #### Macros The <QtGlobal> header file provides a range of macros (Q\_CC\_\*) that are defined if the application is compiled using the specified platforms. For example, the [Q\_CC\_SUN](qtglobal#Q_CC_SUN) macro is defined if the application is compiled using Forte Developer, or Sun Studio C++. The header file also declares a range of macros (Q\_OS\_\*) that are defined for the specified platforms. For example, [Q\_OS\_UNIX](qtglobal#Q_OS_UNIX) which is defined for the Unix-based systems. The purpose of these macros is to enable programmers to add compiler or platform specific code to their application. The remaining macros are convenience macros for larger operations: The [QT\_TR\_NOOP](qtglobal#QT_TR_NOOP)(), [QT\_TRANSLATE\_NOOP](qtglobal#QT_TRANSLATE_NOOP)(), and [QT\_TRANSLATE\_NOOP3](qtglobal#QT_TRANSLATE_NOOP3)() macros provide the possibility of marking strings for delayed translation. [QT\_TR\_N\_NOOP](qtglobal#QT_TR_N_NOOP)(), [QT\_TRANSLATE\_N\_NOOP](qtglobal#QT_TRANSLATE_N_NOOP)(), and [QT\_TRANSLATE\_N\_NOOP3](qtglobal#QT_TRANSLATE_N_NOOP3)() are numerator dependent variants of these. The [Q\_ASSERT](qtglobal#Q_ASSERT)() and [Q\_ASSERT\_X](qtglobal#Q_ASSERT_X)() enables warning messages of various level of refinement. The [Q\_FOREACH](qtglobal#Q_FOREACH)() and [foreach](qtglobal#foreach)() macros implement Qt's foreach loop. The [Q\_INT64\_C](qtglobal#Q_INT64_C)() and [Q\_UINT64\_C](qtglobal#Q_UINT64_C)() macros wrap signed and unsigned 64-bit integer literals in a platform-independent way. The [Q\_CHECK\_PTR](qtglobal#Q_CHECK_PTRx)() macro prints a warning containing the source code's file name and line number, saying that the program ran out of memory, if the pointer is `nullptr`. The [qPrintable](qtglobal#qPrintable)() and [qUtf8Printable](qtglobal#qUtf8Printable)() macros represent an easy way of printing text. The [QT\_POINTER\_SIZE](qtglobal#QT_POINTER_SIZE) macro expands to the size of a pointer in bytes. The macros [QT\_VERSION](qtglobal#QT_VERSION) and [QT\_VERSION\_STR](qtglobal#QT_VERSION_STR) expand to a numeric value or a string, respectively, that specifies the version of Qt that the application is compiled against. **See also** [<QtAlgorithms>](qtalgorithms) and [QSysInfo](qsysinfo). Type Documentation ------------------ ### QFunctionPointer This is a typedef for `void (*)()`, a pointer to a function that takes no arguments and returns void. ### `[since 5.0]` QtMessageHandler This is a typedef for a pointer to a function with the following signature: ``` void myMessageHandler(QtMsgType, const QMessageLogContext &, const QString &); ``` This typedef was introduced in Qt 5.0. **See also** [QtMsgType](qtglobal#QtMsgType-enum) and [qInstallMessageHandler](qtglobal#qInstallMessageHandler)(). ### enum QtMsgType This enum describes the messages that can be sent to a message handler ([QtMessageHandler](qtglobal#QtMessageHandler-typedef)). You can use the enum to identify and associate the various message types with the appropriate actions. | Constant | Value | Description | | --- | --- | --- | | `QtDebugMsg` | `0` | A message generated by the [qDebug](qtglobal#qDebug)() function. | | `QtInfoMsg` | `4` | A message generated by the [qInfo](qtglobal#qInfo)() function. | | `QtWarningMsg` | `1` | A message generated by the [qWarning](qtglobal#qWarning)() function. | | `QtCriticalMsg` | `2` | A message generated by the [qCritical](qtglobal#qCritical)() function. | | `QtFatalMsg` | `3` | A message generated by the [qFatal](qtglobal#qFatal)() function. | | `QtSystemMsg` | `QtCriticalMsg` | | `QtInfoMsg` was added in Qt 5.5. **See also** [QtMessageHandler](qtglobal#QtMessageHandler-typedef) and [qInstallMessageHandler](qtglobal#qInstallMessageHandler)(). ### qint8 Typedef for `signed char`. This type is guaranteed to be 8-bit on all platforms supported by Qt. ### qint16 Typedef for `signed short`. This type is guaranteed to be 16-bit on all platforms supported by Qt. ### qint32 Typedef for `signed int`. This type is guaranteed to be 32-bit on all platforms supported by Qt. ### qint64 Typedef for `long long int`. This type is guaranteed to be 64-bit on all platforms supported by Qt. Literals of this type can be created using the [Q\_INT64\_C](qtglobal#Q_INT64_C)() macro: ``` qint64 value = Q_INT64_C(932838457459459); ``` **See also** [Q\_INT64\_C](qtglobal#Q_INT64_C)(), [quint64](qtglobal#quint64-typedef), and [qlonglong](qtglobal#qlonglong-typedef). ### qintptr Integral type for representing pointers in a signed integer (useful for hashing, etc.). Typedef for either qint32 or qint64. This type is guaranteed to be the same size as a pointer on all platforms supported by Qt. On a system with 32-bit pointers, qintptr is a typedef for qint32; on a system with 64-bit pointers, qintptr is a typedef for qint64. Note that qintptr is signed. Use quintptr for unsigned values. In order to print values of this type by using formatted-output facilities such as `printf()`, [qDebug](qtglobal#qDebug)(), [QString::asprintf](qstring#asprintf)() and so on, you can use the `PRIdQINTPTR` and `PRIiQINTPTR` macros as format specifiers. They will both print the value as a base 10 number. ``` qintptr p = 123; printf("The pointer is %" PRIdQINTPTR "\n", p); ``` **See also** [qptrdiff](qtglobal#qptrdiff-typedef), [qint32](qtglobal#qint32-typedef), and [qint64](qtglobal#qint64-typedef). ### qlonglong Typedef for `long long int` (`__int64` on Windows). This is the same as [qint64](qtglobal#qint64-typedef). **See also** [qulonglong](qtglobal#qulonglong-typedef) and [qint64](qtglobal#qint64-typedef). ### qptrdiff Integral type for representing pointer differences. Typedef for either qint32 or qint64. This type is guaranteed to be the same size as a pointer on all platforms supported by Qt. On a system with 32-bit pointers, quintptr is a typedef for quint32; on a system with 64-bit pointers, quintptr is a typedef for quint64. Note that qptrdiff is signed. Use quintptr for unsigned values. In order to print values of this type by using formatted-output facilities such as `printf()`, [qDebug](qtglobal#qDebug)(), [QString::asprintf](qstring#asprintf)() and so on, you can use the `PRIdQPTRDIFF` and `PRIiQPTRDIFF` macros as format specifiers. They will both print the value as a base 10 number. ``` qptrdiff d = 123; printf("The difference is %" PRIdQPTRDIFF "\n", d); ``` **See also** [quintptr](qtglobal#quintptr-typedef), [qint32](qtglobal#qint32-typedef), and [qint64](qtglobal#qint64-typedef). ### qreal Typedef for `double` unless Qt is configured with the `-qreal float` option. ### `[alias, since 5.10]` qsizetype Integral type providing Posix' `ssize_t` for all platforms. This type is guaranteed to be the same size as a `size_t` on all platforms supported by Qt. Note that qsizetype is signed. Use `size_t` for unsigned values. In order to print values of this type by using formatted-output facilities such as `printf()`, [qDebug](qtglobal#qDebug)(), [QString::asprintf](qstring#asprintf)() and so on, you can use the `PRIdQSIZETYPE` and `PRIiQSIZETYPE` macros as format specifiers. They will both print the value as a base 10 number. ``` qsizetype s = 123; printf("The size is %" PRIdQSIZETYPE "\n", s); ``` This typedef was introduced in Qt 5.10. **See also** [qptrdiff](qtglobal#qptrdiff-typedef). ### quint8 Typedef for `unsigned char`. This type is guaranteed to be 8-bit on all platforms supported by Qt. ### quint16 Typedef for `unsigned short`. This type is guaranteed to be 16-bit on all platforms supported by Qt. ### quint32 Typedef for `unsigned int`. This type is guaranteed to be 32-bit on all platforms supported by Qt. ### quint64 Typedef for `unsigned long long int`. This type is guaranteed to be 64-bit on all platforms supported by Qt. Literals of this type can be created using the [Q\_UINT64\_C](qtglobal#Q_UINT64_C)() macro: ``` quint64 value = Q_UINT64_C(932838457459459); ``` **See also** [Q\_UINT64\_C](qtglobal#Q_UINT64_C)(), [qint64](qtglobal#qint64-typedef), and [qulonglong](qtglobal#qulonglong-typedef). ### quintptr Integral type for representing pointers in an unsigned integer (useful for hashing, etc.). Typedef for either quint32 or quint64. This type is guaranteed to be the same size as a pointer on all platforms supported by Qt. On a system with 32-bit pointers, quintptr is a typedef for quint32; on a system with 64-bit pointers, quintptr is a typedef for quint64. Note that quintptr is unsigned. Use qptrdiff for signed values. In order to print values of this type by using formatted-output facilities such as `printf()`, [qDebug](qtglobal#qDebug)(), [QString::asprintf](qstring#asprintf)() and so on, you can use the following macros as format specifiers: * `PRIuQUINTPTR`: prints the value as a base 10 number. * `PRIoQUINTPTR`: prints the value as a base 8 number. * `PRIxQUINTPTR`: prints the value as a base 16 number, using lowercase `a-f` letters. * `PRIXQUINTPTR`: prints the value as a base 16 number, using uppercase `A-F` letters. ``` quintptr p = 123u; printf("The pointer value is 0x%" PRIXQUINTPTR "\n", p); ``` **See also** [qptrdiff](qtglobal#qptrdiff-typedef), [quint32](qtglobal#quint32-typedef), and [quint64](qtglobal#quint64-typedef). ### qulonglong Typedef for `unsigned long long int` (`unsigned __int64` on Windows). This is the same as [quint64](qtglobal#quint64-typedef). **See also** [quint64](qtglobal#quint64-typedef) and [qlonglong](qtglobal#qlonglong-typedef). ### uchar Convenience typedef for `unsigned char`. ### uint Convenience typedef for `unsigned int`. ### ulong Convenience typedef for `unsigned long`. ### ushort Convenience typedef for `unsigned short`. Function Documentation ---------------------- ### int qFpClassify(double *val*) ### int qFpClassify(float *val*) Classifies a floating-point value. The return values are defined in `<cmath>`: returns one of the following, determined by the floating-point class of *val*: * FP\_NAN not a number * FP\_INFINITE infinities (positive or negative) * FP\_ZERO zero (positive or negative) * FP\_NORMAL finite with a full mantissa * FP\_SUBNORMAL finite with a reduced mantissa ### `[since 5.10]` [QString](qstring) qEnvironmentVariable(const char \**varName*) ### `[since 5.10]` [QString](qstring) qEnvironmentVariable(const char \**varName*, const [QString](qstring) &*defaultValue*) These functions return the value of the environment variable, *varName*, as a [QString](qstring). If no variable *varName* is found in the environment and *defaultValue* is provided, *defaultValue* is returned. Otherwise QString() is returned. The Qt environment manipulation functions are thread-safe, but this requires that the C library equivalent functions like getenv and putenv are not directly called. The following table describes how to choose between [qgetenv](qtglobal#qgetenv)() and [qEnvironmentVariable](qtglobal#qEnvironmentVariable)(): | Condition | Recommendation | | --- | --- | | Variable contains file paths or user text | [qEnvironmentVariable](qtglobal#qEnvironmentVariable)() | | Windows-specific code | [qEnvironmentVariable](qtglobal#qEnvironmentVariable)() | | Unix-specific code, destination variable is not [QString](qstring) and/or is used to interface with non-Qt APIs | [qgetenv](qtglobal#qgetenv)() | | Destination variable is a [QString](qstring) | [qEnvironmentVariable](qtglobal#qEnvironmentVariable)() | | Destination variable is a [QByteArray](qbytearray) or std::string | [qgetenv](qtglobal#qgetenv)() | **Note:** on Unix systems, this function may produce data loss if the original string contains arbitrary binary data that cannot be decoded by the locale codec. Use [qgetenv](qtglobal#qgetenv)() instead for that case. On Windows, this function is lossless. **Note:** the variable name *varName* must contain only US-ASCII characters. This function was introduced in Qt 5.10. **See also** [qputenv](qtglobal#qputenv)(), [qgetenv](qtglobal#qgetenv)(), [qEnvironmentVariableIsSet](qtglobal#qEnvironmentVariableIsSet)(), and [qEnvironmentVariableIsEmpty](qtglobal#qEnvironmentVariableIsEmpty)(). ### template <typename T> T qAbs(const T &*t*) Compares *t* to the 0 of type T and returns the absolute value. Thus if T is *double*, then *t* is compared to *(double) 0*. Example: ``` int absoluteValue; int myValue = -4; absoluteValue = qAbs(myValue); // absoluteValue == 4 ``` ### `[since 5.7]` template <typename T> typename std::add\_const<T>::type &qAsConst(T &*t*) Returns *t* cast to `const T`. This function is a Qt implementation of C++17's std::as\_const(), a cast function like std::move(). But while std::move() turns lvalues into rvalues, this function turns non-const lvalues into const lvalues. Like std::as\_const(), it doesn't work on rvalues, because it cannot be efficiently implemented for rvalues without leaving dangling references. Its main use in Qt is to prevent implicitly-shared Qt containers from detaching: ``` QString s = ...; for (QChar ch : s) // detaches 's' (performs a deep-copy if 's' was shared) process(ch); for (QChar ch : qAsConst(s)) // ok, no detach attempt process(ch); ``` Of course, in this case, you could (and probably should) have declared `s` as `const` in the first place: ``` const QString s = ...; for (QChar ch : s) // ok, no detach attempt on const objects process(ch); ``` but often that is not easily possible. It is important to note that qAsConst() does not copy its argument, it just performs a `const_cast<const T&>(t)`. This is also the reason why it is designed to fail for rvalues: The returned reference would go stale too soon. So while this works (but detaches the returned object): ``` for (QChar ch : funcReturningQString()) process(ch); // OK, the returned object is kept alive for the loop's duration ``` this would not: ``` for (QChar ch : qAsConst(funcReturningQString())) process(ch); // ERROR: ch is copied from deleted memory ``` To prevent this construct from compiling (and failing at runtime), qAsConst() has a second, deleted, overload which binds to rvalues. This function was introduced in Qt 5.7. ### `[since 5.7]` template <typename T> void qAsConst(const T &&*t*) This is an overloaded function. This overload is deleted to prevent a dangling reference in code like ``` for (QChar ch : qAsConst(funcReturningQString())) process(ch); // ERROR: ch is copied from deleted memory ``` This function was introduced in Qt 5.7. ### template <typename T> const T &qBound(const T &*min*, const T &*val*, const T &*max*) Returns *val* bounded by *min* and *max*. This is equivalent to [qMax](qtglobal#qMax)(*min*, [qMin](qtglobal#qMin)(*val*, *max*)). Example: ``` int myValue = 10; int minValue = 2; int maxValue = 6; int boundedValue = qBound(minValue, myValue, maxValue); // boundedValue == 6 ``` **See also** [qMin](qtglobal#qMin)() and [qMax](qtglobal#qMax)(). ### `[since 5.7]` template <typename T> auto qConstOverload(T *memberFunctionPointer*) Returns the *memberFunctionPointer* pointer to a constant member function: ``` struct Foo { void overloadedFunction(int, const QString &); void overloadedFunction(int, const QString &) const; }; ... qConstOverload<int, const QString &>(&Foo::overloadedFunction) ... qNonConstOverload<int, const QString &>(&Foo::overloadedFunction) ``` This function was introduced in Qt 5.7. **See also** [qOverload](qtglobal#qOverload), [qNonConstOverload](qtglobal#qNonConstOverload), and [Differences between String-Based and Functor-Based Connections](signalsandslots-syntaxes). ### `[since 5.10]` [QString](qstring) qEnvironmentVariable(const char \**varName*, const [QString](qstring) &*defaultValue*) This function was introduced in Qt 5.10. ### `[since 5.10]` [QString](qstring) qEnvironmentVariable(const char \**varName*) This function was introduced in Qt 5.10. ### `[since 5.5]` int qEnvironmentVariableIntValue(const char \**varName*, bool \**ok* = nullptr) Returns the numerical value of the environment variable *varName*. If *ok* is not null, sets `*ok` to `true` or `false` depending on the success of the conversion. Equivalent to ``` qgetenv(varName).toInt(ok, 0) ``` except that it's much faster, and can't throw exceptions. **Note:** there's a limit on the length of the value, which is sufficient for all valid values of int, not counting leading zeroes or spaces. Values that are too long will either be truncated or this function will set *ok* to `false`. This function was introduced in Qt 5.5. **See also** [qgetenv](qtglobal#qgetenv)(), [qEnvironmentVariable](qtglobal#qEnvironmentVariable)(), and [qEnvironmentVariableIsSet](qtglobal#qEnvironmentVariableIsSet)(). ### `[since 5.1]` bool qEnvironmentVariableIsEmpty(const char \**varName*) Returns whether the environment variable *varName* is empty. Equivalent to ``` qgetenv(varName).isEmpty() ``` except that it's potentially much faster, and can't throw exceptions. This function was introduced in Qt 5.1. **See also** [qgetenv](qtglobal#qgetenv)(), [qEnvironmentVariable](qtglobal#qEnvironmentVariable)(), and [qEnvironmentVariableIsSet](qtglobal#qEnvironmentVariableIsSet)(). ### `[since 5.1]` bool qEnvironmentVariableIsSet(const char \**varName*) Returns whether the environment variable *varName* is set. Equivalent to ``` !qgetenv(varName).isNull() ``` except that it's potentially much faster, and can't throw exceptions. This function was introduced in Qt 5.1. **See also** [qgetenv](qtglobal#qgetenv)(), [qEnvironmentVariable](qtglobal#qEnvironmentVariable)(), and [qEnvironmentVariableIsEmpty](qtglobal#qEnvironmentVariableIsEmpty)(). ### `[since 5.14]` template <typename T, typename U> T qExchange(T &*obj*, U &&*newValue*) Replaces the value of *obj* with *newValue* and returns the old value of *obj*. This is Qt's implementation of std::exchange(). It differs from std::exchange() only in that it is `constexpr` already in C++14, and available on all supported compilers. Here is how to use qExchange() to implement move constructors: ``` MyClass(MyClass &&other) : m_pointer{qExchange(other.m_pointer, nullptr)}, m_int{qExchange(other.m_int, 0)}, m_vector{std::move(other.m_vector)}, ... ``` For members of class type, we can use std::move(), as their move-constructor will do the right thing. But for scalar types such as raw pointers or integer type, move is the same as copy, which, particularly for pointers, is not what we expect. So, we cannot use std::move() for such types, but we can use std::exchange()/qExchange() to make sure the source object's member is already reset by the time we get to the initialization of our next data member, which might come in handy if the constructor exits with an exception. Here is how to use qExchange() to write a loop that consumes the collection it iterates over: ``` for (auto &e : qExchange(collection, {}) doSomethingWith(e); ``` Which is equivalent to the following, much more verbose code: ``` { auto tmp = std::move(collection); collection = {}; // or collection.clear() for (auto &e : tmp) doSomethingWith(e); } // destroys 'tmp' ``` This is perfectly safe, as the for-loop keeps the result of qExchange() alive for as long as the loop runs, saving the declaration of a temporary variable. Be aware, though, that qExchange() returns a non-const object, so Qt containers may detach. This function was introduced in Qt 5.14. ### `[since 5.2]` [quint32](qtglobal#quint32-typedef) qFloatDistance(float *a*, float *b*) Returns the number of representable floating-point numbers between *a* and *b*. This function provides an alternative way of doing approximated comparisons of floating-point numbers similar to [qFuzzyCompare](qtglobal#qFuzzyCompare)(). However, it returns the distance between two numbers, which gives the caller a possibility to choose the accepted error. Errors are relative, so for instance the distance between 1.0E-5 and 1.00001E-5 will give 110, while the distance between 1.0E36 and 1.00001E36 will give 127. This function is useful if a floating point comparison requires a certain precision. Therefore, if *a* and *b* are equal it will return 0. The maximum value it will return for 32-bit floating point numbers is 4,278,190,078. This is the distance between `-FLT_MAX` and `+FLT_MAX`. The function does not give meaningful results if any of the arguments are `Infinite` or `NaN`. You can check for this by calling [qIsFinite](qtglobal#qIsFinite)(). The return value can be considered as the "error", so if you for instance want to compare two 32-bit floating point numbers and all you need is an approximated 24-bit precision, you can use this function like this: ``` if (qFloatDistance(a, b) < (1 << 7)) { // The last 7 bits are not // significant // precise enough } ``` This function was introduced in Qt 5.2. **See also** [qFuzzyCompare](qtglobal#qFuzzyCompare)(). ### `[since 5.2]` [quint64](qtglobal#quint64-typedef) qFloatDistance(double *a*, double *b*) Returns the number of representable floating-point numbers between *a* and *b*. This function serves the same purpose as `qFloatDistance(float, float)`, but returns the distance between two `double` numbers. Since the range is larger than for two `float` numbers (`[-DBL_MAX,DBL_MAX]`), the return type is quint64. This function was introduced in Qt 5.2. **See also** [qFuzzyCompare](qtglobal#qFuzzyCompare)(). ### `[since 5.4]` [QString](qstring) qFormatLogMessage([QtMsgType](qtglobal#QtMsgType-enum) *type*, const [QMessageLogContext](qmessagelogcontext) &*context*, const [QString](qstring) &*str*) Generates a formatted string out of the *type*, *context*, *str* arguments. qFormatLogMessage returns a [QString](qstring) that is formatted according to the current message pattern. It can be used by custom message handlers to format output similar to Qt's default message handler. The function is thread-safe. This function was introduced in Qt 5.4. **See also** [qInstallMessageHandler](qtglobal#qInstallMessageHandler)() and [qSetMessagePattern](qtglobal#qSetMessagePattern)(). ### int qFpClassify(double *val*) ### int qFpClassify(float *val*) ### bool qFuzzyCompare(double *p1*, double *p2*) Compares the floating point value *p1* and *p2* and returns `true` if they are considered equal, otherwise `false`. Note that comparing values where either *p1* or *p2* is 0.0 will not work, nor does comparing values where one of the values is NaN or infinity. If one of the values is always 0.0, use [qFuzzyIsNull](qtglobal#qFuzzyIsNull) instead. If one of the values is likely to be 0.0, one solution is to add 1.0 to both values. ``` // Instead of comparing with 0.0 qFuzzyCompare(0.0, 1.0e-200); // This will return false // Compare adding 1 to both values will fix the problem qFuzzyCompare(1 + 0.0, 1 + 1.0e-200); // This will return true ``` The two numbers are compared in a relative way, where the exactness is stronger the smaller the numbers are. **Note:** This function is [thread-safe](threads-reentrancy). ### bool qFuzzyCompare(float *p1*, float *p2*) Compares the floating point value *p1* and *p2* and returns `true` if they are considered equal, otherwise `false`. The two numbers are compared in a relative way, where the exactness is stronger the smaller the numbers are. **Note:** This function is [thread-safe](threads-reentrancy). ### bool qFuzzyIsNull(double *d*) Returns true if the absolute value of *d* is within 0.000000000001 of 0.0. **Note:** This function is [thread-safe](threads-reentrancy). ### bool qFuzzyIsNull(float *f*) Returns true if the absolute value of *f* is within 0.00001f of 0.0. **Note:** This function is [thread-safe](threads-reentrancy). ### double qInf() Returns the bit pattern for an infinite number as a double. **See also** [qIsInf](qtglobal#qIsInf)(). ### `[since 5.0]` [QtMessageHandler](qtglobal#QtMessageHandler-typedef) qInstallMessageHandler([QtMessageHandler](qtglobal#QtMessageHandler-typedef) *handler*) Installs a Qt message *handler* which has been defined previously. Returns a pointer to the previous message handler. The message handler is a function that prints out debug messages, warnings, critical and fatal error messages. The Qt library (debug mode) contains hundreds of warning messages that are printed when internal errors (usually invalid function arguments) occur. Qt built in release mode also contains such warnings unless QT\_NO\_WARNING\_OUTPUT and/or QT\_NO\_DEBUG\_OUTPUT have been set during compilation. If you implement your own message handler, you get total control of these messages. The default message handler prints the message to the standard output under X11 or to the debugger under Windows. If it is a fatal message, the application aborts immediately. Only one message handler can be defined, since this is usually done on an application-wide basis to control debug output. To restore the message handler, call `qInstallMessageHandler(0)`. Example: ``` #include <qapplication.h> #include <stdio.h> #include <stdlib.h> void myMessageOutput(QtMsgType type, const QMessageLogContext &context, const QString &msg) { QByteArray localMsg = msg.toLocal8Bit(); const char *file = context.file ? context.file : ""; const char *function = context.function ? context.function : ""; switch (type) { case QtDebugMsg: fprintf(stderr, "Debug: %s (%s:%u, %s)\n", localMsg.constData(), file, context.line, function); break; case QtInfoMsg: fprintf(stderr, "Info: %s (%s:%u, %s)\n", localMsg.constData(), file, context.line, function); break; case QtWarningMsg: fprintf(stderr, "Warning: %s (%s:%u, %s)\n", localMsg.constData(), file, context.line, function); break; case QtCriticalMsg: fprintf(stderr, "Critical: %s (%s:%u, %s)\n", localMsg.constData(), file, context.line, function); break; case QtFatalMsg: fprintf(stderr, "Fatal: %s (%s:%u, %s)\n", localMsg.constData(), file, context.line, function); break; } } int main(int argc, char **argv) { qInstallMessageHandler(myMessageOutput); QApplication app(argc, argv); ... return app.exec(); } ``` This function was introduced in Qt 5.0. **See also** [QtMessageHandler](qtglobal#QtMessageHandler-typedef), [QtMsgType](qtglobal#QtMsgType-enum), [qDebug](qtglobal#qDebug)(), [qInfo](qtglobal#qInfo)(), [qWarning](qtglobal#qWarning)(), [qCritical](qtglobal#qCritical)(), [qFatal](qtglobal#qFatal)(), and [Debugging Techniques](testing-and-debugging#debugging-techniques). ### bool qIsFinite(double *d*) Returns `true` if the double *d* is a finite number. ### bool qIsFinite(float *f*) Returns `true` if the float *f* is a finite number. ### bool qIsInf(double *d*) Returns `true` if the double *d* is equivalent to infinity. **See also** [qInf](qtglobal#qInf)(). ### bool qIsInf(float *f*) Returns `true` if the float *f* is equivalent to infinity. **See also** [qInf](qtglobal#qInf)(). ### bool qIsNaN(double *d*) Returns `true` if the double *d* is not a number (NaN). ### bool qIsNaN(float *f*) Returns `true` if the float *f* is not a number (NaN). ### template <typename T> const T &qMax(const T &*a*, const T &*b*) Returns the maximum of *a* and *b*. Example: ``` int myValue = 6; int yourValue = 4; int maxValue = qMax(myValue, yourValue); // maxValue == myValue ``` **See also** [qMin](qtglobal#qMin)() and [qBound](qtglobal#qBound)(). ### template <typename T> const T &qMin(const T &*a*, const T &*b*) Returns the minimum of *a* and *b*. Example: ``` int myValue = 6; int yourValue = 4; int minValue = qMin(myValue, yourValue); // minValue == yourValue ``` **See also** [qMax](qtglobal#qMax)() and [qBound](qtglobal#qBound)(). ### `[since 5.7]` template <typename T> auto qNonConstOverload(T *memberFunctionPointer*) Returns the *memberFunctionPointer* pointer to a non-constant member function: ``` struct Foo { void overloadedFunction(int, const QString &); void overloadedFunction(int, const QString &) const; }; ... qConstOverload<int, const QString &>(&Foo::overloadedFunction) ... qNonConstOverload<int, const QString &>(&Foo::overloadedFunction) ``` This function was introduced in Qt 5.7. **See also** [qOverload](qtglobal#qOverload), qNonConstOverload, and [Differences between String-Based and Functor-Based Connections](signalsandslots-syntaxes). ### `[since 5.7]` template <typename T> auto qOverload(T *functionPointer*) Returns a pointer to an overloaded function. The template parameter is the list of the argument types of the function. *functionPointer* is the pointer to the (member) function: ``` struct Foo { void overloadedFunction(); void overloadedFunction(int, const QString &); }; ... qOverload<>(&Foo::overloadedFunction) ... qOverload<int, const QString &>(&Foo::overloadedFunction) ``` If a member function is also const-overloaded [qConstOverload](qtglobal#qConstOverload) and [qNonConstOverload](qtglobal#qNonConstOverload) need to be used. qOverload() requires C++14 enabled. In C++11-only code, the helper classes QOverload, QConstOverload, and QNonConstOverload can be used directly: ``` ... QOverload<>::of(&Foo::overloadedFunction) ... QOverload<int, const QString &>::of(&Foo::overloadedFunction) ``` **Note:** Qt detects the necessary C++14 compiler support by way of the feature test recommendations from [C++ Committee's Standing Document 6](https://isocpp.org/std/standing-documents/sd-6-sg10-feature-test-recommendations). This function was introduced in Qt 5.7. **See also** [qConstOverload](qtglobal#qConstOverload)(), [qNonConstOverload](qtglobal#qNonConstOverload)(), and [Differences between String-Based and Functor-Based Connections](signalsandslots-syntaxes). ### double qQNaN() Returns the bit pattern of a quiet NaN as a double. **See also** [qIsNaN](qtglobal#qIsNaN)(). ### [qint64](qtglobal#qint64-typedef) qRound64(double *d*) Rounds *d* to the nearest 64-bit integer. Rounds half away from zero (e.g. 0.5 -> 1, -0.5 -> -1). **Note:** This function does not guarantee correctness for high precisions. Example: ``` double valueA = 42949672960.3; double valueB = 42949672960.7; qint64 roundedValueA = qRound64(valueA); // roundedValueA = 42949672960 qint64 roundedValueB = qRound64(valueB); // roundedValueB = 42949672961 ``` ### [qint64](qtglobal#qint64-typedef) qRound64(float *d*) Rounds *d* to the nearest 64-bit integer. Rounds half away from zero (e.g. 0.5f -> 1, -0.5f -> -1). **Note:** This function does not guarantee correctness for high precisions. Example: ``` float valueA = 42949672960.3; float valueB = 42949672960.7; qint64 roundedValueA = qRound64(valueA); // roundedValueA = 42949672960 qint64 roundedValueB = qRound64(valueB); // roundedValueB = 42949672961 ``` ### int qRound(double *d*) Rounds *d* to the nearest integer. Rounds half away from zero (e.g. 0.5 -> 1, -0.5 -> -1). **Note:** This function does not guarantee correctness for high precisions. Example: ``` double valueA = 2.3; double valueB = 2.7; int roundedValueA = qRound(valueA); // roundedValueA = 2 int roundedValueB = qRound(valueB); // roundedValueB = 3 ``` ### int qRound(float *d*) Rounds *d* to the nearest integer. Rounds half away from zero (e.g. 0.5f -> 1, -0.5f -> -1). **Note:** This function does not guarantee correctness for high precisions. Example: ``` float valueA = 2.3; float valueB = 2.7; int roundedValueA = qRound(valueA); // roundedValueA = 2 int roundedValueB = qRound(valueB); // roundedValueB = 3 ``` ### double qSNaN() Returns the bit pattern of a signalling NaN as a double. ### `[since 5.0]` void qSetMessagePattern(const [QString](qstring) &*pattern*) Changes the output of the default message handler. Allows to tweak the output of [qDebug](qtglobal#qDebug)(), [qInfo](qtglobal#qInfo)(), [qWarning](qtglobal#qWarning)(), [qCritical](qtglobal#qCritical)(), and [qFatal](qtglobal#qFatal)(). The category logging output of [qCDebug](qloggingcategory#qCDebug)(), [qCInfo](qloggingcategory#qCInfo)(), [qCWarning](qloggingcategory#qCWarning)(), and [qCCritical](qloggingcategory#qCCritical)() is formatted, too. Following placeholders are supported: | Placeholder | Description | | --- | --- | | `%{appname}` | [QCoreApplication::applicationName](qcoreapplication#applicationName-prop)() | | `%{category}` | Logging category | | `%{file}` | Path to source file | | `%{function}` | Function | | `%{line}` | Line in source file | | `%{message}` | The actual message | | `%{pid}` | [QCoreApplication::applicationPid](qcoreapplication#applicationPid)() | | `%{threadid}` | The system-wide ID of current thread (if it can be obtained) | | `%{qthreadptr}` | A pointer to the current [QThread](qthread) (result of [QThread::currentThread](qthread#currentThread)()) | | `%{type}` | "debug", "warning", "critical" or "fatal" | | `%{time process}` | time of the message, in seconds since the process started (the token "process" is literal) | | `%{time boot}` | the time of the message, in seconds since the system boot if that can be determined (the token "boot" is literal). If the time since boot could not be obtained, the output is indeterminate (see [QElapsedTimer::msecsSinceReference](qelapsedtimer#msecsSinceReference)()). | | `%{time [format]}` | system time when the message occurred, formatted by passing the `format` to [QDateTime::toString](qdatetime#toString)(). If the format is not specified, the format of [Qt::ISODate](qt#DateFormat-enum) is used. | | `%{backtrace [depth=N] [separator="..."]}` | A backtrace with the number of frames specified by the optional `depth` parameter (defaults to 5), and separated by the optional `separator` parameter (defaults to "|"). This expansion is available only on some platforms (currently only platfoms using glibc). Names are only known for exported functions. If you want to see the name of every function in your application, use `QMAKE_LFLAGS += -rdynamic`. When reading backtraces, take into account that frames might be missing due to inlining or tail call optimization. | You can also use conditionals on the type of the message using `%{if-debug}`, `%{if-info}` `%{if-warning}`, `%{if-critical}` or `%{if-fatal}` followed by an `%{endif}`. What is inside the `%{if-*}` and `%{endif}` will only be printed if the type matches. Finally, text inside `%{if-category}` ... `%{endif}` is only printed if the category is not the default one. Example: ``` QT_MESSAGE_PATTERN="[%{time yyyyMMdd h:mm:ss.zzz t} %{if-debug}D%{endif}%{if-info}I%{endif}%{if-warning}W%{endif}%{if-critical}C%{endif}%{if-fatal}F%{endif}] %{file}:%{line} - %{message}" ``` The default *pattern* is "%{if-category}%{category}: %{endif}%{message}". The *pattern* can also be changed at runtime by setting the QT\_MESSAGE\_PATTERN environment variable; if both qSetMessagePattern() is called and QT\_MESSAGE\_PATTERN is set, the environment variable takes precedence. **Note:** The information for the placeholders `category`, `file`, `function` and `line` is only recorded in debug builds. Alternatively, `QT_MESSAGELOGCONTEXT` can be defined explicitly. For more information refer to the [QMessageLogContext](qmessagelogcontext) documentation. **Note:** The message pattern only applies to unstructured logging, such as the default `stderr` output. Structured logging such as systemd will record the message as is, along with as much structured information as can be captured. Custom message handlers can use [qFormatLogMessage](qtglobal#qFormatLogMessage)() to take *pattern* into account. This function was introduced in Qt 5.0. **See also** [qInstallMessageHandler](qtglobal#qInstallMessageHandler)(), [Debugging Techniques](testing-and-debugging#debugging-techniques), [QLoggingCategory](qloggingcategory), and [QMessageLogContext](qmessagelogcontext). ### `[since 6.2]` template <typename Enum> std::underlying\_type\_t<Enum> qToUnderlying(Enum *e*) Converts the enumerator *e* to the equivalent value expressed in its enumeration's underlying type. This function was introduced in Qt 6.2. ### const char \*qVersion() Returns the version number of Qt at run-time as a string (for example, "4.1.2"). This may be a different version than the version the application was compiled against. **See also** [QT\_VERSION\_STR](qtglobal#QT_VERSION_STR) and [QLibraryInfo::version](qlibraryinfo#version)(). ### template <typename T> T \*q\_check\_ptr(T \**p*) Uses [Q\_CHECK\_PTR](qtglobal#Q_CHECK_PTRx) on *p*, then returns *p*. This can be used as an inline version of [Q\_CHECK\_PTR](qtglobal#Q_CHECK_PTRx). ### [QByteArray](qbytearray) qgetenv(const char \**varName*) Returns the value of the environment variable with name *varName* as a [QByteArray](qbytearray). If no variable by that name is found in the environment, this function returns a default-constructed [QByteArray](qbytearray). The Qt environment manipulation functions are thread-safe, but this requires that the C library equivalent functions like getenv and putenv are not directly called. To convert the data to a [QString](qstring) use [QString::fromLocal8Bit](qstring#fromLocal8Bit)(). **Note:** on desktop Windows, qgetenv() may produce data loss if the original string contains Unicode characters not representable in the ANSI encoding. Use [qEnvironmentVariable](qtglobal#qEnvironmentVariable)() instead. On Unix systems, this function is lossless. **Note:** This function is [thread-safe](threads-reentrancy). **See also** [qputenv](qtglobal#qputenv)(), [qEnvironmentVariable](qtglobal#qEnvironmentVariable)(), [qEnvironmentVariableIsSet](qtglobal#qEnvironmentVariableIsSet)(), and [qEnvironmentVariableIsEmpty](qtglobal#qEnvironmentVariableIsEmpty)(). ### bool qputenv(const char \**varName*, const [QByteArray](qbytearray) &*value*) This function sets the *value* of the environment variable named *varName*. It will create the variable if it does not exist. It returns 0 if the variable could not be set. Calling qputenv with an empty value removes the environment variable on Windows, and makes it set (but empty) on Unix. Prefer using [qunsetenv](qtglobal#qunsetenv)() for fully portable behavior. **Note:** qputenv() was introduced because putenv() from the standard C library was deprecated in VC2005 (and later versions). qputenv() uses the replacement function in VC, and calls the standard C library's implementation on all other platforms. **See also** [qgetenv](qtglobal#qgetenv)() and [qEnvironmentVariable](qtglobal#qEnvironmentVariable)(). ### [QString](qstring) qtTrId(const char \**id*, int *n* = -1) The qtTrId function finds and returns a translated string. Returns a translated string identified by *id*. If no matching string is found, the id itself is returned. This should not happen under normal conditions. If *n* >= 0, all occurrences of `%n` in the resulting string are replaced with a decimal representation of *n*. In addition, depending on *n*'s value, the translation text may vary. Meta data and comments can be passed as documented for [QObject::tr](qobject#tr)(). In addition, it is possible to supply a source string template like that: `//% <C string>` or `\begincomment% <C string> \endcomment` Example: ``` //% "%n fooish bar(s) found.\n" //% "Do you want to continue?" QString text = qtTrId("qtn_foo_bar", n); ``` Creating QM files suitable for use with this function requires passing the `-idbased` option to the `lrelease` tool. **Warning:** This method is reentrant only if all translators are installed *before* calling this method. Installing or removing translators while performing translations is not supported. Doing so will probably result in crashes or other undesirable behavior. **Note:** This function is [reentrant](17-qdoc-commands-thread#reentrant). **See also** [QObject::tr](qobject#tr)(), [QCoreApplication::translate](qcoreapplication#translate)(), and [Internationalization with Qt](internationalization). ### `[since 5.1]` bool qunsetenv(const char \**varName*) This function deletes the variable *varName* from the environment. Returns `true` on success. This function was introduced in Qt 5.1. **See also** [qputenv](qtglobal#qputenv)(), [qgetenv](qtglobal#qgetenv)(), and [qEnvironmentVariable](qtglobal#qEnvironmentVariable)(). Macro Documentation ------------------- ### `[since 6.2]` PRIdQSIZETYPE ### `[since 6.2]` PRIiQSIZETYPE See qsizetype. This function was introduced in Qt 6.2. ### `[since 6.2]` PRIdQPTRDIFF ### `[since 6.2]` PRIiQPTRDIFF See qptrdiff. This function was introduced in Qt 6.2. ### `[since 6.2]` PRIXQUINTPTR ### `[since 6.2]` PRIoQUINTPTR ### `[since 6.2]` PRIuQUINTPTR ### `[since 6.2]` PRIxQUINTPTR See quintptr. This function was introduced in Qt 6.2. ### `[since 6.2]` PRIdQINTPTR ### `[since 6.2]` PRIiQINTPTR See qintptr. This function was introduced in Qt 6.2. ### `[since 6.2]` PRIXQUINTPTR This function was introduced in Qt 6.2. ### `[since 6.2]` PRIdQINTPTR This function was introduced in Qt 6.2. ### `[since 6.2]` PRIdQPTRDIFF This function was introduced in Qt 6.2. ### `[since 6.2]` PRIdQSIZETYPE This function was introduced in Qt 6.2. ### `[since 6.2]` PRIiQINTPTR This function was introduced in Qt 6.2. ### `[since 6.2]` PRIiQPTRDIFF This function was introduced in Qt 6.2. ### `[since 6.2]` PRIiQSIZETYPE This function was introduced in Qt 6.2. ### `[since 6.2]` PRIoQUINTPTR This function was introduced in Qt 6.2. ### `[since 6.2]` PRIuQUINTPTR This function was introduced in Qt 6.2. ### `[since 6.2]` PRIxQUINTPTR This function was introduced in Qt 6.2. ### QT\_DEPRECATED\_WARNINGS Since Qt 5.13, this macro has no effect. In Qt 5.12 and before, if this macro is defined, the compiler will generate warnings if any API declared as deprecated by Qt is used. **See also** [QT\_DISABLE\_DEPRECATED\_BEFORE](qtglobal#QT_DISABLE_DEPRECATED_BEFORE) and [QT\_NO\_DEPRECATED\_WARNINGS](qtglobal#QT_NO_DEPRECATED_WARNINGS). ### QT\_DISABLE\_DEPRECATED\_BEFORE This macro can be defined in the project file to disable functions deprecated in a specified version of Qt or any earlier version. The default version number is 5.0, meaning that functions deprecated in or before Qt 5.0 will not be included. For instance, when using a future release of Qt 5, set `QT_DISABLE_DEPRECATED_BEFORE=0x050100` to disable functions deprecated in Qt 5.1 and earlier. In any release, set `QT_DISABLE_DEPRECATED_BEFORE=0x000000` to enable all functions, including the ones deprecated in Qt 5.0. **See also** [QT\_DEPRECATED\_WARNINGS](qtglobal#QT_DEPRECATED_WARNINGS). ### `[since 5.13]` QT\_NO\_DEPRECATED\_WARNINGS This macro can be used to suppress deprecation warnings that would otherwise be generated when using deprecated APIs. This function was introduced in Qt 5.13. **See also** [QT\_DISABLE\_DEPRECATED\_BEFORE](qtglobal#QT_DISABLE_DEPRECATED_BEFORE). ### QT\_POINTER\_SIZE Expands to the size of a pointer in bytes (4 or 8). This is equivalent to `sizeof(void *)` but can be used in a preprocessor directive. ### QT\_REQUIRE\_VERSION(int *argc*, char \*\**argv*, const char \**version*) This macro can be used to ensure that the application is run against a recent enough version of Qt. This is especially useful if your application depends on a specific bug fix introduced in a bug-fix release (e.g., 4.0.2). The *argc* and *argv* parameters are the `main()` function's `argc` and `argv` parameters. The *version* parameter is a string literal that specifies which version of Qt the application requires (e.g., "4.0.2"). Example: ``` #include <QApplication> #include <QMessageBox> int main(int argc, char *argv[]) { QT_REQUIRE_VERSION(argc, argv, "4.0.2") QApplication app(argc, argv); ... return app.exec(); } ``` ### QT\_TRANSLATE\_NOOP3(*context*, *sourceText*, *disambiguation*) Marks the UTF-8 encoded string literal *sourceText* for delayed translation in the given *context* with the given *disambiguation*. The *context* is typically a class and also needs to be specified as a string literal. The string literal *disambiguation* should be a short semantic tag to tell apart otherwise identical strings. The macro tells lupdate to collect the string, and expands to an anonymous struct of the two string literals passed as *sourceText* and *disambiguation*. Example: ``` static { const char *source; const char *comment; } greeting_strings[] = { QT_TRANSLATE_NOOP3("FriendlyConversation", "Hello", "A really friendly hello"), QT_TRANSLATE_NOOP3("FriendlyConversation", "Goodbye", "A really friendly goodbye") }; QString FriendlyConversation::greeting(int type) { return tr(greeting_strings[type].source, greeting_strings[type].comment); } QString global_greeting(int type) { return qApp->translate("FriendlyConversation", greeting_strings[type].source, greeting_strings[type].comment); } ``` **See also** [QT\_TR\_NOOP](qtglobal#QT_TR_NOOP)(), [QT\_TRANSLATE\_NOOP](qtglobal#QT_TRANSLATE_NOOP)(), and [Internationalization with Qt](internationalization). ### QT\_TRANSLATE\_NOOP(*context*, *sourceText*) Marks the UTF-8 encoded string literal *sourceText* for delayed translation in the given *context*. The *context* is typically a class name and also needs to be specified as a string literal. The macro tells lupdate to collect the string, and expands to *sourceText* itself. Example: ``` static const char *greeting_strings[] = { QT_TRANSLATE_NOOP("FriendlyConversation", "Hello"), QT_TRANSLATE_NOOP("FriendlyConversation", "Goodbye") }; QString FriendlyConversation::greeting(int type) { return tr(greeting_strings[type]); } QString global_greeting(int type) { return qApp->translate("FriendlyConversation", greeting_strings[type]); } ``` **See also** [QT\_TR\_NOOP](qtglobal#QT_TR_NOOP)(), [QT\_TRANSLATE\_NOOP3](qtglobal#QT_TRANSLATE_NOOP3)(), and [Internationalization with Qt](internationalization). ### `[since 5.12]` QT\_TRANSLATE\_N\_NOOP3(*context*, *sourceText*, *comment*) Marks the UTF-8 encoded string literal *sourceText* for numerator dependent delayed translation in the given *context* with the given *comment*. The *context* is typically a class and also needs to be specified as a string literal. The string literal *comment* should be a short semantic tag to tell apart otherwise identical strings. The macro tells lupdate to collect the string, and expands to an anonymous struct of the two string literals passed as *sourceText* and *comment*. Example: ``` static { const char * const source; const char * const comment; } status_strings[] = { QT_TRANSLATE_N_NOOP3("Message Status", "Hello, you have %n message(s)", "A login message status"), QT_TRANSLATE_N_NOOP3("Message status", "You have %n new message(s)", "A new message query status") }; QString FriendlyConversation::greeting(int type, int count) { return tr(status_strings[type].source, status_strings[type].comment, count); } QString global_greeting(int type, int count) { return qApp->translate("Message Status", status_strings[type].source, status_strings[type].comment, count); } ``` This function was introduced in Qt 5.12. **See also** [QT\_TR\_NOOP](qtglobal#QT_TR_NOOP)(), [QT\_TRANSLATE\_NOOP](qtglobal#QT_TRANSLATE_NOOP)(), [QT\_TRANSLATE\_NOOP3](qtglobal#QT_TRANSLATE_NOOP3)(), and [Internationalization with Qt](internationalization). ### `[since 5.12]` QT\_TRANSLATE\_N\_NOOP(*context*, *sourceText*) Marks the UTF-8 encoded string literal *sourceText* for numerator dependent delayed translation in the given *context*. The *context* is typically a class name and also needs to be specified as a string literal. The macro tells lupdate to collect the string, and expands to *sourceText* itself. Example: ``` static const char * const greeting_strings[] = { QT_TRANSLATE_N_NOOP("Welcome Msg", "Hello, you have %n message(s)"), QT_TRANSLATE_N_NOOP("Welcome Msg", "Hi, you have %n message(s)") }; QString global_greeting(int type, int msgcnt) { return translate("Welcome Msg", greeting_strings[type], nullptr, msgcnt); } ``` This function was introduced in Qt 5.12. **See also** [QT\_TRANSLATE\_NOOP](qtglobal#QT_TRANSLATE_NOOP)(), [QT\_TRANSLATE\_N\_NOOP3](qtglobal#QT_TRANSLATE_N_NOOP3)(), and [Internationalization with Qt](internationalization). ### QT\_TRID\_NOOP(*id*) The QT\_TRID\_NOOP macro marks an id for dynamic translation. The only purpose of this macro is to provide an anchor for attaching meta data like to [qtTrId](qtglobal#qtTrId)(). The macro expands to *id*. Example: ``` static const char * const ids[] = { //% "This is the first text." QT_TRID_NOOP("qtn_1st_text"), //% "This is the second text." QT_TRID_NOOP("qtn_2nd_text"), 0 }; void TheClass::addLabels() { for (int i = 0; ids[i]; ++i) new QLabel(qtTrId(ids[i]), this); } ``` **See also** [qtTrId](qtglobal#qtTrId)() and [Internationalization with Qt](internationalization). ### QT\_TR\_NOOP(*sourceText*) Marks the UTF-8 encoded string literal *sourceText* for delayed translation in the current context (class). The macro tells lupdate to collect the string, and expands to *sourceText* itself. Example: ``` QString FriendlyConversation::greeting(int type) { static const char *greeting_strings[] = { QT_TR_NOOP("Hello"), QT_TR_NOOP("Goodbye") }; return tr(greeting_strings[type]); } ``` The macro QT\_TR\_NOOP\_UTF8() is identical and obsolete; this applies to all other \_UTF8 macros as well. **See also** [QT\_TRANSLATE\_NOOP](qtglobal#QT_TRANSLATE_NOOP)() and [Internationalization with Qt](internationalization). ### `[since 5.12]` QT\_TR\_N\_NOOP(*sourceText*) Marks the UTF-8 encoded string literal *sourceText* for numerator dependent delayed translation in the current context (class). The macro tells lupdate to collect the string, and expands to *sourceText* itself. The macro expands to *sourceText*. Example: ``` static const char * const StatusClass::status_strings[] = { QT_TR_N_NOOP("There are %n new message(s)"), QT_TR_N_NOOP("There are %n total message(s)") }; QString StatusClass::status(int type, int count) { return tr(status_strings[type], nullptr, count); } ``` This function was introduced in Qt 5.12. **See also** [QT\_TR\_NOOP](qtglobal#QT_TR_NOOP) and [Internationalization with Qt](internationalization). ### QT\_VERSION This macro expands a numeric value of the form 0xMMNNPP (MM = major, NN = minor, PP = patch) that specifies Qt's version number. For example, if you compile your application against Qt 4.1.2, the QT\_VERSION macro will expand to 0x040102. You can use QT\_VERSION to use the latest Qt features where available. Example: ``` #if QT_VERSION >= 0x040100 QIcon icon = style()->standardIcon(QStyle::SP_TrashIcon); #else QPixmap pixmap = style()->standardPixmap(QStyle::SP_TrashIcon); QIcon icon(pixmap); #endif ``` **See also** [QT\_VERSION\_STR](qtglobal#QT_VERSION_STR) and [qVersion](qtglobal#qVersion)(). ### QT\_VERSION\_CHECK Turns the major, minor and patch numbers of a version into an integer, 0xMMNNPP (MM = major, NN = minor, PP = patch). This can be compared with another similarly processed version id. Example: ``` #include <QtGlobal> #if (QT_VERSION >= QT_VERSION_CHECK(5, 0, 0)) #include <QtWidgets> #else #include <QtGui> #endif ``` **See also** [QT\_VERSION](qtglobal#QT_VERSION). ### QT\_VERSION\_STR This macro expands to a string that specifies Qt's version number (for example, "4.1.2"). This is the version against which the application is compiled. **See also** [qVersion](qtglobal#qVersion)() and [QT\_VERSION](qtglobal#QT_VERSION). ### void Q\_ASSERT(bool *test*) Prints a warning message containing the source code file name and line number if *test* is `false`. Q\_ASSERT() is useful for testing pre- and post-conditions during development. It does nothing if `QT_NO_DEBUG` was defined during compilation. Example: ``` // File: div.cpp #include <QtGlobal> int divide(int a, int b) { Q_ASSERT(b != 0); return a / b; } ``` If `b` is zero, the Q\_ASSERT statement will output the following message using the [qFatal](qtglobal#qFatal)() function: ``` ASSERT: "b != 0" in file div.cpp, line 7 ``` **See also** [Q\_ASSERT\_X](qtglobal#Q_ASSERT_X)(), [qFatal](qtglobal#qFatal)(), and [Debugging Techniques](testing-and-debugging#debugging-techniques). ### void Q\_ASSERT\_X(bool *test*, const char \**where*, const char \**what*) Prints the message *what* together with the location *where*, the source file name and line number if *test* is `false`. Q\_ASSERT\_X is useful for testing pre- and post-conditions during development. It does nothing if `QT_NO_DEBUG` was defined during compilation. Example: ``` // File: div.cpp #include <QtGlobal> int divide(int a, int b) { Q_ASSERT_X(b != 0, "divide", "division by zero"); return a / b; } ``` If `b` is zero, the Q\_ASSERT\_X statement will output the following message using the [qFatal](qtglobal#qFatal)() function: ``` ASSERT failure in divide: "division by zero", file div.cpp, line 7 ``` **See also** [Q\_ASSERT](qtglobal#Q_ASSERT)(), [qFatal](qtglobal#qFatal)(), and [Debugging Techniques](testing-and-debugging#debugging-techniques). ### `[since 5.0]` void Q\_ASSUME(bool *expr*) Causes the compiler to assume that *expr* is `true`. This macro is useful for improving code generation, by providing the compiler with hints about conditions that it would not otherwise know about. However, there is no guarantee that the compiler will actually use those hints. This macro could be considered a "lighter" version of [Q\_ASSERT](qtglobal#Q_ASSERT)(). While [Q\_ASSERT](qtglobal#Q_ASSERT) will abort the program's execution if the condition is `false`, Q\_ASSUME will tell the compiler not to generate code for those conditions. Therefore, it is important that the assumptions always hold, otherwise undefined behaviour may occur. If *expr* is a constantly `false` condition, Q\_ASSUME will tell the compiler that the current code execution cannot be reached. That is, Q\_ASSUME(false) is equivalent to [Q\_UNREACHABLE](qtglobal#Q_UNREACHABLE)(). In debug builds the condition is enforced by an assert to facilitate debugging. **Note:** [Q\_LIKELY](qtglobal#Q_LIKELY)() tells the compiler that the expression is likely, but not the only possibility. Q\_ASSUME tells the compiler that it is the only possibility. This function was introduced in Qt 5.0. **See also** [Q\_ASSERT](qtglobal#Q_ASSERT)(), [Q\_UNREACHABLE](qtglobal#Q_UNREACHABLE)(), and [Q\_LIKELY](qtglobal#Q_LIKELY)(). ### Q\_BIG\_ENDIAN This macro represents a value you can compare to the macro [Q\_BYTE\_ORDER](qtglobal#Q_BYTE_ORDER) to determine the endian-ness of your system. In a big-endian system, the most significant byte is stored at the lowest address. The other bytes follow in decreasing order of significance. ``` #if Q_BYTE_ORDER == Q_BIG_ENDIAN ... #endif ``` **See also** [Q\_BYTE\_ORDER](qtglobal#Q_BYTE_ORDER) and [Q\_LITTLE\_ENDIAN](qtglobal#Q_LITTLE_ENDIAN). ### Q\_BYTE\_ORDER This macro can be used to determine the byte order your system uses for storing data in memory. i.e., whether your system is little-endian or big-endian. It is set by Qt to one of the macros [Q\_LITTLE\_ENDIAN](qtglobal#Q_LITTLE_ENDIAN) or [Q\_BIG\_ENDIAN](qtglobal#Q_BIG_ENDIAN). You normally won't need to worry about endian-ness, but you might, for example if you need to know which byte of an integer or UTF-16 character is stored in the lowest address. Endian-ness is important in networking, where computers with different values for Q\_BYTE\_ORDER must pass data back and forth. Use this macro as in the following examples. ``` #if Q_BYTE_ORDER == Q_BIG_ENDIAN ... #endif or #if Q_BYTE_ORDER == Q_LITTLE_ENDIAN ... #endif ``` **See also** [Q\_BIG\_ENDIAN](qtglobal#Q_BIG_ENDIAN) and [Q\_LITTLE\_ENDIAN](qtglobal#Q_LITTLE_ENDIAN). ### Q\_CC\_BOR Defined if the application is compiled using Borland/Turbo C++. ### Q\_CC\_CDS Defined if the application is compiled using Reliant C++. ### Q\_CC\_CLANG Defined if the application is compiled using Clang. ### Q\_CC\_COMEAU Defined if the application is compiled using Comeau C++. ### Q\_CC\_DEC Defined if the application is compiled using DEC C++. ### Q\_CC\_EDG Defined if the application is compiled using Edison Design Group C++. ### Q\_CC\_GHS Defined if the application is compiled using Green Hills Optimizing C++ Compilers. ### Q\_CC\_GNU Defined if the application is compiled using GNU C++. ### Q\_CC\_HIGHC Defined if the application is compiled using MetaWare High C/C++. ### Q\_CC\_HPACC Defined if the application is compiled using HP aC++. ### Q\_CC\_INTEL Defined if the application is compiled using Intel C++ for Linux, Intel C++ for Windows. ### Q\_CC\_KAI Defined if the application is compiled using KAI C++. ### Q\_CC\_MIPS Defined if the application is compiled using MIPSpro C++. ### Q\_CC\_MSVC Defined if the application is compiled using Microsoft Visual C/C++, Intel C++ for Windows. ### Q\_CC\_OC Defined if the application is compiled using CenterLine C++. ### Q\_CC\_PGI Defined if the application is compiled using Portland Group C++. ### Q\_CC\_SUN Defined if the application is compiled using Forte Developer, or Sun Studio C++. ### Q\_CC\_SYM Defined if the application is compiled using Digital Mars C/C++ (used to be Symantec C++). ### Q\_CC\_USLC Defined if the application is compiled using SCO OUDK and UDK. ### Q\_CC\_WAT Defined if the application is compiled using Watcom C++. ### void Q\_CHECK\_PTR(void \**pointer*) If *pointer* is `nullptr`, prints a message containing the source code's file name and line number, saying that the program ran out of memory and aborts program execution. It throws `std::bad_alloc` instead if exceptions are enabled. Q\_CHECK\_PTR does nothing if `QT_NO_DEBUG` and `QT_NO_EXCEPTIONS` were defined during compilation. Therefore you must not use Q\_CHECK\_PTR to check for successful memory allocations because the check will be disabled in some cases. Example: ``` int *a; Q_CHECK_PTR(a = new int[80]); // WRONG! a = new (nothrow) int[80]; // Right Q_CHECK_PTR(a); ``` **See also** [qWarning](qtglobal#qWarning)() and [Debugging Techniques](testing-and-debugging#debugging-techniques). ### Q\_DECLARE\_TYPEINFO(*Type*, *Flags*) You can use this macro to specify information about a custom type *Type*. With accurate type information, Qt's [generic containers](containers) can choose appropriate storage methods and algorithms. *Flags* can be one of the following: * `Q_PRIMITIVE_TYPE` specifies that *Type* is a POD (plain old data) type with no constructor or destructor, and for which memcpy()ing creates a valid independent copy of the object. * `Q_RELOCATABLE_TYPE` specifies that *Type* has a constructor and/or a destructor but can be moved in memory using `memcpy()`. * `Q_MOVABLE_TYPE` is the same as `Q_RELOCATABLE_TYPE`. Prefer to use `Q_RELOCATABLE_TYPE` in new code. Note: despite the name, this has nothing to do with move constructors or C++ move semantics. * `Q_COMPLEX_TYPE` (the default) specifies that *Type* has constructors and/or a destructor and that it may not be moved in memory. Example of a "primitive" type: ``` struct Point2D { int x; int y; }; Q_DECLARE_TYPEINFO(Point2D, Q_PRIMITIVE_TYPE); ``` An example of a non-POD "primitive" type is [QUuid](quuid): Even though [QUuid](quuid) has constructors (and therefore isn't POD), every bit pattern still represents a valid object, and memcpy() can be used to create a valid independent copy of a [QUuid](quuid) object. Example of a relocatable type: ``` class Point2D { public: Point2D() { data = new int[2]; } Point2D(const Point2D &other) { ... } ~Point2D() { delete[] data; } Point2D &operator=(const Point2D &other) { ... } int x() const { return data[0]; } int y() const { return data[1]; } private: int *data; }; Q_DECLARE_TYPEINFO(Point2D, Q_RELOCATABLE_TYPE); ``` Qt will try to detect the class of a type using [std::is\_trivial\_v<T>](https://en.cppreference.com/w/cpp/types/is_trivial) to identify primitive types and it will require both [std::is\_trivially\_copyable\_v<T>](https://en.cppreference.com/w/cpp/types/is_trivially_copyable) and [std::is\_trivially\_destructible\_v<T>](https://en.cppreference.com/w/cpp/types/is_destructible) to identify relocatable types. Use this macro to tune the behavior. For instance many types would be candidates for Q\_RELOCATABLE\_TYPE despite not being trivially-copyable. ### Q\_DECL\_CONSTEXPR This macro can be used to declare variable that should be constructed at compile-time, or an inline function that can be computed at compile-time. It expands to "constexpr" if your compiler supports that C++11 keyword, or to nothing otherwise. **See also** [Q\_DECL\_RELAXED\_CONSTEXPR](qtglobal#Q_DECL_RELAXED_CONSTEXPR). ### Q\_DECL\_EXPORT This macro marks a symbol for shared library export (see [Creating Shared Libraries](https://doc.qt.io/qt-6.2/sharedlibrary.html)). **See also** [Q\_DECL\_IMPORT](qtglobal#Q_DECL_IMPORT). ### Q\_DECL\_IMPORT This macro declares a symbol to be an import from a shared library (see [Creating Shared Libraries](https://doc.qt.io/qt-6.2/sharedlibrary.html)). **See also** [Q\_DECL\_EXPORT](qtglobal#Q_DECL_EXPORT). ### `[since 5.0]` Q\_DECL\_NOEXCEPT This macro marks a function as never throwing. If the function does nevertheless throw, the behaviour is defined: std::terminate() is called. The macro expands to C++11 noexcept, if available, or to nothing otherwise. If you need the operator version of C++11 noexcept, use [Q\_DECL\_NOEXCEPT\_EXPR](qtglobal#Q_DECL_NOEXCEPT_EXPR)(x). If you don't need C++11 noexcept semantics, e.g. because your function can't possibly throw, don't use this macro, use [Q\_DECL\_NOTHROW](qtglobal#Q_DECL_NOTHROW) instead. This function was introduced in Qt 5.0. **See also** [Q\_DECL\_NOTHROW](qtglobal#Q_DECL_NOTHROW) and [Q\_DECL\_NOEXCEPT\_EXPR](qtglobal#Q_DECL_NOEXCEPT_EXPR)(). ### `[since 5.0]` Q\_DECL\_NOEXCEPT\_EXPR(*x*) This macro marks a function as non-throwing if *x* is `true`. If the function does nevertheless throw, the behaviour is defined: std::terminate() is called. The macro expands to C++11 noexcept(x), if available, or to nothing otherwise. If you need the always-true version of C++11 noexcept, use [Q\_DECL\_NOEXCEPT](qtglobal#Q_DECL_NOEXCEPT). If you don't need C++11 noexcept semantics, e.g. because your function can't possibly throw, don't use this macro, use [Q\_DECL\_NOTHROW](qtglobal#Q_DECL_NOTHROW) instead. This function was introduced in Qt 5.0. **See also** [Q\_DECL\_NOTHROW](qtglobal#Q_DECL_NOTHROW) and [Q\_DECL\_NOEXCEPT](qtglobal#Q_DECL_NOEXCEPT). ### `[since 5.0]` Q\_DECL\_NOTHROW This macro marks a function as never throwing, under no circumstances. If the function does nevertheless throw, the behaviour is undefined. The macro expands to either "throw()", if that has some benefit on the compiler, or to C++11 noexcept, if available, or to nothing otherwise. If you need C++11 noexcept semantics, don't use this macro, use [Q\_DECL\_NOEXCEPT](qtglobal#Q_DECL_NOEXCEPT)/[Q\_DECL\_NOEXCEPT\_EXPR](qtglobal#Q_DECL_NOEXCEPT_EXPR) instead. This function was introduced in Qt 5.0. **See also** [Q\_DECL\_NOEXCEPT](qtglobal#Q_DECL_NOEXCEPT) and [Q\_DECL\_NOEXCEPT\_EXPR](qtglobal#Q_DECL_NOEXCEPT_EXPR)(). ### Q\_DECL\_RELAXED\_CONSTEXPR This macro can be used to declare an inline function that can be computed at compile-time according to the relaxed rules from C++14. It expands to "constexpr" if your compiler supports C++14 relaxed constant expressions, or to nothing otherwise. **See also** [Q\_DECL\_CONSTEXPR](qtglobal#Q_DECL_CONSTEXPR). ### `[since 5.8]` void Q\_FALLTHROUGH Can be used in switch statements at the end of case block to tell the compiler and other developers that that the lack of a break statement is intentional. This is useful since a missing break statement is often a bug, and some compilers can be configured to emit warnings when one is not found. This function was introduced in Qt 5.8. **See also** [Q\_UNREACHABLE](qtglobal#Q_UNREACHABLE)(). ### Q\_FOREACH(*variable*, *container*) Same as foreach(*variable*, *container*). This macro is available even when `no_keywords` is specified using the `.pro` file's `CONFIG` variable. **Note:** Since Qt 5.7, the use of this macro is discouraged. It will be removed in a future version of Qt. Please use C++11 range-for, possibly with [qAsConst](qtglobal#qAsConst)(), as needed. **See also** [qAsConst](qtglobal#qAsConst)(). ### Q\_FOREVER Same as [forever](containers#forever). This macro is available even when `no_keywords` is specified using the `.pro` file's `CONFIG` variable. **See also** [foreach](qtglobal#foreach)(). ### `[since 5.2]` Q\_FORWARD\_DECLARE\_CF\_TYPE(*type*) Forward-declares a Core Foundation *type*. This includes the actual type and the ref type. For example, Q\_FORWARD\_DECLARE\_CF\_TYPE(CFString) declares \_\_CFString and CFStringRef. This function was introduced in Qt 5.2. ### `[since 5.2]` Q\_FORWARD\_DECLARE\_MUTABLE\_CF\_TYPE(*type*) Forward-declares a mutable Core Foundation *type*. This includes the actual type and the ref type. For example, Q\_FORWARD\_DECLARE\_MUTABLE\_CF\_TYPE(CFMutableString) declares \_\_CFMutableString and CFMutableStringRef. This function was introduced in Qt 5.2. ### `[since 5.2]` Q\_FORWARD\_DECLARE\_OBJC\_CLASS(*classname*) Forward-declares an Objective-C *classname* in a manner such that it can be compiled as either Objective-C or C++. This is primarily intended for use in header files that may be included by both Objective-C and C++ source files. This function was introduced in Qt 5.2. ### const char\*Q\_FUNC\_INFO Expands to a string that describe the function the macro resides in. How this string looks more specifically is compiler dependent. With GNU GCC it is typically the function signature, while with other compilers it might be the line and column number. Q\_FUNC\_INFO can be conveniently used with [qDebug](qtglobal#qDebug)(). For example, this function: ``` template<typename TInputType> const TInputType &myMin(const TInputType &value1, const TInputType &value2) { qDebug() << Q_FUNC_INFO << "was called with value1:" << value1 << "value2:" << value2; if(value1 < value2) return value1; else return value2; } ``` when instantiated with the integer type, will with the GCC compiler produce: `const TInputType& myMin(const TInputType&, const TInputType&) [with TInputType = int] was called with value1: 3 value2: 4` If this macro is used outside a function, the behavior is undefined. ### [qint64](qtglobal#qint64-typedef) Q\_INT64\_C(*literal*) Wraps the signed 64-bit integer *literal* in a platform-independent way. Example: ``` qint64 value = Q_INT64_C(932838457459459); ``` **See also** [qint64](qtglobal#qint64-typedef) and [Q\_UINT64\_C](qtglobal#Q_UINT64_C)(). ### Q\_LIKELY(*expr*) Hints to the compiler that the enclosed condition, *expr*, is likely to evaluate to `true`. Use of this macro can help the compiler to optimize the code. Example: ``` // the condition inside the "if" will be successful most of the times for (int i = 1; i <= 365; i++) { if (Q_LIKELY(isWorkingDay(i))) { ... } ... } ``` **See also** [Q\_UNLIKELY](qtglobal#Q_UNLIKELY)(). ### Q\_LITTLE\_ENDIAN This macro represents a value you can compare to the macro [Q\_BYTE\_ORDER](qtglobal#Q_BYTE_ORDER) to determine the endian-ness of your system. In a little-endian system, the least significant byte is stored at the lowest address. The other bytes follow in increasing order of significance. ``` #if Q_BYTE_ORDER == Q_LITTLE_ENDIAN ... #endif ``` **See also** [Q\_BYTE\_ORDER](qtglobal#Q_BYTE_ORDER) and [Q\_BIG\_ENDIAN](qtglobal#Q_BIG_ENDIAN). ### Q\_OS\_AIX Defined on AIX. ### Q\_OS\_ANDROID Defined on Android. ### Q\_OS\_BSD4 Defined on Any BSD 4.4 system. ### Q\_OS\_CYGWIN Defined on Cygwin. ### Q\_OS\_DARWIN Defined on Darwin-based operating systems such as macOS, iOS, watchOS, and tvOS. ### Q\_OS\_FREEBSD Defined on FreeBSD. ### Q\_OS\_HPUX Defined on HP-UX. ### Q\_OS\_HURD Defined on GNU Hurd. ### Q\_OS\_IOS Defined on iOS. ### Q\_OS\_LINUX Defined on Linux. ### Q\_OS\_LYNX Defined on LynxOS. ### Q\_OS\_MAC Deprecated synonym for `Q_OS_DARWIN`. Do not use. ### Q\_OS\_MACOS Defined on macOS. ### Q\_OS\_NETBSD Defined on NetBSD. ### Q\_OS\_OPENBSD Defined on OpenBSD. ### Q\_OS\_OSX Deprecated synonym for `Q_OS_MACOS`. Do not use. ### Q\_OS\_QNX Defined on QNX Neutrino. ### Q\_OS\_SOLARIS Defined on Sun Solaris. ### Q\_OS\_TVOS Defined on tvOS. ### Q\_OS\_UNIX Defined on Any UNIX BSD/SYSV system. ### Q\_OS\_WASM Defined on Web Assembly. ### Q\_OS\_WATCHOS Defined on watchOS. ### Q\_OS\_WIN32 Defined on 32-bit and 64-bit versions of Windows. ### Q\_OS\_WIN64 Defined on 64-bit versions of Windows. ### Q\_OS\_WIN Defined on all supported versions of Windows. That is, if [Q\_OS\_WIN32](qtglobal#Q_OS_WIN32) or [Q\_OS\_WIN64](qtglobal#Q_OS_WIN64) is defined. ### Q\_OS\_WINDOWS This is a synonym for [Q\_OS\_WIN](qtglobal#Q_OS_WIN). ### Q\_PROCESSOR\_X86 Defined if the application is compiled for x86 processors. Qt currently supports two x86 variants: [Q\_PROCESSOR\_X86\_32](qtglobal#Q_PROCESSOR_X86_32) and [Q\_PROCESSOR\_X86\_64](qtglobal#Q_PROCESSOR_X86_64). **See also** [QSysInfo::buildCpuArchitecture](qsysinfo#buildCpuArchitecture)(). ### Q\_PROCESSOR\_S390 Defined if the application is compiled for S/390 processors. Qt supports one optional variant of S/390: [Q\_PROCESSOR\_S390\_X](qtglobal#Q_PROCESSOR_S390_X). **See also** [QSysInfo::buildCpuArchitecture](qsysinfo#buildCpuArchitecture)(). ### Q\_PROCESSOR\_ALPHA Defined if the application is compiled for Alpha processors. **See also** [QSysInfo::buildCpuArchitecture](qsysinfo#buildCpuArchitecture)(). ### Q\_PROCESSOR\_ARM Defined if the application is compiled for ARM processors. Qt currently supports three optional ARM revisions: [Q\_PROCESSOR\_ARM\_V5](qtglobal#Q_PROCESSOR_ARM_V5), [Q\_PROCESSOR\_ARM\_V6](qtglobal#Q_PROCESSOR_ARM_V6), and [Q\_PROCESSOR\_ARM\_V7](qtglobal#Q_PROCESSOR_ARM_V7). **See also** [QSysInfo::buildCpuArchitecture](qsysinfo#buildCpuArchitecture)(). ### Q\_PROCESSOR\_ARM\_V5 Defined if the application is compiled for ARMv5 processors. The [Q\_PROCESSOR\_ARM](qtglobal#Q_PROCESSOR_ARM) macro is also defined when Q\_PROCESSOR\_ARM\_V5 is defined. **See also** [QSysInfo::buildCpuArchitecture](qsysinfo#buildCpuArchitecture)(). ### Q\_PROCESSOR\_ARM\_V6 Defined if the application is compiled for ARMv6 processors. The [Q\_PROCESSOR\_ARM](qtglobal#Q_PROCESSOR_ARM) and [Q\_PROCESSOR\_ARM\_V5](qtglobal#Q_PROCESSOR_ARM_V5) macros are also defined when Q\_PROCESSOR\_ARM\_V6 is defined. **See also** [QSysInfo::buildCpuArchitecture](qsysinfo#buildCpuArchitecture)(). ### Q\_PROCESSOR\_ARM\_V7 Defined if the application is compiled for ARMv7 processors. The [Q\_PROCESSOR\_ARM](qtglobal#Q_PROCESSOR_ARM), [Q\_PROCESSOR\_ARM\_V5](qtglobal#Q_PROCESSOR_ARM_V5), and [Q\_PROCESSOR\_ARM\_V6](qtglobal#Q_PROCESSOR_ARM_V6) macros are also defined when Q\_PROCESSOR\_ARM\_V7 is defined. **See also** [QSysInfo::buildCpuArchitecture](qsysinfo#buildCpuArchitecture)(). ### Q\_PROCESSOR\_AVR32 Defined if the application is compiled for AVR32 processors. **See also** [QSysInfo::buildCpuArchitecture](qsysinfo#buildCpuArchitecture)(). ### Q\_PROCESSOR\_BLACKFIN Defined if the application is compiled for Blackfin processors. **See also** [QSysInfo::buildCpuArchitecture](qsysinfo#buildCpuArchitecture)(). ### Q\_PROCESSOR\_IA64 Defined if the application is compiled for IA-64 processors. This includes all Itanium and Itanium 2 processors. **See also** [QSysInfo::buildCpuArchitecture](qsysinfo#buildCpuArchitecture)(). ### Q\_PROCESSOR\_MIPS Defined if the application is compiled for MIPS processors. Qt currently supports seven MIPS revisions: [Q\_PROCESSOR\_MIPS\_I](qtglobal#Q_PROCESSOR_MIPS_I), [Q\_PROCESSOR\_MIPS\_II](qtglobal#Q_PROCESSOR_MIPS_II), [Q\_PROCESSOR\_MIPS\_III](qtglobal#Q_PROCESSOR_MIPS_III), [Q\_PROCESSOR\_MIPS\_IV](qtglobal#Q_PROCESSOR_MIPS_IV), [Q\_PROCESSOR\_MIPS\_V](qtglobal#Q_PROCESSOR_MIPS_V), [Q\_PROCESSOR\_MIPS\_32](qtglobal#Q_PROCESSOR_MIPS_32), and [Q\_PROCESSOR\_MIPS\_64](qtglobal#Q_PROCESSOR_MIPS_64). **See also** [QSysInfo::buildCpuArchitecture](qsysinfo#buildCpuArchitecture)(). ### Q\_PROCESSOR\_MIPS\_32 Defined if the application is compiled for MIPS32 processors. The [Q\_PROCESSOR\_MIPS](qtglobal#Q_PROCESSOR_MIPS), [Q\_PROCESSOR\_MIPS\_I](qtglobal#Q_PROCESSOR_MIPS_I), and [Q\_PROCESSOR\_MIPS\_II](qtglobal#Q_PROCESSOR_MIPS_II) macros are also defined when Q\_PROCESSOR\_MIPS\_32 is defined. **See also** [QSysInfo::buildCpuArchitecture](qsysinfo#buildCpuArchitecture)(). ### Q\_PROCESSOR\_MIPS\_64 Defined if the application is compiled for MIPS64 processors. The [Q\_PROCESSOR\_MIPS](qtglobal#Q_PROCESSOR_MIPS), [Q\_PROCESSOR\_MIPS\_I](qtglobal#Q_PROCESSOR_MIPS_I), [Q\_PROCESSOR\_MIPS\_II](qtglobal#Q_PROCESSOR_MIPS_II), [Q\_PROCESSOR\_MIPS\_III](qtglobal#Q_PROCESSOR_MIPS_III), [Q\_PROCESSOR\_MIPS\_IV](qtglobal#Q_PROCESSOR_MIPS_IV), and [Q\_PROCESSOR\_MIPS\_V](qtglobal#Q_PROCESSOR_MIPS_V) macros are also defined when Q\_PROCESSOR\_MIPS\_64 is defined. **See also** [QSysInfo::buildCpuArchitecture](qsysinfo#buildCpuArchitecture)(). ### Q\_PROCESSOR\_MIPS\_I Defined if the application is compiled for MIPS-I processors. The [Q\_PROCESSOR\_MIPS](qtglobal#Q_PROCESSOR_MIPS) macro is also defined when Q\_PROCESSOR\_MIPS\_I is defined. **See also** [QSysInfo::buildCpuArchitecture](qsysinfo#buildCpuArchitecture)(). ### Q\_PROCESSOR\_MIPS\_II Defined if the application is compiled for MIPS-II processors. The [Q\_PROCESSOR\_MIPS](qtglobal#Q_PROCESSOR_MIPS) and [Q\_PROCESSOR\_MIPS\_I](qtglobal#Q_PROCESSOR_MIPS_I) macros are also defined when Q\_PROCESSOR\_MIPS\_II is defined. **See also** [QSysInfo::buildCpuArchitecture](qsysinfo#buildCpuArchitecture)(). ### Q\_PROCESSOR\_MIPS\_III Defined if the application is compiled for MIPS-III processors. The [Q\_PROCESSOR\_MIPS](qtglobal#Q_PROCESSOR_MIPS), [Q\_PROCESSOR\_MIPS\_I](qtglobal#Q_PROCESSOR_MIPS_I), and [Q\_PROCESSOR\_MIPS\_II](qtglobal#Q_PROCESSOR_MIPS_II) macros are also defined when Q\_PROCESSOR\_MIPS\_III is defined. **See also** [QSysInfo::buildCpuArchitecture](qsysinfo#buildCpuArchitecture)(). ### Q\_PROCESSOR\_MIPS\_IV Defined if the application is compiled for MIPS-IV processors. The [Q\_PROCESSOR\_MIPS](qtglobal#Q_PROCESSOR_MIPS), [Q\_PROCESSOR\_MIPS\_I](qtglobal#Q_PROCESSOR_MIPS_I), [Q\_PROCESSOR\_MIPS\_II](qtglobal#Q_PROCESSOR_MIPS_II), and [Q\_PROCESSOR\_MIPS\_III](qtglobal#Q_PROCESSOR_MIPS_III) macros are also defined when Q\_PROCESSOR\_MIPS\_IV is defined. **See also** [QSysInfo::buildCpuArchitecture](qsysinfo#buildCpuArchitecture)(). ### Q\_PROCESSOR\_MIPS\_V Defined if the application is compiled for MIPS-V processors. The [Q\_PROCESSOR\_MIPS](qtglobal#Q_PROCESSOR_MIPS), [Q\_PROCESSOR\_MIPS\_I](qtglobal#Q_PROCESSOR_MIPS_I), [Q\_PROCESSOR\_MIPS\_II](qtglobal#Q_PROCESSOR_MIPS_II), [Q\_PROCESSOR\_MIPS\_III](qtglobal#Q_PROCESSOR_MIPS_III), and [Q\_PROCESSOR\_MIPS\_IV](qtglobal#Q_PROCESSOR_MIPS_IV) macros are also defined when Q\_PROCESSOR\_MIPS\_V is defined. **See also** [QSysInfo::buildCpuArchitecture](qsysinfo#buildCpuArchitecture)(). ### Q\_PROCESSOR\_POWER Defined if the application is compiled for POWER processors. Qt currently supports two Power variants: [Q\_PROCESSOR\_POWER\_32](qtglobal#Q_PROCESSOR_POWER_32) and [Q\_PROCESSOR\_POWER\_64](qtglobal#Q_PROCESSOR_POWER_64). **See also** [QSysInfo::buildCpuArchitecture](qsysinfo#buildCpuArchitecture)(). ### Q\_PROCESSOR\_POWER\_32 Defined if the application is compiled for 32-bit Power processors. The [Q\_PROCESSOR\_POWER](qtglobal#Q_PROCESSOR_POWER) macro is also defined when Q\_PROCESSOR\_POWER\_32 is defined. **See also** [QSysInfo::buildCpuArchitecture](qsysinfo#buildCpuArchitecture)(). ### Q\_PROCESSOR\_POWER\_64 Defined if the application is compiled for 64-bit Power processors. The [Q\_PROCESSOR\_POWER](qtglobal#Q_PROCESSOR_POWER) macro is also defined when Q\_PROCESSOR\_POWER\_64 is defined. **See also** [QSysInfo::buildCpuArchitecture](qsysinfo#buildCpuArchitecture)(). ### `[since 5.13]` Q\_PROCESSOR\_RISCV Defined if the application is compiled for RISC-V processors. Qt currently supports two RISC-V variants: [Q\_PROCESSOR\_RISCV\_32](qtglobal#Q_PROCESSOR_RISCV_32) and [Q\_PROCESSOR\_RISCV\_64](qtglobal#Q_PROCESSOR_RISCV_64). This function was introduced in Qt 5.13. **See also** [QSysInfo::buildCpuArchitecture](qsysinfo#buildCpuArchitecture)(). ### `[since 5.13]` Q\_PROCESSOR\_RISCV\_32 Defined if the application is compiled for 32-bit RISC-V processors. The [Q\_PROCESSOR\_RISCV](qtglobal#Q_PROCESSOR_RISCV) macro is also defined when Q\_PROCESSOR\_RISCV\_32 is defined. This function was introduced in Qt 5.13. **See also** [QSysInfo::buildCpuArchitecture](qsysinfo#buildCpuArchitecture)(). ### `[since 5.13]` Q\_PROCESSOR\_RISCV\_64 Defined if the application is compiled for 64-bit RISC-V processors. The [Q\_PROCESSOR\_RISCV](qtglobal#Q_PROCESSOR_RISCV) macro is also defined when Q\_PROCESSOR\_RISCV\_64 is defined. This function was introduced in Qt 5.13. **See also** [QSysInfo::buildCpuArchitecture](qsysinfo#buildCpuArchitecture)(). ### Q\_PROCESSOR\_S390\_X Defined if the application is compiled for S/390x processors. The [Q\_PROCESSOR\_S390](qtglobal#Q_PROCESSOR_S390) macro is also defined when Q\_PROCESSOR\_S390\_X is defined. **See also** [QSysInfo::buildCpuArchitecture](qsysinfo#buildCpuArchitecture)(). ### Q\_PROCESSOR\_SH Defined if the application is compiled for SuperH processors. Qt currently supports one SuperH revision: [Q\_PROCESSOR\_SH\_4A](qtglobal#Q_PROCESSOR_SH_4A). **See also** [QSysInfo::buildCpuArchitecture](qsysinfo#buildCpuArchitecture)(). ### Q\_PROCESSOR\_SH\_4A Defined if the application is compiled for SuperH 4A processors. The [Q\_PROCESSOR\_SH](qtglobal#Q_PROCESSOR_SH) macro is also defined when Q\_PROCESSOR\_SH\_4A is defined. **See also** [QSysInfo::buildCpuArchitecture](qsysinfo#buildCpuArchitecture)(). ### Q\_PROCESSOR\_SPARC Defined if the application is compiled for SPARC processors. Qt currently supports one optional SPARC revision: [Q\_PROCESSOR\_SPARC\_V9](qtglobal#Q_PROCESSOR_SPARC_V9). **See also** [QSysInfo::buildCpuArchitecture](qsysinfo#buildCpuArchitecture)(). ### Q\_PROCESSOR\_SPARC\_V9 Defined if the application is compiled for SPARC V9 processors. The [Q\_PROCESSOR\_SPARC](qtglobal#Q_PROCESSOR_SPARC) macro is also defined when Q\_PROCESSOR\_SPARC\_V9 is defined. **See also** [QSysInfo::buildCpuArchitecture](qsysinfo#buildCpuArchitecture)(). ### Q\_PROCESSOR\_X86\_32 Defined if the application is compiled for 32-bit x86 processors. This includes all i386, i486, i586, and i686 processors. The [Q\_PROCESSOR\_X86](qtglobal#Q_PROCESSOR_X86) macro is also defined when Q\_PROCESSOR\_X86\_32 is defined. **See also** [QSysInfo::buildCpuArchitecture](qsysinfo#buildCpuArchitecture)(). ### Q\_PROCESSOR\_X86\_64 Defined if the application is compiled for 64-bit x86 processors. This includes all AMD64, Intel 64, and other x86\_64/x64 processors. The [Q\_PROCESSOR\_X86](qtglobal#Q_PROCESSOR_X86) macro is also defined when Q\_PROCESSOR\_X86\_64 is defined. **See also** [QSysInfo::buildCpuArchitecture](qsysinfo#buildCpuArchitecture)(). ### [quint64](qtglobal#quint64-typedef) Q\_UINT64\_C(*literal*) Wraps the unsigned 64-bit integer *literal* in a platform-independent way. Example: ``` quint64 value = Q_UINT64_C(932838457459459); ``` **See also** [quint64](qtglobal#quint64-typedef) and [Q\_INT64\_C](qtglobal#Q_INT64_C)(). ### Q\_UNLIKELY(*expr*) Hints to the compiler that the enclosed condition, *expr*, is likely to evaluate to `false`. Use of this macro can help the compiler to optimize the code. Example: ``` bool readConfiguration(const QFile &file) { // We expect to be asked to read an existing file if (Q_UNLIKELY(!file.exists())) { qWarning() << "File not found"; return false; } ... return true; } ``` **See also** [Q\_LIKELY](qtglobal#Q_LIKELY)(). ### `[since 5.0]` void Q\_UNREACHABLE Tells the compiler that the current point cannot be reached by any execution, so it may optimize any code paths leading here as dead code, as well as code continuing from here. This macro is useful to mark impossible conditions. For example, given the following enum: ``` enum Shapes { Rectangle, Triangle, Circle, NumShapes }; ``` One can write a switch table like so: ``` switch (shape) { case Rectangle: return rectangle(); case Triangle: return triangle(); case Circle: return circle(); case NumShapes: Q_UNREACHABLE(); break; } ``` The advantage of inserting Q\_UNREACHABLE() at that point is that the compiler is told not to generate code for a shape variable containing that value. If the macro is missing, the compiler will still generate the necessary comparisons for that value. If the case label were removed, some compilers could produce a warning that some enum values were not checked. By using this macro in impossible conditions, code coverage may be improved as dead code paths may be eliminated. In debug builds the condition is enforced by an assert to facilitate debugging. This function was introduced in Qt 5.0. **See also** [Q\_ASSERT](qtglobal#Q_ASSERT)(), [Q\_ASSUME](qtglobal#Q_ASSUME)(), and [qFatal](qtglobal#qFatal)(). ### Q\_UNUSED(*name*) Indicates to the compiler that the parameter with the specified *name* is not used in the body of a function. This can be used to suppress compiler warnings while allowing functions to be defined with meaningful parameter names in their signatures. ### foreach(*variable*, *container*) This macro is used to implement Qt's `foreach` loop. The *variable* parameter is a variable name or variable definition; the *container* parameter is a Qt container whose value type corresponds to the type of the variable. See [The foreach Keyword](foreach-keyword#the-foreach-keyword) for details. If you're worried about namespace pollution, you can disable this macro by adding the following line to your `.pro` file: ``` CONFIG += no_keywords ``` **Note:** Since Qt 5.7, the use of this macro is discouraged. It will be removed in a future version of Qt. Please use C++11 range-for, possibly with [qAsConst](qtglobal#qAsConst)(), as needed. **See also** [qAsConst](qtglobal#qAsConst)(). ### forever This macro is provided for convenience for writing infinite loops. Example: ``` forever { ... } ``` It is equivalent to `for (;;)`. If you're worried about namespace pollution, you can disable this macro by adding the following line to your `.pro` file: ``` CONFIG += no_keywords ``` **See also** [Q\_FOREVER](qtglobal#Q_FOREVER). ### qCritical(const char \**message*, ...) Calls the message handler with the critical message *message*. If no message handler has been installed, the message is printed to stderr. Under Windows, the message is sent to the debugger. On QNX the message is sent to slogger2. It exits if the environment variable QT\_FATAL\_CRITICALS is not empty. This function takes a format string and a list of arguments, similar to the C printf() function. The format should be a Latin-1 string. Example: ``` void load(const QString &fileName) { QFile file(fileName); if (!file.exists()) qCritical("File '%s' does not exist!", qUtf8Printable(fileName)); } ``` If you include <QtDebug>, a more convenient syntax is also available: ``` qCritical() << "Brush:" << myQBrush << "Other value:" << i; ``` A space is inserted between the items, and a newline is appended at the end. To suppress the output at runtime, install your own message handler with [qInstallMessageHandler](qtglobal#qInstallMessageHandler)(). **Note:** This function is [thread-safe](threads-reentrancy). **See also** [qDebug](qtglobal#qDebug)(), [qInfo](qtglobal#qInfo)(), [qWarning](qtglobal#qWarning)(), [qFatal](qtglobal#qFatal)(), [qInstallMessageHandler](qtglobal#qInstallMessageHandler)(), and [Debugging Techniques](testing-and-debugging#debugging-techniques). ### qDebug(const char \**message*, ...) Calls the message handler with the debug message *message*. If no message handler has been installed, the message is printed to stderr. Under Windows the message is sent to the console, if it is a console application; otherwise, it is sent to the debugger. On QNX, the message is sent to slogger2. This function does nothing if `QT_NO_DEBUG_OUTPUT` was defined during compilation. If you pass the function a format string and a list of arguments, it works in similar way to the C printf() function. The format should be a Latin-1 string. Example: ``` qDebug("Items in list: %d", myList.size()); ``` If you include `<QtDebug>`, a more convenient syntax is also available: ``` qDebug() << "Brush:" << myQBrush << "Other value:" << i; ``` With this syntax, the function returns a [QDebug](qdebug) object that is configured to use the [QtDebugMsg](qtglobal#QtMsgType-enum) message type. It automatically puts a single space between each item, and outputs a newline at the end. It supports many C++ and Qt types. To suppress the output at run-time, install your own message handler with [qInstallMessageHandler](qtglobal#qInstallMessageHandler)(). **Note:** This function is [thread-safe](threads-reentrancy). **See also** [qInfo](qtglobal#qInfo)(), [qWarning](qtglobal#qWarning)(), [qCritical](qtglobal#qCritical)(), [qFatal](qtglobal#qFatal)(), [qInstallMessageHandler](qtglobal#qInstallMessageHandler)(), and [Debugging Techniques](testing-and-debugging#debugging-techniques). ### qFatal(const char \**message*, ...) Calls the message handler with the fatal message *message*. If no message handler has been installed, the message is printed to stderr. Under Windows, the message is sent to the debugger. On QNX the message is sent to slogger2. If you are using the **default message handler** this function will abort to create a core dump. On Windows, for debug builds, this function will report a \_CRT\_ERROR enabling you to connect a debugger to the application. This function takes a format string and a list of arguments, similar to the C printf() function. Example: ``` int divide(int a, int b) { if (b == 0) // program error qFatal("divide: cannot divide by zero"); return a / b; } ``` To suppress the output at runtime, install your own message handler with [qInstallMessageHandler](qtglobal#qInstallMessageHandler)(). **See also** [qDebug](qtglobal#qDebug)(), [qInfo](qtglobal#qInfo)(), [qWarning](qtglobal#qWarning)(), [qCritical](qtglobal#qCritical)(), [qInstallMessageHandler](qtglobal#qInstallMessageHandler)(), and [Debugging Techniques](testing-and-debugging#debugging-techniques). ### `[since 5.5]` qInfo(const char \**message*, ...) Calls the message handler with the informational message *message*. If no message handler has been installed, the message is printed to stderr. Under Windows, the message is sent to the console, if it is a console application; otherwise, it is sent to the debugger. On QNX the message is sent to slogger2. This function does nothing if `QT_NO_INFO_OUTPUT` was defined during compilation. If you pass the function a format string and a list of arguments, it works in similar way to the C printf() function. The format should be a Latin-1 string. Example: ``` qInfo("Items in list: %d", myList.size()); ``` If you include `<QtDebug>`, a more convenient syntax is also available: ``` qInfo() << "Brush:" << myQBrush << "Other value:" << i; ``` With this syntax, the function returns a [QDebug](qdebug) object that is configured to use the [QtInfoMsg](qtglobal#QtMsgType-enum) message type. It automatically puts a single space between each item, and outputs a newline at the end. It supports many C++ and Qt types. To suppress the output at run-time, install your own message handler with [qInstallMessageHandler](qtglobal#qInstallMessageHandler)(). **Note:** This function is [thread-safe](threads-reentrancy). This function was introduced in Qt 5.5. **See also** [qDebug](qtglobal#qDebug)(), [qWarning](qtglobal#qWarning)(), [qCritical](qtglobal#qCritical)(), [qFatal](qtglobal#qFatal)(), [qInstallMessageHandler](qtglobal#qInstallMessageHandler)(), and [Debugging Techniques](testing-and-debugging#debugging-techniques). ### const char \*qPrintable(const [QString](qstring) &*str*) Returns *str* as a `const char *`. This is equivalent to *str*.toLocal8Bit().constData(). The char pointer will be invalid after the statement in which qPrintable() is used. This is because the array returned by [QString::toLocal8Bit](qstring#toLocal8Bit)() will fall out of scope. **Note:** [qDebug](qtglobal#qDebug)(), [qInfo](qtglobal#qInfo)(), [qWarning](qtglobal#qWarning)(), [qCritical](qtglobal#qCritical)(), [qFatal](qtglobal#qFatal)() expect %s arguments to be UTF-8 encoded, while qPrintable() converts to local 8-bit encoding. Therefore [qUtf8Printable](qtglobal#qUtf8Printable)() should be used for logging strings instead of qPrintable(). **See also** [qUtf8Printable](qtglobal#qUtf8Printable)(). ### `[since 5.7]` const wchar\_t \*qUtf16Printable(const [QString](qstring) &*str*) Returns *str* as a `const ushort *`, but cast to a `const wchar_t *` to avoid warnings. This is equivalent to *str*.utf16() plus some casting. The only useful thing you can do with the return value of this macro is to pass it to [QString::asprintf](qstring#asprintf)() for use in a `%ls` conversion. In particular, the return value is *not* a valid `const wchar_t*`! In general, the pointer will be invalid after the statement in which qUtf16Printable() is used. This is because the pointer may have been obtained from a temporary expression, which will fall out of scope. Example: ``` qWarning("%ls: %ls", qUtf16Printable(key), qUtf16Printable(value)); ``` This function was introduced in Qt 5.7. **See also** [qPrintable](qtglobal#qPrintable)(), [qDebug](qtglobal#qDebug)(), [qInfo](qtglobal#qInfo)(), [qWarning](qtglobal#qWarning)(), [qCritical](qtglobal#qCritical)(), and [qFatal](qtglobal#qFatal)(). ### `[since 5.4]` const char \*qUtf8Printable(const [QString](qstring) &*str*) Returns *str* as a `const char *`. This is equivalent to *str*.toUtf8().constData(). The char pointer will be invalid after the statement in which qUtf8Printable() is used. This is because the array returned by [QString::toUtf8](qstring#toUtf8)() will fall out of scope. Example: ``` qWarning("%s: %s", qUtf8Printable(key), qUtf8Printable(value)); ``` This function was introduced in Qt 5.4. **See also** [qPrintable](qtglobal#qPrintable)(), [qDebug](qtglobal#qDebug)(), [qInfo](qtglobal#qInfo)(), [qWarning](qtglobal#qWarning)(), [qCritical](qtglobal#qCritical)(), and [qFatal](qtglobal#qFatal)(). ### qWarning(const char \**message*, ...) Calls the message handler with the warning message *message*. If no message handler has been installed, the message is printed to stderr. Under Windows, the message is sent to the debugger. On QNX the message is sent to slogger2. This function does nothing if `QT_NO_WARNING_OUTPUT` was defined during compilation; it exits if at the nth warning corresponding to the counter in environment variable `QT_FATAL_WARNINGS`. That is, if the environment variable contains the value 1, it will exit on the 1st message; if it contains the value 10, it will exit on the 10th message. Any non-numeric value is equivalent to 1. This function takes a format string and a list of arguments, similar to the C printf() function. The format should be a Latin-1 string. Example: ``` void f(int c) { if (c > 200) qWarning("f: bad argument, c == %d", c); } ``` If you include <QtDebug>, a more convenient syntax is also available: ``` qWarning() << "Brush:" << myQBrush << "Other value:" << i; ``` This syntax inserts a space between each item, and appends a newline at the end. To suppress the output at runtime, install your own message handler with [qInstallMessageHandler](qtglobal#qInstallMessageHandler)(). **Note:** This function is [thread-safe](threads-reentrancy). **See also** [qDebug](qtglobal#qDebug)(), [qInfo](qtglobal#qInfo)(), [qCritical](qtglobal#qCritical)(), [qFatal](qtglobal#qFatal)(), [qInstallMessageHandler](qtglobal#qInstallMessageHandler)(), and [Debugging Techniques](testing-and-debugging#debugging-techniques).
programming_docs
qt QGraphicsEffect Class QGraphicsEffect Class ===================== The QGraphicsEffect class is the base class for all graphics effects. [More...](#details) | | | | --- | --- | | Header: | #include <QGraphicsEffect> | | CMake: | find\_package(Qt6 COMPONENTS Widgets REQUIRED) target\_link\_libraries(mytarget PRIVATE Qt6::Widgets) | | qmake: | QT += widgets | | Inherits: | [QObject](qobject) | | Inherited By: | [QGraphicsBlurEffect](qgraphicsblureffect), [QGraphicsColorizeEffect](qgraphicscolorizeeffect), [QGraphicsDropShadowEffect](qgraphicsdropshadoweffect), and [QGraphicsOpacityEffect](qgraphicsopacityeffect) | * [List of all members, including inherited members](https://doc.qt.io/qt-6.2/qgraphicseffect-members.html) Public Types ------------ | | | | --- | --- | | enum | **[ChangeFlag](qgraphicseffect#ChangeFlag-enum)** { SourceAttached, SourceDetached, SourceBoundingRectChanged, SourceInvalidated } | | flags | **[ChangeFlags](qgraphicseffect#ChangeFlag-enum)** | | enum | **[PixmapPadMode](qgraphicseffect#PixmapPadMode-enum)** { NoPad, PadToTransparentBorder, PadToEffectiveBoundingRect } | Properties ---------- * **[enabled](qgraphicseffect#enabled-prop)** : bool Public Functions ---------------- | | | | --- | --- | | | **[QGraphicsEffect](qgraphicseffect#QGraphicsEffect)**(QObject \**parent* = nullptr) | | virtual | **[~QGraphicsEffect](qgraphicseffect#dtor.QGraphicsEffect)**() | | QRectF | **[boundingRect](qgraphicseffect#boundingRect)**() const | | virtual QRectF | **[boundingRectFor](qgraphicseffect#boundingRectFor)**(const QRectF &*rect*) const | | bool | **[isEnabled](qgraphicseffect#enabled-prop)**() const | Public Slots ------------ | | | | --- | --- | | void | **[setEnabled](qgraphicseffect#enabled-prop)**(bool *enable*) | | void | **[update](qgraphicseffect#update)**() | Signals ------- | | | | --- | --- | | void | **[enabledChanged](qgraphicseffect#enabledChanged)**(bool *enabled*) | Protected Functions ------------------- | | | | --- | --- | | virtual void | **[draw](qgraphicseffect#draw)**(QPainter \**painter*) = 0 | | void | **[drawSource](qgraphicseffect#drawSource)**(QPainter \**painter*) | | QRectF | **[sourceBoundingRect](qgraphicseffect#sourceBoundingRect)**(Qt::CoordinateSystem *system* = Qt::LogicalCoordinates) const | | virtual void | **[sourceChanged](qgraphicseffect#sourceChanged)**(QGraphicsEffect::ChangeFlags *flags*) | | bool | **[sourceIsPixmap](qgraphicseffect#sourceIsPixmap)**() const | | QPixmap | **[sourcePixmap](qgraphicseffect#sourcePixmap)**(Qt::CoordinateSystem *system* = Qt::LogicalCoordinates, QPoint \**offset* = nullptr, QGraphicsEffect::PixmapPadMode *mode* = PadToEffectiveBoundingRect) const | | void | **[updateBoundingRect](qgraphicseffect#updateBoundingRect)**() | Detailed Description -------------------- Effects alter the appearance of elements by hooking into the rendering pipeline and operating between the source (e.g., a [QGraphicsPixmapItem](qgraphicspixmapitem)) and the destination device (e.g., [QGraphicsView](qgraphicsview)'s viewport). Effects can be disabled by calling [setEnabled](qgraphicseffect#enabled-prop)(false). If effects are disabled, the source is rendered directly. To add a visual effect to a [QGraphicsItem](qgraphicsitem), for example, you can use one of the standard effects, or alternately, create your own effect by creating a subclass of QGraphicsEffect. The effect can then be installed on the item using [QGraphicsItem::setGraphicsEffect](qgraphicsitem#setGraphicsEffect)(). Qt provides the following standard effects: * [QGraphicsBlurEffect](qgraphicsblureffect) - blurs the item by a given radius * [QGraphicsDropShadowEffect](qgraphicsdropshadoweffect) - renders a dropshadow behind the item * [QGraphicsColorizeEffect](qgraphicscolorizeeffect) - renders the item in shades of any given color * [QGraphicsOpacityEffect](qgraphicsopacityeffect) - renders the item with an opacity | | | --- | | | | | | | | | For more information on how to use each effect, refer to the specific effect's documentation. To create your own custom effect, create a subclass of QGraphicsEffect (or any other existing effects) and reimplement the virtual function [draw](qgraphicseffect#draw)(). This function is called whenever the effect needs to redraw. The [draw](qgraphicseffect#draw)() function takes the painter with which to draw as an argument. For more information, refer to the documentation for [draw](qgraphicseffect#draw)(). In the [draw](qgraphicseffect#draw)() function you can call [sourcePixmap](qgraphicseffect#sourcePixmap)() to get a pixmap of the graphics effect source which you can then process. If your effect changes, use [update](qgraphicseffect#update)() to request for a redraw. If your custom effect changes the bounding rectangle of the source, e.g., a radial glow effect may need to apply an extra margin, you can reimplement the virtual [boundingRectFor](qgraphicseffect#boundingRectFor)() function, and call [updateBoundingRect](qgraphicseffect#updateBoundingRect)() to notify the framework whenever this rectangle changes. The virtual [sourceChanged](qgraphicseffect#sourceChanged)() function is called to notify the effects that the source has changed in some way - e.g., if the source is a [QGraphicsRectItem](qgraphicsrectitem) and its rectangle parameters have changed. **See also** [QGraphicsItem::setGraphicsEffect](qgraphicsitem#setGraphicsEffect)() and [QWidget::setGraphicsEffect](qwidget#setGraphicsEffect)(). Member Type Documentation ------------------------- ### enum QGraphicsEffect::ChangeFlagflags QGraphicsEffect::ChangeFlags This enum describes what has changed in QGraphicsEffectSource. | Constant | Value | Description | | --- | --- | --- | | `QGraphicsEffect::SourceAttached` | `0x1` | The effect is installed on a source. | | `QGraphicsEffect::SourceDetached` | `0x2` | The effect is uninstalled on a source. | | `QGraphicsEffect::SourceBoundingRectChanged` | `0x4` | The bounding rect of the source has changed. | | `QGraphicsEffect::SourceInvalidated` | `0x8` | The visual appearance of the source has changed. | The ChangeFlags type is a typedef for [QFlags](qflags)<ChangeFlag>. It stores an OR combination of ChangeFlag values. ### enum QGraphicsEffect::PixmapPadMode This enum describes how the pixmap returned from [sourcePixmap](qgraphicseffect#sourcePixmap) should be padded. | Constant | Value | Description | | --- | --- | --- | | `QGraphicsEffect::NoPad` | `0` | The pixmap should not receive any additional padding. | | `QGraphicsEffect::PadToTransparentBorder` | `1` | The pixmap should be padded to ensure it has a completely transparent border. | | `QGraphicsEffect::PadToEffectiveBoundingRect` | `2` | The pixmap should be padded to match the effective bounding rectangle of the effect. | Property Documentation ---------------------- ### enabled : bool This property holds whether the effect is enabled or not. If an effect is disabled, the source will be rendered with as normal, with no interference from the effect. If the effect is enabled, the source will be rendered with the effect applied. This property is enabled by default. Using this property, you can disable certain effects on slow platforms, in order to ensure that the user interface is responsive. **Access functions:** | | | | --- | --- | | bool | **isEnabled**() const | | void | **setEnabled**(bool *enable*) | **Notifier signal:** | | | | --- | --- | | void | **[enabledChanged](qgraphicseffect#enabledChanged)**(bool *enabled*) | Member Function Documentation ----------------------------- ### QGraphicsEffect::QGraphicsEffect([QObject](qobject#QObject) \**parent* = nullptr) Constructs a new QGraphicsEffect instance having the specified *parent*. ### `[signal]` void QGraphicsEffect::enabledChanged(bool *enabled*) This signal is emitted whenever the effect is enabled or disabled. The *enabled* parameter holds the effects's new enabled state. **Note:** Notifier signal for property [enabled](qgraphicseffect#enabled-prop). **See also** [isEnabled](qgraphicseffect#enabled-prop)(). ### `[slot]` void QGraphicsEffect::update() Schedules a redraw of the effect. Call this function whenever the effect needs to be redrawn. This function does not trigger a redraw of the source. **See also** [updateBoundingRect](qgraphicseffect#updateBoundingRect)(). ### `[virtual]` QGraphicsEffect::~QGraphicsEffect() Removes the effect from the source, and destroys the graphics effect. ### [QRectF](qrectf) QGraphicsEffect::boundingRect() const Returns the effective bounding rectangle for this effect, i.e., the bounding rectangle of the source in device coordinates, adjusted by any margins applied by the effect itself. **See also** [boundingRectFor](qgraphicseffect#boundingRectFor)() and [updateBoundingRect](qgraphicseffect#updateBoundingRect)(). ### `[virtual]` [QRectF](qrectf) QGraphicsEffect::boundingRectFor(const [QRectF](qrectf) &*rect*) const Returns the effective bounding rectangle for this effect, given the provided *rect* in the device coordinates. When writing you own custom effect, you must call [updateBoundingRect](qgraphicseffect#updateBoundingRect)() whenever any parameters are changed that may cause this this function to return a different value. **See also** [sourceBoundingRect](qgraphicseffect#sourceBoundingRect)(). ### `[pure virtual protected]` void QGraphicsEffect::draw([QPainter](qpainter) \**painter*) This pure virtual function draws the effect and is called whenever the source needs to be drawn. Reimplement this function in a [QGraphicsEffect](qgraphicseffect) subclass to provide the effect's drawing implementation, using *painter*. For example: ``` MyGraphicsEffect::draw(QPainter *painter) { ... QPoint offset; if (sourceIsPixmap()) { // No point in drawing in device coordinates (pixmap will be scaled anyways). const QPixmap pixmap = sourcePixmap(Qt::LogicalCoordinates, &offset); ... painter->drawPixmap(offset, pixmap); } else { // Draw pixmap in device coordinates to avoid pixmap scaling; const QPixmap pixmap = sourcePixmap(Qt::DeviceCoordinates, &offset); painter->setWorldTransform(QTransform()); ... painter->drawPixmap(offset, pixmap); } ... } ``` This function should not be called explicitly by the user, since it is meant for reimplementation purposes only. ### `[protected]` void QGraphicsEffect::drawSource([QPainter](qpainter) \**painter*) Draws the source directly using the given *painter*. This function should only be called from [QGraphicsEffect::draw](qgraphicseffect#draw)(). For example: ``` MyGraphicsOpacityEffect::draw(QPainter *painter) { // Fully opaque; draw directly without going through a pixmap. if (qFuzzyCompare(m_opacity, 1)) { drawSource(painter); return; } ... } ``` **See also** [QGraphicsEffect::draw](qgraphicseffect#draw)(). ### `[protected]` [QRectF](qrectf) QGraphicsEffect::sourceBoundingRect([Qt::CoordinateSystem](qt#CoordinateSystem-enum) *system* = Qt::LogicalCoordinates) const Returns the bounding rectangle of the source mapped to the given *system*. Calling this function with [Qt::DeviceCoordinates](qt#CoordinateSystem-enum) outside of [QGraphicsEffect::draw](qgraphicseffect#draw)() will give undefined results, as there is no device context available. **See also** [draw](qgraphicseffect#draw)(). ### `[virtual protected]` void QGraphicsEffect::sourceChanged([QGraphicsEffect::ChangeFlags](qgraphicseffect#ChangeFlag-enum) *flags*) This virtual function is called by [QGraphicsEffect](qgraphicseffect) to notify the effect that the source has changed. If the effect applies any cache, then this cache must be purged in order to reflect the new appearance of the source. The *flags* describes what has changed. ### `[protected]` bool QGraphicsEffect::sourceIsPixmap() const Returns `true` if the source effectively is a pixmap, e.g., a [QGraphicsPixmapItem](qgraphicspixmapitem). This function is useful for optimization purposes. For instance, there's no point in drawing the source in device coordinates to avoid pixmap scaling if this function returns `true` - the source pixmap will be scaled anyways. ### `[protected]` [QPixmap](qpixmap) QGraphicsEffect::sourcePixmap([Qt::CoordinateSystem](qt#CoordinateSystem-enum) *system* = Qt::LogicalCoordinates, [QPoint](qpoint) \**offset* = nullptr, [QGraphicsEffect::PixmapPadMode](qgraphicseffect#PixmapPadMode-enum) *mode* = PadToEffectiveBoundingRect) const Returns a pixmap with the source painted into it. The *system* specifies which coordinate system to be used for the source. The optional *offset* parameter returns the offset where the pixmap should be painted at using the current painter. For control on how the pixmap is padded use the *mode* parameter. The returned pixmap is clipped to the current painter's device rectangle when *system* is [Qt::DeviceCoordinates](qt#CoordinateSystem-enum). Calling this function with [Qt::DeviceCoordinates](qt#CoordinateSystem-enum) outside of [QGraphicsEffect::draw](qgraphicseffect#draw)() will give undefined results, as there is no device context available. **See also** [draw](qgraphicseffect#draw)() and [boundingRect](qgraphicseffect#boundingRect)(). ### `[protected]` void QGraphicsEffect::updateBoundingRect() This function notifies the effect framework when the effect's bounding rectangle has changed. As a custom effect author, you must call this function whenever you change any parameters that will cause the virtual [boundingRectFor](qgraphicseffect#boundingRectFor)() function to return a different value. This function will call [update](qgraphicseffect#update)() if this is necessary. **See also** [boundingRectFor](qgraphicseffect#boundingRectFor)(), [boundingRect](qgraphicseffect#boundingRect)(), and [sourceBoundingRect](qgraphicseffect#sourceBoundingRect)(). qt ToolBar QML Type ToolBar QML Type ================ Container for context-sensitive controls. [More...](#details) | | | | --- | --- | | Import Statement: | import QtQuick.Controls | | Since: | Qt 5.7 | | Inherits: | [Pane](qml-qtquick-controls2-pane) | * [List of all members, including inherited members](https://doc.qt.io/qt-6.2/qml-qtquick-controls2-toolbar-members.html) Properties ---------- * **[position](qml-qtquick-controls2-toolbar#position-prop)** : enumeration Detailed Description -------------------- ToolBar is a container of application-wide and context sensitive actions and controls, such as navigation buttons and search fields. ToolBar is commonly used as a [header](qml-qtquick-controls2-applicationwindow#header-attached-prop) or a [footer](qml-qtquick-controls2-applicationwindow#footer-attached-prop) of an [ApplicationWindow](qtquickcontrols-changes-qt6#applicationwindow). ToolBar does not provide a layout of its own, but requires you to position its contents, for instance by creating a [RowLayout](qml-qtquick-layouts-rowlayout). If only a single item is used within the ToolBar, it will resize to fit the implicit size of its contained item. This makes it particularly suitable for use together with layouts. ``` ApplicationWindow { visible:true header: ToolBar { RowLayout { anchors.fill: parent ToolButton { text: qsTr("‹") onClicked: stack.pop() } Label { text: "Title" elide: Label.ElideRight horizontalAlignment: Qt.AlignHCenter verticalAlignment: Qt.AlignVCenter Layout.fillWidth: true } ToolButton { text: qsTr("⋮") onClicked: menu.open() } } } StackView { id: stack anchors.fill: parent } } ``` **See also** [ApplicationWindow](qtquickcontrols-changes-qt6#applicationwindow), [ToolButton](qml-qtquick-controls2-toolbutton), [Customizing ToolBar](qtquickcontrols2-customize#customizing-toolbar), and [Container Controls](qtquickcontrols2-containers). Property Documentation ---------------------- ### position : [enumeration](qml-enumeration) This property holds the position of the toolbar. **Note:** If the toolbar is assigned as a header or footer of [ApplicationWindow](qtquickcontrols-changes-qt6#applicationwindow) or [Page](qml-qtquick-controls2-page), the appropriate position is set automatically. Possible values: | Constant | Description | | --- | --- | | `ToolBar.Header` | The toolbar is at the top, as a window or page header. | | `ToolBar.Footer` | The toolbar is at the bottom, as a window or page footer. | The default value is style-specific. **See also** [ApplicationWindow::header](qml-qtquick-controls2-applicationwindow#header-attached-prop), [ApplicationWindow::footer](qml-qtquick-controls2-applicationwindow#footer-attached-prop), [Page::header](qml-qtquick-controls2-page#header-prop), and [Page::footer](qml-qtquick-controls2-page#footer-prop). qt QRayCaster Class QRayCaster Class ================ class [Qt3DRender](https://doc.qt.io/qt-6.2/qt3drender-module.html)::QRayCaster [Qt3DRender::QRayCaster](qt3drender-qraycaster) is used to perform ray casting tests in 3d world coordinates. [More...](#details) | | | | --- | --- | | Header: | #include <QRayCaster> | | CMake: | find\_package(Qt6 COMPONENTS 3drender REQUIRED) target\_link\_libraries(mytarget PRIVATE Qt6::3drender) | | qmake: | QT += 3drender | | Since: | Qt 5.11 | | Instantiated By: | [RayCaster](qml-qt3d-render-raycaster) | | Inherits: | [Qt3DRender::QAbstractRayCaster](qt3drender-qabstractraycaster) | * [List of all members, including inherited members](https://doc.qt.io/qt-6.2/qt3drender-qraycaster-members.html) Properties ---------- * **[direction](qt3drender-qraycaster#direction-prop)** : QVector3D * **[length](qt3drender-qraycaster#length-prop)** : float * **[origin](qt3drender-qraycaster#origin-prop)** : QVector3D Public Functions ---------------- | | | | --- | --- | | QVector3D | **[direction](qt3drender-qraycaster#direction-prop)**() const | | float | **[length](qt3drender-qraycaster#length-prop)**() const | | QVector3D | **[origin](qt3drender-qraycaster#origin-prop)**() const | Public Slots ------------ | | | | --- | --- | | void | **[setDirection](qt3drender-qraycaster#direction-prop)**(const QVector3D &*direction*) | | void | **[setLength](qt3drender-qraycaster#setLength)**(float *length*) | | void | **[setOrigin](qt3drender-qraycaster#origin-prop)**(const QVector3D &*origin*) | | void | **[trigger](qt3drender-qraycaster#trigger-1)**(const QVector3D &*origin*, const QVector3D &*direction*, float *length*) | | void | **[trigger](qt3drender-qraycaster#trigger)**() | Signals ------- | | | | --- | --- | | void | **[directionChanged](qt3drender-qraycaster#direction-prop)**(const QVector3D &*direction*) | | void | **[lengthChanged](qt3drender-qraycaster#length-prop)**(float *length*) | | void | **[originChanged](qt3drender-qraycaster#origin-prop)**(const QVector3D &*origin*) | Detailed Description -------------------- The 3d ray is defined by its origin, direction and length. It will be affected by the transformations applied to the entity it belongs to. Ray casting tests will be performed every frame as long as the component is enabled. The hits property will be updated with the list of intersections. **See also** [QAbstractRayCaster](qt3drender-qabstractraycaster), [QScreenRayCaster](qt3drender-qscreenraycaster), and [QNoPicking](qt3drender-qnopicking). Property Documentation ---------------------- ### direction : [QVector3D](qvector3d) Holds the direction of the 3D ray. This should be a unit vector. **Access functions:** | | | | --- | --- | | QVector3D | **direction**() const | | void | **setDirection**(const QVector3D &*direction*) | **Notifier signal:** | | | | --- | --- | | void | **directionChanged**(const QVector3D &*direction*) | ### length : float Holds the length of the 3D ray. **Access functions:** | | | | --- | --- | | float | **length**() const | | void | **[setLength](qt3drender-qraycaster#setLength)**(float *length*) | **Notifier signal:** | | | | --- | --- | | void | **lengthChanged**(float *length*) | ### origin : [QVector3D](qvector3d) Holds the origin of the 3D ray in local coordinates. **Access functions:** | | | | --- | --- | | QVector3D | **origin**() const | | void | **setOrigin**(const QVector3D &*origin*) | **Notifier signal:** | | | | --- | --- | | void | **originChanged**(const QVector3D &*origin*) | Member Function Documentation ----------------------------- ### `[slot]` void QRayCaster::setLength(float *length*) Sets the length of the ray to *length*. If the value is less than or equal to zero, the ray is concidered to be infinite. **Note:** Setter function for property [length](qt3drender-qraycaster#length-prop). **See also** [length](qt3drender-qraycaster#length-prop)(). ### `[slot]` void QRayCaster::trigger(const [QVector3D](qvector3d) &*origin*, const [QVector3D](qvector3d) &*direction*, float *length*) Convenience method to set the ray details *origin*, *direction*, and *length*, and enable the component to trigger tests. ### `[slot]` void QRayCaster::trigger() Convenience method to enable the component and trigger tests using the current ray.
programming_docs
qt QTapGesture Class QTapGesture Class ================= The QTapGesture class describes a tap gesture made by the user. [More...](#details) | | | | --- | --- | | Header: | #include <QTapGesture> | | CMake: | find\_package(Qt6 COMPONENTS Widgets REQUIRED) target\_link\_libraries(mytarget PRIVATE Qt6::Widgets) | | qmake: | QT += widgets | | Inherits: | [QGesture](qgesture) | * [List of all members, including inherited members](https://doc.qt.io/qt-6.2/qtapgesture-members.html) Properties ---------- * **[position](qtapgesture#position-prop)** : QPointF Public Functions ---------------- | | | | --- | --- | | virtual | **[~QTapGesture](qtapgesture#dtor.QTapGesture)**() | | QPointF | **[position](qtapgesture#position-prop)**() const | | void | **[setPosition](qtapgesture#position-prop)**(const QPointF &*pos*) | Detailed Description -------------------- For an overview of gesture handling in Qt and information on using gestures in your applications, see the [Gestures in Widgets and Graphics View](https://doc.qt.io/qt-6.2/gestures-overview.html) document. **See also** [QPanGesture](qpangesture) and [QPinchGesture](qpinchgesture). Property Documentation ---------------------- ### position : [QPointF](qpointf) This property holds the position of the tap **Access functions:** | | | | --- | --- | | QPointF | **position**() const | | void | **setPosition**(const QPointF &*pos*) | Member Function Documentation ----------------------------- ### `[virtual]` QTapGesture::~QTapGesture() Destructor. qt TextArea QML Type TextArea QML Type ================= Multi-line text input area. [More...](#details) | | | | --- | --- | | Import Statement: | import QtQuick.Controls | | Since: | Qt 5.7 | | Inherits: | [TextEdit](qml-qtquick-textedit) | * [List of all members, including inherited members](https://doc.qt.io/qt-6.2/qml-qtquick-controls2-textarea-members.html) Properties ---------- * **[background](qml-qtquick-controls2-textarea#background-prop)** : Item * **[bottomInset](qml-qtquick-controls2-textarea#bottomInset-prop)** : real * **[focusReason](qml-qtquick-controls2-textarea#focusReason-prop)** : enumeration * **[hoverEnabled](qml-qtquick-controls2-textarea#hoverEnabled-prop)** : bool * **[hovered](qml-qtquick-controls2-textarea#hovered-prop)** : bool * **[implicitBackgroundHeight](qml-qtquick-controls2-textarea#implicitBackgroundHeight-prop)** : real * **[implicitBackgroundWidth](qml-qtquick-controls2-textarea#implicitBackgroundWidth-prop)** : real * **[leftInset](qml-qtquick-controls2-textarea#leftInset-prop)** : real * **[placeholderText](qml-qtquick-controls2-textarea#placeholderText-prop)** : string * **[placeholderTextColor](qml-qtquick-controls2-textarea#placeholderTextColor-prop)** : color * **[rightInset](qml-qtquick-controls2-textarea#rightInset-prop)** : real * **[topInset](qml-qtquick-controls2-textarea#topInset-prop)** : real Attached Properties ------------------- * **[flickable](qml-qtquick-controls2-textarea#flickable-attached-prop)** : TextArea Signals ------- * **[pressAndHold](qml-qtquick-controls2-textarea#pressAndHold-signal)**(MouseEvent *event*) * **[pressed](qml-qtquick-controls2-textarea#pressed-signal)**(MouseEvent *event*) * **[released](qml-qtquick-controls2-textarea#released-signal)**(MouseEvent *event*) Detailed Description -------------------- TextArea is a multi-line text editor. TextArea extends [TextEdit](qml-qtquick-textedit) with a [placeholder text](qml-qtquick-controls2-textarea#placeholderText-prop) functionality, and adds decoration. ``` TextArea { placeholderText: qsTr("Enter description") } ``` TextArea is not scrollable by itself. Especially on screen-size constrained platforms, it is often preferable to make entire application pages scrollable. On such a scrollable page, a non-scrollable TextArea might behave better than nested scrollable controls. Notice, however, that in such a scenario, the background decoration of the TextArea scrolls together with the rest of the scrollable content. ### Scrollable TextArea If you want to make a TextArea scrollable, for example, when it covers an entire application page, it can be placed inside a [ScrollView](qml-qtquick-controls2-scrollview). ``` ScrollView { id: view anchors.fill: parent TextArea { text: "TextArea\n...\n...\n...\n...\n...\n...\n" } } ``` A TextArea that is placed inside a [ScrollView](qml-qtquick-controls2-scrollview) does the following: * Sets the content size automatically * Ensures that the background decoration stays in place * Clips the content ### Tab Focus By default, pressing the tab key while TextArea has [active focus](qml-qtquick-item#activeFocus-prop) results in a tab character being input into the control itself. To make tab pass active focus onto another item, use the attached [KeyNavigation](qml-qtquick-keynavigation) properties: ``` TextField { id: textField } TextArea { KeyNavigation.priority: KeyNavigation.BeforeItem KeyNavigation.tab: textField } ``` **See also** [TextField](qml-qtquick-controls2-textfield), [Customizing TextArea](qtquickcontrols2-customize#customizing-textarea), and [Input Controls](qtquickcontrols2-input). Property Documentation ---------------------- ### background : [Item](qml-qtquick-item) This property holds the background item. **Note:** If the background item has no explicit size specified, it automatically follows the control's size. In most cases, there is no need to specify width or height for a background item. **Note:** Most controls use the implicit size of the background item to calculate the implicit size of the control itself. If you replace the background item with a custom one, you should also consider providing a sensible implicit size for it (unless it is an item like [Image](qml-qtquick-image) which has its own implicit size). **See also** [Customizing TextArea](qtquickcontrols2-customize#customizing-textarea). ### [since QtQuick.Controls 2.5 (Qt 5.12)] bottomInset : [real](qml-real) This property holds the bottom inset for the background. This property was introduced in QtQuick.Controls 2.5 (Qt 5.12). **See also** [Control Layout](qml-qtquick-controls2-control#control-layout) and [topInset](qml-qtquick-controls2-textarea#topInset-prop). ### focusReason : [enumeration](qml-enumeration) This property holds the reason of the last focus change. **Note:** This property does not indicate whether the control has [active focus](qml-qtquick-item#activeFocus-prop), but the reason why the control either gained or lost focus. | Constant | Description | | --- | --- | | `Qt.MouseFocusReason` | A mouse action occurred. | | `Qt.TabFocusReason` | The Tab key was pressed. | | `Qt.BacktabFocusReason` | A Backtab occurred. The input for this may include the Shift or Control keys; e.g. Shift+Tab. | | `Qt.ActiveWindowFocusReason` | The window system made this window either active or inactive. | | `Qt.PopupFocusReason` | The application opened/closed a pop-up that grabbed/released the keyboard focus. | | `Qt.ShortcutFocusReason` | The user typed a label's buddy shortcut | | `Qt.MenuBarFocusReason` | The menu bar took focus. | | `Qt.OtherFocusReason` | Another reason, usually application-specific. | **See also** [Item::activeFocus](qml-qtquick-item#activeFocus-prop). ### [since QtQuick.Controls 2.1 (Qt 5.8)] hoverEnabled : [bool](qml-bool) This property determines whether the text area accepts hover events. The default value is `true`. This property was introduced in QtQuick.Controls 2.1 (Qt 5.8). **See also** [hovered](qml-qtquick-controls2-textarea#hovered-prop). ### [read-only, since QtQuick.Controls 2.1 (Qt 5.8)] hovered : [bool](qml-bool) This property holds whether the text area is hovered. This property was introduced in QtQuick.Controls 2.1 (Qt 5.8). **See also** [hoverEnabled](qml-qtquick-controls2-textarea#hoverEnabled-prop). ### [read-only, since QtQuick.Controls 2.5 (Qt 5.12)] implicitBackgroundHeight : [real](qml-real) This property holds the implicit background height. The value is equal to `background ? background.implicitHeight : 0`. This property was introduced in QtQuick.Controls 2.5 (Qt 5.12). **See also** [implicitBackgroundWidth](qml-qtquick-controls2-textarea#implicitBackgroundWidth-prop). ### [read-only, since QtQuick.Controls 2.5 (Qt 5.12)] implicitBackgroundWidth : [real](qml-real) This property holds the implicit background width. The value is equal to `background ? background.implicitWidth : 0`. This property was introduced in QtQuick.Controls 2.5 (Qt 5.12). **See also** [implicitBackgroundHeight](qml-qtquick-controls2-textarea#implicitBackgroundHeight-prop). ### [since QtQuick.Controls 2.5 (Qt 5.12)] leftInset : [real](qml-real) This property holds the left inset for the background. This property was introduced in QtQuick.Controls 2.5 (Qt 5.12). **See also** [Control Layout](qml-qtquick-controls2-control#control-layout) and [rightInset](qml-qtquick-controls2-textarea#rightInset-prop). ### placeholderText : [string](qml-string) This property holds the short hint that is displayed in the text area before the user enters a value. ### [since QtQuick.Controls 2.5 (Qt 5.12)] placeholderTextColor : [color](qml-color) This property holds the color of [placeholderText](qml-qtquick-controls2-textarea#placeholderText-prop). This property was introduced in QtQuick.Controls 2.5 (Qt 5.12). **See also** [placeholderText](qml-qtquick-controls2-textarea#placeholderText-prop). ### [since QtQuick.Controls 2.5 (Qt 5.12)] rightInset : [real](qml-real) This property holds the right inset for the background. This property was introduced in QtQuick.Controls 2.5 (Qt 5.12). **See also** [Control Layout](qml-qtquick-controls2-control#control-layout) and [leftInset](qml-qtquick-controls2-textarea#leftInset-prop). ### [since QtQuick.Controls 2.5 (Qt 5.12)] topInset : [real](qml-real) This property holds the top inset for the background. This property was introduced in QtQuick.Controls 2.5 (Qt 5.12). **See also** [Control Layout](qml-qtquick-controls2-control#control-layout) and [bottomInset](qml-qtquick-controls2-textarea#bottomInset-prop). Attached Property Documentation ------------------------------- ### TextArea.flickable : [TextArea](qml-qtquick-controls2-textarea) This property attaches a text area to a [Flickable](qml-qtquick-flickable). **See also** [ScrollBar](qml-qtquick-controls2-scrollbar), [ScrollIndicator](qml-qtquick-controls2-scrollindicator), and [Scrollable TextArea](qml-qtquick-controls2-textarea#scrollable-textarea). Signal Documentation -------------------- ### pressAndHold([MouseEvent](qml-qtquick-mouseevent) *event*) This signal is emitted when there is a long press (the delay depends on the platform plugin). The *event* parameter provides information about the press, including the x and y coordinates of the press, and which button is pressed. **Note:** The corresponding handler is `onPressAndHold`. **See also** [pressed](qml-qtquick-controls2-textarea#pressed-signal) and [released](qml-qtquick-controls2-textarea#released-signal). ### `[since QtQuick.Controls 2.1 (Qt 5.8)]` pressed([MouseEvent](qml-qtquick-mouseevent) *event*) This signal is emitted when the text area is pressed by the user. The *event* parameter provides information about the press, including the x and y coordinates of the press, and which button is pressed. **Note:** The corresponding handler is `onPressed`. This signal was introduced in QtQuick.Controls 2.1 (Qt 5.8). **See also** [released](qml-qtquick-controls2-textarea#released-signal) and [pressAndHold](qml-qtquick-controls2-textarea#pressAndHold-signal). ### `[since QtQuick.Controls 2.1 (Qt 5.8)]` released([MouseEvent](qml-qtquick-mouseevent) *event*) This signal is emitted when the text area is released by the user. The *event* parameter provides information about the release, including the x and y coordinates of the press, and which button is pressed. **Note:** The corresponding handler is `onReleased`. This signal was introduced in QtQuick.Controls 2.1 (Qt 5.8). **See also** [pressed](qml-qtquick-controls2-textarea#pressed-signal) and [pressAndHold](qml-qtquick-controls2-textarea#pressAndHold-signal). qt QCandlestickSet Class QCandlestickSet Class ===================== The QCandlestickSet class represents a single candlestick item in a candlestick chart. [More...](#details) | | | | --- | --- | | Header: | #include <QCandlestickSet> | | Since: | Qt 5.8 | | Instantiated By: | [CandlestickSet](qml-qtcharts-candlestickset) | | Inherits: | [QObject](qobject) | * [List of all members, including inherited members](https://doc.qt.io/qt-6.2/qcandlestickset-members.html) Properties ---------- | | | | --- | --- | | * **[brush](qcandlestickset#brush-prop)** : QBrush * **[close](qcandlestickset#close-prop)** : qreal * **[high](qcandlestickset#high-prop)** : qreal * **[low](qcandlestickset#low-prop)** : qreal | * **[open](qcandlestickset#open-prop)** : qreal * **[pen](qcandlestickset#pen-prop)** : QPen * **[timestamp](qcandlestickset#timestamp-prop)** : qreal | Public Functions ---------------- | | | | --- | --- | | | **[QCandlestickSet](qcandlestickset#QCandlestickSet-1)**(qreal *open*, qreal *high*, qreal *low*, qreal *close*, qreal *timestamp* = 0.0, QObject \**parent* = nullptr) | | | **[QCandlestickSet](qcandlestickset#QCandlestickSet)**(qreal *timestamp* = 0.0, QObject \**parent* = nullptr) | | virtual | **[~QCandlestickSet](qcandlestickset#dtor.QCandlestickSet)**() | | QBrush | **[brush](qcandlestickset#brush-prop)**() const | | qreal | **[close](qcandlestickset#close-prop)**() const | | qreal | **[high](qcandlestickset#high-prop)**() const | | qreal | **[low](qcandlestickset#low-prop)**() const | | qreal | **[open](qcandlestickset#open-prop)**() const | | QPen | **[pen](qcandlestickset#pen-prop)**() const | | void | **[setBrush](qcandlestickset#brush-prop)**(const QBrush &*brush*) | | void | **[setClose](qcandlestickset#close-prop)**(qreal *close*) | | void | **[setHigh](qcandlestickset#high-prop)**(qreal *high*) | | void | **[setLow](qcandlestickset#low-prop)**(qreal *low*) | | void | **[setOpen](qcandlestickset#open-prop)**(qreal *open*) | | void | **[setPen](qcandlestickset#pen-prop)**(const QPen &*pen*) | | void | **[setTimestamp](qcandlestickset#timestamp-prop)**(qreal *timestamp*) | | qreal | **[timestamp](qcandlestickset#timestamp-prop)**() const | Signals ------- | | | | --- | --- | | void | **[brushChanged](qcandlestickset#brushChanged)**() | | void | **[clicked](qcandlestickset#clicked)**() | | void | **[closeChanged](qcandlestickset#closeChanged)**() | | void | **[doubleClicked](qcandlestickset#doubleClicked)**() | | void | **[highChanged](qcandlestickset#highChanged)**() | | void | **[hovered](qcandlestickset#hovered)**(bool *status*) | | void | **[lowChanged](qcandlestickset#lowChanged)**() | | void | **[openChanged](qcandlestickset#openChanged)**() | | void | **[penChanged](qcandlestickset#penChanged)**() | | void | **[pressed](qcandlestickset#pressed)**() | | void | **[released](qcandlestickset#released)**() | | void | **[timestampChanged](qcandlestickset#timestampChanged)**() | Detailed Description -------------------- Five values are needed to create a graphical representation of a candlestick item: *open*, *high*, *low*, *close*, and *timestamp*. These values can be either passed to a QCandlestickSet constructor or set by using [setOpen](qcandlestickset#open-prop)(), [setHigh](qcandlestickset#high-prop)(), [setLow](qcandlestickset#low-prop)(), [setClose](qcandlestickset#close-prop)(), and [setTimestamp](qcandlestickset#timestamp-prop)(). **See also** [QCandlestickSeries](qcandlestickseries). Property Documentation ---------------------- ### brush : [QBrush](qbrush) This property holds the brush used to fill the candlestick item. **Access functions:** | | | | --- | --- | | QBrush | **brush**() const | | void | **setBrush**(const QBrush &*brush*) | **Notifier signal:** | | | | --- | --- | | void | **[brushChanged](qcandlestickset#brushChanged)**() | ### close : [qreal](qtglobal#qreal-typedef) This property holds the close value of the candlestick item. **Access functions:** | | | | --- | --- | | qreal | **close**() const | | void | **setClose**(qreal *close*) | **Notifier signal:** | | | | --- | --- | | void | **[closeChanged](qcandlestickset#closeChanged)**() | ### high : [qreal](qtglobal#qreal-typedef) This property holds the high value of the candlestick item. **Access functions:** | | | | --- | --- | | qreal | **high**() const | | void | **setHigh**(qreal *high*) | **Notifier signal:** | | | | --- | --- | | void | **[highChanged](qcandlestickset#highChanged)**() | ### low : [qreal](qtglobal#qreal-typedef) This property holds the low value of the candlestick item. **Access functions:** | | | | --- | --- | | qreal | **low**() const | | void | **setLow**(qreal *low*) | **Notifier signal:** | | | | --- | --- | | void | **[lowChanged](qcandlestickset#lowChanged)**() | ### open : [qreal](qtglobal#qreal-typedef) This property holds the open value of the candlestick item. **Access functions:** | | | | --- | --- | | qreal | **open**() const | | void | **setOpen**(qreal *open*) | **Notifier signal:** | | | | --- | --- | | void | **[openChanged](qcandlestickset#openChanged)**() | ### pen : [QPen](qpen) This property holds the pen used to draw the lines of the candlestick item. **Access functions:** | | | | --- | --- | | QPen | **pen**() const | | void | **setPen**(const QPen &*pen*) | **Notifier signal:** | | | | --- | --- | | void | **[penChanged](qcandlestickset#penChanged)**() | ### timestamp : [qreal](qtglobal#qreal-typedef) This property holds the timestamp value of the candlestick item. **Access functions:** | | | | --- | --- | | qreal | **timestamp**() const | | void | **setTimestamp**(qreal *timestamp*) | **Notifier signal:** | | | | --- | --- | | void | **[timestampChanged](qcandlestickset#timestampChanged)**() | Member Function Documentation ----------------------------- ### QCandlestickSet::QCandlestickSet([qreal](qtglobal#qreal-typedef) *open*, [qreal](qtglobal#qreal-typedef) *high*, [qreal](qtglobal#qreal-typedef) *low*, [qreal](qtglobal#qreal-typedef) *close*, [qreal](qtglobal#qreal-typedef) *timestamp* = 0.0, [QObject](qobject#QObject) \**parent* = nullptr) Constructs a candlestick item with given ordered values. The values *open*, *high*, *low*, and *close* are mandatory. The values *timestamp* and *parent* are optional. ### QCandlestickSet::QCandlestickSet([qreal](qtglobal#qreal-typedef) *timestamp* = 0.0, [QObject](qobject#QObject) \**parent* = nullptr) Constructs a candlestick item with an optional *timestamp* and a *parent*. ### `[signal]` void QCandlestickSet::brushChanged() This signal is emitted when the candlestick item brush changes. **Note:** Notifier signal for property [brush](qcandlestickset#brush-prop). **See also** [brush](qcandlestickset#brush-prop). ### `[signal]` void QCandlestickSet::clicked() This signal is emitted when the candlestick item is clicked. ### `[signal]` void QCandlestickSet::closeChanged() This signal is emitted when the candlestick item close value changes. **Note:** Notifier signal for property [close](qcandlestickset#close-prop). **See also** [close](qcandlestickset#close-prop). ### `[signal]` void QCandlestickSet::doubleClicked() This signal is emitted when the user double-clicks a candlestick item. ### `[signal]` void QCandlestickSet::highChanged() This signal is emitted when the candlestick item high value changes. **Note:** Notifier signal for property [high](qcandlestickset#high-prop). **See also** [high](qcandlestickset#high-prop). ### `[signal]` void QCandlestickSet::hovered(bool *status*) This signal is emitted when a mouse is hovered over a candlestick item. When the mouse moves over the item, *status* turns `true`, and when the mouse moves away again, it turns `false`. ### `[signal]` void QCandlestickSet::lowChanged() This signal is emitted when the candlestick item low value changes. **Note:** Notifier signal for property [low](qcandlestickset#low-prop). **See also** [low](qcandlestickset#low-prop). ### `[signal]` void QCandlestickSet::openChanged() This signal is emitted when the candlestick item open value changes. **Note:** Notifier signal for property [open](qcandlestickset#open-prop). **See also** [open](qcandlestickset#open-prop). ### `[signal]` void QCandlestickSet::penChanged() This signal is emitted when the candlestick item pen changes. **Note:** Notifier signal for property [pen](qcandlestickset#pen-prop). **See also** [pen](qcandlestickset#pen-prop). ### `[signal]` void QCandlestickSet::pressed() This signal is emitted when the user clicks the candlestick item and holds down the mouse button. ### `[signal]` void QCandlestickSet::released() This signal is emitted when the user releases the mouse press on the candlestick item. ### `[signal]` void QCandlestickSet::timestampChanged() This signal is emitted when the candlestick item timestamp changes. **Note:** Notifier signal for property [timestamp](qcandlestickset#timestamp-prop). **See also** [timestamp](qcandlestickset#timestamp-prop). ### `[virtual]` QCandlestickSet::~QCandlestickSet() Destroys the candlestick item.
programming_docs
qt WebEngineClientCertificateSelection QML Type WebEngineClientCertificateSelection QML Type ============================================ Provides a selection of client certificates. [More...](#details) | | | | --- | --- | | Import Statement: | import QtWebEngine | | Since: | QtWebEngine 1.9 | * [List of all members, including inherited members](https://doc.qt.io/qt-6.2/qml-qtwebengine-webengineclientcertificateselection-members.html) Properties ---------- * **[certificates](qml-qtwebengine-webengineclientcertificateselection#certificates-prop)** : list<WebEngineClientCertificateOption> * **[host](qml-qtwebengine-webengineclientcertificateselection#host-prop)** : url Methods ------- * void **[select](qml-qtwebengine-webengineclientcertificateselection#select-method-1)**(int *index*) * void **[select](qml-qtwebengine-webengineclientcertificateselection#select-method)**(WebEngineClientCertificateOption *certificate*) * void **[selectNone](qml-qtwebengine-webengineclientcertificateselection#selectNone-method)**() Detailed Description -------------------- When a web site requests an SSL client certificate, and one or more certificates are found in the system's client certificate store, this type provides access to the certificates to choose from, as well as a method for selecting one. The selection is asynchronous. If no certificate is selected and no copy of the object is kept alive, loading will continue without a certificate. **See also** [WebEngineView.selectClientCertificate](qml-qtwebengine-webengineview#selectClientCertificate-signal). Property Documentation ---------------------- ### certificates : [list](qml-list)<[WebEngineClientCertificateOption](qml-qtwebengine-webengineclientcertificateoption)> The client certificates available to choose from. ### host : [url](qml-url) The host and port of the server requesting the client certificate. Method Documentation -------------------- ### void select([int](qml-int) *index*) Selects the client certificate at the index *index* in the list of offered certificates. **See also** [selectNone](qml-qtwebengine-webengineclientcertificateselection#selectNone-method)(). ### void select([WebEngineClientCertificateOption](qml-qtwebengine-webengineclientcertificateoption) *certificate*) Selects the client certificate *certificate*. The certificate must be one of the offered certificates. **See also** [selectNone](qml-qtwebengine-webengineclientcertificateselection#selectNone-method)(). ### void selectNone() Continues without using any of the offered certificates. This is the same action as taken when destroying the last copy of this object if no selection has been made. **See also** [select](qml-qtwebengine-webengineclientcertificateselection#select-method)(). qt Explore Qt Explore Qt ========== We invite you to explore the rest of Qt. We prepared overviews which help you decide which APIs to use and our examples demonstrate how to use them. Reference Documentation ----------------------- * [Qt Overviews](https://doc.qt.io/qt-6.2/overviews-main.html) - list of topics about application development * [Examples and Tutorials](https://doc.qt.io/qt-6.2/qtexamplesandtutorials.html) - code samples and tutorials * [Qt Reference Pages](https://doc.qt.io/qt-6.2/reference-overview.html) - a listing of C++ and QML APIs Participate in the Qt Community ------------------------------- Qt's vibrant and active community site <http://qt.io>, houses a wiki, a forum, and additional learning guides and presentations. qt QModbusRtuSerialServer Class QModbusRtuSerialServer Class ============================ The QModbusRtuSerialServer class represents a Modbus server that uses a serial port for its communication with the Modbus client. [More...](#details) | | | | --- | --- | | Header: | #include <QModbusRtuSerialServer> | | qmake: | QT += serialbus | | Since: | Qt 6.2 | | Inherits: | [QModbusServer](qmodbusserver) | * [List of all members, including inherited members](https://doc.qt.io/qt-6.2/qmodbusrtuserialserver-members.html) Public Functions ---------------- | | | | --- | --- | | | **[QModbusRtuSerialServer](qmodbusrtuserialserver#QModbusRtuSerialServer)**(QObject \**parent* = nullptr) | | virtual | **[~QModbusRtuSerialServer](qmodbusrtuserialserver#dtor.QModbusRtuSerialServer)**() | | int | **[interFrameDelay](qmodbusrtuserialserver#interFrameDelay)**() const | | void | **[setInterFrameDelay](qmodbusrtuserialserver#setInterFrameDelay)**(int *microseconds*) | Reimplemented Public Functions ------------------------------ | | | | --- | --- | | virtual bool | **[processesBroadcast](qmodbusrtuserialserver#processesBroadcast)**() const override | Reimplemented Protected Functions --------------------------------- | | | | --- | --- | | virtual void | **[close](qmodbusrtuserialserver#close)**() override | | virtual bool | **[open](qmodbusrtuserialserver#open)**() override | | virtual QModbusResponse | **[processRequest](qmodbusrtuserialserver#processRequest)**(const QModbusPdu &*request*) override | Detailed Description -------------------- Communication via Modbus requires the interaction between a single Modbus client instance and multiple Modbus server. This class provides the Modbus server implementation via a serial port. Since multiple Modbus server instances can interact with a Modbus client at the same time (using a serial bus), servers are identified by their [serverAddress](qmodbusserver#serverAddress)(). Member Function Documentation ----------------------------- ### QModbusRtuSerialServer::QModbusRtuSerialServer([QObject](qobject#QObject) \**parent* = nullptr) Constructs a QModbusRtuSerialServer with the specified *parent*. The [serverAddress](qmodbusserver#serverAddress) preset is `1`. ### `[virtual]` QModbusRtuSerialServer::~QModbusRtuSerialServer() Destroys the [QModbusRtuSerialServer](qmodbusrtuserialserver) instance. ### `[override virtual protected]` void QModbusRtuSerialServer::close() Reimplements: [QModbusDevice::close](qmodbusdevice#close)(). ### `[since 6.2]` int QModbusRtuSerialServer::interFrameDelay() const Returns the amount of microseconds for the silent interval between two consecutive Modbus messages. This function was introduced in Qt 6.2. **See also** [setInterFrameDelay](qmodbusrtuserialserver#setInterFrameDelay)(). ### `[override virtual protected]` bool QModbusRtuSerialServer::open() Reimplements: [QModbusDevice::open](qmodbusdevice#open)(). **Note:** When calling this function, existing buffered data is removed from the serial port. ### `[override virtual protected]` [QModbusResponse](qmodbusresponse) QModbusRtuSerialServer::processRequest(const [QModbusPdu](qmodbuspdu) &*request*) Reimplements: [QModbusServer::processRequest](qmodbusserver#processRequest)(const QModbusPdu &request). Processes the Modbus client request specified by *request* and returns a Modbus response. The Modbus function [QModbusRequest::EncapsulatedInterfaceTransport](qmodbuspdu#FunctionCode-enum) with MEI Type 13 (0x0D) CANopen General Reference is filtered out because it is usually Modbus TCP or Modbus serial ASCII only. A request to the RTU serial server will be answered with a Modbus exception response with the exception code QModbusExceptionResponse::IllegalFunction. ### `[override virtual]` bool QModbusRtuSerialServer::processesBroadcast() const Reimplements: [QModbusServer::processesBroadcast() const](qmodbusserver#processesBroadcast). ### `[since 6.2]` void QModbusRtuSerialServer::setInterFrameDelay(int *microseconds*) Sets the amount of *microseconds* for the silent interval between two consecutive Modbus messages. By default, the class implementation will use a pre-calculated value according to the Modbus specification. A active or running connection is not affected by such delay changes. **Note:** If *microseconds* is set to -1 or *microseconds* is less than the pre-calculated delay then this pre-calculated value is used as frame delay. This function was introduced in Qt 6.2. **See also** [interFrameDelay](qmodbusrtuserialserver#interFrameDelay)(). qt Shader QML Type Shader QML Type =============== Container component for defining shader code used by post-processing effects. [More...](#details) | | | | --- | --- | | Import Statement: | import QtQuick3D | * [List of all members, including inherited members](https://doc.qt.io/qt-6.2/qml-qtquick3d-shader-members.html) Properties ---------- * **[shader](qml-qtquick3d-shader#shader-prop)** : url * **[stage](qml-qtquick3d-shader#stage-prop)** : enumeration Detailed Description -------------------- The Shader type is used for populating the [shaders](qml-qtquick3d-pass#shaders-prop) list in the render [pass](qml-qtquick3d-pass) of an [Effect](qml-qtquick3d-effect). A shader is code which is executed directly on the graphic hardware at a particular [stage](qml-qtquick3d-shader#stage-prop) of the rendering pipeline. **See also** [Effect](qml-qtquick3d-effect). Property Documentation ---------------------- ### shader : [url](qml-url) Specifies the name of the shader source file. For details on how to write shader code, see the [Effect](qml-qtquick3d-effect) documentation. ### stage : [enumeration](qml-enumeration) Specifies the stage of the rendering pipeline when the shader code will be executed. The default is `Shader.Fragment` | Constant | Description | | --- | --- | | `Shader.Vertex` | The shader is a vertex shader. This code is run once per vertex in the input geometry and can be used to modify it before the geometry is rasterized (scan converted). In the case of effects, the input geometry is always a quad (four vertexes representing the corners of the render target). | | `Shader.Fragment` | The shader is a fragment shader. After vertex processing, the modified geometry is turned into fragments (rasterization). Then a fragment shader is executed for each fragment, assigning a color to it. Fragments are a related concept to pixels, but with additional information attached. Also, as a result of some anti-aliasing strategies, there may be more than one fragment for each pixel in the output. | qt const_iterator Class const\_iterator Class ===================== class [QJsonObject](qjsonobject)::const\_iterator The [QJsonObject::const\_iterator](qjsonobject-const-iterator) class provides an STL-style const iterator for [QJsonObject](qjsonobject). [More...](#details) This class was introduced in Qt 5.0. * [List of all members, including inherited members](https://doc.qt.io/qt-6.2/qjsonobject-const-iterator-members.html) Public Types ------------ | | | | --- | --- | | | **[iterator\_category](qjsonobject-const-iterator#iterator_category-typedef)** | Public Functions ---------------- | | | | --- | --- | | | **[const\_iterator](qjsonobject-const-iterator#const_iterator-2)**(const iterator &*other*) | | | **[const\_iterator](qjsonobject-const-iterator#const_iterator)**() | | QString | **[key](qjsonobject-const-iterator#key)**() const | | QJsonValueRef | **[value](qjsonobject-const-iterator#value)**() const | | bool | **[operator!=](qjsonobject-const-iterator#operator-not-eq)**(const const\_iterator &*other*) const | | bool | **[operator!=](qjsonobject-const-iterator#operator-not-eq-1)**(const iterator &*other*) const | | const QJsonValueRef | **[operator\*](qjsonobject-const-iterator#operator-2a)**() const | | const\_iterator | **[operator+](qjsonobject-const-iterator#operator-2b)**(qsizetype *j*) const | | const\_iterator & | **[operator++](qjsonobject-const-iterator#operator-2b-2b)**() | | const\_iterator | **[operator++](qjsonobject-const-iterator#operator-2b-2b-1)**(int) | | const\_iterator & | **[operator+=](qjsonobject-const-iterator#operator-2b-eq)**(qsizetype *j*) | | const\_iterator | **[operator-](qjsonobject-const-iterator#operator-)**(qsizetype *j*) const | | qsizetype | **[operator-](qjsonobject-const-iterator#operator--1)**(const\_iterator *other*) const | | const\_iterator & | **[operator--](qjsonobject-const-iterator#operator--)**() | | const\_iterator | **[operator--](qjsonobject-const-iterator#operator---1)**(int) | | const\_iterator & | **[operator-=](qjsonobject-const-iterator#operator--eq)**(qsizetype *j*) | | const QJsonValueRef \* | **[operator->](qjsonobject-const-iterator#operator--gt)**() const | | bool | **[operator<](qjsonobject-const-iterator#operator-lt)**(const const\_iterator &*other*) const | | bool | **[operator<=](qjsonobject-const-iterator#operator-lt-eq)**(const const\_iterator &*other*) const | | bool | **[operator==](qjsonobject-const-iterator#operator-eq-eq)**(const const\_iterator &*other*) const | | bool | **[operator==](qjsonobject-const-iterator#operator-eq-eq-1)**(const iterator &*other*) const | | bool | **[operator>](qjsonobject-const-iterator#operator-gt)**(const const\_iterator &*other*) const | | bool | **[operator>=](qjsonobject-const-iterator#operator-gt-eq)**(const const\_iterator &*other*) const | | const QJsonValueRef | **[operator[]](qjsonobject-const-iterator#operator-5b-5d)**(qsizetype *j*) | Detailed Description -------------------- [QJsonObject::const\_iterator](qjsonobject-const-iterator) allows you to iterate over a [QJsonObject](qjsonobject). If you want to modify the [QJsonObject](qjsonobject) as you iterate over it, you must use [QJsonObject::iterator](qjsonobject-iterator) instead. It is generally good practice to use [QJsonObject::const\_iterator](qjsonobject-const-iterator) on a non-const [QJsonObject](qjsonobject) as well, unless you need to change the [QJsonObject](qjsonobject) through the iterator. Const iterators are slightly faster and improve code readability. The default [QJsonObject::const\_iterator](qjsonobject-const-iterator) constructor creates an uninitialized iterator. You must initialize it using a [QJsonObject](qjsonobject) function like [QJsonObject::constBegin](qjsonobject#constBegin)(), [QJsonObject::constEnd](qjsonobject#constEnd)(), or [QJsonObject::find](qjsonobject#find)() before you can start iterating. Multiple iterators can be used on the same object. Existing iterators will however become dangling if the object gets modified. **See also** [QJsonObject::iterator](qjsonobject-iterator), [JSON Support in Qt](json), and [JSON Save Game Example](https://doc.qt.io/qt-6.2/qtcore-serialization-savegame-example.html). Member Type Documentation ------------------------- ### const\_iterator::iterator\_category A synonym for *std::random\_access\_iterator\_tag* indicating this iterator is a random-access iterator. **Note:** In Qt versions before 5.6, this was set by mistake to *std::bidirectional\_iterator\_tag*. Member Function Documentation ----------------------------- ### bool const\_iterator::operator!=(const [const\_iterator](qjsonobject-const-iterator#const_iterator) &*other*) const ### bool const\_iterator::operator!=(const [iterator](qjsonobject-iterator) &*other*) const Returns `true` if *other* points to a different item than this iterator; otherwise returns `false`. **See also** [operator==](qjsonobject-const-iterator#operator-eq-eq)(). ### bool const\_iterator::operator==(const [const\_iterator](qjsonobject-const-iterator#const_iterator) &*other*) const ### bool const\_iterator::operator==(const [iterator](qjsonobject-iterator) &*other*) const Returns `true` if *other* points to the same item as this iterator; otherwise returns `false`. **See also** [operator!=](qjsonobject-const-iterator#operator-not-eq)(). ### const\_iterator::const\_iterator(const [iterator](qjsonobject-iterator) &*other*) Constructs a copy of *other*. ### const\_iterator::const\_iterator() Constructs an uninitialized iterator. Functions like [key](qjsonobject-const-iterator#key)(), [value](qjsonobject-const-iterator#value)(), and operator++() must not be called on an uninitialized iterator. Use operator=() to assign a value to it before using it. **See also** [QJsonObject::constBegin](qjsonobject#constBegin)() and [QJsonObject::constEnd](qjsonobject#constEnd)(). ### [QString](qstring) const\_iterator::key() const Returns the current item's key. **See also** [value](qjsonobject-const-iterator#value)(). ### QJsonValueRef const\_iterator::value() const Returns the current item's value. **See also** [key](qjsonobject-const-iterator#key)() and [operator\*](qjsonobject-const-iterator#operator-2a)(). ### const QJsonValueRef const\_iterator::operator\*() const Returns the current item's value. Same as [value](qjsonobject-const-iterator#value)(). **See also** [key](qjsonobject-const-iterator#key)(). ### [const\_iterator](qjsonobject-const-iterator#const_iterator) const\_iterator::operator+(qsizetype *j*) const Returns an iterator to the item at *j* positions forward from this iterator. If *j* is negative, the iterator goes backward. This operation can be slow for large *j* values. **See also** [operator-](qjsonobject-const-iterator#operator-)(). ### [const\_iterator](qjsonobject-const-iterator#const_iterator) &const\_iterator::operator++() The prefix ++ operator, `++i`, advances the iterator to the next item in the object and returns an iterator to the new current item. Calling this function on [QJsonObject::end](qjsonobject#end)() leads to undefined results. **See also** [operator--](qjsonobject-const-iterator#operator--)(). ### [const\_iterator](qjsonobject-const-iterator#const_iterator) const\_iterator::operator++(int) This is an overloaded function. The postfix ++ operator, `i++`, advances the iterator to the next item in the object and returns an iterator to the previously current item. ### [const\_iterator](qjsonobject-const-iterator#const_iterator) &const\_iterator::operator+=(qsizetype *j*) Advances the iterator by *j* items. If *j* is negative, the iterator goes backward. This operation can be slow for large *j* values. **See also** [operator-=](qjsonobject-const-iterator#operator--eq)() and [operator+](qjsonobject-const-iterator#operator-2b)(). ### [const\_iterator](qjsonobject-const-iterator#const_iterator) const\_iterator::operator-(qsizetype *j*) const Returns an iterator to the item at *j* positions backward from this iterator. If *j* is negative, the iterator goes forward. This operation can be slow for large *j* values. **See also** [operator+](qjsonobject-const-iterator#operator-2b)(). ### qsizetype const\_iterator::operator-([const\_iterator](qjsonobject-const-iterator#const_iterator) *other*) const Returns the number of items between the item pointed to by *other* and the item pointed to by this iterator. ### [const\_iterator](qjsonobject-const-iterator#const_iterator) &const\_iterator::operator--() The prefix -- operator, `--i`, makes the preceding item current and returns an iterator pointing to the new current item. Calling this function on [QJsonObject::begin](qjsonobject#begin)() leads to undefined results. **See also** [operator++](qjsonobject-const-iterator#operator-2b-2b)(). ### [const\_iterator](qjsonobject-const-iterator#const_iterator) const\_iterator::operator--(int) This is an overloaded function. The postfix -- operator, `i--`, makes the preceding item current and returns an iterator pointing to the previously current item. ### [const\_iterator](qjsonobject-const-iterator#const_iterator) &const\_iterator::operator-=(qsizetype *j*) Makes the iterator go back by *j* items. If *j* is negative, the iterator goes forward. This operation can be slow for large *j* values. **See also** [operator+=](qjsonobject-const-iterator#operator-2b-eq)() and [operator-](qjsonobject-const-iterator#operator-)(). ### const QJsonValueRef \*const\_iterator::operator->() const Returns a pointer to the current item. ### bool const\_iterator::operator<(const [const\_iterator](qjsonobject-const-iterator#const_iterator) &*other*) const Returns `true` if the item pointed to by this iterator is less than the item pointed to by the *other* iterator. ### bool const\_iterator::operator<=(const [const\_iterator](qjsonobject-const-iterator#const_iterator) &*other*) const Returns `true` if the item pointed to by this iterator is less than or equal to the item pointed to by the *other* iterator. ### bool const\_iterator::operator>(const [const\_iterator](qjsonobject-const-iterator#const_iterator) &*other*) const Returns `true` if the item pointed to by this iterator is greater than the item pointed to by the *other* iterator. ### bool const\_iterator::operator>=(const [const\_iterator](qjsonobject-const-iterator#const_iterator) &*other*) const Returns `true` if the item pointed to by this iterator is greater than or equal to the item pointed to by the *other* iterator. ### const QJsonValueRef const\_iterator::operator[](qsizetype *j*) Returns the item at offset *j* from the item pointed to by this iterator (the item at position `*this + j`). This function is provided to make [QJsonObject](qjsonobject) iterators behave like C++ pointers. **See also** [operator+](qjsonobject-const-iterator#operator-2b)().
programming_docs
qt QHelpFilterData Class QHelpFilterData Class ===================== The QHelpFilterData class provides details for the filters used by [QHelpFilterEngine](qhelpfilterengine). [More...](#details) | | | | --- | --- | | Header: | #include <QHelpFilterData> | | CMake: | find\_package(Qt6 COMPONENTS Help REQUIRED) target\_link\_libraries(mytarget PRIVATE Qt6::Help) | | qmake: | QT += help | | Since: | Qt 5.13 | * [List of all members, including inherited members](https://doc.qt.io/qt-6.2/qhelpfilterdata-members.html) Public Functions ---------------- | | | | --- | --- | | | **[QHelpFilterData](qhelpfilterdata#QHelpFilterData-2)**(QHelpFilterData &&*other*) | | | **[QHelpFilterData](qhelpfilterdata#QHelpFilterData-1)**(const QHelpFilterData &*other*) | | | **[QHelpFilterData](qhelpfilterdata#QHelpFilterData)**() | | QHelpFilterData & | **[operator=](qhelpfilterdata#operator-eq-1)**(QHelpFilterData &&*other*) | | QHelpFilterData & | **[operator=](qhelpfilterdata#operator-eq)**(const QHelpFilterData &*other*) | | | **[~QHelpFilterData](qhelpfilterdata#dtor.QHelpFilterData)**() | | QStringList | **[components](qhelpfilterdata#components)**() const | | void | **[setComponents](qhelpfilterdata#setComponents)**(const QStringList &*components*) | | void | **[setVersions](qhelpfilterdata#setVersions)**(const QList<QVersionNumber> &*versions*) | | void | **[swap](qhelpfilterdata#swap)**(QHelpFilterData &*other*) | | QList<QVersionNumber> | **[versions](qhelpfilterdata#versions)**() const | Detailed Description -------------------- By using [setComponents](qhelpfilterdata#setComponents)() you may constrain the search results to documents that belong only to components specified on the given list. By using [setVersions](qhelpfilterdata#setVersions)() you may constrain the search results to documents that belong only to versions specified on the given list. **See also** [QHelpFilterEngine](qhelpfilterengine). Member Function Documentation ----------------------------- ### QHelpFilterData::QHelpFilterData([QHelpFilterData](qhelpfilterdata#QHelpFilterData) &&*other*) Move-constructs a QHelpFilterData instance, making it point at the same object that *other* was pointing to. ### QHelpFilterData::QHelpFilterData(const [QHelpFilterData](qhelpfilterdata#QHelpFilterData) &*other*) Constructs a copy of *other*. ### QHelpFilterData::QHelpFilterData() Constructs the empty filter. ### [QHelpFilterData](qhelpfilterdata#QHelpFilterData) &QHelpFilterData::operator=([QHelpFilterData](qhelpfilterdata#QHelpFilterData) &&*other*) Move-assigns *other* to this [QHelpFilterData](qhelpfilterdata) instance. ### [QHelpFilterData](qhelpfilterdata#QHelpFilterData) &QHelpFilterData::operator=(const [QHelpFilterData](qhelpfilterdata#QHelpFilterData) &*other*) Assigns *other* to this filter and returns a reference to this filter. ### QHelpFilterData::~QHelpFilterData() Destroys the filter. ### [QStringList](qstringlist) QHelpFilterData::components() const Returns the component list that is used for filtering the search results. **See also** [setComponents](qhelpfilterdata#setComponents)(). ### void QHelpFilterData::setComponents(const [QStringList](qstringlist) &*components*) Specifies the component list that is used for filtering the search results. Only results from components in the list *components* shall be returned. **See also** [components](qhelpfilterdata#components)(). ### void QHelpFilterData::setVersions(const [QList](qlist)<[QVersionNumber](qversionnumber)> &*versions*) Specifies the version list that is used for filtering the search results. Only results from versions in the list *versions* shall be returned. **See also** [versions](qhelpfilterdata#versions)(). ### void QHelpFilterData::swap([QHelpFilterData](qhelpfilterdata#QHelpFilterData) &*other*) Swaps the filter *other* with this filter. This operation is very fast and never fails. ### [QList](qlist)<[QVersionNumber](qversionnumber)> QHelpFilterData::versions() const Returns the version list that is used for filtering the search results. **See also** [setVersions](qhelpfilterdata#setVersions)(). qt QWebEngineLoadingInfo Class QWebEngineLoadingInfo Class =========================== A utility type for the [WebEngineView::loadingChanged](qml-qtwebengine-webengineview#loadingChanged-signal) signal. [More...](#details) | | | | --- | --- | | Header: | #include <QWebEngineLoadingInfo> | | CMake: | find\_package(Qt6 COMPONENTS WebEngineCore REQUIRED) target\_link\_libraries(mytarget PRIVATE Qt6::WebEngineCore) | | qmake: | QT += webenginecore | | Since: | Qt 6.2 | | Instantiated By: | [WebEngineLoadingInfo](qml-qtwebengine-webengineloadinginfo) | * [List of all members, including inherited members](https://doc.qt.io/qt-6.2/qwebengineloadinginfo-members.html) Public Types ------------ | | | | --- | --- | | enum | **[ErrorDomain](qwebengineloadinginfo#ErrorDomain-enum)** { NoErrorDomain, InternalErrorDomain, ConnectionErrorDomain, CertificateErrorDomain, HttpErrorDomain, …, DnsErrorDomain } | | enum | **[LoadStatus](qwebengineloadinginfo#LoadStatus-enum)** { LoadStartedStatus, LoadStoppedStatus, LoadSucceededStatus, LoadFailedStatus } | Properties ---------- | | | | --- | --- | | * **[errorCode](qwebengineloadinginfo#errorCode-prop)** : const int * **[errorString](qwebengineloadinginfo#errorString-prop)** : const QString * **[isErrorPage](qwebengineloadinginfo#isErrorPage-prop)** : const bool | * **[status](qwebengineloadinginfo#status-prop)** : const LoadStatus * **[url](qwebengineloadinginfo#url-prop)** : const QUrl | Public Functions ---------------- | | | | --- | --- | | int | **[errorCode](qwebengineloadinginfo#errorCode-prop)**() const | | QWebEngineLoadingInfo::ErrorDomain | **[errorDomain](qwebengineloadinginfo#errorDomain-prop)**() const | | QString | **[errorString](qwebengineloadinginfo#errorString-prop)**() const | | bool | **[isErrorPage](qwebengineloadinginfo#isErrorPage-prop)**() const | | QWebEngineLoadingInfo::LoadStatus | **[status](qwebengineloadinginfo#status-prop)**() const | | QUrl | **[url](qwebengineloadinginfo#url)**() const | Detailed Description -------------------- Contains information about a web page loading status change, such as the URL and current loading status (started, succeeded, stopped, failed). **See also** [QWebEnginePage::loadStarted](qwebenginepage#loadStarted), [QWebEnginePage::loadFinished](qwebenginepage#loadFinished), and [WebEngineView::loadingChanged](qml-qtwebengine-webengineview#loadingChanged-signal). Member Type Documentation ------------------------- ### enum QWebEngineLoadingInfo::ErrorDomain This enumeration holds the type of a load error: | Constant | Value | Description | | --- | --- | --- | | `QWebEngineLoadingInfo::NoErrorDomain` | `0` | Error type is not known. | | `QWebEngineLoadingInfo::InternalErrorDomain` | `1` | Content cannot be interpreted by Qt WebEngine. | | `QWebEngineLoadingInfo::ConnectionErrorDomain` | `2` | Error results from a faulty network connection. | | `QWebEngineLoadingInfo::CertificateErrorDomain` | `3` | Error is related to the SSL/TLS certificate. | | `QWebEngineLoadingInfo::HttpErrorDomain` | `4` | Error is related to the HTTP connection. | | `QWebEngineLoadingInfo::FtpErrorDomain` | `5` | Error is related to the FTP connection. | | `QWebEngineLoadingInfo::DnsErrorDomain` | `6` | Error is related to the DNS connection. | ### enum QWebEngineLoadingInfo::LoadStatus This enumeration represents the load status of a web page load request: | Constant | Value | Description | | --- | --- | --- | | `QWebEngineLoadingInfo::LoadStartedStatus` | `0` | Page is currently loading. | | `QWebEngineLoadingInfo::LoadStoppedStatus` | `1` | Loading the page was stopped by the stop() method or by the loader code or network stack in Chromium. | | `QWebEngineLoadingInfo::LoadSucceededStatus` | `2` | Page has been loaded with success. | | `QWebEngineLoadingInfo::LoadFailedStatus` | `3` | Page could not be loaded. | Property Documentation ---------------------- ### `[read-only]` errorCode : const int Holds the error code. **Access functions:** | | | | --- | --- | | int | **errorCode**() const | ### `[read-only]` errorString : const [QString](qstring) Holds the error message. **Access functions:** | | | | --- | --- | | QString | **errorString**() const | ### `[read-only]` isErrorPage : const bool Indicates if the load resulted in an error page. **Access functions:** | | | | --- | --- | | bool | **isErrorPage**() const | ### `[read-only]` status : const [LoadStatus](qwebengineloadinginfo#LoadStatus-enum) This property holds the load status of the page. **Access functions:** | | | | --- | --- | | QWebEngineLoadingInfo::LoadStatus | **status**() const | ### `[read-only]` url : const [QUrl](qurl) Holds the URL of the load request. **Access functions:** | | | | --- | --- | | QUrl | **[url](qwebengineloadinginfo#url)**() const | Member Function Documentation ----------------------------- ### [QUrl](qurl) QWebEngineLoadingInfo::url() const Returns the URL of the load request. **Note:** Getter function for property url. qt QGoochMaterial Class QGoochMaterial Class ==================== class [Qt3DExtras](https://doc.qt.io/qt-6.2/qt3dextras-module.html)::QGoochMaterial The QGoochMaterial provides a material that implements the Gooch shading model, popular in CAD and CAM applications. [More...](#details) | | | | --- | --- | | Header: | #include <QGoochMaterial> | | CMake: | find\_package(Qt6 COMPONENTS 3dextras REQUIRED) target\_link\_libraries(mytarget PRIVATE Qt6::3dextras) | | qmake: | QT += 3dextras | | Since: | Qt 5.7 | | Inherits: | [Qt3DRender::QMaterial](qt3drender-qmaterial) | * [List of all members, including inherited members](https://doc.qt.io/qt-6.2/qt3dextras-qgoochmaterial-members.html) Properties ---------- | | | | --- | --- | | * **[alpha](qt3dextras-qgoochmaterial#alpha-prop)** : float * **[beta](qt3dextras-qgoochmaterial#beta-prop)** : float * **[cool](qt3dextras-qgoochmaterial#cool-prop)** : QColor * **[diffuse](qt3dextras-qgoochmaterial#diffuse-prop)** : QColor | * **[shininess](qt3dextras-qgoochmaterial#shininess-prop)** : float * **[specular](qt3dextras-qgoochmaterial#specular-prop)** : QColor * **[warm](qt3dextras-qgoochmaterial#warm-prop)** : QColor | Public Functions ---------------- | | | | --- | --- | | | **[QGoochMaterial](qt3dextras-qgoochmaterial#QGoochMaterial)**(Qt3DCore::QNode \**parent* = nullptr) | | float | **[alpha](qt3dextras-qgoochmaterial#alpha-prop)**() const | | float | **[beta](qt3dextras-qgoochmaterial#beta-prop)**() const | | QColor | **[cool](qt3dextras-qgoochmaterial#cool-prop)**() const | | QColor | **[diffuse](qt3dextras-qgoochmaterial#diffuse-prop)**() const | | float | **[shininess](qt3dextras-qgoochmaterial#shininess-prop)**() const | | QColor | **[specular](qt3dextras-qgoochmaterial#specular-prop)**() const | | QColor | **[warm](qt3dextras-qgoochmaterial#warm-prop)**() const | Public Slots ------------ | | | | --- | --- | | void | **[setAlpha](qt3dextras-qgoochmaterial#alpha-prop)**(float *alpha*) | | void | **[setBeta](qt3dextras-qgoochmaterial#beta-prop)**(float *beta*) | | void | **[setCool](qt3dextras-qgoochmaterial#cool-prop)**(const QColor &*cool*) | | void | **[setDiffuse](qt3dextras-qgoochmaterial#diffuse-prop)**(const QColor &*diffuse*) | | void | **[setShininess](qt3dextras-qgoochmaterial#shininess-prop)**(float *shininess*) | | void | **[setSpecular](qt3dextras-qgoochmaterial#specular-prop)**(const QColor &*specular*) | | void | **[setWarm](qt3dextras-qgoochmaterial#warm-prop)**(const QColor &*warm*) | Signals ------- | | | | --- | --- | | void | **[alphaChanged](qt3dextras-qgoochmaterial#alpha-prop)**(float *alpha*) | | void | **[betaChanged](qt3dextras-qgoochmaterial#beta-prop)**(float *beta*) | | void | **[coolChanged](qt3dextras-qgoochmaterial#cool-prop)**(const QColor &*cool*) | | void | **[diffuseChanged](qt3dextras-qgoochmaterial#diffuse-prop)**(const QColor &*diffuse*) | | void | **[shininessChanged](qt3dextras-qgoochmaterial#shininess-prop)**(float *shininess*) | | void | **[specularChanged](qt3dextras-qgoochmaterial#specular-prop)**(const QColor &*specular*) | | void | **[warmChanged](qt3dextras-qgoochmaterial#warm-prop)**(const QColor &*warm*) | Detailed Description -------------------- The Gooch lighting model uses both color and brightness to help show the curvature of 3D surfaces. This is often better than models such as Phong that rely purely upon changes in brightness. In situations such as in CAD and CAM applications where photorealism is not a goal, the Gooch shading model in conjunction with some kind of silhouette edge inking is a popular solution. The Gooch lighting model is explained fully in the [original Gooch paper](http://www.cs.northwestern.edu/~ago820/SIG98/abstract.html). The Gooch model mixes a diffuse object color with a user-provided cool color and warm color to produce the end points of a color ramp that is used to shade the object based upon the cosine of the angle between the vector from the fragment to the light source and the fragment's normal vector. Optionally, a specular highlight can be added on top. The relative contributions to the cool and warm colors by the diffuse color are controlled by the alpha and beta properties respecitvely. This material uses an effect with a single render pass approach and performs per fragment lighting. Techniques are provided for OpenGL 2, OpenGL 3 or above as well as OpenGL ES 2. Property Documentation ---------------------- ### alpha : float Holds the current alpha value. The start point of the color ramp used by the Gooch shader is calculated as {c = cool + alpha \* diffuse}. **Access functions:** | | | | --- | --- | | float | **alpha**() const | | void | **setAlpha**(float *alpha*) | **Notifier signal:** | | | | --- | --- | | void | **alphaChanged**(float *alpha*) | ### beta : float Holds the current beta value. The start point of the color ramp used by the Gooch shader is calculated as {c = warm + beta \* diffuse}. **Access functions:** | | | | --- | --- | | float | **beta**() const | | void | **setBeta**(float *beta*) | **Notifier signal:** | | | | --- | --- | | void | **betaChanged**(float *beta*) | ### cool : [QColor](qcolor) Holds the current cool color. **Access functions:** | | | | --- | --- | | QColor | **cool**() const | | void | **setCool**(const QColor &*cool*) | **Notifier signal:** | | | | --- | --- | | void | **coolChanged**(const QColor &*cool*) | ### diffuse : [QColor](qcolor) Holds the current diffuse color. **Access functions:** | | | | --- | --- | | QColor | **diffuse**() const | | void | **setDiffuse**(const QColor &*diffuse*) | **Notifier signal:** | | | | --- | --- | | void | **diffuseChanged**(const QColor &*diffuse*) | ### shininess : float Holds the current shininess value. Higher values of shininess result in a smaller and brighter highlight. **Access functions:** | | | | --- | --- | | float | **shininess**() const | | void | **setShininess**(float *shininess*) | **Notifier signal:** | | | | --- | --- | | void | **shininessChanged**(float *shininess*) | ### specular : [QColor](qcolor) Holds the current specular color. **Access functions:** | | | | --- | --- | | QColor | **specular**() const | | void | **setSpecular**(const QColor &*specular*) | **Notifier signal:** | | | | --- | --- | | void | **specularChanged**(const QColor &*specular*) | ### warm : [QColor](qcolor) Holds the current warm color. **Access functions:** | | | | --- | --- | | QColor | **warm**() const | | void | **setWarm**(const QColor &*warm*) | **Notifier signal:** | | | | --- | --- | | void | **warmChanged**(const QColor &*warm*) | Member Function Documentation ----------------------------- ### QGoochMaterial::QGoochMaterial([Qt3DCore::QNode](qt3dcore-qnode) \**parent* = nullptr) Constructs a new QGoochMaterial instance with parent object *parent*. qt Inter-Process Communication in Qt Inter-Process Communication in Qt ================================= Qt provides several ways to implement Inter-Process Communication (IPC) in Qt applications. TCP/IP ------ The cross-platform [Qt Network](qtnetwork-index) module provides classes that make network programming portable and easy. It offers high-level classes (e.g. [QNetworkAccessManager](qnetworkaccessmanager)) that communicate using specific application-level protocols, and lower-level classes (e.g., [QTcpSocket](qtcpsocket), [QTcpServer](qtcpserver), [QSslSocket](qsslsocket)) for implementing protocols. Local Server/Socket ------------------- The cross-platform [Qt Network](qtnetwork-index) module provides classes that make local network programming portable and easy. It offers the [QLocalServer](qlocalserver) and [QLocalSocket](qlocalsocket) classes that allow for network-like communication in a local setup. Their TCP counterparts can be used as drop-in replacement to make the communication work across networks. Shared Memory ------------- The cross-platform shared memory class, [QSharedMemory](qsharedmemory), provides access to the operating system's shared memory implementation. It allows safe access to shared memory segments by multiple threads and processes. Additionally, [QSystemSemaphore](qsystemsemaphore) can be used to control access to resources shared by the system, as well as to communicate between processes. D-Bus protocol -------------- The [Qt D-Bus](qtdbus-index) module is a Unix-only library you can use to implement IPC using the D-Bus protocol. It extends Qt's [Signals and Slots](signalsandslots) mechanism to the IPC level, allowing a signal emitted by one process to be connected to a slot in another process. The [Qt D-Bus](qtdbus-index) documentation has detailed information on how to use the [Qt D-Bus](qtdbus-index) module. QProcess Class -------------- The cross-platform class [QProcess](qprocess) can be used to start external programs as child processes, and to communicate with them. It provides an API for monitoring and controlling the state of the child process. [QProcess](qprocess) gives access to the input/output channels of child process by inheriting from [QIODevice](qiodevice). Session Management ------------------ On Linux/X11, Windows and macOS, Qt provides support for session management. Sessions allow events to be propagated to processes, for example, to notify when a shutdown occurs. The process and applications can then perform any necessary operations such as save open documents. * [Session Management](https://doc.qt.io/qt-6.2/session.html) qt CanvasGradient QML Type CanvasGradient QML Type ======================= Provides an opaque CanvasGradient interface. [More...](#details) | | | | --- | --- | | Import Statement: | import QtQuick | | Since: | Qt 5.0 | * [List of all members, including inherited members](https://doc.qt.io/qt-6.2/qml-qtquick-canvasgradient-members.html) Methods ------- * CanvasGradient **[addColorStop](qml-qtquick-canvasgradient#addColorStop-method)**(real *offset*, string *color*) Detailed Description -------------------- Method Documentation -------------------- ### [CanvasGradient](qml-qtquick-canvasgradient) addColorStop([real](qml-real) *offset*, [string](qml-string) *color*) Adds a color stop with the given *color* to the gradient at the given *offset*. 0.0 is the offset at one end of the gradient, 1.0 is the offset at the other end. For example: ``` var gradient = ctx.createLinearGradient(0, 0, 100, 100); gradient.addColorStop(0.3, Qt.rgba(1, 0, 0, 1)); gradient.addColorStop(0.7, 'rgba(0, 255, 255, 1'); ```
programming_docs
qt AnimationController QML Type AnimationController QML Type ============================ Enables manual control of animations. [More...](#details) | | | | --- | --- | | Import Statement: | import QtQuick | * [List of all members, including inherited members](https://doc.qt.io/qt-6.2/qml-qtquick-animationcontroller-members.html) Properties ---------- * **[animation](qml-qtquick-animationcontroller#animation-prop)** : Animation * **[progress](qml-qtquick-animationcontroller#progress-prop)** : real Methods ------- * **[completeToBeginning](qml-qtquick-animationcontroller#completeToBeginning-method)**() * **[completeToEnd](qml-qtquick-animationcontroller#completeToEnd-method)**() * **[reload](qml-qtquick-animationcontroller#reload-method)**() Detailed Description -------------------- Normally animations are driven by an internal timer, but the AnimationController allows the given *animation* to be driven by a *progress* value explicitly. Property Documentation ---------------------- ### [default] animation : [Animation](qml-qtquick-animation) This property holds the animation to be controlled by the [AnimationController](qml-qtquick-animationcontroller). Note:An animation controlled by [AnimationController](qml-qtquick-animationcontroller) will always have its `running` and `paused` properties set to true. It can not be manually started or stopped (much like an animation in a Behavior can not be manually started or stopped). ### progress : [real](qml-real) This property holds the animation progress value. The valid `progress` value is 0.0 to 1.0, setting values less than 0 will be converted to 0, setting values great than 1 will be converted to 1. Method Documentation -------------------- ### completeToBeginning() Finishes running the controlled animation in a backwards direction. After calling this method, the animation runs normally from the current progress point in a backwards direction to the beginning state. The animation controller's progress value will be automatically updated while the animation is running. **See also** [completeToEnd](qml-qtquick-animationcontroller#completeToEnd-method)() and [progress](qml-qtquick-animationcontroller#progress-prop). ### completeToEnd() Finishes running the controlled animation in a forwards direction. After calling this method, the animation runs normally from the current progress point in a forwards direction to the end state. The animation controller's progress value will be automatically updated while the animation is running. **See also** [completeToBeginning](qml-qtquick-animationcontroller#completeToBeginning-method)() and [progress](qml-qtquick-animationcontroller#progress-prop). ### reload() Reloads the animation properties If the animation properties changed, calling this method to reload the animation definations. qt Install Qt Design Studio Install Qt Design Studio ======================== To begin, create a [Qt Account](https://account.qt.io/). This account gives you access to a web portal to manage your licenses and download the standalone Qt Design Studio package. Qt Design Studio is also available as a free community version. It does not include the Qt Bridge asset export and import tools for Photoshop, Sketch, and Figma. However, you can purchase Qt Bridge separately at [Qt Marketplace](https://marketplace.qt.io). The Qt Design Studio installer installs and configures all the modules and tools you need to design UIs and preview them on the desktop. After the installation, you can start exploring Qt Design Studio by opening examples, following tutorials, watching videos, and reading the [Qt Design Studio Manual](https://doc.qt.io/qtdesignstudio/index.html). qt QScxmlTableData Class QScxmlTableData Class ===================== The QScxmlTableData class is used by compiled state machines. [More...](#details) | | | | --- | --- | | Header: | #include <QScxmlTableData> | | CMake: | find\_package(Qt6 COMPONENTS Scxml REQUIRED) target\_link\_libraries(mytarget PRIVATE Qt6::Scxml) | | qmake: | QT += scxml | | Since: | Qt 5.8 | * [List of all members, including inherited members](https://doc.qt.io/qt-6.2/qscxmltabledata-members.html) Public Functions ---------------- | | | | --- | --- | | virtual | **[~QScxmlTableData](qscxmltabledata#dtor.QScxmlTableData)**() | | virtual QScxmlExecutableContent::AssignmentInfo | **[assignmentInfo](qscxmltabledata#assignmentInfo)**(QScxmlExecutableContent::EvaluatorId *assignmentId*) const = 0 | | virtual QScxmlExecutableContent::StringId \* | **[dataNames](qscxmltabledata#dataNames)**(int \**count*) const = 0 | | virtual QScxmlExecutableContent::EvaluatorInfo | **[evaluatorInfo](qscxmltabledata#evaluatorInfo)**(QScxmlExecutableContent::EvaluatorId *evaluatorId*) const = 0 | | virtual QScxmlExecutableContent::ForeachInfo | **[foreachInfo](qscxmltabledata#foreachInfo)**(QScxmlExecutableContent::EvaluatorId *foreachId*) const = 0 | | virtual QScxmlExecutableContent::ContainerId | **[initialSetup](qscxmltabledata#initialSetup)**() const = 0 | | virtual QScxmlExecutableContent::InstructionId \* | **[instructions](qscxmltabledata#instructions)**() const = 0 | | virtual QString | **[name](qscxmltabledata#name)**() const = 0 | | virtual QScxmlInvokableServiceFactory \* | **[serviceFactory](qscxmltabledata#serviceFactory)**(int *id*) const = 0 | | virtual const qint32 \* | **[stateMachineTable](qscxmltabledata#stateMachineTable)**() const = 0 | | virtual QString | **[string](qscxmltabledata#string)**(QScxmlExecutableContent::StringId *id*) const = 0 | Detailed Description -------------------- QScxmlTableData is the interface to the compiled representation of SCXML state machines. It should only be used internally and by state machines compiled from SCXML documents. Member Function Documentation ----------------------------- ### `[virtual]` QScxmlTableData::~QScxmlTableData() Destroys the SXCML table data. ### `[pure virtual]` [QScxmlExecutableContent::AssignmentInfo](qscxmlexecutablecontent-assignmentinfo) QScxmlTableData::assignmentInfo([QScxmlExecutableContent::EvaluatorId](qscxmlexecutablecontent#EvaluatorId-typedef) *assignmentId*) const Returns the [QScxmlExecutableContent::AssignmentInfo](qscxmlexecutablecontent-assignmentinfo) object for the given *assignmentId*. ### `[pure virtual]` [QScxmlExecutableContent::StringId](qscxmlexecutablecontent#StringId-typedef) \*QScxmlTableData::dataNames(int \**count*) const Retrieves the string IDs for the names of data items in the data model. The number of strings is saved into *count* and a pointer to an array of string IDs is returned. Returns a pointer to an array of string IDs. ### `[pure virtual]` [QScxmlExecutableContent::EvaluatorInfo](qscxmlexecutablecontent-evaluatorinfo) QScxmlTableData::evaluatorInfo([QScxmlExecutableContent::EvaluatorId](qscxmlexecutablecontent#EvaluatorId-typedef) *evaluatorId*) const Returns the [QScxmlExecutableContent::EvaluatorInfo](qscxmlexecutablecontent-evaluatorinfo) object for the given *evaluatorId*. ### `[pure virtual]` [QScxmlExecutableContent::ForeachInfo](qscxmlexecutablecontent-foreachinfo) QScxmlTableData::foreachInfo([QScxmlExecutableContent::EvaluatorId](qscxmlexecutablecontent#EvaluatorId-typedef) *foreachId*) const Returns the [QScxmlExecutableContent::ForeachInfo](qscxmlexecutablecontent-foreachinfo) object for the given *foreachId*. ### `[pure virtual]` [QScxmlExecutableContent::ContainerId](qscxmlexecutablecontent#ContainerId-typedef) QScxmlTableData::initialSetup() const Initializes the table data. Returns the ID of the container with instructions to be executed when initializing the state machine. ### `[pure virtual]` [QScxmlExecutableContent::InstructionId](qscxmlexecutablecontent#InstructionId-typedef) \*QScxmlTableData::instructions() const Returns a pointer to the instructions of executable content contained in the state machine. ### `[pure virtual]` [QString](qstring) QScxmlTableData::name() const Returns the name of the state machine. ### `[pure virtual]` [QScxmlInvokableServiceFactory](qscxmlinvokableservicefactory) \*QScxmlTableData::serviceFactory(int *id*) const Returns the service factory that creates invokable services for the state with the ID *id*. ### `[pure virtual]` const [qint32](qtglobal#qint32-typedef) \*QScxmlTableData::stateMachineTable() const Returns a pointer to the complete state table, expressed as an opaque sequence of integers. ### `[pure virtual]` [QString](qstring) QScxmlTableData::string([QScxmlExecutableContent::StringId](qscxmlexecutablecontent#StringId-typedef) *id*) const Returns a [QString](qstring) for the given *id*. qt Qt 3D Render Geometry Qt 3D Render Geometry ===================== Qt 3D Render provides a generic way of storing geometry data and specifying how it should be read by the renderer. * [Buffer](qt3drender-geometry#buffer) * [Attribute](qt3drender-geometry#attribute) * [Geometry](qt3drender-geometry#geometry) * [GeometryRenderer](qt3drender-geometry#geometryrenderer) ### Buffer The [Qt3DCore::QBuffer](qt3dcore-qbuffer) class stores the raw data. This acts purely as an array of memory. In most cases a [Qt3DCore::QBuffer](qt3dcore-qbuffer) will be used indirectly by being referenced by one or more Qt3DRender::QAttributes. However there are times when a [QBuffer](qbuffer) may be used directly as the value property of a QParameter when dealing with Uniform Buffer Objects (UBO) or Shader Storage Buffer Objects (SSBO). ``` Buffer { id: vertexBuffer type: Buffer.VertexBuffer data: buildVertexBufferData() } ``` ### Attribute [Qt3DCore::QAttribute](qt3dcore-qattribute) specifies how data contained in the referenced buffer should be extracted and passed to an input of a vertex shader. It references a [Qt3DCore::QBuffer](qt3dcore-qbuffer) and can specify the layout of the attributes by definining the vertex size, the data type, the stride between two vertices and a starting offset. The type of the attribute will also define whether it is to be used as a vertex buffer or as an index buffer. This allows you complete flexibility of how you structure your data in buffers. It is possible to use separate buffers for each vertex attribute, an interleaved buffer containing data for all attributes or a combination of separate and interleaved buffers. ``` Attribute { attributeType: Attribute.VertexAttribute vertexBaseType: Attribute.Float vertexSize: 3 byteOffset: 0 byteStride: 9 * 4 count: 4 name: defaultPositionAttributeName() buffer: vertexBuffer } ``` ### Geometry A [Qt3DCore::QGeometry](qt3dcore-qgeometry) aggregates various attributes to form a piece of geometry. Usually a proper geometry will provide an attribute for vertex positions, an attribute for vertex normals and an attribute for texture coordinates. If you want your geometry to also work with normal mapped materials it will need to provide a consistent set of vertex tangent vectors too. ``` Geometry { Attribute { attributeType: Attribute.VertexAttribute vertexBaseType: Attribute.Float vertexSize: 3 byteOffset: 0 byteStride: 9 * 4 count: 4 name: defaultPositionAttributeName() buffer: vertexBuffer } Attribute { attributeType: Attribute.VertexAttribute vertexBaseType: Attribute.Float vertexSize: 3 byteOffset: 3 * 4 byteStride: 9 * 4 count: 4 name: defaultNormalAttributeName() buffer: vertexBuffer } ``` ### GeometryView A [Qt3DCore::QGeometryView](qt3dcore-qgeometryview) takes a [Qt3DCore::QGeometry](qt3dcore-qgeometry). It provides properties to control the draw call such as the number of instances to be drawn, the starting instance, the type of [Qt3DCore::QGeometryView::PrimitiveType](qt3dcore-qgeometryview#PrimitiveType-enum) to be used, etc. It completely defines the details of a mesh so that operations such as bounding volume computation and picking can be done on a mesh without requiring it to be rendered. ``` GeometryView { instanceCount: 1 indexOffset: 0 firstInstance: 0 primitiveType: GeometryRenderer.Triangles geometry: Geometry { ... } } ``` ### GeometryRenderer [Qt3DRender::QGeometryRenderer](qt3drender-qgeometryrenderer) is a QComponent which when aggregated by a QEntity allows to draw the [Qt3DCore::QGeometryView](qt3dcore-qgeometryview) it references. A [Qt3DRender::QGeometryRenderer](qt3drender-qgeometryrenderer) is translated into a draw call to the underlying graphics API. ``` GeometryRenderer { view: GeometryView { ... } } ``` **Note:** Prior to Qt 6, [Qt3DRender::QGeometryRenderer](qt3drender-qgeometryrenderer) included details that are now intended to be provided by the view instance. The properties are still there in Qt 6 but will be deprecated and then removed in Qt 7. qt SystemId Class SystemId Class ============== class [QCalendar](qcalendar)::SystemId This class was introduced in Qt 6.2. * [List of all members, including inherited members](https://doc.qt.io/qt-6.2/qcalendar-systemid-members.html) Public Functions ---------------- | | | | --- | --- | | bool | **[isValid](qcalendar-systemid#isValid)**() const | Detailed Description -------------------- This is an opaque type used to identify custom calendar implementations. The only supported source for values of this type is the backend's `calendarId()` method. A value of this type whose [isValid](qcalendar-systemid#isValid)() is false does not identify a successfully-registered backend. The only valid consumer of values of this type is a [QCalendar](qcalendar) constructor, which will only produce a valid [QCalendar](qcalendar) instance if the ID passed to it is valid. **See also** [QCalendar](qcalendar) and [QCalendar::System](qcalendar#System-enum). Member Function Documentation ----------------------------- ### bool SystemId::isValid() const Returns `true` if this is a valid calendar implementation identifier, `false` otherwise. **See also** [QCalendar](qcalendar). qt QActionInput Class QActionInput Class ================== class [Qt3DInput](https://doc.qt.io/qt-6.2/qt3dinput-module.html)::QActionInput QActionInput stores Device and Buttons used to trigger an input event. [More...](#details) | | | | --- | --- | | Header: | #include <QActionInput> | | CMake: | find\_package(Qt6 COMPONENTS 3dinput REQUIRED) target\_link\_libraries(mytarget PRIVATE Qt6::3dinput) | | qmake: | QT += 3dinput | | Since: | Qt 5.7 | | Instantiated By: | [ActionInput](qml-qt3d-input-actioninput) | | Inherits: | [Qt3DInput::QAbstractActionInput](qt3dinput-qabstractactioninput) | * [List of all members, including inherited members](https://doc.qt.io/qt-6.2/qt3dinput-qactioninput-members.html) Properties ---------- * **[buttons](qt3dinput-qactioninput#buttons-prop)** : QList<int> * **[sourceDevice](qt3dinput-qactioninput#sourceDevice-prop)** : Qt3DInput::QAbstractPhysicalDevice\* Public Functions ---------------- | | | | --- | --- | | | **[QActionInput](qt3dinput-qactioninput#QActionInput)**(Qt3DCore::QNode \**parent* = nullptr) | | QList<int> | **[buttons](qt3dinput-qactioninput#buttons-prop)**() const | | Qt3DInput::QAbstractPhysicalDevice \* | **[sourceDevice](qt3dinput-qactioninput#sourceDevice-prop)**() const | Public Slots ------------ | | | | --- | --- | | void | **[setButtons](qt3dinput-qactioninput#setButtons)**(const QList<int> &*buttons*) | | void | **[setSourceDevice](qt3dinput-qactioninput#sourceDevice-prop)**(Qt3DInput::QAbstractPhysicalDevice \**sourceDevice*) | Signals ------- | | | | --- | --- | | void | **[buttonsChanged](qt3dinput-qactioninput#buttonsChanged)**(const QList<int> &*buttons*) | | void | **[sourceDeviceChanged](qt3dinput-qactioninput#sourceDeviceChanged)**(Qt3DInput::QAbstractPhysicalDevice \**sourceDevice*) | Detailed Description -------------------- Property Documentation ---------------------- ### buttons : [QList](qlist)<int> Holds the buttons that can trigger this Action. **Access functions:** | | | | --- | --- | | QList<int> | **buttons**() const | | void | **[setButtons](qt3dinput-qactioninput#setButtons)**(const QList<int> &*buttons*) | **Notifier signal:** | | | | --- | --- | | void | **[buttonsChanged](qt3dinput-qactioninput#buttonsChanged)**(const QList<int> &*buttons*) | ### sourceDevice : [Qt3DInput::QAbstractPhysicalDevice](qt3dinput-qabstractphysicaldevice)\* The current source device of the [QActionInput](qt3dinput-qactioninput). **Access functions:** | | | | --- | --- | | Qt3DInput::QAbstractPhysicalDevice \* | **sourceDevice**() const | | void | **setSourceDevice**(Qt3DInput::QAbstractPhysicalDevice \**sourceDevice*) | **Notifier signal:** | | | | --- | --- | | void | **[sourceDeviceChanged](qt3dinput-qactioninput#sourceDeviceChanged)**(Qt3DInput::QAbstractPhysicalDevice \**sourceDevice*) | Member Function Documentation ----------------------------- ### QActionInput::QActionInput([Qt3DCore::QNode](qt3dcore-qnode) \**parent* = nullptr) Constructs a new QActionInput instance with *parent*. ### `[signal]` void QActionInput::buttonsChanged(const [QList](qlist)<int> &*buttons*) This signal is emitted when the buttons associated with the action input is changed. The buttons changed are *buttons* **Note:** Notifier signal for property [buttons](qt3dinput-qactioninput#buttons-prop). ### `[slot]` void QActionInput::setButtons(const [QList](qlist)<int> &*buttons*) Set the buttons to trigger the [QActionInput](qt3dinput-qactioninput) instance to *buttons*. **Note:** Setter function for property [buttons](qt3dinput-qactioninput#buttons-prop). **See also** [buttons](qt3dinput-qactioninput#buttons-prop)(). ### `[signal]` void QActionInput::sourceDeviceChanged([Qt3DInput::QAbstractPhysicalDevice](qt3dinput-qabstractphysicaldevice) \**sourceDevice*) This signal is emitted when the source device associated with the action input is changed to *sourceDevice*. **Note:** Notifier signal for property [sourceDevice](qt3dinput-qactioninput#sourceDevice-prop). qt QBarLegendMarker Class QBarLegendMarker Class ====================== The QBarLegendMarker class is a legend marker for a bar series. [More...](#details) | | | | --- | --- | | Header: | #include <QBarLegendMarker> | | Inherits: | [QLegendMarker](qlegendmarker) | * [List of all members, including inherited members](https://doc.qt.io/qt-6.2/qbarlegendmarker-members.html) Public Functions ---------------- | | | | --- | --- | | virtual | **[~QBarLegendMarker](qbarlegendmarker#dtor.QBarLegendMarker)**() | | QBarSet \* | **[barset](qbarlegendmarker#barset)**() | Reimplemented Public Functions ------------------------------ | | | | --- | --- | | virtual QAbstractBarSeries \* | **[series](qbarlegendmarker#series)**() override | | virtual QLegendMarker::LegendMarkerType | **[type](qbarlegendmarker#type)**() override | Detailed Description -------------------- A bar legend marker is related to [QAbstractBarSeries](qabstractbarseries) derived classes. With a bar series, each marker is related to one [QBarSet](qbarset). **See also** [QLegend](qlegend), [QAbstractBarSeries](qabstractbarseries), and [QBarSet](qbarset). Member Function Documentation ----------------------------- ### `[virtual]` QBarLegendMarker::~QBarLegendMarker() Removes the legend marker for a bar set. ### [QBarSet](qbarset) \*QBarLegendMarker::barset() Returns the bar set related to the marker. ### `[override virtual]` [QAbstractBarSeries](qabstractbarseries) \*QBarLegendMarker::series() Reimplements: [QLegendMarker::series](qlegendmarker#series)(). ### `[override virtual]` [QLegendMarker::LegendMarkerType](qlegendmarker#LegendMarkerType-enum) QBarLegendMarker::type() Reimplements: [QLegendMarker::type](qlegendmarker#type)().
programming_docs
qt QAxScript Class QAxScript Class =============== The QAxScript class provides a wrapper around script code. [More...](#details) | | | | --- | --- | | Header: | #include <QAxScript> | | CMake: | find\_package(Qt6 COMPONENTS AxContainer REQUIRED) target\_link\_libraries(mytarget PRIVATE Qt6::AxContainer) | | qmake: | QT += axcontainer | | Inherits: | [QObject](qobject) | * [List of all members, including inherited members](https://doc.qt.io/qt-6.2/qaxscript-members.html) Public Types ------------ | | | | --- | --- | | enum | **[FunctionFlags](qaxscript#FunctionFlags-enum)** { FunctionNames, FunctionSignatures } | Public Functions ---------------- | | | | --- | --- | | | **[QAxScript](qaxscript#QAxScript)**(const QString &*name*, QAxScriptManager \**manager*) | | virtual | **[~QAxScript](qaxscript#dtor.QAxScript)**() override | | QVariant | **[call](qaxscript#call)**(const QString &*function*, const QVariant &*var1* = QVariant(), const QVariant &*var2* = QVariant(), const QVariant &*var3* = QVariant(), const QVariant &*var4* = QVariant(), const QVariant &*var5* = QVariant(), const QVariant &*var6* = QVariant(), const QVariant &*var7* = QVariant(), const QVariant &*var8* = QVariant()) | | QVariant | **[call](qaxscript#call-1)**(const QString &*function*, QList<QVariant> &*arguments*) | | QStringList | **[functions](qaxscript#functions)**(QAxScript::FunctionFlags *flags* = FunctionNames) const | | bool | **[load](qaxscript#load)**(const QString &*code*, const QString &*language* = QString()) | | QString | **[scriptCode](qaxscript#scriptCode)**() const | | QAxScriptEngine \* | **[scriptEngine](qaxscript#scriptEngine)**() const | | QString | **[scriptName](qaxscript#scriptName)**() const | Signals ------- | | | | --- | --- | | void | **[entered](qaxscript#entered)**() | | void | **[error](qaxscript#error)**(int *code*, const QString &*description*, int *sourcePosition*, const QString &*sourceText*) | | void | **[finished](qaxscript#finished-2)**(int *code*, const QString &*source*, const QString &*description*, const QString &*help*) | | void | **[finished](qaxscript#finished-1)**(const QVariant &*result*) | | void | **[finished](qaxscript#finished)**() | | void | **[stateChanged](qaxscript#stateChanged)**(int *state*) | Detailed Description -------------------- Every instance of the QAxScript class represents a piece of scripting code in a particular scripting language. The code is loaded into the script engine using [load](qaxscript#load)(). Functions declared in the code can be called using [call](qaxscript#call)(). The script provides [scriptEngine](qaxscript#scriptEngine)() provides feedback to the application through signals. The most important signal is the [error](qaxscript#error)() signal. Direct access to the [QAxScriptEngine](qaxscriptengine) is provided through the [scriptEngine](qaxscript#scriptEngine)() function. **Warning:** This class is not available with the bcc5.5 compiler. **See also** [QAxScriptEngine](qaxscriptengine), [QAxScriptManager](qaxscriptmanager), [QAxBase](qaxbase), and [ActiveQt Framework](activeqt-index). Member Type Documentation ------------------------- ### enum QAxScript::FunctionFlags This FunctionFlags enum describes formatting for function introspection. | Constant | Value | Description | | --- | --- | --- | | `QAxScript::FunctionNames` | `0` | Only function names are returned. | | `QAxScript::FunctionSignatures` | `1` | Returns the functions with signatures. | Member Function Documentation ----------------------------- ### QAxScript::QAxScript(const [QString](qstring) &*name*, [QAxScriptManager](qaxscriptmanager) \**manager*) Constructs a QAxScript object called *name* and registers it with the [QAxScriptManager](qaxscriptmanager) *manager*. This is usually done by the [QAxScriptManager](qaxscriptmanager) class when [loading a script](qaxscriptmanager#load). A script should always have a name. A manager is necessary to allow the script code to reference objects in the application. The *manager* takes ownership of the object. ### `[signal]` void QAxScript::entered() This signal is emitted when a script engine has started executing code. ### `[signal]` void QAxScript::error(int *code*, const [QString](qstring) &*description*, int *sourcePosition*, const [QString](qstring) &*sourceText*) This signal is emitted when an execution error occurred while running a script. *code*, *description*, *sourcePosition* and *sourceText* contain information about the execution error. ### `[signal]` void QAxScript::finished(int *code*, const [QString](qstring) &*source*, const [QString](qstring) &*description*, const [QString](qstring) &*help*) This is an overloaded function. *code*, *source*, *description* and *help* contain exception information when the script terminated. **Note:** Signal *finished* is overloaded in this class. To connect to this signal by using the function pointer syntax, Qt provides a convenient helper for obtaining the function pointer as shown in this example: ``` connect(axScript, QOverload<int, const QString &, const QString &, const QString &>::of(&QAxScript::finished), [=](int code, const QString &source, const QString &description, const QString &help){ /* ... */ }); ``` ### `[signal]` void QAxScript::finished(const [QVariant](qvariant) &*result*) This is an overloaded function. *result* contains the script's result. This will be an invalid [QVariant](qvariant) if the script has no return value. **Note:** Signal *finished* is overloaded in this class. To connect to this signal by using the function pointer syntax, Qt provides a convenient helper for obtaining the function pointer as shown in this example: ``` connect(axScript, QOverload<const QVariant &>::of(&QAxScript::finished), [=](const QVariant &result){ /* ... */ }); ``` ### `[signal]` void QAxScript::finished() This signal is emitted when a script engine has finished executing code. **Note:** Signal *finished* is overloaded in this class. To connect to this signal by using the function pointer syntax, Qt provides a convenient helper for obtaining the function pointer as shown in this example: ``` connect(axScript, QOverload<>::of(&QAxScript::finished), [=](){ /* ... */ }); ``` ### `[signal]` void QAxScript::stateChanged(int *state*) This signal is emitted when a script engine changes state. *state* can be any value in the `QAxScriptEngine::State` enumeration. ### `[override virtual]` QAxScript::~QAxScript() Destroys the object, releasing all allocated resources. ### [QVariant](qvariant) QAxScript::call(const [QString](qstring) &*function*, const [QVariant](qvariant) &*var1* = QVariant(), const [QVariant](qvariant) &*var2* = QVariant(), const [QVariant](qvariant) &*var3* = QVariant(), const [QVariant](qvariant) &*var4* = QVariant(), const [QVariant](qvariant) &*var5* = QVariant(), const [QVariant](qvariant) &*var6* = QVariant(), const [QVariant](qvariant) &*var7* = QVariant(), const [QVariant](qvariant) &*var8* = QVariant()) Calls *function*, passing the parameters *var1*, *var1*, *var2*, *var3*, *var4*, *var5*, *var6*, *var7* and *var8* as arguments and returns the value returned by the function, or an invalid [QVariant](qvariant) if the function does not return a value or when the function call failed. See [QAxScriptManager::call](qaxscriptmanager#call)() for more information about how to call script functions. ### [QVariant](qvariant) QAxScript::call(const [QString](qstring) &*function*, [QList](qlist)<[QVariant](qvariant)> &*arguments*) This is an overloaded function. Calls *function* passing *arguments* as parameters, and returns the result. Returns when the script's execution has finished. See [QAxScriptManager::call](qaxscriptmanager#call)() for more information about how to call script functions. ### [QStringList](qstringlist) QAxScript::functions([QAxScript::FunctionFlags](qaxscript#FunctionFlags-enum) *flags* = FunctionNames) const Returns a list of all the functions in this script if the respective script engine supports introspection; otherwise returns an empty list. The functions are either provided with full prototypes or only as names, depending on the value of *flags*. **See also** [QAxScriptEngine::hasIntrospection](qaxscriptengine#hasIntrospection)(). ### bool QAxScript::load(const [QString](qstring) &*code*, const [QString](qstring) &*language* = QString()) Loads the script source *code* written in language *language* into the script engine. Returns true if *code* was successfully entered into the script engine; otherwise returns false. If *language* is empty (the default) it will be determined heuristically. If *code* contains the string `End Sub` it will be interpreted as VBScript, otherwise as JScript. Additional scripting languages can be registered using [QAxScriptManager::registerEngine](qaxscriptmanager#registerEngine)(). This function can only be called once for each [QAxScript](qaxscript) object, which is done automatically when using [QAxScriptManager::load](qaxscriptmanager#load)(). ### [QString](qstring) QAxScript::scriptCode() const Returns the script's code, or the null-string if no code has been loaded yet. **See also** [load](qaxscript#load)(). ### [QAxScriptEngine](qaxscriptengine) \*QAxScript::scriptEngine() const Returns a pointer to the script engine. You can use the object returned to connect signals to the script functions, or to access the script engine directly. ### [QString](qstring) QAxScript::scriptName() const Returns the name of the script. qt QDBusSignature Class QDBusSignature Class ==================== The QDBusSignature class enables the programmer to identify the SIGNATURE type provided by the D-Bus typesystem. [More...](#details) | | | | --- | --- | | Header: | #include <QDBusSignature> | | CMake: | find\_package(Qt6 COMPONENTS Dbus REQUIRED) target\_link\_libraries(mytarget PRIVATE Qt6::Dbus) | | qmake: | QT += dbus | * [List of all members, including inherited members](https://doc.qt.io/qt-6.2/qdbussignature-members.html) Public Functions ---------------- | | | | --- | --- | | | **[QDBusSignature](qdbussignature#QDBusSignature-3)**(const QString &*signature*) | | | **[QDBusSignature](qdbussignature#QDBusSignature-2)**(QLatin1String *signature*) | | | **[QDBusSignature](qdbussignature#QDBusSignature-1)**(const char \**signature*) | | | **[QDBusSignature](qdbussignature#QDBusSignature)**() | | void | **[setSignature](qdbussignature#setSignature)**(const QString &*signature*) | | QString | **[signature](qdbussignature#signature)**() const | | void | **[swap](qdbussignature#swap)**(QDBusSignature &*other*) | Detailed Description -------------------- **See also** [The Qt D-Bus Type System](qdbustypesystem). Member Function Documentation ----------------------------- ### QDBusSignature::QDBusSignature(const [QString](qstring) &*signature*) Constructs a new signature from the given *signature*. ### QDBusSignature::QDBusSignature([QLatin1String](qlatin1string) *signature*) Constructs a new signature from the given *signature*. ### QDBusSignature::QDBusSignature(const char \**signature*) Constructs a new signature from the given *signature*. ### QDBusSignature::QDBusSignature() Constructs a new signature. **See also** [setSignature](qdbussignature#setSignature)(). ### void QDBusSignature::setSignature(const [QString](qstring) &*signature*) Assigns the value of the given *signature* to this signature. **See also** [signature](qdbussignature#signature)(). ### [QString](qstring) QDBusSignature::signature() const Returns this signature. **See also** [setSignature](qdbussignature#setSignature)(). ### void QDBusSignature::swap([QDBusSignature](qdbussignature#QDBusSignature) &*other*) Swaps this [QDBusSignature](qdbussignature) instance with *other*. qt WaylandHardwareLayer QML Type WaylandHardwareLayer QML Type ============================= Makes a parent [WaylandQuickItem](qml-qtwayland-compositor-waylandquickitem) use hardware layers for rendering. [More...](#details) | | | | --- | --- | | Import Statement: | import QtWayland.Compositor | * [List of all members, including inherited members](https://doc.qt.io/qt-6.2/qml-qtwayland-compositor-waylandhardwarelayer-members.html) Properties ---------- * **[stackingLevel](qml-qtwayland-compositor-waylandhardwarelayer#stackingLevel-prop)** : int Detailed Description -------------------- This item needs to be a descendant of a [WaylandQuickItem](qml-qtwayland-compositor-waylandquickitem) or a derivative, (i.e. [ShellSurfaceItem](qml-qtwayland-compositor-shellsurfaceitem) or similar) The Surface of the parent [WaylandQuickItem](qml-qtwayland-compositor-waylandquickitem) will be drawn in a hardware specific way instead of the regular way using the [QtQuick](https://doc.qt.io/qt-6.2/qtquick-module.html) scene graph. On some platforms, the [WaylandQuickItem](qml-qtwayland-compositor-waylandquickitem)'s current buffer and the scene graph can be blended in a separate step. This makes it possible for clients to update continuously without triggering a full redraw of the compositor scene graph for each frame. The preferred hardware layer integration may be overridden by setting the QT\_WAYLAND\_HARDWARE\_LAYER\_INTEGRATION environment variable. Property Documentation ---------------------- ### stackingLevel : [int](qml-int) This property holds the stacking level of this hardware layer relative to other hardware layers, and can be used to sort hardware layers. I.e. a layer with a higher level is rendered on top of one with a lower level. Layers with level 0 will be drawn in an implementation defined order on top of the compositor scene graph. Layers with a level below 0 are drawn beneath the compositor scene graph, if supported by the hardware layer integration. qt Slider QML Type Slider QML Type =============== Used to select a value by sliding a handle along a track. [More...](#details) | | | | --- | --- | | Import Statement: | import QtQuick.Controls | | Since: | Qt 5.7 | | Inherits: | [Control](qml-qtquick-controls2-control) | * [List of all members, including inherited members](https://doc.qt.io/qt-6.2/qml-qtquick-controls2-slider-members.html) Properties ---------- * **[from](qml-qtquick-controls2-slider#from-prop)** : real * **[handle](qml-qtquick-controls2-slider#handle-prop)** : Item * **[horizontal](qml-qtquick-controls2-slider#horizontal-prop)** : bool * **[implicitHandleHeight](qml-qtquick-controls2-slider#implicitHandleHeight-prop)** : real * **[implicitHandleWidth](qml-qtquick-controls2-slider#implicitHandleWidth-prop)** : real * **[live](qml-qtquick-controls2-slider#live-prop)** : bool * **[orientation](qml-qtquick-controls2-slider#orientation-prop)** : enumeration * **[position](qml-qtquick-controls2-slider#position-prop)** : real * **[pressed](qml-qtquick-controls2-slider#pressed-prop)** : bool * **[snapMode](qml-qtquick-controls2-slider#snapMode-prop)** : enumeration * **[stepSize](qml-qtquick-controls2-slider#stepSize-prop)** : real * **[to](qml-qtquick-controls2-slider#to-prop)** : real * **[touchDragThreshold](qml-qtquick-controls2-slider#touchDragThreshold-prop)** : qreal * **[value](qml-qtquick-controls2-slider#value-prop)** : real * **[vertical](qml-qtquick-controls2-slider#vertical-prop)** : bool * **[visualPosition](qml-qtquick-controls2-slider#visualPosition-prop)** : real Signals ------- * **[moved](qml-qtquick-controls2-slider#moved-signal)**() Methods ------- * void **[decrease](qml-qtquick-controls2-slider#decrease-method)**() * void **[increase](qml-qtquick-controls2-slider#increase-method)**() * real **[valueAt](qml-qtquick-controls2-slider#valueAt-method)**(real *position*) Detailed Description -------------------- Slider is used to select a value by sliding a handle along a track. In the example below, custom [from](qml-qtquick-controls2-slider#from-prop), [value](qml-qtquick-controls2-slider#value-prop), and [to](qml-qtquick-controls2-slider#to-prop) values are set: ``` Slider { from: 1 value: 25 to: 100 } ``` The [position](qml-qtquick-controls2-slider#position-prop) property is expressed as a fraction of the control's size, in the range `0.0 - 1.0`. The [visualPosition](qml-qtquick-controls2-slider#visualPosition-prop) property is the same, except that it is reversed in a [right-to-left](qtquick-positioning-righttoleft) application. The [visualPosition](qml-qtquick-controls2-slider#visualPosition-prop) is useful for positioning the handle when styling Slider. In the example above, [visualPosition](qml-qtquick-controls2-slider#visualPosition-prop) will be `0.24` in a left-to-right application, and `0.76` in a right-to-left application. For a slider that allows the user to select a range by providing two handles, see [RangeSlider](qml-qtquick-controls2-rangeslider). **See also** [Customizing Slider](qtquickcontrols2-customize#customizing-slider) and [Input Controls](qtquickcontrols2-input). Property Documentation ---------------------- ### from : [real](qml-real) This property holds the starting value for the range. The default value is `0.0`. **See also** [to](qml-qtquick-controls2-slider#to-prop) and [value](qml-qtquick-controls2-slider#value-prop). ### handle : [Item](qml-qtquick-item) This property holds the handle item. **See also** [Customizing Slider](qtquickcontrols2-customize#customizing-slider). ### [read-only, since QtQuick.Controls 2.3 (Qt 5.10)] horizontal : [bool](qml-bool) This property holds whether the slider is horizontal. This property was introduced in QtQuick.Controls 2.3 (Qt 5.10). **See also** [orientation](qml-qtquick-controls2-slider#orientation-prop). ### [read-only, since QtQuick.Controls 2.5 (Qt 5.12)] implicitHandleHeight : [real](qml-real) This property holds the implicit handle height. The value is equal to `handle ? handle.implicitHeight : 0`. This is typically used, together with [implicitContentHeight](qml-qtquick-controls2-control#implicitContentHeight-prop) and [implicitBackgroundHeight](qml-qtquick-controls2-control#implicitBackgroundHeight-prop), to calculate the [implicitHeight](qml-qtquick-item#implicitHeight-prop). This property was introduced in QtQuick.Controls 2.5 (Qt 5.12). **See also** [implicitHandleWidth](qml-qtquick-controls2-slider#implicitHandleWidth-prop). ### [read-only, since QtQuick.Controls 2.5 (Qt 5.12)] implicitHandleWidth : [real](qml-real) This property holds the implicit handle width. The value is equal to `handle ? handle.implicitWidth : 0`. This is typically used, together with [implicitContentWidth](qml-qtquick-controls2-control#implicitContentWidth-prop) and [implicitBackgroundWidth](qml-qtquick-controls2-control#implicitBackgroundWidth-prop), to calculate the [implicitWidth](qml-qtquick-item#implicitWidth-prop). This property was introduced in QtQuick.Controls 2.5 (Qt 5.12). **See also** [implicitHandleHeight](qml-qtquick-controls2-slider#implicitHandleHeight-prop). ### [since QtQuick.Controls 2.2 (Qt 5.9)] live : [bool](qml-bool) This property holds whether the slider provides live updates for the [value](qml-qtquick-controls2-slider#value-prop) property while the handle is dragged. The default value is `true`. This property was introduced in QtQuick.Controls 2.2 (Qt 5.9). **See also** [value](qml-qtquick-controls2-slider#value-prop) and [valueAt](qml-qtquick-controls2-slider#valueAt-method)(). ### orientation : [enumeration](qml-enumeration) This property holds the orientation. Possible values: | Constant | Description | | --- | --- | | `Qt.Horizontal` | Horizontal (default) | | `Qt.Vertical` | Vertical | **See also** [horizontal](qml-qtquick-controls2-slider#horizontal-prop) and [vertical](qml-qtquick-controls2-slider#vertical-prop). ### [read-only] position : [real](qml-real) This property holds the logical position of the handle. The position is expressed as a fraction of the control's size, in the range `0.0 - 1.0`. For visualizing a slider, the right-to-left aware [visualPosition](qml-qtquick-controls2-slider#visualPosition-prop) should be used instead. **See also** [value](qml-qtquick-controls2-slider#value-prop), [visualPosition](qml-qtquick-controls2-slider#visualPosition-prop), and [valueAt](qml-qtquick-controls2-slider#valueAt-method)(). ### pressed : [bool](qml-bool) This property holds whether the slider is pressed by either touch, mouse, or keys. ### snapMode : [enumeration](qml-enumeration) This property holds the snap mode. The snap mode determines how the slider handle behaves with regards to the [stepSize](qml-qtquick-controls2-slider#stepSize-prop). Possible values: | Constant | Description | | --- | --- | | `Slider.NoSnap` | The slider does not snap (default). | | `Slider.SnapAlways` | The slider snaps while the handle is dragged. | | `Slider.SnapOnRelease` | The slider does not snap while being dragged, but only after the handle is released. | In the following table, the various modes are illustrated with animations. The movement of the mouse cursor and the [stepSize](qml-qtquick-controls2-slider#stepSize-prop) (`0.2`) are identical in each animation. | **Value** | **Example** | | `Slider.NoSnap` | | | `Slider.SnapAlways` | | | `Slider.SnapOnRelease` | | **See also** [stepSize](qml-qtquick-controls2-slider#stepSize-prop). ### stepSize : [real](qml-real) This property holds the step size. The default value is `0.0`. **See also** [snapMode](qml-qtquick-controls2-slider#snapMode-prop), [increase](qml-qtquick-controls2-slider#increase-method)(), and [decrease](qml-qtquick-controls2-slider#decrease-method)(). ### to : [real](qml-real) This property holds the end value for the range. The default value is `1.0`. **See also** [from](qml-qtquick-controls2-slider#from-prop) and [value](qml-qtquick-controls2-slider#value-prop). ### [since QtQuick.Controls 2.5 (Qt 5.12)] touchDragThreshold : qreal This property holds the threshold (in logical pixels) at which a touch drag event will be initiated. The mouse drag threshold won't be affected. The default value is `Qt.styleHints.startDragDistance`. This property was introduced in QtQuick.Controls 2.5 (Qt 5.12). **See also** [QStyleHints](qstylehints). ### value : [real](qml-real) This property holds the value in the range `from` - `to`. The default value is `0.0`. **See also** [position](qml-qtquick-controls2-slider#position-prop). ### [read-only, since QtQuick.Controls 2.3 (Qt 5.10)] vertical : [bool](qml-bool) This property holds whether the slider is vertical. This property was introduced in QtQuick.Controls 2.3 (Qt 5.10). **See also** [orientation](qml-qtquick-controls2-slider#orientation-prop). ### [read-only] visualPosition : [real](qml-real) This property holds the visual position of the handle. The position is expressed as a fraction of the control's size, in the range `0.0 - 1.0`. When the control is [mirrored](qml-qtquick-controls2-control#mirrored-prop), the value is equal to `1.0 - position`. This makes the value suitable for visualizing the slider, taking right-to-left support into account. **See also** [position](qml-qtquick-controls2-slider#position-prop). Signal Documentation -------------------- ### `[since QtQuick.Controls 2.2 (Qt 5.9)]` moved() This signal is emitted when the slider has been interactively moved by the user by either touch, mouse, wheel, or keys. **Note:** The corresponding handler is `onMoved`. This signal was introduced in QtQuick.Controls 2.2 (Qt 5.9). Method Documentation -------------------- ### void decrease() Decreases the value by [stepSize](qml-qtquick-controls2-slider#stepSize-prop) or `0.1` if [stepSize](qml-qtquick-controls2-slider#stepSize-prop) is not defined. **See also** [stepSize](qml-qtquick-controls2-slider#stepSize-prop). ### void increase() Increases the value by [stepSize](qml-qtquick-controls2-slider#stepSize-prop) or `0.1` if [stepSize](qml-qtquick-controls2-slider#stepSize-prop) is not defined. **See also** [stepSize](qml-qtquick-controls2-slider#stepSize-prop). ### `[since QtQuick.Controls 2.1 (Qt 5.8)]` [real](qml-real) valueAt([real](qml-real) *position*) Returns the value for the given *position*. This method was introduced in QtQuick.Controls 2.1 (Qt 5.8). **See also** [value](qml-qtquick-controls2-slider#value-prop) and [position](qml-qtquick-controls2-slider#position-prop).
programming_docs
qt QHeaderView Class QHeaderView Class ================= The QHeaderView class provides a header row or header column for item views. [More...](#details) | | | | --- | --- | | Header: | #include <QHeaderView> | | CMake: | find\_package(Qt6 COMPONENTS Widgets REQUIRED) target\_link\_libraries(mytarget PRIVATE Qt6::Widgets) | | qmake: | QT += widgets | | Inherits: | [QAbstractItemView](qabstractitemview) | * [List of all members, including inherited members](https://doc.qt.io/qt-6.2/qheaderview-members.html) Public Types ------------ | | | | --- | --- | | enum | **[ResizeMode](qheaderview#ResizeMode-enum)** { Interactive, Fixed, Stretch, ResizeToContents, Custom } | Properties ---------- | | | | --- | --- | | * **[cascadingSectionResizes](qheaderview#cascadingSectionResizes-prop)** : bool * **[defaultAlignment](qheaderview#defaultAlignment-prop)** : Qt::Alignment * **[defaultSectionSize](qheaderview#defaultSectionSize-prop)** : int * **[firstSectionMovable](qheaderview#firstSectionMovable-prop)** : bool * **[highlightSections](qheaderview#highlightSections-prop)** : bool | * **[maximumSectionSize](qheaderview#maximumSectionSize-prop)** : int * **[minimumSectionSize](qheaderview#minimumSectionSize-prop)** : int * **[showSortIndicator](qheaderview#showSortIndicator-prop)** : bool * **[sortIndicatorClearable](qheaderview#sortIndicatorClearable-prop)** : bool * **[stretchLastSection](qheaderview#stretchLastSection-prop)** : bool | Public Functions ---------------- | | | | --- | --- | | | **[QHeaderView](qheaderview#QHeaderView)**(Qt::Orientation *orientation*, QWidget \**parent* = nullptr) | | virtual | **[~QHeaderView](qheaderview#dtor.QHeaderView)**() | | bool | **[cascadingSectionResizes](qheaderview#cascadingSectionResizes-prop)**() const | | int | **[count](qheaderview#count)**() const | | Qt::Alignment | **[defaultAlignment](qheaderview#defaultAlignment-prop)**() const | | int | **[defaultSectionSize](qheaderview#defaultSectionSize-prop)**() const | | int | **[hiddenSectionCount](qheaderview#hiddenSectionCount)**() const | | void | **[hideSection](qheaderview#hideSection)**(int *logicalIndex*) | | bool | **[highlightSections](qheaderview#highlightSections-prop)**() const | | bool | **[isFirstSectionMovable](qheaderview#firstSectionMovable-prop)**() const | | bool | **[isSectionHidden](qheaderview#isSectionHidden)**(int *logicalIndex*) const | | bool | **[isSortIndicatorClearable](qheaderview#sortIndicatorClearable-prop)**() const | | bool | **[isSortIndicatorShown](qheaderview#showSortIndicator-prop)**() const | | int | **[length](qheaderview#length)**() const | | int | **[logicalIndex](qheaderview#logicalIndex)**(int *visualIndex*) const | | int | **[logicalIndexAt](qheaderview#logicalIndexAt)**(int *position*) const | | int | **[logicalIndexAt](qheaderview#logicalIndexAt-1)**(int *x*, int *y*) const | | int | **[logicalIndexAt](qheaderview#logicalIndexAt-2)**(const QPoint &*pos*) const | | int | **[maximumSectionSize](qheaderview#maximumSectionSize-prop)**() const | | int | **[minimumSectionSize](qheaderview#minimumSectionSize-prop)**() const | | void | **[moveSection](qheaderview#moveSection)**(int *from*, int *to*) | | int | **[offset](qheaderview#offset)**() const | | Qt::Orientation | **[orientation](qheaderview#orientation)**() const | | void | **[resetDefaultSectionSize](qheaderview#defaultSectionSize-prop)**() | | int | **[resizeContentsPrecision](qheaderview#resizeContentsPrecision)**() const | | void | **[resizeSection](qheaderview#resizeSection)**(int *logicalIndex*, int *size*) | | void | **[resizeSections](qheaderview#resizeSections)**(QHeaderView::ResizeMode *mode*) | | bool | **[restoreState](qheaderview#restoreState)**(const QByteArray &*state*) | | QByteArray | **[saveState](qheaderview#saveState)**() const | | int | **[sectionPosition](qheaderview#sectionPosition)**(int *logicalIndex*) const | | QHeaderView::ResizeMode | **[sectionResizeMode](qheaderview#sectionResizeMode)**(int *logicalIndex*) const | | int | **[sectionSize](qheaderview#sectionSize)**(int *logicalIndex*) const | | int | **[sectionSizeHint](qheaderview#sectionSizeHint)**(int *logicalIndex*) const | | int | **[sectionViewportPosition](qheaderview#sectionViewportPosition)**(int *logicalIndex*) const | | bool | **[sectionsClickable](qheaderview#sectionsClickable)**() const | | bool | **[sectionsHidden](qheaderview#sectionsHidden)**() const | | bool | **[sectionsMovable](qheaderview#sectionsMovable)**() const | | bool | **[sectionsMoved](qheaderview#sectionsMoved)**() const | | void | **[setCascadingSectionResizes](qheaderview#cascadingSectionResizes-prop)**(bool *enable*) | | void | **[setDefaultAlignment](qheaderview#defaultAlignment-prop)**(Qt::Alignment *alignment*) | | void | **[setDefaultSectionSize](qheaderview#defaultSectionSize-prop)**(int *size*) | | void | **[setFirstSectionMovable](qheaderview#firstSectionMovable-prop)**(bool *movable*) | | void | **[setHighlightSections](qheaderview#highlightSections-prop)**(bool *highlight*) | | void | **[setMaximumSectionSize](qheaderview#maximumSectionSize-prop)**(int *size*) | | void | **[setMinimumSectionSize](qheaderview#minimumSectionSize-prop)**(int *size*) | | void | **[setResizeContentsPrecision](qheaderview#setResizeContentsPrecision)**(int *precision*) | | void | **[setSectionHidden](qheaderview#setSectionHidden)**(int *logicalIndex*, bool *hide*) | | void | **[setSectionResizeMode](qheaderview#setSectionResizeMode)**(QHeaderView::ResizeMode *mode*) | | void | **[setSectionResizeMode](qheaderview#setSectionResizeMode-1)**(int *logicalIndex*, QHeaderView::ResizeMode *mode*) | | void | **[setSectionsClickable](qheaderview#setSectionsClickable)**(bool *clickable*) | | void | **[setSectionsMovable](qheaderview#setSectionsMovable)**(bool *movable*) | | void | **[setSortIndicator](qheaderview#setSortIndicator)**(int *logicalIndex*, Qt::SortOrder *order*) | | void | **[setSortIndicatorClearable](qheaderview#sortIndicatorClearable-prop)**(bool *clearable*) | | void | **[setSortIndicatorShown](qheaderview#showSortIndicator-prop)**(bool *show*) | | void | **[setStretchLastSection](qheaderview#stretchLastSection-prop)**(bool *stretch*) | | void | **[showSection](qheaderview#showSection)**(int *logicalIndex*) | | Qt::SortOrder | **[sortIndicatorOrder](qheaderview#sortIndicatorOrder)**() const | | int | **[sortIndicatorSection](qheaderview#sortIndicatorSection)**() const | | bool | **[stretchLastSection](qheaderview#stretchLastSection-prop)**() const | | int | **[stretchSectionCount](qheaderview#stretchSectionCount)**() const | | void | **[swapSections](qheaderview#swapSections)**(int *first*, int *second*) | | int | **[visualIndex](qheaderview#visualIndex)**(int *logicalIndex*) const | | int | **[visualIndexAt](qheaderview#visualIndexAt)**(int *position*) const | Reimplemented Public Functions ------------------------------ | | | | --- | --- | | virtual void | **[reset](qheaderview#reset)**() override | | virtual void | **[setModel](qheaderview#setModel)**(QAbstractItemModel \**model*) override | | virtual void | **[setVisible](qheaderview#setVisible)**(bool *v*) override | | virtual QSize | **[sizeHint](qheaderview#sizeHint)**() const override | Public Slots ------------ | | | | --- | --- | | void | **[headerDataChanged](qheaderview#headerDataChanged)**(Qt::Orientation *orientation*, int *logicalFirst*, int *logicalLast*) | | void | **[setOffset](qheaderview#setOffset)**(int *offset*) | | void | **[setOffsetToLastSection](qheaderview#setOffsetToLastSection)**() | | void | **[setOffsetToSectionPosition](qheaderview#setOffsetToSectionPosition)**(int *visualSectionNumber*) | Signals ------- | | | | --- | --- | | void | **[geometriesChanged](qheaderview#geometriesChanged)**() | | void | **[sectionClicked](qheaderview#sectionClicked)**(int *logicalIndex*) | | void | **[sectionCountChanged](qheaderview#sectionCountChanged)**(int *oldCount*, int *newCount*) | | void | **[sectionDoubleClicked](qheaderview#sectionDoubleClicked)**(int *logicalIndex*) | | void | **[sectionEntered](qheaderview#sectionEntered)**(int *logicalIndex*) | | void | **[sectionHandleDoubleClicked](qheaderview#sectionHandleDoubleClicked)**(int *logicalIndex*) | | void | **[sectionMoved](qheaderview#sectionMoved)**(int *logicalIndex*, int *oldVisualIndex*, int *newVisualIndex*) | | void | **[sectionPressed](qheaderview#sectionPressed)**(int *logicalIndex*) | | void | **[sectionResized](qheaderview#sectionResized)**(int *logicalIndex*, int *oldSize*, int *newSize*) | | void | **[sortIndicatorChanged](qheaderview#sortIndicatorChanged)**(int *logicalIndex*, Qt::SortOrder *order*) | | void | **[sortIndicatorClearableChanged](qheaderview#sortIndicatorClearable-prop)**(bool *clearable*) | Protected Functions ------------------- | | | | --- | --- | | virtual void | **[initStyleOption](qheaderview#initStyleOption)**(QStyleOptionHeader \**option*) const | | virtual void | **[initStyleOptionForIndex](qheaderview#initStyleOptionForIndex)**(QStyleOptionHeader \**option*, int *logicalIndex*) const | | virtual void | **[paintSection](qheaderview#paintSection)**(QPainter \**painter*, const QRect &*rect*, int *logicalIndex*) const | | virtual QSize | **[sectionSizeFromContents](qheaderview#sectionSizeFromContents)**(int *logicalIndex*) const | Reimplemented Protected Functions --------------------------------- | | | | --- | --- | | virtual void | **[currentChanged](qheaderview#currentChanged)**(const QModelIndex &*current*, const QModelIndex &*old*) override | | virtual bool | **[event](qheaderview#event)**(QEvent \**e*) override | | virtual int | **[horizontalOffset](qheaderview#horizontalOffset)**() const override | | virtual void | **[mouseDoubleClickEvent](qheaderview#mouseDoubleClickEvent)**(QMouseEvent \**e*) override | | virtual void | **[mouseMoveEvent](qheaderview#mouseMoveEvent)**(QMouseEvent \**e*) override | | virtual void | **[mousePressEvent](qheaderview#mousePressEvent)**(QMouseEvent \**e*) override | | virtual void | **[mouseReleaseEvent](qheaderview#mouseReleaseEvent)**(QMouseEvent \**e*) override | | virtual void | **[paintEvent](qheaderview#paintEvent)**(QPaintEvent \**e*) override | | virtual void | **[setSelection](qheaderview#setSelection)**(const QRect &*rect*, QItemSelectionModel::SelectionFlags *flags*) override | | virtual int | **[verticalOffset](qheaderview#verticalOffset)**() const override | | virtual bool | **[viewportEvent](qheaderview#viewportEvent)**(QEvent \**e*) override | Protected Slots --------------- | | | | --- | --- | | void | **[resizeSections](qheaderview#resizeSections-1)**() | | void | **[sectionsAboutToBeRemoved](qheaderview#sectionsAboutToBeRemoved)**(const QModelIndex &*parent*, int *logicalFirst*, int *logicalLast*) | | void | **[sectionsInserted](qheaderview#sectionsInserted)**(const QModelIndex &*parent*, int *logicalFirst*, int *logicalLast*) | Detailed Description -------------------- A QHeaderView displays the headers used in item views such as the [QTableView](qtableview) and [QTreeView](qtreeview) classes. It takes the place of Qt3's `QHeader` class previously used for the same purpose, but uses the Qt's model/view architecture for consistency with the item view classes. The QHeaderView class is one of the [Model/View Classes](model-view-programming#model-view-classes) and is part of Qt's [model/view framework](model-view-programming). The header gets the data for each section from the model using the [QAbstractItemModel::headerData](qabstractitemmodel#headerData)() function. You can set the data by using [QAbstractItemModel::setHeaderData](qabstractitemmodel#setHeaderData)(). Each header has an [orientation](qheaderview#orientation)() and a number of sections, given by the [count](qheaderview#count)() function. A section refers to a part of the header - either a row or a column, depending on the orientation. Sections can be moved and resized using [moveSection](qheaderview#moveSection)() and [resizeSection](qheaderview#resizeSection)(); they can also be hidden and shown with [hideSection](qheaderview#hideSection)() and [showSection](qheaderview#showSection)(). Each section of a header is described by a section ID, specified by its section(), and can be located at a particular [visualIndex](qheaderview#visualIndex)() in the header. A section can have a sort indicator set with [setSortIndicator](qheaderview#setSortIndicator)(); this indicates whether the items in the associated item view will be sorted in the order given by the section. For a horizontal header the section is equivalent to a column in the model, and for a vertical header the section is equivalent to a row in the model. ### Moving Header Sections A header can be fixed in place, or made movable with [setSectionsMovable](qheaderview#setSectionsMovable)(). It can be made clickable with [setSectionsClickable](qheaderview#setSectionsClickable)(), and has resizing behavior in accordance with [setSectionResizeMode](qheaderview#setSectionResizeMode)(). **Note:** Double-clicking on a header to resize a section only applies for visible rows. A header will emit [sectionMoved](qheaderview#sectionMoved)() if the user moves a section, [sectionResized](qheaderview#sectionResized)() if the user resizes a section, and [sectionClicked](qheaderview#sectionClicked)() as well as [sectionHandleDoubleClicked](qheaderview#sectionHandleDoubleClicked)() in response to mouse clicks. A header will also emit [sectionCountChanged](qheaderview#sectionCountChanged)(). You can identify a section using the [logicalIndex](qheaderview#logicalIndex)() and [logicalIndexAt](qheaderview#logicalIndexAt)() functions, or by its index position, using the [visualIndex](qheaderview#visualIndex)() and [visualIndexAt](qheaderview#visualIndexAt)() functions. The visual index will change if a section is moved, but the logical index will not change. ### Appearance [QTableWidget](qtablewidget) and [QTableView](qtableview) create default headers. If you want the headers to be visible, you can use [setVisible](qwidget#visible-prop)(). Not all [ItemDataRole](qt#ItemDataRole-enum)s will have an effect on a QHeaderView. If you need to draw other roles, you can subclass QHeaderView and reimplement [paintEvent](qheaderview#paintEvent)(). QHeaderView respects the following item data roles, unless they are in conflict with the style (which can happen for styles that follow the desktop theme): [TextAlignmentRole](qt#ItemDataRole-enum), [DisplayRole](qt#ItemDataRole-enum), [FontRole](qt#ItemDataRole-enum), [DecorationRole](qt#ItemDataRole-enum), [ForegroundRole](qt#ItemDataRole-enum), and [BackgroundRole](qt#ItemDataRole-enum). **Note:** Each header renders the data for each section itself, and does not rely on a delegate. As a result, calling a header's [setItemDelegate](qabstractitemview#setItemDelegate)() function will have no effect. **See also** [Model/View Programming](model-view-programming), [QListView](qlistview), [QTableView](qtableview), and [QTreeView](qtreeview). Member Type Documentation ------------------------- ### enum QHeaderView::ResizeMode The resize mode specifies the behavior of the header sections. It can be set on the entire header view or on individual sections using [setSectionResizeMode](qheaderview#setSectionResizeMode)(). | Constant | Value | Description | | --- | --- | --- | | `QHeaderView::Interactive` | `0` | The user can resize the section. The section can also be resized programmatically using [resizeSection](qheaderview#resizeSection)(). The section size defaults to [defaultSectionSize](qheaderview#defaultSectionSize-prop). (See also [cascadingSectionResizes](qheaderview#cascadingSectionResizes-prop).) | | `QHeaderView::Fixed` | `2` | The user cannot resize the section. The section can only be resized programmatically using [resizeSection](qheaderview#resizeSection)(). The section size defaults to [defaultSectionSize](qheaderview#defaultSectionSize-prop). | | `QHeaderView::Stretch` | `1` | [QHeaderView](qheaderview) will automatically resize the section to fill the available space. The size cannot be changed by the user or programmatically. | | `QHeaderView::ResizeToContents` | `3` | [QHeaderView](qheaderview) will automatically resize the section to its optimal size based on the contents of the entire column or row. The size cannot be changed by the user or programmatically. (This value was introduced in 4.2) | The following values are obsolete: | Constant | Value | Description | | --- | --- | --- | | `QHeaderView::Custom` | `Fixed` | Use Fixed instead. | **See also** [setSectionResizeMode](qheaderview#setSectionResizeMode)(), [stretchLastSection](qheaderview#stretchLastSection-prop), and [minimumSectionSize](qheaderview#minimumSectionSize-prop). Property Documentation ---------------------- ### cascadingSectionResizes : bool This property holds whether interactive resizing will be cascaded to the following sections once the section being resized by the user has reached its minimum size This property only affects sections that have [Interactive](qheaderview#ResizeMode-enum) as their resize mode. The default value is false. **Access functions:** | | | | --- | --- | | bool | **cascadingSectionResizes**() const | | void | **setCascadingSectionResizes**(bool *enable*) | **See also** [setSectionResizeMode](qheaderview#setSectionResizeMode)(). ### defaultAlignment : [Qt::Alignment](qt#AlignmentFlag-enum) This property holds the default alignment of the text in each header section **Access functions:** | | | | --- | --- | | Qt::Alignment | **defaultAlignment**() const | | void | **setDefaultAlignment**(Qt::Alignment *alignment*) | ### defaultSectionSize : int This property holds the default size of the header sections before resizing. This property only affects sections that have [Interactive](qheaderview#ResizeMode-enum) or [Fixed](qheaderview#ResizeMode-enum) as their resize mode. By default, the value of this property is style dependent. Thus, when the style changes, this property updates from it. Calling setDefaultSectionSize() stops the updates, calling resetDefaultSectionSize() will restore default behavior. **Access functions:** | | | | --- | --- | | int | **defaultSectionSize**() const | | void | **setDefaultSectionSize**(int *size*) | | void | **resetDefaultSectionSize**() | **See also** [setSectionResizeMode](qheaderview#setSectionResizeMode)() and [minimumSectionSize](qheaderview#minimumSectionSize-prop). ### `[since 5.11]` firstSectionMovable : bool This property holds whether the first column can be moved by the user This property controls whether the first column can be moved by the user. In a [QTreeView](qtreeview), the first column holds the tree structure and is therefore non-movable by default, even after [setSectionsMovable](qheaderview#setSectionsMovable)(true). It can be made movable again, for instance in the case of flat lists without a tree structure, by calling this method. In such a scenario, it is recommended to call [QTreeView::setRootIsDecorated](qtreeview#rootIsDecorated-prop)(false) as well. Setting it to true has no effect unless [setSectionsMovable](qheaderview#setSectionsMovable)(true) is called as well. This property was introduced in Qt 5.11. **Access functions:** | | | | --- | --- | | bool | **isFirstSectionMovable**() const | | void | **setFirstSectionMovable**(bool *movable*) | **See also** [setSectionsMovable](qheaderview#setSectionsMovable)(). ### highlightSections : bool This property holds whether the sections containing selected items are highlighted By default, this property is `false`. **Access functions:** | | | | --- | --- | | bool | **highlightSections**() const | | void | **setHighlightSections**(bool *highlight*) | ### `[since 5.2]` maximumSectionSize : int This property holds the maximum size of the header sections. The maximum section size is the largest section size allowed. The default value for this property is 1048575, which is also the largest possible size for a section. Setting maximum to -1 will reset the value to the largest section size. With exception of stretch this property is honored by all [resize modes](qheaderview#ResizeMode-enum) This property was introduced in Qt 5.2. **Access functions:** | | | | --- | --- | | int | **maximumSectionSize**() const | | void | **setMaximumSectionSize**(int *size*) | **See also** [setSectionResizeMode](qheaderview#setSectionResizeMode)() and [defaultSectionSize](qheaderview#defaultSectionSize-prop). ### minimumSectionSize : int This property holds the minimum size of the header sections. The minimum section size is the smallest section size allowed. If the minimum section size is set to -1, [QHeaderView](qheaderview) will use the [font metrics](qwidget#fontMetrics) size. This property is honored by all [resize modes](qheaderview#ResizeMode-enum). **Access functions:** | | | | --- | --- | | int | **minimumSectionSize**() const | | void | **setMinimumSectionSize**(int *size*) | **See also** [setSectionResizeMode](qheaderview#setSectionResizeMode)() and [defaultSectionSize](qheaderview#defaultSectionSize-prop). ### showSortIndicator : bool This property holds whether the sort indicator is shown By default, this property is `false`. **Access functions:** | | | | --- | --- | | bool | **isSortIndicatorShown**() const | | void | **setSortIndicatorShown**(bool *show*) | **See also** [setSectionsClickable](qheaderview#setSectionsClickable)(). ### `[since 6.1]` sortIndicatorClearable : bool This property holds whether the sort indicator can be cleared by clicking on a section multiple times This property controls whether the user is able to remove the sorting indicator on a given section by clicking on the section multiple times. Normally, clicking on a section will simply change the sorting order for that section. By setting this property to true, the sorting indicator will be cleared after alternating to ascending and descending; this will typically restore the original sorting of a model. Setting this property to true has no effect unless [sectionsClickable](qheaderview#sectionsClickable)() is also true (which is the default for certain views, for instance [QTableView](qtableview), or is automatically set when making a view sortable, for instance by calling [QTreeView::setSortingEnabled](qtreeview#sortingEnabled-prop)). This property was introduced in Qt 6.1. **Access functions:** | | | | --- | --- | | bool | **isSortIndicatorClearable**() const | | void | **setSortIndicatorClearable**(bool *clearable*) | **Notifier signal:** | | | | --- | --- | | void | **sortIndicatorClearableChanged**(bool *clearable*) | ### stretchLastSection : bool This property holds whether the last visible section in the header takes up all the available space The default value is false. **Note:** The horizontal headers provided by [QTreeView](qtreeview) are configured with this property set to true, ensuring that the view does not waste any of the space assigned to it for its header. If this value is set to true, this property will override the resize mode set on the last section in the header. **Access functions:** | | | | --- | --- | | bool | **stretchLastSection**() const | | void | **setStretchLastSection**(bool *stretch*) | **See also** [setSectionResizeMode](qheaderview#setSectionResizeMode)(). Member Function Documentation ----------------------------- ### QHeaderView::QHeaderView([Qt::Orientation](qt#Orientation-enum) *orientation*, [QWidget](qwidget#QWidget) \**parent* = nullptr) Creates a new generic header with the given *orientation* and *parent*. ### `[signal]` void QHeaderView::geometriesChanged() This signal is emitted when the header's geometries have changed. ### `[slot]` void QHeaderView::headerDataChanged([Qt::Orientation](qt#Orientation-enum) *orientation*, int *logicalFirst*, int *logicalLast*) Updates the changed header sections with the given *orientation*, from *logicalFirst* to *logicalLast* inclusive. ### `[protected slot]` void QHeaderView::resizeSections() Resizes the sections according to their size hints. Normally, you do not have to call this function. ### `[signal]` void QHeaderView::sectionClicked(int *logicalIndex*) This signal is emitted when a section is clicked. The section's logical index is specified by *logicalIndex*. Note that the [sectionPressed](qheaderview#sectionPressed) signal will also be emitted. **See also** [setSectionsClickable](qheaderview#setSectionsClickable)() and [sectionPressed](qheaderview#sectionPressed)(). ### `[signal]` void QHeaderView::sectionCountChanged(int *oldCount*, int *newCount*) This signal is emitted when the number of sections changes, i.e., when sections are added or deleted. The original count is specified by *oldCount*, and the new count by *newCount*. **See also** [count](qheaderview#count)(), [length](qheaderview#length)(), and [headerDataChanged](qheaderview#headerDataChanged)(). ### `[signal]` void QHeaderView::sectionDoubleClicked(int *logicalIndex*) This signal is emitted when a section is double-clicked. The section's logical index is specified by *logicalIndex*. **See also** [setSectionsClickable](qheaderview#setSectionsClickable)(). ### `[signal]` void QHeaderView::sectionEntered(int *logicalIndex*) This signal is emitted when the cursor moves over the section and the left mouse button is pressed. The section's logical index is specified by *logicalIndex*. **See also** [setSectionsClickable](qheaderview#setSectionsClickable)() and [sectionPressed](qheaderview#sectionPressed)(). ### `[signal]` void QHeaderView::sectionHandleDoubleClicked(int *logicalIndex*) This signal is emitted when a section is double-clicked. The section's logical index is specified by *logicalIndex*. **See also** [setSectionsClickable](qheaderview#setSectionsClickable)(). ### `[signal]` void QHeaderView::sectionMoved(int *logicalIndex*, int *oldVisualIndex*, int *newVisualIndex*) This signal is emitted when a section is moved. The section's logical index is specified by *logicalIndex*, the old index by *oldVisualIndex*, and the new index position by *newVisualIndex*. **See also** [moveSection](qheaderview#moveSection)(). ### `[signal]` void QHeaderView::sectionPressed(int *logicalIndex*) This signal is emitted when a section is pressed. The section's logical index is specified by *logicalIndex*. **See also** [setSectionsClickable](qheaderview#setSectionsClickable)(). ### `[signal]` void QHeaderView::sectionResized(int *logicalIndex*, int *oldSize*, int *newSize*) This signal is emitted when a section is resized. The section's logical number is specified by *logicalIndex*, the old size by *oldSize*, and the new size by *newSize*. **See also** [resizeSection](qheaderview#resizeSection)(). ### `[protected slot]` void QHeaderView::sectionsAboutToBeRemoved(const [QModelIndex](qmodelindex) &*parent*, int *logicalFirst*, int *logicalLast*) This slot is called when sections are removed from the *parent*. *logicalFirst* and *logicalLast* signify where the sections were removed. If only one section is removed, *logicalFirst* and *logicalLast* will be the same. ### `[protected slot]` void QHeaderView::sectionsInserted(const [QModelIndex](qmodelindex) &*parent*, int *logicalFirst*, int *logicalLast*) This slot is called when sections are inserted into the *parent*. *logicalFirst* and *logicalLast* indices signify where the new sections were inserted. If only one section is inserted, *logicalFirst* and *logicalLast* will be the same. ### `[slot]` void QHeaderView::setOffset(int *offset*) Sets the header's offset to *offset*. **See also** [offset](qheaderview#offset)() and [length](qheaderview#length)(). ### `[slot]` void QHeaderView::setOffsetToLastSection() Sets the offset to make the last section visible. **See also** [setOffset](qheaderview#setOffset)(), [sectionPosition](qheaderview#sectionPosition)(), and [setOffsetToSectionPosition](qheaderview#setOffsetToSectionPosition)(). ### `[slot]` void QHeaderView::setOffsetToSectionPosition(int *visualSectionNumber*) Sets the offset to the start of the section at the given *visualSectionNumber*. *visualSectionNumber* is the actual visible section when hiddenSections are not considered. That is not always the same as [visualIndex](qheaderview#visualIndex)(). **See also** [setOffset](qheaderview#setOffset)() and [sectionPosition](qheaderview#sectionPosition)(). ### `[signal]` void QHeaderView::sortIndicatorChanged(int *logicalIndex*, [Qt::SortOrder](qt#SortOrder-enum) *order*) This signal is emitted when the section containing the sort indicator or the order indicated is changed. The section's logical index is specified by *logicalIndex* and the sort order is specified by *order*. **See also** [setSortIndicator](qheaderview#setSortIndicator)(). ### `[virtual]` QHeaderView::~QHeaderView() Destroys the header. ### int QHeaderView::count() const Returns the number of sections in the header. **See also** [sectionCountChanged](qheaderview#sectionCountChanged)() and [length](qheaderview#length)(). ### `[override virtual protected]` void QHeaderView::currentChanged(const [QModelIndex](qmodelindex) &*current*, const [QModelIndex](qmodelindex) &*old*) Reimplements: [QAbstractItemView::currentChanged](qabstractitemview#currentChanged)(const QModelIndex &current, const QModelIndex &previous). ### `[override virtual protected]` bool QHeaderView::event([QEvent](qevent) \**e*) Reimplements: [QAbstractItemView::event](qabstractitemview#event)(QEvent \*event). ### int QHeaderView::hiddenSectionCount() const Returns the number of sections in the header that has been hidden. **See also** [setSectionHidden](qheaderview#setSectionHidden)() and [isSectionHidden](qheaderview#isSectionHidden)(). ### void QHeaderView::hideSection(int *logicalIndex*) Hides the section specified by *logicalIndex*. **See also** [showSection](qheaderview#showSection)(), [isSectionHidden](qheaderview#isSectionHidden)(), [hiddenSectionCount](qheaderview#hiddenSectionCount)(), and [setSectionHidden](qheaderview#setSectionHidden)(). ### `[override virtual protected]` int QHeaderView::horizontalOffset() const Reimplements: [QAbstractItemView::horizontalOffset() const](qabstractitemview#horizontalOffset). Returns the horizontal offset of the header. This is 0 for vertical headers. **See also** [offset](qheaderview#offset)(). ### `[virtual protected]` void QHeaderView::initStyleOption([QStyleOptionHeader](qstyleoptionheader) \**option*) const Initialize *option* with the values from this [QHeaderView](qheaderview). This method is useful for subclasses when they need a [QStyleOptionHeader](qstyleoptionheader), but do not want to fill in all the information themselves. **See also** [QStyleOption::initFrom](qstyleoption#initFrom)() and [initStyleOptionForIndex](qheaderview#initStyleOptionForIndex)(). ### `[virtual protected, since 6.0]` void QHeaderView::initStyleOptionForIndex([QStyleOptionHeader](qstyleoptionheader) \**option*, int *logicalIndex*) const Initializes the style *option* from the specified *logicalIndex*. This function is called by the default implementation of [paintSection](qheaderview#paintSection) after [initStyleOption](qheaderview#initStyleOption) has been called. This function was introduced in Qt 6.0. **See also** [paintSection](qheaderview#paintSection)() and [initStyleOption](qheaderview#initStyleOption)(). ### bool QHeaderView::isSectionHidden(int *logicalIndex*) const Returns `true` if the section specified by *logicalIndex* is explicitly hidden from the user; otherwise returns `false`. **See also** [hideSection](qheaderview#hideSection)(), [showSection](qheaderview#showSection)(), [setSectionHidden](qheaderview#setSectionHidden)(), and [hiddenSectionCount](qheaderview#hiddenSectionCount)(). ### int QHeaderView::length() const Returns the length along the orientation of the header. **See also** [sizeHint](qheaderview#sizeHint)(), [setSectionResizeMode](qheaderview#setSectionResizeMode)(), and [offset](qheaderview#offset)(). ### int QHeaderView::logicalIndex(int *visualIndex*) const Returns the logicalIndex for the section at the given *visualIndex* position, or -1 if [visualIndex](qheaderview#visualIndex) < 0 or [visualIndex](qheaderview#visualIndex) >= [QHeaderView::count](qheaderview#count)(). Note that the [visualIndex](qheaderview#visualIndex) is not affected by hidden sections. **See also** [visualIndex](qheaderview#visualIndex)() and [sectionPosition](qheaderview#sectionPosition)(). ### int QHeaderView::logicalIndexAt(int *position*) const Returns the section that covers the given *position* in the viewport. **See also** [visualIndexAt](qheaderview#visualIndexAt)() and [isSectionHidden](qheaderview#isSectionHidden)(). ### int QHeaderView::logicalIndexAt(int *x*, int *y*) const Returns the logical index of the section at the given coordinate. If the header is horizontal *x* will be used, otherwise *y* will be used to find the logical index. ### int QHeaderView::logicalIndexAt(const [QPoint](qpoint) &*pos*) const Returns the logical index of the section at the position given in *pos*. If the header is horizontal the x-coordinate will be used, otherwise the y-coordinate will be used to find the logical index. **See also** [sectionPosition](qheaderview#sectionPosition)(). ### `[override virtual protected]` void QHeaderView::mouseDoubleClickEvent([QMouseEvent](qmouseevent) \**e*) Reimplements: [QAbstractItemView::mouseDoubleClickEvent](qabstractitemview#mouseDoubleClickEvent)(QMouseEvent \*event). ### `[override virtual protected]` void QHeaderView::mouseMoveEvent([QMouseEvent](qmouseevent) \**e*) Reimplements: [QAbstractItemView::mouseMoveEvent](qabstractitemview#mouseMoveEvent)(QMouseEvent \*event). ### `[override virtual protected]` void QHeaderView::mousePressEvent([QMouseEvent](qmouseevent) \**e*) Reimplements: [QAbstractItemView::mousePressEvent](qabstractitemview#mousePressEvent)(QMouseEvent \*event). ### `[override virtual protected]` void QHeaderView::mouseReleaseEvent([QMouseEvent](qmouseevent) \**e*) Reimplements: [QAbstractItemView::mouseReleaseEvent](qabstractitemview#mouseReleaseEvent)(QMouseEvent \*event). ### void QHeaderView::moveSection(int *from*, int *to*) Moves the section at visual index *from* to occupy visual index *to*. **See also** [sectionsMoved](qheaderview#sectionsMoved)(). ### int QHeaderView::offset() const Returns the offset of the header: this is the header's left-most (or top-most for vertical headers) visible pixel. **See also** [setOffset](qheaderview#setOffset)(). ### [Qt::Orientation](qt#Orientation-enum) QHeaderView::orientation() const Returns the orientation of the header. **See also** [Qt::Orientation](qt#Orientation-enum). ### `[override virtual protected]` void QHeaderView::paintEvent([QPaintEvent](qpaintevent) \**e*) Reimplements: [QAbstractScrollArea::paintEvent](qabstractscrollarea#paintEvent)(QPaintEvent \*event). ### `[virtual protected]` void QHeaderView::paintSection([QPainter](qpainter) \**painter*, const [QRect](qrect) &*rect*, int *logicalIndex*) const Paints the section specified by the given *logicalIndex*, using the given *painter* and *rect*. Normally, you do not have to call this function. ### `[override virtual]` void QHeaderView::reset() Reimplements: [QAbstractItemView::reset](qabstractitemview#reset)(). ### `[since 5.2]` int QHeaderView::resizeContentsPrecision() const Returns how precise [QHeaderView](qheaderview) will calculate on [ResizeToContents](qheaderview#ResizeMode-enum). This function was introduced in Qt 5.2. **See also** [setResizeContentsPrecision](qheaderview#setResizeContentsPrecision)() and [setSectionResizeMode](qheaderview#setSectionResizeMode)(). ### void QHeaderView::resizeSection(int *logicalIndex*, int *size*) Resizes the section specified by *logicalIndex* to *size* measured in pixels. The size parameter must be a value larger or equal to zero. A size equal to zero is however not recommended. In that situation [hideSection](qheaderview#hideSection) should be used instead. **See also** [sectionResized](qheaderview#sectionResized)(), [sectionSize](qheaderview#sectionSize)(), and [hideSection](qheaderview#hideSection)(). ### void QHeaderView::resizeSections([QHeaderView::ResizeMode](qheaderview#ResizeMode-enum) *mode*) Resizes the sections according to the given *mode*, ignoring the current resize mode. **See also** [sectionResized](qheaderview#sectionResized)(). ### bool QHeaderView::restoreState(const [QByteArray](qbytearray) &*state*) Restores the *state* of this header view. This function returns `true` if the state was restored; otherwise returns false. **See also** [saveState](qheaderview#saveState)(). ### [QByteArray](qbytearray) QHeaderView::saveState() const Saves the current state of this header view. To restore the saved state, pass the return value to [restoreState](qheaderview#restoreState)(). **See also** [restoreState](qheaderview#restoreState)(). ### int QHeaderView::sectionPosition(int *logicalIndex*) const Returns the section position of the given *logicalIndex*, or -1 if the section is hidden. The position is measured in pixels from the first visible item's top-left corner to the top-left corner of the item with *logicalIndex*. The measurement is along the x-axis for horizontal headers and along the y-axis for vertical headers. **See also** [sectionViewportPosition](qheaderview#sectionViewportPosition)(). ### `[since 5.0]` [QHeaderView::ResizeMode](qheaderview#ResizeMode-enum) QHeaderView::sectionResizeMode(int *logicalIndex*) const Returns the resize mode that applies to the section specified by the given *logicalIndex*. This function was introduced in Qt 5.0. **See also** [setSectionResizeMode](qheaderview#setSectionResizeMode)(). ### int QHeaderView::sectionSize(int *logicalIndex*) const Returns the width (or height for vertical headers) of the given *logicalIndex*. **See also** [length](qheaderview#length)(), [setSectionResizeMode](qheaderview#setSectionResizeMode)(), and [defaultSectionSize](qheaderview#defaultSectionSize-prop)(). ### `[virtual protected]` [QSize](qsize) QHeaderView::sectionSizeFromContents(int *logicalIndex*) const Returns the size of the contents of the section specified by the given *logicalIndex*. **See also** [defaultSectionSize](qheaderview#defaultSectionSize-prop)(). ### int QHeaderView::sectionSizeHint(int *logicalIndex*) const Returns a suitable size hint for the section specified by *logicalIndex*. [Qt::SizeHintRole](qt#ItemDataRole-enum) **See also** [sizeHint](qheaderview#sizeHint)(), [defaultSectionSize](qheaderview#defaultSectionSize-prop)(), [minimumSectionSize](qheaderview#minimumSectionSize-prop)(), and [maximumSectionSize](qheaderview#maximumSectionSize-prop)(). ### int QHeaderView::sectionViewportPosition(int *logicalIndex*) const Returns the section viewport position of the given *logicalIndex*. If the section is hidden, the return value is undefined. **See also** [sectionPosition](qheaderview#sectionPosition)() and [isSectionHidden](qheaderview#isSectionHidden)(). ### `[since 5.0]` bool QHeaderView::sectionsClickable() const Returns `true` if the header is clickable; otherwise returns `false`. A clickable header could be set up to allow the user to change the representation of the data in the view related to the header. This function was introduced in Qt 5.0. **See also** [setSectionsClickable](qheaderview#setSectionsClickable)(). ### bool QHeaderView::sectionsHidden() const Returns `true` if sections in the header has been hidden; otherwise returns false; **See also** [setSectionHidden](qheaderview#setSectionHidden)(). ### `[since 5.0]` bool QHeaderView::sectionsMovable() const Returns `true` if the header can be moved by the user; otherwise returns false. By default, sections are movable in [QTreeView](qtreeview) (except for the first one), and not movable in [QTableView](qtableview). This function was introduced in Qt 5.0. **See also** [setSectionsMovable](qheaderview#setSectionsMovable)(). ### bool QHeaderView::sectionsMoved() const Returns `true` if sections in the header has been moved; otherwise returns false; **See also** [moveSection](qheaderview#moveSection)(). ### `[override virtual]` void QHeaderView::setModel([QAbstractItemModel](qabstractitemmodel) \**model*) Reimplements: [QAbstractItemView::setModel](qabstractitemview#setModel)(QAbstractItemModel \*model). ### `[since 5.2]` void QHeaderView::setResizeContentsPrecision(int *precision*) Sets how precise [QHeaderView](qheaderview) should calculate the size when [ResizeToContents](qheaderview#ResizeMode-enum) is used. A low value will provide a less accurate but fast auto resize while a higher value will provide a more accurate resize that however can be slow. The number *precision* specifies how many sections that should be consider when calculating the preferred size. The default value is 1000 meaning that a horizontal column with auto-resize will look at maximum 1000 rows on calculating when doing an auto resize. Special value 0 means that it will look at only the visible area. Special value -1 will imply looking at all elements. This value is used in [QTableView::sizeHintForColumn](qtableview#sizeHintForColumn)(), [QTableView::sizeHintForRow](qtableview#sizeHintForRow)() and [QTreeView::sizeHintForColumn](qtreeview#sizeHintForColumn)(). Reimplementing these functions can make this function not having an effect. This function was introduced in Qt 5.2. **See also** [resizeContentsPrecision](qheaderview#resizeContentsPrecision)(), [setSectionResizeMode](qheaderview#setSectionResizeMode)(), [resizeSections](qheaderview#resizeSections-1)(), [QTableView::sizeHintForColumn](qtableview#sizeHintForColumn)(), [QTableView::sizeHintForRow](qtableview#sizeHintForRow)(), and [QTreeView::sizeHintForColumn](qtreeview#sizeHintForColumn)(). ### void QHeaderView::setSectionHidden(int *logicalIndex*, bool *hide*) If *hide* is true the section specified by *logicalIndex* is hidden; otherwise the section is shown. **See also** [isSectionHidden](qheaderview#isSectionHidden)() and [hiddenSectionCount](qheaderview#hiddenSectionCount)(). ### `[since 5.0]` void QHeaderView::setSectionResizeMode([QHeaderView::ResizeMode](qheaderview#ResizeMode-enum) *mode*) Sets the constraints on how the header can be resized to those described by the given *mode*. This function was introduced in Qt 5.0. **See also** [sectionResizeMode](qheaderview#sectionResizeMode)(), [length](qheaderview#length)(), and [sectionResized](qheaderview#sectionResized)(). ### `[since 5.0]` void QHeaderView::setSectionResizeMode(int *logicalIndex*, [QHeaderView::ResizeMode](qheaderview#ResizeMode-enum) *mode*) Sets the constraints on how the section specified by *logicalIndex* in the header can be resized to those described by the given *mode*. The logical index should exist at the time this function is called. **Note:** This setting will be ignored for the last section if the [stretchLastSection](qheaderview#stretchLastSection-prop) property is set to true. This is the default for the horizontal headers provided by [QTreeView](qtreeview). This function was introduced in Qt 5.0. **See also** [setStretchLastSection](qheaderview#stretchLastSection-prop)() and [resizeContentsPrecision](qheaderview#resizeContentsPrecision)(). ### `[since 5.0]` void QHeaderView::setSectionsClickable(bool *clickable*) If *clickable* is true, the header will respond to single clicks. This function was introduced in Qt 5.0. **See also** [sectionsClickable](qheaderview#sectionsClickable)(), [sectionClicked](qheaderview#sectionClicked)(), [sectionPressed](qheaderview#sectionPressed)(), and [setSortIndicatorShown](qheaderview#showSortIndicator-prop)(). ### `[since 5.0]` void QHeaderView::setSectionsMovable(bool *movable*) If *movable* is true, the header sections may be moved by the user; otherwise they are fixed in place. When used in combination with [QTreeView](qtreeview), the first column is not movable (since it contains the tree structure), by default. You can make it movable with [setFirstSectionMovable](qheaderview#firstSectionMovable-prop)(true). This function was introduced in Qt 5.0. **See also** [sectionsMovable](qheaderview#sectionsMovable)(), [sectionMoved](qheaderview#sectionMoved)(), and [setFirstSectionMovable](qheaderview#firstSectionMovable-prop)(). ### `[override virtual protected]` void QHeaderView::setSelection(const [QRect](qrect) &*rect*, [QItemSelectionModel::SelectionFlags](qitemselectionmodel#SelectionFlag-enum) *flags*) Reimplements: [QAbstractItemView::setSelection](qabstractitemview#setSelection)(const QRect &rect, QItemSelectionModel::SelectionFlags flags). Selects the items in the given *rect* according to the specified *flags*. The base class implementation does nothing. ### void QHeaderView::setSortIndicator(int *logicalIndex*, [Qt::SortOrder](qt#SortOrder-enum) *order*) Sets the sort indicator for the section specified by the given *logicalIndex* in the direction specified by *order*, and removes the sort indicator from any other section that was showing it. *logicalIndex* may be -1, in which case no sort indicator will be shown and the model will return to its natural, unsorted order. Note that not all models support this and may even crash in this case. **See also** [sortIndicatorSection](qheaderview#sortIndicatorSection)() and [sortIndicatorOrder](qheaderview#sortIndicatorOrder)(). ### `[override virtual]` void QHeaderView::setVisible(bool *v*) Reimplements an access function for property: [QWidget::visible](qwidget#visible-prop). ### void QHeaderView::showSection(int *logicalIndex*) Shows the section specified by *logicalIndex*. **See also** [hideSection](qheaderview#hideSection)(), [isSectionHidden](qheaderview#isSectionHidden)(), [hiddenSectionCount](qheaderview#hiddenSectionCount)(), and [setSectionHidden](qheaderview#setSectionHidden)(). ### `[override virtual]` [QSize](qsize) QHeaderView::sizeHint() const Reimplements: [QAbstractScrollArea::sizeHint() const](qabstractscrollarea#sizeHint). Returns a suitable size hint for this header. **See also** [sectionSizeHint](qheaderview#sectionSizeHint)(). ### [Qt::SortOrder](qt#SortOrder-enum) QHeaderView::sortIndicatorOrder() const Returns the order for the sort indicator. If no section has a sort indicator the return value of this function is undefined. **See also** [setSortIndicator](qheaderview#setSortIndicator)() and [sortIndicatorSection](qheaderview#sortIndicatorSection)(). ### int QHeaderView::sortIndicatorSection() const Returns the logical index of the section that has a sort indicator. By default this is section 0. **See also** [setSortIndicator](qheaderview#setSortIndicator)(), [sortIndicatorOrder](qheaderview#sortIndicatorOrder)(), and [setSortIndicatorShown](qheaderview#showSortIndicator-prop)(). ### int QHeaderView::stretchSectionCount() const Returns the number of sections that are set to resize mode stretch. In views, this can be used to see if the headerview needs to resize the sections when the view's geometry changes. **See also** [stretchLastSection](qheaderview#stretchLastSection-prop). ### void QHeaderView::swapSections(int *first*, int *second*) Swaps the section at visual index *first* with the section at visual index *second*. **See also** [moveSection](qheaderview#moveSection)(). ### `[override virtual protected]` int QHeaderView::verticalOffset() const Reimplements: [QAbstractItemView::verticalOffset() const](qabstractitemview#verticalOffset). Returns the vertical offset of the header. This is 0 for horizontal headers. **See also** [offset](qheaderview#offset)(). ### `[override virtual protected]` bool QHeaderView::viewportEvent([QEvent](qevent) \**e*) Reimplements: [QAbstractItemView::viewportEvent](qabstractitemview#viewportEvent)(QEvent \*event). ### int QHeaderView::visualIndex(int *logicalIndex*) const Returns the visual index position of the section specified by the given *logicalIndex*, or -1 otherwise. Hidden sections still have valid visual indexes. **See also** [logicalIndex](qheaderview#logicalIndex)(). ### int QHeaderView::visualIndexAt(int *position*) const Returns the visual index of the section that covers the given *position* in the viewport. **See also** [logicalIndexAt](qheaderview#logicalIndexAt)().
programming_docs
qt QPixmap Class QPixmap Class ============= The QPixmap class is an off-screen image representation that can be used as a paint device. [More...](#details) | | | | --- | --- | | Header: | #include <QPixmap> | | CMake: | find\_package(Qt6 COMPONENTS Gui REQUIRED) target\_link\_libraries(mytarget PRIVATE Qt6::Gui) | | qmake: | QT += gui | | Inherits: | [QPaintDevice](qpaintdevice) | | Inherited By: | [QBitmap](qbitmap) | * [List of all members, including inherited members](https://doc.qt.io/qt-6.2/qpixmap-members.html) Public Functions ---------------- | | | | --- | --- | | | **[QPixmap](qpixmap#QPixmap-5)**(QPixmap &&*other*) | | | **[QPixmap](qpixmap#QPixmap-4)**(const QPixmap &*pixmap*) | | | **[QPixmap](qpixmap#QPixmap-3)**(const char \*const [] *xpm*) | | | **[QPixmap](qpixmap#QPixmap-2)**(const QString &*fileName*, const char \**format* = nullptr, Qt::ImageConversionFlags *flags* = Qt::AutoColor) | | | **[QPixmap](qpixmap#QPixmap-1)**(const QSize &*size*) | | | **[QPixmap](qpixmap#QPixmap)**(int *width*, int *height*) | | | **[QPixmap](qpixmap#QPixmap)**() | | QPixmap & | **[operator=](qpixmap#operator-eq-1)**(QPixmap &&*other*) | | QPixmap & | **[operator=](qpixmap#operator-eq)**(const QPixmap &*pixmap*) | | virtual | **[~QPixmap](qpixmap#dtor.QPixmap)**() | | qint64 | **[cacheKey](qpixmap#cacheKey)**() const | | bool | **[convertFromImage](qpixmap#convertFromImage)**(const QImage &*image*, Qt::ImageConversionFlags *flags* = Qt::AutoColor) | | QPixmap | **[copy](qpixmap#copy)**(const QRect &*rectangle* = QRect()) const | | QPixmap | **[copy](qpixmap#copy-1)**(int *x*, int *y*, int *width*, int *height*) const | | QBitmap | **[createHeuristicMask](qpixmap#createHeuristicMask)**(bool *clipTight* = true) const | | QBitmap | **[createMaskFromColor](qpixmap#createMaskFromColor)**(const QColor &*maskColor*, Qt::MaskMode *mode* = Qt::MaskInColor) const | | int | **[depth](qpixmap#depth)**() const | | void | **[detach](qpixmap#detach)**() | | QSizeF | **[deviceIndependentSize](qpixmap#deviceIndependentSize)**() const | | qreal | **[devicePixelRatio](qpixmap#devicePixelRatio)**() const | | void | **[fill](qpixmap#fill)**(const QColor &*color* = Qt::white) | | bool | **[hasAlpha](qpixmap#hasAlpha)**() const | | bool | **[hasAlphaChannel](qpixmap#hasAlphaChannel)**() const | | int | **[height](qpixmap#height)**() const | | bool | **[isNull](qpixmap#isNull)**() const | | bool | **[isQBitmap](qpixmap#isQBitmap)**() const | | bool | **[load](qpixmap#load)**(const QString &*fileName*, const char \**format* = nullptr, Qt::ImageConversionFlags *flags* = Qt::AutoColor) | | bool | **[loadFromData](qpixmap#loadFromData)**(const uchar \**data*, uint *len*, const char \**format* = nullptr, Qt::ImageConversionFlags *flags* = Qt::AutoColor) | | bool | **[loadFromData](qpixmap#loadFromData-1)**(const QByteArray &*data*, const char \**format* = nullptr, Qt::ImageConversionFlags *flags* = Qt::AutoColor) | | QBitmap | **[mask](qpixmap#mask)**() const | | QRect | **[rect](qpixmap#rect)**() const | | bool | **[save](qpixmap#save)**(const QString &*fileName*, const char \**format* = nullptr, int *quality* = -1) const | | bool | **[save](qpixmap#save-1)**(QIODevice \**device*, const char \**format* = nullptr, int *quality* = -1) const | | QPixmap | **[scaled](qpixmap#scaled)**(const QSize &*size*, Qt::AspectRatioMode *aspectRatioMode* = Qt::IgnoreAspectRatio, Qt::TransformationMode *transformMode* = Qt::FastTransformation) const | | QPixmap | **[scaled](qpixmap#scaled-1)**(int *width*, int *height*, Qt::AspectRatioMode *aspectRatioMode* = Qt::IgnoreAspectRatio, Qt::TransformationMode *transformMode* = Qt::FastTransformation) const | | QPixmap | **[scaledToHeight](qpixmap#scaledToHeight)**(int *height*, Qt::TransformationMode *mode* = Qt::FastTransformation) const | | QPixmap | **[scaledToWidth](qpixmap#scaledToWidth)**(int *width*, Qt::TransformationMode *mode* = Qt::FastTransformation) const | | void | **[scroll](qpixmap#scroll)**(int *dx*, int *dy*, int *x*, int *y*, int *width*, int *height*, QRegion \**exposed* = nullptr) | | void | **[scroll](qpixmap#scroll-1)**(int *dx*, int *dy*, const QRect &*rect*, QRegion \**exposed* = nullptr) | | void | **[setDevicePixelRatio](qpixmap#setDevicePixelRatio)**(qreal *scaleFactor*) | | void | **[setMask](qpixmap#setMask)**(const QBitmap &*mask*) | | QSize | **[size](qpixmap#size)**() const | | void | **[swap](qpixmap#swap)**(QPixmap &*other*) | | QImage | **[toImage](qpixmap#toImage)**() const | | QPixmap | **[transformed](qpixmap#transformed)**(const QTransform &*transform*, Qt::TransformationMode *mode* = Qt::FastTransformation) const | | int | **[width](qpixmap#width)**() const | | QVariant | **[operator QVariant](qpixmap#operator-QVariant)**() const | | bool | **[operator!](qpixmap#operator-not)**() const | Static Public Members --------------------- | | | | --- | --- | | int | **[defaultDepth](qpixmap#defaultDepth)**() | | QPixmap | **[fromImage](qpixmap#fromImage)**(const QImage &*image*, Qt::ImageConversionFlags *flags* = Qt::AutoColor) | | QPixmap | **[fromImage](qpixmap#fromImage-1)**(QImage &&*image*, Qt::ImageConversionFlags *flags* = Qt::AutoColor) | | QPixmap | **[fromImageReader](qpixmap#fromImageReader)**(QImageReader \**imageReader*, Qt::ImageConversionFlags *flags* = Qt::AutoColor) | | QTransform | **[trueMatrix](qpixmap#trueMatrix)**(const QTransform &*matrix*, int *width*, int *height*) | Related Non-Members ------------------- | | | | --- | --- | | QDataStream & | **[operator<<](qpixmap#operator-lt-lt)**(QDataStream &*stream*, const QPixmap &*pixmap*) | | QDataStream & | **[operator>>](qpixmap#operator-gt-gt-1)**(QDataStream &*stream*, QPixmap &*pixmap*) | Detailed Description -------------------- Qt provides four classes for handling image data: [QImage](qimage), QPixmap, [QBitmap](qbitmap) and [QPicture](qpicture). [QImage](qimage) is designed and optimized for I/O, and for direct pixel access and manipulation, while QPixmap is designed and optimized for showing images on screen. [QBitmap](qbitmap) is only a convenience class that inherits QPixmap, ensuring a depth of 1. The [isQBitmap](qpixmap#isQBitmap)() function returns `true` if a QPixmap object is really a bitmap, otherwise returns `false`. Finally, the [QPicture](qpicture) class is a paint device that records and replays [QPainter](qpainter) commands. A QPixmap can easily be displayed on the screen using [QLabel](qlabel) or one of [QAbstractButton](qabstractbutton)'s subclasses (such as [QPushButton](qpushbutton) and [QToolButton](qtoolbutton)). [QLabel](qlabel) has a pixmap property, whereas [QAbstractButton](qabstractbutton) has an icon property. QPixmap objects can be passed around by value since the QPixmap class uses implicit data sharing. For more information, see the [Implicit Data Sharing](implicit-sharing) documentation. QPixmap objects can also be streamed. Note that the pixel data in a pixmap is internal and is managed by the underlying window system. Because QPixmap is a [QPaintDevice](qpaintdevice) subclass, [QPainter](qpainter) can be used to draw directly onto pixmaps. Pixels can only be accessed through [QPainter](qpainter) functions or by converting the QPixmap to a [QImage](qimage). However, the [fill](qpixmap#fill)() function is available for initializing the entire pixmap with a given color. There are functions to convert between [QImage](qimage) and QPixmap. Typically, the [QImage](qimage) class is used to load an image file, optionally manipulating the image data, before the [QImage](qimage) object is converted into a QPixmap to be shown on screen. Alternatively, if no manipulation is desired, the image file can be loaded directly into a QPixmap. QPixmap provides a collection of functions that can be used to obtain a variety of information about the pixmap. In addition, there are several functions that enables transformation of the pixmap. ### Reading and Writing Image Files QPixmap provides several ways of reading an image file: The file can be loaded when constructing the QPixmap object, or by using the [load](qpixmap#load)() or [loadFromData](qpixmap#loadFromData)() functions later on. When loading an image, the file name can either refer to an actual file on disk or to one of the application's embedded resources. See [The Qt Resource System](resources) overview for details on how to embed images and other resource files in the application's executable. Simply call the [save](qpixmap#save)() function to save a QPixmap object. The complete list of supported file formats are available through the [QImageReader::supportedImageFormats](qimagereader#supportedImageFormats)() and [QImageWriter::supportedImageFormats](qimagewriter#supportedImageFormats)() functions. New file formats can be added as plugins. By default, Qt supports the following formats: | Format | Description | Qt's support | | --- | --- | --- | | BMP | Windows Bitmap | Read/write | | GIF | Graphic Interchange Format (optional) | Read | | JPG | Joint Photographic Experts Group | Read/write | | JPEG | Joint Photographic Experts Group | Read/write | | PNG | Portable Network Graphics | Read/write | | PBM | Portable Bitmap | Read | | PGM | Portable Graymap | Read | | PPM | Portable Pixmap | Read/write | | XBM | X11 Bitmap | Read/write | | XPM | X11 Pixmap | Read/write | ### Pixmap Information QPixmap provides a collection of functions that can be used to obtain a variety of information about the pixmap: | | Available Functions | | --- | --- | | Geometry | The [size](qpixmap#size)(), [width](qpixmap#width)() and [height](qpixmap#height)() functions provide information about the pixmap's size. The [rect](qpixmap#rect)() function returns the image's enclosing rectangle. | | Alpha component | The [hasAlphaChannel](qpixmap#hasAlphaChannel)() returns `true` if the pixmap has a format that respects the alpha channel, otherwise returns `false`. The [hasAlpha](qpixmap#hasAlpha)(), [setMask](qpixmap#setMask)() and [mask](qpixmap#mask)() functions are legacy and should not be used. They are potentially very slow.The [createHeuristicMask](qpixmap#createHeuristicMask)() function creates and returns a 1-bpp heuristic mask (i.e. a [QBitmap](qbitmap)) for this pixmap. It works by selecting a color from one of the corners and then chipping away pixels of that color, starting at all the edges. The [createMaskFromColor](qpixmap#createMaskFromColor)() function creates and returns a mask (i.e. a [QBitmap](qbitmap)) for the pixmap based on a given color. | | Low-level information | The [depth](qpixmap#depth)() function returns the depth of the pixmap. The [defaultDepth](qpixmap#defaultDepth)() function returns the default depth, i.e. the depth used by the application on the given screen.The [cacheKey](qpixmap#cacheKey)() function returns a number that uniquely identifies the contents of the QPixmap object. | ### Pixmap Conversion A QPixmap object can be converted into a [QImage](qimage) using the [toImage](qpixmap#toImage)() function. Likewise, a [QImage](qimage) can be converted into a QPixmap using the [fromImage](qpixmap#fromImage)(). If this is too expensive an operation, you can use [QBitmap::fromImage](qbitmap#fromImage)() instead. To convert a QPixmap to and from HICON you can use the QtWinExtras functions QtWin::toHICON() and QtWin::fromHICON() respectively. ### Pixmap Transformations QPixmap supports a number of functions for creating a new pixmap that is a transformed version of the original: The [scaled](qpixmap#scaled)(), [scaledToWidth](qpixmap#scaledToWidth)() and [scaledToHeight](qpixmap#scaledToHeight)() functions return scaled copies of the pixmap, while the [copy](qpixmap#copy)() function creates a QPixmap that is a plain copy of the original one. The [transformed](qpixmap#transformed)() function returns a copy of the pixmap that is transformed with the given transformation matrix and transformation mode: Internally, the transformation matrix is adjusted to compensate for unwanted translation, i.e. [transformed](qpixmap#transformed)() returns the smallest pixmap containing all transformed points of the original pixmap. The static [trueMatrix](qpixmap#trueMatrix)() function returns the actual matrix used for transforming the pixmap. **See also** [QBitmap](qbitmap), [QImage](qimage), [QImageReader](qimagereader), and [QImageWriter](qimagewriter). Member Function Documentation ----------------------------- ### QPixmap::QPixmap([QPixmap](qpixmap#QPixmap) &&*other*) Move-constructs a QPixmap instance from *other*. **See also** [swap](qpixmap#swap)() and [operator=](qpixmap#operator-eq-1)(QPixmap&&). ### QPixmap::QPixmap(const [QPixmap](qpixmap#QPixmap) &*pixmap*) Constructs a pixmap that is a copy of the given *pixmap*. **See also** [copy](qpixmap#copy)(). ### QPixmap::QPixmap(const char \*const [] *xpm*) Constructs a pixmap from the given *xpm* data, which must be a valid XPM image. Errors are silently ignored. Note that it's possible to squeeze the XPM variable a little bit by using an unusual declaration: ``` static const char * const start_xpm[] = { "16 15 8 1", "a c #cec6bd", // etc. }; ``` The extra `const` makes the entire definition read-only, which is slightly more efficient (for example, when the code is in a shared library) and ROMable when the application is to be stored in ROM. ### QPixmap::QPixmap(const [QString](qstring) &*fileName*, const char \**format* = nullptr, [Qt::ImageConversionFlags](qt#ImageConversionFlag-enum) *flags* = Qt::AutoColor) Constructs a pixmap from the file with the given *fileName*. If the file does not exist or is of an unknown format, the pixmap becomes a null pixmap. The loader attempts to read the pixmap using the specified *format*. If the *format* is not specified (which is the default), the loader probes the file for a header to guess the file format. The file name can either refer to an actual file on disk or to one of the application's embedded resources. See the [Resource System](resources) overview for details on how to embed images and other resource files in the application's executable. If the image needs to be modified to fit in a lower-resolution result (e.g. converting from 32-bit to 8-bit), use the *flags* to control the conversion. The *fileName*, *format* and *flags* parameters are passed on to [load](qpixmap#load)(). This means that the data in *fileName* is not compiled into the binary. If *fileName* contains a relative path (e.g. the filename only) the relevant file must be found relative to the runtime working directory. **See also** [Reading and Writing Image Files](qpixmap#reading-and-writing-image-files). ### QPixmap::QPixmap(const [QSize](qsize) &*size*) This is an overloaded function. Constructs a pixmap of the given *size*. **Warning:** This will create a QPixmap with uninitialized data. Call [fill](qpixmap#fill)() to fill the pixmap with an appropriate color before drawing onto it with [QPainter](qpainter). ### QPixmap::QPixmap(int *width*, int *height*) Constructs a pixmap with the given *width* and *height*. If either *width* or *height* is zero, a null pixmap is constructed. **Warning:** This will create a QPixmap with uninitialized data. Call [fill](qpixmap#fill)() to fill the pixmap with an appropriate color before drawing onto it with [QPainter](qpainter). **See also** [isNull](qpixmap#isNull)(). ### QPixmap::QPixmap() Constructs a null pixmap. **See also** [isNull](qpixmap#isNull)(). ### `[since 5.2]` [QPixmap](qpixmap#QPixmap) &QPixmap::operator=([QPixmap](qpixmap#QPixmap) &&*other*) Move-assigns *other* to this [QPixmap](qpixmap) instance. This function was introduced in Qt 5.2. ### [QPixmap](qpixmap#QPixmap) &QPixmap::operator=(const [QPixmap](qpixmap#QPixmap) &*pixmap*) Assigns the given *pixmap* to this pixmap and returns a reference to this pixmap. **See also** [copy](qpixmap#copy)() and [QPixmap](qpixmap#QPixmap)(). ### `[virtual]` QPixmap::~QPixmap() Destroys the pixmap. ### [qint64](qtglobal#qint64-typedef) QPixmap::cacheKey() const Returns a number that identifies this [QPixmap](qpixmap). Distinct [QPixmap](qpixmap) objects can only have the same cache key if they refer to the same contents. The cacheKey() will change when the pixmap is altered. ### bool QPixmap::convertFromImage(const [QImage](qimage) &*image*, [Qt::ImageConversionFlags](qt#ImageConversionFlag-enum) *flags* = Qt::AutoColor) Replaces this pixmap's data with the given *image* using the specified *flags* to control the conversion. The *flags* argument is a bitwise-OR of the [Qt::ImageConversionFlags](qt#ImageConversionFlag-enum). Passing 0 for *flags* sets all the default options. Returns `true` if the result is that this pixmap is not null. Note: this function was part of Qt 3 support in Qt 4.6 and earlier. It has been promoted to official API status in 4.7 to support updating the pixmap's image without creating a new [QPixmap](qpixmap) as [fromImage](qpixmap#fromImage)() would. **See also** [fromImage](qpixmap#fromImage)(). ### [QPixmap](qpixmap#QPixmap) QPixmap::copy(const [QRect](qrect) &*rectangle* = QRect()) const Returns a deep copy of the subset of the pixmap that is specified by the given *rectangle*. For more information on deep copies, see the [Implicit Data Sharing](implicit-sharing) documentation. If the given *rectangle* is empty, the whole image is copied. **See also** [operator=](qpixmap#operator-eq)(), [QPixmap](qpixmap#QPixmap)(), and [Pixmap Transformations](qpixmap#pixmap-transformations). ### [QPixmap](qpixmap#QPixmap) QPixmap::copy(int *x*, int *y*, int *width*, int *height*) const This is an overloaded function. Returns a deep copy of the subset of the pixmap that is specified by the rectangle [QRect](qrect)( *x*, *y*, *width*, *height*). ### [QBitmap](qbitmap) QPixmap::createHeuristicMask(bool *clipTight* = true) const Creates and returns a heuristic mask for this pixmap. The function works by selecting a color from one of the corners and then chipping away pixels of that color, starting at all the edges. If *clipTight* is true (the default) the mask is just large enough to cover the pixels; otherwise, the mask is larger than the data pixels. The mask may not be perfect but it should be reasonable, so you can do things such as the following: ``` QPixmap myPixmap; myPixmap.setMask(myPixmap.createHeuristicMask()); ``` This function is slow because it involves converting to/from a [QImage](qimage), and non-trivial computations. **See also** [QImage::createHeuristicMask](qimage#createHeuristicMask)() and [createMaskFromColor](qpixmap#createMaskFromColor)(). ### [QBitmap](qbitmap) QPixmap::createMaskFromColor(const [QColor](qcolor) &*maskColor*, [Qt::MaskMode](qt#MaskMode-enum) *mode* = Qt::MaskInColor) const Creates and returns a mask for this pixmap based on the given *maskColor*. If the *mode* is [Qt::MaskInColor](qt#MaskMode-enum), all pixels matching the maskColor will be transparent. If *mode* is [Qt::MaskOutColor](qt#MaskMode-enum), all pixels matching the maskColor will be opaque. This function is slow because it involves converting to/from a [QImage](qimage). **See also** [createHeuristicMask](qpixmap#createHeuristicMask)() and [QImage::createMaskFromColor](qimage#createMaskFromColor)(). ### `[static]` int QPixmap::defaultDepth() Returns the default pixmap depth used by the application. On all platforms the depth of the primary screen will be returned. **Note:** [QGuiApplication](qguiapplication) must be created before calling this function. **See also** [depth](qpixmap#depth)(), [QColormap::depth](qcolormap#depth)(), and [Pixmap Information](qpixmap#pixmap-information). ### int QPixmap::depth() const Returns the depth of the pixmap. The pixmap depth is also called bits per pixel (bpp) or bit planes of a pixmap. A null pixmap has depth 0. **See also** [defaultDepth](qpixmap#defaultDepth)() and [Pixmap Information](qpixmap#pixmap-information). ### void QPixmap::detach() Detaches the pixmap from shared pixmap data. A pixmap is automatically detached by Qt whenever its contents are about to change. This is done in almost all [QPixmap](qpixmap) member functions that modify the pixmap ([fill](qpixmap#fill)(), [fromImage](qpixmap#fromImage)(), [load](qpixmap#load)(), etc.), and in [QPainter::begin](qpainter#begin)() on a pixmap. There are two exceptions in which detach() must be called explicitly, that is when calling the handle() or the x11PictureHandle() function (only available on X11). Otherwise, any modifications done using system calls, will be performed on the shared data. The detach() function returns immediately if there is just a single reference or if the pixmap has not been initialized yet. ### [QSizeF](qsizef) QPixmap::deviceIndependentSize() const Returns the size of the pixmap in device independent pixels. This value should be used when using the pixmap size in user interface size calculations. The return value is equivalent to pixmap.[size](qpixmap#size)() / pixmap.[devicePixelRatio](qpixmap#devicePixelRatio)(), ### [qreal](qtglobal#qreal-typedef) QPixmap::devicePixelRatio() const Returns the device pixel ratio for the pixmap. This is the ratio between *device pixels* and *device independent pixels*. Use this function when calculating layout geometry based on the pixmap size: [QSize](qsize) layoutSize = image.[size](qpixmap#size)() / image.devicePixelRatio() The default value is 1.0. **See also** [setDevicePixelRatio](qpixmap#setDevicePixelRatio)() and [QImageReader](qimagereader). ### void QPixmap::fill(const [QColor](qcolor) &*color* = Qt::white) Fills the pixmap with the given *color*. The effect of this function is undefined when the pixmap is being painted on. **See also** [Pixmap Transformations](qpixmap#pixmap-transformations). ### `[static]` [QPixmap](qpixmap#QPixmap) QPixmap::fromImage(const [QImage](qimage) &*image*, [Qt::ImageConversionFlags](qt#ImageConversionFlag-enum) *flags* = Qt::AutoColor) Converts the given *image* to a pixmap using the specified *flags* to control the conversion. The *flags* argument is a bitwise-OR of the [Qt::ImageConversionFlags](qt#ImageConversionFlag-enum). Passing 0 for *flags* sets all the default options. In case of monochrome and 8-bit images, the image is first converted to a 32-bit pixmap and then filled with the colors in the color table. If this is too expensive an operation, you can use [QBitmap::fromImage](qbitmap#fromImage)() instead. **See also** [fromImageReader](qpixmap#fromImageReader)(), [toImage](qpixmap#toImage)(), and [Pixmap Conversion](qpixmap#pixmap-conversion). ### `[static, since 5.3]` [QPixmap](qpixmap#QPixmap) QPixmap::fromImage([QImage](qimage) &&*image*, [Qt::ImageConversionFlags](qt#ImageConversionFlag-enum) *flags* = Qt::AutoColor) This is an overloaded function. Converts the given *image* to a pixmap without copying if possible. This function was introduced in Qt 5.3. ### `[static]` [QPixmap](qpixmap#QPixmap) QPixmap::fromImageReader([QImageReader](qimagereader) \**imageReader*, [Qt::ImageConversionFlags](qt#ImageConversionFlag-enum) *flags* = Qt::AutoColor) Create a [QPixmap](qpixmap) from an image read directly from an *imageReader*. The *flags* argument is a bitwise-OR of the [Qt::ImageConversionFlags](qt#ImageConversionFlag-enum). Passing 0 for *flags* sets all the default options. On some systems, reading an image directly to [QPixmap](qpixmap) can use less memory than reading a [QImage](qimage) to convert it to [QPixmap](qpixmap). **See also** [fromImage](qpixmap#fromImage)(), [toImage](qpixmap#toImage)(), and [Pixmap Conversion](qpixmap#pixmap-conversion). ### bool QPixmap::hasAlpha() const Returns `true` if this pixmap has an alpha channel, *or* has a mask, otherwise returns `false`. **See also** [hasAlphaChannel](qpixmap#hasAlphaChannel)() and [mask](qpixmap#mask)(). ### bool QPixmap::hasAlphaChannel() const Returns `true` if the pixmap has a format that respects the alpha channel, otherwise returns `false`. **See also** [hasAlpha](qpixmap#hasAlpha)(). ### int QPixmap::height() const Returns the height of the pixmap. **See also** [size](qpixmap#size)() and [Pixmap Information](qpixmap#pixmap-information). ### bool QPixmap::isNull() const Returns `true` if this is a null pixmap; otherwise returns `false`. A null pixmap has zero width, zero height and no contents. You cannot draw in a null pixmap. ### bool QPixmap::isQBitmap() const Returns `true` if this is a [QBitmap](qbitmap); otherwise returns `false`. ### bool QPixmap::load(const [QString](qstring) &*fileName*, const char \**format* = nullptr, [Qt::ImageConversionFlags](qt#ImageConversionFlag-enum) *flags* = Qt::AutoColor) Loads a pixmap from the file with the given *fileName*. Returns true if the pixmap was successfully loaded; otherwise invalidates the pixmap and returns `false`. The loader attempts to read the pixmap using the specified *format*. If the *format* is not specified (which is the default), the loader probes the file for a header to guess the file format. The file name can either refer to an actual file on disk or to one of the application's embedded resources. See the [Resource System](resources) overview for details on how to embed pixmaps and other resource files in the application's executable. If the data needs to be modified to fit in a lower-resolution result (e.g. converting from 32-bit to 8-bit), use the *flags* to control the conversion. Note that QPixmaps are automatically added to the [QPixmapCache](qpixmapcache) when loaded from a file in main thread; the key used is internal and cannot be acquired. **See also** [loadFromData](qpixmap#loadFromData)() and [Reading and Writing Image Files](qpixmap#reading-and-writing-image-files). ### bool QPixmap::loadFromData(const [uchar](qtglobal#uchar-typedef) \**data*, [uint](qtglobal#uint-typedef) *len*, const char \**format* = nullptr, [Qt::ImageConversionFlags](qt#ImageConversionFlag-enum) *flags* = Qt::AutoColor) Loads a pixmap from the *len* first bytes of the given binary *data*. Returns `true` if the pixmap was loaded successfully; otherwise invalidates the pixmap and returns `false`. The loader attempts to read the pixmap using the specified *format*. If the *format* is not specified (which is the default), the loader probes the file for a header to guess the file format. If the data needs to be modified to fit in a lower-resolution result (e.g. converting from 32-bit to 8-bit), use the *flags* to control the conversion. **See also** [load](qpixmap#load)() and [Reading and Writing Image Files](qpixmap#reading-and-writing-image-files). ### bool QPixmap::loadFromData(const [QByteArray](qbytearray) &*data*, const char \**format* = nullptr, [Qt::ImageConversionFlags](qt#ImageConversionFlag-enum) *flags* = Qt::AutoColor) This is an overloaded function. Loads a pixmap from the binary *data* using the specified *format* and conversion *flags*. ### [QBitmap](qbitmap) QPixmap::mask() const Extracts a bitmap mask from the pixmap's alpha channel. **Warning:** This is potentially an expensive operation. The mask of the pixmap is extracted dynamically from the pixeldata. **See also** [setMask](qpixmap#setMask)() and [Pixmap Information](qpixmap#pixmap-information). ### [QRect](qrect) QPixmap::rect() const Returns the pixmap's enclosing rectangle. **See also** [Pixmap Information](qpixmap#pixmap-information). ### bool QPixmap::save(const [QString](qstring) &*fileName*, const char \**format* = nullptr, int *quality* = -1) const Saves the pixmap to the file with the given *fileName* using the specified image file *format* and *quality* factor. Returns `true` if successful; otherwise returns `false`. The *quality* factor must be in the range [0,100] or -1. Specify 0 to obtain small compressed files, 100 for large uncompressed files, and -1 to use the default settings. If *format* is `nullptr`, an image format will be chosen from *fileName*'s suffix. **See also** [Reading and Writing Image Files](qpixmap#reading-and-writing-image-files). ### bool QPixmap::save([QIODevice](qiodevice) \**device*, const char \**format* = nullptr, int *quality* = -1) const This is an overloaded function. This function writes a [QPixmap](qpixmap) to the given *device* using the specified image file *format* and *quality* factor. This can be used, for example, to save a pixmap directly into a [QByteArray](qbytearray): ``` QPixmap pixmap; QByteArray bytes; QBuffer buffer(&bytes); buffer.open(QIODevice::WriteOnly); pixmap.save(&buffer, "PNG"); // writes pixmap into bytes in PNG format ``` ### [QPixmap](qpixmap#QPixmap) QPixmap::scaled(const [QSize](qsize) &*size*, [Qt::AspectRatioMode](qt#AspectRatioMode-enum) *aspectRatioMode* = Qt::IgnoreAspectRatio, [Qt::TransformationMode](qt#TransformationMode-enum) *transformMode* = Qt::FastTransformation) const Scales the pixmap to the given *size*, using the aspect ratio and transformation modes specified by *aspectRatioMode* and *transformMode*. * If *aspectRatioMode* is [Qt::IgnoreAspectRatio](qt#AspectRatioMode-enum), the pixmap is scaled to *size*. * If *aspectRatioMode* is [Qt::KeepAspectRatio](qt#AspectRatioMode-enum), the pixmap is scaled to a rectangle as large as possible inside *size*, preserving the aspect ratio. * If *aspectRatioMode* is [Qt::KeepAspectRatioByExpanding](qt#AspectRatioMode-enum), the pixmap is scaled to a rectangle as small as possible outside *size*, preserving the aspect ratio. If the given *size* is empty, this function returns a null pixmap. In some cases it can be more beneficial to draw the pixmap to a painter with a scale set rather than scaling the pixmap. This is the case when the painter is for instance based on OpenGL or when the scale factor changes rapidly. **See also** [isNull](qpixmap#isNull)() and [Pixmap Transformations](qpixmap#pixmap-transformations). ### [QPixmap](qpixmap#QPixmap) QPixmap::scaled(int *width*, int *height*, [Qt::AspectRatioMode](qt#AspectRatioMode-enum) *aspectRatioMode* = Qt::IgnoreAspectRatio, [Qt::TransformationMode](qt#TransformationMode-enum) *transformMode* = Qt::FastTransformation) const This is an overloaded function. Returns a copy of the pixmap scaled to a rectangle with the given *width* and *height* according to the given *aspectRatioMode* and *transformMode*. If either the *width* or the *height* is zero or negative, this function returns a null pixmap. ### [QPixmap](qpixmap#QPixmap) QPixmap::scaledToHeight(int *height*, [Qt::TransformationMode](qt#TransformationMode-enum) *mode* = Qt::FastTransformation) const Returns a scaled copy of the image. The returned image is scaled to the given *height* using the specified transformation *mode*. The width of the pixmap is automatically calculated so that the aspect ratio of the pixmap is preserved. If *height* is 0 or negative, a null pixmap is returned. **See also** [isNull](qpixmap#isNull)() and [Pixmap Transformations](qpixmap#pixmap-transformations). ### [QPixmap](qpixmap#QPixmap) QPixmap::scaledToWidth(int *width*, [Qt::TransformationMode](qt#TransformationMode-enum) *mode* = Qt::FastTransformation) const Returns a scaled copy of the image. The returned image is scaled to the given *width* using the specified transformation *mode*. The height of the pixmap is automatically calculated so that the aspect ratio of the pixmap is preserved. If *width* is 0 or negative, a null pixmap is returned. **See also** [isNull](qpixmap#isNull)() and [Pixmap Transformations](qpixmap#pixmap-transformations). ### void QPixmap::scroll(int *dx*, int *dy*, int *x*, int *y*, int *width*, int *height*, [QRegion](qregion) \**exposed* = nullptr) This convenience function is equivalent to calling QPixmap::scroll(*dx*, *dy*, [QRect](qrect)(*x*, *y*, *width*, *height*), *exposed*). **See also** [QWidget::scroll](qwidget#scroll)() and [QGraphicsItem::scroll](qgraphicsitem#scroll)(). ### void QPixmap::scroll(int *dx*, int *dy*, const [QRect](qrect) &*rect*, [QRegion](qregion) \**exposed* = nullptr) Scrolls the area *rect* of this pixmap by (*dx*, *dy*). The exposed region is left unchanged. You can optionally pass a pointer to an empty [QRegion](qregion) to get the region that is *exposed* by the scroll operation. ``` QPixmap pixmap("background.png"); QRegion exposed; pixmap.scroll(10, 10, pixmap.rect(), &exposed); ``` You cannot scroll while there is an active painter on the pixmap. **See also** [QWidget::scroll](qwidget#scroll)() and [QGraphicsItem::scroll](qgraphicsitem#scroll)(). ### void QPixmap::setDevicePixelRatio([qreal](qtglobal#qreal-typedef) *scaleFactor*) Sets the device pixel ratio for the pixmap. This is the ratio between image pixels and device-independent pixels. The default *scaleFactor* is 1.0. Setting it to something else has two effects: QPainters that are opened on the pixmap will be scaled. For example, painting on a 200x200 image if with a ratio of 2.0 will result in effective (device-independent) painting bounds of 100x100. Code paths in Qt that calculate layout geometry based on the pixmap size will take the ratio into account: [QSize](qsize) layoutSize = pixmap.[size](qpixmap#size)() / pixmap.[devicePixelRatio](qpixmap#devicePixelRatio)() The net effect of this is that the pixmap is displayed as high-DPI pixmap rather than a large pixmap (see [Drawing High Resolution Versions of Pixmaps and Images](qpainter#drawing-high-resolution-versions-of-pixmaps-and-images)). **See also** [devicePixelRatio](qpixmap#devicePixelRatio)() and [deviceIndependentSize](qpixmap#deviceIndependentSize)(). ### void QPixmap::setMask(const [QBitmap](qbitmap) &*mask*) Sets a mask bitmap. This function merges the *mask* with the pixmap's alpha channel. A pixel value of 1 on the mask means the pixmap's pixel is unchanged; a value of 0 means the pixel is transparent. The mask must have the same size as this pixmap. Setting a null mask resets the mask, leaving the previously transparent pixels black. The effect of this function is undefined when the pixmap is being painted on. **Warning:** This is potentially an expensive operation. **See also** [mask](qpixmap#mask)(), [Pixmap Transformations](qpixmap#pixmap-transformations), and [QBitmap](qbitmap). ### [QSize](qsize) QPixmap::size() const Returns the size of the pixmap. **See also** [width](qpixmap#width)(), [height](qpixmap#height)(), and [Pixmap Information](qpixmap#pixmap-information). ### void QPixmap::swap([QPixmap](qpixmap#QPixmap) &*other*) Swaps pixmap *other* with this pixmap. This operation is very fast and never fails. ### [QImage](qimage) QPixmap::toImage() const Converts the pixmap to a [QImage](qimage). Returns a null image if the conversion fails. If the pixmap has 1-bit depth, the returned image will also be 1 bit deep. Images with more bits will be returned in a format closely represents the underlying system. Usually this will be [QImage::Format\_ARGB32\_Premultiplied](qimage#Format-enum) for pixmaps with an alpha and [QImage::Format\_RGB32](qimage#Format-enum) or [QImage::Format\_RGB16](qimage#Format-enum) for pixmaps without alpha. Note that for the moment, alpha masks on monochrome images are ignored. **See also** [fromImage](qpixmap#fromImage)() and [Image Formats](qimage#image-formats). ### [QPixmap](qpixmap#QPixmap) QPixmap::transformed(const [QTransform](qtransform) &*transform*, [Qt::TransformationMode](qt#TransformationMode-enum) *mode* = Qt::FastTransformation) const Returns a copy of the pixmap that is transformed using the given transformation *transform* and transformation *mode*. The original pixmap is not changed. The transformation *transform* is internally adjusted to compensate for unwanted translation; i.e. the pixmap produced is the smallest pixmap that contains all the transformed points of the original pixmap. Use the [trueMatrix](qpixmap#trueMatrix)() function to retrieve the actual matrix used for transforming the pixmap. This function is slow because it involves transformation to a [QImage](qimage), non-trivial computations and a transformation back to a [QPixmap](qpixmap). **See also** [trueMatrix](qpixmap#trueMatrix)() and [Pixmap Transformations](qpixmap#pixmap-transformations). ### `[static]` [QTransform](qtransform) QPixmap::trueMatrix(const [QTransform](qtransform) &*matrix*, int *width*, int *height*) Returns the actual matrix used for transforming a pixmap with the given *width*, *height* and *matrix*. When transforming a pixmap using the [transformed](qpixmap#transformed)() function, the transformation matrix is internally adjusted to compensate for unwanted translation, i.e. [transformed](qpixmap#transformed)() returns the smallest pixmap containing all transformed points of the original pixmap. This function returns the modified matrix, which maps points correctly from the original pixmap into the new pixmap. **See also** [transformed](qpixmap#transformed)() and [Pixmap Transformations](qpixmap#pixmap-transformations). ### int QPixmap::width() const Returns the width of the pixmap. **See also** [size](qpixmap#size)() and [Pixmap Information](qpixmap#pixmap-information). ### [QVariant](qvariant) QPixmap::operator QVariant() const Returns the pixmap as a [QVariant](qvariant). ### bool QPixmap::operator!() const Returns `true` if this is a null pixmap; otherwise returns `false`. **See also** [isNull](qpixmap#isNull)(). Related Non-Members ------------------- ### [QDataStream](qdatastream) &operator<<([QDataStream](qdatastream) &*stream*, const [QPixmap](qpixmap#QPixmap) &*pixmap*) Writes the given *pixmap* to the given *stream* as a PNG image. Note that writing the stream to a file will not produce a valid image file. **See also** [QPixmap::save](qpixmap#save)() and [Serializing Qt Data Types](datastreamformat). ### [QDataStream](qdatastream) &operator>>([QDataStream](qdatastream) &*stream*, [QPixmap](qpixmap#QPixmap) &*pixmap*) Reads an image from the given *stream* into the given *pixmap*. **See also** [QPixmap::load](qpixmap#load)() and [Serializing Qt Data Types](datastreamformat).
programming_docs
qt QTextCodec Class QTextCodec Class ================ The QTextCodec class provides conversions between text encodings. [More...](#details) | | | | --- | --- | | Header: | #include <QTextCodec> | | CMake: | find\_package(Qt6 COMPONENTS Core5Compat REQUIRED) target\_link\_libraries(mytarget PRIVATE Qt6::Core5Compat) | | qmake: | QT += core5compat | * [List of all members, including inherited members](https://doc.qt.io/qt-6.2/qtextcodec-members.html) * [Deprecated members](https://doc.qt.io/qt-6.2/qtextcodec-obsolete.html) **Note:** All functions in this class are [reentrant](threads-reentrancy). * [setCodecForLocale](qtextcodec#setCodecForLocale)() * [~QTextCodec](qtextcodec#dtor.QTextCodec)() **Note:** These functions are also [thread-safe](threads-reentrancy): * [codecForName](qtextcodec#codecForName)() * [codecForMib](qtextcodec#codecForMib)() * [availableCodecs](qtextcodec#availableCodecs)() * [availableMibs](qtextcodec#availableMibs)() * [codecForLocale](qtextcodec#codecForLocale)() Public Types ------------ | | | | --- | --- | | | **[ConversionFlags](qtextcodec#ConversionFlags-typedef)** | | | **[ConverterState](qtextcodec#ConverterState-typedef)** | Public Functions ---------------- | | | | --- | --- | | virtual QList<QByteArray> | **[aliases](qtextcodec#aliases)**() const | | bool | **[canEncode](qtextcodec#canEncode)**(QChar *ch*) const | | bool | **[canEncode](qtextcodec#canEncode-1)**(const QString &*s*) const | | bool | **[canEncode](qtextcodec#canEncode-2)**(QStringView *s*) const | | QByteArray | **[fromUnicode](qtextcodec#fromUnicode)**(const QString &*str*) const | | QByteArray | **[fromUnicode](qtextcodec#fromUnicode-1)**(QStringView *str*) const | | QByteArray | **[fromUnicode](qtextcodec#fromUnicode-2)**(const QChar \**input*, int *number*, QTextCodec::ConverterState \**state* = nullptr) const | | QTextDecoder \* | **[makeDecoder](qtextcodec#makeDecoder)**(QTextCodec::ConversionFlags *flags* = DefaultConversion) const | | QTextEncoder \* | **[makeEncoder](qtextcodec#makeEncoder)**(QTextCodec::ConversionFlags *flags* = DefaultConversion) const | | virtual int | **[mibEnum](qtextcodec#mibEnum)**() const = 0 | | virtual QByteArray | **[name](qtextcodec#name)**() const = 0 | | QString | **[toUnicode](qtextcodec#toUnicode)**(const QByteArray &*a*) const | | QString | **[toUnicode](qtextcodec#toUnicode-1)**(const char \**chars*) const | | QString | **[toUnicode](qtextcodec#toUnicode-2)**(const char \**input*, int *size*, QTextCodec::ConverterState \**state* = nullptr) const | Static Public Members --------------------- | | | | --- | --- | | QList<QByteArray> | **[availableCodecs](qtextcodec#availableCodecs)**() | | QList<int> | **[availableMibs](qtextcodec#availableMibs)**() | | QTextCodec \* | **[codecForHtml](qtextcodec#codecForHtml)**(const QByteArray &*ba*, QTextCodec \**defaultCodec*) | | QTextCodec \* | **[codecForHtml](qtextcodec#codecForHtml-1)**(const QByteArray &*ba*) | | QTextCodec \* | **[codecForLocale](qtextcodec#codecForLocale)**() | | QTextCodec \* | **[codecForMib](qtextcodec#codecForMib)**(int *mib*) | | QTextCodec \* | **[codecForName](qtextcodec#codecForName)**(const QByteArray &*name*) | | QTextCodec \* | **[codecForName](qtextcodec#codecForName-1)**(const char \**name*) | | QTextCodec \* | **[codecForUtfText](qtextcodec#codecForUtfText)**(const QByteArray &*ba*, QTextCodec \**defaultCodec*) | | QTextCodec \* | **[codecForUtfText](qtextcodec#codecForUtfText-1)**(const QByteArray &*ba*) | | void | **[setCodecForLocale](qtextcodec#setCodecForLocale)**(QTextCodec \**c*) | Protected Functions ------------------- | | | | --- | --- | | | **[QTextCodec](qtextcodec#QTextCodec-1)**() | | virtual | **[~QTextCodec](qtextcodec#dtor.QTextCodec)**() | | virtual QByteArray | **[convertFromUnicode](qtextcodec#convertFromUnicode)**(const QChar \**input*, int *number*, QTextCodec::ConverterState \**state*) const = 0 | | virtual QString | **[convertToUnicode](qtextcodec#convertToUnicode)**(const char \**chars*, int *len*, QTextCodec::ConverterState \**state*) const = 0 | Detailed Description -------------------- Qt uses Unicode to store, draw and manipulate strings. In many situations you may wish to deal with data that uses a different encoding. For example, most Japanese documents are still stored in Shift-JIS or ISO 2022-JP, while Russian users often have their documents in KOI8-R or Windows-1251. Qt provides a set of QTextCodec classes to help with converting non-Unicode formats to and from Unicode. You can also create your own codec classes. The supported encodings are: * [Big5](codec-big5) * [Big5-HKSCS](codec-big5hkscs) * CP949 * [EUC-JP](codec-eucjp) * [EUC-KR](codec-euckr) * [GB18030](codec-gbk) * HP-ROMAN8 * IBM 850 * IBM 866 * IBM 874 * [ISO 2022-JP](codecs-jis) * ISO 8859-1 to 10 * ISO 8859-13 to 16 * Iscii-Bng, Dev, Gjr, Knd, Mlm, Ori, Pnj, Tlg, and Tml * KOI8-R * KOI8-U * Macintosh * [Shift-JIS](codec-sjis) * TIS-620 * [TSCII](codec-tscii) * UTF-8 * UTF-16 * UTF-16BE * UTF-16LE * UTF-32 * UTF-32BE * UTF-32LE * Windows-1250 to 1258 If Qt is compiled with ICU support enabled, most codecs supported by ICU will also be available to the application. [QTextCodec](qtextcodec)s can be used as follows to convert some locally encoded string to Unicode. Suppose you have some string encoded in Russian KOI8-R encoding, and want to convert it to Unicode. The simple way to do it is like this: ``` QByteArray encodedString = "..."; QTextCodec *codec = QTextCodec::codecForName("KOI8-R"); QString string = codec->toUnicode(encodedString); ``` After this, `string` holds the text converted to Unicode. Converting a string from Unicode to the local encoding is just as easy: ``` QString string = "..."; QTextCodec *codec = QTextCodec::codecForName("KOI8-R"); QByteArray encodedString = codec->fromUnicode(string); ``` Some care must be taken when trying to convert the data in chunks, for example, when receiving it over a network. In such cases it is possible that a multi-byte character will be split over two chunks. At best this might result in the loss of a character and at worst cause the entire conversion to fail. The approach to use in these situations is to create a [QTextDecoder](qtextdecoder) object for the codec and use this [QTextDecoder](qtextdecoder) for the whole decoding process, as shown below: ``` QTextCodec *codec = QTextCodec::codecForName("Shift-JIS"); QTextDecoder *decoder = codec->makeDecoder(); QString string; while (new_data_available()) { QByteArray chunk = get_new_data(); string += decoder->toUnicode(chunk); } delete decoder; ``` The [QTextDecoder](qtextdecoder) object maintains state between chunks and therefore works correctly even if a multi-byte character is split between chunks. ### Creating Your Own Codec Class Support for new text encodings can be added to Qt by creating QTextCodec subclasses. The pure virtual functions describe the encoder to the system and the coder is used as required in the different text file formats supported by [QTextStream](qtextstream), and under X11, for the locale-specific character input and output. To add support for another encoding to Qt, make a subclass of QTextCodec and implement the functions listed in the table below. | Function | Description | | --- | --- | | [name](qtextcodec#name)() | Returns the official name for the encoding. If the encoding is listed in the [IANA character-sets encoding file](http://www.iana.org/assignments/character-sets/character-sets.xml), the name should be the preferred MIME name for the encoding. | | [aliases](qtextcodec#aliases)() | Returns a list of alternative names for the encoding. QTextCodec provides a default implementation that returns an empty list. For example, "ISO-8859-1" has "latin1", "CP819", "IBM819", and "iso-ir-100" as aliases. | | [mibEnum](qtextcodec#mibEnum)() | Return the MIB enum for the encoding if it is listed in the [IANA character-sets encoding file](http://www.iana.org/assignments/character-sets/character-sets.xml). | | [convertToUnicode](qtextcodec#convertToUnicode)() | Converts an 8-bit character string to Unicode. | | [convertFromUnicode](qtextcodec#convertFromUnicode)() | Converts a Unicode string to an 8-bit character string. | **See also** [QTextStream](qtextstream), [QTextDecoder](qtextdecoder), and [QTextEncoder](qtextencoder). Member Type Documentation ------------------------- ### `[alias]` QTextCodec::ConversionFlags | Constant | Description | | --- | --- | | `DefaultConversion` | No flag is set. | | `ConvertInvalidToNull` | If this flag is set, each invalid input character is output as a null character. | | `IgnoreHeader` | Ignore any Unicode byte-order mark and don't generate any. | ### `[alias]` QTextCodec::ConverterState Member Function Documentation ----------------------------- ### `[protected]` QTextCodec::QTextCodec() Constructs a QTextCodec, and gives it the highest precedence. The QTextCodec should always be constructed on the heap (i.e. with `new`). Qt takes ownership and will delete it when the application terminates. ### `[virtual protected]` QTextCodec::~QTextCodec() Destroys the [QTextCodec](qtextcodec). Note that you should not delete codecs yourself: once created they become Qt's responsibility. **Warning:** This function is not [reentrant](threads-reentrancy). ### `[virtual]` [QList](qlist)<[QByteArray](qbytearray)> QTextCodec::aliases() const Subclasses can return a number of aliases for the codec in question. Standard aliases for codecs can be found in the [IANA character-sets encoding file](http://www.iana.org/assignments/character-sets/character-sets.xml). ### `[static]` [QList](qlist)<[QByteArray](qbytearray)> QTextCodec::availableCodecs() Returns the list of all available codecs, by name. Call [QTextCodec::codecForName](qtextcodec#codecForName)() to obtain the [QTextCodec](qtextcodec) for the name. The list may contain many mentions of the same codec if the codec has aliases. **Note:** This function is [thread-safe](threads-reentrancy). **See also** [availableMibs](qtextcodec#availableMibs)(), [name](qtextcodec#name)(), and [aliases](qtextcodec#aliases)(). ### `[static]` [QList](qlist)<int> QTextCodec::availableMibs() Returns the list of MIBs for all available codecs. Call [QTextCodec::codecForMib](qtextcodec#codecForMib)() to obtain the [QTextCodec](qtextcodec) for the MIB. **Note:** This function is [thread-safe](threads-reentrancy). **See also** [availableCodecs](qtextcodec#availableCodecs)() and [mibEnum](qtextcodec#mibEnum)(). ### bool QTextCodec::canEncode([QChar](qchar) *ch*) const Returns `true` if the Unicode character *ch* can be fully encoded with this codec; otherwise returns `false`. ### bool QTextCodec::canEncode(const [QString](qstring) &*s*) const This is an overloaded function. *s* contains the string being tested for encode-ability. ### `[since 5.10]` bool QTextCodec::canEncode([QStringView](qstringview) *s*) const This is an overloaded function. Returns `true` if the Unicode string *s* can be fully encoded with this codec; otherwise returns `false`. This function was introduced in Qt 5.10. ### `[static]` QTextCodec \*QTextCodec::codecForHtml(const [QByteArray](qbytearray) &*ba*, QTextCodec \**defaultCodec*) Tries to detect the encoding of the provided snippet of HTML in the given byte array, *ba*, by checking the BOM (Byte Order Mark) and the content-type meta header and returns a [QTextCodec](qtextcodec) instance that is capable of decoding the html to unicode. If the codec cannot be detected from the content provided, *defaultCodec* is returned. **See also** [codecForUtfText](qtextcodec#codecForUtfText)(). ### `[static]` QTextCodec \*QTextCodec::codecForHtml(const [QByteArray](qbytearray) &*ba*) This is an overloaded function. Tries to detect the encoding of the provided snippet of HTML in the given byte array, *ba*, by checking the BOM (Byte Order Mark) and the content-type meta header and returns a [QTextCodec](qtextcodec) instance that is capable of decoding the html to unicode. If the codec cannot be detected, this overload returns a Latin-1 [QTextCodec](qtextcodec). ### `[static]` QTextCodec \*QTextCodec::codecForLocale() Returns a pointer to the codec most suitable for this locale. The codec will be retrieved from ICU where that backend is in use, otherwise it may be obtained from an OS-specific API. In the latter case, the codec's name may be "System". **Note:** This function is [thread-safe](threads-reentrancy). **See also** [setCodecForLocale](qtextcodec#setCodecForLocale)(). ### `[static]` QTextCodec \*QTextCodec::codecForMib(int *mib*) Returns the [QTextCodec](qtextcodec) which matches the [MIBenum](qtextcodec#mibEnum) *mib*. **Note:** This function is [thread-safe](threads-reentrancy). ### `[static]` QTextCodec \*QTextCodec::codecForName(const [QByteArray](qbytearray) &*name*) Searches all installed [QTextCodec](qtextcodec) objects and returns the one which best matches *name*; the match is case-insensitive. Returns 0 if no codec matching the name *name* could be found. **Note:** This function is [thread-safe](threads-reentrancy). ### `[static]` QTextCodec \*QTextCodec::codecForName(const char \**name*) Searches all installed [QTextCodec](qtextcodec) objects and returns the one which best matches *name*; the match is case-insensitive. Returns 0 if no codec matching the name *name* could be found. ### `[static]` QTextCodec \*QTextCodec::codecForUtfText(const [QByteArray](qbytearray) &*ba*, QTextCodec \**defaultCodec*) Tries to detect the encoding of the provided snippet *ba* by using the BOM (Byte Order Mark) and returns a [QTextCodec](qtextcodec) instance that is capable of decoding the text to unicode. This function can detect one of the following codecs: * UTF-32 Little Endian * UTF-32 Big Endian * UTF-16 Little Endian * UTF-16 Big Endian * UTF-8 If the codec cannot be detected from the content provided, *defaultCodec* is returned. **See also** [codecForHtml](qtextcodec#codecForHtml)(). ### `[static]` QTextCodec \*QTextCodec::codecForUtfText(const [QByteArray](qbytearray) &*ba*) This is an overloaded function. Tries to detect the encoding of the provided snippet *ba* by using the BOM (Byte Order Mark) and returns a [QTextCodec](qtextcodec) instance that is capable of decoding the text to unicode. This function can detect one of the following codecs: * UTF-32 Little Endian * UTF-32 Big Endian * UTF-16 Little Endian * UTF-16 Big Endian * UTF-8 If the codec cannot be detected from the content provided, this overload returns a Latin-1 [QTextCodec](qtextcodec). **See also** [codecForHtml](qtextcodec#codecForHtml)(). ### `[pure virtual protected]` [QByteArray](qbytearray) QTextCodec::convertFromUnicode(const [QChar](qchar) \**input*, int *number*, QTextCodec::ConverterState \**state*) const [QTextCodec](qtextcodec) subclasses must reimplement this function. Converts the first *number* of characters from the *input* array from Unicode to the encoding of the subclass, and returns the result in a [QByteArray](qbytearray). *state* can be `nullptr` in which case the conversion is stateless and default conversion rules should be used. If state is not 0, the codec should save the state after the conversion in *state*, and adjust the `remainingChars` and `invalidChars` members of the struct. ### `[pure virtual protected]` [QString](qstring) QTextCodec::convertToUnicode(const char \**chars*, int *len*, QTextCodec::ConverterState \**state*) const [QTextCodec](qtextcodec) subclasses must reimplement this function. Converts the first *len* characters of *chars* from the encoding of the subclass to Unicode, and returns the result in a [QString](qstring). *state* can be `nullptr`, in which case the conversion is stateless and default conversion rules should be used. If state is not 0, the codec should save the state after the conversion in *state*, and adjust the `remainingChars` and `invalidChars` members of the struct. ### [QByteArray](qbytearray) QTextCodec::fromUnicode(const [QString](qstring) &*str*) const Converts *str* from Unicode to the encoding of this codec, and returns the result in a [QByteArray](qbytearray). ### `[since 5.10]` [QByteArray](qbytearray) QTextCodec::fromUnicode([QStringView](qstringview) *str*) const This is an overloaded function. Converts *str* from Unicode to the encoding of this codec, and returns the result in a [QByteArray](qbytearray). This function was introduced in Qt 5.10. ### [QByteArray](qbytearray) QTextCodec::fromUnicode(const [QChar](qchar) \**input*, int *number*, QTextCodec::ConverterState \**state* = nullptr) const Converts the first *number* of characters from the *input* array from Unicode to the encoding of this codec, and returns the result in a [QByteArray](qbytearray). The *state* of the convertor used is updated. ### [QTextDecoder](qtextdecoder) \*QTextCodec::makeDecoder(QTextCodec::ConversionFlags *flags* = DefaultConversion) const Creates a [QTextDecoder](qtextdecoder) with a specified *flags* to decode chunks of `char *` data to create chunks of Unicode data. The caller is responsible for deleting the returned object. ### [QTextEncoder](qtextencoder) \*QTextCodec::makeEncoder(QTextCodec::ConversionFlags *flags* = DefaultConversion) const Creates a [QTextEncoder](qtextencoder) with a specified *flags* to encode chunks of Unicode data as `char *` data. The caller is responsible for deleting the returned object. ### `[pure virtual]` int QTextCodec::mibEnum() const Subclasses of [QTextCodec](qtextcodec) must reimplement this function. It returns the MIBenum (see [IANA character-sets encoding file](http://www.iana.org/assignments/character-sets/character-sets.xml) for more information). It is important that each [QTextCodec](qtextcodec) subclass returns the correct unique value for this function. ### `[pure virtual]` [QByteArray](qbytearray) QTextCodec::name() const [QTextCodec](qtextcodec) subclasses must reimplement this function. It returns the name of the encoding supported by the subclass. If the codec is registered as a character set in the [IANA character-sets encoding file](http://www.iana.org/assignments/character-sets/character-sets.xml) this method should return the preferred mime name for the codec if defined, otherwise its name. ### `[static]` void QTextCodec::setCodecForLocale(QTextCodec \**c*) Set the codec to *c*; this will be returned by [codecForLocale](qtextcodec#codecForLocale)(). If *c* is `nullptr`, the codec is reset to the default. This might be needed for some applications that want to use their own mechanism for setting the locale. **Warning:** This function is not [reentrant](threads-reentrancy). **See also** [codecForLocale](qtextcodec#codecForLocale)(). ### [QString](qstring) QTextCodec::toUnicode(const [QByteArray](qbytearray) &*a*) const Converts *a* from the encoding of this codec to Unicode, and returns the result in a [QString](qstring). ### [QString](qstring) QTextCodec::toUnicode(const char \**chars*) const This is an overloaded function. *chars* contains the source characters. ### [QString](qstring) QTextCodec::toUnicode(const char \**input*, int *size*, QTextCodec::ConverterState \**state* = nullptr) const Converts the first *size* characters from the *input* from the encoding of this codec to Unicode, and returns the result in a [QString](qstring). The *state* of the convertor used is updated. qt TiltSensor QML Type TiltSensor QML Type =================== The TiltSensor element reports tilt events along the X and Y axes. [More...](#details) | | | | --- | --- | | Import Statement: | import QtSensors | | Since: | QtSensors 5.0 | | Inherits: | [Sensor](qml-qtsensors-sensor) | * [List of all members, including inherited members](https://doc.qt.io/qt-6.2/qml-qtsensors-tiltsensor-members.html) Methods ------- * **[calibrate](qml-qtsensors-tiltsensor#calibrate-method)**() Detailed Description -------------------- The TiltSensor element reports tilt events along the X and Y axes. This element wraps the [QTiltSensor](qtiltsensor) class. Please see the documentation for [QTiltSensor](qtiltsensor) for details. **See also** [TiltReading](qml-qtsensors-tiltreading). Method Documentation -------------------- ### calibrate() Calibrate the tilt sensor. Please see [QTiltSensor::calibrate](qtiltsensor#calibrate)() for information about this property.
programming_docs
qt QScopedValueRollback Class QScopedValueRollback Class ========================== template <typename T> class QScopedValueRollback The QScopedValueRollback class resets a variable to its previous value on destruction. [More...](#details) | | | | --- | --- | | Header: | #include <QScopedValueRollback> | | CMake: | find\_package(Qt6 COMPONENTS Core REQUIRED) target\_link\_libraries(mytarget PRIVATE Qt6::Core) | | qmake: | QT += core | * [List of all members, including inherited members](https://doc.qt.io/qt-6.2/qscopedvaluerollback-members.html) Public Functions ---------------- | | | | --- | --- | | | **[QScopedValueRollback](qscopedvaluerollback#QScopedValueRollback-1)**(T &*var*, T *value*) | | | **[QScopedValueRollback](qscopedvaluerollback#QScopedValueRollback)**(T &*var*) | | | **[~QScopedValueRollback](qscopedvaluerollback#dtor.QScopedValueRollback)**() | | void | **[commit](qscopedvaluerollback#commit)**() | Detailed Description -------------------- The QScopedValueRollback class can be used to revert state when an exception is thrown without needing to write try-catch blocks. It can also be used to manage variables that are temporarily set, such as reentrancy guards. By using this class, the variable will be reset whether the function is exited normally, exited early by a return statement, or exited by an exception. The template can only be instantiated with a type that supports assignment. **See also** [QScopedPointer](qscopedpointer) and [QScopeGuard](qscopeguard). Member Function Documentation ----------------------------- ### `[since 5.4]` QScopedValueRollback::QScopedValueRollback(T &*var*, T *value*) Assigns *value* to var and stores the previous value of *var* internally, for revert on destruction. This function was introduced in Qt 5.4. ### QScopedValueRollback::QScopedValueRollback(T &*var*) Stores the previous value of *var* internally, for revert on destruction. ### QScopedValueRollback::~QScopedValueRollback() Assigns the previous value to the managed variable. This is the value at construction time, or at the last call to [commit](qscopedvaluerollback#commit)() ### void QScopedValueRollback::commit() Updates the previous value of the managed variable to its current value. qt Reentrancy and Thread-Safety Reentrancy and Thread-Safety ============================ Throughout the documentation, the terms *reentrant* and *thread-safe* are used to mark classes and functions to indicate how they can be used in multithread applications: * A *thread-safe* function can be called simultaneously from multiple threads, even when the invocations use shared data, because all references to the shared data are serialized. * A *reentrant* function can also be called simultaneously from multiple threads, but only if each invocation uses its own data. Hence, a *thread-safe* function is always *reentrant*, but a *reentrant* function is not always *thread-safe*. By extension, a class is said to be *reentrant* if its member functions can be called safely from multiple threads, as long as each thread uses a *different* instance of the class. The class is *thread-safe* if its member functions can be called safely from multiple threads, even if all the threads use the *same* instance of the class. **Note:** Qt classes are only documented as *thread-safe* if they are intended to be used by multiple threads. If a function is not marked as thread-safe or reentrant, it should not be used from different threads. If a class is not marked as thread-safe or reentrant then a specific instance of that class should not be accessed from different threads. Reentrancy ---------- C++ classes are often reentrant, simply because they only access their own member data. Any thread can call a member function on an instance of a reentrant class, as long as no other thread can call a member function on the *same* instance of the class at the same time. For example, the `Counter` class below is reentrant: ``` class Counter { public: Counter() { n = 0; } void increment() { ++n; } void decrement() { --n; } int value() const { return n; } private: int n; }; ``` The class isn't thread-safe, because if multiple threads try to modify the data member `n`, the result is undefined. This is because the `++` and `--` operators aren't always atomic. Indeed, they usually expand to three machine instructions: 1. Load the variable's value in a register. 2. Increment or decrement the register's value. 3. Store the register's value back into main memory. If thread A and thread B load the variable's old value simultaneously, increment their register, and store it back, they end up overwriting each other, and the variable is incremented only once! Thread-Safety ------------- Clearly, the access must be serialized: Thread A must perform steps 1, 2, 3 without interruption (atomically) before thread B can perform the same steps; or vice versa. An easy way to make the class thread-safe is to protect all access to the data members with a [QMutex](qmutex): ``` class Counter { public: Counter() { n = 0; } void increment() { QMutexLocker locker(&mutex); ++n; } void decrement() { QMutexLocker locker(&mutex); --n; } int value() const { QMutexLocker locker(&mutex); return n; } private: mutable QMutex mutex; int n; }; ``` The [QMutexLocker](qmutexlocker) class automatically locks the mutex in its constructor and unlocks it when the destructor is invoked, at the end of the function. Locking the mutex ensures that access from different threads will be serialized. The `mutex` data member is declared with the `mutable` qualifier because we need to lock and unlock the mutex in `value()`, which is a const function. Notes on Qt Classes ------------------- Many Qt classes are *reentrant*, but they are not made *thread-safe*, because making them thread-safe would incur the extra overhead of repeatedly locking and unlocking a [QMutex](qmutex). For example, [QString](qstring) is reentrant but not thread-safe. You can safely access *different* instances of [QString](qstring) from multiple threads simultaneously, but you can't safely access the *same* instance of [QString](qstring) from multiple threads simultaneously (unless you protect the accesses yourself with a [QMutex](qmutex)). Some Qt classes and functions are thread-safe. These are mainly the thread-related classes (e.g. [QMutex](qmutex)) and fundamental functions (e.g. [QCoreApplication::postEvent](qcoreapplication#postEvent)()). **Note:** Terminology in the multithreading domain isn't entirely standardized. POSIX uses definitions of reentrant and thread-safe that are somewhat different for its C APIs. When using other object-oriented C++ class libraries with Qt, be sure the definitions are understood. qt OpacityMask QML Type OpacityMask QML Type ==================== Masks the source item with another item. [More...](#details) | | | | --- | --- | | Import Statement: | import Qt5Compat.GraphicalEffects | | Since: | QtGraphicalEffects 1.0 | | Inherits: | [Item](qml-qtquick-item) | * [List of all members, including inherited members](https://doc.qt.io/qt-6.2/qml-qt5compat-graphicaleffects-opacitymask-members.html) Properties ---------- * **[cached](qml-qt5compat-graphicaleffects-opacitymask#cached-prop)** : bool * **[invert](qml-qt5compat-graphicaleffects-opacitymask#invert-prop)** : bool * **[maskSource](qml-qt5compat-graphicaleffects-opacitymask#maskSource-prop)** : variant * **[source](qml-qt5compat-graphicaleffects-opacitymask#source-prop)** : variant Detailed Description -------------------- | Source | MaskSource | Effect applied | | --- | --- | --- | | | | | Example ------- The following example shows how to apply the effect. ``` import QtQuick import Qt5Compat.GraphicalEffects Item { width: 300 height: 300 Image { id: bug source: "images/bug.jpg" sourceSize: Qt.size(parent.width, parent.height) smooth: true visible: false } Image { id: mask source: "images/butterfly.png" sourceSize: Qt.size(parent.width, parent.height) smooth: true visible: false } OpacityMask { anchors.fill: bug source: bug maskSource: mask } } ``` Property Documentation ---------------------- ### cached : [bool](qml-bool) This property allows the effect output pixels to be cached in order to improve the rendering performance. Every time the source or effect properties are changed, the pixels in the cache must be updated. Memory consumption is increased, because an extra buffer of memory is required for storing the effect output. It is recommended to disable the cache when the source or the effect properties are animated. By default, the property is set to `false`. **Note:** It is not supported to let the effect include itself, for instance by setting [maskSource](qml-qt5compat-graphicaleffects-opacitymask#maskSource-prop) to the effect's parent. ### [since 5.7] invert : [bool](qml-bool) This property controls how the alpha values of the sourceMask will behave. If this property is `false`, the resulting opacity is the source alpha multiplied with the mask alpha, `As * Am`. If this property is `true`, the resulting opacity is the source alpha multiplied with the inverse of the mask alpha, `As * (1 - Am)`. The default is `false`. This property was introduced in Qt 5.7. ### maskSource : variant This property defines the item that is going to be used as the mask. The mask item gets rendered into an intermediate pixel buffer and the alpha values from the result are used to determine the source item's pixels visibility in the display. | Original | Mask | Effect applied | | --- | --- | --- | | | | | ### source : variant This property defines the source item that is going to be masked. **Note:** It is not supported to let the effect include itself, for instance by setting source to the effect's parent. qt QXmlInputSource Class QXmlInputSource Class ===================== The QXmlInputSource class provides the input data for the [QXmlReader](qxmlreader) subclasses. [More...](#details) | | | | --- | --- | | Header: | #include <QXmlInputSource> | | CMake: | find\_package(Qt6 COMPONENTS Core5Compat REQUIRED) target\_link\_libraries(mytarget PRIVATE Qt6::Core5Compat) | | qmake: | QT += core5compat | * [List of all members, including inherited members](https://doc.qt.io/qt-6.2/qxmlinputsource-members.html) **Note:** All functions in this class are [reentrant](threads-reentrancy). Public Functions ---------------- | | | | --- | --- | | | **[QXmlInputSource](qxmlinputsource#QXmlInputSource-1)**(QIODevice \**dev*) | | | **[QXmlInputSource](qxmlinputsource#QXmlInputSource)**() | | virtual | **[~QXmlInputSource](qxmlinputsource#dtor.QXmlInputSource)**() | | virtual QString | **[data](qxmlinputsource#data)**() const | | virtual void | **[fetchData](qxmlinputsource#fetchData)**() | | virtual QChar | **[next](qxmlinputsource#next)**() | | virtual void | **[reset](qxmlinputsource#reset)**() | | virtual void | **[setData](qxmlinputsource#setData)**(const QString &*dat*) | | virtual void | **[setData](qxmlinputsource#setData-1)**(const QByteArray &*dat*) | Protected Functions ------------------- | | | | --- | --- | | virtual QString | **[fromRawData](qxmlinputsource#fromRawData)**(const QByteArray &*data*, bool *beginning* = false) | Detailed Description -------------------- All subclasses of [QXmlReader](qxmlreader) read the input XML document from this class. This class recognizes the encoding of the data by reading the encoding declaration in the XML file if it finds one, and reading the data using the corresponding encoding. If it does not find an encoding declaration, then it assumes that the data is either in UTF-8 or UTF-16, depending on whether it can find a byte-order mark. There are two ways to populate the input source with data: you can construct it with a [QIODevice](qiodevice)\* so that the input source reads the data from that device. Or you can set the data explicitly with one of the [setData](qxmlinputsource#setData)() functions. Usually you either construct a QXmlInputSource that works on a [QIODevice](qiodevice)\* or you construct an empty QXmlInputSource and set the data with [setData](qxmlinputsource#setData)(). There are only rare occasions where you would want to mix both methods. The [QXmlReader](qxmlreader) subclasses use the [next](qxmlinputsource#next)() function to read the input character by character. If you want to start from the beginning again, use [reset](qxmlinputsource#reset)(). The functions [data](qxmlinputsource#data)() and [fetchData](qxmlinputsource#fetchData)() are useful if you want to do something with the data other than parsing, e.g. displaying the raw XML file. The benefit of using the QXmlInputClass in such cases is that it tries to use the correct encoding. **See also** [QXmlReader](qxmlreader) and [QXmlSimpleReader](qxmlsimplereader). Member Function Documentation ----------------------------- ### QXmlInputSource::QXmlInputSource([QIODevice](qiodevice) \**dev*) Constructs an input source and gets the data from device *dev*. If *dev* is not open, it is opened in read-only mode. If *dev* is 0 or it is not possible to read from the device, the input source will contain no data. **See also** [setData](qxmlinputsource#setData)(), [fetchData](qxmlinputsource#fetchData)(), and [QIODevice](qiodevice). ### QXmlInputSource::QXmlInputSource() Constructs an input source which contains no data. **See also** [setData](qxmlinputsource#setData)(). ### `[virtual]` QXmlInputSource::~QXmlInputSource() Destructor. ### `[virtual]` [QString](qstring) QXmlInputSource::data() const Returns the data the input source contains or an empty string if the input source does not contain any data. **See also** [setData](qxmlinputsource#setData)(), [QXmlInputSource](qxmlinputsource#QXmlInputSource)(), and [fetchData](qxmlinputsource#fetchData)(). ### `[virtual]` void QXmlInputSource::fetchData() This function reads more data from the device that was set during construction. If the input source already contained data, this function deletes that data first. This object contains no data after a call to this function if the object was constructed without a device to read data from or if this function was not able to get more data from the device. There are two occasions where a fetch is done implicitly by another function call: during construction (so that the object starts out with some initial data where available), and during a call to [next](qxmlinputsource#next)() (if the data had run out). You don't normally need to use this function if you use [next](qxmlinputsource#next)(). **See also** [data](qxmlinputsource#data)(), [next](qxmlinputsource#next)(), and [QXmlInputSource](qxmlinputsource#QXmlInputSource)(). ### `[virtual protected]` [QString](qstring) QXmlInputSource::fromRawData(const [QByteArray](qbytearray) &*data*, bool *beginning* = false) This function reads the XML file from *data* and tries to recognize the encoding. It converts the raw data *data* into a [QString](qstring) and returns it. It tries its best to get the correct encoding for the XML file. If *beginning* is true, this function assumes that the data starts at the beginning of a new XML document and looks for an encoding declaration. If *beginning* is false, it converts the raw data using the encoding determined from prior calls. ### `[virtual]` [QChar](qchar) QXmlInputSource::next() Returns the next character of the input source. If this function reaches the end of available data, it returns QXmlInputSource::EndOfData. If you call next() after that, it tries to fetch more data by calling [fetchData](qxmlinputsource#fetchData)(). If the [fetchData](qxmlinputsource#fetchData)() call results in new data, this function returns the first character of that data; otherwise it returns QXmlInputSource::EndOfDocument. Readers, such as [QXmlSimpleReader](qxmlsimplereader), will assume that the end of the XML document has been reached if the this function returns QXmlInputSource::EndOfDocument, and will check that the supplied input is well-formed. Therefore, when reimplementing this function, it is important to ensure that this behavior is duplicated. **See also** [reset](qxmlinputsource#reset)(), [fetchData](qxmlinputsource#fetchData)(), [QXmlSimpleReader::parse](qxmlsimplereader#parse)(), and [QXmlSimpleReader::parseContinue](qxmlsimplereader#parseContinue)(). ### `[virtual]` void QXmlInputSource::reset() This function sets the position used by [next](qxmlinputsource#next)() to the beginning of the data returned by [data](qxmlinputsource#data)(). This is useful if you want to use the input source for more than one parse. **Note:** In the case that the underlying data source is a [QIODevice](qiodevice), the current position in the device is not automatically set to the start of input. Call [QIODevice::seek](qiodevice#seek)(0) on the device to do this. **See also** [next](qxmlinputsource#next)(). ### `[virtual]` void QXmlInputSource::setData(const [QString](qstring) &*dat*) Sets the data of the input source to *dat*. If the input source already contains data, this function deletes that data first. **See also** [data](qxmlinputsource#data)(). ### `[virtual]` void QXmlInputSource::setData(const [QByteArray](qbytearray) &*dat*) This is an overloaded function. The data *dat* is passed through the correct text-codec, before it is set. qt Qt Positioning Gypsy plugin Qt Positioning Gypsy plugin =========================== Overview -------- The plugin is an interface to the [Gypsy daemon](https://gypsy.freedesktop.org/wiki/). It requires the daemon to be installed and running on the system to function. The plugin uses D-Bus and GLib to connect to GPS device and provide satellite information. Currently the plugin *does not* provide positioning information. The plugin can be loaded using provider name **gypsy**. Parameters ---------- The following table lists parameters that *can* be passed to the gypsy plugin. | Parameter | Description | | --- | --- | | deviceName | The name of the device (or path to the device file) that will be used to provide satellite information. The typical values can be `/dev/ttyUSB0` or `/dev/ttyACM0`. | | gconfKey | The key that will be used to extract device name from the GConf configuration system. | The plugin supports two ways of specifying the device name: * Specify the device name directly with the *deviceName* plugin parameter. * Specify the configuration key using *gconfKey* plugin parameter and extract the device name from the GConf configuration system. This approach is useful when the device name is already specified for some other GConf-based application. By default, when none of the parameters is specified, the plugin will try to extract the device name from the GConf configuration system using the following hardcoded key: ``` /apps/geoclue/master/org.freedesktop.Geoclue.GPSDevice ``` ### Using GConf to set parameters To specify a value for a key in the GConf configuration system, use *gconftool-2* as follows: ``` gconftool-2 -t string -s /apps/geoclue/master/org.freedesktop.Geoclue.GPSDevice /dev/ttyUSB0 ``` Usage example ------------- The following examples show how to create a **gypsy** satellite info source from C++. Specifying device name directly: ``` QVariantMap parameters; parameters["deviceName"] = "/dev/ttyACM0"; QGeoSatelliteInfoSource *source = QGeoSatelliteInfoSource::createSource("gypsy", parameters, this); ``` Using GConf key: ``` QVariantMap parameters; parameters["gconfKey"] = "/apps/myapp/mykey"; QGeoSatelliteInfoSource *source = QGeoSatelliteInfoSource::createSource("gypsy", parameters, this); ```
programming_docs
qt QEnableSharedFromThis Class QEnableSharedFromThis Class =========================== template <typename T> class QEnableSharedFromThis A base class that allows obtaining a [QSharedPointer](qsharedpointer) for an object already managed by a shared pointer. [More...](#details) | | | | --- | --- | | Header: | #include <QEnableSharedFromThis> | | CMake: | find\_package(Qt6 COMPONENTS Core REQUIRED) target\_link\_libraries(mytarget PRIVATE Qt6::Core) | | qmake: | QT += core | | Since: | Qt 5.4 | * [List of all members, including inherited members](https://doc.qt.io/qt-6.2/qenablesharedfromthis-members.html) Public Functions ---------------- | | | | --- | --- | | QSharedPointer<T> | **[sharedFromThis](qenablesharedfromthis#sharedFromThis)**() | | QSharedPointer<const T> | **[sharedFromThis](qenablesharedfromthis#sharedFromThis-1)**() const | Detailed Description -------------------- You can inherit this class when you need to create a [QSharedPointer](qsharedpointer) from any instance of a class; for instance, from within the object itself. The key point is that the technique of just returning [QSharedPointer](qsharedpointer)<T>(this) cannot be used, because this winds up creating multiple distinct [QSharedPointer](qsharedpointer) objects with separate reference counts. For this reason you must never create more than one [QSharedPointer](qsharedpointer) from the same raw pointer. QEnableSharedFromThis defines two member functions called [sharedFromThis](qenablesharedfromthis#sharedFromThis)() that return a [QSharedPointer](qsharedpointer)<T> and [QSharedPointer](qsharedpointer)<const T>, depending on constness, to `this`: ``` class Y: public QEnableSharedFromThis<Y> { public: QSharedPointer<Y> f() { return sharedFromThis(); } }; int main() { QSharedPointer<Y> p(new Y()); QSharedPointer<Y> y = p->f(); Q_ASSERT(p == y); // p and q must share ownership } ``` It is also possible to get a shared pointer from an object outside of the class itself. This is especially useful in code that provides an interface to scripts, where it is currently not possible to use shared pointers. For example: ``` class ScriptInterface : public QObject { Q_OBJECT // ... public slots: void slotCalledByScript(Y *managedBySharedPointer) { QSharedPointer<Y> yPtr = managedBySharedPointer->sharedFromThis(); // Some other code unrelated to scripts that expects a QSharedPointer<Y> ... } }; ``` Member Function Documentation ----------------------------- ### `[since 5.4]` [QSharedPointer](qsharedpointer)<T> QEnableSharedFromThis::sharedFromThis() If `this` (that is, the subclass instance invoking this method) is being managed by a [QSharedPointer](qsharedpointer), returns a shared pointer instance pointing to `this`; otherwise returns a null [QSharedPointer](qsharedpointer). This function was introduced in Qt 5.4. ### `[since 5.4]` [QSharedPointer](qsharedpointer)<const T> QEnableSharedFromThis::sharedFromThis() const This is an overloaded function. Const overload of sharedFromThis(). This function was introduced in Qt 5.4. qt QTextDocumentWriter Class QTextDocumentWriter Class ========================= The QTextDocumentWriter class provides a format-independent interface for writing a [QTextDocument](qtextdocument) to files or other devices. [More...](#details) | | | | --- | --- | | Header: | #include <QTextDocumentWriter> | | CMake: | find\_package(Qt6 COMPONENTS Gui REQUIRED) target\_link\_libraries(mytarget PRIVATE Qt6::Gui) | | qmake: | QT += gui | * [List of all members, including inherited members](https://doc.qt.io/qt-6.2/qtextdocumentwriter-members.html) Public Functions ---------------- | | | | --- | --- | | | **[QTextDocumentWriter](qtextdocumentwriter#QTextDocumentWriter-2)**(const QString &*fileName*, const QByteArray &*format* = QByteArray()) | | | **[QTextDocumentWriter](qtextdocumentwriter#QTextDocumentWriter-1)**(QIODevice \**device*, const QByteArray &*format*) | | | **[QTextDocumentWriter](qtextdocumentwriter#QTextDocumentWriter)**() | | | **[~QTextDocumentWriter](qtextdocumentwriter#dtor.QTextDocumentWriter)**() | | QIODevice \* | **[device](qtextdocumentwriter#device)**() const | | QString | **[fileName](qtextdocumentwriter#fileName)**() const | | QByteArray | **[format](qtextdocumentwriter#format)**() const | | void | **[setDevice](qtextdocumentwriter#setDevice)**(QIODevice \**device*) | | void | **[setFileName](qtextdocumentwriter#setFileName)**(const QString &*fileName*) | | void | **[setFormat](qtextdocumentwriter#setFormat)**(const QByteArray &*format*) | | bool | **[write](qtextdocumentwriter#write)**(const QTextDocument \**document*) | | bool | **[write](qtextdocumentwriter#write-1)**(const QTextDocumentFragment &*fragment*) | Static Public Members --------------------- | | | | --- | --- | | QList<QByteArray> | **[supportedDocumentFormats](qtextdocumentwriter#supportedDocumentFormats)**() | Detailed Description -------------------- To write a document, construct a QTextDocumentWriter object with either a file name or a device object, and specify the document format to be written. You can construct a writer and set the format using [setFormat](qtextdocumentwriter#setFormat)() later. Call [write](qtextdocumentwriter#write)() to write the document to the device. If the document is successfully written, this function returns `true`. However, if an error occurs when writing the document, it will return false. Call [supportedDocumentFormats](qtextdocumentwriter#supportedDocumentFormats)() for a list of formats that QTextDocumentWriter can write. Since the capabilities of the supported output formats vary considerably, the writer simply outputs the appropriate subset of objects for each format. This typically includes the formatted text and images contained in a document. Member Function Documentation ----------------------------- ### QTextDocumentWriter::QTextDocumentWriter(const [QString](qstring) &*fileName*, const [QByteArray](qbytearray) &*format* = QByteArray()) Constructs an QTextDocumentWriter object that will write to a file with the name *fileName*, using the document format specified by *format*. If *format* is not provided, QTextDocumentWriter will detect the document format by inspecting the extension of *fileName*. ### QTextDocumentWriter::QTextDocumentWriter([QIODevice](qiodevice) \**device*, const [QByteArray](qbytearray) &*format*) Constructs a QTextDocumentWriter object to write to the given *device* in the document format specified by *format*. ### QTextDocumentWriter::QTextDocumentWriter() Constructs an empty QTextDocumentWriter object. Before writing, you must call [setFormat](qtextdocumentwriter#setFormat)() to set a document format, then [setDevice](qtextdocumentwriter#setDevice)() or [setFileName](qtextdocumentwriter#setFileName)(). ### QTextDocumentWriter::~QTextDocumentWriter() Destroys the [QTextDocumentWriter](qtextdocumentwriter) object. ### [QIODevice](qiodevice) \*QTextDocumentWriter::device() const Returns the device currently assigned, or `nullptr` if no device has been assigned. **See also** [setDevice](qtextdocumentwriter#setDevice)(). ### [QString](qstring) QTextDocumentWriter::fileName() const If the currently assigned device is a [QFile](qfile), or if [setFileName](qtextdocumentwriter#setFileName)() has been called, this function returns the name of the file to be written to. In all other cases, it returns an empty string. **See also** [setFileName](qtextdocumentwriter#setFileName)() and [setDevice](qtextdocumentwriter#setDevice)(). ### [QByteArray](qbytearray) QTextDocumentWriter::format() const Returns the format used for writing documents. **See also** [setFormat](qtextdocumentwriter#setFormat)(). ### void QTextDocumentWriter::setDevice([QIODevice](qiodevice) \**device*) Sets the writer's device to the *device* specified. If a device has already been set, the old device is removed but otherwise left unchanged. If the device is not already open, [QTextDocumentWriter](qtextdocumentwriter) will attempt to open the device in [WriteOnly](qiodevicebase#OpenModeFlag-enum) mode by calling open(). **Note:** This will not work for certain devices, such as [QProcess](qprocess), [QTcpSocket](qtcpsocket) and [QUdpSocket](qudpsocket), where some configuration is required before the device can be opened. **See also** [device](qtextdocumentwriter#device)() and [setFileName](qtextdocumentwriter#setFileName)(). ### void QTextDocumentWriter::setFileName(const [QString](qstring) &*fileName*) Sets the name of the file to be written to *fileName*. Internally, [QTextDocumentWriter](qtextdocumentwriter) will create a [QFile](qfile) and open it in [WriteOnly](qiodevicebase#OpenModeFlag-enum) mode, and use this file when writing the document. **See also** [fileName](qtextdocumentwriter#fileName)() and [setDevice](qtextdocumentwriter#setDevice)(). ### void QTextDocumentWriter::setFormat(const [QByteArray](qbytearray) &*format*) Sets the format used to write documents to the *format* specified. *format* is a case insensitive text string. For example: ``` QTextDocumentWriter writer; writer.setFormat("odf"); // same as writer.setFormat("ODF"); ``` You can call [supportedDocumentFormats](qtextdocumentwriter#supportedDocumentFormats)() for the full list of formats [QTextDocumentWriter](qtextdocumentwriter) supports. **See also** [format](qtextdocumentwriter#format)(). ### `[static]` [QList](qlist)<[QByteArray](qbytearray)> QTextDocumentWriter::supportedDocumentFormats() Returns the list of document formats supported by [QTextDocumentWriter](qtextdocumentwriter). By default, Qt can write the following formats: | Format | Description | | --- | --- | | plaintext | Plain text | | HTML | HyperText Markup Language | | markdown | Markdown (CommonMark or GitHub dialects) | | ODF | OpenDocument Format | **See also** [setFormat](qtextdocumentwriter#setFormat)(). ### bool QTextDocumentWriter::write(const [QTextDocument](qtextdocument) \**document*) Writes the given *document* to the assigned device or file and returns `true` if successful; otherwise returns `false`. ### bool QTextDocumentWriter::write(const [QTextDocumentFragment](qtextdocumentfragment) &*fragment*) Writes the document fragment specified by *fragment* to the assigned device or file and returns `true` if successful; otherwise returns `false`. qt QSGD3D11Texture Struct QSGD3D11Texture Struct ====================== struct [QNativeInterface](qnativeinterface-sub-qtquick)::QSGD3D11Texture Provides access to and enables adopting Direct3D 11 texture objects. [More...](#details) | | | | --- | --- | | Header: | #include <QSGD3D11Texture> | | CMake: | find\_package(Qt6 COMPONENTS Quick REQUIRED) target\_link\_libraries(mytarget PRIVATE Qt6::Quick) | | qmake: | QT += quick | | Since: | Qt 6.0 | * [List of all members, including inherited members](https://doc.qt.io/qt-6.2/qnativeinterface-qsgd3d11texture-members.html) Public Functions ---------------- | | | | --- | --- | | virtual void \* | **[nativeTexture](qnativeinterface-qsgd3d11texture#nativeTexture)**() const = 0 | Static Public Members --------------------- | | | | --- | --- | | QSGTexture \* | **[fromNative](qnativeinterface-qsgd3d11texture#fromNative)**(void \**texture*, QQuickWindow \**window*, const QSize &*size*, QQuickWindow::CreateTextureOptions *options* = {}) | Detailed Description -------------------- Member Function Documentation ----------------------------- ### `[static, since 6.0]` [QSGTexture](qsgtexture) \*QSGD3D11Texture::fromNative(void \**texture*, [QQuickWindow](qquickwindow) \**window*, const [QSize](qsize) &*size*, [QQuickWindow::CreateTextureOptions](qquickwindow#CreateTextureOption-enum) *options* = {}) Creates a new [QSGTexture](qsgtexture) wrapping an existing Direct 3D 11 *texture* object for *window*. The native object is wrapped, but not owned, by the resulting [QSGTexture](qsgtexture). The caller of the function is responsible for deleting the returned [QSGTexture](qsgtexture), but that will not destroy the underlying native object. This function is currently suitable for 2D RGBA textures only. **Warning:** This function will return null if the scene graph has not yet been initialized. Use *options* to customize the texture attributes. Only the TextureHasAlphaChannel and TextureHasMipmaps are taken into account here. *size* specifies the size in pixels. **Note:** This function must be called on the scene graph rendering thread. This function was introduced in Qt 6.0. **See also** [QQuickWindow::sceneGraphInitialized](qquickwindow#sceneGraphInitialized)(), [QSGTexture](qsgtexture), [Scene Graph - Metal Texture Import](https://doc.qt.io/qt-6.2/qtquick-scenegraph-metaltextureimport-example.html), and [Scene Graph - Vulkan Texture Import](https://doc.qt.io/qt-6.2/qtquick-scenegraph-vulkantextureimport-example.html). ### `[pure virtual]` void \*QSGD3D11Texture::nativeTexture() const Returns the ID3D11Texture2D object. qt QRawFont Class QRawFont Class ============== The QRawFont class provides access to a single physical instance of a font. [More...](#details) | | | | --- | --- | | Header: | #include <QRawFont> | | CMake: | find\_package(Qt6 COMPONENTS Gui REQUIRED) target\_link\_libraries(mytarget PRIVATE Qt6::Gui) | | qmake: | QT += gui | * [List of all members, including inherited members](https://doc.qt.io/qt-6.2/qrawfont-members.html) Public Types ------------ | | | | --- | --- | | enum | **[AntialiasingType](qrawfont#AntialiasingType-enum)** { PixelAntialiasing, SubPixelAntialiasing } | | enum | **[LayoutFlag](qrawfont#LayoutFlag-enum)** { SeparateAdvances, KernedAdvances, UseDesignMetrics } | | flags | **[LayoutFlags](qrawfont#LayoutFlag-enum)** | Public Functions ---------------- | | | | --- | --- | | | **[QRawFont](qrawfont#QRawFont-3)**(const QRawFont &*other*) | | | **[QRawFont](qrawfont#QRawFont-2)**(const QByteArray &*fontData*, qreal *pixelSize*, QFont::HintingPreference *hintingPreference* = QFont::PreferDefaultHinting) | | | **[QRawFont](qrawfont#QRawFont-1)**(const QString &*fileName*, qreal *pixelSize*, QFont::HintingPreference *hintingPreference* = QFont::PreferDefaultHinting) | | | **[QRawFont](qrawfont#QRawFont)**() | | QRawFont & | **[operator=](qrawfont#operator-eq-1)**(const QRawFont &*other*) | | | **[~QRawFont](qrawfont#dtor.QRawFont)**() | | QList<QPointF> | **[advancesForGlyphIndexes](qrawfont#advancesForGlyphIndexes)**(const QList<quint32> &*glyphIndexes*, QRawFont::LayoutFlags *layoutFlags*) const | | QList<QPointF> | **[advancesForGlyphIndexes](qrawfont#advancesForGlyphIndexes-1)**(const QList<quint32> &*glyphIndexes*) const | | bool | **[advancesForGlyphIndexes](qrawfont#advancesForGlyphIndexes-2)**(const quint32 \**glyphIndexes*, QPointF \**advances*, int *numGlyphs*) const | | bool | **[advancesForGlyphIndexes](qrawfont#advancesForGlyphIndexes-3)**(const quint32 \**glyphIndexes*, QPointF \**advances*, int *numGlyphs*, QRawFont::LayoutFlags *layoutFlags*) const | | QImage | **[alphaMapForGlyph](qrawfont#alphaMapForGlyph)**(quint32 *glyphIndex*, QRawFont::AntialiasingType *antialiasingType* = SubPixelAntialiasing, const QTransform &*transform* = QTransform()) const | | qreal | **[ascent](qrawfont#ascent)**() const | | qreal | **[averageCharWidth](qrawfont#averageCharWidth)**() const | | QRectF | **[boundingRect](qrawfont#boundingRect)**(quint32 *glyphIndex*) const | | qreal | **[capHeight](qrawfont#capHeight)**() const | | qreal | **[descent](qrawfont#descent)**() const | | QString | **[familyName](qrawfont#familyName)**() const | | QByteArray | **[fontTable](qrawfont#fontTable)**(const char \**tagName*) const | | bool | **[glyphIndexesForChars](qrawfont#glyphIndexesForChars)**(const QChar \**chars*, int *numChars*, quint32 \**glyphIndexes*, int \**numGlyphs*) const | | QList<quint32> | **[glyphIndexesForString](qrawfont#glyphIndexesForString)**(const QString &*text*) const | | QFont::HintingPreference | **[hintingPreference](qrawfont#hintingPreference)**() const | | bool | **[isValid](qrawfont#isValid)**() const | | qreal | **[leading](qrawfont#leading)**() const | | qreal | **[lineThickness](qrawfont#lineThickness)**() const | | void | **[loadFromData](qrawfont#loadFromData)**(const QByteArray &*fontData*, qreal *pixelSize*, QFont::HintingPreference *hintingPreference*) | | void | **[loadFromFile](qrawfont#loadFromFile)**(const QString &*fileName*, qreal *pixelSize*, QFont::HintingPreference *hintingPreference*) | | qreal | **[maxCharWidth](qrawfont#maxCharWidth)**() const | | QPainterPath | **[pathForGlyph](qrawfont#pathForGlyph)**(quint32 *glyphIndex*) const | | qreal | **[pixelSize](qrawfont#pixelSize)**() const | | void | **[setPixelSize](qrawfont#setPixelSize)**(qreal *pixelSize*) | | QFont::Style | **[style](qrawfont#style)**() const | | QString | **[styleName](qrawfont#styleName)**() const | | QList<QFontDatabase::WritingSystem> | **[supportedWritingSystems](qrawfont#supportedWritingSystems)**() const | | bool | **[supportsCharacter](qrawfont#supportsCharacter)**(QChar *character*) const | | bool | **[supportsCharacter](qrawfont#supportsCharacter-1)**(uint *ucs4*) const | | void | **[swap](qrawfont#swap)**(QRawFont &*other*) | | qreal | **[underlinePosition](qrawfont#underlinePosition)**() const | | qreal | **[unitsPerEm](qrawfont#unitsPerEm)**() const | | int | **[weight](qrawfont#weight)**() const | | qreal | **[xHeight](qrawfont#xHeight)**() const | | bool | **[operator!=](qrawfont#operator-not-eq)**(const QRawFont &*other*) const | | bool | **[operator==](qrawfont#operator-eq-eq)**(const QRawFont &*other*) const | Static Public Members --------------------- | | | | --- | --- | | QRawFont | **[fromFont](qrawfont#fromFont)**(const QFont &*font*, QFontDatabase::WritingSystem *writingSystem* = QFontDatabase::Any) | Related Non-Members ------------------- | | | | --- | --- | | size\_t | **[qHash](qrawfont#qHash)**(const QRawFont &*font*, size\_t *seed* = 0) | Detailed Description -------------------- **Note:** QRawFont is a low level class. For most purposes [QFont](qfont) is a more appropriate class. Most commonly, when presenting text in a user interface, the exact fonts used to render the characters is to some extent unknown. This can be the case for several reasons: For instance, the actual, physical fonts present on the target system could be unexpected to the developers, or the text could contain user selected styles, sizes or writing systems that are not supported by font chosen in the code. Therefore, Qt's [QFont](qfont) class really represents a query for fonts. When text is interpreted, Qt will do its best to match the text to the query, but depending on the support, different fonts can be used behind the scenes. For most use cases, this is both expected and necessary, as it minimizes the possibility of text in the user interface being undisplayable. In some cases, however, more direct control over the process might be useful. It is for these use cases the QRawFont class exists. A QRawFont object represents a single, physical instance of a given font in a given pixel size. I.e. in the typical case it represents a set of TrueType or OpenType font tables and uses a user specified pixel size to convert metrics into logical pixel units. It can be used in combination with the [QGlyphRun](https://doc.qt.io/qt-6.2/qglyphrun.html) class to draw specific glyph indexes at specific positions, and also have accessors to some relevant data in the physical font. QRawFont only provides support for the main font technologies: GDI and DirectWrite on Windows platforms, FreeType on Linux platforms and CoreText on macOS. For other font back-ends, the APIs will be disabled. QRawFont can be constructed in a number of ways: * It can be constructed by calling QTextLayout::glyphs() or QTextFragment::glyphs(). The returned QGlyphs objects will contain QRawFont objects which represent the actual fonts used to render each portion of the text. * It can be constructed by passing a [QFont](qfont) object to [QRawFont::fromFont](qrawfont#fromFont)(). The function will return a QRawFont object representing the font that will be selected as response to the [QFont](qfont) query and the selected writing system. * It can be constructed by passing a file name or [QByteArray](qbytearray) directly to the QRawFont constructor, or by calling [loadFromFile](qrawfont#loadFromFile)() or [loadFromData](qrawfont#loadFromData)(). In this case, the font will not be registered in [QFontDatabase](qfontdatabase), and it will not be available as part of regular font selection. QRawFont is considered local to the thread in which it is constructed (either using a constructor, or by calling [loadFromData](qrawfont#loadFromData)() or [loadFromFile](qrawfont#loadFromFile)()). The QRawFont cannot be moved to a different thread, but will have to be recreated in the thread in question. **Note:** For the requirement of caching glyph indexes and font selections for static text to avoid reshaping and relayouting in the inner loop of an application, a better choice is the [QStaticText](qstatictext) class, since it optimizes the memory cost of the cache and also provides the possibility of paint engine specific caches for an additional speed-up. Member Type Documentation ------------------------- ### enum QRawFont::AntialiasingType This enum represents the different ways a glyph can be rasterized in the function [alphaMapForGlyph](qrawfont#alphaMapForGlyph)(). | Constant | Value | Description | | --- | --- | --- | | `QRawFont::PixelAntialiasing` | `0` | Will rasterize by measuring the coverage of the shape on whole pixels. The returned image contains the alpha values of each pixel based on the coverage of the glyph shape. | | `QRawFont::SubPixelAntialiasing` | `1` | Will rasterize by measuring the coverage of each subpixel, returning a separate alpha value for each of the red, green and blue components of each pixel. | ### `[since 5.1]` enum QRawFont::LayoutFlagflags QRawFont::LayoutFlags This enum tells the function [advancesForGlyphIndexes](qrawfont#advancesForGlyphIndexes)() how to calculate the advances. | Constant | Value | Description | | --- | --- | --- | | `QRawFont::SeparateAdvances` | `0` | Will calculate the advance for each glyph separately. | | `QRawFont::KernedAdvances` | `1` | Will apply kerning between adjacent glyphs. Note that OpenType GPOS based kerning is currently not supported. | | `QRawFont::UseDesignMetrics` | `2` | Use design metrics instead of hinted metrics adjusted to the resolution of the paint device. Can be OR-ed with any of the options above. | This enum was introduced or modified in Qt 5.1. The LayoutFlags type is a typedef for [QFlags](qflags)<LayoutFlag>. It stores an OR combination of LayoutFlag values. Member Function Documentation ----------------------------- ### QRawFont::QRawFont(const [QRawFont](qrawfont#QRawFont) &*other*) Creates a QRawFont which is a copy of *other*. ### QRawFont::QRawFont(const [QByteArray](qbytearray) &*fontData*, [qreal](qtglobal#qreal-typedef) *pixelSize*, [QFont::HintingPreference](qfont#HintingPreference-enum) *hintingPreference* = QFont::PreferDefaultHinting) Constructs a QRawFont representing the font contained in the supplied *fontData* for the size (in pixels) given by *pixelSize*, and using the hinting preference specified by *hintingPreference*. **Note:** The data must contain a TrueType or OpenType font. ### QRawFont::QRawFont(const [QString](qstring) &*fileName*, [qreal](qtglobal#qreal-typedef) *pixelSize*, [QFont::HintingPreference](qfont#HintingPreference-enum) *hintingPreference* = QFont::PreferDefaultHinting) Constructs a QRawFont representing the font contained in the file referenced by *fileName* for the size (in pixels) given by *pixelSize*, and using the hinting preference specified by *hintingPreference*. **Note:** The referenced file must contain a TrueType or OpenType font. ### QRawFont::QRawFont() Constructs an invalid QRawFont. ### [QRawFont](qrawfont#QRawFont) &QRawFont::operator=(const [QRawFont](qrawfont#QRawFont) &*other*) Assigns *other* to this [QRawFont](qrawfont). ### QRawFont::~QRawFont() Destroys the [QRawFont](qrawfont) ### `[since 5.1]` [QList](qlist)<[QPointF](qpointf)> QRawFont::advancesForGlyphIndexes(const [QList](qlist)<[quint32](qtglobal#quint32-typedef)> &*glyphIndexes*, [QRawFont::LayoutFlags](qrawfont#LayoutFlag-enum) *layoutFlags*) const Returns the [QRawFont](qrawfont)'s advances for each of the *glyphIndexes* in pixel units. The advances give the distance from the position of a given glyph to where the next glyph should be drawn to make it appear as if the two glyphs are unspaced. How the advances are calculated is controlled by *layoutFlags*. **Note:** When `KernedAdvances` is requested, this function will apply kerning rules from the TrueType table `KERN`, if this is available in the font. In many modern fonts, kerning is handled through OpenType rules or AAT rules, which requires a full shaping step to be applied. To get the results of fully shaping the text, use [QTextLayout](qtextlayout). This function was introduced in Qt 5.1. **See also** [QTextLine::horizontalAdvance](qtextline#horizontalAdvance)(), [QFontMetricsF::horizontalAdvance](qfontmetricsf#horizontalAdvance)(), and [QTextLayout::glyphRuns](qtextlayout#glyphRuns)(). ### [QList](qlist)<[QPointF](qpointf)> QRawFont::advancesForGlyphIndexes(const [QList](qlist)<[quint32](qtglobal#quint32-typedef)> &*glyphIndexes*) const This is an overloaded function. Returns the [QRawFont](qrawfont)'s advances for each of the *glyphIndexes* in pixel units. The advances give the distance from the position of a given glyph to where the next glyph should be drawn to make it appear as if the two glyphs are unspaced. The advance of each glyph is calculated separately. **See also** [QTextLine::horizontalAdvance](qtextline#horizontalAdvance)() and [QFontMetricsF::horizontalAdvance](qfontmetricsf#horizontalAdvance)(). ### bool QRawFont::advancesForGlyphIndexes(const [quint32](qtglobal#quint32-typedef) \**glyphIndexes*, [QPointF](qpointf) \**advances*, int *numGlyphs*) const This is an overloaded function. Returns the [QRawFont](qrawfont)'s advances for each of the *glyphIndexes* in pixel units. The advances give the distance from the position of a given glyph to where the next glyph should be drawn to make it appear as if the two glyphs are unspaced. The glyph indexes are given with the array *glyphIndexes* while the results are returned through *advances*, both of them must have *numGlyphs* elements. The advance of each glyph is calculated separately **See also** [QTextLine::horizontalAdvance](qtextline#horizontalAdvance)() and [QFontMetricsF::horizontalAdvance](qfontmetricsf#horizontalAdvance)(). ### `[since 5.1]` bool QRawFont::advancesForGlyphIndexes(const [quint32](qtglobal#quint32-typedef) \**glyphIndexes*, [QPointF](qpointf) \**advances*, int *numGlyphs*, [QRawFont::LayoutFlags](qrawfont#LayoutFlag-enum) *layoutFlags*) const Returns the [QRawFont](qrawfont)'s advances for each of the *glyphIndexes* in pixel units. The advances give the distance from the position of a given glyph to where the next glyph should be drawn to make it appear as if the two glyphs are unspaced. The glyph indexes are given with the array *glyphIndexes* while the results are returned through *advances*, both of them must have *numGlyphs* elements. How the advances are calculated is controlled by *layoutFlags*. **Note:** When `KernedAdvances` is requested, this function will apply kerning rules from the TrueType table `KERN`, if this is available in the font. In many modern fonts, kerning is handled through OpenType rules or AAT rules, which requires a full shaping step to be applied. To get the results of fully shaping the text, use [QTextLayout](qtextlayout). This function was introduced in Qt 5.1. **See also** [QTextLine::horizontalAdvance](qtextline#horizontalAdvance)(), [QFontMetricsF::horizontalAdvance](qfontmetricsf#horizontalAdvance)(), and [QTextLayout::glyphRuns](qtextlayout#glyphRuns)(). ### [QImage](qimage) QRawFont::alphaMapForGlyph([quint32](qtglobal#quint32-typedef) *glyphIndex*, [QRawFont::AntialiasingType](qrawfont#AntialiasingType-enum) *antialiasingType* = SubPixelAntialiasing, const [QTransform](qtransform) &*transform* = QTransform()) const This function returns a rasterized image of the glyph at the given *glyphIndex* in the underlying font, using the *transform* specified. If the [QRawFont](qrawfont) is not valid, this function will return an invalid [QImage](qimage). If the font is a color font, then the resulting image will contain the rendered glyph at the current pixel size. In this case, the *antialiasingType* will be ignored. Otherwise, if *antialiasingType* is set to [QRawFont::SubPixelAntialiasing](qrawfont#AntialiasingType-enum), then the resulting image will be in [QImage::Format\_RGB32](qimage#Format-enum) and the RGB values of each pixel will represent the subpixel opacities of the pixel in the rasterization of the glyph. Otherwise, the image will be in the format of [QImage::Format\_Indexed8](qimage#Format-enum) and each pixel will contain the opacity of the pixel in the rasterization. **See also** [pathForGlyph](qrawfont#pathForGlyph)() and [QPainter::drawGlyphRun](qpainter#drawGlyphRun)(). ### [qreal](qtglobal#qreal-typedef) QRawFont::ascent() const Returns the ascent of this [QRawFont](qrawfont) in pixel units. The ascent of a font is the distance from the baseline to the highest position characters extend to. In practice, some font designers break this rule, e.g. when they put more than one accent on top of a character, or to accommodate an unusual character in an exotic language, so it is possible (though rare) that this value will be too small. **See also** [QFontMetricsF::ascent](qfontmetricsf#ascent)(). ### [qreal](qtglobal#qreal-typedef) QRawFont::averageCharWidth() const Returns the average character width of this [QRawFont](qrawfont) in pixel units. **See also** [QFontMetricsF::averageCharWidth](qfontmetricsf#averageCharWidth)(). ### `[since 5.0]` [QRectF](qrectf) QRawFont::boundingRect([quint32](qtglobal#quint32-typedef) *glyphIndex*) const Returns the smallest rectangle containing the glyph with the given *glyphIndex*. This function was introduced in Qt 5.0. ### `[since 5.8]` [qreal](qtglobal#qreal-typedef) QRawFont::capHeight() const Returns the cap height of this [QRawFont](qrawfont) in pixel units. The cap height of a font is the height of a capital letter above the baseline. It specifically is the height of capital letters that are flat - such as H or I - as opposed to round letters such as O, or pointed letters like A, both of which may display overshoot. This function was introduced in Qt 5.8. **See also** [QFontMetricsF::capHeight](qfontmetricsf#capHeight)(). ### [qreal](qtglobal#qreal-typedef) QRawFont::descent() const Returns the descent of this [QRawFont](qrawfont) in pixel units. The descent is the distance from the base line to the lowest point characters extend to. In practice, some font designers break this rule, e.g. to accommodate an unusual character in an exotic language, so it is possible (though rare) that this value will be too small. **See also** [QFontMetricsF::descent](qfontmetricsf#descent)(). ### [QString](qstring) QRawFont::familyName() const Returns the family name of this [QRawFont](qrawfont). ### [QByteArray](qbytearray) QRawFont::fontTable(const char \**tagName*) const Retrieves the sfnt table named *tagName* from the underlying physical font, or an empty byte array if no such table was found. The returned font table's byte order is Big Endian, like the sfnt format specifies. The *tagName* must be four characters long and should be formatted in the default endianness of the current platform. ### `[static]` [QRawFont](qrawfont#QRawFont) QRawFont::fromFont(const [QFont](qfont) &*font*, [QFontDatabase::WritingSystem](qfontdatabase#WritingSystem-enum) *writingSystem* = QFontDatabase::Any) Fetches the physical representation based on a *font* query. The physical font returned is the font that will be preferred by Qt in order to display text in the selected *writingSystem*. **Warning:** This function is potentially expensive and should not be called in performance sensitive code. ### bool QRawFont::glyphIndexesForChars(const [QChar](qchar) \**chars*, int *numChars*, [quint32](qtglobal#quint32-typedef) \**glyphIndexes*, int \**numGlyphs*) const Converts a string of unicode points to glyph indexes using the CMAP table in the underlying font. The function works like [glyphIndexesForString](qrawfont#glyphIndexesForString)() except it take an array (*chars*), the results will be returned though *glyphIndexes* array and number of glyphs will be set in *numGlyphs*. The size of *glyphIndexes* array must be at least *numChars*, if that's still not enough, this function will return false, then you can resize *glyphIndexes* from the size returned in *numGlyphs*. **See also** [glyphIndexesForString](qrawfont#glyphIndexesForString)(), [advancesForGlyphIndexes](qrawfont#advancesForGlyphIndexes)(), [QGlyphRun](https://doc.qt.io/qt-6.2/qglyphrun.html), [QTextLayout::glyphRuns](qtextlayout#glyphRuns)(), and [QTextFragment::glyphRuns](qtextfragment#glyphRuns)(). ### [QList](qlist)<[quint32](qtglobal#quint32-typedef)> QRawFont::glyphIndexesForString(const [QString](qstring) &*text*) const Converts the string of unicode points given by *text* to glyph indexes using the CMAP table in the underlying font, and returns a list containing the result. Note that, in cases where there are other tables in the font that affect the shaping of the text, the returned glyph indexes will not correctly represent the rendering of the text. To get the correctly shaped text, you can use [QTextLayout](qtextlayout) to lay out and shape the text, then call QTextLayout::glyphs() to get the set of glyph index list and [QRawFont](qrawfont) pairs. **See also** [advancesForGlyphIndexes](qrawfont#advancesForGlyphIndexes)(), [glyphIndexesForChars](qrawfont#glyphIndexesForChars)(), [QGlyphRun](https://doc.qt.io/qt-6.2/qglyphrun.html), [QTextLayout::glyphRuns](qtextlayout#glyphRuns)(), and [QTextFragment::glyphRuns](qtextfragment#glyphRuns)(). ### [QFont::HintingPreference](qfont#HintingPreference-enum) QRawFont::hintingPreference() const Returns the hinting preference used to construct this [QRawFont](qrawfont). **See also** [QFont::hintingPreference](qfont#hintingPreference)(). ### bool QRawFont::isValid() const Returns `true` if the [QRawFont](qrawfont) is valid and false otherwise. ### [qreal](qtglobal#qreal-typedef) QRawFont::leading() const Returns the leading of this [QRawFont](qrawfont) in pixel units. This is the natural inter-line spacing. **See also** [QFontMetricsF::leading](qfontmetricsf#leading)(). ### [qreal](qtglobal#qreal-typedef) QRawFont::lineThickness() const Returns the thickness for drawing lines (underline, overline, etc.) along with text drawn in this font. ### void QRawFont::loadFromData(const [QByteArray](qbytearray) &*fontData*, [qreal](qtglobal#qreal-typedef) *pixelSize*, [QFont::HintingPreference](qfont#HintingPreference-enum) *hintingPreference*) Replaces the current [QRawFont](qrawfont) with the font contained in the supplied *fontData* for the size (in pixels) given by *pixelSize*, and using the hinting preference specified by *hintingPreference*. The *fontData* must contain a TrueType or OpenType font. **See also** [loadFromFile](qrawfont#loadFromFile)(). ### void QRawFont::loadFromFile(const [QString](qstring) &*fileName*, [qreal](qtglobal#qreal-typedef) *pixelSize*, [QFont::HintingPreference](qfont#HintingPreference-enum) *hintingPreference*) Replaces the current [QRawFont](qrawfont) with the contents of the file referenced by *fileName* for the size (in pixels) given by *pixelSize*, and using the hinting preference specified by *hintingPreference*. The file must reference a TrueType or OpenType font. **See also** [loadFromData](qrawfont#loadFromData)(). ### [qreal](qtglobal#qreal-typedef) QRawFont::maxCharWidth() const Returns the width of the widest character in the font. **See also** [QFontMetricsF::maxWidth](qfontmetricsf#maxWidth)(). ### [QPainterPath](qpainterpath) QRawFont::pathForGlyph([quint32](qtglobal#quint32-typedef) *glyphIndex*) const This function returns the shape of the glyph at a given *glyphIndex* in the underlying font if the [QRawFont](qrawfont) is valid. Otherwise, it returns an empty [QPainterPath](qpainterpath). The returned glyph will always be unhinted. **See also** [alphaMapForGlyph](qrawfont#alphaMapForGlyph)() and [QPainterPath::addText](qpainterpath#addText)(). ### [qreal](qtglobal#qreal-typedef) QRawFont::pixelSize() const Returns the pixel size set for this [QRawFont](qrawfont). The pixel size affects how glyphs are rasterized, the size of glyphs returned by [pathForGlyph](qrawfont#pathForGlyph)(), and is used to convert internal metrics from design units to logical pixel units. **See also** [setPixelSize](qrawfont#setPixelSize)(). ### void QRawFont::setPixelSize([qreal](qtglobal#qreal-typedef) *pixelSize*) Sets the pixel size with which this font should be rendered to *pixelSize*. **See also** [pixelSize](qrawfont#pixelSize)(). ### [QFont::Style](qfont#Style-enum) QRawFont::style() const Returns the style of this [QRawFont](qrawfont). **See also** [QFont::style](qfont#style)(). ### [QString](qstring) QRawFont::styleName() const Returns the style name of this [QRawFont](qrawfont). **See also** [QFont::styleName](qfont#styleName)(). ### [QList](qlist)<[QFontDatabase::WritingSystem](qfontdatabase#WritingSystem-enum)> QRawFont::supportedWritingSystems() const Returns a list of writing systems supported by the font according to designer supplied information in the font file. Please note that this does not guarantee support for a specific unicode point in the font. You can use the [supportsCharacter](qrawfont#supportsCharacter)() to check support for a single, specific character. **Note:** The list is determined based on the unicode ranges and codepage ranges set in the font's OS/2 table and requires such a table to be present in the underlying font file. **See also** [supportsCharacter](qrawfont#supportsCharacter)(). ### bool QRawFont::supportsCharacter([QChar](qchar) *character*) const Returns `true` if the font has a glyph that corresponds to the given *character*. **See also** [supportedWritingSystems](qrawfont#supportedWritingSystems)(). ### bool QRawFont::supportsCharacter([uint](qtglobal#uint-typedef) *ucs4*) const This is an overloaded function. Returns `true` if the font has a glyph that corresponds to the UCS-4 encoded character *ucs4*. **See also** [supportedWritingSystems](qrawfont#supportedWritingSystems)(). ### `[since 5.0]` void QRawFont::swap([QRawFont](qrawfont#QRawFont) &*other*) Swaps this raw font with *other*. This function is very fast and never fails. This function was introduced in Qt 5.0. ### [qreal](qtglobal#qreal-typedef) QRawFont::underlinePosition() const Returns the position from baseline for drawing underlines below the text rendered with this font. ### [qreal](qtglobal#qreal-typedef) QRawFont::unitsPerEm() const Returns the number of design units define the width and height of the em square for this [QRawFont](qrawfont). This value is used together with the pixel size when converting design metrics to pixel units, as the internal metrics are specified in design units and the pixel size gives the size of 1 em in pixels. **See also** [pixelSize](qrawfont#pixelSize)() and [setPixelSize](qrawfont#setPixelSize)(). ### int QRawFont::weight() const Returns the weight of this [QRawFont](qrawfont). **See also** [QFont::weight](qfont#weight)(). ### [qreal](qtglobal#qreal-typedef) QRawFont::xHeight() const Returns the xHeight of this [QRawFont](qrawfont) in pixel units. This is often but not always the same as the height of the character 'x'. **See also** [QFontMetricsF::xHeight](qfontmetricsf#xHeight)(). ### bool QRawFont::operator!=(const [QRawFont](qrawfont#QRawFont) &*other*) const Returns `true` if this [QRawFont](qrawfont) is not equal to *other*. Otherwise, returns `false`. ### bool QRawFont::operator==(const [QRawFont](qrawfont#QRawFont) &*other*) const Returns `true` if this [QRawFont](qrawfont) is equal to *other*. Otherwise, returns `false`. Related Non-Members ------------------- ### `[since 5.8]` size\_t qHash(const [QRawFont](qrawfont#QRawFont) &*font*, size\_t *seed* = 0) Returns the hash value for *font*. If specified, *seed* is used to initialize the hash. This function was introduced in Qt 5.8.
programming_docs
qt Platform Notes Platform Notes ============== Many cross-platform projects can be handled by the basic qmake configuration features. However, on some platforms, it is sometimes useful, or even necessary, to take advantage of platform-specific features. qmake knows about many of these features, which can be accessed via specific variables that only take effect on the platforms where they are relevant. macOS, iOS, tvOS, and watchOS ----------------------------- Features specific to these platforms include support for creating universal binaries, frameworks and bundles. ### Source and Binary Packages The version of qmake supplied in source packages is configured slightly differently to that supplied in binary packages in that it uses a different feature specification. Where the source package typically uses the `macx-g++` specification, the binary package is typically configured to use the `macx-xcode` specification. Users of each package can override this configuration by invoking qmake with the `-spec` option (see [Running qmake](qmake-running) for more information). For example, to use qmake from a binary package to create a Makefile in a project directory, invoke the following command: ``` qmake -spec macx-g++ ``` ### Using Frameworks qmake is able to automatically generate build rules for linking against frameworks in the standard framework directory on macOS, located at `/Library/Frameworks/`. Directories other than the standard framework directory need to be specified to the build system, and this is achieved by appending linker options to the [LIBS](qmake-variable-reference#libs) variable, as shown in the following example: ``` LIBS += -F/path/to/framework/directory/ ``` The framework itself is linked in by appending the `-framework` options and the name of the framework to the [LIBS](qmake-variable-reference#libs) variable: ``` LIBS += -framework TheFramework ``` ### Creating Frameworks Any given library project can be configured so that the resulting library file is placed in a [framework](http://developer.apple.com/documentation/MacOSX/Conceptual/BPFrameworks/Concepts/WhatAreFrameworks.html), ready for deployment. To do this, set up the project to use the [`lib` template](qmake-variable-reference#template) and add the `lib_bundle` option to the [CONFIG](qmake-variable-reference#config) variable: ``` TEMPLATE = lib CONFIG += lib_bundle ``` The data associated with the library is specified using the [QMAKE\_BUNDLE\_DATA](qmake-variable-reference#qmake-bundle-data) variable. This holds items that will be installed with a library bundle, and is often used to specify a collection of header files, as in the following example: ``` FRAMEWORK_HEADERS.version = Versions FRAMEWORK_HEADERS.files = path/to/header_one.h path/to/header_two.h FRAMEWORK_HEADERS.path = Headers QMAKE_BUNDLE_DATA += FRAMEWORK_HEADERS ``` You use the `FRAMEWORK_HEADERS` variable to specify the headers required by a particular framework. Appending it to the `QMAKE_BUNDLE_DATA` variable ensures that information about these headers is added to the collection of resources that will be installed with the library bundle. Also, the framework name and version are specified by the [QMAKE\_FRAMEWORK\_BUNDLE\_NAME](qmake-variable-reference#qmake-framework-bundle-name) and [QMAKE\_FRAMEWORK\_VERSION](qmake-variable-reference#qmake-framework-version) variables. By default, the values used for these variables are obtained from the [TARGET](qmake-variable-reference#target) and [VERSION](qmake-variable-reference#version) variables. See [Qt for macOS - Deployment](https://doc.qt.io/qt-6.2/macos-deployment.html) for more information about deploying applications and libraries. ### Creating and Moving Xcode Projects On macOS, developers can generate Xcode project files from an existing qmake project file. For example: ``` qmake -spec macx-xcode project.pro ``` **Note:** If a project is later moved on the disk, qmake must be run again to process the project file and create a new Xcode project file. ### Supporting Two Build Targets Simultaneously Implementing this is currently not feasible, because the Xcode concept of Active Build Configurations is conceptually different from the qmake idea of build targets. The Xcode Active Build Configurations settings are for modifying Xcode configurations, compiler flags and similar build options. Unlike Visual Studio, Xcode does not allow for the selection of specific library files based on whether debug or release build configurations are selected. The qmake debug and release settings control which library files are linked to the executable. It is currently not possible to set files in Xcode configuration settings from the qmake generated Xcode project file. The way the libraries are linked in the *Frameworks & Libraries* phase in the Xcode build system. Furthermore, the selected *Active Build Configuration* is stored in a .pbxuser file, which is generated by Xcode on first load, not created by qmake. Windows ------- Features specific to this platform include support for Windows resource files (provided or auto-generated), creating Visual Studio project files, and handling manifest files when deploying Qt applications developed using Visual Studio 2005, or later. ### Adding Windows Resource Files This section describes how to handle a Windows resource file with qmake to have it linked to an application executable (EXE) or dynamic link library (DLL). qmake can optionally auto-generate a suitably filled Windows resource file. A linked Windows resource file may contain many elements that can be accessed by its EXE or DLL. However, the [Qt resource system](resources) should be used for accessing linked-in resources in a platform-independent way. But some standard elements of the linked Windows resource file are accessed by Windows itself. For example, in Windows explorer the version tab of the file properties is filled by resource elements. In addition, the program icon of the EXE is read from these elements. So it is good practice for a Qt created Windows EXE or DLL to use both techniques at the same time: link platform-independent resources via the [Qt resource system](resources) and add Windows specific resources via a Windows resource file. Typically, a resource-definition script (.rc file) is compiled to a Windows resource file. Within the Microsoft toolchain, the RC tool generates a .res file, which can be linked with the Microsoft linker to an EXE or DLL. The MinGW toolchain uses the windres tool to generate an .o file that can be linked with the MinGW linker to an EXE or DLL. The optional auto-generation of a suitably filled .rc file by qmake is triggered by setting at least one of the system variables [VERSION](qmake-variable-reference#version) and [RC\_ICONS](qmake-variable-reference#rc-icons). The generated .rc file is automatically compiled and linked. Elements that are added to the .rc file are defined by the system variables [QMAKE\_TARGET\_COMPANY](qmake-variable-reference#qmake-target-company), [QMAKE\_TARGET\_DESCRIPTION](qmake-variable-reference#qmake-target-description), [QMAKE\_TARGET\_COPYRIGHT](qmake-variable-reference#qmake-target-copyright), [QMAKE\_TARGET\_PRODUCT](qmake-variable-reference#qmake-target-product), [QMAKE\_TARGET\_ORIGINAL\_FILENAME](qmake-variable-reference#qmake-target-original-filename), [QMAKE\_TARGET\_INTERNALNAME](qmake-variable-reference#qmake-target-internalname), [QMAKE\_TARGET\_COMMENTS](qmake-variable-reference#qmake-target-comments), [QMAKE\_TARGET\_TRADEMARKS](qmake-variable-reference#qmake-target-trademarks), [QMAKE\_MANIFEST](qmake-variable-reference#qmake-manifest), [RC\_CODEPAGE](qmake-variable-reference#rc-codepage), [RC\_ICONS](qmake-variable-reference#rc-icons), [RC\_LANG](qmake-variable-reference#rc-lang) and [VERSION](qmake-variable-reference#version). If these elements are not sufficient, qmake has the two system variables [RC\_FILE](qmake-variable-reference#rc-file) and [RES\_FILE](qmake-variable-reference#res-file) that point directly to an externally created .rc or .res file. By setting one of these variables, the specified file is linked to the EXE or DLL. **Note:** The generation of the .rc file by qmake is blocked, if [RC\_FILE](qmake-variable-reference#rc-file) or [RES\_FILE](qmake-variable-reference#res-file) is set. In this case, no further changes are made to the given .rc file or the .res or .o file by qmake; the variables pertaining to .rc file generation have no effect. ### Creating Visual Studio Project Files This section describes how to import an existing qmake project into Visual Studio. qmake is able to take a project file and create a Visual Studio project that contains all the necessary information required by the development environment. This is achieved by setting the qmake [project template](qmake-variable-reference#template) to either `vcapp` (for application projects) or `vclib` (for library projects). This can also be set using a command line option, for example: ``` qmake -tp vc ``` It is possible to recursively generate `.vcproj` files in subdirectories and a `.sln` file in the main directory, by typing: ``` qmake -tp vc -r ``` Each time you update the project file, you need to run qmake to generate an updated Visual Studio project. **Note:** If you are using the Visual Studio Add-in, select **Qt** > **Import from .pro file** to import `.pro` files. ### Visual Studio Manifest Files When deploying Qt applications built using Visual Studio 2005, or later, make sure that the manifest file that was created when the application was linked is handled correctly. This is handled automatically for projects that generate DLLs. Removing manifest embedding for application executables can be done with the following assignment to the [CONFIG](qmake-variable-reference#config) variable: ``` CONFIG -= embed_manifest_exe ``` Also, the manifest embedding for DLLs can be removed with the following assignment to the `CONFIG` variable: ``` CONFIG -= embed_manifest_dll ``` This is discussed in more detail in the [deployment guide for Windows](https://doc.qt.io/qt-6.2/windows-deployment.html#manifest-files). qt QTorusGeometry Class QTorusGeometry Class ==================== class [Qt3DExtras](https://doc.qt.io/qt-6.2/qt3dextras-module.html)::QTorusGeometry The QTorusGeometry class allows creation of a torus in 3D space. \* \* \* \* \* The QTorusGeometry class is most commonly used internally by the [QTorusMesh](qt3dextras-qtorusmesh) \* but can also be used in custom [Qt3DRender::QGeometryRenderer](qt3drender-qgeometryrenderer) subclasses. [More...](#details) | | | | --- | --- | | Header: | #include <Qt3DExtras/QTorusGeometry> | | CMake: | find\_package(Qt6 COMPONENTS 3dextras REQUIRED) target\_link\_libraries(mytarget PRIVATE Qt6::3dextras) | | qmake: | QT += 3dextras | | Since: | Qt 5.7 | | Instantiated By: | [TorusGeometry](qml-qt3d-extras-torusgeometry) | | Inherits: | [Qt3DCore::QGeometry](qt3dcore-qgeometry) | * [List of all members, including inherited members](https://doc.qt.io/qt-6.2/qt3dextras-qtorusgeometry-members.html) Properties ---------- | | | | --- | --- | | * **[indexAttribute](qt3dextras-qtorusgeometry#indexAttribute-prop)** : Qt3DCore::QAttribute\* const * **[minorRadius](qt3dextras-qtorusgeometry#minorRadius-prop)** : float * **[normalAttribute](qt3dextras-qtorusgeometry#normalAttribute-prop)** : Qt3DCore::QAttribute\* const * **[positionAttribute](qt3dextras-qtorusgeometry#positionAttribute-prop)** : Qt3DCore::QAttribute\* const | * **[radius](qt3dextras-qtorusgeometry#radius-prop)** : float * **[rings](qt3dextras-qtorusgeometry#rings-prop)** : int * **[slices](qt3dextras-qtorusgeometry#slices-prop)** : int * **[texCoordAttribute](qt3dextras-qtorusgeometry#texCoordAttribute-prop)** : Qt3DCore::QAttribute\* const | Public Functions ---------------- | | | | --- | --- | | | **[QTorusGeometry](qt3dextras-qtorusgeometry#QTorusGeometry)**(Qt3DCore::QNode \**parent* = nullptr) | | Qt3DCore::QAttribute \* | **[indexAttribute](qt3dextras-qtorusgeometry#indexAttribute-prop)**() const | | float | **[minorRadius](qt3dextras-qtorusgeometry#minorRadius-prop)**() const | | Qt3DCore::QAttribute \* | **[normalAttribute](qt3dextras-qtorusgeometry#normalAttribute-prop)**() const | | Qt3DCore::QAttribute \* | **[positionAttribute](qt3dextras-qtorusgeometry#positionAttribute-prop)**() const | | float | **[radius](qt3dextras-qtorusgeometry#radius-prop)**() const | | int | **[rings](qt3dextras-qtorusgeometry#rings-prop)**() const | | int | **[slices](qt3dextras-qtorusgeometry#slices-prop)**() const | | Qt3DCore::QAttribute \* | **[texCoordAttribute](qt3dextras-qtorusgeometry#texCoordAttribute-prop)**() const | | void | **[updateIndices](qt3dextras-qtorusgeometry#updateIndices)**() | | void | **[updateVertices](qt3dextras-qtorusgeometry#updateVertices)**() | Public Slots ------------ | | | | --- | --- | | void | **[setMinorRadius](qt3dextras-qtorusgeometry#minorRadius-prop)**(float *minorRadius*) | | void | **[setRadius](qt3dextras-qtorusgeometry#radius-prop)**(float *radius*) | | void | **[setRings](qt3dextras-qtorusgeometry#rings-prop)**(int *rings*) | | void | **[setSlices](qt3dextras-qtorusgeometry#slices-prop)**(int *slices*) | Signals ------- | | | | --- | --- | | void | **[minorRadiusChanged](qt3dextras-qtorusgeometry#minorRadius-prop)**(float *minorRadius*) | | void | **[radiusChanged](qt3dextras-qtorusgeometry#radius-prop)**(float *radius*) | | void | **[ringsChanged](qt3dextras-qtorusgeometry#rings-prop)**(int *rings*) | | void | **[slicesChanged](qt3dextras-qtorusgeometry#slices-prop)**(int *slices*) | Detailed Description -------------------- \* \* \* \* Property Documentation ---------------------- ### `[read-only]` indexAttribute : [Qt3DCore::QAttribute](qt3dcore-qattribute)\* const Holds the geometry index attribute. **Access functions:** | | | | --- | --- | | Qt3DCore::QAttribute \* | **indexAttribute**() const | ### minorRadius : float Holds the inner radius of the torus. **Access functions:** | | | | --- | --- | | float | **minorRadius**() const | | void | **setMinorRadius**(float *minorRadius*) | **Notifier signal:** | | | | --- | --- | | void | **minorRadiusChanged**(float *minorRadius*) | ### `[read-only]` normalAttribute : [Qt3DCore::QAttribute](qt3dcore-qattribute)\* const Holds the geometry normal attribute. **Access functions:** | | | | --- | --- | | Qt3DCore::QAttribute \* | **normalAttribute**() const | ### `[read-only]` positionAttribute : [Qt3DCore::QAttribute](qt3dcore-qattribute)\* const Holds the geometry position attribute. **Access functions:** | | | | --- | --- | | Qt3DCore::QAttribute \* | **positionAttribute**() const | ### radius : float Holds the outer radius of the torus. **Access functions:** | | | | --- | --- | | float | **radius**() const | | void | **setRadius**(float *radius*) | **Notifier signal:** | | | | --- | --- | | void | **radiusChanged**(float *radius*) | ### rings : int Holds the number of rings in the torus. **Access functions:** | | | | --- | --- | | int | **rings**() const | | void | **setRings**(int *rings*) | **Notifier signal:** | | | | --- | --- | | void | **ringsChanged**(int *rings*) | ### slices : int Holds the number of slices in the torus. **Access functions:** | | | | --- | --- | | int | **slices**() const | | void | **setSlices**(int *slices*) | **Notifier signal:** | | | | --- | --- | | void | **slicesChanged**(int *slices*) | ### `[read-only]` texCoordAttribute : [Qt3DCore::QAttribute](qt3dcore-qattribute)\* const Holds the geometry texture coordinate attribute. **Access functions:** | | | | --- | --- | | Qt3DCore::QAttribute \* | **texCoordAttribute**() const | Member Function Documentation ----------------------------- ### QTorusGeometry::QTorusGeometry([Qt3DCore::QNode](qt3dcore-qnode) \**parent* = nullptr) Constructs a new QTorusGeometry with *parent*. ### void QTorusGeometry::updateIndices() Updates indices based on rings and slices properties. ### void QTorusGeometry::updateVertices() Updates vertices based on rings, slices, and radius properties. qt Layer QML Type Layer QML Type ============== Layer provides a way of filtering which entities will be rendered. [More...](#details) | | | | --- | --- | | Import Statement: | import Qt3D.Render | | Since: | Qt 5.5 | | Instantiates: | [QLayer](qt3drender-qlayer) | | Inherits: | [Component3D](qml-qt3d-core-component3d) | * [List of all members, including inherited members](https://doc.qt.io/qt-6.2/qml-qt3d-render-layer-members.html) Properties ---------- * **[recursive](qml-qt3d-render-layer#recursive-prop)** : bool Detailed Description -------------------- Layer works in conjunction with the [LayerFilter](qml-qt3d-render-layerfilter) in the FrameGraph. A Layer can be applied to a subtree of entities by setting the recursive property to true. ``` import Qt3D.Core 2.0 import Qt3D.Render 2.0 Entity { id: root components: RenderSettings { // FrameGraph Viewport { ClearBuffers { buffers: ClearBuffers.ColorDepthBuffer CameraSelector { camera: mainCamera LayerFilter { layers: [layer1] } } } } } // Scene Camera { id: mainCamera } Layer { id: layer1 recursive: true } GeometryRenderer { id: mesh } Entity { id: renderableEntity components: [ mesh, layer1 ] } } ``` **See also** [LayerFilter](qml-qt3d-render-layerfilter). Property Documentation ---------------------- ### recursive : [bool](qml-bool) Specifies if the layer is also applied to the entity subtree. qt Android Services Android Services ================ Starting with Qt 5.7, you can create Android services using Qt. A service is a component that runs in background, so, it has no user interface. It is useful to perform long-term operations such as logging GPS, waiting for social media notifications, and so on. A service will continue to run even if the application that started it exits. Assemble the Service -------------------- To get started, create an Android package directory as instructed in [Qt Creator: Deploying Applications to Android Devices](https://doc.qt.io/qtcreator/creator-deploying-android.html). This directory contains the `AndroidManifest.xml` file. Inside the package directory, create a `src` directory, where all your Java packages and classes will be created. ### Create the Service Class You can create a service by extending the class `QtService` or [Android: Service](https://developer.android.com/reference/android/app/Service) to your Java class. Depending on whether you want to use Qt features in your service or call native C++ functions from Java, you need to extend either `QtService` or `Service`. Let's start with a simple service, as follows: ``` import android.content.Context; import android.content.Intent; import android.util.Log; import org.qtproject.qt.android.bindings.QtService; public class QtAndroidService extends QtService { private static final String TAG = "QtAndroidService"; @Override public void onCreate() { super.onCreate(); Log.i(TAG, "Creating Service"); } @Override public void onDestroy() { super.onDestroy(); Log.i(TAG, "Destroying Service"); } @Override public int onStartCommand(Intent intent, int flags, int startId) { int ret = super.onStartCommand(intent, flags, startId); // Do some work return ret; } } ``` ### Start the Service Android allows starting services on demand or at boot time. You can do both using Qt as well. #### Start a Service On Demand You can start the service in the following ways: * Directly from C++ using [QAndroidIntent](qandroidintent) and [QJniObject](qjniobject), by creating a service [Intent](https://developer.android.com/reference/android/content/Intent) and calling the app's main activity method [startService()](https://developer.android.com/reference/android/content/Context#startService(android.content.Intent)): ``` auto activity = QJniObject(QNativeInterface::QAndroidApplication:context()); QAndroidIntent serviceIntent(activity.object(), "org/qtproject/example/qtandroidservice/QtAndroidService"); QJniObject result = activity.callObjectMethod( "startService", "(Landroid/content/Intent;)Landroid/content/ComponentName;", serviceIntent.handle().object()); ``` * Start the service by calling a Java method. The easiest way is to create a static method in your service class: ``` public static void startQtAndroidService(Context context) { context.startService(new Intent(context, QtAndroidService.class)); } ``` The you can call it from C++ using the following JNI call: ``` QJniObject::callStaticMethod<void>( "org/qtproject/example/qtandroidservice/QtAndroidService", "startQtAndroidService", "(Landroid/content/Context;)V", QtAndroid::androidActivity().object()); ``` #### Start a Service At Boot Time To run a service at boot time, you need a [BroadcastReceiver](https://developer.android.com/reference/android/content/BroadcastReceiver). Create a custom Java class: ``` public class QtBootServiceBroadcastReceiver extends BroadcastReceiver { @Override public void onReceive(Context context, Intent intent) { Intent startServiceIntent = new Intent(context, QtAndroidService.class); context.startService(startServiceIntent); } } ``` Add the following `uses-permission` in the body of the `<manifest>` section in the `AndroidManifest.xml` file: ``` <uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" /> ``` Also, add the `receiver` definition in the body of the `<application>` section: ``` <receiver android:name=".QtBootServiceBroadcastReceiver"> <intent-filter> <action android:name="android.intent.action.BOOT_COMPLETED" /> </intent-filter> </receiver> ``` **Note:** Android 8.0 introduced some limitations on running background services, which means using a nomal `Service` class might not work. For more information, see Android's recommendation to use either [Foreground services](https://developer.android.com/guide/components/foreground-services) or [JobIntentService](https://developer.android.com/reference/androidx/core/app/JobIntentService.html). ### Manage the Service in AndroidMnifest.xml For the service to be usable in an Android app, you must declare it in the `AndroidManifest.xml` file. Let's start with adding the service section: * When extending `Service`, just declare the service section as a normal Android service. Add the following inside the `<application>` section: ``` <service android:name=".QtAndroidService"> <!-- Background running --> <meta-data android:name="android.app.background_running" android:value="true"/> <!-- Background running --> </service> ``` This way the service will start in the same process as `QtActivity`, which allows you to use native C++ calls from Java code. You can run it in a separate process but that way you cannot use any native calls for communication because the Qt libraries are not loaded for that process. To run on separate process, add this to the service tag: ``` android:process=":qt_service" ``` * When extending `QtService`, you need to declare other items for loading all the necessary libs required for Qt, mainly the same items as in `<activity>` section for `QtActivity`. Add the following: ``` <service android:process=":qt_service" android:name=".QtAndroidService"> <meta-data android:name="android.app.lib_name" android:value="service"/> <meta-data android:name="android.app.background_running" android:value="true"/> </service> ``` **Note:** Make sure to define the following to run the service in the background: ``` <meta-data android:name="android.app.background_running" android:value="true"/> ``` There are a few variations on how to declare services. Some of them are already used in the previous manifest snippet. Depending on your use case, run the service either in the same process as QtActivity or in a separate process. #### Service in the Same Process as QtActivity To run a service in the same process as QtActivity, declare the service header as follows: ``` <service android:name=".QtAndroidService"> ``` #### Service in Separate Process To run a service in a dedicated process, declare the service header as follows: ``` <service android:process=":qt_service" android:name=".QtAndroidService"> ``` Qt loads the `.so` file defined in `android.app.lib_name` `meta-data`, and calls the `main()` function with all the arguments set in `android.app.arguments` `meta-data`. When running in a separate process, you can start the service using either the same lib file as the main activity or a separate lib file. ##### Use the Same .so Lib File Using the same `.so` lib file as the main activity means the service will use the same entry point with an extra argument to distinguish it from the main activity. You can handle your application's execution in the `main()` function according the arguments provided. Add the following argument declaration to your service body: ``` <!-- Application arguments --> <meta-data android:name="android.app.arguments" android:value="-service"/> <!-- Application arguments --> ``` Then make sure the service `android.app.lib_name` is the same as the main activity, add the following: ``` <meta-data android:name="android.app.lib_name" android:value="-- %%INSERT_APP_LIB_NAME%% --"/> ``` When using the same `.so` lib file, your application's `main()` function is executed two times, one to start the main activity and the second time to start the service. Thus, you have to handle each execution according to the provided argument. One way to acheive that is as follows: ``` if (argc <= 1) { // code to handle main activity execution } else if (argc > 1 && strcmp(argv[1], "-service") == 0) { qDebug() << "Service starting with from the same .so file"; QAndroidService app(argc, argv); return app.exec(); } else { qWarning() << "Unrecognized command line argument"; return -1; } ``` ##### Use a Separate .so Lib File In this case, you need to have a sub-project with a `lib` template that provides a different executable for the service. A sample project `.pro` is: ``` TEMPLATE = lib TARGET = service CONFIG += dll QT += core core-private SOURCES += \ service_main.cpp HEADERS += servicemessenger.h ``` In the `service_main.cpp` you could have the following: ``` #include <QDebug> #include <QAndroidService> int main(int argc, char *argv[]) { qWarning() << "Service starting from a separate .so file"; QAndroidService app(argc, argv); return app.exec(); } ``` Define the `android.app.lib_name` for the service in the `AndroidManifest.xml`: ``` <meta-data android:name="android.app.lib_name" android:value="service"/> ``` Communication with the Service ------------------------------ Qt for Android offers a variety of inter-process communication (IPC) methods to communicate with Android Services. Depending on the structure of your project, you can use either native C++ calls from Java Service or Android BroadcastReceiver. ### Native C++ Calls from Java Service This can work with services running in the same process as `QtActivity` and even if `Service` is extended. For more information, see the [Qt Android Notifier Example](https://doc.qt.io/qt-6.2/qtcore-platform-androidnotifier-example.html). ### Using Android BroadcastReceiver [Android BroadcastReceiver](https://developer.android.com/reference/android/content/BroadcastReceiver) enables exchanging messages between the Android system, apps, activities and services. Similarly to other Android features, Qt can use broadcast receivers to exchange messages between `QtActivity` and your service. Let's start with logic to send a message from your service. Add the following in your service implementation, which calls [sendBroadcast()](https://developer.android.com/reference/android/content/Context#sendBroadcast(android.content.Intent)): ``` @Override public int onStartCommand(Intent intent, int flags, int startId) { int ret = super.onStartCommand(intent, flags, startId); Intent sendToUiIntent = new Intent(); sendToUiIntent.setAction(ActivityUtils.BROADCAST_CUSTOM_ACTION); sendToUiIntent.putExtra("message", "simple_string"); Log.i(TAG, "Service sending broadcast"); sendBroadcast(sendToUiIntent); return ret; } ``` Then, you need to create and register the broadcast receiver from the Qt's main activity. The easiest way is to create a custom class with a method and implement all that logic in Java. In the following example, the service sends a message `"simple_string"` to Qt by calling the native method `sendToQt()`: ``` public class ServiceBroadcastUtils { private static native void sendToQt(String message); private static final String TAG = "ActivityUtils"; public static final String BROADCAST_CUSTOM_ACTION = "org.qtproject.example.qtandroidservice.broadcast.custom"; public void registerServiceBroadcastReceiver(Context context) { IntentFilter intentFilter = new IntentFilter(); intentFilter.addAction(BROADCAST_CUSTOM_ACTION); context.registerReceiver(serviceMessageReceiver, intentFilter); Log.i(TAG, "Registered broadcast receiver"); } private BroadcastReceiver serviceMessageReceiver = new BroadcastReceiver() { @Override public void onReceive(Context context, Intent intent) { Log.i(TAG, "In OnReceive()"); if (BROADCAST_CUSTOM_ACTION.equals(intent.getAction())) { String message = intent.getStringExtra("message"); sendToQt(data); Log.i(TAG, "Service sent back message to C++: " + message); } } }; } ``` To make use of all that, start your service as shown in [Start the Service](android-services#start-the-service), an then register the broadcast receiver by calling the method `registerServiceBroadcastReceiver()`: ``` QJniEnvironment env; jclass javaClass = env.findClass("org/qtproject/example/qtandroidservice/ActivityUtils"); QJniObject classObject(javaClass); classObject.callMethod<void>("registerServiceBroadcastReceiver", "(Landroid/content/Context;)V", QtAndroid::androidContext().object()); ``` ### Using Qt Remote Objects [Qt Remote Objects](qtremoteobjects-gettingstarted) offers an easy way to share APIs between Qt processes. The main concept is to server in the service process, and have a replica in the Qt application, then those two parts are able to exchange data between each other, using signals and slots. #### Prepare the replica Let's consider a service example with separate `.so` lib file. Define a `.rep` file which defines our communication class: ``` class ServiceMessenger { SLOT(void ping(const QString &message)); SIGNAL(pong(const QString &message)); } ``` The define the class in the service sub-project as `servicemessenger.h`: ``` #include "rep_servicemessenger_source.h" class ServiceMessenger : public ServiceMessengerSource { public slots: void ping(const QString &name) override { emit pong("Hello " + name); } }; ``` Then, add the `.rep` file to both the main application and service `.pro` files, in the main application: ``` QT += remoteobjects REPC_REPLICA += servicemessenger.rep ``` And in the service sub-project: ``` QT += remoteobjects REPC_SOURCE += servicemessenger.rep ``` #### Connect the source and replica Define the Qt Remote Objects source node in the service sub-project's `main()` function: ``` #include "servicemessenger.h" #include <QDebug> #include <QAndroidService> int main(int argc, char *argv[]) { qWarning() << "QtAndroidService starting from separate .so"; QAndroidService app(argc, argv); QRemoteObjectHost srcNode(QUrl(QStringLiteral("local:replica"))); ServiceMessenger serviceMessenger; srcNode.enableRemoting(&serviceMessenger); return app.exec(); } ``` Then, in the application's `main()` function, connect to source node: ``` QRemoteObjectNode repNode; repNode.connectToNode(QUrl(QStringLiteral("local:replica"))); QSharedPointer<ServiceMessengerReplica> rep(repNode.acquire<ServiceMessengerReplica>()); bool res = rep->waitForSource(); Q_ASSERT(res); QObject::connect(rep.data(), &ServiceMessengerReplica::pong, [](const QString &message){ qDebug() << "Service sent: " << message; }); rep->ping("Qt and Android are friends!"); ``` This example sends a message from the main application's process to the service. The service replies with the same message, which is printed on the debug logcat. **Note:** The same method could be used when using the same `.so` lib file. For more information, see [Use the same .so Lib File](android-services#use-the-same-so-lib-file). ### Using QAndroidBinder [QAndroidBinder](qandroidbinder) is a convenience class that enables inter-process communication by implementing the most important methods in [Android: Binder](https://developer.android.com/reference/android/os/Binder.html). It allows sending [QByteArray](qbytearray) or [QVariant](qvariant) objects between processes. **Note:** Qt for Android has a limitation forcing the execution of only one service at a time when running multiple services in one process. Thus, it is recommended to run each service in its own process. For more information, see [QTBUG-78009](https://bugreports.qt.io/browse/QTBUG-78009).
programming_docs
qt QMovie Class QMovie Class ============ The QMovie class is a convenience class for playing movies with [QImageReader](qimagereader). [More...](#details) | | | | --- | --- | | Header: | #include <QMovie> | | CMake: | find\_package(Qt6 COMPONENTS Gui REQUIRED) target\_link\_libraries(mytarget PRIVATE Qt6::Gui) | | qmake: | QT += gui | | Inherits: | [QObject](qobject) | * [List of all members, including inherited members](https://doc.qt.io/qt-6.2/qmovie-members.html) Public Types ------------ | | | | --- | --- | | enum | **[CacheMode](qmovie#CacheMode-enum)** { CacheNone, CacheAll } | | enum | **[MovieState](qmovie#MovieState-enum)** { NotRunning, Paused, Running } | Properties ---------- * **[cacheMode](qmovie#cacheMode-prop)** : CacheMode * **[speed](qmovie#speed-prop)** : int Public Functions ---------------- | | | | --- | --- | | | **[QMovie](qmovie#QMovie-2)**(const QString &*fileName*, const QByteArray &*format* = QByteArray(), QObject \**parent* = nullptr) | | | **[QMovie](qmovie#QMovie-1)**(QIODevice \**device*, const QByteArray &*format* = QByteArray(), QObject \**parent* = nullptr) | | | **[QMovie](qmovie#QMovie)**(QObject \**parent* = nullptr) | | virtual | **[~QMovie](qmovie#dtor.QMovie)**() | | QColor | **[backgroundColor](qmovie#backgroundColor)**() const | | QMovie::CacheMode | **[cacheMode](qmovie#cacheMode-prop)**() const | | int | **[currentFrameNumber](qmovie#currentFrameNumber)**() const | | QImage | **[currentImage](qmovie#currentImage)**() const | | QPixmap | **[currentPixmap](qmovie#currentPixmap)**() const | | QIODevice \* | **[device](qmovie#device)**() const | | QString | **[fileName](qmovie#fileName)**() const | | QByteArray | **[format](qmovie#format)**() const | | int | **[frameCount](qmovie#frameCount)**() const | | QRect | **[frameRect](qmovie#frameRect)**() const | | bool | **[isValid](qmovie#isValid)**() const | | bool | **[jumpToFrame](qmovie#jumpToFrame)**(int *frameNumber*) | | QImageReader::ImageReaderError | **[lastError](qmovie#lastError)**() const | | QString | **[lastErrorString](qmovie#lastErrorString)**() const | | int | **[loopCount](qmovie#loopCount)**() const | | int | **[nextFrameDelay](qmovie#nextFrameDelay)**() const | | QSize | **[scaledSize](qmovie#scaledSize)**() | | void | **[setBackgroundColor](qmovie#setBackgroundColor)**(const QColor &*color*) | | void | **[setCacheMode](qmovie#cacheMode-prop)**(QMovie::CacheMode *mode*) | | void | **[setDevice](qmovie#setDevice)**(QIODevice \**device*) | | void | **[setFileName](qmovie#setFileName)**(const QString &*fileName*) | | void | **[setFormat](qmovie#setFormat)**(const QByteArray &*format*) | | void | **[setScaledSize](qmovie#setScaledSize)**(const QSize &*size*) | | int | **[speed](qmovie#speed-prop)**() const | | QMovie::MovieState | **[state](qmovie#state)**() const | Public Slots ------------ | | | | --- | --- | | bool | **[jumpToNextFrame](qmovie#jumpToNextFrame)**() | | void | **[setPaused](qmovie#setPaused)**(bool *paused*) | | void | **[setSpeed](qmovie#speed-prop)**(int *percentSpeed*) | | void | **[start](qmovie#start)**() | | void | **[stop](qmovie#stop)**() | Signals ------- | | | | --- | --- | | void | **[error](qmovie#error)**(QImageReader::ImageReaderError *error*) | | void | **[finished](qmovie#finished)**() | | void | **[frameChanged](qmovie#frameChanged)**(int *frameNumber*) | | void | **[resized](qmovie#resized)**(const QSize &*size*) | | void | **[started](qmovie#started)**() | | void | **[stateChanged](qmovie#stateChanged)**(QMovie::MovieState *state*) | | void | **[updated](qmovie#updated)**(const QRect &*rect*) | Static Public Members --------------------- | | | | --- | --- | | QList<QByteArray> | **[supportedFormats](qmovie#supportedFormats)**() | Detailed Description -------------------- This class is used to show simple animations without sound. First, create a QMovie object by passing either the name of a file or a pointer to a [QIODevice](qiodevice) containing an animated image format to QMovie's constructor. You can call [isValid](qmovie#isValid)() to check if the image data is valid, before starting the movie. To start the movie, call [start](qmovie#start)(). QMovie will enter [Running](qmovie#MovieState-enum) state, and emit [started](qmovie#started)() and [stateChanged](qmovie#stateChanged)(). To get the current state of the movie, call [state](qmovie#state)(). To display the movie in your application, you can pass your QMovie object to [QLabel::setMovie](qlabel#setMovie)(). Example: ``` QLabel label; QMovie *movie = new QMovie("animations/fire.gif"); label.setMovie(movie); movie->start(); ``` Whenever a new frame is available in the movie, QMovie will emit [updated](qmovie#updated)(). If the size of the frame changes, [resized](qmovie#resized)() is emitted. You can call [currentImage](qmovie#currentImage)() or [currentPixmap](qmovie#currentPixmap)() to get a copy of the current frame. When the movie is done, QMovie emits [finished](qmovie#finished)(). If any error occurs during playback (i.e, the image file is corrupt), QMovie will emit [error](qmovie#error)(). You can control the speed of the movie playback by calling [setSpeed](qmovie#speed-prop)(), which takes the percentage of the original speed as an argument. Pause the movie by calling [setPaused](qmovie#setPaused)(true). QMovie will then enter [Paused](qmovie#MovieState-enum) state and emit [stateChanged](qmovie#stateChanged)(). If you call [setPaused](qmovie#setPaused)(false), QMovie will reenter [Running](qmovie#MovieState-enum) state and start the movie again. To stop the movie, call [stop](qmovie#stop)(). Certain animation formats allow you to set the background color. You can call [setBackgroundColor](qmovie#setBackgroundColor)() to set the color, or [backgroundColor](qmovie#backgroundColor)() to retrieve the current background color. [currentFrameNumber](qmovie#currentFrameNumber)() returns the sequence number of the current frame. The first frame in the animation has the sequence number 0. [frameCount](qmovie#frameCount)() returns the total number of frames in the animation, if the image format supports this. You can call [loopCount](qmovie#loopCount)() to get the number of times the movie should loop before finishing. [nextFrameDelay](qmovie#nextFrameDelay)() returns the number of milliseconds the current frame should be displayed. QMovie can be instructed to cache frames of an animation by calling [setCacheMode](qmovie#cacheMode-prop)(). Call [supportedFormats](qmovie#supportedFormats)() for a list of formats that QMovie supports. **See also** [QLabel](qlabel), [QImageReader](qimagereader), and [Movie Example](https://doc.qt.io/qt-6.2/qtwidgets-widgets-movie-example.html). Member Type Documentation ------------------------- ### enum QMovie::CacheMode This enum describes the different cache modes of [QMovie](qmovie). | Constant | Value | Description | | --- | --- | --- | | `QMovie::CacheNone` | `0` | No frames are cached (the default). | | `QMovie::CacheAll` | `1` | All frames are cached. | ### enum QMovie::MovieState This enum describes the different states of [QMovie](qmovie). | Constant | Value | Description | | --- | --- | --- | | `QMovie::NotRunning` | `0` | The movie is not running. This is [QMovie](qmovie)'s initial state, and the state it enters after [stop](qmovie#stop)() has been called or the movie is finished. | | `QMovie::Paused` | `1` | The movie is paused, and [QMovie](qmovie) stops emitting [updated](qmovie#updated)() or [resized](qmovie#resized)(). This state is entered after calling pause() or [setPaused](qmovie#setPaused)(true). The current frame number it kept, and the movie will continue with the next frame when unpause() or [setPaused](qmovie#setPaused)(false) is called. | | `QMovie::Running` | `2` | The movie is running. | Property Documentation ---------------------- ### `[bindable]` cacheMode : [CacheMode](qmovie#CacheMode-enum) **Note:** This property supports [QProperty](qproperty) bindings. This property holds the movie's cache mode Caching frames can be useful when the underlying animation format handler that [QMovie](qmovie) relies on to decode the animation data does not support jumping to particular frames in the animation, or even "rewinding" the animation to the beginning (for looping). Furthermore, if the image data comes from a sequential device, it is not possible for the underlying animation handler to seek back to frames whose data has already been read (making looping altogether impossible). To aid in such situations, a [QMovie](qmovie) object can be instructed to cache the frames, at the added memory cost of keeping the frames in memory for the lifetime of the object. By default, this property is set to [CacheNone](qmovie#CacheMode-enum). **See also** [QMovie::CacheMode](qmovie#CacheMode-enum). ### `[bindable]` speed : int **Note:** This property supports [QProperty](qproperty) bindings. This property holds the movie's speed The speed is measured in percentage of the original movie speed. The default speed is 100%. Example: ``` QMovie movie("racecar.gif"); movie.setSpeed(200); // 2x speed ``` Member Function Documentation ----------------------------- ### QMovie::QMovie(const [QString](qstring) &*fileName*, const [QByteArray](qbytearray) &*format* = QByteArray(), [QObject](qobject#QObject) \**parent* = nullptr) Constructs a QMovie object. QMovie will use read image data from *fileName*. If *format* is not empty, QMovie will use the image format *format* for decoding the image data. Otherwise, QMovie will attempt to guess the format. The *parent* object is passed to [QObject](qobject)'s constructor. ### QMovie::QMovie([QIODevice](qiodevice) \**device*, const [QByteArray](qbytearray) &*format* = QByteArray(), [QObject](qobject#QObject) \**parent* = nullptr) Constructs a QMovie object. QMovie will use read image data from *device*, which it assumes is open and readable. If *format* is not empty, QMovie will use the image format *format* for decoding the image data. Otherwise, QMovie will attempt to guess the format. The *parent* object is passed to [QObject](qobject)'s constructor. ### QMovie::QMovie([QObject](qobject#QObject) \**parent* = nullptr) Constructs a QMovie object, passing the *parent* object to [QObject](qobject)'s constructor. **See also** [setFileName](qmovie#setFileName)(), [setDevice](qmovie#setDevice)(), and [setFormat](qmovie#setFormat)(). ### `[signal]` void QMovie::error([QImageReader::ImageReaderError](qimagereader#ImageReaderError-enum) *error*) This signal is emitted by [QMovie](qmovie) when the error *error* occurred during playback. [QMovie](qmovie) will stop the movie, and enter [QMovie::NotRunning](qmovie#MovieState-enum) state. **See also** [lastError](qmovie#lastError)() and [lastErrorString](qmovie#lastErrorString)(). ### `[signal]` void QMovie::finished() This signal is emitted when the movie has finished. **See also** [QMovie::stop](qmovie#stop)(). ### `[signal]` void QMovie::frameChanged(int *frameNumber*) This signal is emitted when the frame number has changed to *frameNumber*. You can call [currentImage](qmovie#currentImage)() or [currentPixmap](qmovie#currentPixmap)() to get a copy of the frame. ### `[slot]` bool QMovie::jumpToNextFrame() Jumps to the next frame. Returns `true` on success; otherwise returns `false`. ### `[signal]` void QMovie::resized(const [QSize](qsize) &*size*) This signal is emitted when the current frame has been resized to *size*. This effect is sometimes used in animations as an alternative to replacing the frame. You can call [currentImage](qmovie#currentImage)() or [currentPixmap](qmovie#currentPixmap)() to get a copy of the updated frame. ### `[slot]` void QMovie::setPaused(bool *paused*) If *paused* is true, [QMovie](qmovie) will enter [Paused](qmovie#MovieState-enum) state and emit [stateChanged](qmovie#stateChanged)(Paused); otherwise it will enter [Running](qmovie#MovieState-enum) state and emit [stateChanged](qmovie#stateChanged)(Running). **See also** [state](qmovie#state)(). ### `[slot]` void QMovie::start() Starts the movie. [QMovie](qmovie) will enter [Running](qmovie#MovieState-enum) state, and start emitting [updated](qmovie#updated)() and [resized](qmovie#resized)() as the movie progresses. If [QMovie](qmovie) is in the [Paused](qmovie#MovieState-enum) state, this function is equivalent to calling [setPaused](qmovie#setPaused)(false). If [QMovie](qmovie) is already in the [Running](qmovie#MovieState-enum) state, this function does nothing. **See also** [stop](qmovie#stop)() and [setPaused](qmovie#setPaused)(). ### `[signal]` void QMovie::started() This signal is emitted after [QMovie::start](qmovie#start)() has been called, and [QMovie](qmovie) has entered [QMovie::Running](qmovie#MovieState-enum) state. ### `[signal]` void QMovie::stateChanged([QMovie::MovieState](qmovie#MovieState-enum) *state*) This signal is emitted every time the state of the movie changes. The new state is specified by *state*. **See also** [QMovie::state](qmovie#state)(). ### `[slot]` void QMovie::stop() Stops the movie. [QMovie](qmovie) enters [NotRunning](qmovie#MovieState-enum) state, and stops emitting [updated](qmovie#updated)() and [resized](qmovie#resized)(). If [start](qmovie#start)() is called again, the movie will restart from the beginning. If [QMovie](qmovie) is already in the [NotRunning](qmovie#MovieState-enum) state, this function does nothing. **See also** [start](qmovie#start)() and [setPaused](qmovie#setPaused)(). ### `[signal]` void QMovie::updated(const [QRect](qrect) &*rect*) This signal is emitted when the rect *rect* in the current frame has been updated. You can call [currentImage](qmovie#currentImage)() or [currentPixmap](qmovie#currentPixmap)() to get a copy of the updated frame. ### `[virtual]` QMovie::~QMovie() Destructs the [QMovie](qmovie) object. ### [QColor](qcolor) QMovie::backgroundColor() const Returns the background color of the movie. If no background color has been assigned, an invalid [QColor](qcolor) is returned. **See also** [setBackgroundColor](qmovie#setBackgroundColor)(). ### int QMovie::currentFrameNumber() const Returns the sequence number of the current frame. The number of the first frame in the movie is 0. ### [QImage](qimage) QMovie::currentImage() const Returns the current frame as a [QImage](qimage). **See also** [currentPixmap](qmovie#currentPixmap)() and [updated](qmovie#updated)(). ### [QPixmap](qpixmap) QMovie::currentPixmap() const Returns the current frame as a [QPixmap](qpixmap). **See also** [currentImage](qmovie#currentImage)() and [updated](qmovie#updated)(). ### [QIODevice](qiodevice) \*QMovie::device() const Returns the device [QMovie](qmovie) reads image data from. If no device has currently been assigned, `nullptr` is returned. **See also** [setDevice](qmovie#setDevice)() and [fileName](qmovie#fileName)(). ### [QString](qstring) QMovie::fileName() const Returns the name of the file that [QMovie](qmovie) reads image data from. If no file name has been assigned, or if the assigned device is not a file, an empty [QString](qstring) is returned. **See also** [setFileName](qmovie#setFileName)() and [device](qmovie#device)(). ### [QByteArray](qbytearray) QMovie::format() const Returns the format that [QMovie](qmovie) uses when decoding image data. If no format has been assigned, an empty QByteArray() is returned. **See also** [setFormat](qmovie#setFormat)(). ### int QMovie::frameCount() const Returns the number of frames in the movie. Certain animation formats do not support this feature, in which case 0 is returned. ### [QRect](qrect) QMovie::frameRect() const Returns the rect of the last frame. If no frame has yet been updated, an invalid [QRect](qrect) is returned. **See also** [currentImage](qmovie#currentImage)() and [currentPixmap](qmovie#currentPixmap)(). ### bool QMovie::isValid() const Returns `true` if the movie is valid (e.g., the image data is readable and the image format is supported); otherwise returns `false`. For information about why the movie is not valid, see [lastError](qmovie#lastError)(). ### bool QMovie::jumpToFrame(int *frameNumber*) Jumps to frame number *frameNumber*. Returns `true` on success; otherwise returns `false`. ### [QImageReader::ImageReaderError](qimagereader#ImageReaderError-enum) QMovie::lastError() const Returns the most recent error that occurred while attempting to read image data. **See also** [lastErrorString](qmovie#lastErrorString)(). ### [QString](qstring) QMovie::lastErrorString() const Returns a human-readable representation of the most recent error that occurred while attempting to read image data. **See also** [lastError](qmovie#lastError)(). ### int QMovie::loopCount() const Returns the number of times the movie will loop before it finishes. If the movie will only play once (no looping), loopCount returns 0. If the movie loops forever, loopCount returns -1. Note that, if the image data comes from a sequential device (e.g. a socket), [QMovie](qmovie) can only loop the movie if the [cacheMode](qmovie#cacheMode-prop) is set to [QMovie::CacheAll](qmovie#CacheMode-enum). ### int QMovie::nextFrameDelay() const Returns the number of milliseconds [QMovie](qmovie) will wait before updating the next frame in the animation. ### [QSize](qsize) QMovie::scaledSize() Returns the scaled size of frames. **See also** [setScaledSize](qmovie#setScaledSize)() and [QImageReader::scaledSize](qimagereader#scaledSize)(). ### void QMovie::setBackgroundColor(const [QColor](qcolor) &*color*) For image formats that support it, this function sets the background color to *color*. **See also** [backgroundColor](qmovie#backgroundColor)(). ### void QMovie::setDevice([QIODevice](qiodevice) \**device*) Sets the current device to *device*. [QMovie](qmovie) will read image data from this device when the movie is running. **See also** [device](qmovie#device)() and [setFormat](qmovie#setFormat)(). ### void QMovie::setFileName(const [QString](qstring) &*fileName*) Sets the name of the file that [QMovie](qmovie) reads image data from, to *fileName*. **See also** [fileName](qmovie#fileName)(), [setDevice](qmovie#setDevice)(), and [setFormat](qmovie#setFormat)(). ### void QMovie::setFormat(const [QByteArray](qbytearray) &*format*) Sets the format that [QMovie](qmovie) will use when decoding image data, to *format*. By default, [QMovie](qmovie) will attempt to guess the format of the image data. You can call [supportedFormats](qmovie#supportedFormats)() for the full list of formats [QMovie](qmovie) supports. **See also** [format](qmovie#format)() and [QImageReader::supportedImageFormats](qimagereader#supportedImageFormats)(). ### void QMovie::setScaledSize(const [QSize](qsize) &*size*) Sets the scaled frame size to *size*. **See also** [scaledSize](qmovie#scaledSize)() and [QImageReader::setScaledSize](qimagereader#setScaledSize)(). ### [QMovie::MovieState](qmovie#MovieState-enum) QMovie::state() const Returns the current state of [QMovie](qmovie). **See also** [MovieState](qmovie#MovieState-enum) and [stateChanged](qmovie#stateChanged)(). ### `[static]` [QList](qlist)<[QByteArray](qbytearray)> QMovie::supportedFormats() Returns the list of image formats supported by [QMovie](qmovie). **See also** [QImageReader::supportedImageFormats](qimagereader#supportedImageFormats)(). qt PieSlice QML Type PieSlice QML Type ================= Represents a single slice in a pie series. [More...](#details) | | | | --- | --- | | Import Statement: | import QtCharts | | Instantiates: | [QPieSlice](qpieslice) | * [List of all members, including inherited members](https://doc.qt.io/qt-6.2/qml-qtcharts-pieslice-members.html) Properties ---------- * **[angleSpan](qml-qtcharts-pieslice#angleSpan-prop)** : real * **[borderColor](qml-qtcharts-pieslice#borderColor-prop)** : color * **[borderWidth](qml-qtcharts-pieslice#borderWidth-prop)** : int * **[brushFilename](qml-qtcharts-pieslice#brushFilename-prop)** : string * **[color](qml-qtcharts-pieslice#color-prop)** : color * **[explodeDistanceFactor](qml-qtcharts-pieslice#explodeDistanceFactor-prop)** : real * **[exploded](qml-qtcharts-pieslice#exploded-prop)** : bool * **[label](qml-qtcharts-pieslice#label-prop)** : string * **[labelArmLengthFactor](qml-qtcharts-pieslice#labelArmLengthFactor-prop)** : real * **[labelColor](qml-qtcharts-pieslice#labelColor-prop)** : color * **[labelFont](qml-qtcharts-pieslice#labelFont-prop)** : font * **[labelPosition](qml-qtcharts-pieslice#labelPosition-prop)** : enumeration * **[labelVisible](qml-qtcharts-pieslice#labelVisible-prop)** : bool * **[percentage](qml-qtcharts-pieslice#percentage-prop)** : real * **[startAngle](qml-qtcharts-pieslice#startAngle-prop)** : real * **[value](qml-qtcharts-pieslice#value-prop)** : real Signals ------- * **[clicked](qml-qtcharts-pieslice#clicked-signal)**() * **[doubleClicked](qml-qtcharts-pieslice#doubleClicked-signal)**() * **[hovered](qml-qtcharts-pieslice#hovered-signal)**(bool *state*) * **[pressed](qml-qtcharts-pieslice#pressed-signal)**() * **[released](qml-qtcharts-pieslice#released-signal)**() Detailed Description -------------------- A pie slice has a value and a label. When the slice is added to a pie series, the [PieSeries](qml-qtcharts-pieseries) type calculates the percentage of the slice compared with the sum of all slices in the series to determine the actual size of the slice in the chart. By default, the label is hidden. If it is visible, it can be either located outside the slice and connected to it with an arm or centered inside the slice either horizontally or in parallel with the tangential or normal of the slice's arc. By default, the visual appearance of the slice is set by a theme, but the theme can be overridden by specifying slice properties. However, if the theme is changed after the slices are customized, all customization will be lost. The PieSlice type should be used as a child of a [PieSeries](qml-qtcharts-pieseries) type. For example: ``` PieSeries { id: pieSeries PieSlice { label: "eaten"; value: 94.9 } PieSlice { label: "not yet eaten"; value: 5.1 } } ``` Alternatively, slices can be added to a pie series by using the [PieSeries.append](qml-qtcharts-pieseries#append-method)() method. ``` pieSeries.append("don't care", 1.1); ``` In that case, [PieSeries.at](qml-qtcharts-pieseries#at-method)() or [PieSeries.find](qml-qtcharts-pieseries#find-method) can be used to access the properties of an individual PieSlice instance. ``` pieSeries.at(0).exploded = true; ``` **See also** [PieSeries](qml-qtcharts-pieseries). Property Documentation ---------------------- ### angleSpan : [real](qml-real) The span of the slice in degrees. A full pie is 360 degrees, where 0 degrees is at 12 a'clock. Updated automatically once the slice is added to the series. ### borderColor : [color](qml-color) The color used to draw the slice border (pen color). **See also** [borderWidth](qml-qtcharts-pieslice#borderWidth-prop). ### borderWidth : [int](qml-int) The width of the slice border. This is a convenience property for modifying the slice pen. **See also** [borderColor](qml-qtcharts-pieslice#borderColor-prop). ### brushFilename : [string](qml-string) The name of the file used as a brush for the slice. ### color : [color](qml-color) The fill (brush) color of the slice. ### explodeDistanceFactor : [real](qml-real) Determines how far away from the pie the slice is exploded. * 1.0 means that the distance is the same as the radius. * 0.5 means that the distance is half of the radius. By default, the distance is 0.15 **See also** [exploded](qml-qtcharts-pieslice#exploded-prop). ### exploded : [bool](qml-bool) Whether the slice is separated from the pie. **See also** [explodeDistanceFactor](qml-qtcharts-pieslice#explodeDistanceFactor-prop). ### label : [string](qml-string) The label of the slice. **Note:** The string can be HTML formatted. ### labelArmLengthFactor : [real](qml-real) The length of the label arm. The factor is relative to the pie radius. For example: * 1.0 means that the length is the same as the radius. * 0.5 means that the length is half of the radius. By default, the arm length is 0.15 **See also** [labelVisible](qml-qtcharts-pieslice#labelVisible-prop). ### labelColor : [color](qml-color) The color used to draw the slice label. ### labelFont : [font](qml-font) The font used for the slice label. For more information, see [font](qml-font). **See also** [labelVisible](qml-qtcharts-pieslice#labelVisible-prop) and [labelPosition](qml-qtcharts-pieslice#labelPosition-prop). ### labelPosition : [enumeration](qml-enumeration) Describes the position of the slice label. | Constant | Description | | --- | --- | | `PieSlice.LabelOutside` | The label is located outside the slice connected to it with an arm. This is the default value. | | `PieSlice.LabelInsideHorizontal` | The label is centered within the slice and laid out horizontally. | | `PieSlice.LabelInsideTangential` | The label is centered within the slice and rotated to be parallel with the tangential of the slice's arc. | | `PieSlice.LabelInsideNormal` | The label is centered within the slice and rotated to be parallel with the normal of the slice's arc. | **See also** [labelVisible](qml-qtcharts-pieslice#labelVisible-prop). ### labelVisible : [bool](qml-bool) The visibility of the slice label. By default, the label is not visible. ### percentage : [real](qml-real) The percentage of the slice compared to the sum of all slices in the series. The actual value ranges from 0.0 to 1.0. Updated automatically once the slice is added to the series. ### startAngle : [real](qml-real) The starting angle of this slice in the series it belongs to. A full pie is 360 degrees, where 0 degrees is at 12 a'clock. Updated automatically once the slice is added to the series. ### value : [real](qml-real) The value of the slice. **Note:** A negative value is converted to a positive value. Signal Documentation -------------------- ### clicked() This signal is emitted when the slice is clicked. The corresponding signal handler is `onClicked()`. **Note:** The corresponding handler is `onClicked`. ### doubleClicked() This signal is emitted when user double-clicks the slice. The corresponding signal handler is `onDoubleClicked()`. **Note:** The corresponding handler is `onDoubleClicked`. ### hovered([bool](qml-bool) *state*) This signal is emitted when a mouse is hovered over the slice. When the mouse moves over the slice, *state* turns `true`, and when the mouse moves away again, it turns `false`. The corresponding signal handler is `onHovered()`. **Note:** The corresponding handler is `onHovered`. ### pressed() This signal is emitted when user clicks the slice and holds down the mouse button. The corresponding signal handler is `onPressed()`. **Note:** The corresponding handler is `onPressed`. ### released() This signal is emitted when the user releases the mouse press on the slice. The corresponding signal handler is `onReleased()`. **Note:** The corresponding handler is `onReleased`.
programming_docs
qt PhongAlphaMaterial QML Type PhongAlphaMaterial QML Type =========================== The PhongAlphaMaterial class provides a default implementation of the phong lighting effect with alpha. [More...](#details) | | | | --- | --- | | Import Statement: | import Qt3D.Extras | | Since: | Qt 5.7 | | Inherits: | [Material](qml-qt3d-render-material) | * [List of all members, including inherited members](https://doc.qt.io/qt-6.2/qml-qt3d-extras-phongalphamaterial-members.html) Properties ---------- * **[alpha](qml-qt3d-extras-phongalphamaterial#alpha-prop)** : real * **[ambient](qml-qt3d-extras-phongalphamaterial#ambient-prop)** : color * **[blendFunctionArg](qml-qt3d-extras-phongalphamaterial#blendFunctionArg-prop)** : BlendEquation::BlendFunction * **[destinationAlphaArg](qml-qt3d-extras-phongalphamaterial#destinationAlphaArg-prop)** : BlendEquationArguments::Blending * **[destinationRgbArg](qml-qt3d-extras-phongalphamaterial#destinationRgbArg-prop)** : BlendEquationArguments::Blending * **[diffuse](qml-qt3d-extras-phongalphamaterial#diffuse-prop)** : color * **[shininess](qml-qt3d-extras-phongalphamaterial#shininess-prop)** : real * **[sourceAlphaArg](qml-qt3d-extras-phongalphamaterial#sourceAlphaArg-prop)** : BlendEquationArguments::Blending * **[sourceRgbArg](qml-qt3d-extras-phongalphamaterial#sourceRgbArg-prop)** : BlendEquationArguments::Blending * **[specular](qml-qt3d-extras-phongalphamaterial#specular-prop)** : color Detailed Description -------------------- The phong lighting effect is based on the combination of 3 lighting components ambient, diffuse and specular. The relative strengths of these components are controlled by means of their reflectivity coefficients which are modelled as RGB triplets: * Ambient is the color that is emitted by an object without any other light source. * Diffuse is the color that is emitted for rought surface reflections with the lights. * Specular is the color emitted for shiny surface reflections with the lights. * The shininess of a surface is controlled by a float property. * Alpha is the transparency of the surface between 0 (fully transparent) and 1 (opaque). This material uses an effect with a single render pass approach and performs per fragment lighting. Techniques are provided for OpenGL 2, OpenGL 3 or above as well as OpenGL ES 2. Property Documentation ---------------------- ### alpha : [real](qml-real) Holds the alpha component of the object which varies between 0 and 1. The default value is 0.5. ### ambient : [color](qml-color) Holds the current ambient color. ### blendFunctionArg : BlendEquation::BlendFunction Holds the blend equation function argument. **See also** [Qt3DRender::QBlendEquation::BlendFunction](qt3drender-qblendequation#BlendFunction-enum). ### destinationAlphaArg : BlendEquationArguments::Blending Holds the blend equation destination alpha blending argument. **See also** [Qt3DRender::QBlendEquationArguments::Blending](qt3drender-qblendequationarguments#Blending-enum). ### destinationRgbArg : BlendEquationArguments::Blending Holds the blend equation destination RGB blending argument. **See also** [Qt3DRender::QBlendEquationArguments::Blending](qt3drender-qblendequationarguments#Blending-enum). ### diffuse : [color](qml-color) Holds the current diffuse color. ### shininess : [real](qml-real) Holds the current shininess. ### sourceAlphaArg : BlendEquationArguments::Blending Holds the blend equation source alpha blending argument. **See also** [Qt3DRender::QBlendEquationArguments::Blending](qt3drender-qblendequationarguments#Blending-enum). ### sourceRgbArg : BlendEquationArguments::Blending Holds the blend equation source RGB blending argument. **See also** [Qt3DRender::QBlendEquationArguments::Blending](qt3drender-qblendequationarguments#Blending-enum). ### specular : [color](qml-color) Holds the current specular color. qt RangeSlider QML Type RangeSlider QML Type ==================== Used to select a range of values by sliding two handles along a track. [More...](#details) | | | | --- | --- | | Import Statement: | import QtQuick.Controls | | Since: | Qt 5.7 | | Inherits: | [Control](qml-qtquick-controls2-control) | * [List of all members, including inherited members](https://doc.qt.io/qt-6.2/qml-qtquick-controls2-rangeslider-members.html) Properties ---------- * **[first](qml-qtquick-controls2-rangeslider#first-prop)** + **[first.handle](qml-qtquick-controls2-rangeslider#first.handle-prop)** : Item + **[first.hovered](qml-qtquick-controls2-rangeslider#first.hovered-prop)** : bool + **[first.implicitHandleHeight](qml-qtquick-controls2-rangeslider#first.implicitHandleHeight-prop)** : real + **[first.implicitHandleWidth](qml-qtquick-controls2-rangeslider#first.implicitHandleWidth-prop)** : real + **[first.position](qml-qtquick-controls2-rangeslider#first.position-prop)** : real + **[first.pressed](qml-qtquick-controls2-rangeslider#first.pressed-prop)** : bool + **[first.value](qml-qtquick-controls2-rangeslider#first.value-prop)** : real + **[first.visualPosition](qml-qtquick-controls2-rangeslider#first.visualPosition-prop)** : real * **[from](qml-qtquick-controls2-rangeslider#from-prop)** : real * **[horizontal](qml-qtquick-controls2-rangeslider#horizontal-prop)** : bool * **[live](qml-qtquick-controls2-rangeslider#live-prop)** : bool * **[orientation](qml-qtquick-controls2-rangeslider#orientation-prop)** : enumeration * **[second](qml-qtquick-controls2-rangeslider#second-prop)** + **[second.handle](qml-qtquick-controls2-rangeslider#second.handle-prop)** : Item + **[second.hovered](qml-qtquick-controls2-rangeslider#second.hovered-prop)** : bool + **[second.implicitHandleHeight](qml-qtquick-controls2-rangeslider#second.implicitHandleHeight-prop)** : real + **[second.implicitHandleWidth](qml-qtquick-controls2-rangeslider#second.implicitHandleWidth-prop)** : real + **[second.position](qml-qtquick-controls2-rangeslider#second.position-prop)** : real + **[second.pressed](qml-qtquick-controls2-rangeslider#second.pressed-prop)** : bool + **[second.value](qml-qtquick-controls2-rangeslider#second.value-prop)** : real + **[second.visualPosition](qml-qtquick-controls2-rangeslider#second.visualPosition-prop)** : real * **[snapMode](qml-qtquick-controls2-rangeslider#snapMode-prop)** : enumeration * **[stepSize](qml-qtquick-controls2-rangeslider#stepSize-prop)** : real * **[to](qml-qtquick-controls2-rangeslider#to-prop)** : real * **[touchDragThreshold](qml-qtquick-controls2-rangeslider#touchDragThreshold-prop)** : qreal * **[vertical](qml-qtquick-controls2-rangeslider#vertical-prop)** : bool Signals ------- * void **[first.moved](qml-qtquick-controls2-rangeslider#first.moved-signal)**() * void **[second.moved](qml-qtquick-controls2-rangeslider#second.moved-signal)**() Methods ------- * void **[first.decrease](qml-qtquick-controls2-rangeslider#first.decrease-method)**() * void **[first.increase](qml-qtquick-controls2-rangeslider#first.increase-method)**() * void **[second.decrease](qml-qtquick-controls2-rangeslider#second.decrease-method)**() * void **[second.increase](qml-qtquick-controls2-rangeslider#second.increase-method)**() * void **[setValues](qml-qtquick-controls2-rangeslider#setValues-method)**(real *firstValue*, real *secondValue*) * real **[valueAt](qml-qtquick-controls2-rangeslider#valueAt-method)**(real *position*) Detailed Description -------------------- RangeSlider is used to select a range specified by two values, by sliding each handle along a track. In the example below, custom [from](qml-qtquick-controls2-rangeslider#from-prop) and [to](qml-qtquick-controls2-rangeslider#to-prop) values are set, and the initial positions of the [first](qml-qtquick-controls2-rangeslider#first-prop) and [second](qml-qtquick-controls2-rangeslider#second-prop) handles are set: ``` RangeSlider { from: 1 to: 100 first.value: 25 second.value: 75 } ``` In order to perform an action when the value for a particular handle changes, use the following syntax: ``` first.onMoved: console.log("first.value changed to " + first.value) ``` The [first.position](qml-qtquick-controls2-rangeslider#first.position-prop) and [second.position](qml-qtquick-controls2-rangeslider#second.position-prop) properties are expressed as fractions of the control's size, in the range `0.0 - 1.0`. The [first.visualPosition](qml-qtquick-controls2-rangeslider#first.visualPosition-prop) and [second.visualPosition](qml-qtquick-controls2-rangeslider#second.visualPosition-prop) properties are the same, except that they are reversed in a [right-to-left](qtquick-positioning-righttoleft) application. The `visualPosition` is useful for positioning the handles when styling RangeSlider. In the example above, [first.visualPosition](qml-qtquick-controls2-rangeslider#first.visualPosition-prop) will be `0.24` in a left-to-right application, and `0.76` in a right-to-left application. For a slider that allows the user to select a single value, see [Slider](qml-qtquick-controls2-slider). **See also** [Customizing RangeSlider](qtquickcontrols2-customize#customizing-rangeslider), [Input Controls](qtquickcontrols2-input), and [Focus Management in Qt Quick Controls](qtquickcontrols2-focus). Property Documentation ---------------------- ### first.handle : [Item](qml-qtquick-item) | Property | Description | | --- | --- | | value | This property holds the value of the first handle in the range `from` - `to`.If [from](qml-qtquick-controls2-rangeslider#from-prop) is greater than [to](qml-qtquick-controls2-rangeslider#to-prop), the value of the first handle must be greater than the second, and vice versa. The default value is `0.0`. | | handle | This property holds the first handle item. | | visualPosition | This property holds the visual position of the first handle.The position is expressed as a fraction of the control's size, in the range `0.0 - 1.0`. When the control is [mirrored](qml-qtquick-controls2-control#mirrored-prop), the value is equal to `1.0 - position`. This makes the value suitable for visualizing the slider, taking right-to-left support into account. | | position | This property holds the logical position of the first handle.The position is expressed as a fraction of the control's size, in the range `0.0 - 1.0`. For visualizing a slider, the right-to-left aware [visualPosition](qml-qtquick-controls2-rangeslider#first.visualPosition-prop) should be used instead. | | pressed | This property holds whether the first handle is pressed by either touch, mouse, or keys. | | hovered | This property holds whether the first handle is hovered. This property was introduced in [QtQuick](https://doc.qt.io/qt-6.2/qtquick-module.html).Controls 2.1. | | implicitHandleWidth | This property holds the implicit width of the first handle. This property was introduced in [QtQuick](https://doc.qt.io/qt-6.2/qtquick-module.html).Controls 2.5. | | implicitHandleHeight | This property holds the implicit height of the first handle. This property was introduced in [QtQuick](https://doc.qt.io/qt-6.2/qtquick-module.html).Controls 2.5. | **See also** [first.moved](qml-qtquick-controls2-rangeslider#first.moved-signal)(), [first.increase](qml-qtquick-controls2-rangeslider#first.increase-method)(), and [first.decrease](qml-qtquick-controls2-rangeslider#first.decrease-method)(). ### from : [real](qml-real) This property holds the starting value for the range. The default value is `0.0`. **See also** [to](qml-qtquick-controls2-rangeslider#to-prop), [first.value](qml-qtquick-controls2-rangeslider#first.value-prop), and [second.value](qml-qtquick-controls2-rangeslider#second.value-prop). ### [read-only, since QtQuick.Controls 2.3 (Qt 5.10)] horizontal : [bool](qml-bool) This property holds whether the slider is horizontal. This property was introduced in QtQuick.Controls 2.3 (Qt 5.10). **See also** [orientation](qml-qtquick-controls2-rangeslider#orientation-prop). ### [since QtQuick.Controls 2.2 (Qt 5.9)] live : [bool](qml-bool) This property holds whether the slider provides live updates for the [first.value](qml-qtquick-controls2-rangeslider#first.value-prop) and [second.value](qml-qtquick-controls2-rangeslider#second.value-prop) properties while the respective handles are dragged. The default value is `true`. This property was introduced in QtQuick.Controls 2.2 (Qt 5.9). **See also** [first.value](qml-qtquick-controls2-rangeslider#first.value-prop) and [second.value](qml-qtquick-controls2-rangeslider#second.value-prop). ### orientation : [enumeration](qml-enumeration) This property holds the orientation. Possible values: | Constant | Description | | --- | --- | | `Qt.Horizontal` | Horizontal (default) | | `Qt.Vertical` | Vertical | **See also** [horizontal](qml-qtquick-controls2-rangeslider#horizontal-prop) and [vertical](qml-qtquick-controls2-rangeslider#vertical-prop). ### second.handle : [Item](qml-qtquick-item) | Property | Description | | --- | --- | | value | This property holds the value of the second handle in the range `from` - `to`.If [from](qml-qtquick-controls2-rangeslider#from-prop) is greater than [to](qml-qtquick-controls2-rangeslider#to-prop), the value of the first handle must be greater than the second, and vice versa. The default value is `0.0`. | | handle | This property holds the second handle item. | | visualPosition | This property holds the visual position of the second handle.The position is expressed as a fraction of the control's size, in the range `0.0 - 1.0`. When the control is [mirrored](qml-qtquick-controls2-control#mirrored-prop), the value is equal to `1.0 - position`. This makes the value suitable for visualizing the slider, taking right-to-left support into account. | | position | This property holds the logical position of the second handle.The position is expressed as a fraction of the control's size, in the range `0.0 - 1.0`. For visualizing a slider, the right-to-left aware [visualPosition](qml-qtquick-controls2-rangeslider#second.visualPosition-prop) should be used instead. | | pressed | This property holds whether the second handle is pressed by either touch, mouse, or keys. | | hovered | This property holds whether the second handle is hovered. This property was introduced in [QtQuick](https://doc.qt.io/qt-6.2/qtquick-module.html).Controls 2.1. | | implicitHandleWidth | This property holds the implicit width of the second handle. This property was introduced in [QtQuick](https://doc.qt.io/qt-6.2/qtquick-module.html).Controls 2.5. | | implicitHandleHeight | This property holds the implicit height of the second handle. This property was introduced in [QtQuick](https://doc.qt.io/qt-6.2/qtquick-module.html).Controls 2.5. | **See also** [second.moved](qml-qtquick-controls2-rangeslider#second.moved-signal)(), [second.increase](qml-qtquick-controls2-rangeslider#second.increase-method)(), and [second.decrease](qml-qtquick-controls2-rangeslider#second.decrease-method)(). ### snapMode : [enumeration](qml-enumeration) This property holds the snap mode. The snap mode determines how the slider handles behave with regards to the [stepSize](qml-qtquick-controls2-rangeslider#stepSize-prop). Possible values: | Constant | Description | | --- | --- | | `RangeSlider.NoSnap` | The slider does not snap (default). | | `RangeSlider.SnapAlways` | The slider snaps while the handle is dragged. | | `RangeSlider.SnapOnRelease` | The slider does not snap while being dragged, but only after the handle is released. | For visual explanations of the various modes, see the [snapMode](qml-qtquick-controls2-slider#snapMode-prop) documentation of [Slider](qml-qtquick-controls2-slider). **See also** [stepSize](qml-qtquick-controls2-rangeslider#stepSize-prop). ### stepSize : [real](qml-real) This property holds the step size. The default value is `0.0`. **See also** [snapMode](qml-qtquick-controls2-rangeslider#snapMode-prop), [first.increase](qml-qtquick-controls2-rangeslider#first.increase-method)(), and [first.decrease](qml-qtquick-controls2-rangeslider#first.decrease-method)(). ### to : [real](qml-real) This property holds the end value for the range. The default value is `1.0`. **See also** [from](qml-qtquick-controls2-rangeslider#from-prop), [first.value](qml-qtquick-controls2-rangeslider#first.value-prop), and [second.value](qml-qtquick-controls2-rangeslider#second.value-prop). ### [since QtQuick.Controls 2.5 (Qt 5.12)] touchDragThreshold : qreal This property holds the threshold (in logical pixels) at which a touch drag event will be initiated. The mouse drag threshold won't be affected. The default value is `Qt.styleHints.startDragDistance`. This property was introduced in QtQuick.Controls 2.5 (Qt 5.12). **See also** [QStyleHints](qstylehints). ### [read-only, since QtQuick.Controls 2.3 (Qt 5.10)] vertical : [bool](qml-bool) This property holds whether the slider is vertical. This property was introduced in QtQuick.Controls 2.3 (Qt 5.10). **See also** [orientation](qml-qtquick-controls2-rangeslider#orientation-prop). Signal Documentation -------------------- ### `[since QtQuick.Controls 2.5]` void first.moved() This signal is emitted when either the first or second handle has been interactively moved by the user by either touch, mouse, or keys. This QML signal was introduced in QtQuick.Controls 2.5. **See also** [first](qml-qtquick-controls2-rangeslider#first-prop) and [second](qml-qtquick-controls2-rangeslider#second-prop). Method Documentation -------------------- ### void first.decrease() Decreases the value of the handle by [stepSize](qml-qtquick-controls2-rangeslider#stepSize-prop), or `0.1` if [stepSize](qml-qtquick-controls2-rangeslider#stepSize-prop) is not defined. **See also** [first](qml-qtquick-controls2-rangeslider#first-prop). ### void first.increase() Increases the value of the handle by [stepSize](qml-qtquick-controls2-rangeslider#stepSize-prop), or `0.1` if [stepSize](qml-qtquick-controls2-rangeslider#stepSize-prop) is not defined. **See also** [first](qml-qtquick-controls2-rangeslider#first-prop). ### void second.decrease() Decreases the value of the handle by [stepSize](qml-qtquick-controls2-rangeslider#stepSize-prop), or `0.1` if [stepSize](qml-qtquick-controls2-rangeslider#stepSize-prop) is not defined. **See also** [second](qml-qtquick-controls2-rangeslider#second-prop). ### void second.increase() Increases the value of the handle by [stepSize](qml-qtquick-controls2-rangeslider#stepSize-prop), or `0.1` if [stepSize](qml-qtquick-controls2-rangeslider#stepSize-prop) is not defined. **See also** [second](qml-qtquick-controls2-rangeslider#second-prop). ### void setValues([real](qml-real) *firstValue*, [real](qml-real) *secondValue*) Sets [first.value](qml-qtquick-controls2-rangeslider#first.value-prop) and [second.value](qml-qtquick-controls2-rangeslider#second.value-prop) with the given arguments. If [to](qml-qtquick-controls2-rangeslider#to-prop) is larger than [from](qml-qtquick-controls2-rangeslider#from-prop) and *firstValue* is larger than *secondValue*, firstValue will be clamped to secondValue. If [from](qml-qtquick-controls2-rangeslider#from-prop) is larger than [to](qml-qtquick-controls2-rangeslider#to-prop) and secondValue is larger than firstValue, secondValue will be clamped to firstValue. This function may be necessary to set the first and second values after the control has been completed, as there is a circular dependency between firstValue and secondValue which can cause assigned values to be clamped to each other. **See also** [stepSize](qml-qtquick-controls2-rangeslider#stepSize-prop). ### `[since QtQuick.Controls 2.5 (Qt 5.12)]` [real](qml-real) valueAt([real](qml-real) *position*) Returns the value for the given *position*. This method was introduced in QtQuick.Controls 2.5 (Qt 5.12). **See also** [first.value](qml-qtquick-controls2-rangeslider#first.value-prop), [second.value](qml-qtquick-controls2-rangeslider#second.value-prop), [first.position](qml-qtquick-controls2-rangeslider#first.position-prop), [second.position](qml-qtquick-controls2-rangeslider#second.position-prop), and [live](qml-qtquick-controls2-rangeslider#live-prop).
programming_docs
qt EnterKey QML Type EnterKey QML Type ================= Provides a property to manipulate the appearance of Enter key on an on-screen keyboard. [More...](#details) | | | | --- | --- | | Import Statement: | import QtQuick | | Since: | Qt 5.6 | * [List of all members, including inherited members](https://doc.qt.io/qt-6.2/qml-qtquick-enterkey-members.html) Attached Properties ------------------- * **[type](qml-qtquick-enterkey#type-attached-prop)** : enumeration Detailed Description -------------------- The EnterKey attached property is used to manipulate the appearance and behavior of the Enter key on an on-screen keyboard. Attached Property Documentation ------------------------------- ### EnterKey.type : [enumeration](qml-enumeration) Holds the type of the Enter key. **Note:** Not all of these values are supported on all platforms. For unsupported values the default key is used instead. | Constant | Description | | --- | --- | | `Qt.EnterKeyDefault` | The default Enter key. This can be either a button to accept the input and close the keyboard, or a *Return* button to enter a newline in case of a multi-line input field. | | `Qt.EnterKeyReturn` | Show a *Return* button that inserts a newline. | | `Qt.EnterKeyDone` | Show a *"Done"* button. Typically, the keyboard is expected to close when the button is pressed. | | `Qt.EnterKeyGo` | Show a *"Go"* button. Typically used in an address bar when entering a URL. | | `Qt.EnterKeySend` | Show a *"Send"* button. | | `Qt.EnterKeySearch` | Show a *"Search"* button. | | `Qt.EnterKeyNext` | Show a *"Next"* button. Typically used in a form to allow navigating to the next input field without the keyboard closing. | | `Qt.EnterKeyPrevious` | Show a *"Previous"* button. | qt QDBusServer Class QDBusServer Class ================= The QDBusServer class provides peer-to-peer communication between processes on the same computer. [More...](#details) | | | | --- | --- | | Header: | #include <QDBusServer> | | CMake: | find\_package(Qt6 COMPONENTS Dbus REQUIRED) target\_link\_libraries(mytarget PRIVATE Qt6::Dbus) | | qmake: | QT += dbus | | Inherits: | [QObject](qobject) | * [List of all members, including inherited members](https://doc.qt.io/qt-6.2/qdbusserver-members.html) Public Functions ---------------- | | | | --- | --- | | | **[QDBusServer](qdbusserver#QDBusServer-1)**(QObject \**parent* = nullptr) | | | **[QDBusServer](qdbusserver#QDBusServer)**(const QString &*address*, QObject \**parent* = nullptr) | | virtual | **[~QDBusServer](qdbusserver#dtor.QDBusServer)**() | | QString | **[address](qdbusserver#address)**() const | | bool | **[isAnonymousAuthenticationAllowed](qdbusserver#isAnonymousAuthenticationAllowed)**() const | | bool | **[isConnected](qdbusserver#isConnected)**() const | | QDBusError | **[lastError](qdbusserver#lastError)**() const | | void | **[setAnonymousAuthenticationAllowed](qdbusserver#setAnonymousAuthenticationAllowed)**(bool *value*) | Signals ------- | | | | --- | --- | | void | **[newConnection](qdbusserver#newConnection)**(const QDBusConnection &*connection*) | Detailed Description -------------------- Member Function Documentation ----------------------------- ### QDBusServer::QDBusServer([QObject](qobject#QObject) \**parent* = nullptr) Constructs a QDBusServer with the given *parent*. The server will listen for connections in `/tmp` (on Unix systems) or on a TCP port bound to localhost (elsewhere). ### QDBusServer::QDBusServer(const [QString](qstring) &*address*, [QObject](qobject#QObject) \**parent* = nullptr) Constructs a QDBusServer with the given *address*, and the given *parent*. ### `[signal]` void QDBusServer::newConnection(const [QDBusConnection](qdbusconnection) &*connection*) This signal is emitted when a new client connection *connection* is established to the server. ### `[virtual]` QDBusServer::~QDBusServer() Destructs a [QDBusServer](qdbusserver) ### [QString](qstring) QDBusServer::address() const Returns the address this server is associated with. ### `[since 5.3]` bool QDBusServer::isAnonymousAuthenticationAllowed() const Returns true if anonymous authentication is allowed. This function was introduced in Qt 5.3. **See also** [setAnonymousAuthenticationAllowed](qdbusserver#setAnonymousAuthenticationAllowed)(). ### bool QDBusServer::isConnected() const Returns `true` if this [QDBusServer](qdbusserver) object is connected. If it isn't connected, you need to call the constructor again. ### [QDBusError](qdbuserror) QDBusServer::lastError() const Returns the last error that happened in this server. This function is provided for low-level code. ### `[since 5.3]` void QDBusServer::setAnonymousAuthenticationAllowed(bool *value*) If *value* is set to true, an incoming connection can proceed even if the connecting client is not authenticated as a user. By default, this value is false. This function was introduced in Qt 5.3. **See also** [isAnonymousAuthenticationAllowed](qdbusserver#isAnonymousAuthenticationAllowed)(). qt <QQmlExtensionPlugin> Proxy Page <QQmlExtensionPlugin> Proxy Page ================================ Macros ------ | | | | --- | --- | | | **[Q\_IMPORT\_QML\_PLUGIN](qqmlextensionplugin-proxy#Q_IMPORT_QML_PLUGIN)**(*PluginName*) | Macro Documentation ------------------- ### Q\_IMPORT\_QML\_PLUGIN(*PluginName*) Ensures the plugin whose metadata-declaring class is named *PluginName* is linked into static builds. **See also** [Q\_IMPORT\_PLUGIN](qtplugin#Q_IMPORT_PLUGIN). qt QGregorianCalendar Class QGregorianCalendar Class ======================== The QGregorianCalendar class implements the Gregorian calendar. [More...](#details) | | | | --- | --- | | Header: | #include <QGregorianCalendar> | | CMake: | find\_package(Qt6 COMPONENTS Core REQUIRED) target\_link\_libraries(mytarget PRIVATE Qt6::Core) | | qmake: | QT += core | | Since: | Qt 5.14 | | Inherits: | [QRomanCalendar](qromancalendar) | Detailed Description -------------------- ### The Gregorian Calendar The Gregorian calendar is a refinement of the earlier Julian calendar, itself a late form of the Roman calendar. It is widely used. **See also** [QRomanCalendar](qromancalendar), [QJulianCalendar](qjuliancalendar), and [QCalendar](qcalendar). qt Sequence Class Sequence Class ============== class [QBluetoothServiceInfo](qbluetoothserviceinfo)::Sequence The Sequence class stores attributes of a Bluetooth Data Element Sequence. [More...](#details) This class was introduced in Qt 5.2. * [List of all members, including inherited members](https://doc.qt.io/qt-6.2/qbluetoothserviceinfo-sequence-members.html) Public Functions ---------------- | | | | --- | --- | | | **[Sequence](qbluetoothserviceinfo-sequence#Sequence-1)**(const QList<QVariant> &*list*) | | | **[Sequence](qbluetoothserviceinfo-sequence#Sequence)**() | Detailed Description -------------------- Member Function Documentation ----------------------------- ### Sequence::Sequence(const [QList](qlist#QList-1)<[QVariant](qvariant)> &*list*) Constructs a new sequence that is a copy of *list*. ### Sequence::Sequence() Constructs a new empty sequence. qt Joint QML Type Joint QML Type ============== Defines a node in a skeletal animation hierarchy. [More...](#details) | | | | --- | --- | | Import Statement: | import QtQuick3D | | Inherits: | [Node](qml-qtquick3d-node) | * [List of all members, including inherited members](https://doc.qt.io/qt-6.2/qml-qtquick3d-joint-members.html) Properties ---------- * **[index](qml-qtquick3d-joint#index-prop)** : int * **[skeletonRoot](qml-qtquick3d-joint#skeletonRoot-prop)** : Skeleton Detailed Description -------------------- A joint is a transformable node inside a [Skeleton](qml-qtquick3d-skeleton), used for [skeletal animation](quick3d-vertex-skinning). It is called a "joint" because it can be seen as a joint between the bones of a skeleton. All the joints must be contained inside a Skeleton, and each joint must have a [skeletonRoot](qml-qtquick3d-joint#skeletonRoot-prop) pointing back to that skeleton. ``` Skeleton { id: qmlskeleton Joint { id: joint0 index: 0 skeletonRoot: qmlskeleton Joint { id: joint1 index: 1 skeletonRoot: qmlskeleton } } } ``` Property Documentation ---------------------- ### index : [int](qml-int) Specifies the index of this joint. This index value is used in the `JointSemantic` [custom geometry attribute](qquick3dgeometry#addAttribute). **Note:** Index values must be unique within the same [Skeleton](qml-qtquick3d-skeleton). **See also** [QQuick3DGeometry::addAttribute](qquick3dgeometry#addAttribute) and [Qt Quick 3D - Simple Skinning Example](https://doc.qt.io/qt-6.2/qtquick3d-skinning-example.html). ### skeletonRoot : [Skeleton](qml-qtquick3d-skeleton) Specifies the [Skeleton](qml-qtquick3d-skeleton) that contains this joint. **Note:** All the [Joint](qml-qtquick3d-joint)s in the [Skeleton](qml-qtquick3d-skeleton) must have the same skeletonRoot. If not, the animation will be broken. **See also** [Skeleton](qml-qtquick3d-skeleton). qt QRenderCaptureReply Class QRenderCaptureReply Class ========================= class [Qt3DRender](https://doc.qt.io/qt-6.2/qt3drender-module.html)::QRenderCaptureReply Receives the result of render capture request. [More...](#details) | | | | --- | --- | | Header: | #include <Qt3DRender/QRenderCaptureReply> | | CMake: | find\_package(Qt6 COMPONENTS 3drender REQUIRED) target\_link\_libraries(mytarget PRIVATE Qt6::3drender) | | qmake: | QT += 3drender | | Since: | Qt 5.8 | | Instantiated By: | [RenderCaptureReply](qml-qt3d-render-rendercapturereply) | | Inherits: | [QObject](qobject) | * [List of all members, including inherited members](https://doc.qt.io/qt-6.2/qt3drender-qrendercapturereply-members.html) Properties ---------- * **[captureId](qt3drender-qrendercapturereply#captureId-prop)** : const int * **[complete](qt3drender-qrendercapturereply#complete-prop)** : const bool * **[image](qt3drender-qrendercapturereply#image-prop)** : const QImage Public Functions ---------------- | | | | --- | --- | | int | **[captureId](qt3drender-qrendercapturereply#captureId-prop)**() const | | QImage | **[image](qt3drender-qrendercapturereply#image-prop)**() const | | bool | **[isComplete](qt3drender-qrendercapturereply#complete-prop)**() const | | bool | **[saveImage](qt3drender-qrendercapturereply#saveImage)**(const QString &*fileName*) const | Signals ------- | | | | --- | --- | | void | **[completed](qt3drender-qrendercapturereply#complete-prop)**() | Detailed Description -------------------- An object, which receives the image from QRenderCapture::requestCapture. Property Documentation ---------------------- ### `[read-only]` captureId : const int Holds the captureId, which was passed to the renderCapture. **Access functions:** | | | | --- | --- | | int | **captureId**() const | ### `[read-only]` complete : const bool Holds the complete state of the render capture. **Access functions:** | | | | --- | --- | | bool | **isComplete**() const | **Notifier signal:** | | | | --- | --- | | void | **completed**() | ### `[read-only]` image : const [QImage](qimage) Holds the image, which was produced as a result of render capture. **Access functions:** | | | | --- | --- | | QImage | **image**() const | Member Function Documentation ----------------------------- ### `[invokable, since 5.9]` bool QRenderCaptureReply::saveImage(const [QString](qstring) &*fileName*) const Saves the render capture result as an image to *fileName*. Returns true if the image was successfully saved; otherwise returns false. **Note:** This function can be invoked via the meta-object system and from QML. See [Q\_INVOKABLE](qobject#Q_INVOKABLE). This function was introduced in Qt 5.9. qt QAccessibleTextCursorEvent Class QAccessibleTextCursorEvent Class ================================ The QAccessibleTextCursorEvent class notifies of cursor movements. [More...](#details) | | | | --- | --- | | Header: | #include <QAccessibleTextCursorEvent> | | CMake: | find\_package(Qt6 COMPONENTS Gui REQUIRED) target\_link\_libraries(mytarget PRIVATE Qt6::Gui) | | qmake: | QT += gui | | Inherits: | [QAccessibleEvent](qaccessibleevent) | | Inherited By: | [QAccessibleTextInsertEvent](qaccessibletextinsertevent), [QAccessibleTextRemoveEvent](qaccessibletextremoveevent), [QAccessibleTextSelectionEvent](qaccessibletextselectionevent), and [QAccessibleTextUpdateEvent](qaccessibletextupdateevent) | * [List of all members, including inherited members](https://doc.qt.io/qt-6.2/qaccessibletextcursorevent-members.html) Public Functions ---------------- | | | | --- | --- | | | **[QAccessibleTextCursorEvent](qaccessibletextcursorevent#QAccessibleTextCursorEvent-1)**(QAccessibleInterface \**iface*, int *cursorPos*) | | | **[QAccessibleTextCursorEvent](qaccessibletextcursorevent#QAccessibleTextCursorEvent)**(QObject \**object*, int *cursorPos*) | | int | **[cursorPosition](qaccessibletextcursorevent#cursorPosition)**() const | | void | **[setCursorPosition](qaccessibletextcursorevent#setCursorPosition)**(int *position*) | Detailed Description -------------------- This class is used with [QAccessible::updateAccessibility](qaccessible#updateAccessibility)(). Member Function Documentation ----------------------------- ### QAccessibleTextCursorEvent::QAccessibleTextCursorEvent([QAccessibleInterface](qaccessibleinterface) \**iface*, int *cursorPos*) Create a new QAccessibleTextCursorEvent for *iface*, The *cursorPos* is the new cursor position. ### QAccessibleTextCursorEvent::QAccessibleTextCursorEvent([QObject](qobject) \**object*, int *cursorPos*) Create a new QAccessibleTextCursorEvent for *object*. The *cursorPos* is the new cursor position. ### int QAccessibleTextCursorEvent::cursorPosition() const Returns the cursor position. **See also** [setCursorPosition](qaccessibletextcursorevent#setCursorPosition)(). ### void QAccessibleTextCursorEvent::setCursorPosition(int *position*) Sets the cursor *position* for this event. **See also** [cursorPosition](qaccessibletextcursorevent#cursorPosition)(). qt MouseEvent QML Type MouseEvent QML Type =================== Provides parameters that describe a mouse event. [More...](#details) | | | | --- | --- | | Import Statement: | import Qt3D.Input | | Since: | Qt 5.5 | | Instantiates: | [QMouseEvent](qt3dinput-qmouseevent) | * [List of all members, including inherited members](https://doc.qt.io/qt-6.2/qml-qt3d-input-mouseevent-members.html) Properties ---------- * **[accepted](qml-qt3d-input-mouseevent#accepted-prop)** : bool * **[button](qml-qt3d-input-mouseevent#button-prop)** : Buttons * **[buttons](qml-qt3d-input-mouseevent#buttons-prop)** : int * **[modifiers](qml-qt3d-input-mouseevent#modifiers-prop)** : Modifiers * **[wasHeld](qml-qt3d-input-mouseevent#wasHeld-prop)** : bool * **[x](qml-qt3d-input-mouseevent#x-prop)** : int * **[y](qml-qt3d-input-mouseevent#y-prop)** : int Detailed Description -------------------- Mouse events occur when a mouse button is pressed and the ray traversing the view, originating from the mouse position intersects with one or more elements of the scene. **See also** [KeyEvent](qml-qt3d-input-keyevent), [WheelEvent](qml-qt3d-input-wheelevent), and [MouseHandler](qml-qt3d-input-mousehandler). Property Documentation ---------------------- ### accepted : [bool](qml-bool) Specifies if the mouse event has been accepted ### [read-only] button : Buttons Specifies the button triggering the mouse event ### [read-only] buttons : [int](qml-int) Specifies the button triggering the mouse event ### [read-only] modifiers : Modifiers Specifies if any modifiers were applied to the mouse event ### [read-only] wasHeld : [bool](qml-bool) Specifies if a mouse button was held down during the mouse event ### [read-only] x : [int](qml-int) Specifies The X coordinate of the mouse event ### [read-only] y : [int](qml-int) Specifies The Y coordinate of the mouse event qt QSensorManager Class QSensorManager Class ==================== The QSensorManager class handles registration and creation of sensor backends. [More...](#details) | | | | --- | --- | | Header: | #include <QSensorManager> | | CMake: | find\_package(Qt6 COMPONENTS Sensors REQUIRED) target\_link\_libraries(mytarget PRIVATE Qt6::Sensors) | | qmake: | QT += sensors | * [List of all members, including inherited members](https://doc.qt.io/qt-6.2/qsensormanager-members.html) Static Public Members --------------------- | | | | --- | --- | | QSensorBackend \* | **[createBackend](qsensormanager#createBackend)**(QSensor \**sensor*) | | bool | **[isBackendRegistered](qsensormanager#isBackendRegistered)**(const QByteArray &*type*, const QByteArray &*identifier*) | | void | **[registerBackend](qsensormanager#registerBackend)**(const QByteArray &*type*, const QByteArray &*identifier*, QSensorBackendFactory \**factory*) | | void | **[setDefaultBackend](qsensormanager#setDefaultBackend)**(const QByteArray &*type*, const QByteArray &*identifier*) | | void | **[unregisterBackend](qsensormanager#unregisterBackend)**(const QByteArray &*type*, const QByteArray &*identifier*) | Detailed Description -------------------- Sensor plugins register backends using the [registerBackend](qsensormanager#registerBackend)() function. When [QSensor::connectToBackend](qsensor#connectToBackend)() is called, the [createBackend](qsensormanager#createBackend)() function will be called. Member Function Documentation ----------------------------- ### `[static]` [QSensorBackend](qsensorbackend) \*QSensorManager::createBackend([QSensor](qsensor) \**sensor*) Create a backend for *sensor*. Returns null if no suitable backend exists. ### `[static]` bool QSensorManager::isBackendRegistered(const [QByteArray](qbytearray) &*type*, const [QByteArray](qbytearray) &*identifier*) Returns true if the backend identified by *type* and *identifier* is registered. This is a convenience method that helps out plugins doing dynamic registration. ### `[static]` void QSensorManager::registerBackend(const [QByteArray](qbytearray) &*type*, const [QByteArray](qbytearray) &*identifier*, [QSensorBackendFactory](qsensorbackendfactory) \**factory*) Register a sensor for *type*. The *identifier* must be unique. The *factory* will be asked to create instances of the backend. Sensor identifiers starting with `generic` or `dummy` are given lower priority when choosing the default sensor if other sensors are found. ### `[static]` void QSensorManager::setDefaultBackend(const [QByteArray](qbytearray) &*type*, const [QByteArray](qbytearray) &*identifier*) Sets or overwrite the sensor *type* with the backend *identifier*. ### `[static]` void QSensorManager::unregisterBackend(const [QByteArray](qbytearray) &*type*, const [QByteArray](qbytearray) &*identifier*) Unregister the backend for *type* with *identifier*. Note that this only prevents new instance of the backend from being created. It does not invalidate the existing instances of the backend. The backend code should handle the disappearance of the underlying hardware itself. qt Colorize QML Type Colorize QML Type ================= Sets the color in the HSL color space. [More...](#details) | | | | --- | --- | | Import Statement: | import Qt5Compat.GraphicalEffects | | Since: | QtGraphicalEffects 1.0 | | Inherits: | [Item](qml-qtquick-item) | * [List of all members, including inherited members](https://doc.qt.io/qt-6.2/qml-qt5compat-graphicaleffects-colorize-members.html) Properties ---------- * **[cached](qml-qt5compat-graphicaleffects-colorize#cached-prop)** : bool * **[hue](qml-qt5compat-graphicaleffects-colorize#hue-prop)** : real * **[lightness](qml-qt5compat-graphicaleffects-colorize#lightness-prop)** : real * **[saturation](qml-qt5compat-graphicaleffects-colorize#saturation-prop)** : real * **[source](qml-qt5compat-graphicaleffects-colorize#source-prop)** : variant Detailed Description -------------------- The effect is similar to what happens when a colorized glass is put on top of a grayscale image. Colorize uses the hue, saturation, and lightness (HSL) color space. You can specify a desired value for each property. You can shift all HSL values with the [HueSaturation](qml-qt5compat-graphicaleffects-huesaturation) effect. Alternatively, you can use the [ColorOverlay](qml-qt5compat-graphicaleffects-coloroverlay) effect to colorize the source item in the RGBA color space. | Source | Effect applied | | --- | --- | | | | Example ------- The following example shows how to apply the effect. ``` import QtQuick import Qt5Compat.GraphicalEffects Item { width: 300 height: 300 Image { id: bug source: "images/bug.jpg" sourceSize: Qt.size(parent.width, parent.height) smooth: true visible: false } Colorize { anchors.fill: bug source: bug hue: 0.0 saturation: 0.5 lightness: -0.2 } } ``` Property Documentation ---------------------- ### cached : [bool](qml-bool) This property allows the effect output pixels to be cached in order to improve the rendering performance. Every time the source or effect properties are changed, the pixels in the cache must be updated. Memory consumption is increased, because an extra buffer of memory is required for storing the effect output. It is recommended to disable the cache when the source or the effect properties are animated. By default, the property is set to `false`. ### hue : [real](qml-real) This property defines the hue value which is used to colorize the source. The value ranges from 0.0 to 1.0. By default, the property is set to `0.0`, which produces a slightly red color. | Allowed hue values | | --- | | | | Output examples with different hue values | | | | --- | --- | --- | | | | | | **hue: 0.2** | **hue: 0.5** | **hue: 0.8** | | [saturation](qml-qt5compat-graphicaleffects-colorize#saturation-prop): 1 | [saturation](qml-qt5compat-graphicaleffects-colorize#saturation-prop): 1 | [saturation](qml-qt5compat-graphicaleffects-colorize#saturation-prop): 1 | | [lightness](qml-qt5compat-graphicaleffects-colorize#lightness-prop): 0 | [lightness](qml-qt5compat-graphicaleffects-colorize#lightness-prop): 0 | [lightness](qml-qt5compat-graphicaleffects-colorize#lightness-prop): 0 | ### lightness : [real](qml-real) This property defines how much the source lightness value is increased or decreased. Unlike hue and saturation properties, lightness does not set the used value, but it shifts the existing source pixel lightness value. The value ranges from -1.0 (decreased) to 1.0 (increased). By default, the property is set to `0.0` (no change). | Output examples with different lightness values | | | | --- | --- | --- | | | | | | **lightness: -0.75** | **lightness: 0** | **lightness: 0.75** | | [hue](qml-qt5compat-graphicaleffects-colorize#hue-prop): 0 | [hue](qml-qt5compat-graphicaleffects-colorize#hue-prop): 0 | [hue](qml-qt5compat-graphicaleffects-colorize#hue-prop): 0 | | [saturation](qml-qt5compat-graphicaleffects-colorize#saturation-prop): 1 | [saturation](qml-qt5compat-graphicaleffects-colorize#saturation-prop): 1 | [saturation](qml-qt5compat-graphicaleffects-colorize#saturation-prop): 1 | ### saturation : [real](qml-real) This property defines the saturation value which is used to colorize the source. The value ranges from 0.0 (desaturated) to 1.0 (saturated). By default, the property is set to `1.0` (saturated). | Output examples with different saturation values | | | | --- | --- | --- | | | | | | **saturation: 0** | **saturation: 0.5** | **saturation: 1** | | [hue](qml-qt5compat-graphicaleffects-colorize#hue-prop): 0 | [hue](qml-qt5compat-graphicaleffects-colorize#hue-prop): 0 | [hue](qml-qt5compat-graphicaleffects-colorize#hue-prop): 0 | | [lightness](qml-qt5compat-graphicaleffects-colorize#lightness-prop): 0 | [lightness](qml-qt5compat-graphicaleffects-colorize#lightness-prop): 0 | [lightness](qml-qt5compat-graphicaleffects-colorize#lightness-prop): 0 | ### source : variant This property defines the source item that provides the source pixels for the effect. **Note:** It is not supported to let the effect include itself, for instance by setting source to the effect's parent.
programming_docs
qt QStyleOptionDockWidget Class QStyleOptionDockWidget Class ============================ The QStyleOptionDockWidget class is used to describe the parameters for drawing a dock widget. [More...](#details) | | | | --- | --- | | Header: | #include <QStyleOptionDockWidget> | | CMake: | find\_package(Qt6 COMPONENTS Widgets REQUIRED) target\_link\_libraries(mytarget PRIVATE Qt6::Widgets) | | qmake: | QT += widgets | | Inherits: | [QStyleOption](qstyleoption) | * [List of all members, including inherited members](https://doc.qt.io/qt-6.2/qstyleoptiondockwidget-members.html) Public Types ------------ | | | | --- | --- | | enum | **[StyleOptionType](qstyleoptiondockwidget#StyleOptionType-enum)** { Type } | | enum | **[StyleOptionVersion](qstyleoptiondockwidget#StyleOptionVersion-enum)** { Version } | Public Functions ---------------- | | | | --- | --- | | | **[QStyleOptionDockWidget](qstyleoptiondockwidget#QStyleOptionDockWidget-1)**(const QStyleOptionDockWidget &*other*) | | | **[QStyleOptionDockWidget](qstyleoptiondockwidget#QStyleOptionDockWidget)**() | Public Variables ---------------- | | | | --- | --- | | bool | **[closable](qstyleoptiondockwidget#closable-var)** | | bool | **[floatable](qstyleoptiondockwidget#floatable-var)** | | bool | **[movable](qstyleoptiondockwidget#movable-var)** | | QString | **[title](qstyleoptiondockwidget#title-var)** | Detailed Description -------------------- QStyleOptionDockWidget contains all the information that [QStyle](qstyle) functions need to draw graphical elements like [QDockWidget](qdockwidget). For performance reasons, there are few member functions and the access to the member variables is direct (i.e., using the `.` or `->` operator). This makes the structures straightforward to use and emphasizes that these are simply parameters used by the style functions. For an example demonstrating how style options can be used, see the [Styles](https://doc.qt.io/qt-6.2/qtwidgets-widgets-styles-example.html) example. **See also** [QStyleOption](qstyleoption). Member Type Documentation ------------------------- ### enum QStyleOptionDockWidget::StyleOptionType This enum is used to hold information about the type of the style option, and is defined for each [QStyleOption](qstyleoption) subclass. | Constant | Value | Description | | --- | --- | --- | | `QStyleOptionDockWidget::Type` | `SO_DockWidget` | The type of style option provided ([SO\_DockWidget](qstyleoption#OptionType-enum) for this class). | The type is used internally by [QStyleOption](qstyleoption), its subclasses, and [qstyleoption\_cast](qstyleoption#qstyleoption_cast)() to determine the type of style option. In general you do not need to worry about this unless you want to create your own [QStyleOption](qstyleoption) subclass and your own styles. **See also** [StyleOptionVersion](qstyleoptiondockwidget#StyleOptionVersion-enum). ### enum QStyleOptionDockWidget::StyleOptionVersion This enum is used to hold information about the version of the style option, and is defined for each [QStyleOption](qstyleoption) subclass. | Constant | Value | Description | | --- | --- | --- | | `QStyleOptionDockWidget::Version` | `1` | 2 | The version is used by [QStyleOption](qstyleoption) subclasses to implement extensions without breaking compatibility. If you use [qstyleoption\_cast](qstyleoption#qstyleoption_cast)(), you normally do not need to check it. **See also** [StyleOptionType](qstyleoptiondockwidget#StyleOptionType-enum). Member Function Documentation ----------------------------- ### QStyleOptionDockWidget::QStyleOptionDockWidget(const [QStyleOptionDockWidget](qstyleoptiondockwidget#QStyleOptionDockWidget) &*other*) Constructs a copy of the *other* style option. ### QStyleOptionDockWidget::QStyleOptionDockWidget() Constructs a QStyleOptionDockWidget, initializing the member variables to their default values. Member Variable Documentation ----------------------------- ### bool QStyleOptionDockWidget::closable This variable holds whether the dock window is closable The default value is true. ### bool QStyleOptionDockWidget::floatable This variable holds whether the dock window is floatable The default value is true. ### bool QStyleOptionDockWidget::movable This variable holds whether the dock window is movable The default value is false. ### [QString](qstring) QStyleOptionDockWidget::title This variable holds the title of the dock window The default value is an empty string. qt Declaring Slots in D-Bus Adaptors Declaring Slots in D-Bus Adaptors ================================= Slots in D-Bus adaptors are declared just like normal, public slots, but their parameters must follow certain rules (see [The Qt D-Bus Type System](qdbustypesystem) for more information). Slots whose parameters do not follow those rules or that are not public will not be accessible via D-Bus. Slots can have one parameter of type `const QDBusMessage &`, which must appear at the end of the input parameter list, before any output parameters. This parameter, if present, will be initialized with a copy of the current message being processed, which allows the callee to obtain information about the caller, such as its connection name. Slots can be of three kinds: 1. Asynchronous 2. Input-only 3. Input-and-output Asynchronous Slots ------------------ Asynchronous slots are those that do not normally return any reply to the caller. For that reason, they cannot take any output parameters. In most cases, by the time the first line of the slot is run, the caller function has already resumed working. However, slots must not rely on that behavior. Scheduling and message-dispatching issues could change the order in which the slot is run. Code intending to synchronize with the caller should provide its own method of synchronization. Asynchronous slots are marked by the keyword [Q\_NOREPLY](qdbusabstractadaptor#Q_NOREPLY) in the method signature, before the `void` return type and the slot name. The `quit()` slot in the [D-Bus Complex Ping Pong Example](https://doc.qt.io/qt-6.2/qtdbus-complexpingpong-example.html) is an example of this. Input-Only Slots ---------------- Input-only slots are normal slots that take parameters passed by value or by constant reference. However, unlike asynchronous slots, the caller is usually waiting for completion of the callee before resuming operation. Therefore, non-asynchronous slots should not block or should state it its documentation that they may do so. Input-only slots have no special marking in their signature, except that they take only parameters passed by value or by constant reference. Optionally, slots can take a [QDBusMessage](qdbusmessage) parameter as a last parameter, which can be used to perform additional analysis of the method call message. Input and Output Slots ---------------------- Like input-only slots, input-and-output slots are those that the caller is waiting for a reply. Unlike input-only ones, though, this reply will contain data. Slots that output data may contain non-constant references and may return a value as well. However, the output parameters must all appear at the end of the argument list and may not have input arguments interleaved. Optionally, a [QDBusMessage](qdbusmessage) argument may appear between the input and the output arguments. Automatic Replies ----------------- Method replies are generated automatically with the contents of the output parameters (if there were any) by the Qt D-Bus implementation. Slots need not worry about constructing proper [QDBusMessage](qdbusmessage) objects and sending them over the connection. However, the possibility of doing so remains there. Should the slot find out it needs to send a special reply or even an error, it can do so by using [QDBusMessage::createReply](qdbusmessage#createReply)() or [QDBusMessage::createErrorReply](qdbusmessage#createErrorReply)() on the [QDBusMessage](qdbusmessage) parameter and send it with [QDBusConnection::send](qdbusconnection#send)(). The Qt D-Bus implementation will not generate any reply if the slot did so. **Warning:** When a caller places a method call and waits for a reply, it will only wait for a limited amount of time. Slots intending to take a long time to complete should make that fact clear in documentation so that callers properly set higher timeouts. Delayed Replies --------------- In some circumstances, the called slot may not be able to process the request immediately. This is frequently the case when the request involves an I/O or networking operation which may block. If this is the case, the slot should return control to the application's main loop to avoid freezing the user interface, and resume the process later. To accomplish this, it should make use of the extra `QDBusMessage` parameter at the end of the input parameter list and request a delayed reply. We do this by writing a slot that stores the request data in a persistent structure, indicating to the caller using [QDBusMessage::setDelayedReply](qdbusmessage#setDelayedReply)(true) that the response will be sent later. ``` struct RequestData { QString request; QString processedData; QDBusMessage reply; }; QString processRequest(const QString &request, const QDBusMessage &message) { RequestData *data = new RequestData; data->request = request; message.setDelayedReply(true); data->reply = message.createReply(); appendRequest(data); return QString(); } ``` In this case, the return value is unimportant; we return an arbitrary value to satisfy the compiler. When the request is processed and a reply is available, it should be sent using the `QDBusMessage` object that was obtained. In our example, the reply code could be something as follows: ``` void sendReply(RequestData *data) { // data->processedData has been initialized with the request's reply QDBusMessage &reply = data->reply; // send the reply over D-Bus: reply << data->processedData; QDBusConnection::sessionBus().send(reply); // dispose of the transaction data delete data; } ``` As can be seen in the example, when a delayed reply is in place, the return value(s) from the slot will be ignored by Qt D-Bus. They are used only to determine the slot's signature when communicating the adaptor's description to remote applications, or in case the code in the slot decides not to use a delayed reply. The delayed reply itself is requested from Qt D-Bus by calling QDBusMessage::reply() on the original message. It then becomes the responsibility of the called code to eventually send a reply to the caller. **Warning:** When a caller places a method call and waits for a reply, it will only wait for a limited amount of time. Slots intending to take a long time to complete should make that fact clear in documentation so that callers properly set higher timeouts. **See also** [Using Qt D-Bus Adaptors](usingadaptors), [Declaring Signals in D-Bus Adaptors](qdbusdeclaringsignals), [The Qt D-Bus Type System](qdbustypesystem), [QDBusConnection](qdbusconnection), and [QDBusMessage](qdbusmessage). qt QScxmlInvokableServiceFactory Class QScxmlInvokableServiceFactory Class =================================== The QScxmlInvokableServiceFactory class creates invokable service instances. [More...](#details) | | | | --- | --- | | Header: | #include <QScxmlInvokableServiceFactory> | | CMake: | find\_package(Qt6 COMPONENTS Scxml REQUIRED) target\_link\_libraries(mytarget PRIVATE Qt6::Scxml) | | qmake: | QT += scxml | | Since: | Qt 5.8 | | Inherits: | [QObject](qobject) | | Inherited By: | [QScxmlDynamicScxmlServiceFactory](qscxmldynamicscxmlservicefactory) and [QScxmlStaticScxmlServiceFactory](qscxmlstaticscxmlservicefactory) | * [List of all members, including inherited members](https://doc.qt.io/qt-6.2/qscxmlinvokableservicefactory-members.html) Properties ---------- * **[invokeInfo](qscxmlinvokableservicefactory#invokeInfo-prop)** : const QScxmlExecutableContent::InvokeInfo * **[names](qscxmlinvokableservicefactory#names-prop)** : const QList<QScxmlExecutableContent::StringId> * **[parameters](qscxmlinvokableservicefactory#parameters-prop)** : const QList<QScxmlExecutableContent::ParameterInfo> Public Functions ---------------- | | | | --- | --- | | virtual QScxmlInvokableService \* | **[invoke](qscxmlinvokableservicefactory#invoke)**(QScxmlStateMachine \**parentStateMachine*) = 0 | | const QScxmlExecutableContent::InvokeInfo & | **[invokeInfo](qscxmlinvokableservicefactory#invokeInfo-prop)**() const | | const QList<QScxmlExecutableContent::StringId> & | **[names](qscxmlinvokableservicefactory#names-prop)**() const | | const QList<QScxmlExecutableContent::ParameterInfo> & | **[parameters](qscxmlinvokableservicefactory#parameters-prop)**() const | Detailed Description -------------------- Each service instance represents an `<invoke>` element in the SCXML document. Each time the service is actually invoked, a new instance of [QScxmlInvokableService](qscxmlinvokableservice) is created. Property Documentation ---------------------- ### `[read-only]` invokeInfo : const [QScxmlExecutableContent::InvokeInfo](qscxmlexecutablecontent-invokeinfo) This property holds the [QScxmlExecutableContent::InvokeInfo](qscxmlexecutablecontent-invokeinfo) passed to the constructor. **Access functions:** | | | | --- | --- | | const QScxmlExecutableContent::InvokeInfo & | **invokeInfo**() const | ### `[read-only]` names : const [QList](qlist)<[QScxmlExecutableContent::StringId](qscxmlexecutablecontent#StringId-typedef)> This property holds the names passed to the constructor. **Access functions:** | | | | --- | --- | | const QList<QScxmlExecutableContent::StringId> & | **names**() const | ### `[read-only]` parameters : const [QList](qlist)<[QScxmlExecutableContent::ParameterInfo](qscxmlexecutablecontent-parameterinfo)> This property holds the parameters passed to the constructor. **Access functions:** | | | | --- | --- | | const QList<QScxmlExecutableContent::ParameterInfo> & | **parameters**() const | Member Function Documentation ----------------------------- ### `[pure virtual]` [QScxmlInvokableService](qscxmlinvokableservice) \*QScxmlInvokableServiceFactory::invoke([QScxmlStateMachine](qscxmlstatemachine) \**parentStateMachine*) Invokes the service with the parameters given in the constructor, passing *parentStateMachine* as the parent. Returns the new invokable service. qt QScrollEvent Class QScrollEvent Class ================== The QScrollEvent class is sent when scrolling. [More...](#details) | | | | --- | --- | | Header: | #include <QScrollEvent> | | CMake: | find\_package(Qt6 COMPONENTS Gui REQUIRED) target\_link\_libraries(mytarget PRIVATE Qt6::Gui) | | qmake: | QT += gui | | Inherits: | [QEvent](qevent) | * [List of all members, including inherited members](https://doc.qt.io/qt-6.2/qscrollevent-members.html) Public Types ------------ | | | | --- | --- | | enum | **[ScrollState](qscrollevent#ScrollState-enum)** { ScrollStarted, ScrollUpdated, ScrollFinished } | Public Functions ---------------- | | | | --- | --- | | | **[QScrollEvent](qscrollevent#QScrollEvent-2)**(const QPointF &*contentPos*, const QPointF &*overshootDistance*, QScrollEvent::ScrollState *scrollState*) | | virtual | **[~QScrollEvent](qscrollevent#dtor.QScrollEvent)**() | | QPointF | **[contentPos](qscrollevent#contentPos)**() const | | QPointF | **[overshootDistance](qscrollevent#overshootDistance)**() const | | QScrollEvent::ScrollState | **[scrollState](qscrollevent#scrollState)**() const | Detailed Description -------------------- The scroll event is sent to indicate that the receiver should be scrolled. Usually the receiver should be something visual like [QWidget](qwidget) or [QGraphicsObject](qgraphicsobject). Some care should be taken that no conflicting QScrollEvents are sent from two sources. Using [QScroller::scrollTo](qscroller#scrollTo) is save however. **See also** [QScrollPrepareEvent](qscrollprepareevent) and [QScroller](qscroller). Member Type Documentation ------------------------- ### enum QScrollEvent::ScrollState This enum describes the states a scroll event can have. | Constant | Value | Description | | --- | --- | --- | | `QScrollEvent::ScrollStarted` | `0` | Set for the first scroll event of a scroll activity. | | `QScrollEvent::ScrollUpdated` | `1` | Set for all but the first and the last scroll event of a scroll activity. | | `QScrollEvent::ScrollFinished` | `2` | Set for the last scroll event of a scroll activity. | **See also** [QScrollEvent::scrollState](qscrollevent#scrollState)(). Member Function Documentation ----------------------------- ### QScrollEvent::QScrollEvent(const [QPointF](qpointf) &*contentPos*, const [QPointF](qpointf) &*overshootDistance*, [QScrollEvent::ScrollState](qscrollevent#ScrollState-enum) *scrollState*) Creates a new QScrollEvent *contentPos* is the new content position, *overshootDistance* is the new overshoot distance while *scrollState* indicates if this scroll event is the first one, the last one or some event in between. ### `[virtual]` QScrollEvent::~QScrollEvent() Destroys [QScrollEvent](qscrollevent). ### [QPointF](qpointf) QScrollEvent::contentPos() const Returns the new scroll position. ### [QPointF](qpointf) QScrollEvent::overshootDistance() const Returns the new overshoot distance. See [QScroller](qscroller) for an explanation of the term overshoot. **See also** [QScroller](qscroller). ### [QScrollEvent::ScrollState](qscrollevent#ScrollState-enum) QScrollEvent::scrollState() const Returns the current scroll state as a combination of ScrollStateFlag values. [ScrollStarted](qscrollevent#ScrollState-enum) (or [ScrollFinished](qscrollevent#ScrollState-enum)) will be set, if this scroll event is the first (or last) event in a scrolling activity. Please note that both values can be set at the same time, if the activity consists of a single [QScrollEvent](qscrollevent). All other scroll events in between will have their state set to [ScrollUpdated](qscrollevent#ScrollState-enum). A widget could for example revert selections when scrolling is started and stopped. qt qtgui.qdocconf qtgui.qdocconf ============== ``` include($QT_INSTALL_DOCS/global/qt-module-defaults.qdocconf) project = QtGui description = Qt GUI Reference Documentation version = $QT_VERSION examplesinstallpath = gui qhp.projects = QtGui qhp.QtGui.file = qtgui.qhp qhp.QtGui.namespace = org.qt-project.qtgui.$QT_VERSION_TAG qhp.QtGui.virtualFolder = qtgui qhp.QtGui.indexTitle = Qt GUI qhp.QtGui.indexRoot = qhp.QtGui.filterAttributes = qtgui $QT_VERSION qtrefdoc qhp.QtGui.customFilters.Qt.name = Qtgui $QT_VERSION qhp.QtGui.customFilters.Qt.filterAttributes = qtgui $QT_VERSION qhp.QtGui.subprojects = classes qhp.QtGui.subprojects.classes.title = C++ Classes qhp.QtGui.subprojects.classes.indexTitle = Qt GUI C++ Classes qhp.QtGui.subprojects.classes.selectors = class fake:headerfile qhp.QtGui.subprojects.classes.sortPages = true tagfile = ../../../doc/qtgui/qtgui.tags depends += \ qtcore \ qtnetwork \ qtopengl \ qtsvg \ qtqml \ qtquick \ qtwidgets \ qtdoc headerdirs += .. sourcedirs += .. \ ../../../examples/gui/doc/src exampledirs += ../../../examples/gui \ snippets imagedirs += images \ ../../../examples/gui/doc/images \ ../../../doc/src/images \ ``` qt ANDROID_SDK_ROOT ANDROID\_SDK\_ROOT ================== Location of the Android SDK. **Note:** This variable is in technology preview and may change in future releases. **Note:** This variable is used only if targeting the Android platform. This specifies the location of the Android SDK when building for the Android platform. It is written out as part of the deployment settings for a target. **See also** [qt\_android\_generate\_deployment\_settings()](https://doc.qt.io/qt-6.2/qt-android-generate-deployment-settings.html#qt6-android-generate-deployment-settings).
programming_docs
qt QAreaLegendMarker Class QAreaLegendMarker Class ======================= The QAreaLegendMarker class is a legend marker for an area series. [More...](#details) | | | | --- | --- | | Header: | #include <QAreaLegendMarker> | | Inherits: | [QLegendMarker](qlegendmarker) | * [List of all members, including inherited members](https://doc.qt.io/qt-6.2/qarealegendmarker-members.html) Public Functions ---------------- | | | | --- | --- | | virtual | **[~QAreaLegendMarker](qarealegendmarker#dtor.QAreaLegendMarker)**() | Reimplemented Public Functions ------------------------------ | | | | --- | --- | | virtual QAreaSeries \* | **[series](qarealegendmarker#series)**() override | | virtual QLegendMarker::LegendMarkerType | **[type](qarealegendmarker#type)**() override | Detailed Description -------------------- An area legend marker is related to a [QAreaSeries](qareaseries) object, so that one area series results in one marker. **See also** [QLegend](qlegend) and [QAreaSeries](qareaseries). Member Function Documentation ----------------------------- ### `[virtual]` QAreaLegendMarker::~QAreaLegendMarker() Removes the legend marker for an area series. ### `[override virtual]` [QAreaSeries](qareaseries) \*QAreaLegendMarker::series() Reimplements: [QLegendMarker::series](qlegendmarker#series)(). ### `[override virtual]` [QLegendMarker::LegendMarkerType](qlegendmarker#LegendMarkerType-enum) QAreaLegendMarker::type() Reimplements: [QLegendMarker::type](qlegendmarker#type)(). qt QEasingCurve Class QEasingCurve Class ================== The QEasingCurve class provides easing curves for controlling animation. [More...](#details) | | | | --- | --- | | Header: | #include <QEasingCurve> | | CMake: | find\_package(Qt6 COMPONENTS Core REQUIRED) target\_link\_libraries(mytarget PRIVATE Qt6::Core) | | qmake: | QT += core | * [List of all members, including inherited members](https://doc.qt.io/qt-6.2/qeasingcurve-members.html) Public Types ------------ | | | | --- | --- | | | **[EasingFunction](qeasingcurve#EasingFunction-typedef)** | | enum | **[Type](qeasingcurve#Type-enum)** { Linear, InQuad, OutQuad, InOutQuad, OutInQuad, …, Custom } | Public Functions ---------------- | | | | --- | --- | | | **[QEasingCurve](qeasingcurve#QEasingCurve-2)**(QEasingCurve &&*other*) | | | **[QEasingCurve](qeasingcurve#QEasingCurve-1)**(const QEasingCurve &*other*) | | | **[QEasingCurve](qeasingcurve#QEasingCurve)**(QEasingCurve::Type *type* = Linear) | | QEasingCurve & | **[operator=](qeasingcurve#operator-eq-1)**(QEasingCurve &&*other*) | | QEasingCurve & | **[operator=](qeasingcurve#operator-eq)**(const QEasingCurve &*other*) | | | **[~QEasingCurve](qeasingcurve#dtor.QEasingCurve)**() | | void | **[addCubicBezierSegment](qeasingcurve#addCubicBezierSegment)**(const QPointF &*c1*, const QPointF &*c2*, const QPointF &*endPoint*) | | void | **[addTCBSegment](qeasingcurve#addTCBSegment)**(const QPointF &*nextPoint*, qreal *t*, qreal *c*, qreal *b*) | | qreal | **[amplitude](qeasingcurve#amplitude)**() const | | QEasingCurve::EasingFunction | **[customType](qeasingcurve#customType)**() const | | qreal | **[overshoot](qeasingcurve#overshoot)**() const | | qreal | **[period](qeasingcurve#period)**() const | | void | **[setAmplitude](qeasingcurve#setAmplitude)**(qreal *amplitude*) | | void | **[setCustomType](qeasingcurve#setCustomType)**(QEasingCurve::EasingFunction *func*) | | void | **[setOvershoot](qeasingcurve#setOvershoot)**(qreal *overshoot*) | | void | **[setPeriod](qeasingcurve#setPeriod)**(qreal *period*) | | void | **[setType](qeasingcurve#setType)**(QEasingCurve::Type *type*) | | void | **[swap](qeasingcurve#swap)**(QEasingCurve &*other*) | | QList<QPointF> | **[toCubicSpline](qeasingcurve#toCubicSpline)**() const | | QEasingCurve::Type | **[type](qeasingcurve#type)**() const | | qreal | **[valueForProgress](qeasingcurve#valueForProgress)**(qreal *progress*) const | | bool | **[operator!=](qeasingcurve#operator-not-eq)**(const QEasingCurve &*other*) const | | bool | **[operator==](qeasingcurve#operator-eq-eq)**(const QEasingCurve &*other*) const | Related Non-Members ------------------- | | | | --- | --- | | QDataStream & | **[operator<<](qeasingcurve#operator-lt-lt-2)**(QDataStream &*stream*, const QEasingCurve &*easing*) | | QDataStream & | **[operator>>](qeasingcurve#operator-gt-gt-1)**(QDataStream &*stream*, QEasingCurve &*easing*) | Detailed Description -------------------- Easing curves describe a function that controls how the speed of the interpolation between 0 and 1 should be. Easing curves allow transitions from one value to another to appear more natural than a simple constant speed would allow. The QEasingCurve class is usually used in conjunction with the [QVariantAnimation](qvariantanimation) and [QPropertyAnimation](qpropertyanimation) classes but can be used on its own. It is usually used to accelerate the interpolation from zero velocity (ease in) or decelerate to zero velocity (ease out). Ease in and ease out can also be combined in the same easing curve. To calculate the speed of the interpolation, the easing curve provides the function [valueForProgress](qeasingcurve#valueForProgress)(), where the *progress* argument specifies the progress of the interpolation: 0 is the start value of the interpolation, 1 is the end value of the interpolation. The returned value is the effective progress of the interpolation. If the returned value is the same as the input value for all input values the easing curve is a linear curve. This is the default behaviour. For example, ``` QEasingCurve easing(QEasingCurve::InOutQuad); for (qreal t = 0.0; t < 1.0; t += 0.1) qWarning() << "Effective progress" << t << "is" << easing.valueForProgress(t); ``` will print the effective progress of the interpolation between 0 and 1. When using a [QPropertyAnimation](qpropertyanimation), the associated easing curve will be used to control the progress of the interpolation between startValue and endValue: ``` QPropertyAnimation animation; animation.setStartValue(0); animation.setEndValue(1000); animation.setDuration(1000); animation.setEasingCurve(QEasingCurve::InOutQuad); ``` The ability to set an amplitude, overshoot, or period depends on the QEasingCurve type. Amplitude access is available to curves that behave as springs such as elastic and bounce curves. Changing the amplitude changes the height of the curve. Period access is only available to elastic curves and setting a higher period slows the rate of bounce. Only curves that have "boomerang" behaviors such as the [InBack](qeasingcurve#Type-enum), [OutBack](qeasingcurve#Type-enum), [InOutBack](qeasingcurve#Type-enum), and [OutInBack](qeasingcurve#Type-enum) have overshoot settings. These curves will interpolate beyond the end points and return to the end point, acting similar to a boomerang. The [Easing Curves Example](https://doc.qt.io/qt-6.2/qtwidgets-animation-easing-example.html) contains samples of QEasingCurve types and lets you change the curve settings. Member Type Documentation ------------------------- ### QEasingCurve::EasingFunction This is a typedef for a pointer to a function with the following signature: ``` qreal myEasingFunction(qreal progress); ``` ### enum QEasingCurve::Type The type of easing curve. | Constant | Value | | --- | --- | | `QEasingCurve::Linear` | `0` | Easing curve for a linear (t) function: velocity is constant. | Constant | Value | | --- | --- | | `QEasingCurve::InQuad` | `1` | Easing curve for a quadratic (t^2) function: accelerating from zero velocity. | Constant | Value | | --- | --- | | `QEasingCurve::OutQuad` | `2` | Easing curve for a quadratic (t^2) function: decelerating to zero velocity. | Constant | Value | | --- | --- | | `QEasingCurve::InOutQuad` | `3` | Easing curve for a quadratic (t^2) function: acceleration until halfway, then deceleration. | Constant | Value | | --- | --- | | `QEasingCurve::OutInQuad` | `4` | Easing curve for a quadratic (t^2) function: deceleration until halfway, then acceleration. | Constant | Value | | --- | --- | | `QEasingCurve::InCubic` | `5` | Easing curve for a cubic (t^3) function: accelerating from zero velocity. | Constant | Value | | --- | --- | | `QEasingCurve::OutCubic` | `6` | Easing curve for a cubic (t^3) function: decelerating to zero velocity. | Constant | Value | | --- | --- | | `QEasingCurve::InOutCubic` | `7` | Easing curve for a cubic (t^3) function: acceleration until halfway, then deceleration. | Constant | Value | | --- | --- | | `QEasingCurve::OutInCubic` | `8` | Easing curve for a cubic (t^3) function: deceleration until halfway, then acceleration. | Constant | Value | | --- | --- | | `QEasingCurve::InQuart` | `9` | Easing curve for a quartic (t^4) function: accelerating from zero velocity. | Constant | Value | | --- | --- | | `QEasingCurve::OutQuart` | `10` | Easing curve for a quartic (t^4) function: decelerating to zero velocity. | Constant | Value | | --- | --- | | `QEasingCurve::InOutQuart` | `11` | Easing curve for a quartic (t^4) function: acceleration until halfway, then deceleration. | Constant | Value | | --- | --- | | `QEasingCurve::OutInQuart` | `12` | Easing curve for a quartic (t^4) function: deceleration until halfway, then acceleration. | Constant | Value | | --- | --- | | `QEasingCurve::InQuint` | `13` | Easing curve for a quintic (t^5) easing in: accelerating from zero velocity. | Constant | Value | | --- | --- | | `QEasingCurve::OutQuint` | `14` | Easing curve for a quintic (t^5) function: decelerating to zero velocity. | Constant | Value | | --- | --- | | `QEasingCurve::InOutQuint` | `15` | Easing curve for a quintic (t^5) function: acceleration until halfway, then deceleration. | Constant | Value | | --- | --- | | `QEasingCurve::OutInQuint` | `16` | Easing curve for a quintic (t^5) function: deceleration until halfway, then acceleration. | Constant | Value | | --- | --- | | `QEasingCurve::InSine` | `17` | Easing curve for a sinusoidal (sin(t)) function: accelerating from zero velocity. | Constant | Value | | --- | --- | | `QEasingCurve::OutSine` | `18` | Easing curve for a sinusoidal (sin(t)) function: decelerating to zero velocity. | Constant | Value | | --- | --- | | `QEasingCurve::InOutSine` | `19` | Easing curve for a sinusoidal (sin(t)) function: acceleration until halfway, then deceleration. | Constant | Value | | --- | --- | | `QEasingCurve::OutInSine` | `20` | Easing curve for a sinusoidal (sin(t)) function: deceleration until halfway, then acceleration. | Constant | Value | | --- | --- | | `QEasingCurve::InExpo` | `21` | Easing curve for an exponential (2^t) function: accelerating from zero velocity. | Constant | Value | | --- | --- | | `QEasingCurve::OutExpo` | `22` | Easing curve for an exponential (2^t) function: decelerating to zero velocity. | Constant | Value | | --- | --- | | `QEasingCurve::InOutExpo` | `23` | Easing curve for an exponential (2^t) function: acceleration until halfway, then deceleration. | Constant | Value | | --- | --- | | `QEasingCurve::OutInExpo` | `24` | Easing curve for an exponential (2^t) function: deceleration until halfway, then acceleration. | Constant | Value | | --- | --- | | `QEasingCurve::InCirc` | `25` | Easing curve for a circular (sqrt(1-t^2)) function: accelerating from zero velocity. | Constant | Value | | --- | --- | | `QEasingCurve::OutCirc` | `26` | Easing curve for a circular (sqrt(1-t^2)) function: decelerating to zero velocity. | Constant | Value | | --- | --- | | `QEasingCurve::InOutCirc` | `27` | Easing curve for a circular (sqrt(1-t^2)) function: acceleration until halfway, then deceleration. | Constant | Value | | --- | --- | | `QEasingCurve::OutInCirc` | `28` | Easing curve for a circular (sqrt(1-t^2)) function: deceleration until halfway, then acceleration. | Constant | Value | | --- | --- | | `QEasingCurve::InElastic` | `29` | Easing curve for an elastic (exponentially decaying sine wave) function: accelerating from zero velocity. The peak amplitude can be set with the *amplitude* parameter, and the period of decay by the *period* parameter. | Constant | Value | | --- | --- | | `QEasingCurve::OutElastic` | `30` | Easing curve for an elastic (exponentially decaying sine wave) function: decelerating to zero velocity. The peak amplitude can be set with the *amplitude* parameter, and the period of decay by the *period* parameter. | Constant | Value | | --- | --- | | `QEasingCurve::InOutElastic` | `31` | Easing curve for an elastic (exponentially decaying sine wave) function: acceleration until halfway, then deceleration. | Constant | Value | | --- | --- | | `QEasingCurve::OutInElastic` | `32` | Easing curve for an elastic (exponentially decaying sine wave) function: deceleration until halfway, then acceleration. | Constant | Value | | --- | --- | | `QEasingCurve::InBack` | `33` | Easing curve for a back (overshooting cubic function: (s+1)\*t^3 - s\*t^2) easing in: accelerating from zero velocity. | Constant | Value | | --- | --- | | `QEasingCurve::OutBack` | `34` | Easing curve for a back (overshooting cubic function: (s+1)\*t^3 - s\*t^2) easing out: decelerating to zero velocity. | Constant | Value | | --- | --- | | `QEasingCurve::InOutBack` | `35` | Easing curve for a back (overshooting cubic function: (s+1)\*t^3 - s\*t^2) easing in/out: acceleration until halfway, then deceleration. | Constant | Value | | --- | --- | | `QEasingCurve::OutInBack` | `36` | Easing curve for a back (overshooting cubic easing: (s+1)\*t^3 - s\*t^2) easing out/in: deceleration until halfway, then acceleration. | Constant | Value | | --- | --- | | `QEasingCurve::InBounce` | `37` | Easing curve for a bounce (exponentially decaying parabolic bounce) function: accelerating from zero velocity. | Constant | Value | | --- | --- | | `QEasingCurve::OutBounce` | `38` | Easing curve for a bounce (exponentially decaying parabolic bounce) function: decelerating from zero velocity. | Constant | Value | | --- | --- | | `QEasingCurve::InOutBounce` | `39` | Easing curve for a bounce (exponentially decaying parabolic bounce) function easing in/out: acceleration until halfway, then deceleration. | Constant | Value | | --- | --- | | `QEasingCurve::OutInBounce` | `40` | Easing curve for a bounce (exponentially decaying parabolic bounce) function easing out/in: deceleration until halfway, then acceleration. | Constant | Value | Description | | --- | --- | --- | | `QEasingCurve::BezierSpline` | `45` | Allows defining a custom easing curve using a cubic bezier spline | | `QEasingCurve::TCBSpline` | `46` | Allows defining a custom easing curve using a TCB spline | | `QEasingCurve::Custom` | `47` | This is returned if the user specified a custom curve type with [setCustomType](qeasingcurve#setCustomType)(). Note that you cannot call [setType](qeasingcurve#setType)() with this value, but [type](qeasingcurve#type)() can return it. | **See also** [addCubicBezierSegment](qeasingcurve#addCubicBezierSegment)() and [addTCBSegment](qeasingcurve#addTCBSegment)(). Member Function Documentation ----------------------------- ### `[since 5.2]` QEasingCurve::QEasingCurve([QEasingCurve](qeasingcurve#QEasingCurve) &&*other*) Move-constructs a QEasingCurve instance, making it point at the same object that *other* was pointing to. This function was introduced in Qt 5.2. ### QEasingCurve::QEasingCurve(const [QEasingCurve](qeasingcurve#QEasingCurve) &*other*) Construct a copy of *other*. ### QEasingCurve::QEasingCurve([QEasingCurve::Type](qeasingcurve#Type-enum) *type* = Linear) Constructs an easing curve of the given *type*. ### `[since 5.2]` [QEasingCurve](qeasingcurve#QEasingCurve) &QEasingCurve::operator=([QEasingCurve](qeasingcurve#QEasingCurve) &&*other*) Move-assigns *other* to this [QEasingCurve](qeasingcurve) instance. This function was introduced in Qt 5.2. ### [QEasingCurve](qeasingcurve#QEasingCurve) &QEasingCurve::operator=(const [QEasingCurve](qeasingcurve#QEasingCurve) &*other*) Copy *other*. ### QEasingCurve::~QEasingCurve() Destructor. ### void QEasingCurve::addCubicBezierSegment(const [QPointF](qpointf) &*c1*, const [QPointF](qpointf) &*c2*, const [QPointF](qpointf) &*endPoint*) Adds a segment of a cubic bezier spline to define a custom easing curve. It is only applicable if [type](qeasingcurve#type)() is [QEasingCurve::BezierSpline](qeasingcurve#Type-enum). Note that the spline implicitly starts at (0.0, 0.0) and has to end at (1.0, 1.0) to be a valid easing curve. *c1* and *c2* are the control points used for drawing the curve. *endPoint* is the endpoint of the curve. ### void QEasingCurve::addTCBSegment(const [QPointF](qpointf) &*nextPoint*, [qreal](qtglobal#qreal-typedef) *t*, [qreal](qtglobal#qreal-typedef) *c*, [qreal](qtglobal#qreal-typedef) *b*) Adds a segment of a TCB bezier spline to define a custom easing curve. It is only applicable if [type](qeasingcurve#type)() is [QEasingCurve::TCBSpline](qeasingcurve#Type-enum). The spline has to start explicitly at (0.0, 0.0) and has to end at (1.0, 1.0) to be a valid easing curve. The tension *t* changes the length of the tangent vector. The continuity *c* changes the sharpness in change between the tangents. The bias *b* changes the direction of the tangent vector. *nextPoint* is the sample position. All three parameters are valid between -1 and 1 and define the tangent of the control point. If all three parameters are 0 the resulting spline is a Catmull-Rom spline. The begin and endpoint always have a bias of -1 and 1, since the outer tangent is not defined. ### [qreal](qtglobal#qreal-typedef) QEasingCurve::amplitude() const Returns the amplitude. This is not applicable for all curve types. It is only applicable for bounce and elastic curves (curves of [type](qeasingcurve#type)() [QEasingCurve::InBounce](qeasingcurve#Type-enum), [QEasingCurve::OutBounce](qeasingcurve#Type-enum), [QEasingCurve::InOutBounce](qeasingcurve#Type-enum), [QEasingCurve::OutInBounce](qeasingcurve#Type-enum), [QEasingCurve::InElastic](qeasingcurve#Type-enum), [QEasingCurve::OutElastic](qeasingcurve#Type-enum), [QEasingCurve::InOutElastic](qeasingcurve#Type-enum) or [QEasingCurve::OutInElastic](qeasingcurve#Type-enum)). **See also** [setAmplitude](qeasingcurve#setAmplitude)(). ### [QEasingCurve::EasingFunction](qeasingcurve#EasingFunction-typedef) QEasingCurve::customType() const Returns the function pointer to the custom easing curve. If [type](qeasingcurve#type)() does not return [QEasingCurve::Custom](qeasingcurve#Type-enum), this function will return 0. **See also** [setCustomType](qeasingcurve#setCustomType)(). ### [qreal](qtglobal#qreal-typedef) QEasingCurve::overshoot() const Returns the overshoot. This is not applicable for all curve types. It is only applicable if [type](qeasingcurve#type)() is [QEasingCurve::InBack](qeasingcurve#Type-enum), [QEasingCurve::OutBack](qeasingcurve#Type-enum), [QEasingCurve::InOutBack](qeasingcurve#Type-enum) or [QEasingCurve::OutInBack](qeasingcurve#Type-enum). **See also** [setOvershoot](qeasingcurve#setOvershoot)(). ### [qreal](qtglobal#qreal-typedef) QEasingCurve::period() const Returns the period. This is not applicable for all curve types. It is only applicable if [type](qeasingcurve#type)() is [QEasingCurve::InElastic](qeasingcurve#Type-enum), [QEasingCurve::OutElastic](qeasingcurve#Type-enum), [QEasingCurve::InOutElastic](qeasingcurve#Type-enum) or [QEasingCurve::OutInElastic](qeasingcurve#Type-enum). **See also** [setPeriod](qeasingcurve#setPeriod)(). ### void QEasingCurve::setAmplitude([qreal](qtglobal#qreal-typedef) *amplitude*) Sets the amplitude to *amplitude*. This will set the amplitude of the bounce or the amplitude of the elastic "spring" effect. The higher the number, the higher the amplitude. **See also** [amplitude](qeasingcurve#amplitude)(). ### void QEasingCurve::setCustomType([QEasingCurve::EasingFunction](qeasingcurve#EasingFunction-typedef) *func*) Sets a custom easing curve that is defined by the user in the function *func*. The signature of the function is qreal myEasingFunction(qreal progress), where *progress* and the return value are considered to be normalized between 0 and 1. (In some cases the return value can be outside that range) After calling this function [type](qeasingcurve#type)() will return [QEasingCurve::Custom](qeasingcurve#Type-enum). *func* cannot be zero. **See also** [customType](qeasingcurve#customType)() and [valueForProgress](qeasingcurve#valueForProgress)(). ### void QEasingCurve::setOvershoot([qreal](qtglobal#qreal-typedef) *overshoot*) Sets the overshoot to *overshoot*. 0 produces no overshoot, and the default value of 1.70158 produces an overshoot of 10 percent. **See also** [overshoot](qeasingcurve#overshoot)(). ### void QEasingCurve::setPeriod([qreal](qtglobal#qreal-typedef) *period*) Sets the period to *period*. Setting a small period value will give a high frequency of the curve. A large period will give it a small frequency. **See also** [period](qeasingcurve#period)(). ### void QEasingCurve::setType([QEasingCurve::Type](qeasingcurve#Type-enum) *type*) Sets the type of the easing curve to *type*. **See also** [type](qeasingcurve#type)(). ### `[since 5.0]` void QEasingCurve::swap([QEasingCurve](qeasingcurve#QEasingCurve) &*other*) Swaps curve *other* with this curve. This operation is very fast and never fails. This function was introduced in Qt 5.0. ### `[since 5.0]` [QList](qlist)<[QPointF](qpointf)> QEasingCurve::toCubicSpline() const Returns the cubicBezierSpline that defines a custom easing curve. If the easing curve does not have a custom bezier easing curve the list is empty. This function was introduced in Qt 5.0. ### [QEasingCurve::Type](qeasingcurve#Type-enum) QEasingCurve::type() const Returns the type of the easing curve. **See also** [setType](qeasingcurve#setType)(). ### [qreal](qtglobal#qreal-typedef) QEasingCurve::valueForProgress([qreal](qtglobal#qreal-typedef) *progress*) const Return the effective progress for the easing curve at *progress*. Whereas *progress* must be between 0 and 1, the returned effective progress can be outside those bounds. For example, [QEasingCurve::InBack](qeasingcurve#Type-enum) will return negative values in the beginning of the function. ### bool QEasingCurve::operator!=(const [QEasingCurve](qeasingcurve#QEasingCurve) &*other*) const Compare this easing curve with *other* and returns `true` if they are not equal. It will also compare the properties of a curve. **See also** [operator==](qeasingcurve#operator-eq-eq)(). ### bool QEasingCurve::operator==(const [QEasingCurve](qeasingcurve#QEasingCurve) &*other*) const Compare this easing curve with *other* and returns `true` if they are equal. It will also compare the properties of a curve. Related Non-Members ------------------- ### [QDataStream](qdatastream) &operator<<([QDataStream](qdatastream) &*stream*, const [QEasingCurve](qeasingcurve#QEasingCurve) &*easing*) Writes the given *easing* curve to the given *stream* and returns a reference to the stream. **See also** [Serializing Qt Data Types](datastreamformat). ### [QDataStream](qdatastream) &operator>>([QDataStream](qdatastream) &*stream*, [QEasingCurve](qeasingcurve#QEasingCurve) &*easing*) Reads an easing curve from the given *stream* into the given *easing* curve and returns a reference to the stream. **See also** [Serializing Qt Data Types](datastreamformat).
programming_docs
qt QVariantRef Class QVariantRef Class ================= template <typename Pointer> class QVariantRef The QVariantRef acts as a non-const reference to a [QVariant](qvariant). [More...](#details) | | | | --- | --- | | Header: | #include <QVariantRef> | | CMake: | find\_package(Qt6 COMPONENTS Core REQUIRED) target\_link\_libraries(mytarget PRIVATE Qt6::Core) | | qmake: | QT += core | | Since: | Qt 6.0 | * [List of all members, including inherited members](https://doc.qt.io/qt-6.2/qvariantref-members.html) Public Functions ---------------- | | | | --- | --- | | | **[QVariantRef](qvariantref#QVariantRef)**(const Pointer \**pointer*) | | QVariantRef<Pointer> & | **[operator=](qvariantref#operator-eq-2)**(QVariantRef<Pointer> &&*value*) | | QVariantRef<Pointer> & | **[operator=](qvariantref#operator-eq-1)**(const QVariantRef<Pointer> &*value*) | | QVariantRef<Pointer> & | **[operator=](qvariantref#operator-eq)**(const QVariant &*value*) | | QVariant | **[operator QVariant](qvariantref#operator-QVariant)**() const | Detailed Description -------------------- As the generic iterators don't actually instantiate a [QVariant](qvariant) on each step, they cannot return a reference to one from operator\*(). QVariantRef provides the same functionality as an actual reference to a [QVariant](qvariant) would, but is backed by a pointer given as template parameter. The template is implemented for pointers of type QSequentialIterator and QAssociativeIterator. Member Function Documentation ----------------------------- ### QVariantRef::QVariantRef(const Pointer \**pointer*) Creates a QVariantRef from an *pointer*. ### [QVariantRef](qvariantref#QVariantRef)<Pointer> &QVariantRef::operator=([QVariantRef](qvariantref#QVariantRef)<Pointer> &&*value*) Assigns a new *value* to the value pointed to by the pointer this [QVariantRef](qvariantref) refers to. ### [QVariantRef](qvariantref#QVariantRef)<Pointer> &QVariantRef::operator=(const [QVariantRef](qvariantref#QVariantRef)<Pointer> &*value*) Assigns a new *value* to the value pointed to by the pointer this [QVariantRef](qvariantref) refers to. ### [QVariantRef](qvariantref#QVariantRef)<Pointer> &QVariantRef::operator=(const [QVariant](qvariant) &*value*) Assigns a new *value* to the value pointed to by the pointer this [QVariantRef](qvariantref) refers to. ### [QVariant](qvariant) QVariantRef::operator QVariant() const Resolves the [QVariantRef](qvariantref) to an actual [QVariant](qvariant). qt QWhatsThis Class QWhatsThis Class ================ The QWhatsThis class provides a simple description of any widget, i.e. answering the question "What's This?". [More...](#details) | | | | --- | --- | | Header: | #include <QWhatsThis> | | CMake: | find\_package(Qt6 COMPONENTS Widgets REQUIRED) target\_link\_libraries(mytarget PRIVATE Qt6::Widgets) | | qmake: | QT += widgets | * [List of all members, including inherited members](https://doc.qt.io/qt-6.2/qwhatsthis-members.html) Static Public Members --------------------- | | | | --- | --- | | QAction \* | **[createAction](qwhatsthis#createAction)**(QObject \**parent* = nullptr) | | void | **[enterWhatsThisMode](qwhatsthis#enterWhatsThisMode)**() | | void | **[hideText](qwhatsthis#hideText)**() | | bool | **[inWhatsThisMode](qwhatsthis#inWhatsThisMode)**() | | void | **[leaveWhatsThisMode](qwhatsthis#leaveWhatsThisMode)**() | | void | **[showText](qwhatsthis#showText)**(const QPoint &*pos*, const QString &*text*, QWidget \**w* = nullptr) | Detailed Description -------------------- "What's This?" help is part of an application's online help system, and provides users with information about the functionality and usage of a particular widget. "What's This?" help texts are typically longer and more detailed than [tooltips](qtooltip), but generally provide less information than that supplied by separate help windows. QWhatsThis provides a single window with an explanatory text that pops up when the user asks "What's This?". The default way for users to ask the question is to move the focus to the relevant widget and press Shift+F1. The help text appears immediately; it goes away as soon as the user does something else. (Note that if there is a shortcut for Shift+F1, this mechanism will not work.) Some dialogs provide a "?" button that users can click to enter "What's This?" mode; they then click the relevant widget to pop up the "What's This?" window. It is also possible to provide a a menu option or toolbar button to switch into "What's This?" mode. To add "What's This?" text to a widget or an action, you simply call [QWidget::setWhatsThis](qwidget#whatsThis-prop)() or [QAction::setWhatsThis](qaction#whatsThis-prop)(). The text can be either rich text or plain text. If you specify a rich text formatted string, it will be rendered using the default stylesheet, making it possible to embed images in the displayed text. To be as fast as possible, the default stylesheet uses a simple method to determine whether the text can be rendered as plain text. See [Qt::mightBeRichText](qt-sub-qtgui#mightBeRichText)() for details. ``` newAct = new QAction(tr("&New"), this); newAct->setShortcut(tr("Ctrl+N")); newAct->setStatusTip(tr("Create a new file")); newAct->setWhatsThis(tr("Click this option to create a new file.")); ``` An alternative way to enter "What's This?" mode is to call [createAction](qwhatsthis#createAction)(), and add the returned [QAction](qaction) to either a menu or a tool bar. By invoking this context help action (in the picture below, the button with the arrow and question mark icon) the user switches into "What's This?" mode. If they now click on a widget the appropriate help text is shown. The mode is left when help is given or when the user presses Esc. You can enter "What's This?" mode programmatically with [enterWhatsThisMode](qwhatsthis#enterWhatsThisMode)(), check the mode with [inWhatsThisMode](qwhatsthis#inWhatsThisMode)(), and return to normal mode with [leaveWhatsThisMode](qwhatsthis#leaveWhatsThisMode)(). If you want to control the "What's This?" behavior of a widget manually see [Qt::WA\_CustomWhatsThis](qt#WidgetAttribute-enum). It is also possible to show different help texts for different regions of a widget, by using a [QHelpEvent](qhelpevent) of type [QEvent::WhatsThis](qevent#Type-enum). Intercept the help event in your widget's [QWidget::event](qwidget#event)() function and call [QWhatsThis::showText](qwhatsthis#showText)() with the text you want to display for the position specified in [QHelpEvent::pos](qhelpevent#pos)(). If the text is rich text and the user clicks on a link, the widget also receives a [QWhatsThisClickedEvent](qwhatsthisclickedevent) with the link's reference as [QWhatsThisClickedEvent::href](qwhatsthisclickedevent#href)(). If a [QWhatsThisClickedEvent](qwhatsthisclickedevent) is handled (i.e. [QWidget::event](qwidget#event)() returns true), the help window remains visible. Call [QWhatsThis::hideText](qwhatsthis#hideText)() to hide it explicitly. **See also** [QToolTip](qtooltip). Member Function Documentation ----------------------------- ### `[static]` [QAction](qaction) \*QWhatsThis::createAction([QObject](qobject) \**parent* = nullptr) Returns a ready-made [QAction](qaction), used to invoke "What's This?" context help, with the given *parent*. The returned [QAction](qaction) provides a convenient way to let users enter "What's This?" mode. ### `[static]` void QWhatsThis::enterWhatsThisMode() This function switches the user interface into "What's This?" mode. The user interface can be switched back into normal mode by the user (e.g. by them clicking or pressing Esc), or programmatically by calling [leaveWhatsThisMode](qwhatsthis#leaveWhatsThisMode)(). When entering "What's This?" mode, a [QEvent](qevent) of type Qt::EnterWhatsThisMode is sent to all toplevel widgets. **See also** [inWhatsThisMode](qwhatsthis#inWhatsThisMode)() and [leaveWhatsThisMode](qwhatsthis#leaveWhatsThisMode)(). ### `[static]` void QWhatsThis::hideText() If a "What's This?" window is showing, this destroys it. **See also** [showText](qwhatsthis#showText)(). ### `[static]` bool QWhatsThis::inWhatsThisMode() Returns `true` if the user interface is in "What's This?" mode; otherwise returns `false`. **See also** [enterWhatsThisMode](qwhatsthis#enterWhatsThisMode)(). ### `[static]` void QWhatsThis::leaveWhatsThisMode() If the user interface is in "What's This?" mode, this function switches back to normal mode; otherwise it does nothing. When leaving "What's This?" mode, a [QEvent](qevent) of type Qt::LeaveWhatsThisMode is sent to all toplevel widgets. **See also** [enterWhatsThisMode](qwhatsthis#enterWhatsThisMode)() and [inWhatsThisMode](qwhatsthis#inWhatsThisMode)(). ### `[static]` void QWhatsThis::showText(const [QPoint](qpoint) &*pos*, const [QString](qstring) &*text*, [QWidget](qwidget) \**w* = nullptr) Shows *text* as a "What's This?" window, at global position *pos*. The optional widget argument, *w*, is used to determine the appropriate screen on multi-head systems. **See also** [hideText](qwhatsthis#hideText)(). qt SplitView QML Type SplitView QML Type ================== Lays out items with a draggable splitter between each item. [More...](#details) | | | | --- | --- | | Import Statement: | import QtQuick.Controls | | Since: | Qt 5.13 | | Inherits: | [Container](qml-qtquick-controls2-container) | * [List of all members, including inherited members](https://doc.qt.io/qt-6.2/qml-qtquick-controls2-splitview-members.html) Properties ---------- * **[handle](qml-qtquick-controls2-splitview#handle-prop)** : Component * **[orientation](qml-qtquick-controls2-splitview#orientation-prop)** : enumeration * **[resizing](qml-qtquick-controls2-splitview#resizing-prop)** : bool Attached Properties ------------------- * **[fillHeight](qml-qtquick-controls2-splitview#fillHeight-attached-prop)** : bool * **[fillWidth](qml-qtquick-controls2-splitview#fillWidth-attached-prop)** : bool * **[maximumHeight](qml-qtquick-controls2-splitview#maximumHeight-attached-prop)** : real * **[maximumWidth](qml-qtquick-controls2-splitview#maximumWidth-attached-prop)** : real * **[minimumHeight](qml-qtquick-controls2-splitview#minimumHeight-attached-prop)** : real * **[minimumWidth](qml-qtquick-controls2-splitview#minimumWidth-attached-prop)** : real * **[preferredHeight](qml-qtquick-controls2-splitview#preferredHeight-attached-prop)** : real * **[preferredWidth](qml-qtquick-controls2-splitview#preferredWidth-attached-prop)** : real * **[view](qml-qtquick-controls2-splitview#view-attached-prop)** : SplitView Methods ------- * bool **[restoreState](qml-qtquick-controls2-splitview#restoreState-method)**(*state*) * var **[saveState](qml-qtquick-controls2-splitview#saveState-method)**() Detailed Description -------------------- SplitView is a control that lays out items horizontally or vertically with a draggable splitter between each item. SplitView supports the following attached properties on items it manages: * [SplitView.minimumWidth](qml-qtquick-controls2-splitview#minimumWidth-attached-prop) * [SplitView.minimumHeight](qml-qtquick-controls2-splitview#minimumHeight-attached-prop) * [SplitView.preferredWidth](qml-qtquick-controls2-splitview#preferredWidth-attached-prop) * [SplitView.preferredHeight](qml-qtquick-controls2-splitview#preferredHeight-attached-prop) * [SplitView.maximumWidth](qml-qtquick-controls2-splitview#maximumWidth-attached-prop) * [SplitView.maximumHeight](qml-qtquick-controls2-splitview#maximumHeight-attached-prop) * [SplitView.fillWidth](qml-qtquick-controls2-splitview#fillWidth-attached-prop) (true for only one child) * [SplitView.fillHeight](qml-qtquick-controls2-splitview#fillHeight-attached-prop) (true for only one child) In addition, each handle has the following read-only attached properties: * [SplitHandle.hovered](qml-qtquick-controls2-splithandle#hovered-attached-prop) * [SplitHandle.pressed](qml-qtquick-controls2-splithandle#pressed-attached-prop) **Note:** Handles should be purely visual and not handle events, as it can interfere with their hovered and pressed states. The preferred size of items in a SplitView can be specified via [implicitWidth](qml-qtquick-item#implicitWidth-prop) and [implicitHeight](qml-qtquick-item#implicitHeight-prop) or `SplitView.preferredWidth` and `SplitView.preferredHeight`: ``` SplitView { anchors.fill: parent Item { SplitView.preferredWidth: 50 } // ... } ``` For a horizontal SplitView, it's not necessary to specify the preferred height of each item, as they will be resized to the height of the view. This applies in reverse for vertical views. When a split handle is dragged, the `SplitView.preferredWidth` or `SplitView.preferredHeight` property is overwritten, depending on the [orientation](qml-qtquick-controls2-splitview#orientation-prop) of the view. To limit the size of items in a horizontal view, use the following properties: ``` SplitView { anchors.fill: parent Item { SplitView.minimumWidth: 25 SplitView.preferredWidth: 50 SplitView.maximumWidth: 100 } // ... } ``` To limit the size of items in a vertical view, use the following properties: ``` SplitView { anchors.fill: parent orientation: Qt.Vertical Item { SplitView.minimumHeight: 25 SplitView.preferredHeight: 50 SplitView.maximumHeight: 100 } // ... } ``` There will always be one item (the fill item) in the SplitView that has `SplitView.fillWidth` set to `true` (or `SplitView.fillHeight`, if [orientation](qml-qtquick-controls2-splitview#orientation-prop) is `Qt.Vertical`). This means that the item will get all leftover space when other items have been laid out. By default, the last visible child of the SplitView will have this set, but it can be changed by explicitly setting `fillWidth` to `true` on another item. A handle can belong to the item either on the left or top side, or on the right or bottom side: * If the fill item is to the right: the handle belongs to the left item. * If the fill item is on the left: the handle belongs to the right item. To create a SplitView with three items, and let the center item get superfluous space, one could do the following: ``` SplitView { anchors.fill: parent orientation: Qt.Horizontal Rectangle { implicitWidth: 200 SplitView.maximumWidth: 400 color: "lightblue" Label { text: "View 1" anchors.centerIn: parent } } Rectangle { id: centerItem SplitView.minimumWidth: 50 SplitView.fillWidth: true color: "lightgray" Label { text: "View 2" anchors.centerIn: parent } } Rectangle { implicitWidth: 200 color: "lightgreen" Label { text: "View 3" anchors.centerIn: parent } } } ``` Serializing SplitView's State ----------------------------- The main purpose of SplitView is to allow users to easily configure the size of various UI elements. In addition, the user's preferred sizes should be remembered across sessions. To achieve this, the values of the `SplitView.preferredWidth` and `SplitView.preferredHeight` properties can be serialized using the [saveState](qml-qtquick-controls2-splitview#saveState-method)() and [restoreState](qml-qtquick-controls2-splitview#restoreState-method)() functions: ``` import QtQuick.Controls import Qt.labs.settings ApplicationWindow { // ... Component.onCompleted: splitView.restoreState(settings.splitView) Component.onDestruction: settings.splitView = splitView.saveState() Settings { id: settings property var splitView } SplitView { id: splitView // ... } } ``` Alternatively, the [value](qml-qt-labs-settings-settings#value-method)() and [setValue](qml-qt-labs-settings-settings#setValue-method)() functions of [Settings](qpainter#settings) can be used: ``` import QtQuick.Controls import Qt.labs.settings ApplicationWindow { // ... Component.onCompleted: splitView.restoreState(settings.value("ui/splitview")) Component.onDestruction: settings.setValue("ui/splitview", splitView.saveState()) Settings { id: settings } SplitView { id: splitView // ... } } ``` **See also** [SplitHandle](qml-qtquick-controls2-splithandle), [Customizing SplitView](qtquickcontrols2-customize#customizing-splitview), and [Container Controls](qtquickcontrols2-containers). Property Documentation ---------------------- ### handle : [Component](qml-qtqml-component) This property holds the handle component. An instance of this component will be instantiated `count - 1` times, as long as `count` is greater than than `1`. The following table explains how each handle will be resized depending on the orientation of the split view: | Orientation | Handle Width | Handle Height | | --- | --- | --- | | `Qt.Horizontal` | `implicitWidth` | The `height` of the [SplitView](qml-qtquick-controls2-splitview). | | `Qt.Vertical` | The `width` of the [SplitView](qml-qtquick-controls2-splitview). | `implicitHeight` | To change the size of the handle for mouse and touch events without changing its visual size, use a [containmentMask](qml-qtquick-item#containmentMask-prop): ``` SplitView { id: splitView anchors.fill: parent handle: Rectangle { implicitWidth: 4 implicitHeight: 4 color: SplitHandle.pressed ? "#81e889" : (SplitHandle.hovered ? Qt.lighter("#c2f4c6", 1.1) : "#c2f4c6") containmentMask: Item { x: -width / 2 width: 64 height: splitView.height } } Rectangle { implicitWidth: 150 color: "#444" } Rectangle { implicitWidth: 50 color: "#666" } } ``` **See also** [Customizing SplitView](qtquickcontrols2-customize#customizing-splitview). ### orientation : [enumeration](qml-enumeration) This property holds the orientation of the [SplitView](qml-qtquick-controls2-splitview). The orientation determines how the split items are laid out: Possible values: | Constant | Description | | --- | --- | | `Qt.Horizontal` | The items are laid out horizontally (default). | | `Qt.Vertical` | The items are laid out vertically. | ### [read-only] resizing : [bool](qml-bool) This property is `true` when the user is resizing split items by dragging on the splitter handles. Attached Property Documentation ------------------------------- ### SplitView.fillHeight : [bool](qml-bool) This attached property controls whether the item takes the remaining space in the split view after all other items have been laid out. By default, the last visible child of the split view will have this set, but it can be changed by explicitly setting `fillHeight` to `true` on another item. The height of a split item with `fillHeight` set to `true` is still restricted within its [minimumHeight](qml-qtquick-controls2-splitview#minimumHeight-attached-prop) and [maximumHeight](qml-qtquick-controls2-splitview#maximumHeight-attached-prop). **See also** [minimumHeight](qml-qtquick-controls2-splitview#minimumHeight-attached-prop), [preferredHeight](qml-qtquick-controls2-splitview#preferredHeight-attached-prop), [maximumHeight](qml-qtquick-controls2-splitview#maximumHeight-attached-prop), and [fillWidth](qml-qtquick-controls2-splitview#fillWidth-attached-prop). ### SplitView.fillWidth : [bool](qml-bool) This attached property controls whether the item takes the remaining space in the split view after all other items have been laid out. By default, the last visible child of the split view will have this set, but it can be changed by explicitly setting `fillWidth` to `true` on another item. The width of a split item with `fillWidth` set to `true` is still restricted within its [minimumWidth](qml-qtquick-controls2-splitview#minimumWidth-attached-prop) and [maximumWidth](qml-qtquick-controls2-splitview#maximumWidth-attached-prop). **See also** [minimumWidth](qml-qtquick-controls2-splitview#minimumWidth-attached-prop), [preferredWidth](qml-qtquick-controls2-splitview#preferredWidth-attached-prop), [maximumWidth](qml-qtquick-controls2-splitview#maximumWidth-attached-prop), and [fillHeight](qml-qtquick-controls2-splitview#fillHeight-attached-prop). ### SplitView.maximumHeight : [real](qml-real) This attached property controls the maximum height of the split item. The [preferredHeight](qml-qtquick-controls2-splitview#preferredHeight-attached-prop) is bound within the [minimumHeight](qml-qtquick-controls2-splitview#minimumHeight-attached-prop) and maximumHeight. A split item cannot be dragged to be larger than its `maximumHeight`. The default value is `Infinity`. To reset this property to its default value, set it to `undefined`. **See also** [minimumHeight](qml-qtquick-controls2-splitview#minimumHeight-attached-prop), [preferredHeight](qml-qtquick-controls2-splitview#preferredHeight-attached-prop), [fillHeight](qml-qtquick-controls2-splitview#fillHeight-attached-prop), and [maximumWidth](qml-qtquick-controls2-splitview#maximumWidth-attached-prop). ### SplitView.maximumWidth : [real](qml-real) This attached property controls the maximum width of the split item. The [preferredWidth](qml-qtquick-controls2-splitview#preferredWidth-attached-prop) is bound within the [minimumWidth](qml-qtquick-controls2-splitview#minimumWidth-attached-prop) and maximumWidth. A split item cannot be dragged to be larger than its `maximumWidth`. The default value is `Infinity`. To reset this property to its default value, set it to `undefined`. **See also** [minimumWidth](qml-qtquick-controls2-splitview#minimumWidth-attached-prop), [preferredWidth](qml-qtquick-controls2-splitview#preferredWidth-attached-prop), [fillWidth](qml-qtquick-controls2-splitview#fillWidth-attached-prop), and [maximumHeight](qml-qtquick-controls2-splitview#maximumHeight-attached-prop). ### SplitView.minimumHeight : [real](qml-real) This attached property controls the minimum height of the split item. The [preferredHeight](qml-qtquick-controls2-splitview#preferredHeight-attached-prop) is bound within the minimumHeight and [maximumHeight](qml-qtquick-controls2-splitview#maximumHeight-attached-prop). A split item cannot be dragged to be smaller than its `minimumHeight`. The default value is `0`. To reset this property to its default value, set it to `undefined`. **See also** [maximumHeight](qml-qtquick-controls2-splitview#maximumHeight-attached-prop), [preferredHeight](qml-qtquick-controls2-splitview#preferredHeight-attached-prop), [fillHeight](qml-qtquick-controls2-splitview#fillHeight-attached-prop), and [minimumWidth](qml-qtquick-controls2-splitview#minimumWidth-attached-prop). ### SplitView.minimumWidth : [real](qml-real) This attached property controls the minimum width of the split item. The [preferredWidth](qml-qtquick-controls2-splitview#preferredWidth-attached-prop) is bound within the minimumWidth and [maximumWidth](qml-qtquick-controls2-splitview#maximumWidth-attached-prop). A split item cannot be dragged to be smaller than its `minimumWidth`. The default value is `0`. To reset this property to its default value, set it to `undefined`. **See also** [maximumWidth](qml-qtquick-controls2-splitview#maximumWidth-attached-prop), [preferredWidth](qml-qtquick-controls2-splitview#preferredWidth-attached-prop), [fillWidth](qml-qtquick-controls2-splitview#fillWidth-attached-prop), and [minimumHeight](qml-qtquick-controls2-splitview#minimumHeight-attached-prop). ### SplitView.preferredHeight : [real](qml-real) This attached property controls the preferred height of the split item. The preferred height will be used as the size of the item, and will be bound within the [minimumHeight](qml-qtquick-controls2-splitview#minimumHeight-attached-prop) and [maximumHeight](qml-qtquick-controls2-splitview#maximumHeight-attached-prop). If the preferred height is not set, the item's [implicitHeight](qml-qtquick-item#implicitHeight-prop) will be used. When a split item is resized, the preferredHeight will be set in order to keep track of the new size. By default, this property is not set, and therefore [implicitHeight](qml-qtquick-item#implicitHeight-prop) will be used instead. To reset this property to its default value, set it to `undefined`. **Note:** Do not set the [height](qml-qtquick-item#height-prop) property of a split item, as it will be overwritten upon each layout of the [SplitView](qml-qtquick-controls2-splitview). **See also** [minimumHeight](qml-qtquick-controls2-splitview#minimumHeight-attached-prop), [maximumHeight](qml-qtquick-controls2-splitview#maximumHeight-attached-prop), [fillHeight](qml-qtquick-controls2-splitview#fillHeight-attached-prop), and [preferredWidth](qml-qtquick-controls2-splitview#preferredWidth-attached-prop). ### SplitView.preferredWidth : [real](qml-real) This attached property controls the preferred width of the split item. The preferred width will be used as the size of the item, and will be bound within the [minimumWidth](qml-qtquick-controls2-splitview#minimumWidth-attached-prop) and [maximumWidth](qml-qtquick-controls2-splitview#maximumWidth-attached-prop). If the preferred width is not set, the item's [implicitWidth](qml-qtquick-item#implicitWidth-prop) will be used. When a split item is resized, the preferredWidth will be set in order to keep track of the new size. By default, this property is not set, and therefore [implicitWidth](qml-qtquick-item#implicitWidth-prop) will be used instead. To reset this property to its default value, set it to `undefined`. **Note:** Do not set the [width](qml-qtquick-item#width-prop) property of a split item, as it will be overwritten upon each layout of the [SplitView](qml-qtquick-controls2-splitview). **See also** [minimumWidth](qml-qtquick-controls2-splitview#minimumWidth-attached-prop), [maximumWidth](qml-qtquick-controls2-splitview#maximumWidth-attached-prop), [fillWidth](qml-qtquick-controls2-splitview#fillWidth-attached-prop), and [preferredHeight](qml-qtquick-controls2-splitview#preferredHeight-attached-prop). ### SplitView.view : [SplitView](qml-qtquick-controls2-splitview) This attached property holds the split view of the item it is attached to, or `null` if the item is not in a split view. Method Documentation -------------------- ### [bool](qml-bool) restoreState(*state*) Reads the preferred sizes from *state* and applies them to the split items. Returns `true` if the state was successfully restored, otherwise `false`. **See also** [Serializing SplitView's State](qml-qtquick-controls2-splitview#serializing-splitview-s-state) and [saveState](qml-qtquick-controls2-splitview#saveState-method)(). ### [var](qml-var) saveState() Saves the preferred sizes of split items into a byte array and returns it. **See also** [Serializing SplitView's State](qml-qtquick-controls2-splitview#serializing-splitview-s-state) and [restoreState](qml-qtquick-controls2-splitview#restoreState-method)().
programming_docs
qt Object Trees & Ownership Object Trees & Ownership ======================== Overview -------- [QObjects](qobject) organize themselves in object trees. When you create a [QObject](qobject) with another object as parent, it's added to the parent's [children](qobject#children)() list, and is deleted when the parent is. It turns out that this approach fits the needs of GUI objects very well. For example, a [QShortcut](qshortcut) (keyboard shortcut) is a child of the relevant window, so when the user closes that window, the shortcut is deleted too. [QQuickItem](qquickitem), the basic visual element of the Qt Quick module, inherits from [QObject](qobject), but has a concept of the *visual parent* which differs from that of the *[QObject](qobject) parent*. An item's visual parent may not necessarily be the same as its object parent. See [Concepts - Visual Parent in Qt Quick](qtquick-visualcanvas-visualparent) for more details. [QWidget](qwidget), the fundamental class of the Qt Widgets module, extends the parent-child relationship. A child normally also becomes a child widget, i.e. it is displayed in its parent's coordinate system and is graphically clipped by its parent's boundaries. For example, when the application deletes a message box after it has been closed, the message box's buttons and label are also deleted, just as we'd want, because the buttons and label are children of the message box. You can also delete child objects yourself, and they will remove themselves from their parents. For example, when the user removes a toolbar it may lead to the application deleting one of its [QToolBar](qtoolbar) objects, in which case the tool bar's [QMainWindow](qmainwindow) parent would detect the change and reconfigure its screen space accordingly. The debugging functions [QObject::dumpObjectTree](qobject#dumpObjectTree)() and [QObject::dumpObjectInfo](qobject#dumpObjectInfo)() are often useful when an application looks or acts strangely. Construction/Destruction Order of QObjects ------------------------------------------ When [QObjects](qobject) are created on the heap (i.e., created with *new*), a tree can be constructed from them in any order, and later, the objects in the tree can be destroyed in any order. When any [QObject](qobject) in the tree is deleted, if the object has a parent, the destructor automatically removes the object from its parent. If the object has children, the destructor automatically deletes each child. No [QObject](qobject) is deleted twice, regardless of the order of destruction. When [QObjects](qobject) are created on the stack, the same behavior applies. Normally, the order of destruction still doesn't present a problem. Consider the following snippet: ``` int main() { QWidget window; QPushButton quit("Quit", &window); ... } ``` The parent, `window`, and the child, `quit`, are both [QObjects](qobject) because [QPushButton](qpushbutton) inherits [QWidget](qwidget), and [QWidget](qwidget) inherits [QObject](qobject). This code is correct: the destructor of `quit` is *not* called twice because the C++ language standard *(ISO/IEC 14882:2003)* specifies that destructors of local objects are called in the reverse order of their constructors. Therefore, the destructor of the child, `quit`, is called first, and it removes itself from its parent, `window`, before the destructor of `window` is called. But now consider what happens if we swap the order of construction, as shown in this second snippet: ``` int main() { QPushButton quit("Quit"); QWidget window; quit.setParent(&window); ... } ``` In this case, the order of destruction causes a problem. The parent's destructor is called first because it was created last. It then calls the destructor of its child, `quit`, which is incorrect because `quit` is a local variable. When `quit` subsequently goes out of scope, its destructor is called again, this time correctly, but the damage has already been done. liquid Liquid Liquid ====== Liquid is an open-source template language created by [Shopify](https://www.shopify.com) and written in Ruby. It is the backbone of Shopify themes and is used to load dynamic content on storefronts. Liquid has been in production use at Shopify since 2006 and is now used by many other hosted web applications. liquid split split ===== Divides a string into an array using the argument as a separator. split is commonly used to convert comma-separated items from a string to an array. Input ``` {% assign beatles = "John, Paul, George, Ringo" | split: ", " %} {% for member in beatles %} {{ member }} {% endfor %} ``` Output ``` John Paul George Ringo ``` liquid at_least at\_least ========= Limits a number to a minimum value. Input ``` {{ 4 | at_least: 5 }} ``` Output ``` 5 ``` Input ``` {{ 4 | at_least: 3 }} ``` Output ``` 4 ``` liquid escape escape ====== Escapes a string by replacing characters with escape sequences (so that the string can be used in a URL, for example). It doesn’t change strings that don’t have anything to escape. Input ``` {{ "Have you read 'James & the Giant Peach'?" | escape }} ``` Output ``` Have you read &#39;James &amp; the Giant Peach&#39;? ``` Input ``` {{ "Tetsuro Takara" | escape }} ``` Output ``` Tetsuro Takara ``` liquid ceil ceil ==== Rounds the input up to the nearest whole number. Liquid tries to convert the input to a number before the filter is applied. Input ``` {{ 1.2 | ceil }} ``` Output ``` 2 ``` Input ``` {{ 2.0 | ceil }} ``` Output ``` 2 ``` Input ``` {{ 183.357 | ceil }} ``` Output ``` 184 ``` Here the input value is a string: Input ``` {{ "3.5" | ceil }} ``` Output ``` 4 ``` liquid concat concat ====== Concatenates (joins together) multiple arrays. The resulting array contains all the items from the input arrays. Input ``` {% assign fruits = "apples, oranges, peaches" | split: ", " %} {% assign vegetables = "carrots, turnips, potatoes" | split: ", " %} {% assign everything = fruits | concat: vegetables %} {% for item in everything %} - {{ item }} {% endfor %} ``` Output ``` - apples - oranges - peaches - carrots - turnips - potatoes ``` You can string together concat filters to join more than two arrays: Input ``` {% assign furniture = "chairs, tables, shelves" | split: ", " %} {% assign everything = fruits | concat: vegetables | concat: furniture %} {% for item in everything %} - {{ item }} {% endfor %} ``` Output ``` - apples - oranges - peaches - carrots - turnips - potatoes - chairs - tables - shelves ``` liquid url_encode url\_encode =========== Converts any URL-unsafe characters in a string into percent-encoded characters. Input ``` {{ "[email protected]" | url_encode }} ``` Output ``` john%40liquid.com ``` Input ``` {{ "Tetsuro Takara" | url_encode }} ``` Output ``` Tetsuro+Takara ``` liquid remove remove ====== Removes every occurrence of the specified substring from a string. Input ``` {{ "I strained to see the train through the rain" | remove: "rain" }} ``` Output ``` I sted to see the t through the ``` liquid compact compact ======= Removes any nil values from an array. For this example, assume site.pages is an array of content pages for a website, and some of these pages have an attribute called category that specifies their content category. If we map those categories to an array, some of the array items might be nil if any pages do not have a category attribute. Input ``` {% assign site_categories = site.pages | map: "category" %} {% for category in site_categories %} - {{ category }} {% endfor %} ``` Output ``` - business - celebrities - - lifestyle - sports - - technology ``` By using compact when we create our site\_categories array, we can remove all the nil values in the array. Input ``` {% assign site_categories = site.pages | map: "category" | compact %} {% for category in site_categories %} - {{ category }} {% endfor %} ``` Output ``` - business - celebrities - lifestyle - sports - technology ``` liquid sort_natural sort\_natural ============= Sorts items in an array in case-insensitive order. Input ``` {% assign my_array = "zebra, octopus, giraffe, Sally Snake" | split: ", " %} {{ my_array | sort_natural | join: ", " }} ``` Output ``` giraffe, octopus, Sally Snake, zebra ``` An optional argument specifies which property of the array’s items to use for sorting. ``` {% assign products_by_company = collection.products | sort_natural: "company" %} {% for product in products_by_company %} <h4>{{ product.title }}</h4> {% endfor %} ``` liquid last last ==== Returns the last item of an array. Input ``` {{ "Ground control to Major Tom." | split: " " | last }} ``` Output ``` Tom. ``` Input ``` {% assign my_array = "zebra, octopus, giraffe, tiger" | split: ", " %} {{ my_array.last }} ``` Output ``` tiger ``` You can use last with dot notation when you need to use the filter inside a tag: ``` {% if my_array.last == "tiger" %} There goes a tiger! {% endif %} ``` liquid truncate truncate ======== Shortens a string down to the number of characters passed as an argument. If the specified number of characters is less than the length of the string, an ellipsis (…) is appended to the string and is included in the character count. Input ``` {{ "Ground control to Major Tom." | truncate: 20 }} ``` Output ``` Ground control to... ``` ### Custom ellipsis truncate takes an optional second argument that specifies the sequence of characters to be appended to the truncated string. By default this is an ellipsis (…), but you can specify a different sequence. The length of the second argument counts against the number of characters specified by the first argument. For example, if you want to truncate a string to exactly 10 characters, and use a 3-character ellipsis, use **13** for the first argument of truncate, since the ellipsis counts as 3 characters. Input ``` {{ "Ground control to Major Tom." | truncate: 25, ", and so on" }} ``` Output ``` Ground control, and so on ``` ### No ellipsis You can truncate to the exact number of characters specified by the first argument and avoid showing trailing characters by passing a blank string as the second argument: Input ``` {{ "Ground control to Major Tom." | truncate: 20, "" }} ``` Output ``` Ground control to Ma ``` liquid strip strip ===== Removes all whitespace (tabs, spaces, and newlines) from both the left and right sides of a string. It does not affect spaces between words. Input ``` {{ " So much room for activities! " | strip }} ``` Output ``` So much room for activities! ``` liquid join join ==== Combines the items in an array into a single string using the argument as a separator. Input ``` {% assign beatles = "John, Paul, George, Ringo" | split: ", " %} {{ beatles | join: " and " }} ``` Output ``` John and Paul and George and Ringo ``` liquid minus minus ===== Subtracts a number from another number. Input ``` {{ 4 | minus: 2 }} ``` Output ``` 2 ``` Input ``` {{ 16 | minus: 4 }} ``` Output ``` 12 ``` Input ``` {{ 183.357 | minus: 12 }} ``` Output ``` 171.357 ``` liquid sort sort ==== Sorts items in an array in case-sensitive order. Input ``` {% assign my_array = "zebra, octopus, giraffe, Sally Snake" | split: ", " %} {{ my_array | sort | join: ", " }} ``` Output ``` Sally Snake, giraffe, octopus, zebra ``` An optional argument specifies which property of the array’s items to use for sorting. ``` {% assign products_by_price = collection.products | sort: "price" %} {% for product in products_by_price %} <h4>{{ product.title }}</h4> {% endfor %} ``` liquid first first ===== Returns the first item of an array. Input ``` {{ "Ground control to Major Tom." | split: " " | first }} ``` Output ``` Ground ``` Input ``` {% assign my_array = "zebra, octopus, giraffe, tiger" | split: ", " %} {{ my_array.first }} ``` Output ``` zebra ``` You can use first with dot notation when you need to use the filter inside a tag: ``` {% if my_array.first == "zebra" %} Here comes a zebra! {% endif %} ``` liquid slice slice ===== Returns a substring of 1 character beginning at the index specified by the first argument. An optional second argument specifies the length of the substring to be returned. String indices are numbered starting from 0. Input ``` {{ "Liquid" | slice: 0 }} ``` Output ``` L ``` Input ``` {{ "Liquid" | slice: 2 }} ``` Output ``` q ``` Input ``` {{ "Liquid" | slice: 2, 5 }} ``` Output ``` quid ``` If the first argument is a negative number, the indices are counted from the end of the string: Input ``` {{ "Liquid" | slice: -3, 2 }} ``` Output ``` ui ``` liquid times times ===== Multiplies a number by another number. Input ``` {{ 3 | times: 2 }} ``` Output ``` 6 ``` Input ``` {{ 24 | times: 7 }} ``` Output ``` 168 ``` Input ``` {{ 183.357 | times: 12 }} ``` Output ``` 2200.284 ``` liquid strip_html strip\_html =========== Removes any HTML tags from a string. Input ``` {{ "Have <em>you</em> read <strong>Ulysses</strong>?" | strip_html }} ``` Output ``` Have you read Ulysses? ``` liquid at_most at\_most ======== Limits a number to a maximum value. Input ``` {{ 4 | at_most: 5 }} ``` Output ``` 4 ``` Input ``` {{ 4 | at_most: 3 }} ``` Output ``` 3 ``` liquid append append ====== Concatenates two strings and returns the concatenated value. Input ``` {{ "/my/fancy/url" | append: ".html" }} ``` Output ``` /my/fancy/url.html ``` append can also be used with variables: Input ``` {% assign filename = "/index.html" %} {{ "website.com" | append: filename }} ``` Output ``` website.com/index.html ``` liquid date date ==== Converts a timestamp into another date format. The format for this syntax is the same as [strftime](http://strftime.net). The input uses the same format as Ruby’s [Time.parse](https://ruby-doc.org/stdlib/libdoc/time/rdoc/Time.html#method-c-parse). Input ``` {{ article.published_at | date: "%a, %b %d, %y" }} ``` Output ``` Fri, Jul 17, 15 ``` Input ``` {{ article.published_at | date: "%Y" }} ``` Output ``` 2015 ``` date works on strings if they contain well-formatted dates: Input ``` {{ "March 14, 2016" | date: "%b %d, %y" }} ``` Output ``` Mar 14, 16 ``` To get the current time, pass the special word "now" (or "today") to date: Input ``` This page was last updated at {{ "now" | date: "%Y-%m-%d %H:%M" }}. ``` Output ``` This page was last updated at 2019-09-19 17:48. ``` Note that the value will be the current time of when the page was last generated from the template, not when the page is presented to a user if caching or static site generation is involved. liquid default default ======= Allows you to specify a fallback in case a value doesn’t exist. default will show its value if the left side is nil, false, or empty. In this example, product\_price is not defined, so the default value is used. Input ``` {{ product_price | default: 2.99 }} ``` Output ``` 2.99 ``` In this example, product\_price is defined, so the default value is not used. Input ``` {% assign product_price = 4.99 %} {{ product_price | default: 2.99 }} ``` Output ``` 4.99 ``` In this example, product\_price is empty, so the default value is used. Input ``` {% assign product_price = "" %} {{ product_price | default: 2.99 }} ``` Output ``` 2.99 ``` liquid prepend prepend ======= Adds the specified string to the beginning of another string. Input ``` {{ "apples, oranges, and bananas" | prepend: "Some fruit: " }} ``` Output ``` Some fruit: apples, oranges, and bananas ``` prepend can also be used with variables: Input ``` {% assign url = "example.com" %} {{ "/index.html" | prepend: url }} ``` Output ``` example.com/index.html ``` liquid remove_first remove\_first ============= Removes only the first occurrence of the specified substring from a string. Input ``` {{ "I strained to see the train through the rain" | remove_first: "rain" }} ``` Output ``` I sted to see the train through the rain ``` liquid reverse reverse ======= Reverses the order of the items in an array. reverse cannot reverse a string. Input ``` {% assign my_array = "apples, oranges, peaches, plums" | split: ", " %} {{ my_array | reverse | join: ", " }} ``` Output ``` plums, peaches, oranges, apples ``` Although reverse cannot be used directly on a string, you can split a string into an array, reverse the array, and rejoin it by chaining together filters: Input ``` {{ "Ground control to Major Tom." | split: "" | reverse | join: "" }} ``` Output ``` .moT rojaM ot lortnoc dnuorG ``` liquid escape_once escape\_once ============ Escapes a string without changing existing escaped entities. It doesn’t change strings that don’t have anything to escape. Input ``` {{ "1 < 2 & 3" | escape_once }} ``` Output ``` 1 &lt; 2 &amp; 3 ``` Input ``` {{ "1 &lt; 2 &amp; 3" | escape_once }} ``` Output ``` 1 &lt; 2 &amp; 3 ``` liquid divided_by divided\_by =========== Divides a number by another number. The result is rounded down to the nearest integer (that is, the [floor](../floor/index)) if the divisor is an integer. Input ``` {{ 16 | divided_by: 4 }} ``` Output ``` 4 ``` Input ``` {{ 5 | divided_by: 3 }} ``` Output ``` 1 ``` ### Controlling rounding divided\_by produces a result of the same type as the divisor — that is, if you divide by an integer, the result will be an integer. If you divide by a float (a number with a decimal in it), the result will be a float. For example, here the divisor is an integer: Input ``` {{ 20 | divided_by: 7 }} ``` Output ``` 2 ``` Here it is a float: Input ``` {{ 20 | divided_by: 7.0 }} ``` Output ``` 2.857142857142857 ``` ### Changing variable types You might want to use a variable as a divisor, in which case you can’t simply add .0 to convert it to a float. In these cases, you can assign a version of your variable converted to a float using the times filter. In this example, we’re dividing by a variable that contains an integer, so we get an integer: Input ``` {% assign my_integer = 7 %} {{ 20 | divided_by: my_integer }} ``` Output ``` 2 ``` Here, we [multiply](../times/index) the variable by 1.0 to get a float, then divide by the float instead: Input ``` {% assign my_integer = 7 %} {% assign my_float = my_integer | times: 1.0 %} {{ 20 | divided_by: my_float }} ``` Output ``` 2.857142857142857 ``` liquid rstrip rstrip ====== Removes all whitespace (tabs, spaces, and newlines) from the right side of a string. It does not affect spaces between words. Input ``` {{ " So much room for activities! " | rstrip }} ``` Output ``` So much room for activities! ``` liquid replace_first replace\_first ============== Replaces only the first occurrence of the first argument in a string with the second argument. Input ``` {{ "Take my protein pills and put my helmet on" | replace_first: "my", "your" }} ``` Output ``` Take your protein pills and put my helmet on ``` liquid uniq uniq ==== Removes any duplicate elements in an array. Input ``` {% assign my_array = "ants, bugs, bees, bugs, ants" | split: ", " %} {{ my_array | uniq | join: ", " }} ``` Output ``` ants, bugs, bees ``` liquid map map === Creates an array of values by extracting the values of a named property from another object. In this example, assume the object site.pages contains all the metadata for a website. Using assign with the map filter creates a variable that contains only the values of the category properties of everything in the site.pages object. Input ``` {% assign all_categories = site.pages | map: "category" %} {% for item in all_categories %} - {{ item }} {% endfor %} ``` Output ``` - business - celebrities - lifestyle - sports - technology ```
programming_docs
liquid abs abs === Returns the absolute value of a number. Input ``` {{ -17 | abs }} ``` Output ``` 17 ``` Input ``` {{ 4 | abs }} ``` Output ``` 4 ``` abs will also work on a string that only contains a number: Input ``` {{ "-19.86" | abs }} ``` Output ``` 19.86 ``` liquid upcase upcase ====== Makes each character in a string uppercase. It has no effect on strings which are already all uppercase. Input ``` {{ "Parker Moore" | upcase }} ``` Output ``` PARKER MOORE ``` Input ``` {{ "APPLE" | upcase }} ``` Output ``` APPLE ``` liquid floor floor ===== Rounds the input down to the nearest whole number. Liquid tries to convert the input to a number before the filter is applied. Input ``` {{ 1.2 | floor }} ``` Output ``` 1 ``` Input ``` {{ 2.0 | floor }} ``` Output ``` 2 ``` Input ``` {{ 183.357 | floor }} ``` Output ``` 183 ``` Here the input value is a string: Input ``` {{ "3.5" | floor }} ``` Output ``` 3 ``` liquid replace replace ======= Replaces every occurrence of the first argument in a string with the second argument. Input ``` {{ "Take my protein pills and put my helmet on" | replace: "my", "your" }} ``` Output ``` Take your protein pills and put your helmet on ``` liquid downcase downcase ======== Makes each character in a string lowercase. It has no effect on strings which are already all lowercase. Input ``` {{ "Parker Moore" | downcase }} ``` Output ``` parker moore ``` Input ``` {{ "apple" | downcase }} ``` Output ``` apple ``` liquid truncatewords truncatewords ============= Shortens a string down to the number of words passed as an argument. If the specified number of words is less than the number of words in the string, an ellipsis (…) is appended to the string. Input ``` {{ "Ground control to Major Tom." | truncatewords: 3 }} ``` Output ``` Ground control to... ``` ### Custom ellipsis truncatewords takes an optional second argument that specifies the sequence of characters to be appended to the truncated string. By default this is an ellipsis (…), but you can specify a different sequence. Input ``` {{ "Ground control to Major Tom." | truncatewords: 3, "--" }} ``` Output ``` Ground control to-- ``` ### No ellipsis You can avoid showing trailing characters by passing a blank string as the second argument: Input ``` {{ "Ground control to Major Tom." | truncatewords: 3, "" }} ``` Output ``` Ground control to ``` liquid size size ==== Returns the number of characters in a string or the number of items in an array. Input ``` {{ "Ground control to Major Tom." | size }} ``` Output ``` 28 ``` Input ``` {% assign my_array = "apples, oranges, peaches, plums" | split: ", " %} {{ my_array.size }} ``` Output ``` 4 ``` You can use size with dot notation when you need to use the filter inside a tag: ``` {% if site.pages.size > 10 %} This is a big website! {% endif %} ``` liquid strip_newlines strip\_newlines =============== Removes any newline characters (line breaks) from a string. Input ``` {% capture string_with_newlines %} Hello there {% endcapture %} {{ string_with_newlines | strip_newlines }} ``` Output ``` Hellothere ``` liquid modulo modulo ====== Returns the remainder of a division operation. Input ``` {{ 3 | modulo: 2 }} ``` Output ``` 1 ``` Input ``` {{ 24 | modulo: 7 }} ``` Output ``` 3 ``` Input ``` {{ 183.357 | modulo: 12 }} ``` Output ``` 3.357 ``` liquid capitalize capitalize ========== Makes the first character of a string capitalized. Input ``` {{ "title" | capitalize }} ``` Output ``` Title ``` capitalize only capitalizes the first character of a string, so later words are not affected: Input ``` {{ "my great title" | capitalize }} ``` Output ``` My great title ``` liquid where where ===== Creates an array including only the objects with a given property value, or any [truthy](../../basics/truthy-and-falsy/index#truthy) value by default. In this example, assume you have a list of products and you want to show your kitchen products separately. Using where, you can create an array containing only the products that have a "type" of "kitchen". Input ``` All products: {% for product in products %} - {{ product.title }} {% endfor %} {% assign kitchen_products = products | where: "type", "kitchen" %} Kitchen products: {% for product in kitchen_products %} - {{ product.title }} {% endfor %} ``` Output ``` All products: - Vacuum - Spatula - Television - Garlic press Kitchen products: - Spatula - Garlic press ``` Say instead you have a list of products and you only want to show those that are available to buy. You can where with a property name but no target value to include all products with a [truthy](../../basics/truthy-and-falsy/index#truthy) "available" value. Input ``` All products: {% for product in products %} - {{ product.title }} {% endfor %} {% assign available_products = products | where: "available" %} Available products: {% for product in available_products %} - {{ product.title }} {% endfor %} ``` Output ``` All products: - Coffee mug - Limited edition sneakers - Boring sneakers Available products: - Coffee mug - Boring sneakers ``` The where filter can also be used to find a single object in an array when combined with the first filter. For example, say you want to show off the shirt in your new fall collection. Input ``` {% assign new_shirt = products | where: "type", "shirt" | first %} Featured product: {{ new_shirt.title }} ``` Output ``` Featured product: Hawaiian print sweater vest ``` liquid round round ===== Rounds a number to the nearest integer or, if a number is passed as an argument, to that number of decimal places. Input ``` {{ 1.2 | round }} ``` Output ``` 1 ``` Input ``` {{ 2.7 | round }} ``` Output ``` 3 ``` Input ``` {{ 183.357 | round: 2 }} ``` Output ``` 183.36 ``` liquid lstrip lstrip ====== Removes all whitespace (tabs, spaces, and newlines) from the left side of a string. It does not affect spaces between words. Input ``` {{ " So much room for activities! " | lstrip }} ``` Output ``` So much room for activities! ``` liquid newline_to_br newline\_to\_br =============== Replaces every newline (\n) in a string with an HTML line break (<br />). Input ``` {% capture string_with_newlines %} Hello there {% endcapture %} {{ string_with_newlines | newline_to_br }} ``` Output ``` <br /> Hello<br /> there<br /> ``` liquid url_decode url\_decode =========== Decodes a string that has been encoded as a URL or by [url\_encode](../url_encode/index). Input ``` {{ "%27Stop%21%27+said+Fred" | url_decode }} ``` Output ``` 'Stop!' said Fred ``` liquid plus plus ==== Adds a number to another number. Input ``` {{ 4 | plus: 2 }} ``` Output ``` 6 ``` Input ``` {{ 16 | plus: 4 }} ``` Output ``` 20 ``` Input ``` {{ 183.357 | plus: 12 }} ``` Output ``` 195.357 ``` liquid Types Types ===== Liquid objects can have one of five types: * [String](#string) * [Number](#number) * [Boolean](#boolean) * [Nil](#nil) * [Array](#array) You can initialize Liquid variables with the [assign](../../tags/variable/index#assign) or [capture](../../tags/variable/index#capture) tags. String ------ Declare a string by wrapping a variable’s value in single or double quotes: ``` {% assign my_string = "Hello World!" %} ``` Number ------ Numbers include floats and integers: ``` {% assign my_int = 25 %} {% assign my_float = 39.756 %} ``` Boolean ------- Booleans are either true or false. No quotations are necessary when declaring a boolean: ``` {% assign foo = true %} {% assign bar = false %} ``` Nil --- Nil is a special empty value that is returned when Liquid code has no results. It is **not** a string with the characters “nil”. Nil is [treated as false](../truthy-and-falsy/index#falsy) in the conditions of if blocks and other Liquid tags that check the truthfulness of a statement. In the following example, if the user does not exist (that is, user returns nil), Liquid will not print the greeting: ``` {% if user %} Hello {{ user.name }}! {% endif %} ``` Tags or outputs that return nil will not print anything to the page. Input ``` The current user is {{ user.name }} ``` Output ``` The current user is ``` Array ----- Arrays hold lists of variables of any type. ### Accessing items in arrays To access all the items in an array, you can loop through each item in the array using an [iteration tag](../../tags/iteration/index). Input ``` <!-- if site.users = "Tobi", "Laura", "Tetsuro", "Adam" --> {% for user in site.users %} {{ user }} {% endfor %} ``` Output ``` Tobi Laura Tetsuro Adam ``` ### Accessing specific items in arrays You can use square bracket [ ] notation to access a specific item in an array. Array indexing starts at zero. Input ``` <!-- if site.users = "Tobi", "Laura", "Tetsuro", "Adam" --> {{ site.users[0] }} {{ site.users[1] }} {{ site.users[3] }} ``` Output ``` Tobi Laura Adam ``` ### Initializing arrays You cannot initialize arrays using only Liquid. You can, however, use the [split](../../filters/split/index) filter to break a string into an array of substrings. liquid Operators Operators ========= Liquid includes many logical and comparison operators. Basic operators --------------- | | | | --- | --- | | `==` | equals | | `!=` | does not equal | | `>` | greater than | | `<` | less than | | `>=` | greater than or equal to | | `<=` | less than or equal to | | `or` | logical or | | `and` | logical and | For example: ``` {% if product.title == "Awesome Shoes" %} These shoes are awesome! {% endif %} ``` You can use multiple operators in a tag: ``` {% if product.type == "Shirt" or product.type == "Shoes" %} This is a shirt or a pair of shoes. {% endif %} ``` contains -------- contains checks for the presence of a substring inside a string. ``` {% if product.title contains "Pack" %} This product's title contains the word Pack. {% endif %} ``` contains can also check for the presence of a string in an array of strings. ``` {% if product.tags contains "Hello" %} This product has been tagged with "Hello". {% endif %} ``` contains can only search strings. You cannot use it to check for an object in an array of objects. Order of operations ------------------- In tags with more than one and or or operator, operators are checked in order *from right to left*. You cannot change the order of operations using parentheses — parentheses are invalid characters in Liquid and will prevent your tags from working. ``` {% if true or false and false %} This evaluates to true, since the `and` condition is checked first. {% endif %} ``` ``` {% if true and false and false or true %} This evaluates to false, since the tags are checked like this: true and (false and (false or true)) true and (false and true) true and false false {% endif %} ``` liquid Introduction Introduction ============ Liquid code can be categorized into [**objects**](#objects), [**tags**](#tags), and [**filters**](#filters). Objects ------- **Objects** tell Liquid where to show content on a page. Objects and variable names are denoted by double curly braces: {{ and }}. Input ``` {{ page.title }} ``` Output ``` Introduction ``` In this case, Liquid is rendering the content of an object called page.title, and that object contains the text Introduction. Tags ---- **Tags** create the logic and control flow for templates. They are denoted by curly braces and percent signs: {% and %}. The markup used in tags does not produce any visible text. This means that you can assign variables and create conditions and loops without showing any of the Liquid logic on the page. Input ``` {% if user %} Hello {{ user.name }}! {% endif %} ``` Output ``` Hello Adam! ``` Tags can be categorized into three types: * [Control flow](../../tags/control-flow/index) * [Iteration](../../tags/iteration/index) * [Variable assignments](../../tags/variable/index) You can read more about each type of tag in their respective sections. Filters ------- **Filters** change the output of a Liquid object. They are used within an output and are separated by a |. Input ``` {{ "/my/fancy/url" | append: ".html" }} ``` Output ``` /my/fancy/url.html ``` Multiple filters can be used on one output. They are applied from left to right. Input ``` {{ "adam!" | capitalize | prepend: "Hello " }} ``` Output ``` Hello Adam! ``` liquid Variations of Liquid Variations of Liquid ==================== Liquid is a flexible, safe language, and is used in many different environments. Liquid was created for use in [Shopify](https://www.shopify.com) stores, and is also used extensively on [Jekyll](https://jekyllrb.com) websites. Over time, both Shopify and Jekyll have added their own objects, tags, and filters to Liquid. The most popular versions of Liquid that exist are **Liquid**, **Shopify Liquid**, and **Jekyll Liquid**. This site documents the latest version of **Liquid** including betas and release candidates — that is, Liquid as it exists outside of Shopify and Jekyll. If you download the Liquid repository or install it as a [gem](https://rubygems.org/gems/liquid), you will get access to whatever objects, tags, and filters are in the version of Liquid that you chose. Shopify ------- Shopify always uses the latest version of Liquid as a base, but Shopify adds a significant number of objects, tags, and filters to Liquid for use in merchants’ stores. These include objects representing store, product, and customer information, and filters for displaying store data and manipulating storefront assets like product images. Shopify’s version of Liquid is documented in the [Shopify Help Center](https://help.shopify.com/themes/liquid). If you want to try out Shopify’s version of Liquid, you can create a development store through the [Shopify Partner Dashboard](https://help.shopify.com/en/partners/dashboard/development-stores). Jekyll ------ [Jekyll](https://jekyllrb.com) is a static site generator, a command-line tool that creates websites by merging templates with content files. Jekyll uses Liquid as its template language, and adds a few objects, tags, and filters. These include objects representing content pages, tags for including snippets of content in others, and filters for manipulating strings and URLs. Jekyll also powers [GitHub Pages](https://pages.github.com/), a web hosting service that lets you push a Jekyll installation to a GitHub repository and have the resulting website published. This website is built using GitHub Pages. Jekyll might not be using the latest version of Liquid. This means that the tags and filters listed on this site may not work in Jekyll. Often the Jekyll project will wait for a stable release of Liquid rather than using a beta or release candidate version. To see what version of Liquid Jekyll is using, check the **runtime dependencies** section of [Jekyll’s gem page](https://rubygems.org/gems/jekyll). Jekyll’s version of Liquid is documented in the [Liquid section of Jekyll’s documentation](https://jekyllrb.com/docs/liquid/). If you want to try out Jekyll’s version of Liquid, you can clone the Jekyll project or install Jekyll as a gem and test Liquid on a static site. liquid Whitespace control Whitespace control ================== In Liquid, you can include a hyphen in your tag syntax {{-, -}}, {%-, and -%} to strip whitespace from the left or right side of a rendered tag. Normally, even if it doesn’t print text, any line of Liquid in your template will still print a blank line in your rendered HTML: Input ``` {% assign my_variable = "tomato" %} {{ my_variable }} ``` Notice the blank line before “tomato” in the rendered template: Output ``` tomato ``` By including hyphens in your assign tag, you can strip the generated whitespace from the rendered template: Input ``` {%- assign my_variable = "tomato" -%} {{ my_variable }} ``` Output ``` tomato ``` If you don’t want any of your tags to print whitespace, as a general rule you can add hyphens to both sides of all your tags ({%- and -%}): Input ``` {% assign username = "John G. Chalmers-Smith" %} {% if username and username.size > 10 %} Wow, {{ username }}, you have a long name! {% else %} Hello there! {% endif %} ``` Output without whitespace control ``` Wow, John G. Chalmers-Smith, you have a long name! ``` Input ``` {%- assign username = "John G. Chalmers-Smith" -%} {%- if username and username.size > 10 -%} Wow, {{ username }}, you have a long name! {%- else -%} Hello there! {%- endif -%} ``` Output with whitespace control ``` Wow, John G. Chalmers-Smith, you have a long name! ``` liquid Truthy and falsy Truthy and falsy ================ In programming, anything that returns true in a conditional is called **truthy**. Anything that returns false in a conditional is called **falsy**. All object types can be described as either truthy or falsy. * [Truthy](#truthy) * [Falsy](#falsy) * [Summary](#summary) Truthy ------ All values in Liquid are truthy except nil and false. In the example below, the string “Tobi” is not a boolean, but it is truthy in a conditional: ``` {% assign tobi = "Tobi" %} {% if tobi %} This condition will always be true. {% endif %} ``` [Strings](../types/index#string), even when empty, are truthy. The example below will result in empty HTML tags if settings.fp\_heading is empty: Input ``` {% if settings.fp_heading %} <h1>{{ settings.fp_heading }}</h1> {% endif %} ``` Output ``` <h1></h1> ``` Falsy ----- The falsy values in Liquid are [nil](../types/index#nil) and [false](../types/index#boolean). Summary ------- The table below summarizes what is truthy or falsy in Liquid. | | truthy | falsy | | --- | --- | --- | | true | • | | | false | | • | | nil | | • | | string | • | | | empty string | • | | | 0 | • | | | integer | • | | | float | • | | | array | • | | | empty array | • | | | page | • | | | EmptyDrop | • | | liquid Variable Variable ======== Variable tags create new Liquid variables. assign ------ Creates a new variable. Input ``` {% assign my_variable = false %} {% if my_variable != true %} This statement is valid. {% endif %} ``` Output ``` This statement is valid. ``` Wrap a variable value in quotations " to save it as a string. Input ``` {% assign foo = "bar" %} {{ foo }} ``` Output ``` bar ``` capture ------- Captures the string inside of the opening and closing tags and assigns it to a variable. Variables created through capture are strings. Input ``` {% capture my_variable %}I am being captured.{% endcapture %} {{ my_variable }} ``` Output ``` I am being captured. ``` Using capture, you can create complex strings using other variables created with assign: Input ``` {% assign favorite_food = "pizza" %} {% assign age = 35 %} {% capture about_me %} I am {{ age }} and my favorite food is {{ favorite_food }}. {% endcapture %} {{ about_me }} ``` Output ``` I am 35 and my favourite food is pizza. ``` increment --------- Creates a new number variable, and increases its value by one every time it is called. The initial value is 0. Input ``` {% increment my_counter %} {% increment my_counter %} {% increment my_counter %} ``` Output ``` 0 1 2 ``` Variables created through the increment tag are independent from variables created through assign or capture. In the example below, a variable named “var” is created through assign. The increment tag is then used several times on a variable with the same name. Note that the increment tag does not affect the value of “var” that was created through assign. Input ``` {% assign var = 10 %} {% increment var %} {% increment var %} {% increment var %} {{ var }} ``` Output ``` 0 1 2 10 ``` decrement --------- Creates a new number variable, and decreases its value by one every time it is called. The initial value is -1. Input ``` {% decrement variable %} {% decrement variable %} {% decrement variable %} ``` Output ``` -1 -2 -3 ``` Like [increment](#increment), variables declared inside decrement are independent from variables created through assign or capture.
programming_docs
liquid Comment Comment ======= Allows you to leave un-rendered code inside a Liquid template. Any text within the opening and closing comment blocks will not be printed, and any Liquid code within will not be executed. Input ``` Anything you put between {% comment %} and {% endcomment %} tags is turned into a comment. ``` Output ``` Anything you put between tags is turned into a comment. ``` liquid Control flow Control flow ============ Control flow tags can change the information Liquid shows using programming logic. if -- Executes a block of code only if a certain condition is true. Input ``` {% if product.title == "Awesome Shoes" %} These shoes are awesome! {% endif %} ``` Output ``` These shoes are awesome! ``` unless ------ The opposite of if – executes a block of code only if a certain condition is **not** met. Input ``` {% unless product.title == "Awesome Shoes" %} These shoes are not awesome. {% endunless %} ``` Output ``` These shoes are not awesome. ``` This would be the equivalent of doing the following: ``` {% if product.title != "Awesome Shoes" %} These shoes are not awesome. {% endif %} ``` elsif / else ------------ Adds more conditions within an if or unless block. Input ``` <!-- If customer.name = "anonymous" --> {% if customer.name == "kevin" %} Hey Kevin! {% elsif customer.name == "anonymous" %} Hey Anonymous! {% else %} Hi Stranger! {% endif %} ``` Output ``` Hey Anonymous! ``` case/when --------- Creates a switch statement to compare a variable with different values. case initializes the switch statement, and when compares its values. Input ``` {% assign handle = "cake" %} {% case handle %} {% when "cake" %} This is a cake {% when "cookie" %} This is a cookie {% else %} This is not a cake nor a cookie {% endcase %} ``` Output ``` This is a cake ``` liquid Iteration Iteration ========= Iteration tags run blocks of code repeatedly. for --- Repeatedly executes a block of code. For a full list of attributes available within a for loop, see [forloop (object)](https://help.shopify.com/themes/liquid/objects/for-loops). Input ``` {% for product in collection.products %} {{ product.title }} {% endfor %} ``` Output ``` hat shirt pants ``` ### else Specifies a fallback case for a for loop which will run if the loop has zero length. Input ``` {% for product in collection.products %} {{ product.title }} {% else %} The collection is empty. {% endfor %} ``` Output ``` The collection is empty. ``` ### break Causes the loop to stop iterating when it encounters the break tag. Input ``` {% for i in (1..5) %} {% if i == 4 %} {% break %} {% else %} {{ i }} {% endif %} {% endfor %} ``` Output ``` 1 2 3 ``` ### continue Causes the loop to skip the current iteration when it encounters the continue tag. Input ``` {% for i in (1..5) %} {% if i == 4 %} {% continue %} {% else %} {{ i }} {% endif %} {% endfor %} ``` Output ``` 1 2 3 5 ``` for (parameters) ---------------- ### limit Limits the loop to the specified number of iterations. Input ``` <!-- if array = [1,2,3,4,5,6] --> {% for item in array limit:2 %} {{ item }} {% endfor %} ``` Output ``` 1 2 ``` ### offset Begins the loop at the specified index. Input ``` <!-- if array = [1,2,3,4,5,6] --> {% for item in array offset:2 %} {{ item }} {% endfor %} ``` Output ``` 3 4 5 6 ``` ### range Defines a range of numbers to loop through. The range can be defined by both literal and variable numbers. Input ``` {% for i in (3..5) %} {{ i }} {% endfor %} {% assign num = 4 %} {% for i in (1..num) %} {{ i }} {% endfor %} ``` Output ``` 3 4 5 1 2 3 4 ``` ### reversed Reverses the order of the loop. Note that this flag’s spelling is different from the filter reverse. Input ``` <!-- if array = [1,2,3,4,5,6] --> {% for item in array reversed %} {{ item }} {% endfor %} ``` Output ``` 6 5 4 3 2 1 ``` cycle ----- Loops through a group of strings and prints them in the order that they were passed as arguments. Each time cycle is called, the next string argument is printed. cycle must be used within a [for](#for) loop block. Input ``` {% cycle "one", "two", "three" %} {% cycle "one", "two", "three" %} {% cycle "one", "two", "three" %} {% cycle "one", "two", "three" %} ``` Output ``` one two three one ``` Uses for cycle include: * applying odd/even classes to rows in a table * applying a unique class to the last product thumbnail in a row cycle (parameters) ------------------ cycle accepts a “cycle group” parameter in cases where you need multiple cycle blocks in one template. If no name is supplied for the cycle group, then it is assumed that multiple calls with the same parameters are one group. Input ``` {% cycle "first": "one", "two", "three" %} {% cycle "second": "one", "two", "three" %} {% cycle "second": "one", "two", "three" %} {% cycle "first": "one", "two", "three" %} ``` Output ``` one one two two ``` tablerow -------- Generates an HTML table. Must be wrapped in opening <table> and closing </table> HTML tags. Input ``` <table> {% tablerow product in collection.products %} {{ product.title }} {% endtablerow %} </table> ``` Output ``` <table> <tr class="row1"> <td class="col1"> Cool Shirt </td> <td class="col2"> Alien Poster </td> <td class="col3"> Batman Poster </td> <td class="col4"> Bullseye Shirt </td> <td class="col5"> Another Classic Vinyl </td> <td class="col6"> Awesome Jeans </td> </tr> </table> ``` tablerow (parameters) --------------------- ### cols Defines how many columns the tables should have. Input ``` {% tablerow product in collection.products cols:2 %} {{ product.title }} {% endtablerow %} ``` Output ``` <table> <tr class="row1"> <td class="col1"> Cool Shirt </td> <td class="col2"> Alien Poster </td> </tr> <tr class="row2"> <td class="col1"> Batman Poster </td> <td class="col2"> Bullseye Shirt </td> </tr> <tr class="row3"> <td class="col1"> Another Classic Vinyl </td> <td class="col2"> Awesome Jeans </td> </tr> </table> ``` #### limit Exits the tablerow after a specific index. ``` {% tablerow product in collection.products cols:2 limit:3 %} {{ product.title }} {% endtablerow %} ``` ### offset Starts the tablerow after a specific index. ``` {% tablerow product in collection.products cols:2 offset:3 %} {{ product.title }} {% endtablerow %} ``` ### range Defines a range of numbers to loop through. The range can be defined by both literal and variable numbers. ``` <!--variable number example--> {% assign num = 4 %} <table> {% tablerow i in (1..num) %} {{ i }} {% endtablerow %} </table> <!--literal number example--> <table> {% tablerow i in (3..5) %} {{ i }} {% endtablerow %} </table> ``` liquid Raw Raw === Raw temporarily disables tag processing. This is useful for generating content (eg, Mustache, Handlebars) which uses conflicting syntax. Input ``` {% raw %} In Handlebars, {{ this }} will be HTML-escaped, but {{{ that }}} will not. {% endraw %} ``` Output ``` In Handlebars, {{ this }} will be HTML-escaped, but {{{ that }}} will not. ``` modernizr Modernizr Modernizr ========= What is Modernizr? ------------------ Modernizr is a small piece of JavaScript code that automatically detects the availability of next-generation web technologies in your user's browsers. Rather than blacklisting entire ranges of browsers based on “UA sniffing,” Modernizr uses [feature detection](#what-is-feature-detection) to allow you to easily tailor your user's experiences based on the *actual capabilities* of their browser. With this knowledge that Modernizr gives you, you can take advantage of these new features in the browsers that can render or utilize them, and still have easy and reliable means of controlling the situation for the browsers that cannot. What is feature detection? -------------------------- In the dark ages of web development, we often had to resort to UA sniffing in order to determine if their user's would be able to make use of *Awesome-New-Feature*™. In practice, that means doing something like the following ``` if (browser === "the-one-they-make-you-use-at-work") { getTheOldLameExperience(); } else { showOffAwesomeNewFeature(); } ``` Now that *looks* ok, right? We are using *Awesome-New-Feature*™, and of course it isn't supported in an old crusty browser like that, right? That could very well be the case - today. But what if the next version of that browser adds support for *Awesome-New-Feature*™? Now you have to go back and audit your code, updating every single place that you are doing this check. That is assuming that you have the time to find out about every feature update for every single browser. Worse still, until you realize that it actually works in the newest version, all of those users back at the office `getTheOldLameExperience`, for no reason whatsoever. Those users - given a substandard website for apparently no reason - can actually go into their browser and OS settings and change the name of the browser (or `user-agent` - what we compare against in code when performing a UA sniff) to whatever they would like. At that point - your code is meaningless. You are blocking out users who may actually support all of your features, and possibly letting those in who don't. Nearly everyone gets a broken experience. There has to be a better way! There is, and it is called `Feature Detection`, and it looks more like this ``` if (Modernizr.awesomeNewFeature) { showOffAwesomeNewFeature(); } else { getTheOldLameExperience(); } ``` Rather than basing your decisions on whether or not the user is on the `one-they-make-you-use-at-work` browser, and assuming that means they either do or do not have access to *Awesome-New-Feature*™, feature detection actually programmatically checks if *Awesome-New-Feature*™ works in the browser, and gives you either a `true` or `false` result. So now as soon as your least favorite browser adds support for *Awesome-New-Feature*™, your code works there - automatically! No more having to update, ever. The code ends up being similar, but much more clear to its actual intention Downloading Modernizr --------------------- A lot has changed since the last version of Modernizr. There no longer is a single, base `modernizr.js` file. Instead, just head over to the [Download](https://modernizr.com/download) page as you could have previously, and select the features you want to use in your project. This way we can provide the smallest file possible, which means a faster website for you. Once you have done that, just hit the `Build` button and you’ve got your own custom build of Modernizr, hot off the presses! You may notice that in addition to the `Build` output, where you have been able to download custom builds one at a time for years now - there are two new options. #### Command Line Config Since 3.0, Modernizr also ships its build system as a [node](https://nodejs.org/) module on [npm](https://npmjs.org). That means that you can quickly create multiple builds of Modernizr for different projects, without even having to open a new browser tab. Once you have [npm installed](https://docs.npmjs.com/getting-started/installing-node), you can install the Modernizr command line tool by running ``` npm install -g modernizr ``` Now you are ready to get your start making your custom build! You can download the configuration file from the build menu (under "Command Line Config"). This will give you a [JSON](http://simple.wikipedia.org/wiki/JSON) file that you will give to the Modernizr module to make your custom build. ``` modernizr -c modernizr-config.json ``` Note that you will need to give the command line config the file path to the configuration you downloaded from the site. In the above example, we are running the `modernizr` command from the same folder that we downloaded the `modernizr-config.json` file to. #### Grunt Config If you do not want to manually run your build from the command line every time you update your site, you also have the option to download a [Grunt](http://gruntjs.com/) task to do it for you. This configuration file can be used with [grunt-modernizr](https://www.npmjs.com/package/grunt-modernizr) to automatically build your custom version. Just add it to your [Gruntfile](http://gruntjs.com/sample-gruntfile), and you are off to the races. Note that you will need to update the provided configuration file with paths to the `devFile` and `outputFile`. More documentation is available for grunt-modernizr [here](https://github.com/modernizr/grunt-modernizr#getting-started) #### Configuration Options In addition to the available options and feature detects, there are a handful of additional configuration options. `classPrefix` - *default: `""`* A string that is added before each CSS class. `enableJSClass` - *default: `true`* Whether or not to update `.no-js` to `.js` on the root element. `enableClasses` - *default: `true`* Whether or not Modernizr should add its CSS classes at all See the next section for more information on those options Using Modernizr with CSS ------------------------ #### Modernizr's classes By default, Modernizr sets classes for all of your tests on the root element (`<html>` for websites). This means adding the class for each feature when it is supported, and adding it with a `no-` prefix when it is not (e.g. `.feature` or `.no-feature`). This makes it super simple to add features in via progressive enhancement! Say you include Modernizr's detection for CSS gradients. Depending on the browser, it will result in either `<html class="cssgradients">` or `<html class="no-cssgradients">`. Now that you know those two states, you can write CSS to cover both cases ``` .no-cssgradients .header { background: url("images/glossybutton.png"); } .cssgradients .header { background-image: linear-gradient(cornflowerblue, rebeccapurple); } ``` #### classPrefix If one of Modernizr's class names clashes with one of your preexisting classes, you have the option to add a `classPrefix` inside of [your config](#command-line-config). Consider the [hidden](https://github.com/Modernizr/Modernizr/blob/7b8c0f/feature-detects/dom/hidden.js) detect, which adds a `.hidden` class - something a lot of code bases already use to, well, *hide* things. If you wanted to use that specific detection, you could use the following as your configuration ``` { "classPrefix": "foo-", "feature-detects": ["dom/hidden"] } ``` This would mean that rather than `<html class="hidden">`, you would get `<html class="foo-hidden">`. #### no-js By default, Modernizr will rewrite `<html class="no-js">` to `<html class="js">`. This lets hide certain elements that should only be exposed in environments that execute JavaScript. If you want to disable this change, you can set `enableJSClass` to `false` in [your config](#command-line-config). #### enableClasses If you are using a `classPrefix`, such as `supports-`, then you must include that prefix on your `html` element. ie. `supports-no-js` instead of `no-js`. Finally, if you do not want Modernizr to add any of it's classes, you can set `enableClasses` to `false`. This *does not* effect the `.no-js` update, so if you do not want that updated either you will need to set `enableJSClass` to `false` in your configuration. Using Modernizr with JavaScript ------------------------------- #### The Modernizr object Modernizr keeps track of the results of all of it's feature detections via the `Modernizr` object. That means that for each test, a corresponding property will be added. You just have to test for [truthiness](https://developer.mozilla.org/en-US/docs/Glossary/Truthy) in your code to figure out what you want to do ``` if (Modernizr.awesomeNewFeature) { showOffAwesomeNewFeature(); } else { getTheOldLameExperience(); } ``` #### Helper methods Modernizr optionally exposes a number of additional functions, that you can read more about in [Modernizr API](#modernizr-api) Modernizr API ------------- ### Modernizr.on `Modernizr.on(feature,cb)` ``` Modernizr.on('flash', function( result ) { if (result) { // the browser has flash } else { // the browser does not have flash } }); ``` ### Modernizr.addTest `Modernizr.addTest(feature,test)` The most common way of creating your own feature detects is by calling `Modernizr.addTest` with a string (preferably just lowercase, without any punctuation), and a function you want executed that will return a boolean result ``` Modernizr.addTest('itsTuesday', function() { var d = new Date(); return d.getDay() === 2; }); ``` When the above is run, it will set Modernizr.itstuesday to `true` when it is tuesday, and to `false` every other day of the week. One thing to notice is that the names of feature detect functions are always lowercased when added to the Modernizr object. That means that `Modernizr.itsTuesday` will not exist, but `Modernizr.itstuesday` will. Since we only look at the returned value from any feature detection function, you do not need to actually use a function. For simple detections, just passing in a statement that will return a boolean value works just fine. ``` Modernizr.addTest('hasJquery', 'jQuery' in window); ``` Just like before, when the above runs `Modernizr.hasjquery` will be true if jQuery has been included on the page. Not using a function saves a small amount of overhead for the browser, as well as making your code much more readable. Finally, you also have the ability to pass in an object of feature names and their tests. This is handy if you want to add multiple detections in one go. The keys should always be a string, and the value can be either a boolean or function that returns a boolean. ``` var detects = { 'hasjquery': 'jQuery' in window, 'itstuesday': function() { var d = new Date(); return d.getDay() === 2; } } Modernizr.addTest(detects); ``` There is really no difference between the first methods and this one, it is just a convenience to let you write more readable code. ### Modernizr.atRule `Modernizr.atRule(prop)` ``` var keyframes = Modernizr.atRule('@keyframes'); if (keyframes) { // keyframes are supported // could be `@-webkit-keyframes` or `@keyframes` } else { // keyframes === `false` } ``` ### Modernizr.\_domPrefixes Modernizr.\_domPrefixes is exactly the same as [\_prefixes](#modernizr-_prefixes), but rather than kebab-case properties, all properties are their Capitalized variant ``` Modernizr._domPrefixes === [ "Moz", "O", "ms", "Webkit" ]; ``` ### Modernizr.hasEvent `Modernizr.hasEvent(eventName,[element])` `Modernizr.hasEvent` lets you determine if the browser supports a supplied event. By default, it does this detection on a div element ``` hasEvent('blur') // true; ``` However, you are able to give an object as a second argument to hasEvent to detect an event on something other than a div. ``` hasEvent('devicelight', window) // true; ``` ### Modernizr.mq `Modernizr.mq(mq)` Modernizr.mq allows for you to programmatically check if the current browser window state matches a media query. ``` var query = Modernizr.mq('(min-width: 900px)'); if (query) { // the browser window is larger than 900px } ``` Only valid media queries are supported, therefore you must always include values with your media query ``` // good Modernizr.mq('(min-width: 900px)'); // bad Modernizr.mq('min-width'); ``` If you would just like to test that media queries are supported in general, use ``` Modernizr.mq('only all'); // true if MQ are supported, false if not ``` Note that if the browser does not support media queries (e.g. old IE) mq will always return false. ### Modernizr.prefixed `Modernizr.prefixed(prop,[obj],[elem])` Modernizr.prefixed takes a string css value in the DOM style camelCase (as opposed to the css style kebab-case) form and returns the (possibly prefixed) version of that property that the browser actually supports. For example, in older Firefox... ``` prefixed('boxSizing') ``` returns 'MozBoxSizing' In newer Firefox, as well as any other browser that support the unprefixed version would simply return `boxSizing`. Any browser that does not support the property at all, it will return `false`. By default, prefixed is checked against a DOM element. If you want to check for a property on another object, just pass it as a second argument ``` var rAF = prefixed('requestAnimationFrame', window); raf(function() { renderFunction(); }) ``` Note that this will return *the actual function* - not the name of the function. If you need the actual name of the property, pass in `false` as a third argument ``` var rAFProp = prefixed('requestAnimationFrame', window, false); rafProp === 'WebkitRequestAnimationFrame' // in older webkit ``` One common use case for prefixed is if you're trying to determine which transition end event to bind to, you might do something like... ``` var transEndEventNames = { 'WebkitTransition' : 'webkitTransitionEnd', * Saf 6, Android Browser 'MozTransition' : 'transitionend', * only for FF < 15 'transition' : 'transitionend' * IE10, Opera, Chrome, FF 15+, Saf 7+ }; var transEndEventName = transEndEventNames[ Modernizr.prefixed('transition') ]; ``` If you want a similar lookup, but in kebab-case, you can use [prefixedCSS](#modernizr-prefixedcss). ### Modernizr.prefixedCSS `Modernizr.prefixedCSS(prop)` `Modernizr.prefixedCSS` is like `Modernizr.prefixed`, but returns the result in hyphenated form ``` Modernizr.prefixedCSS('transition') // '-moz-transition' in old Firefox ``` Since it is only useful for CSS style properties, it can only be tested against an HTMLElement. Properties can be passed as both the DOM style camelCase or CSS style kebab-case. ### Modernizr.prefixedCSSValue `Modernizr.prefixedCSSValue(prop,value)` `Modernizr.prefixedCSSValue` is a way test for prefixed css properties (e.g. display: -webkit-flex) ``` Modernizr.prefixedCSSValue('background', 'linear-gradient(left, red, red)') ``` ### Modernizr.\_prefixes Modernizr.\_prefixes is the internal list of prefixes that we test against inside of things like [prefixed](#modernizr-prefixed) and [prefixedCSS](#-code-modernizr-prefixedcss). It is simply an array of kebab-case vendor prefixes you can use within your code. Some common use cases include Generating all possible prefixed version of a CSS property ``` var rule = Modernizr._prefixes.join('transform: rotate(20deg); '); rule === 'transform: rotate(20deg); webkit-transform: rotate(20deg); moz-transform: rotate(20deg); o-transform: rotate(20deg); ms-transform: rotate(20deg);' ``` Generating all possible prefixed version of a CSS value ``` rule = 'display:' + Modernizr._prefixes.join('flex; display:') + 'flex'; rule === 'display:flex; display:-webkit-flex; display:-moz-flex; display:-o-flex; display:-ms-flex; display:flex' ``` ### Modernizr.testAllProps `Modernizr.testAllProps(prop,[value],[skipValueTest])` testAllProps determines whether a given CSS property, in some prefixed form, is supported by the browser. ``` testAllProps('boxSizing') // true ``` It can optionally be given a CSS value in string form to test if a property value is valid ``` testAllProps('display', 'block') // true testAllProps('display', 'penguin') // false ``` A boolean can be passed as a third parameter to skip the value check when native detection (@supports) isn't available. ``` testAllProps('shapeOutside', 'content-box', true); ``` ### Modernizr.testProp `Modernizr.testProp(prop,[value],[useValue])` Just like [testAllProps](#modernizr-testallprops), only it does not check any vendor prefixed version of the string. Note that the property name must be provided in camelCase (e.g. boxSizing not box-sizing) ``` Modernizr.testProp('pointerEvents') // true ``` You can also provide a value as an optional second argument to check if a specific value is supported ``` Modernizr.testProp('pointerEvents', 'none') // true Modernizr.testProp('pointerEvents', 'penguin') // false ``` ### Modernizr.testStyles `Modernizr.testStyles(rule,callback,[nodes],[testnames])` `Modernizr.testStyles` takes a CSS rule and injects it onto the current page along with (possibly multiple) DOM elements. This lets you check for features that can not be detected by simply checking the [IDL](https://developer.mozilla.org/en-US/docs/Mozilla/Developer_guide/Interface_development_guide/IDL_interface_rules). ``` Modernizr.testStyles('#modernizr { width: 9px; color: papayawhip; }', function(elem, rule) { // elem is the first DOM node in the page (by default #modernizr) // rule is the first argument you supplied - the CSS rule in string form addTest('widthworks', elem.style.width === '9px') }); ``` If your test requires multiple nodes, you can include a third argument indicating how many additional div elements to include on the page. The additional nodes are injected as children of the `elem` that is returned as the first argument to the callback. ``` Modernizr.testStyles('#modernizr {width: 1px}; #modernizr2 {width: 2px}', function(elem) { document.getElementById('modernizr').style.width === '1px'; // true document.getElementById('modernizr2').style.width === '2px'; // true elem.firstChild === document.getElementById('modernizr2'); // true }, 1); ``` By default, all of the additional elements have an ID of `modernizr[n]`, where `n` is its index (e.g. the first additional, second overall is `#modernizr2`, the second additional is `#modernizr3`, etc.). If you want to have more meaningful IDs for your function, you can provide them as the fourth argument, as an array of strings ``` Modernizr.testStyles('#foo {width: 10px}; #bar {height: 20px}', function(elem) { elem.firstChild === document.getElementById('foo'); // true elem.lastChild === document.getElementById('bar'); // true }, 2, ['foo', 'bar']); ``` Features detected by Modernizr ------------------------------ | Detect | CSS class/JS property | | --- | --- | | Ambient Light Events | **ambientlight** | | --- | --- | | Detects support for the API that provides information about the ambient light levels, as detected by the device's light detector, in terms of lux units. | | Application Cache | **applicationcache** | | Detects support for the Application Cache, for storing data to enable web-based applications run offline. The API has been [heavily criticized](http://alistapart.com/article/application-cache-is-a-douchebag) and discussions are underway to address this. | | HTML5 Audio Element | **audio** | | Detects the audio element | | Battery API | **batteryapi** | | Detect support for the Battery API, for accessing information about the system's battery charge level. | | Blob constructor | **blobconstructor** | | Detects support for the Blob constructor, for creating file-like objects of immutable, raw data. | | Canvas | **canvas** | | Detects support for the `<canvas>` element for 2D drawing. | | Canvas text | **canvastext** | | Detects support for the text APIs for `<canvas>` elements. | | Content Editable | **contenteditable** | | Detects support for the `contenteditable` attribute of elements, allowing their DOM text contents to be edited directly by the user. | | Context menus | **contextmenu** | | Detects support for custom context menus. | | Cookies | **cookies** | | Detects whether cookie support is enabled. | | Cross-Origin Resource Sharing | **cors** | | Detects support for Cross-Origin Resource Sharing: method of performing XMLHttpRequests across domains. | | Web Cryptography | **cryptography** | | Detects support for the cryptographic functionality available under window.crypto.subtle | | Custom Elements API | **customelements** | | Detects support for the Custom Elements API, to create custom html elements via js | | Custom protocol handler | **customprotocolhandler** | | Detects support for the `window.registerProtocolHandler()` API to allow websites to register themselves as possible handlers for particular protocols. | | CustomEvent | **customevent** | | Detects support for CustomEvent. | | Dart | **dart** | | Detects native support for the Dart programming language. | | DataView | **dataview** | | Detects support for the DataView interface for reading data from an ArrayBuffer as part of the Typed Array spec. | | Emoji | **emoji** | | Detects support for emoji character sets. | | Event Listener | **eventlistener** | | Detects native support for addEventListener | | EXIF Orientation | **exiforientation** | | Detects support for EXIF Orientation in JPEG images. iOS looks at the EXIF Orientation flag in JPEGs and rotates the image accordingly. Most desktop browsers just ignore this data. | | Flash | **flash** | | Detects Flash support as well as Flash-blocking plugins | | Force Touch Events | **forcetouch** | | Tests whether the browser supports the detection of Force Touch Events. Force Touch Events allow custom behaviours and interactions to take place based on the given pressure or change in pressure from a compatible trackpad. Force Touch events are available in OS X 10.11 and later on devices equipped with Force Touch trackpads. | | Fullscreen API | **fullscreen** | | Detects support for the ability to make the current website take over the user's entire screen | | GamePad API | **gamepads** | | Detects support for the Gamepad API, for access to gamepads and controllers. | | Geolocation API | **geolocation** | | Detects support for the Geolocation API for users to provide their location to web applications. | | Hashchange event | **hashchange** | | Detects support for the `hashchange` event, fired when the current location fragment changes. | | Hidden Scrollbar | **hiddenscroll** | | Detects overlay scrollbars (when scrollbars on overflowed blocks are visible). This is found most commonly on mobile and OS X. | | History API | **history** | | Detects support for the History API for manipulating the browser session history. | | HTML Imports | **htmlimports** | | Detects support for HTML import, a feature that is used for loading in Web Components. | | IE8 compat mode | **ie8compat** | | Detects whether or not the current browser is IE8 in compatibility mode (i.e. acting as IE7). | | IndexedDB | **indexeddb** | | Detects support for the IndexedDB client-side storage API (final spec). | | IndexedDB Blob | **indexeddbblob** | | Detects if the browser can save File/Blob objects to IndexedDB | | Input attributes | **input** | | Detects support for HTML5 `<input>` element attributes and exposes Boolean subproperties with the results: ``` Modernizr.input.autocomplete Modernizr.input.autofocus Modernizr.input.list Modernizr.input.max Modernizr.input.min Modernizr.input.multiple Modernizr.input.pattern Modernizr.input.placeholder Modernizr.input.required Modernizr.input.step ``` | | input[search] search event | **search** | | There is a custom `search` event implemented in webkit browsers when using an `input[search]` element. | | Form input types | **inputtypes** | | Detects support for HTML5 form input types and exposes Boolean subproperties with the results: ``` Modernizr.inputtypes.color Modernizr.inputtypes.date Modernizr.inputtypes.datetime Modernizr.inputtypes['datetime-local'] Modernizr.inputtypes.email Modernizr.inputtypes.month Modernizr.inputtypes.number Modernizr.inputtypes.range Modernizr.inputtypes.search Modernizr.inputtypes.tel Modernizr.inputtypes.time Modernizr.inputtypes.url Modernizr.inputtypes.week ``` | | Internationalization API | **intl** | | Detects support for the Internationalization API which allow easy formatting of number and dates and sorting string based on a locale | | JSON | **json** | | Detects native support for JSON handling functions. | | Font Ligatures | **ligatures** | | Detects support for OpenType ligatures | | Reverse Ordered Lists | **olreversed** | | Detects support for the `reversed` attribute on the `<ol>` element. | | MathML | **mathml** | | Detects support for MathML, for mathematic equations in web pages. | | Message Channel | **MessageChannel** | | Detects support for Message Channels, a way to communicate between different browsing contexts like iframes, workers, etc.. | | Notification | **notification** | | Detects support for the Notifications API | | Page Visibility API | **pagevisibility** | | Detects support for the Page Visibility API, which can be used to disable unnecessary actions and otherwise improve user experience. | | Navigation Timing API | **performance** | | Detects support for the Navigation Timing API, for measuring browser and connection performance. | | DOM Pointer Events API | **pointerevents** | | Detects support for the DOM Pointer Events API, which provides a unified event interface for pointing input devices, as implemented in IE10+, Edge and Blink. | | Pointer Lock API | **pointerlock** | | Detects support the pointer lock API which allows you to lock the mouse cursor to the browser window. | | postMessage | **postmessage** | | Detects support for the `window.postMessage` protocol for cross-document messaging. | | Proximity API | **proximity** | | Detects support for an API that allows users to get proximity related information from the device's proximity sensor. | | QuerySelector | **queryselector** | | Detects support for querySelector. | | Quota Storage Management API | **quotamanagement** | | Detects the ability to request a specific amount of space for filesystem access | | requestAnimationFrame | **requestanimationframe** | | Detects support for the `window.requestAnimationFrame` API, for offloading animation repainting to the browser for optimized performance. | | ServiceWorker API | **serviceworker** | | ServiceWorkers (formerly Navigation Controllers) are a way to persistently cache resources to built apps that work better offline. | | SVG | **svg** | | Detects support for SVG in `<embed>` or `<object>` elements. | | Template strings | **templatestrings** | | Template strings are string literals allowing embedded expressions. | | Touch Events | **touchevents** | | Indicates if the browser supports the W3C Touch Events API. This *does not* necessarily reflect a touchscreen device:* Older touchscreen devices only emulate mouse events * Modern IE touch devices implement the Pointer Events API instead: use `Modernizr.pointerevents` to detect support for that * Some browsers & OS setups may enable touch APIs when no touchscreen is connected * Future browsers may implement other event models for touch interactions See this article: [You Can't Detect A Touchscreen](http://www.stucox.com/blog/you-cant-detect-a-touchscreen/). It's recommended to bind both mouse and touch/pointer events simultaneously – see [this HTML5 Rocks tutorial](http://www.html5rocks.com/en/mobile/touchandmouse/). This test will also return `true` for Firefox 4 Multitouch support. | | Typed arrays | **typedarrays** | | Detects support for native binary data manipulation via Typed Arrays in JavaScript. Does not check for DataView support; use `Modernizr.dataview` for that. | | Unicode Range | **unicoderange** | | Unicode characters | **unicode** | | Detects if unicode characters are supported in the current document. | | IE User Data API | **userdata** | | Detects support for IE userData for persisting data, an API similar to localStorage but supported since IE5. | | Vibration API | **vibrate** | | Detects support for the API that provides access to the vibration mechanism of the hosting device, to provide tactile feedback. | | HTML5 Video | **video** | | Detects support for the video element, as well as testing what types of content it supports. Subproperties are provided to describe support for `ogg`, `h264` and `webm` formats, e.g.: ``` Modernizr.video // true Modernizr.video.ogg // 'probably' ``` | | VML | **vml** | | Detects support for VML. | | Web Intents | **webintents** | | Detects native support for the Web Intents APIs for service discovery and inter-application communication. Chrome added support for this in v19, but [removed it again in v24](https://lists.w3.org/Archives/Public/public-web-intents/2012Nov/0000.html) because of "a number of areas for development in both the API and specific user experience in Chrome". No other browsers currently support it, however a [JavaScript shim](http://webintents.org/#javascriptshim) is available. | | Web Animation API | **animation** | | Detects support for the Web Animation API, a way to create css animations in js | | WebGL | **webgl** | | WebSockets Support | **websockets** | | XDomainRequest | **xdomainrequest** | | Detects support for XDomainRequest in IE9 & IE8 | | a[download] Attribute | **adownload** | | When used on an `<a>`, this attribute signifies that the resource it points to should be downloaded by the browser rather than navigating to it. | | Audio Loop Attribute | **audioloop** | | Detects if an audio element can automatically restart, once it has finished | | Audio Preload | **audiopreload** | | Detects if audio can be downloaded in the background before it starts playing in the `<audio>` element | | Web Audio API | **webaudio** | | Detects the older non standard webaudio API, (as opposed to the standards based AudioContext API) | | Low Battery Level | **lowbattery** | | Enable a developer to remove CPU intensive CSS/JS when battery is low | | canvas blending support | **canvasblending** | | Detects if Photoshop style blending modes are available in canvas. | | canvas.toDataURL type support | **todataurljpeg,todataurlpng,todataurlwebp** | | canvas winding support | **canvaswinding** | | Determines if winding rules, which controls if a path can go clockwise or counterclockwise | | getRandomValues | **getrandomvalues** | | Detects support for the window.crypto.getRandomValues method for generating cryptographically secure random numbers | | cssall | **cssall** | | Detects support for the `all` css property, which is a shorthand to reset all css properties (except direction and unicode-bidi) to their original value | | CSS Animations | **cssanimations** | | Detects whether or not elements can be animated using CSS | | Appearance | **appearance** | | Detects support for the `appearance` css property, which is used to make an element inherit the style of a standard user interface element. It can also be used to remove the default styles of an element, such as input and buttons. | | Backdrop Filter | **backdropfilter** | | Detects support for CSS Backdrop Filters, allowing for background blur effects like those introduced in iOS 7. Support for this was added to iOS Safari/WebKit in iOS 9. | | CSS Background Blend Mode | **backgroundblendmode** | | Detects the ability for the browser to composite backgrounds using blending modes similar to ones found in Photoshop or Illustrator. | | CSS Background Clip Text | **backgroundcliptext** | | Detects the ability to control specifies whether or not an element's background extends beyond its border in CSS | | Background Position Shorthand | **bgpositionshorthand** | | Detects if you can use the shorthand method to define multiple parts of an element's background-position simultaniously. eg `background-position: right 10px bottom 10px` | | Background Position XY | **bgpositionxy** | | Detects the ability to control an element's background position using css | | Background Repeat | **bgrepeatspace,bgrepeatround** | | Detects the ability to use round and space as properties for background-repeat | | Background Size | **backgroundsize** | | Background Size Cover | **bgsizecover** | | Border Image | **borderimage** | | Border Radius | **borderradius** | | Box Shadow | **boxshadow** | | Box Sizing | **boxsizing** | | CSS Calc | **csscalc** | | Method of allowing calculated values for length units. For example: ``` //lem { width: calc(100% - 3em); } ``` | | CSS :checked pseudo-selector | **checked** | | CSS Font ch Units | **csschunit** | | CSS Columns | **csscolumns** | | CSS Grid (old & new) | **cssgrid,cssgridlegacy** | | CSS Cubic Bezier Range | **cubicbezierrange** | | CSS Display run-in | **display-runin** | | CSS Display table | **displaytable** | | `display: table` and `table-cell` test. (both are tested under one name `table-cell` ) | | CSS text-overflow ellipsis | **ellipsis** | | CSS.escape() | **cssescape** | | Tests for `CSS.escape()` support. | | CSS Font ex Units | **cssexunit** | | CSS Filters | **cssfilters** | | Flexbox | **flexbox** | | Detects support for the Flexible Box Layout model, a.k.a. Flexbox, which allows easy manipulation of layout order and sizing within a container. | | Flexbox (legacy) | **flexboxlegacy** | | Flexbox (tweener) | **flexboxtweener** | | Flex Line Wrapping | **flexwrap** | | Detects support for the `flex-wrap` CSS property, part of Flexbox, which isn’t present in all Flexbox implementations (notably Firefox). This featured in both the 'tweener' syntax (implemented by IE10) and the 'modern' syntax (implemented by others). This detect will return `true` for either of these implementations, as long as the `flex-wrap` property is supported. So to ensure the modern syntax is supported, use together with `Modernizr.flexbox`: ``` if (Modernizr.flexbox && Modernizr.flexwrap) { // Modern Flexbox with `flex-wrap` supported } else { // Either old Flexbox syntax, or `flex-wrap` not supported } ``` | | CSS :focus-within pseudo-selector | **focuswithin** | | @font-face | **fontface** | | CSS Generated Content | **generatedcontent** | | CSS Gradients | **cssgradients** | | CSS Hairline | **hairline** | | Detects support for hidpi/retina hairlines, which are CSS borders with less than 1px in width, for being physically 1px on hidpi screens. | | CSS HSLA Colors | **hsla** | | CSS Hyphens | **csshyphens,softhyphens,softhyphensfind** | | CSS :invalid pseudo-class | **cssinvalid** | | Detects support for the ':invalid' CSS pseudo-class. | | CSS :last-child pseudo-selector | **lastchild** | | CSS Mask | **cssmask** | | CSS Media Queries | **mediaqueries** | | CSS Multiple Backgrounds | **multiplebgs** | | CSS :nth-child pseudo-selector | **nthchild** | | Detects support for the ':nth-child()' CSS pseudo-selector. | | CSS Object Fit | **objectfit** | | CSS Opacity | **opacity** | | CSS Overflow Scrolling | **overflowscrolling** | | CSS Pointer Events | **csspointerevents** | | CSS position: sticky | **csspositionsticky** | | CSS Generated Content Animations | **csspseudoanimations** | | CSS Generated Content Transitions | **csspseudotransitions** | | CSS Reflections | **cssreflections** | | CSS Regions | **regions** | | CSS Font rem Units | **cssremunit** | | CSS UI Resize | **cssresize** | | Test for CSS 3 UI "resize" property | | CSS rgba | **rgba** | | CSS Stylable Scrollbars | **cssscrollbar** | | Scroll Snap Points | **scrollsnappoints** | | Detects support for CSS Snap Points | | CSS Shapes | **shapes** | | CSS general sibling selector | **siblinggeneral** | | CSS Subpixel Fonts | **subpixelfont** | | CSS Supports | **supports** | | CSS :target pseudo-class | **target** | | Detects support for the ':target' CSS pseudo-class. | | CSS text-align-last | **textalignlast** | | CSS textshadow | **textshadow** | | CSS Transforms | **csstransforms** | | CSS Transforms 3D | **csstransforms3d** | | CSS Transforms Level 2 | **csstransformslevel2** | | CSS Transform Style preserve-3d | **preserve3d** | | Detects support for `transform-style: preserve-3d`, for getting a proper 3D perspective on elements. | | CSS Transitions | **csstransitions** | | CSS user-select | **userselect** | | CSS :valid pseudo-class | **cssvalid** | | Detects support for the ':valid' CSS pseudo-class. | | Variable Open Type Fonts | **variablefonts** | | CSS vh unit | **cssvhunit** | | CSS vmax unit | **cssvmaxunit** | | CSS vmin unit | **cssvminunit** | | CSS vw unit | **cssvwunit** | | will-change | **willchange** | | Detects support for the `will-change` css property, which formally signals to the browser that an element will be animating. | | CSS wrap-flow | **wrapflow** | | classList | **classlist** | | createElement with Attributes | **createelementattrs,createelement-attrs** | | dataset API | **dataset** | | Document Fragment | **documentfragment** | | Append multiple elements to the DOM within a single insertion. | | [hidden] Attribute | **hidden** | | Does the browser support the HTML5 [hidden] attribute? | | microdata | **microdata** | | DOM4 MutationObserver | **mutationobserver** | | Determines if DOM4 MutationObserver support is available. | | Passive event listeners | **passiveeventlisteners** | | Detects support for the passive option to addEventListener. | | bdi Element | **bdi** | | Detect support for the bdi element, a way to have text that is isolated from its possibly bidirectional surroundings | | datalist Element | **datalistelem** | | details Element | **details** | | output Element | **outputelem** | | picture Element | **picture** | | progress Element | **progressbar,meter** | | ruby, rp, rt Elements | **ruby** | | Template Tag | **template** | | time Element | **time** | | Track element and Timed Text Track | **texttrackapi,track** | | Unknown Elements | **unknownelements** | | Does the browser support HTML with non-standard / new elements? | | ES5 Array | **es5array** | | Check if browser implements ECMAScript 5 Array per specification. | | ES5 Date | **es5date** | | Check if browser implements ECMAScript 5 Date per specification. | | ES5 Function | **es5function** | | Check if browser implements ECMAScript 5 Function per specification. | | ES5 Object | **es5object** | | Check if browser implements ECMAScript 5 Object per specification. | | ES5 | **es5** | | Check if browser implements everything as specified in ECMAScript 5. | | ES5 Strict Mode | **strictmode** | | Check if browser implements ECMAScript 5 Object strict mode. | | ES5 String | **es5string** | | Check if browser implements ECMAScript 5 String per specification. | | ES5 Syntax | **es5syntax** | | Check if browser accepts ECMAScript 5 syntax. | | ES5 Immutable Undefined | **es5undefined** | | Check if browser prevents assignment to global `undefined` per ECMAScript 5. | | ES6 Array | **es6array** | | Check if browser implements ECMAScript 6 Array per specification. | | ES6 Arrow Functions | **arrow** | | Check if browser implements ECMAScript 6 Arrow Functions per specification. | | ES6 Collections | **es6collections** | | Check if browser implements ECMAScript 6 Map, Set, WeakMap and WeakSet | | ES5 String.prototype.contains | **contains** | | Check if browser implements ECMAScript 6 `String.prototype.contains` per specification. | | ES6 Generators | **generators** | | Check if browser implements ECMAScript 6 Generators per specification. | | ES6 Math | **es6math** | | Check if browser implements ECMAScript 6 Math per specification. | | ES6 Number | **es6number** | | Check if browser implements ECMAScript 6 Number per specification. | | ES6 Object | **es6object** | | Check if browser implements ECMAScript 6 Object per specification. | | ES6 Promises | **promises** | | Check if browser implements ECMAScript 6 Promises per specification. | | ES6 String | **es6string** | | Check if browser implements ECMAScript 6 String per specification. | | Orientation and Motion Events | **devicemotion,deviceorientation** | | Part of Device Access aspect of HTML5, same category as geolocation. `devicemotion` tests for Device Motion Event support, returns boolean value true/false. `deviceorientation` tests for Device Orientation Event support, returns boolean value true/false | | onInput Event | **oninput** | | `oninput` tests if the browser is able to detect the input event | | File API | **filereader** | | `filereader` tests for the File API specification Tests for objects specific to the File API W3C specification without being redundant (don't bother testing for Blob since it is assumed to be the File object's prototype.) | | Filesystem API | **filesystem** | | input[capture] Attribute | **capture** | | When used on an `<input>`, this attribute signifies that the resource it takes should be generated via device's camera, camcorder, sound recorder. | | input[file] Attribute | **fileinput** | | Detects whether input type="file" is available on the platform E.g. iOS < 6 and some android version don't support this | | input[directory] Attribute | **directory** | | When used on an `<input type="file">`, the `directory` attribute instructs the user agent to present a directory selection dialog instead of the usual file selection dialog. | | input[form] Attribute | **formattribute** | | Detects whether input form="form\_id" is available on the platform E.g. IE 10 (and below), don't support this | | input[type="number"] Localization | **localizednumber** | | Detects whether input type="number" is capable of receiving and displaying localized numbers, e.g. with comma separator. | | placeholder attribute | **placeholder** | | Tests for placeholder attribute in inputs and textareas | | form#requestAutocomplete() | **requestautocomplete** | | When used with input[autocomplete] to annotate a form, form.requestAutocomplete() shows a dialog in Chrome that speeds up checkout flows (payments specific for now). | | Form Validation | **formvalidation** | | This implementation only tests support for interactive form validation. To check validation for a specific type or a specific other constraint, the test can be combined:* `Modernizr.inputtypes.number && Modernizr.formvalidation` (browser supports rangeOverflow, typeMismatch etc. for type=number) * `Modernizr.input.required && Modernizr.formvalidation` (browser supports valueMissing) | | iframe[sandbox] Attribute | **sandbox** | | Test for `sandbox` attribute in iframes. | | iframe[seamless] Attribute | **seamless** | | Test for `seamless` attribute in iframes. | | iframe[srcdoc] Attribute | **srcdoc** | | Test for `srcdoc` attribute in iframes. | | Animated PNG | **apng** | | Test for animated png support. | | Image crossOrigin | **imgcrossorigin** | | Detects support for the crossOrigin attribute on images, which allow for cross domain images inside of a canvas without tainting it | | JPEG 2000 | **jpeg2000** | | Test for JPEG 2000 support | | JPEG XR (extended range) | **jpegxr** | | Test for JPEG XR support | | sizes attribute | **sizes** | | Test for the `sizes` attribute on images | | srcset attribute | **srcset** | | Test for the srcset attribute of images | | Webp Alpha | **webpalpha** | | Tests for transparent webp support. | | Webp Animation | **webpanimation** | | Tests for animated webp support. | | Webp Lossless | **webplossless,webp-lossless** | | Tests for non-alpha lossless webp support. | | Webp | **webp** | | Tests for lossy, non-alpha webp support. Tests for all forms of webp support (lossless, lossy, alpha, and animated).. Modernizr.webp // Basic support (lossy) Modernizr.webp.lossless // Lossless Modernizr.webp.alpha // Alpha (both lossy and lossless) Modernizr.webp.animation // Animated WebP | | input formaction | **inputformaction** | | Detect support for the formaction attribute on form inputs | | input formenctype | **inputformenctype** | | Detect support for the formenctype attribute on form inputs, which overrides the form enctype attribute | | input formmethod | **inputformmethod** | | Detect support for the formmethod attribute on form inputs | | input formtarget | **inputformtarget** | | Detect support for the formtarget attribute on form inputs, which overrides the form target attribute | | Hover Media Query | **hovermq** | | Detect support for Hover based media queries | | Pointer Media Query | **pointermq** | | Detect support for Pointer based media queries | | Beacon API | **beacon** | | Detects support for an API that allows for asynchronous transfer of small HTTP data from the client to a server. | | Low Bandwidth Connection | **lowbandwidth** | | Tests for determining low-bandwidth via `navigator.connection` There are two iterations of the `navigator.connection` interface. The first is present in Android 2.2+ and only in the Browser (not WebView)* http://docs.phonegap.com/en/1.2.0/phonegap\_connection\_connection.md.html#connection.type * http://davidbcalhoun.com/2010/using-navigator-connection-android The second is specced at http://dev.w3.org/2009/dap/netinfo/ and perhaps landing in WebKit* https://bugs.webkit.org/show\_bug.cgi?id=73528 Unknown devices are assumed as fast For more rigorous network testing, consider boomerang.js: https://github.com/bluesmoon/boomerang/ | | Server Sent Events | **eventsource** | | Tests for server sent events aka eventsource. | | Fetch API | **fetch** | | Detects support for the fetch API, a modern replacement for XMLHttpRequest. | | XHR responseType='arraybuffer' | **xhrresponsetypearraybuffer** | | Tests for XMLHttpRequest xhr.responseType='arraybuffer'. | | XHR responseType='blob' | **xhrresponsetypeblob** | | Tests for XMLHttpRequest xhr.responseType='blob'. | | XHR responseType='document' | **xhrresponsetypedocument** | | Tests for XMLHttpRequest xhr.responseType='document'. | | XHR responseType='json' | **xhrresponsetypejson** | | Tests for XMLHttpRequest xhr.responseType='json'. | | XHR responseType='text' | **xhrresponsetypetext** | | Tests for XMLHttpRequest xhr.responseType='text'. | | XHR responseType | **xhrresponsetype** | | Tests for XMLHttpRequest xhr.responseType. | | XML HTTP Request Level 2 XHR2 | **xhr2** | | Tests for XHR2. | | script[async] | **scriptasync** | | Detects support for the `async` attribute on the `<script>` element. | | script[defer] | **scriptdefer** | | Detects support for the `defer` attribute on the `<script>` element. | | Speech Recognition API | **speechrecognition** | | Speech Synthesis API | **speechsynthesis** | | Local Storage | **localstorage** | | Session Storage | **sessionstorage** | | Web SQL Database | **websqldatabase** | | style[scoped] | **stylescoped** | | Support for the `scoped` attribute of the `<style>` element. | | SVG as an <img> tag source | **svgasimg** | | SVG clip paths | **svgclippaths** | | Detects support for clip paths in SVG (only, not on HTML content). See [this discussion](https://github.com/Modernizr/Modernizr/issues/213) regarding applying SVG clip paths to HTML content. | | SVG filters | **svgfilters** | | SVG foreignObject | **svgforeignobject** | | Detects support for foreignObject tag in SVG. | | Inline SVG | **inlinesvg** | | Detects support for inline SVG in HTML (not within XHTML). | | SVG SMIL animation | **smil** | | textarea maxlength | **textareamaxlength** | | Detect support for the maxlength attribute of a textarea element | | Blob URLs | **bloburls** | | Detects support for creating Blob URLs | | Data URI | **datauri** | | Detects support for data URIs. Provides a subproperty to report support for data URIs over 32kb in size: ``` Modernizr.datauri // true Modernizr.datauri.over32kb // false in IE8 ``` | | URL parser | **urlparser** | | Check if browser implements the URL constructor for parsing URLs. | | URLSearchParams API | **urlsearchparams** | | Detects support for an API that provides utility methods for working with the query string of a URL. | | Video Autoplay | **videoautoplay** | | Checks for support of the autoplay attribute of the video element. | | Video crossOrigin | **videocrossorigin** | | Detects support for the crossOrigin attribute on video tag | | Video Loop Attribute | **videoloop** | | Video Preload Attribute | **videopreload** | | WebGL Extensions | **webglextensions** | | Detects support for OpenGL extensions in WebGL. It's `true` if the [WebGL extensions API](https://developer.mozilla.org/en-US/docs/Web/WebGL/Using_Extensions) is supported, then exposes the supported extensions as subproperties, e.g.: ``` if (Modernizr.webglextensions) { // WebGL extensions API supported } if ('OES_vertex_array_object' in Modernizr.webglextensions) { // Vertex Array Objects extension supported } ``` | | RTC Data Channel | **datachannel** | | Detect for the RTCDataChannel API that allows for transfer data directly from one peer to another | | getUserMedia | **getusermedia** | | Detects support for the new Promise-based `getUserMedia` API. | | RTC Peer Connection | **peerconnection** | | Binary WebSockets | **websocketsbinary** | | Base 64 encoding/decoding | **atobbtoa** | | Detects support for WindowBase64 API (window.atob && window.btoa). | | Framed window | **framed** | | Tests if page is iframed. | | matchMedia | **matchmedia** | | Detects support for matchMedia. | | Workers from Blob URIs | **blobworkers** | | Detects support for creating Web Workers from Blob URIs. | | Workers from Data URIs | **dataworkers** | | Detects support for creating Web Workers from Data URIs. | | Shared Workers | **sharedworkers** | | Detects support for the `SharedWorker` API from the Web Workers spec. | | Transferables Objects | **transferables** | | Detects whether web workers can use `transferables` objects. | | Web Workers | **webworkers** | | Detects support for the basic `Worker` API from the Web Workers spec. Web Workers provide a simple means for web content to run scripts in background threads. |
programming_docs
mocha mocha mocha ===== Installation ------------- Install with [npm](https://npmjs.org/) globally: ``` $ npm install --global mocha ``` or as a development dependency for your project: ``` $ npm install --save-dev mocha ``` > As of v9.0.0, Mocha requires Node.js v12.0.0 or newer. > > Getting Started ---------------- ``` $ npm install mocha $ mkdir test $ $EDITOR test/test.js # or open with your favorite editor ``` In your editor: ``` var assert = require('assert'); describe('Array', function() { describe('#indexOf()', function() { it('should return -1 when the value is not present', function() { assert.equal([1, 2, 3].indexOf(4), -1); }); }); }); ``` Back in the terminal: ``` $ ./node_modules/mocha/bin/mocha Array #indexOf() ✓ should return -1 when the value is not present 1 passing (9ms) ``` Set up a test script in package.json: ``` "scripts": { "test": "mocha" } ``` Then run tests with: ``` $ npm test ``` Run Cycle Overview ------------------- > Updated for v8.0.0. > > The following is a mid-level outline of Mocha’s “flow of execution” when run in Node.js; the “less important” details have been omitted. In a browser, test files are loaded by `<script>` tags, and calling `mocha.run()` begins at step 9 [below](#serial-mode). ### Serial Mode 1. User (that’s you) executes `mocha` 2. Loads options from config files, if present 3. Mocha processes any command-line options provided (see section on [configuration merging](#merging) for details) 4. If known flags for the `node` executable are found: 1. Mocha will spawn `node` in a child process, executing itself with these flags 2. Otherwise, Mocha does not spawn a child process 5. Mocha loads modules specified by `--require` 1. If a file loaded this way contains known Mocha-specific exports (e.g., [root hook plugins](#root-hook-plugins)), Mocha “registers” these 2. If not, Mocha ignores any exports of a `--require`’d module 6. Mocha validates any custom reporters or interfaces which were loaded via `--require` or otherwise 7. Mocha *discovers* test files; when given no files or directories, it finds files with extensions `.js`, `.mjs` or `.cjs` in the `test` directory (but not its children), relative to the current working directory 8. The (default) [bdd interface](#bdd) loads the test files *in no particular order*, which are given an interface-specific `global` context (this is how, e.g., `describe()` ends up as a global in a test file) 1. When a test file is loaded, Mocha executes all of its suites and finds–*but does not execute*–any hooks and tests therein. 2. Top-level hooks, tests and suites are all made members of an “invisible” *root suite*; there is only *one* root suite for the entire process 9. Mocha runs [global setup fixtures](#global-setup-fixtures), if any 10. Starting with the “root” suite, Mocha executes: 11. Any “before all” hooks (for the *root* suite, this only happens once; see [root hook plugins](#root-hook-plugins)) 12. For each test, Mocha executes: 1. Any “before each” hooks 2. The test (and reports the result) 3. Any “after each” hooks 13. If the current suite has a child suite, repeat the steps in 10. for each child suite; each child suite *inherits* any “before each” and “after each” hooks defined in its parent 14. Any “after all” hooks (for the *root* suite, this only happens once; see [root hook plugins](#root-hook-plugins)) 15. Mocha prints a final summary/epilog, if applicable 16. Mocha runs [global teardown fixtures](#global-teardown-fixtures), if any ### Parallel Mode 1. Repeat steps 1 through 6 from [Serial Mode](#serial-mode) above, skipping reporter validation 2. All test files found are put into a queue (they are *not* loaded by the main process) 3. Mocha runs [global setup fixtures](#global-setup-fixtures), if any 4. Mocha creates a pool of subprocesses (“workers”) 5. *Immediately before* a worker runs the first test it receives, the worker “bootstraps” itself by: 1. Loading all `--require`’d modules 2. Registering any root hook plugins 3. *Ignoring* global fixtures and custom reporters 4. Asserting the built-in or custom interface is valid 6. When a worker receives a test file to run, the worker creates a new Mocha instance *for the single test file*, and: 7. The worker repeats step 8 from [above](#serial-mode) 8. The worker repeats step 10 from [above](#serial-mode), with the caveat that the worker *does not* report test results directly; it holds them in a memory buffer 9. When the worker completes the test file, buffered results are returned to the main process, which then gives them to the user-specified reporter (`spec` by default) 10. The worker makes itself available to the pool; the pool gives the worker another test file to run, if any remain 11. Mocha prints a final summary/epilog, if applicable 12. Mocha runs [global teardown fixtures](#global-teardown-fixtures), if any Detects Multiple Calls to `done()` ----------------------------------- If you use callback-based async tests, Mocha will throw an error if `done()` is called multiple times. This is handy for catching accidental double callbacks. ``` it('double done', function(done) { // Calling `done()` twice is an error setImmediate(done); setImmediate(done); }); ``` Running the above test will give you the below error message: ``` $ ./node_modules/.bin/mocha mocha.test.js ✓ double done 1) double done 1 passing (6ms) 1 failing 1) double done: Error: done() called multiple times at Object.<anonymous> (mocha.test.js:1:63) at require (internal/module.js:11:18) at Array.forEach (<anonymous>) at startup (bootstrap_node.js:187:16) at bootstrap_node.js:608:3 ``` Assertions ----------- Mocha allows you to use any assertion library you wish. In the above example, we’re using Node.js’ built-in [assert](https://nodejs.org/api/assert.html) module — but generally, if it throws an `Error`, it will work! This means you can use libraries such as: * [should.js](https://github.com/shouldjs/should.js) - BDD style shown throughout these docs * [expect.js](https://github.com/LearnBoost/expect.js) - `expect()` style assertions * [chai](https://www.chaijs.com/) - `expect()`, `assert()` and `should`-style assertions * [better-assert](https://github.com/visionmedia/better-assert) - C-style self-documenting `assert()` * [unexpected](https://unexpected.js.org/) - “the extensible BDD assertion toolkit” Asynchronous Code ------------------ By adding an argument (usually named `done`) to `it()` to a test callback, Mocha will know that it should wait for this function to be called to complete the test. This callback accepts both an `Error` instance (or subclass thereof) *or* a falsy value; anything else is invalid usage and throws an error (usually causing a failed test). ``` describe('User', function() { describe('#save()', function() { it('should save without error', function(done) { var user = new User('Luna'); user.save(function(err) { if (err) done(err); else done(); }); }); }); }); ``` Alternatively, use the `done()` callback directly (which will handle an error argument, if it exists): ``` describe('User', function() { describe('#save()', function() { it('should save without error', function(done) { var user = new User('Luna'); user.save(done); }); }); }); ``` ### Working with Promises Alternately, instead of using the `done()` callback, you may return a [Promise](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise). This is useful if the APIs you are testing return promises instead of taking callbacks: ``` beforeEach(function() { return db.clear().then(function() { return db.save([tobi, loki, jane]); }); }); describe('#find()', function() { it('respond with matching records', function() { return db.find({type: 'User'}).should.eventually.have.length(3); }); }); ``` > The latter example uses [Chai as Promised](https://www.npmjs.com/package/chai-as-promised) for fluent promise assertions. > > In Mocha v3.0.0 and newer, returning a `Promise` *and* calling `done()` will result in an exception, as this is generally a mistake: ``` const assert = require('assert'); // antipattern it('should complete this test', function(done) { return new Promise(function(resolve) { assert.ok(true); resolve(); }).then(done); }); ``` The above test will fail with `Error: Resolution method is overspecified. Specify a callback *or* return a Promise; not both.`. In versions older than v3.0.0, the call to `done()` is effectively ignored. ### Using async / await If your JS environment supports [async / await](https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Statements/async_function), you can also write asynchronous tests like this: ``` beforeEach(async function() { await db.clear(); await db.save([tobi, loki, jane]); }); describe('#find()', function() { it('responds with matching records', async function() { const users = await db.find({type: 'User'}); users.should.have.length(3); }); }); ``` Synchronous Code ----------------- When testing synchronous code, omit the callback and Mocha will automatically continue on to the next test. ``` describe('Array', function() { describe('#indexOf()', function() { it('should return -1 when the value is not present', function() { [1, 2, 3].indexOf(5).should.equal(-1); [1, 2, 3].indexOf(0).should.equal(-1); }); }); }); ``` Arrow Functions ---------------- Passing [arrow functions](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Functions/Arrow_functions) (aka “lambdas”) to Mocha is discouraged. Lambdas lexically bind `this` and cannot access the Mocha context. For example, the following code will fail: ``` describe('my suite', () => { it('my test', () => { // should set the timeout of this test to 1000 ms; instead will fail this.timeout(1000); assert.ok(true); }); }); ``` *If you do not need to use* Mocha’s context, lambdas should work. Be aware that using lambdas will be more painful to refactor if the need eventually arises! Hooks ------ With its default “BDD”-style interface, Mocha provides the hooks `before()`, `after()`, `beforeEach()`, and `afterEach()`. These should be used to set up preconditions and clean up after your tests. ``` describe('hooks', function() { before(function() { // runs once before the first test in this block }); after(function() { // runs once after the last test in this block }); beforeEach(function() { // runs before each test in this block }); afterEach(function() { // runs after each test in this block }); // test cases }); ``` > Tests can appear before, after, or interspersed with your hooks. Hooks will run in the order they are defined, as appropriate; all `before()` hooks run (once), then any `beforeEach()` hooks, tests, any `afterEach()` hooks, and finally `after()` hooks (once). > > ### Describing Hooks Any hook can be invoked with an optional description, making it easier to pinpoint errors in your tests. If a hook is given a named function, that name will be used if no description is supplied. ``` beforeEach(function() { // beforeEach hook }); beforeEach(function namedFun() { // beforeEach:namedFun }); beforeEach('some description', function() { // beforeEach:some description }); ``` ### Asynchronous Hooks All hooks (`before()`, `after()`, `beforeEach()`, `afterEach()`) may be sync or async as well, behaving much like a regular test-case. For example, you may wish to populate database with dummy content before each test: ``` describe('Connection', function() { var db = new Connection(), tobi = new User('tobi'), loki = new User('loki'), jane = new User('jane'); beforeEach(function(done) { db.clear(function(err) { if (err) return done(err); db.save([tobi, loki, jane], done); }); }); describe('#find()', function() { it('respond with matching records', function(done) { db.find({type: 'User'}, function(err, res) { if (err) return done(err); res.should.have.length(3); done(); }); }); }); }); ``` ### Root-Level Hooks A hook defined at the top scope of a test file (outside of a suite) is a *root hook*. As of v8.0.0, [Root Hook Plugins](#root-hook-plugins) are the preferred mechanism for setting root hooks. ### Delayed Root Suite > *WARNING: Delayed root suites are incompatible with [parallel mode](#parallel-tests).* > > If you need to perform asynchronous operations before any of your suites are run, you may delay the root suite. Run `mocha` with the `--delay` flag. This will attach a special callback function, `run()`, to the global context: ``` setTimeout(function() { // do some setup describe('my suite', function() { // ... }); run(); }, 5000); ``` Pending Tests -------------- “Pending”–as in “someone should write these test cases eventually”–test-cases are those *without* a callback: ``` describe('Array', function() { describe('#indexOf()', function() { // pending test below it('should return -1 when the value is not present'); }); }); ``` Pending tests will be included in the test results, and marked as pending. A pending test is not considered a failed test. Read the [inclusive tests section](#inclusive-tests) for an example of conditionally marking a test as pending via `this.skip()`. Exclusive Tests ---------------- > *WARNING: Exclusive tests are incompatible with [parallel mode](#parallel-tests).* > > The exclusivity feature allows you to run *only* the specified suite or test-case by appending `.only()` to the function. Here’s an example of executing only a particular suite: ``` describe('Array', function() { describe.only('#indexOf()', function() { // ... }); }); ``` *Note*: All nested suites will still be executed. Here’s an example of executing an individual test case: ``` describe('Array', function() { describe('#indexOf()', function() { it.only('should return -1 unless present', function() { // ... }); it('should return the index when present', function() { // ... }); }); }); ``` Previous to v3.0.0, `.only()` used string matching to decide which tests to execute; this is no longer the case. In v3.0.0 or newer, `.only()` can be used multiple times to define a subset of tests to run: ``` describe('Array', function() { describe('#indexOf()', function() { it.only('should return -1 unless present', function() { // this test will be run }); it.only('should return the index when present', function() { // this test will also be run }); it('should return -1 if called with a non-Array context', function() { // this test will not be run }); }); }); ``` You may also choose multiple suites: ``` describe('Array', function() { describe.only('#indexOf()', function() { it('should return -1 unless present', function() { // this test will be run }); it('should return the index when present', function() { // this test will also be run }); }); describe.only('#concat()', function() { it('should return a new Array', function() { // this test will also be run }); }); describe('#slice()', function() { it('should return a new Array', function() { // this test will not be run }); }); }); ``` But *tests will have precedence*: ``` describe('Array', function() { describe.only('#indexOf()', function() { it.only('should return -1 unless present', function() { // this test will be run }); it('should return the index when present', function() { // this test will not be run }); }); }); ``` *Note*: Hooks, if present, will still be executed. > Be mindful not to commit usages of `.only()` to version control, unless you really mean it! To do so one can run mocha with the option `--forbid-only` in the continuous integration test command (or in a git precommit hook). > > Inclusive Tests ---------------- This feature is the inverse of `.only()`. By appending `.skip()`, you may tell Mocha to ignore test case(s). Anything skipped will be marked as [pending](#pending-tests), and reported as such. Here’s an example of skipping an individual test: ``` describe('Array', function() { describe('#indexOf()', function() { it.skip('should return -1 unless present', function() { // this test will not be run }); it('should return the index when present', function() { // this test will be run }); }); }); ``` You can also put `.skip()` on an entire suite. This is equivalent to appending `.skip()` onto all tests in the suite. Hooks in the suite are also skipped. ``` describe('Array', function() { describe.skip('#indexOf()', function() { it('should return -1 unless present', function() { // this test will not be run }); }); }); ``` *Note*: Code in skipped suites, that is placed outside of hooks or tests is still executed, as mocha will still invoke the suite function to build up the suite structure for visualization. > *Best practice*: Use `.skip()` instead of commenting tests out. > > You may also skip *at runtime* using `this.skip()`. If a test needs an environment or configuration which cannot be detected beforehand, a runtime skip is appropriate. For example: ``` it('should only test in the correct environment', function() { if (/* check test environment */) { // make assertions } else { this.skip(); } }); ``` The above test will be reported as [pending](#pending-tests). It’s also important to note that calling `this.skip()` will effectively *abort* the test. > *Best practice*: To avoid confusion, do not execute further instructions in a test or hook after calling `this.skip()`. > > Contrast the above test with the following code: ``` it('should only test in the correct environment', function() { if (/* check test environment */) { // make assertions } else { // do nothing } }); ``` Because this test *does nothing*, it will be reported as *passing*. > *Best practice*: Don’t do nothing! A test should make an assertion or use `this.skip()`. > > To skip *multiple* tests in this manner, use `this.skip()` in a “before all” hook: ``` before(function() { if (/* check test environment */) { // setup code } else { this.skip(); } }); ``` This will skip all `it`, `beforeEach/afterEach`, and `describe` blocks within the suite. `before/after` hooks are skipped unless they are defined at the same level as the hook containing `this.skip()`. ``` describe('outer', function() { before(function() { this.skip(); }); after(function() { // will be executed }); describe('inner', function() { before(function() { // will be skipped }); after(function() { // will be skipped }); }); }); ``` > *Updated in v7.0.0:* skipping a test within an “after all” hook is disallowed and will throw an exception. Use a return statement or other means to abort hook execution. > > Before Mocha v3.0.0, `this.skip()` was not supported in asynchronous tests and hooks. Retry Tests ------------ You can choose to retry failed tests up to a certain number of times. This feature is designed to handle end-to-end tests (functional tests/Selenium…) where resources cannot be easily mocked/stubbed. **It’s not recommended to use this feature for unit tests**. This feature does re-run a failed test and its corresponding `beforeEach/afterEach` hooks, but not `before/after` hooks. `this.retries()` has no effect on failing hooks. **NOTE**: Example below was written using Selenium webdriver (which [overwrites global Mocha hooks](https://github.com/SeleniumHQ/selenium/blob/c10e8a955883f004452cdde18096d70738397788/javascript/node/selenium-webdriver/testing/index.js) for `Promise` chain). ``` describe('retries', function() { // Retry all tests in this suite up to 4 times this.retries(4); beforeEach(function() { browser.get('http://www.yahoo.com'); }); it('should succeed on the 3rd try', function() { // Specify this test to only retry up to 2 times this.retries(2); expect($('.foo').isDisplayed()).to.eventually.be.true; }); }); ``` Dynamically Generating Tests ----------------------------- Given Mocha’s use of function expressions to define suites and test cases, it’s straightforward to generate your tests dynamically. No special syntax is required — plain ol’ JavaScript can be used to achieve functionality similar to “parameterized” tests, which you may have seen in other frameworks. Take the following example: ``` const assert = require('assert'); function add(args) { return args.reduce((prev, curr) => prev + curr, 0); } describe('add()', function() { const tests = [ {args: [1, 2], expected: 3}, {args: [1, 2, 3], expected: 6}, {args: [1, 2, 3, 4], expected: 10} ]; tests.forEach(({args, expected}) => { it(`correctly adds ${args.length} args`, function() { const res = add(args); assert.strictEqual(res, expected); }); }); }); ``` The above code will produce a suite with three specs: ``` $ mocha add() ✓ correctly adds 2 args ✓ correctly adds 3 args ✓ correctly adds 4 args ``` Tests added inside a `.forEach` handler often don’t play well with editor plugins, especially with “right-click run” features. Another way to parameterize tests is to generate them with a closure. This following example is equivalent to the one above: ``` describe('add()', function() { const testAdd = ({args, expected}) => function() { const res = add(args); assert.strictEqual(res, expected); }; it('correctly adds 2 args', testAdd({args: [1, 2], expected: 3})); it('correctly adds 3 args', testAdd({args: [1, 2, 3], expected: 6})); it('correctly adds 4 args', testAdd({args: [1, 2, 3, 4], expected: 10})); }); ``` With `top-level await` you can collect your test data in a dynamic and asynchronous way while the test file is being loaded: ``` // testfile.mjs import assert from 'assert'; // top-level await: Node >= v14.8.0 with ESM test file const tests = await new Promise(resolve => { setTimeout(() => { resolve([ {args: [1, 2], expected: 3}, {args: [1, 2, 3], expected: 6}, {args: [1, 2, 3, 4], expected: 10} ]); }, 5000); }); // in suites ASYNCHRONOUS callbacks are NOT supported describe('add()', function() { tests.forEach(({args, expected}) => { it(`correctly adds ${args.length} args`, function() { const res = args.reduce((sum, curr) => sum + curr, 0); assert.strictEqual(res, expected); }); }); }); ``` Test duration ------------- Many reporters will display test duration and flag tests that are slow (default: 75ms), as shown here with the SPEC reporter: There are three levels of test duration (depicted in the following image): 1. FAST: Tests that run within half of the “slow” threshold will show the duration in green (if at all). 2. NORMAL: Tests that run exceeding half of the threshold (but still within it) will show the duration in yellow. 3. SLOW: Tests that run exceeding the threshold will show the duration in red. To tweak what’s considered “slow”, you can use the `slow()` method: ``` describe('something slow', function() { this.slow(300000); // five minutes it('should take long enough for me to go make a sandwich', function() { // ... }); }); ``` Timeouts --------- ### Suite-level Suite-level timeouts may be applied to entire test “suites”, or disabled via `this.timeout(0)`. This will be inherited by all nested suites and test-cases that do not override the value. ``` describe('a suite of tests', function() { this.timeout(500); it('should take less than 500ms', function(done) { setTimeout(done, 300); }); it('should take less than 500ms as well', function(done) { setTimeout(done, 250); }); }); ``` ### Test-level Test-specific timeouts may also be applied, or the use of `this.timeout(0)` to disable timeouts all together: ``` it('should take less than 500ms', function(done) { this.timeout(500); setTimeout(done, 300); }); ``` ### Hook-level Hook-level timeouts may also be applied: ``` describe('a suite of tests', function() { beforeEach(function(done) { this.timeout(3000); // A very long environment setup. setTimeout(done, 2500); }); }); ``` Again, use `this.timeout(0)` to disable the timeout for a hook. > In v3.0.0 or newer, a parameter passed to `this.timeout()` greater than the [maximum delay value](https://developer.mozilla.org/docs/Web/API/WindowTimers/setTimeout#Maximum_delay_value) will cause the timeout to be disabled. In v8.0.0 or newer, `this.enableTimeouts()` has been removed. **Warning:** With async tests if you disable timeouts via `this.timeout(0)` and then do not call `done()`, your test will exit silently. > > Diffs ------ Mocha supports the `err.expected` and `err.actual` properties of any thrown `AssertionError`s from an assertion library. Mocha will attempt to display the difference between what was expected, and what the assertion actually saw. Here’s an example of a “string” diff using `--inline-diffs`: Command-Line Usage ------------------- ``` mocha [spec..] Run tests with Mocha Commands mocha inspect [spec..] Run tests with Mocha [default] mocha init <path> create a client-side Mocha setup at <path> Rules & Behavior --allow-uncaught Allow uncaught errors to propagate [boolean] -A, --async-only Require all tests to use a callback (async) or return a Promise [boolean] -b, --bail Abort ("bail") after first test failure [boolean] --check-leaks Check for global variable leaks [boolean] --delay Delay initial execution of root suite [boolean] --dry-run Report tests without executing them [boolean] --exit Force Mocha to quit after tests complete [boolean] --forbid-only Fail if exclusive test(s) encountered [boolean] --forbid-pending Fail if pending test(s) encountered [boolean] --global, --globals List of allowed global variables [array] -j, --jobs Number of concurrent jobs for --parallel; use 1 to run in serial [number] [default: (number of CPU cores - 1)] -p, --parallel Run tests in parallel [boolean] --retries Retry failed tests this many times [number] -s, --slow Specify "slow" test threshold (in milliseconds) [string] [default: 75] -t, --timeout, --timeouts Specify test timeout threshold (in milliseconds) [string] [default: 2000] -u, --ui Specify user interface [string] [default: "bdd"] Reporting & Output -c, --color, --colors Force-enable color output [boolean] --diff Show diff on failure [boolean] [default: true] --full-trace Display full stack traces [boolean] -G, --growl Enable Growl notifications [boolean] --inline-diffs Display actual/expected differences inline within each string [boolean] -R, --reporter Specify reporter to use [string] [default: "spec"] -O, --reporter-option, Reporter-specific options --reporter-options (<k=v,[k1=v1,..]>) [array] Configuration --config Path to config file [string] [default: (nearest rc file)] --package Path to package.json for config [string] File Handling --extension File extension(s) to load [array] [default: ["js","cjs","mjs"]] --file Specify file(s) to be loaded prior to root suite execution [array] [default: (none)] --ignore, --exclude Ignore file(s) or glob pattern(s) [array] [default: (none)] --recursive Look for tests in subdirectories [boolean] -r, --require Require module [array] [default: (none)] -S, --sort Sort test files [boolean] -w, --watch Watch files in the current working directory for changes [boolean] --watch-files List of paths or globs to watch [array] --watch-ignore List of paths or globs to exclude from watching [array] [default: ["node_modules",".git"]] Test Filters -f, --fgrep Only run tests containing this string [string] -g, --grep Only run tests matching this string or regexp [string] -i, --invert Inverts --grep and --fgrep matches [boolean] Positional Arguments spec One or more files, directories, or globs to test [array] [default: ["test"]] Other Options -h, --help Show usage information & exit [boolean] -V, --version Show version number & exit [boolean] --list-interfaces List built-in user interfaces & exit [boolean] --list-reporters List built-in reporters & exit [boolean] Mocha Resources Chat: https://gitter.im/mochajs/mocha GitHub: https://github.com/mochajs/mocha.git Docs: https://mochajs.org/ ``` ### `--allow-uncaught` By default, Mocha will attempt to trap uncaught exceptions thrown from running tests and report these as test failures. Use `--allow-uncaught` to disable this behavior and allow uncaught exceptions to propagate. Will typically cause the process to crash. This flag is useful when debugging particularly difficult-to-track exceptions. ### `--async-only, -A` Enforce a rule that tests must be written in “async” style, meaning each test provides a `done` callback or returns a `Promise`. Non-compliant tests will be marked as failures. ### `--bail, -b` Causes Mocha to stop running tests after the first test failure it encounters. Corresponding “after each” and “after all” hooks are executed for potential cleanup. `--bail` does *not* imply `--exit`. ### `--check-leaks` Use this option to have Mocha check for global variables that are leaked while running tests. Specify globals that are acceptable via the `--global` option (for example: `--check-leaks --global jQuery --global MyLib`). ### `--compilers` > *`--compilers` was removed in v6.0.0. See [further explanation and workarounds](https://github.com/mochajs/mocha/wiki/compilers-deprecation).* > > ### `--dry-run` > *New in v9.0.0.* > > Report tests without executing any of them, neither tests nor hooks. ### `--exit` > *Updated in v4.0.0.* > > TL;DR: If your tests hang after an upgrade to Mocha v4.0.0 or newer, use `--exit` for a quick (though not necessarily recommended) fix. *Prior to* version v4.0.0, *by default*, Mocha would force its own process to exit once it was finished executing all tests. This behavior enables a set of potential problems; it’s indicative of tests (or fixtures, harnesses, code under test, etc.) which don’t clean up after themselves properly. Ultimately, “dirty” tests can (but not always) lead to *false positive* or *false negative* results. “Hanging” most often manifests itself if a server is still listening on a port, or a socket is still open, etc. It can also be something like a runaway `setInterval()`, or even an errant `Promise` that never fulfilled. The *default behavior* in v4.0.0 (and newer) is `--no-exit`, where previously it was `--exit`. **The easiest way to “fix” the issue is to pass `--exit` to the Mocha process.** It *can* be time-consuming to debug — because it’s not always obvious where the problem is — but it *is* recommended to do so. To ensure your tests aren’t leaving messes around, here are some ideas to get started: * See the [Node.js guide to debugging](https://nodejs.org/en/docs/inspector/) * Use the new [`async_hooks`](https://github.com/nodejs/node/blob/master/doc/api/async_hooks.md) API ([example](https://git.io/vdlNM)) * Try something like [wtfnode](https://npm.im/wtfnode) * Use [`.only`](#exclusive-tests) until you find the test that causes Mocha to hang ### `--forbid-only` Enforce a rule that tests may not be exclusive (use of e.g., `describe.only()` or `it.only()` is disallowed). `--forbid-only` causes Mocha to fail when an exclusive (“only’d”) test or suite is encountered, and it will abort further test execution. ### `--forbid-pending` Enforce a rule that tests may not be skipped (use of e.g., `describe.skip()`, `it.skip()`, or `this.skip()` anywhere is disallowed). `--forbid-pending` causes Mocha to fail when a skipped (“pending”) test or suite is encountered, and it will abort further test execution. ### `--global <variable-name>` > *Updated in v6.0.0; the option is `--global` and `--globals` is now an alias.* > > Define a global variable name. For example, suppose your app deliberately exposes a global named `app` and `YUI`, you may want to add `--global app --global YUI`. `--global` accepts wildcards. You could do `--global '*bar'` and it would match `foobar`, `barbar`, etc. You can also pass in `'*'` to ignore all globals. `--global` can accept a comma-delimited list; `--global app,YUI` is equivalent to `--global app --global YUI`. By using this option in conjunction with `--check-leaks`, you can specify a whitelist of known global variables that you *expect* to leak into global scope. ### `--retries <n>` Retries failed tests `n` times. Mocha does not retry test failures by default. ### `--slow <ms>, -s <ms>` Specify the “slow” test threshold in milliseconds. Mocha uses this to highlight test cases that are taking too long. “Slow” tests are not considered failures. Note: A test that executes for *half* of the “slow” time will be highlighted *in yellow* with the default `spec` reporter; a test that executes for entire “slow” time will be highlighted *in red*. ### `--timeout <ms>, -t <ms>` > *Update in v6.0.0: `--no-timeout` is implied when invoking Mocha using inspect flags. It is equivalent to `--timeout 0`. `--timeout 99999999` is no longer needed.* > > Specifies the test case timeout, defaulting to two (2) seconds (2000 milliseconds). Tests taking longer than this amount of time will be marked as failed. To override you may pass the timeout in milliseconds, or a value with the `s` suffix, e.g., `--timeout 2s` and `--timeout 2000` are equivalent. To disable timeouts, use `--no-timeout`. Note: synchronous (blocking) tests are also bound by the timeout, but they will not complete until the code stops blocking. Infinite loops will still be infinite loops! ### `--ui <name>, -u <name>` The `--ui` option lets you specify the interface to use, defaulting to `bdd`. ### `--color, -c, --colors` > *Updated in v6.0.0. `--colors` is now an alias for `--color`.* > > “Force” color output to be enabled, or alternatively force it to be disabled via `--no-color`. By default, Mocha uses the [supports-color](https://npm.im/supports-color) module to decide. In some cases, color output will be explicitly suppressed by certain reporters outputting in a machine-readable format. ### `--diff` When possible, show the difference between expected and actual values when an assertion failure is encountered. This flag is unusual in that it **defaults to `true`**; use `--no-diff` to suppress Mocha’s own diff output. Some assertion libraries will supply their own diffs, in which case Mocha’s will not be used, regardless of the default value. Mocha’s own diff output does not conform to any known standards, and is designed to be human-readable. ### `--full-trace` Enable “full” stack traces. By default, Mocha attempts to distill stack traces into less noisy (though still useful) output. This flag is helpful when debugging a suspected issue within Mocha or Node.js itself. ### `--growl, -G` Enable [Growl](http://growl.info/) (or OS-level notifications where available). Requires extra software to be installed; see the [growl module’s docs](https://npm.im/growl) for more information. ### `--inline-diffs` Enable “inline” diffs, an alternative output for diffing strings. Useful when working with large strings. Does nothing if an assertion library supplies its own diff output. ### `--reporter <name>, -R <name>` Specify the reporter that will be used, defaulting to `spec`. Allows use of third-party reporters. For example, [mocha-lcov-reporter](https://npm.im/mocha-lcov-reporter) may be used with `--reporter mocha-lcov-reporter` after it has been installed. ### `--reporter-option <option>, -O <option>, --reporter-options <option>` > *Updated in v6.0.0. Can be specified multiple times. `--reporter-options` is now an alias for `--reporter-option`.* > > Provide options specific to a reporter in `<key>=<value>` format, e.g., `--reporter tap --reporter-option tapVersion=13`. Not all reporters accept options. Can be specified as a comma-delimited list. ### `--config <path>` > *New in v6.0.0.* > > Specify an explicit path to a [configuration file](#configuring-mocha-nodejs). By default, Mocha will search for a config file if `--config` is not specified; use `--no-config` to suppress this behavior. ### `--opts <path>` > *Removed in v8.0.0. Please use [configuration file](#configuring-mocha-nodejs) instead.* > > ### `--package <path>` > *New in v6.0.0.* > > Specify an explicit path to a [`package.json` file](#configuring-mocha-nodejs) (ostensibly containing configuration in a `mocha` property). By default, Mocha looks for a `package.json` in the current working directory or nearest ancestor, and will use the first file found (regardless of whether it contains a `mocha` property); to suppress `package.json` lookup, use `--no-package`. ### `--extension <ext>` Files having this extension will be considered test files. Defaults to `js`. Specifying `--extension` will *remove* `.js` as a test file extension; use `--extension js` to re-add it. For example, to load `.mjs` and `.js` test files, you must supply `--extension mjs --extension js`. The option can be given multiple times. The option accepts a comma-delimited list: `--extension a,b` is equivalent to `--extension a --extension b`. > *New in v8.2.0.* > > `--extension` now supports multipart extensions (e.g., `spec.js`), leading dots (`.js`) and combinations thereof (`.spec.js`); ### `--file <file|directory|glob>` > *WARNING: `--file` is incompatible with [parallel mode](#parallel-tests).* > > Explicitly *include* a test file to be loaded before other test files. Multiple uses of `--file` are allowed, and will be loaded in order given. Useful if you want to declare, for example, hooks to be run before every test across all other test files. Files specified this way are not affected by `--sort` or `--recursive`. Files specified in this way should contain one or more suites, tests or hooks. If this is not the case, consider `--require` instead. ### `--ignore <file|directory|glob>, --exclude <file|directory|glob>,` Explicitly ignore (exclude) one or more test files, directories or globs (e.g., `some/**/files*`) that would otherwise be loaded. Files specified using `--file` *are not affected* by this option. Can be specified multiple times. ### `--recursive` When looking for test files, recurse into subdirectories. See `--extension` for defining which files are considered test files. ### `--require <module>, -r <module>` Require a module before loading the user interface or test files. This is useful for: * Test harnesses * Assertion libraries that augment built-ins or global scope (such as [should.js](https://npm.im/should)) * Compilers such as Babel via [@babel/register](https://npm.im/@babel/register) or TypeScript via [ts-node](https://npm.im/ts-node) (using `--require ts-node/register`). See [Babel](https://github.com/mochajs/mocha-examples/tree/master/packages/babel) or [TypeScript](https://github.com/mochajs/mocha-examples/tree/master/packages/typescript) working examples. Modules required in this manner are expected to do work synchronously; Mocha won’t wait for async tasks in a required module to finish. **You cannot use `--require` to set hooks**. If you want to set hooks to run, e.g., before each test, use a [Root Hook Plugin](#root-hook-plugins). > As of v8.0.0, Mocha supports `--require` for [NodeJS native ESM](#nodejs-native-esm-support). There is no separate `--import` flag. > > ### `--sort, -S` > *WARNING: `--sort` is incompatible with [parallel mode](#parallel-tests).* > > Sort test files (by absolute path) using [Array.prototype.sort](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/sort). ### `--watch, -w` Rerun tests on file changes. The `--watch-files` and `--watch-ignore` options can be used to control which files are watched for changes. Tests may be rerun manually by typing ⓡ ⓢ ⏎ (same shortcut as `nodemon`). ### `--watch-files <file|directory|glob>` > *New in v7.0.0* > > List of paths or globs to watch when `--watch` is set. If a file matching the given glob changes or is added or removed mocha will rerun all tests. If the path is a directory all files and subdirectories will be watched. By default all files in the current directory having one of the extensions provided by `--extension` and not contained in the `node_modules` or `.git` folders are watched. The option can be given multiple times. The option accepts a comma-delimited list: `--watch-files a,b` is equivalent to `--watch-files a --watch-files b` ### `--watch-ignore <file|directory|glob>` > *New in v7.0.0* > > List of paths or globs to exclude from watching. Defaults to `node_modules` and `.git`. To exclude all files in a directory it is preferable to use `foo/bar` instead of `foo/bar/**/*`. The latter will still watch the directory `foo/bar` but will ignore all changes to the content of that directory. The option can be given multiple times. The option accepts a comma-delimited list: `--watch-ignore a,b` is equivalent to `--watch-ignore a --watch-ignore b` ### `--fgrep <string>, -f <string>` > *BREAKING CHANGE in v6.0.0; now mutually exclusive with `--grep`.* > > Cause Mocha to only run tests having titles containing the given `string`. Mutually exclusive with `--grep`. ### `--grep <regexp>, -g <regexp>` > *BREAKING CHANGE in v6.0.0; now mutually exclusive with `--fgrep`.* > > Cause Mocha to only run tests matching the given `regexp`, which is internally compiled to a [RegExp](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Regexp). Suppose, for example, you have “api” related tests, as well as “app” related tests, as shown in the following snippet; One could use `--grep api` or `--grep app` to run one or the other. The same goes for any other part of a suite or test-case title, `--grep users` would be valid as well, or even `--grep GET`. ``` describe('api', function() { describe('GET /api/users', function() { it('respond with an array of users', function() { // ... }); }); }); describe('app', function() { describe('GET /users', function() { it('respond with an array of users', function() { // ... }); }); }); ``` Mutually exclusive with `--fgrep`. ### `--invert` Use the *inverse* of the match specified by `--grep` or `fgrep`. Requires either `--grep` or `--fgrep` (but not both). ### `--inspect, --inspect-brk, inspect` > *BREAKING CHANGE in v7.0.0; `--debug` / `--debug-brk` are removed and `debug` is deprecated.* > > Enables Node.js’ inspector. Use `--inspect` / `--inspect-brk` to launch the V8 inspector for use with Chrome Dev Tools. Use `inspect` to launch Node.js’ internal debugger. All of these options are mutually exclusive. Implies `--no-timeout`. ### `--parallel, -p` > *New in v.8.0.0.* > > Use the `--parallel` flag to run tests in a worker pool. Each test file will be put into a queue and executed as workers become available. **NOTICE**: `--parallel` has certain implications for Mocha’s behavior which you must be aware of. Read more about [running tests in parallel](#parallel-tests). ### `--jobs <count>, -j <count>` > *New in v.8.0.0.* > > Use `--jobs <count>` to specify the *maximum* number of processes in the worker pool. The default value is the *number of CPU cores* less 1. Hint: Use `--jobs 0` or `--jobs 1` to temporarily disable `--parallel`. Has no effect unless used with [`--parallel`](#-parallel-p). ### About Option Types > *Updated in v6.0.0.* > > Each flag annotated of type `[boolean]` in Mocha’s `--help` output can be *negated* by prepending `--no-` to the flag name. For example, `--no-color` will disable Mocha’s color output, which is enabled by default. Unless otherwise noted, *all* boolean flags default to `false`. ### About `node` Flags The `mocha` executable supports all applicable flags which the `node` executable supports. These flags vary depending on your version of Node.js. `node` flags can be defined in Mocha’s [configuration](#configuring-mocha-nodejs). ### `--enable-source-maps` > *New in Node.js v12.12.0* > > If the [`--enable-source-maps`](https://nodejs.org/dist/latest-v12.x/docs/api/cli.html#cli_enable_source_maps) flag is passed to mocha, source maps will be collected and used to provide accurate stack traces for transpiled code: ``` Error: cool at Object.<anonymous> (/Users/fake-user/bigco/nodejs-tasks/build/src/index.js:27:7) -> /Users/fake-user/bigco/nodejs-tasks/src/index.ts:24:7 ``` ### About V8 Flags Prepend `--v8-` to any flag listed in the output of `node --v8-options` (excluding `--v8-options` itself) to use it. V8 flags can be defined in Mocha’s [configuration](#configuring-mocha-nodejs). Parallel Tests --------------- > *New in v.8.0.0.* > > Depending on the number and nature of your tests, you may find a significant performance benefit when running tests in parallel (using the [`--parallel`](#-parallel-p) flag). Parallel tests should work out-of-the box for many use cases. However, you must be aware of some important implications of the behavior. > *Note: Authors of third-party libraries built on Mocha should read this!* > > ### Reporter Limitations Due to the nature of the following reporters, they cannot work when running tests in parallel: * [`markdown`](#markdown) * [`progress`](#progress) * [`json-stream`](#json-stream) These reporters expect Mocha to know *how many tests it plans to run* before execution. This information is unavailable in parallel mode, as test files are loaded only when they are about to be run. In serial mode, tests results will “stream” as they occur. In parallel mode, reporter output is *buffered*; reporting will occur after each file is completed. In practice, the reporter output will appear in “chunks” (but will otherwise be identical). If a test file is particularly slow, there may be a significant pause while it’s running. ### Exclusive Tests are Disallowed **You cannot use `it.only`, `describe.only`, `this.only()`, etc., in parallel mode.** This is for the same reason as the incompatible reporters noted above: in parallel mode, Mocha does not load all files and suites into memory before running tests. Suggested workarounds: 1. Use [`--grep`](#-grep-regexp-g-regexp) or [`--fgrep`](http://localhost:8080/#-fgrep-string-f-string) instead; it’s not particularly efficient, but it will work. 2. Don’t use parallel mode. Likely, you won’t be running very many exclusive tests, so you won’t see a great benefit from parallel mode anyhow. > *TIP: If parallel mode is defined in your config file, you can temporarily disable it on the command-line by using either the `--no-parallel` flag or reducing the job count, e.g., `--jobs=0`.* > > ### File Order is Non-Deterministic In parallel mode, Mocha does not guarantee the order in which test files will run, nor which worker process runs them. Because of this, the following options, which depend on order, *cannot be used* in parallel mode: * [`--file`](#-file-filedirectoryglob) * [`--sort`](#-sort-s) * [`--delay`](#delayed-root-suite) ### Test Duration Variability Running tests in parallel mode will naturally use more system resources. The OS may take extra time to schedule and complete some operations, depending on system load. For this reason, the timeouts of *individual tests* may need to be increased either [globally](#-timeout-ms-t-ms) or [otherwise](#timeouts). ### “Bail” is “Best Effort” When used with `--bail` (or `this.bail()`) to exit after the first failure, it’s likely other tests will be running at the same time. Mocha must shut down its worker processes before exiting. Likewise, subprocesses may throw uncaught exceptions. When used with `--allow-uncaught`, Mocha will “bubble” this exception to the main process, but still must shut down its processes. Either way, Mocha will abort the test run “very soon.” ### Root Hooks Are Not Global > *NOTE: This only applies when running in parallel mode.* > > A *root hook* is a hook in a test file which is *not defined* within a suite. An example using the `bdd` interface: ``` // test/setup.js // root hook to run before every test (even in other files) beforeEach(function() { doMySetup(); }); // root hook to run after every test (even in other files) afterEach(function() { doMyTeardown(); }); ``` When run (in the default “serial” mode) via this command: ``` mocha --file "./test/setup.js" "./test/**/*.spec.js" ``` `setup.js` will be executed *first*, and install the two hooks shown above for every test found in `./test/**/*.spec.js`. **The above example does not work in parallel mode.** When Mocha runs in parallel mode, **test files do not share the same process,** nor do they share the same instance of Mocha. Consequently, a hypothetical root hook defined in test file *A* **will not be present** in test file *B*. Here are a couple suggested workarounds: 1. `require('./setup.js')` or `import './setup.js'` at the top of every test file. Best avoided for those averse to boilerplate. 2. *Recommended*: Define root hooks in a “required” file, using the new (also as of v8.0.0) [Root Hook Plugin](#root-hook-plugins) system. If you need to run some code *once and only once*, use a [global fixture](#global-fixtures) instead. ### No Browser Support Parallel mode is only available in Node.js, for now. ### Limited Reporter API for Third-Party Reporters Third-party reporters may encounter issues when attempting to access non-existent properties within `Test`, `Suite`, and `Hook` objects. If a third-party reporter does not work in parallel mode (but otherwise works in serial mode), please [file an issue](https://github.com/mochajs/mocha/issues/new). ### Troubleshooting Parallel Mode If you find your tests don’t work properly when run with [`--parallel`](#-parallel-p), either shrug and move on, or use this handy-dandy checklist to get things working: * ✅ Ensure you are using a [supported reporter](#reporter-limitations). * ✅ Ensure you are not using [other unsupported flags](#file-order-is-non-deterministic). * ✅ Double-check your [config file](#configuring-mocha-nodejs); options set in config files will be merged with any command-line option. * ✅ Look for root hooks (they look like [this](#root-hooks-are-not-global)) in your tests. Move them into a [Root Hook Plugin](#root-hook-plugins). * ✅ Do any assertion, mock, or other test libraries you’re consuming use root hooks? They may need to be [migrated](#migrating-a-library-to-use-root-hook-plugins) for compatibility with parallel mode. * ✅ If tests are unexpectedly timing out, you may need to increase the default test timeout (via [`--timeout`](#-timeout-ms-t-ms)) * ✅ Ensure your tests do not depend on being run in a specific order. * ✅ Ensure your tests clean up after themselves; remove temp files, handles, sockets, etc. Don’t try to share state or resources between test files. ### Caveats About Testing in Parallel Some types of tests are *not* so well-suited to run in parallel. For example, extremely timing-sensitive tests, or tests which make I/O requests to a limited pool of resources (such as opening ports, or automating browser windows, hitting a test DB, or remote server, etc.). Free-tier cloud CI services may not provide a suitable multi-core container or VM for their build agents. Regarding expected performance gains in CI: your mileage may vary. It may help to use a conditional in a `.mocharc.js` to check for `process.env.CI`, and adjust the job count as appropriate. It’s unlikely (but not impossible) to see a performance gain from a [job count](#-jobs-count-j-count) *greater than* the number of available CPU cores. That said, *play around with the job count*–there’s no one-size-fits all, and the unique characteristics of your tests will determine the optimal number of jobs; it may even be that fewer is faster! Root Hook Plugins ------------------ > *New in v8.0.0.* > > In some cases, you may want a [hook](#hooks) before (or after) every test in every file. These are called *root hooks*. Previous to v8.0.0, the way to accomplish this was to use `--file` combined with root hooks (see [example above](#root-hooks-are-not-global)). This still works in v8.0.0, but *not* when running tests in parallel mode! For that reason, running root hooks using this method is *strongly discouraged*, and may be deprecated in the future. A *Root Hook Plugin* is a JavaScript file loaded via [`--require`](#-require-module-r-module) which “registers” one or more root hooks to be used across all test files. ### Defining a Root Hook Plugin A Root Hook Plugin file is a script which exports (via `module.exports`) a `mochaHooks` property. It is loaded via `--require <file>`. Here’s a simple example which defines a root hook, written using CJS and ESM syntax. #### [#](#with-commonjs) With CommonJS ``` // test/hooks.js exports.mochaHooks = { beforeEach(done) { // do something before every test done(); } }; ``` #### [#](#with-es-modules) With ES Modules We’re using the `.mjs` extension in these examples. > *Tip: If you’re having trouble getting ES modules to work, refer to [the Node.js documentation](https://nodejs.org/api/esm.html).* > > ``` // test/hooks.mjs export const mochaHooks = { beforeEach(done) { // do something before every test done(); } }; ``` > *Note: Further examples will use ESM syntax.* > > ### Available Root Hooks Root hooks work with any interface, but *the property names do not change*. In other words, if you are using the `tdd` interface, `suiteSetup` maps to `beforeAll`, and `setup` maps to `beforeEach`. Available root hooks and their behavior: * `beforeAll`: + In **serial** mode (Mocha’s default), *before all tests begin, once only* + In **parallel** mode, run *before all tests begin, for each file* * `beforeEach`: + In **both** modes, run *before each test* * `afterAll`: + In **serial** mode, run *after all tests end, once only* + In **parallel** mode, run *after all tests end, for each file* * `afterEach`: + In **both** modes, run *after every test* > *Tip: If you need to ensure code runs once and only once in any mode, use [global fixtures](#global-fixtures).* > > As with other hooks, `this` refers to to the current context object: ``` // test/hooks.mjs export const mochaHooks = { beforeAll() { // skip all tests for bob if (require('os').userInfo().username === 'bob') { return this.skip(); } } }; ``` ### Multiple Root Hooks in a Single Plugin Multiple root hooks can be defined in a single plugin, for organizational purposes. For example: ``` // test/hooks.mjs export const mochaHooks = { beforeEach: [ function(done) { // do something before every test, // then run the next hook in this array }, async function() { // async or Promise-returning functions allowed } ] }; ``` ### Root Hook Plugins Can Export a Function If you need to perform some logic–such as choosing a root hook conditionally, based on the environment–`mochaHooks` can be a *function* which returns the expected object. ``` // test/hooks.mjs export const mochaHooks = () => { if (process.env.CI) { // root hooks object return { beforeEach: [ function() { // CI-specific beforeEach }, function() { // some other CI-specific beforeEach } ] }; } // root hooks object return { beforeEach() { // regular beforeEach } }; }; ``` If you need to perform an async operation, `mochaHooks` can be `Promise`-returning: ``` // test/hooks.mjs export const mochaHooks = async () => { const result = await checkSomething(); // only use a root hook if `result` is truthy if (result) { // root hooks object return { beforeEach() { // something } }; } }; ``` ### Multiple Root Hook Plugins Multiple root hook plugins can be registered by using `--require` multiple times. For example, to register the root hooks in `hooks-a.js` and `hooks-b.js`, use `--require hooks-a.js --require hooks-b.js`. These will be registered (and run) *in order*. ### Migrating Tests to use Root Hook Plugins To migrate your tests using root hooks to a root hook plugin: 1. Find your root hooks (hooks defined *outside* of a suite–usually `describe()` callback). 2. Create a new file, e.g., `test/hooks.js`. 3. *Move* your root hooks into `test/hooks.js`. 4. In `test/hooks.js`, make your hooks a member of an exported `mochaHooks` property. 5. Use `--require test/hooks.js` (even better: use a [config file](#configuring-mocha-nodejs) with `{"require": "test/hooks.js"}`) when running your tests. For example, given the following file, `test/test.spec.js`, containing root hooks: ``` // test/test.spec.js beforeEach(function() { // global setup for all tests }); after(function() { // one-time final cleanup }); describe('my test suite', function() { it('should have run my global setup', function() { // make assertion }); }); ``` Your `test/hooks.js` (for this example, a CJS module) should contain: ``` // test/hooks.js exports.mochaHooks = { beforeEach: function() { // global setup for all tests }, afterAll: function() { // one-time final cleanup } }; ``` > *NOTE: Careful! `after` becomes `afterAll` and `before` becomes `beforeAll`.* > > Your original `test/test.spec.js` should now contain: ``` // test/test.spec.js describe('my test suite', function() { it('should have run my global setup', function() { // make assertion }); }); ``` Running `mocha --require test/hooks.js test/test.spec.js` will run as before (and is now ready to be used with [`--parallel`](#-parallel-p)). ### Migrating a Library to use Root Hook PLugins If you’re a library maintainer, and your library uses root hooks, you can migrate by refactoring your entry point: * Your library should *always* export a [`mochaHooks` object](#defining-a-root-hook-plugin). * To maintain backwards compatibility, run your root hooks *if and only if* `global.beforeEach` (or other relevant hook) exists. * Instruct your users to `--require <your-package>` when running `mocha`. Global Fixtures ---------------- > New in v8.2.0 > > At first glance, *global fixtures* seem similar to [root hooks](#root-hook-plugins). However, unlike root hooks, global fixtures: 1. Are *guaranteed* to execute *once and only once* 2. Work identically parallel mode, watch mode, and serial mode 3. Do not share a context with tests, suites, or other hooks There are two types of global fixtures: [global setup fixtures](#global-setup-fixtures) and [global teardown fixtures](#global-teardown-fixtures). ### Global Setup Fixtures To create a global setup fixture, export `mochaGlobalSetup` from a script, e.g.,: ``` // fixtures.cjs // can be async or not exports.mochaGlobalSetup = async function() { this.server = await startSomeServer({port: process.env.TEST_PORT}); console.log(`server running on port ${this.server.port}`); }; ``` …or an ES module: ``` // fixtures.mjs // can be async or not export async function mochaGlobalSetup() { this.server = await startSomeServer({port: process.env.TEST_PORT}); console.log(`server running on port ${this.server.port}`); } ``` To use it, load this file when running Mocha via `mocha --require fixtures.cjs` (or whatever you have named the file). > Remember: you can define “requires” in a [configuration file](#configuring-mocha-nodejs). > > Now, before Mocha loads and runs your tests, it will execute the above global setup fixture, starting a server for testing. This won’t shut *down* the server when Mocha is done, however! To do that, use a [*global teardown fixture*](#global-teardown-fixtures). ### Global Teardown Fixtures Just like a [global setup fixture](#global-setup-fixtures), a *global teardown fixture* can be created by exporting from a “required” script (we can put both types of fixtures in a single file): ``` // fixtures.cjs, cont'd // can be async or not exports.mochaGlobalTeardown = async function() { await this.server.stop(); console.log('server stopped!'); }; ``` …or an ES module: ``` // fixtures.mjs, cont'd // can be async or not export async function mochaGlobalTeardown() { await this.server.stop(); console.log('server stopped!'); } ``` You’ll note that we used `this` in the fixture examples. Global setup fixtures and global teardown fixtures *share a context*, which means we can add properties to the context object (`this`) in the setup fixture, and reference them later in the teardown fixture. This is more useful when the fixtures are in separate files, since you can just use JS’ variable scoping rules instead ([example below](#when-not-to-use-global-fixtures)). As explained [above](#global-fixtures)–and [below](#when-not-to-use-global-fixtures)–test files *do not* have access to this context object. ### When To Use Global Fixtures Global fixtures are good for spinning up a server, opening a socket, or otherwise creating a resource that your tests will repeatedly access via I/O. ### When Not To Use Global Fixtures If you need to access an in-memory value (such as a file handle or database connection), *don’t* use global fixtures to do this, because your tests will not have access to the value. > You could be clever and try to get around this restriction by assigning something to the `global` object, but this will *not* work in parallel mode. It’s probably best to play by the rules! > > Instead, use the global fixture to *start* the database, and use [root hook plugins](#root-hook-plugins) or plain ol’ [hooks](#hooks) to create a connection. Here’s an example of using global fixtures and “before all” hooks to get the job done. Note that we do not reference the `server` object anywhere in our tests! First, use a global fixture to start and stop a test server: ``` // fixtures.mjs let server; export const mochaGlobalSetup = async () => { server = await startSomeServer({port: process.env.TEST_PORT}); console.log(`server running on port ${server.port}`); }; export const mochaGlobalTeardown = async () => { await server.stop(); console.log('server stopped!'); }; ``` Then, connect to the server in your tests: ``` // test.spec.mjs import {connect} from 'my-server-connector-thingy'; describe('my API', function() { let connection; before(async function() { connection = await connect({port: process.env.TEST_PORT}); }); it('should be a nice API', function() { // assertions here }); after(async function() { return connection.close(); }); }); ``` Finally, use this command to bring it together: `mocha --require fixtures.mjs test.spec.mjs`. Test Fixture Decision-Tree Wizard Thing ---------------------------------------- This flowchart will help you decide which of [hooks](#hooks), [root hook plugins](#root-hook-plugins) or [global fixtures](#global-fixtures) you should use. Interfaces ----------- Mocha’s “interface” system allows developers to choose their style of DSL. Mocha has **BDD**, **TDD**, **Exports**, **QUnit** and **Require**-style interfaces. ### BDD The **BDD** interface provides `describe()`, `context()`, `it()`, `specify()`, `before()`, `after()`, `beforeEach()`, and `afterEach()`. `context()` is just an alias for `describe()`, and behaves the same way; it provides a way to keep tests easier to read and organized. Similarly, `specify()` is an alias for `it()`. > All of the previous examples were written using the **BDD** interface. > > ``` describe('Array', function() { before(function() { // ... }); describe('#indexOf()', function() { context('when not present', function() { it('should not throw an error', function() { (function() { [1, 2, 3].indexOf(4); }.should.not.throw()); }); it('should return -1', function() { [1, 2, 3].indexOf(4).should.equal(-1); }); }); context('when present', function() { it('should return the index where the element first appears in the array', function() { [1, 2, 3].indexOf(3).should.equal(2); }); }); }); }); ``` ### TDD The **TDD** interface provides `suite()`, `test()`, `suiteSetup()`, `suiteTeardown()`, `setup()`, and `teardown()`: ``` suite('Array', function() { setup(function() { // ... }); suite('#indexOf()', function() { test('should return -1 when not present', function() { assert.equal(-1, [1, 2, 3].indexOf(4)); }); }); }); ``` ### Exports The **Exports** interface is much like Mocha’s predecessor [expresso](https://github.com/tj/expresso). The keys `before`, `after`, `beforeEach`, and `afterEach` are special-cased, object values are suites, and function values are test-cases: ``` module.exports = { before: function() { // ... }, Array: { '#indexOf()': { 'should return -1 when not present': function() { [1, 2, 3].indexOf(4).should.equal(-1); } } } }; ``` ### QUnit The [QUnit](https://qunitjs.com/)-inspired interface matches the “flat” look of QUnit, where the test suite title is defined *before* the test-cases. Like TDD, it uses `suite()` and `test()`, but resembling BDD, it also contains `before()`, `after()`, `beforeEach()`, and `afterEach()`. ``` function ok(expr, msg) { if (!expr) throw new Error(msg); } suite('Array'); test('#length', function() { var arr = [1, 2, 3]; ok(arr.length == 3); }); test('#indexOf()', function() { var arr = [1, 2, 3]; ok(arr.indexOf(1) == 0); ok(arr.indexOf(2) == 1); ok(arr.indexOf(3) == 2); }); suite('String'); test('#length', function() { ok('foo'.length == 3); }); ``` ### Require The `require` interface allows you to require the `describe` and friend words directly using `require` and call them whatever you want. This interface is also useful if you want to avoid global variables in your tests. *Note*: The `require` interface cannot be run via the `node` executable, and must be run via `mocha`. ``` var testCase = require('mocha').describe; var pre = require('mocha').before; var assertions = require('mocha').it; var assert = require('chai').assert; testCase('Array', function() { pre(function() { // ... }); testCase('#indexOf()', function() { assertions('should return -1 when not present', function() { assert.equal([1, 2, 3].indexOf(4), -1); }); }); }); ``` Reporters ---------- Mocha reporters adjust to the terminal window, and always disable ANSI-escape coloring when the stdio streams are not associated with a TTY. ### Spec Alias: `Spec`, `spec` This is the default reporter. The Spec reporter outputs a hierarchical view nested just as the test cases are. ### Dot Matrix Alias: `Dot`, `dot` The Dot Matrix reporter is a series of characters which represent test cases. Failures highlight in red exclamation marks (`!`), pending tests with a blue comma (`,`), and slow tests as yellow. Good if you prefer minimal output. ### Nyan Alias: `Nyan`, `nyan` The Nyan reporter is exactly what you might expect: ### TAP Alias: `TAP`, `tap` The TAP reporter emits lines for a [Test-Anything-Protocol](https://en.wikipedia.org/wiki/Test_Anything_Protocol) consumer. ### Landing Strip Alias: `Landing`, `landing` The Landing Strip reporter is a gimmicky test reporter simulating a plane landing 😃 unicode ftw ### List Alias: `List`, `list` The List reporter outputs a simple specifications list as test cases pass or fail, outputting the failure details at the bottom of the output. ### Progress Alias: `Progress`, `progress` The Progress reporter implements a simple progress-bar: ### JSON Alias: `JSON`, `json` The JSON reporter outputs a single large JSON object when the tests have completed (failures or not). ### JSON Stream Alias: `JSONStream`, `json-stream` The JSON Stream reporter outputs newline-delimited JSON “events” as they occur, beginning with a “start” event, followed by test passes or failures, and then the final “end” event. ### Min Alias: `Min`, `min` The Min reporter displays the summary only, while still outputting errors on failure. This reporter works great with `--watch` as it clears the terminal in order to keep your test summary at the top. ### Doc Alias: `Doc`, `doc` The Doc reporter outputs a hierarchical HTML body representation of your tests. Wrap it with a header, footer, and some styling, then you have some fantastic documentation! For example, suppose you have the following JavaScript: ``` describe('Array', function() { describe('#indexOf()', function() { it('should return -1 when the value is not present', function() { [1, 2, 3].indexOf(5).should.equal(-1); [1, 2, 3].indexOf(0).should.equal(-1); }); }); }); ``` The command `mocha --reporter doc array` would yield: ``` <section class="suite"> <h1>Array</h1> <dl> <section class="suite"> <h1>#indexOf()</h1> <dl> <dt>should return -1 when the value is not present</dt> <dd> <pre><code>[1,2,3].indexOf(5).should.equal(-1); [1,2,3].indexOf(0).should.equal(-1);</code></pre> </dd> </dl> </section> </dl> </section> ``` The SuperAgent request library [test documentation](https://visionmedia.github.io/superagent/docs/test.html) was generated with Mocha’s doc reporter using this Bash command: ``` $ mocha --reporter=doc | cat docs/head.html - docs/tail.html > docs/test.html ``` View SuperAgent’s [Makefile](https://github.com/visionmedia/superagent/blob/master/Makefile) for reference. ### Markdown Alias: `Markdown`, `markdown` The Markdown reporter generates a markdown TOC and body for your test suite. This is great if you want to use the tests as documentation within a Github wiki page, or a markdown file in the repository that Github can render. For example, here is the Connect [test output](https://github.com/senchalabs/connect/blob/90a725343c2945aaee637e799b1cd11e065b2bff/tests.md). ### XUnit Alias: `XUnit`, `xunit` The XUnit reporter is also available. It outputs an XUnit-compatible XML document, often applicable in CI servers. By default, it will output to the console. To write directly to a file, use `--reporter-option output=filename.xml`. To specify custom report title, use `--reporter-option suiteName="Custom name"`. ### Third-Party Reporters Mocha allows you to define custom reporters. For more information see the [wiki](https://github.com/mochajs/mocha/wiki/Third-party-reporters). Examples: * the [TeamCity reporter](https://github.com/travisjeffery/mocha-teamcity-reporter) * our [working example](https://github.com/mochajs/mocha-examples/tree/master/packages/third-party-reporter) ### HTML Reporter Alias: `HTML`, `html` **The HTML reporter is not intended for use on the command-line.** Node.JS native ESM support --------------------------- > *New in v7.1.0* > > Mocha supports writing your tests as ES modules, and not just using CommonJS. For example: ``` // test.mjs import {add} from './add.mjs'; import assert from 'assert'; it('should add to numbers from an es module', () => { assert.equal(add(3, 5), 8); }); ``` To enable this you don’t need to do anything special. Write your test file as an ES module. In Node.js this means either ending the file with a `.mjs` extension, or, if you want to use the regular `.js` extension, by adding `"type": "module"` to your `package.json`. More information can be found in the [Node.js documentation](https://nodejs.org/api/esm.html). ### Current Limitations * [Watch mode](#-watch-w) does not support ES Module test files * [Custom reporters](#third-party-reporters) and [custom interfaces](#interfaces) can only be CommonJS files * [Configuration file](#configuring-mocha-nodejs) can only be a CommonJS file (`.mocharc.js` or `.mocharc.cjs`) * When using module-level mocks via libs like `proxyquire`, `rewiremock` or `rewire`, hold off on using ES modules for your test files. You can switch to using `testdouble`, which does support ESM. Running Mocha in the Browser ----------------------------- Mocha runs in the browser. Every release of Mocha will have new builds of `./mocha.js` and `./mocha.css` for use in the browser. A typical setup might look something like the following, where we call `mocha.setup('bdd')` to use the **BDD** interface before loading the test scripts, running them `onload` with `mocha.run()`. ``` <!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8" /> <title>Mocha Tests</title> <meta name="viewport" content="width=device-width, initial-scale=1.0" /> <link rel="stylesheet" href="https://unpkg.com/mocha/mocha.css" /> </head> <body> <div id="mocha"></div> <script src="https://unpkg.com/chai/chai.js"></script> <script src="https://unpkg.com/mocha/mocha.js"></script> <script class="mocha-init"> mocha.setup('bdd'); mocha.checkLeaks(); </script> <script src="test.array.js"></script> <script src="test.object.js"></script> <script src="test.xhr.js"></script> <script class="mocha-exec"> mocha.run(); </script> </body> </html> ``` ### Grep The browser may use the `--grep` as functionality. Append a query-string to your URL: `?grep=api`. ### Browser Configuration Mocha options can be set via `mocha.setup()`. Examples: ``` // Use "tdd" interface. This is a shortcut to setting the interface; // any other options must be passed via an object. mocha.setup('tdd'); // This is equivalent to the above. mocha.setup({ ui: 'tdd' }); // Examples of options: mocha.setup({ allowUncaught: true, asyncOnly: true, bail: true, checkLeaks: true, dryRun: true, forbidOnly: true, forbidPending: true, global: ['MyLib'], retries: 3, slow: '100', timeout: '2000', ui: 'bdd' }); ``` ### Browser-specific Option(s) Browser Mocha supports many, but not all [cli options](#command-line-usage). To use a [cli option](#command-line-usage) that contains a “-”, please convert the option to camel-case, (eg. `check-leaks` to `checkLeaks`). #### [#](#options-that-differ-slightly-from-cli-options) Options that differ slightly from [cli options](#command-line-usage): `reporter` *{string|constructor}* You can pass a reporter’s name or a custom reporter’s constructor. You can find **recommended** reporters for the browser [here](#reporting). It is possible to use [built-in reporters](#reporters) as well. Their employment in browsers is neither recommended nor supported, open the console to see the test results. #### [#](#options-that-only-function-in-browser-context) Options that *only* function in browser context: `noHighlighting` *{boolean}* If set to `true`, do not attempt to use syntax highlighting on output test code. ### Reporting The HTML reporter is the default reporter when running Mocha in the browser. It looks like this: [Mochawesome](https://npm.im/mochawesome) is a great alternative to the default HTML reporter. Desktop Notification Support ----------------------------- Desktop notifications allow asynchronous communication of events without forcing you to react to a notification immediately. Their appearance and specific functionality vary across platforms. They typically disappear automatically after a short delay, but their content is often stored in some manner that allows you to access past notifications. [Growl](http://growl.info/) was an early notification system implementation for OS X and Windows, hence, the name of Mocha’s `--growl` option. Once enabled, when your root suite completes test execution, a desktop notification should appear informing you whether your tests passed or failed. ### Node-based notifications In order to use desktop notifications with the command-line interface (CLI), you **must** first install some platform-specific prerequisite software. Instructions for doing so can be found [here](https://github.com/mochajs/mocha/wiki/Growl-Notifications). Enable Mocha’s desktop notifications as follows: ``` $ mocha --growl ``` ### Browser-based notifications Web notification support is being made available for current versions of modern browsers. Ensure your browser version supports both [promises](https://caniuse.com/#feat=promises) and [web notifications](https://caniuse.com/#feat=notifications). As the Notification API evolved over time, **do not expect** the minimum possible browser version to necessarily work. Enable Mocha’s web notifications with a slight modification to your client-side mocha HTML. Add a call to `mocha.growl()` prior to running your tests as shown below: ``` <!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8" /> <title>Mocha Tests</title> <meta name="viewport" content="width=device-width, initial-scale=1.0" /> <link rel="stylesheet" href="https://unpkg.com/mocha/mocha.css" /> </head> <body> <div id="mocha"></div> <script src="https://unpkg.com/chai/chai.js"></script> <script src="https://unpkg.com/mocha/mocha.js"></script> <script class="mocha-init"> mocha.setup('bdd'); mocha.growl(); // <-- Enables web notifications </script> <script src="test.spec.js"></script> <script class="mocha-exec"> mocha.run(); </script> </body> </html> ``` Configuring Mocha (Node.js) ---------------------------- > *New in v6.0.0* > > Mocha supports configuration files, typical of modern command-line tools, in several formats: * **JavaScript**: Create a `.mocharc.js` (or `.mocharc.cjs` when using [`"type"="module"`](#nodejs-native-esm-support) in your `package.json`) in your project’s root directory, and export an object (`module.exports = {/* ... */}`) containing your configuration. * **YAML**: Create a `.mocharc.yaml` (or `.mocharc.yml`) in your project’s root directory. * **JSON**: Create a `.mocharc.json` (or `.mocharc.jsonc`) in your project’s root directory. Comments — while not valid JSON — are allowed in this file, and will be ignored by Mocha. * **package.json**: Create a `mocha` property in your project’s `package.json`. ### Custom Locations You can specify a custom location for your configuration file with the `--config <path>` option. Mocha will use the file’s extension to determine how to parse the file, and will assume JSON if unknown. You can specify a custom `package.json` location as well, using the `--package <path>` option. ### Ignoring Config Files To skip looking for config files, use `--no-config`. Likewise, use `--no-package` to stop Mocha from looking for configuration in a `package.json`. ### Priorities If no custom path was given, and if there are multiple configuration files in the same directory, Mocha will search for — and use — only one. The priority is: 1. `.mocharc.js` 2. `.mocharc.yaml` 3. `.mocharc.yml` 4. `.mocharc.jsonc` 5. `.mocharc.json` ### Merging Mocha will also *merge* any options found in `package.json` into its run-time configuration. In case of conflict, the priority is: 1. Arguments specified on command-line 2. Configuration file (`.mocharc.js`, `.mocharc.yml`, etc.) 3. `mocha` property of `package.json` Options which can safely be repeated (e.g., `--require`) will be *concatenated*, with higher-priorty configuration sources appearing earlier in the list. For example, a `.mocharc.json` containing `"require": "bar"`, coupled with execution of `mocha --require foo`, would cause Mocha to require `foo`, then `bar`, in that order. ### Extending Configuration Configurations can inherit from other modules using the `extends` keyword. See [here](http://yargs.js.org/docs/#api-configobject-extends-keyword) for more information. ### Configuration Format * Any “boolean” flag (which doesn’t require a parameter, such as `--bail`), can be specified using a boolean value, e.g.: `"bail": true`. * Any “array”-type option (see `mocha --help` for a list) can be a single string value. * For options containing a dash (`-`), the option name can be specified using camelCase. * Aliases are valid names, e.g., `R` instead of `reporter`. * Test files can be specified using `spec`, e.g., `"spec": "test/**/*.spec.js"`. * Flags to `node` are *also* supported in configuration files. Use caution, as these can vary between versions of Node.js! **For more configuration examples, see the [`example/config`](https://github.com/mochajs/mocha/tree/master/example/config) directory on GitHub.** The `test/` Directory ---------------------- By default, `mocha` looks for the glob `"./test/*.{js,cjs,mjs}"`, so you may want to put your tests in `test/` folder. If you want to include subdirectories, pass the `--recursive` option. To configure where `mocha` looks for tests, you may pass your own glob: ``` $ mocha --recursive "./spec/*.js" ``` Some shells support recursive matching by using the globstar (`**`) wildcard. Bash >= 4.3 supports this with the [`globstar` option](https://www.gnu.org/software/bash/manual/html_node/The-Shopt-Builtin.html) which [must be enabled](https://github.com/mochajs/mocha/pull/3348#issuecomment-383937247) to get the same results as passing the `--recursive` option ([ZSH](http://zsh.sourceforge.net/Doc/Release/Expansion.html#Recursive-Globbing) and [Fish](https://fishshell.com/docs/current/#expand-wildcard) support this by default). With recursive matching enabled, the following is the same as passing `--recursive`: ``` $ mocha "./spec/**/*.js" ``` [You should *always* quote your globs in npm scripts](https://medium.com/@jakubsynowiec/you-should-always-quote-your-globs-in-npm-scripts-621887a2a784). If you use double quotes, it’s the shell on UNIX that will expand the glob. On the other hand, if you use single quotes, the [`node-glob`](https://www.npmjs.com/package/glob) module will handle its expansion. See this [tutorial](https://gist.github.com/reggi/475793ea1846affbcfe8) on using globs. *Note*: Double quotes around the glob are recommended for portability. Error Codes ------------ > *New in v6.0.0* > > When Mocha itself throws exception, the associated `Error` will have a `code` property. Where applicable, consumers should check the `code` property instead of string-matching against the `message` property. The following table describes these error codes: | Code | Description | | --- | --- | | ERR\_MOCHA\_INVALID\_ARG\_TYPE | wrong type was passed for a given argument | | ERR\_MOCHA\_INVALID\_ARG\_VALUE | invalid or unsupported value was passed for a given argument | | ERR\_MOCHA\_INVALID\_EXCEPTION | a falsy or otherwise underspecified exception was thrown | | ERR\_MOCHA\_INVALID\_INTERFACE | interface specified in options not found | | ERR\_MOCHA\_INVALID\_REPORTER | reporter specified in options not found | | ERR\_MOCHA\_NO\_FILES\_MATCH\_PATTERN | test file(s) could not be found | | ERR\_MOCHA\_UNSUPPORTED | requested behavior, option, or parameter is unsupported | Editor Plugins --------------- The following editor-related packages are available: ### TextMate The [Mocha TextMate bundle](https://github.com/mochajs/mocha.tmbundle) includes snippets to make writing tests quicker and more enjoyable. ### JetBrains [JetBrains](https://www.jetbrains.com/) provides a [NodeJS plugin](https://www.jetbrains.com/idea/features/nodejs.html) for its suite of IDEs (IntelliJ IDEA, WebStorm, etc.), which contains a Mocha test runner, among other things. The plugin is titled **NodeJS**, and can be installed via **Preferences** > **Plugins**, assuming your license allows it. ### Wallaby.js [Wallaby.js](https://wallabyjs.com/) is a continuous testing tool that enables real-time code coverage for Mocha with any assertion library in VS Code, Atom, JetBrains IDEs (IntelliJ IDEA, WebStorm, etc.), Sublime Text and Visual Studio for both browser and node.js projects. ### Emacs [Emacs](https://www.gnu.org/software/emacs/) support for running Mocha tests is available via a 3rd party package [mocha.el](https://github.com/scottaj/mocha.el). The package is available on MELPA, and can be installed via `M-x package-install mocha`. ### Mocha Sidebar (VS Code) [Mocha sidebar](https://marketplace.visualstudio.com/items?itemName=maty.vscode-mocha-sidebar) is the most complete mocha extension for vs code. #### [#](#features-2) Features * see all tests in VS Code sidebar menu * run & debug tests for each level hierarchy from all tests to a single test (and each suite) * auto run tests on file save * see tests results directly in the code editor Examples --------- Real live example code: * [Mocha examples](https://github.com/mochajs/mocha-examples) * [Express](https://github.com/visionmedia/express/tree/master/test) * [Connect](https://github.com/senchalabs/connect/tree/master/test) * [SuperAgent](https://github.com/visionmedia/superagent/tree/master/test/node) * [WebSocket.io](https://github.com/LearnBoost/websocket.io/tree/master/test) * [Mocha tests](https://github.com/mochajs/mocha/tree/master/test) Testing Mocha -------------- To run Mocha’s tests, you will need GNU Make or compatible; Cygwin should work. ``` $ cd /path/to/mocha $ npm install $ npm test ```
programming_docs
tensorflow_cpp TensorFlow C++ API Reference TensorFlow C++ API Reference ============================ [array\_ops](group/array-ops) ------------------------------ | Members | | --- | | [tensorflow::ops::BatchToSpace](class/tensorflow/ops/batch-to-space) | [BatchToSpace](class/tensorflow/ops/batch-to-space#classtensorflow_1_1ops_1_1_batch_to_space) for 4-D tensors of type T. | | [tensorflow::ops::BatchToSpaceND](class/tensorflow/ops/batch-to-space-n-d) | [BatchToSpace](class/tensorflow/ops/batch-to-space#classtensorflow_1_1ops_1_1_batch_to_space) for N-D tensors of type T. | | [tensorflow::ops::Bitcast](class/tensorflow/ops/bitcast) | Bitcasts a tensor from one type to another without copying data. | | [tensorflow::ops::BroadcastDynamicShape](class/tensorflow/ops/broadcast-dynamic-shape) | Return the shape of s0 op s1 with broadcast. | | [tensorflow::ops::BroadcastTo](class/tensorflow/ops/broadcast-to) | Broadcast an array for a compatible shape. | | [tensorflow::ops::CheckNumerics](class/tensorflow/ops/check-numerics) | Checks a tensor for NaN and Inf values. | | [tensorflow::ops::Concat](class/tensorflow/ops/concat) | Concatenates tensors along one dimension. | | [tensorflow::ops::ConjugateTranspose](class/tensorflow/ops/conjugate-transpose) | Shuffle dimensions of x according to a permutation and conjugate the result. | | [tensorflow::ops::DebugGradientIdentity](class/tensorflow/ops/debug-gradient-identity) | [Identity](class/tensorflow/ops/identity#classtensorflow_1_1ops_1_1_identity) op for gradient debugging. | | [tensorflow::ops::DebugGradientRefIdentity](class/tensorflow/ops/debug-gradient-ref-identity) | [Identity](class/tensorflow/ops/identity#classtensorflow_1_1ops_1_1_identity) op for gradient debugging. | | [tensorflow::ops::DeepCopy](class/tensorflow/ops/deep-copy) | Makes a copy of `x`. | | [tensorflow::ops::DepthToSpace](class/tensorflow/ops/depth-to-space) | [DepthToSpace](class/tensorflow/ops/depth-to-space#classtensorflow_1_1ops_1_1_depth_to_space) for tensors of type T. | | [tensorflow::ops::Dequantize](class/tensorflow/ops/dequantize) | [Dequantize](class/tensorflow/ops/dequantize#classtensorflow_1_1ops_1_1_dequantize) the 'input' tensor into a float or bfloat16 [Tensor](class/tensorflow/tensor#classtensorflow_1_1_tensor). | | [tensorflow::ops::Diag](class/tensorflow/ops/diag) | Returns a diagonal tensor with a given diagonal values. | | [tensorflow::ops::DiagPart](class/tensorflow/ops/diag-part) | Returns the diagonal part of the tensor. | | [tensorflow::ops::EditDistance](class/tensorflow/ops/edit-distance) | Computes the (possibly normalized) Levenshtein Edit Distance. | | [tensorflow::ops::Empty](class/tensorflow/ops/empty) | Creates a tensor with the given shape. | | [tensorflow::ops::EnsureShape](class/tensorflow/ops/ensure-shape) | Ensures that the tensor's shape matches the expected shape. | | [tensorflow::ops::ExpandDims](class/tensorflow/ops/expand-dims) | Inserts a dimension of 1 into a tensor's shape. | | [tensorflow::ops::ExtractImagePatches](class/tensorflow/ops/extract-image-patches) | Extract `patches` from `images` and put them in the "depth" output dimension. | | [tensorflow::ops::ExtractVolumePatches](class/tensorflow/ops/extract-volume-patches) | Extract `patches` from `input` and put them in the `"depth"` output dimension. | | [tensorflow::ops::FakeQuantWithMinMaxArgs](class/tensorflow/ops/fake-quant-with-min-max-args) | Fake-quantize the 'inputs' tensor, type float to 'outputs' tensor of same type. | | [tensorflow::ops::FakeQuantWithMinMaxArgsGradient](class/tensorflow/ops/fake-quant-with-min-max-args-gradient) | Compute gradients for a [FakeQuantWithMinMaxArgs](class/tensorflow/ops/fake-quant-with-min-max-args#classtensorflow_1_1ops_1_1_fake_quant_with_min_max_args) operation. | | [tensorflow::ops::FakeQuantWithMinMaxVars](class/tensorflow/ops/fake-quant-with-min-max-vars) | Fake-quantize the 'inputs' tensor of type float via global float scalars. | | [tensorflow::ops::FakeQuantWithMinMaxVarsGradient](class/tensorflow/ops/fake-quant-with-min-max-vars-gradient) | Compute gradients for a [FakeQuantWithMinMaxVars](class/tensorflow/ops/fake-quant-with-min-max-vars#classtensorflow_1_1ops_1_1_fake_quant_with_min_max_vars) operation. | | [tensorflow::ops::FakeQuantWithMinMaxVarsPerChannel](class/tensorflow/ops/fake-quant-with-min-max-vars-per-channel) | Fake-quantize the 'inputs' tensor of type float via per-channel floats. | | [tensorflow::ops::FakeQuantWithMinMaxVarsPerChannelGradient](class/tensorflow/ops/fake-quant-with-min-max-vars-per-channel-gradient) | Compute gradients for a [FakeQuantWithMinMaxVarsPerChannel](class/tensorflow/ops/fake-quant-with-min-max-vars-per-channel#classtensorflow_1_1ops_1_1_fake_quant_with_min_max_vars_per_channel) operation. | | [tensorflow::ops::Fill](class/tensorflow/ops/fill) | Creates a tensor filled with a scalar value. | | [tensorflow::ops::Fingerprint](class/tensorflow/ops/fingerprint) | Generates fingerprint values. | | [tensorflow::ops::Gather](class/tensorflow/ops/gather) | [Gather](class/tensorflow/ops/gather#classtensorflow_1_1ops_1_1_gather) slices from `params` according to `indices`. | | [tensorflow::ops::GatherNd](class/tensorflow/ops/gather-nd) | [Gather](class/tensorflow/ops/gather#classtensorflow_1_1ops_1_1_gather) slices from `params` into a [Tensor](class/tensorflow/tensor#classtensorflow_1_1_tensor) with shape specified by `indices`. | | [tensorflow::ops::GatherV2](class/tensorflow/ops/gather-v2) | [Gather](class/tensorflow/ops/gather#classtensorflow_1_1ops_1_1_gather) slices from `params` axis `axis` according to `indices`. | | [tensorflow::ops::GuaranteeConst](class/tensorflow/ops/guarantee-const) | Gives a guarantee to the TF runtime that the input tensor is a constant. | | [tensorflow::ops::Identity](class/tensorflow/ops/identity) | Return a tensor with the same shape and contents as the input tensor or value. | | [tensorflow::ops::IdentityN](class/tensorflow/ops/identity-n) | Returns a list of tensors with the same shapes and contents as the input. | | [tensorflow::ops::ImmutableConst](class/tensorflow/ops/immutable-const) | Returns immutable tensor from memory region. | | [tensorflow::ops::InplaceAdd](class/tensorflow/ops/inplace-add) | Adds v into specified rows of x. | | [tensorflow::ops::InplaceSub](class/tensorflow/ops/inplace-sub) | Subtracts `v` into specified rows of `x`. | | [tensorflow::ops::InplaceUpdate](class/tensorflow/ops/inplace-update) | Updates specified rows 'i' with values 'v'. | | [tensorflow::ops::InvertPermutation](class/tensorflow/ops/invert-permutation) | Computes the inverse permutation of a tensor. | | [tensorflow::ops::MatrixBandPart](class/tensorflow/ops/matrix-band-part) | Copy a tensor setting everything outside a central band in each innermost matrix to zero. | | [tensorflow::ops::MatrixDiag](class/tensorflow/ops/matrix-diag) | Returns a batched diagonal tensor with a given batched diagonal values. | | [tensorflow::ops::MatrixDiagPart](class/tensorflow/ops/matrix-diag-part) | Returns the batched diagonal part of a batched tensor. | | [tensorflow::ops::MatrixDiagPartV2](class/tensorflow/ops/matrix-diag-part-v2) | Returns the batched diagonal part of a batched tensor. | | [tensorflow::ops::MatrixDiagPartV3](class/tensorflow/ops/matrix-diag-part-v3) | Returns the batched diagonal part of a batched tensor. | | [tensorflow::ops::MatrixDiagV2](class/tensorflow/ops/matrix-diag-v2) | Returns a batched diagonal tensor with given batched diagonal values. | | [tensorflow::ops::MatrixDiagV3](class/tensorflow/ops/matrix-diag-v3) | Returns a batched diagonal tensor with given batched diagonal values. | | [tensorflow::ops::MatrixSetDiag](class/tensorflow/ops/matrix-set-diag) | Returns a batched matrix tensor with new batched diagonal values. | | [tensorflow::ops::MatrixSetDiagV2](class/tensorflow/ops/matrix-set-diag-v2) | Returns a batched matrix tensor with new batched diagonal values. | | [tensorflow::ops::MatrixSetDiagV3](class/tensorflow/ops/matrix-set-diag-v3) | Returns a batched matrix tensor with new batched diagonal values. | | [tensorflow::ops::MirrorPad](class/tensorflow/ops/mirror-pad) | Pads a tensor with mirrored values. | | [tensorflow::ops::OneHot](class/tensorflow/ops/one-hot) | Returns a one-hot tensor. | | [tensorflow::ops::OnesLike](class/tensorflow/ops/ones-like) | Returns a tensor of ones with the same shape and type as x. | | [tensorflow::ops::Pad](class/tensorflow/ops/pad) | Pads a tensor with zeros. | | [tensorflow::ops::PadV2](class/tensorflow/ops/pad-v2) | Pads a tensor. | | [tensorflow::ops::ParallelConcat](class/tensorflow/ops/parallel-concat) | Concatenates a list of `N` tensors along the first dimension. | | [tensorflow::ops::Placeholder](class/tensorflow/ops/placeholder) | A placeholder op for a value that will be fed into the computation. | | [tensorflow::ops::PlaceholderWithDefault](class/tensorflow/ops/placeholder-with-default) | A placeholder op that passes through `input` when its output is not fed. | | [tensorflow::ops::PreventGradient](class/tensorflow/ops/prevent-gradient) | An identity op that triggers an error if a gradient is requested. | | [tensorflow::ops::QuantizeAndDequantizeV2](class/tensorflow/ops/quantize-and-dequantize-v2) | Quantizes then dequantizes a tensor. | | [tensorflow::ops::QuantizeAndDequantizeV3](class/tensorflow/ops/quantize-and-dequantize-v3) | Quantizes then dequantizes a tensor. | | [tensorflow::ops::QuantizeAndDequantizeV4](class/tensorflow/ops/quantize-and-dequantize-v4) | Quantizes then dequantizes a tensor. | | [tensorflow::ops::QuantizeAndDequantizeV4Grad](class/tensorflow/ops/quantize-and-dequantize-v4-grad) | Returns the gradient of `[QuantizeAndDequantizeV4](class/tensorflow/ops/quantize-and-dequantize-v4#classtensorflow_1_1ops_1_1_quantize_and_dequantize_v4)`. | | [tensorflow::ops::QuantizeV2](class/tensorflow/ops/quantize-v2) | Quantize the 'input' tensor of type float to 'output' tensor of type 'T'. | | [tensorflow::ops::QuantizedConcat](class/tensorflow/ops/quantized-concat) | Concatenates quantized tensors along one dimension. | | [tensorflow::ops::QuantizedInstanceNorm](class/tensorflow/ops/quantized-instance-norm) | Quantized Instance normalization. | | [tensorflow::ops::SetDiff1D](class/tensorflow/ops/set-diff1-d) | Computes the difference between two lists of numbers or strings. | | [tensorflow::ops::Stack](class/tensorflow/ops/stack) | Packs a list of `N` rank-`R` tensors into one rank-`(R+1)` tensor. | | [tensorflow::ops::Where](class/tensorflow/ops/where) | Reshapes a quantized tensor as per the Reshape op. | | [tensorflow::ops::ZerosLike](class/tensorflow/ops/zeros-like) | Returns a tensor of zeros with the same shape and type as x. | [candidate\_sampling\_ops](group/candidate-sampling-ops) --------------------------------------------------------- | Members | | --- | | [tensorflow::ops::AllCandidateSampler](class/tensorflow/ops/all-candidate-sampler) | Generates labels for candidate sampling with a learned unigram distribution. | | [tensorflow::ops::ComputeAccidentalHits](class/tensorflow/ops/compute-accidental-hits) | Computes the ids of the positions in sampled\_candidates that match true\_labels. | | [tensorflow::ops::FixedUnigramCandidateSampler](class/tensorflow/ops/fixed-unigram-candidate-sampler) | Generates labels for candidate sampling with a learned unigram distribution. | | [tensorflow::ops::LearnedUnigramCandidateSampler](class/tensorflow/ops/learned-unigram-candidate-sampler) | Generates labels for candidate sampling with a learned unigram distribution. | | [tensorflow::ops::LogUniformCandidateSampler](class/tensorflow/ops/log-uniform-candidate-sampler) | Generates labels for candidate sampling with a log-uniform distribution. | | [tensorflow::ops::UniformCandidateSampler](class/tensorflow/ops/uniform-candidate-sampler) | Generates labels for candidate sampling with a uniform distribution. | [control\_flow\_ops](group/control-flow-ops) --------------------------------------------- | Members | | --- | | [tensorflow::ops::Abort](class/tensorflow/ops/abort) | Raise a exception to abort the process when called. | | [tensorflow::ops::ControlTrigger](class/tensorflow/ops/control-trigger) | Does nothing. | | [tensorflow::ops::LoopCond](class/tensorflow/ops/loop-cond) | Forwards the input to the output. | | [tensorflow::ops::Merge](class/tensorflow/ops/merge) | Forwards the value of an available tensor from `inputs` to `output`. | | [tensorflow::ops::NextIteration](class/tensorflow/ops/next-iteration) | Makes its input available to the next iteration. | | [tensorflow::ops::RefNextIteration](class/tensorflow/ops/ref-next-iteration) | Makes its input available to the next iteration. | | [tensorflow::ops::RefSelect](class/tensorflow/ops/ref-select) | Forwards the `index`th element of `inputs` to `output`. | | [tensorflow::ops::RefSwitch](class/tensorflow/ops/ref-switch) | Forwards the ref tensor `data` to the output port determined by `pred`. | | [tensorflow::ops::Switch](class/tensorflow/ops/switch) | Forwards `data` to the output port determined by `pred`. | [core](group/core) ------------------- | Members | | --- | | [tensorflow::ClientSession](class/tensorflow/client-session) | A `[ClientSession](class/tensorflow/client-session#classtensorflow_1_1_client_session)` object lets the caller drive the evaluation of the TensorFlow graph constructed with the C++ API. | | [tensorflow::Input](class/tensorflow/input) | Represents a tensor value that can be used as an operand to an [Operation](class/tensorflow/operation#classtensorflow_1_1_operation). | | [tensorflow::InputList](class/tensorflow/input-list) | A type for representing the input to ops that require a list of tensors. | | [tensorflow::Operation](class/tensorflow/operation) | Represents a node in the computation graph. | | [tensorflow::Output](class/tensorflow/output) | Represents a tensor value produced by an [Operation](class/tensorflow/operation#classtensorflow_1_1_operation). | | [tensorflow::Scope](class/tensorflow/scope) | A `[Scope](class/tensorflow/scope#classtensorflow_1_1_scope)` object represents a set of related TensorFlow ops that have the same properties such as a common name prefix. | | [tensorflow::TensorBuffer](class/tensorflow/tensor-buffer) | | [data\_flow\_ops](group/data-flow-ops) --------------------------------------- | Members | | --- | | [tensorflow::ops::AccumulatorApplyGradient](class/tensorflow/ops/accumulator-apply-gradient) | Applies a gradient to a given accumulator. | | [tensorflow::ops::AccumulatorNumAccumulated](class/tensorflow/ops/accumulator-num-accumulated) | Returns the number of gradients aggregated in the given accumulators. | | [tensorflow::ops::AccumulatorSetGlobalStep](class/tensorflow/ops/accumulator-set-global-step) | Updates the accumulator with a new value for global\_step. | | [tensorflow::ops::AccumulatorTakeGradient](class/tensorflow/ops/accumulator-take-gradient) | Extracts the average gradient in the given [ConditionalAccumulator](class/tensorflow/ops/conditional-accumulator#classtensorflow_1_1ops_1_1_conditional_accumulator). | | [tensorflow::ops::Barrier](class/tensorflow/ops/barrier) | Defines a barrier that persists across different graph executions. | | [tensorflow::ops::BarrierClose](class/tensorflow/ops/barrier-close) | Closes the given barrier. | | [tensorflow::ops::BarrierIncompleteSize](class/tensorflow/ops/barrier-incomplete-size) | Computes the number of incomplete elements in the given barrier. | | [tensorflow::ops::BarrierInsertMany](class/tensorflow/ops/barrier-insert-many) | For each key, assigns the respective value to the specified component. | | [tensorflow::ops::BarrierReadySize](class/tensorflow/ops/barrier-ready-size) | Computes the number of complete elements in the given barrier. | | [tensorflow::ops::BarrierTakeMany](class/tensorflow/ops/barrier-take-many) | Takes the given number of completed elements from a barrier. | | [tensorflow::ops::ConditionalAccumulator](class/tensorflow/ops/conditional-accumulator) | A conditional accumulator for aggregating gradients. | | [tensorflow::ops::DeleteSessionTensor](class/tensorflow/ops/delete-session-tensor) | Delete the tensor specified by its handle in the session. | | [tensorflow::ops::DynamicPartition](class/tensorflow/ops/dynamic-partition) | Partitions `data` into `num_partitions` tensors using indices from `partitions`. | | [tensorflow::ops::DynamicStitch](class/tensorflow/ops/dynamic-stitch) | Interleave the values from the `data` tensors into a single tensor. | | [tensorflow::ops::FIFOQueue](class/tensorflow/ops/f-i-f-o-queue) | A queue that produces elements in first-in first-out order. | | [tensorflow::ops::GetSessionHandle](class/tensorflow/ops/get-session-handle) | Store the input tensor in the state of the current session. | | [tensorflow::ops::GetSessionHandleV2](class/tensorflow/ops/get-session-handle-v2) | Store the input tensor in the state of the current session. | | [tensorflow::ops::GetSessionTensor](class/tensorflow/ops/get-session-tensor) | Get the value of the tensor specified by its handle. | | [tensorflow::ops::MapClear](class/tensorflow/ops/map-clear) | Op removes all elements in the underlying container. | | [tensorflow::ops::MapIncompleteSize](class/tensorflow/ops/map-incomplete-size) | Op returns the number of incomplete elements in the underlying container. | | [tensorflow::ops::MapPeek](class/tensorflow/ops/map-peek) | Op peeks at the values at the specified key. | | [tensorflow::ops::MapSize](class/tensorflow/ops/map-size) | Op returns the number of elements in the underlying container. | | [tensorflow::ops::MapStage](class/tensorflow/ops/map-stage) | [Stage](class/tensorflow/ops/stage#classtensorflow_1_1ops_1_1_stage) (key, values) in the underlying container which behaves like a hashtable. | | [tensorflow::ops::MapUnstage](class/tensorflow/ops/map-unstage) | Op removes and returns the values associated with the key. | | [tensorflow::ops::MapUnstageNoKey](class/tensorflow/ops/map-unstage-no-key) | Op removes and returns a random (key, value) | | [tensorflow::ops::OrderedMapClear](class/tensorflow/ops/ordered-map-clear) | Op removes all elements in the underlying container. | | [tensorflow::ops::OrderedMapIncompleteSize](class/tensorflow/ops/ordered-map-incomplete-size) | Op returns the number of incomplete elements in the underlying container. | | [tensorflow::ops::OrderedMapPeek](class/tensorflow/ops/ordered-map-peek) | Op peeks at the values at the specified key. | | [tensorflow::ops::OrderedMapSize](class/tensorflow/ops/ordered-map-size) | Op returns the number of elements in the underlying container. | | [tensorflow::ops::OrderedMapStage](class/tensorflow/ops/ordered-map-stage) | [Stage](class/tensorflow/ops/stage#classtensorflow_1_1ops_1_1_stage) (key, values) in the underlying container which behaves like a ordered. | | [tensorflow::ops::OrderedMapUnstage](class/tensorflow/ops/ordered-map-unstage) | Op removes and returns the values associated with the key. | | [tensorflow::ops::OrderedMapUnstageNoKey](class/tensorflow/ops/ordered-map-unstage-no-key) | Op removes and returns the (key, value) element with the smallest. | | [tensorflow::ops::PaddingFIFOQueue](class/tensorflow/ops/padding-f-i-f-o-queue) | A queue that produces elements in first-in first-out order. | | [tensorflow::ops::ParallelDynamicStitch](class/tensorflow/ops/parallel-dynamic-stitch) | Interleave the values from the `data` tensors into a single tensor. | | [tensorflow::ops::PriorityQueue](class/tensorflow/ops/priority-queue) | A queue that produces elements sorted by the first component value. | | [tensorflow::ops::QueueClose](class/tensorflow/ops/queue-close) | Closes the given queue. | | [tensorflow::ops::QueueDequeue](class/tensorflow/ops/queue-dequeue) | Dequeues a tuple of one or more tensors from the given queue. | | [tensorflow::ops::QueueDequeueMany](class/tensorflow/ops/queue-dequeue-many) | Dequeues `n` tuples of one or more tensors from the given queue. | | [tensorflow::ops::QueueDequeueUpTo](class/tensorflow/ops/queue-dequeue-up-to) | Dequeues `n` tuples of one or more tensors from the given queue. | | [tensorflow::ops::QueueEnqueue](class/tensorflow/ops/queue-enqueue) | Enqueues a tuple of one or more tensors in the given queue. | | [tensorflow::ops::QueueEnqueueMany](class/tensorflow/ops/queue-enqueue-many) | Enqueues zero or more tuples of one or more tensors in the given queue. | | [tensorflow::ops::QueueIsClosed](class/tensorflow/ops/queue-is-closed) | Returns true if queue is closed. | | [tensorflow::ops::QueueIsClosedV2](class/tensorflow/ops/queue-is-closed-v2) | Returns true if queue is closed. | | [tensorflow::ops::QueueSize](class/tensorflow/ops/queue-size) | Computes the number of elements in the given queue. | | [tensorflow::ops::RandomShuffleQueue](class/tensorflow/ops/random-shuffle-queue) | A queue that randomizes the order of elements. | | [tensorflow::ops::RecordInput](class/tensorflow/ops/record-input) | Emits randomized records. | | [tensorflow::ops::SparseAccumulatorApplyGradient](class/tensorflow/ops/sparse-accumulator-apply-gradient) | Applies a sparse gradient to a given accumulator. | | [tensorflow::ops::SparseAccumulatorTakeGradient](class/tensorflow/ops/sparse-accumulator-take-gradient) | Extracts the average sparse gradient in a [SparseConditionalAccumulator](class/tensorflow/ops/sparse-conditional-accumulator#classtensorflow_1_1ops_1_1_sparse_conditional_accumulator). | | [tensorflow::ops::SparseConditionalAccumulator](class/tensorflow/ops/sparse-conditional-accumulator) | A conditional accumulator for aggregating sparse gradients. | | [tensorflow::ops::Stage](class/tensorflow/ops/stage) | [Stage](class/tensorflow/ops/stage#classtensorflow_1_1ops_1_1_stage) values similar to a lightweight Enqueue. | | [tensorflow::ops::StageClear](class/tensorflow/ops/stage-clear) | Op removes all elements in the underlying container. | | [tensorflow::ops::StagePeek](class/tensorflow/ops/stage-peek) | Op peeks at the values at the specified index. | | [tensorflow::ops::StageSize](class/tensorflow/ops/stage-size) | Op returns the number of elements in the underlying container. | | [tensorflow::ops::TensorArray](class/tensorflow/ops/tensor-array) | An array of Tensors of given size. | | [tensorflow::ops::TensorArrayClose](class/tensorflow/ops/tensor-array-close) | Delete the [TensorArray](class/tensorflow/ops/tensor-array#classtensorflow_1_1ops_1_1_tensor_array) from its resource container. | | [tensorflow::ops::TensorArrayConcat](class/tensorflow/ops/tensor-array-concat) | [Concat](class/tensorflow/ops/concat#classtensorflow_1_1ops_1_1_concat) the elements from the [TensorArray](class/tensorflow/ops/tensor-array#classtensorflow_1_1ops_1_1_tensor_array) into value `value`. | | [tensorflow::ops::TensorArrayGather](class/tensorflow/ops/tensor-array-gather) | [Gather](class/tensorflow/ops/gather#classtensorflow_1_1ops_1_1_gather) specific elements from the [TensorArray](class/tensorflow/ops/tensor-array#classtensorflow_1_1ops_1_1_tensor_array) into output `value`. | | [tensorflow::ops::TensorArrayGrad](class/tensorflow/ops/tensor-array-grad) | Creates a [TensorArray](class/tensorflow/ops/tensor-array#classtensorflow_1_1ops_1_1_tensor_array) for storing the gradients of values in the given handle. | | [tensorflow::ops::TensorArrayGradWithShape](class/tensorflow/ops/tensor-array-grad-with-shape) | Creates a [TensorArray](class/tensorflow/ops/tensor-array#classtensorflow_1_1ops_1_1_tensor_array) for storing multiple gradients of values in the given handle. | | [tensorflow::ops::TensorArrayRead](class/tensorflow/ops/tensor-array-read) | Read an element from the [TensorArray](class/tensorflow/ops/tensor-array#classtensorflow_1_1ops_1_1_tensor_array) into output `value`. | | [tensorflow::ops::TensorArrayScatter](class/tensorflow/ops/tensor-array-scatter) | Scatter the data from the input value into specific [TensorArray](class/tensorflow/ops/tensor-array#classtensorflow_1_1ops_1_1_tensor_array) elements. | | [tensorflow::ops::TensorArraySize](class/tensorflow/ops/tensor-array-size) | Get the current size of the [TensorArray](class/tensorflow/ops/tensor-array#classtensorflow_1_1ops_1_1_tensor_array). | | [tensorflow::ops::TensorArraySplit](class/tensorflow/ops/tensor-array-split) | Split the data from the input value into [TensorArray](class/tensorflow/ops/tensor-array#classtensorflow_1_1ops_1_1_tensor_array) elements. | | [tensorflow::ops::TensorArrayWrite](class/tensorflow/ops/tensor-array-write) | Push an element onto the tensor\_array. | | [tensorflow::ops::Unstage](class/tensorflow/ops/unstage) | Op is similar to a lightweight Dequeue. | [image\_ops](group/image-ops) ------------------------------ | Members | | --- | | [tensorflow::ops::AdjustContrast](class/tensorflow/ops/adjust-contrast) | Adjust the contrast of one or more images. | | [tensorflow::ops::AdjustHue](class/tensorflow/ops/adjust-hue) | Adjust the hue of one or more images. | | [tensorflow::ops::AdjustSaturation](class/tensorflow/ops/adjust-saturation) | Adjust the saturation of one or more images. | | [tensorflow::ops::CombinedNonMaxSuppression](class/tensorflow/ops/combined-non-max-suppression) | Greedily selects a subset of bounding boxes in descending order of score,. | | [tensorflow::ops::CropAndResize](class/tensorflow/ops/crop-and-resize) | Extracts crops from the input image tensor and resizes them. | | [tensorflow::ops::CropAndResizeGradBoxes](class/tensorflow/ops/crop-and-resize-grad-boxes) | Computes the gradient of the crop\_and\_resize op wrt the input boxes tensor. | | [tensorflow::ops::CropAndResizeGradImage](class/tensorflow/ops/crop-and-resize-grad-image) | Computes the gradient of the crop\_and\_resize op wrt the input image tensor. | | [tensorflow::ops::DecodeAndCropJpeg](class/tensorflow/ops/decode-and-crop-jpeg) | Decode and Crop a JPEG-encoded image to a uint8 tensor. | | [tensorflow::ops::DecodeBmp](class/tensorflow/ops/decode-bmp) | Decode the first frame of a BMP-encoded image to a uint8 tensor. | | [tensorflow::ops::DecodeGif](class/tensorflow/ops/decode-gif) | Decode the frame(s) of a GIF-encoded image to a uint8 tensor. | | [tensorflow::ops::DecodeImage](class/tensorflow/ops/decode-image) | Function for decode\_bmp, decode\_gif, decode\_jpeg, and decode\_png. | | [tensorflow::ops::DecodeJpeg](class/tensorflow/ops/decode-jpeg) | Decode a JPEG-encoded image to a uint8 tensor. | | [tensorflow::ops::DecodePng](class/tensorflow/ops/decode-png) | Decode a PNG-encoded image to a uint8 or uint16 tensor. | | [tensorflow::ops::DrawBoundingBoxes](class/tensorflow/ops/draw-bounding-boxes) | Draw bounding boxes on a batch of images. | | [tensorflow::ops::DrawBoundingBoxesV2](class/tensorflow/ops/draw-bounding-boxes-v2) | Draw bounding boxes on a batch of images. | | [tensorflow::ops::EncodeJpeg](class/tensorflow/ops/encode-jpeg) | JPEG-encode an image. | | [tensorflow::ops::EncodeJpegVariableQuality](class/tensorflow/ops/encode-jpeg-variable-quality) | JPEG encode input image with provided compression quality. | | [tensorflow::ops::EncodePng](class/tensorflow/ops/encode-png) | PNG-encode an image. | | [tensorflow::ops::ExtractGlimpse](class/tensorflow/ops/extract-glimpse) | Extracts a glimpse from the input tensor. | | [tensorflow::ops::ExtractJpegShape](class/tensorflow/ops/extract-jpeg-shape) | Extract the shape information of a JPEG-encoded image. | | [tensorflow::ops::HSVToRGB](class/tensorflow/ops/h-s-v-to-r-g-b) | Convert one or more images from HSV to RGB. | | [tensorflow::ops::NonMaxSuppression](class/tensorflow/ops/non-max-suppression) | Greedily selects a subset of bounding boxes in descending order of score,. | | [tensorflow::ops::NonMaxSuppressionV2](class/tensorflow/ops/non-max-suppression-v2) | Greedily selects a subset of bounding boxes in descending order of score,. | | [tensorflow::ops::NonMaxSuppressionV3](class/tensorflow/ops/non-max-suppression-v3) | Greedily selects a subset of bounding boxes in descending order of score,. | | [tensorflow::ops::NonMaxSuppressionV4](class/tensorflow/ops/non-max-suppression-v4) | Greedily selects a subset of bounding boxes in descending order of score,. | | [tensorflow::ops::NonMaxSuppressionV5](class/tensorflow/ops/non-max-suppression-v5) | Greedily selects a subset of bounding boxes in descending order of score,. | | [tensorflow::ops::NonMaxSuppressionWithOverlaps](class/tensorflow/ops/non-max-suppression-with-overlaps) | Greedily selects a subset of bounding boxes in descending order of score,. | | [tensorflow::ops::QuantizedResizeBilinear](class/tensorflow/ops/quantized-resize-bilinear) | Resize quantized `images` to `size` using quantized bilinear interpolation. | | [tensorflow::ops::RGBToHSV](class/tensorflow/ops/r-g-b-to-h-s-v) | Converts one or more images from RGB to HSV. | | [tensorflow::ops::ResizeArea](class/tensorflow/ops/resize-area) | Resize `images` to `size` using area interpolation. | | [tensorflow::ops::ResizeBicubic](class/tensorflow/ops/resize-bicubic) | Resize `images` to `size` using bicubic interpolation. | | [tensorflow::ops::ResizeBilinear](class/tensorflow/ops/resize-bilinear) | Resize `images` to `size` using bilinear interpolation. | | [tensorflow::ops::ResizeNearestNeighbor](class/tensorflow/ops/resize-nearest-neighbor) | Resize `images` to `size` using nearest neighbor interpolation. | | [tensorflow::ops::SampleDistortedBoundingBox](class/tensorflow/ops/sample-distorted-bounding-box) | Generate a single randomly distorted bounding box for an image. | | [tensorflow::ops::SampleDistortedBoundingBoxV2](class/tensorflow/ops/sample-distorted-bounding-box-v2) | Generate a single randomly distorted bounding box for an image. | | [tensorflow::ops::ScaleAndTranslate](class/tensorflow/ops/scale-and-translate) | TODO: add doc. | | [tensorflow::ops::StatelessSampleDistortedBoundingBox](class/tensorflow/ops/stateless-sample-distorted-bounding-box) | Generate a randomly distorted bounding box for an image deterministically. | [io\_ops](group/io-ops) ------------------------ | Members | | --- | | [tensorflow::ops::FixedLengthRecordReader](class/tensorflow/ops/fixed-length-record-reader) | A Reader that outputs fixed-length records from a file. | | [tensorflow::ops::IdentityReader](class/tensorflow/ops/identity-reader) | A Reader that outputs the queued work as both the key and value. | | [tensorflow::ops::LMDBReader](class/tensorflow/ops/l-m-d-b-reader) | A Reader that outputs the records from a LMDB file. | | [tensorflow::ops::MatchingFiles](class/tensorflow/ops/matching-files) | Returns the set of files matching one or more glob patterns. | | [tensorflow::ops::MergeV2Checkpoints](class/tensorflow/ops/merge-v2-checkpoints) | V2 format specific: merges the metadata files of sharded checkpoints. | | [tensorflow::ops::ReadFile](class/tensorflow/ops/read-file) | Reads and outputs the entire contents of the input filename. | | [tensorflow::ops::ReaderNumRecordsProduced](class/tensorflow/ops/reader-num-records-produced) | Returns the number of records this Reader has produced. | | [tensorflow::ops::ReaderNumWorkUnitsCompleted](class/tensorflow/ops/reader-num-work-units-completed) | Returns the number of work units this Reader has finished processing. | | [tensorflow::ops::ReaderRead](class/tensorflow/ops/reader-read) | Returns the next record (key, value pair) produced by a Reader. | | [tensorflow::ops::ReaderReadUpTo](class/tensorflow/ops/reader-read-up-to) | Returns up to `num_records` (key, value) pairs produced by a Reader. | | [tensorflow::ops::ReaderReset](class/tensorflow/ops/reader-reset) | [Restore](class/tensorflow/ops/restore#classtensorflow_1_1ops_1_1_restore) a Reader to its initial clean state. | | [tensorflow::ops::ReaderRestoreState](class/tensorflow/ops/reader-restore-state) | [Restore](class/tensorflow/ops/restore#classtensorflow_1_1ops_1_1_restore) a reader to a previously saved state. | | [tensorflow::ops::ReaderSerializeState](class/tensorflow/ops/reader-serialize-state) | Produce a string tensor that encodes the state of a Reader. | | [tensorflow::ops::Restore](class/tensorflow/ops/restore) | Restores a tensor from checkpoint files. | | [tensorflow::ops::RestoreSlice](class/tensorflow/ops/restore-slice) | Restores a tensor from checkpoint files. | | [tensorflow::ops::RestoreV2](class/tensorflow/ops/restore-v2) | Restores tensors from a V2 checkpoint. | | [tensorflow::ops::Save](class/tensorflow/ops/save) | Saves the input tensors to disk. | | [tensorflow::ops::SaveSlices](class/tensorflow/ops/save-slices) | Saves input tensors slices to disk. | | [tensorflow::ops::SaveV2](class/tensorflow/ops/save-v2) | Saves tensors in V2 checkpoint format. | | [tensorflow::ops::ShardedFilename](class/tensorflow/ops/sharded-filename) | Generate a sharded filename. | | [tensorflow::ops::ShardedFilespec](class/tensorflow/ops/sharded-filespec) | Generate a glob pattern matching all sharded file names. | | [tensorflow::ops::TFRecordReader](class/tensorflow/ops/t-f-record-reader) | A Reader that outputs the records from a TensorFlow Records file. | | [tensorflow::ops::TextLineReader](class/tensorflow/ops/text-line-reader) | A Reader that outputs the lines of a file delimited by '\n'. | | [tensorflow::ops::WholeFileReader](class/tensorflow/ops/whole-file-reader) | A Reader that outputs the entire contents of a file as a value. | | [tensorflow::ops::WriteFile](class/tensorflow/ops/write-file) | Writes `contents` to the file at input `filename`. | [logging\_ops](group/logging-ops) ---------------------------------- | Members | | --- | | [tensorflow::ops::Assert](class/tensorflow/ops/assert) | Asserts that the given condition is true. | | [tensorflow::ops::HistogramSummary](class/tensorflow/ops/histogram-summary) | Outputs a `Summary` protocol buffer with a histogram. | | [tensorflow::ops::MergeSummary](class/tensorflow/ops/merge-summary) | Merges summaries. | | [tensorflow::ops::Print](class/tensorflow/ops/print) | Prints a list of tensors. | | [tensorflow::ops::PrintV2](class/tensorflow/ops/print-v2) | Prints a string scalar. | | [tensorflow::ops::ScalarSummary](class/tensorflow/ops/scalar-summary) | Outputs a `Summary` protocol buffer with scalar values. | | [tensorflow::ops::TensorSummary](class/tensorflow/ops/tensor-summary) | Outputs a `Summary` protocol buffer with a tensor. | | [tensorflow::ops::TensorSummaryV2](class/tensorflow/ops/tensor-summary-v2) | Outputs a `Summary` protocol buffer with a tensor and per-plugin data. | | [tensorflow::ops::Timestamp](class/tensorflow/ops/timestamp) | Provides the time since epoch in seconds. | [math\_ops](group/math-ops) ---------------------------- | Members | | --- | | [tensorflow::ops::Abs](class/tensorflow/ops/abs) | Computes the absolute value of a tensor. | | [tensorflow::ops::AccumulateNV2](class/tensorflow/ops/accumulate-n-v2) | Returns the element-wise sum of a list of tensors. | | [tensorflow::ops::Acos](class/tensorflow/ops/acos) | Computes acos of x element-wise. | | [tensorflow::ops::Acosh](class/tensorflow/ops/acosh) | Computes inverse hyperbolic cosine of x element-wise. | | [tensorflow::ops::Add](class/tensorflow/ops/add) | Returns x + y element-wise. | | [tensorflow::ops::AddN](class/tensorflow/ops/add-n) | [Add](class/tensorflow/ops/add#classtensorflow_1_1ops_1_1_add) all input tensors element wise. | | [tensorflow::ops::AddV2](class/tensorflow/ops/add-v2) | Returns x + y element-wise. | | [tensorflow::ops::All](class/tensorflow/ops/all) | Computes the "logical and" of elements across dimensions of a tensor. | | [tensorflow::ops::Angle](class/tensorflow/ops/angle) | Returns the argument of a complex number. | | [tensorflow::ops::Any](class/tensorflow/ops/any) | Computes the "logical or" of elements across dimensions of a tensor. | | [tensorflow::ops::ApproximateEqual](class/tensorflow/ops/approximate-equal) | Returns the truth value of abs(x-y) < tolerance element-wise. | | [tensorflow::ops::ArgMax](class/tensorflow/ops/arg-max) | Returns the index with the largest value across dimensions of a tensor. | | [tensorflow::ops::ArgMin](class/tensorflow/ops/arg-min) | Returns the index with the smallest value across dimensions of a tensor. | | [tensorflow::ops::Asin](class/tensorflow/ops/asin) | Computes the trignometric inverse sine of x element-wise. | | [tensorflow::ops::Asinh](class/tensorflow/ops/asinh) | Computes inverse hyperbolic sine of x element-wise. | | [tensorflow::ops::Atan](class/tensorflow/ops/atan) | Computes the trignometric inverse tangent of x element-wise. | | [tensorflow::ops::Atan2](class/tensorflow/ops/atan2) | Computes arctangent of `y/x` element-wise, respecting signs of the arguments. | | [tensorflow::ops::Atanh](class/tensorflow/ops/atanh) | Computes inverse hyperbolic tangent of x element-wise. | | [tensorflow::ops::BatchMatMul](class/tensorflow/ops/batch-mat-mul) | Multiplies slices of two tensors in batches. | | [tensorflow::ops::BatchMatMulV2](class/tensorflow/ops/batch-mat-mul-v2) | Multiplies slices of two tensors in batches. | | [tensorflow::ops::BatchMatMulV3](class/tensorflow/ops/batch-mat-mul-v3) | Multiplies slices of two tensors in batches. | | [tensorflow::ops::Betainc](class/tensorflow/ops/betainc) | Compute the regularized incomplete beta integral \(I\_x(a, b)\). | | [tensorflow::ops::Bincount](class/tensorflow/ops/bincount) | Counts the number of occurrences of each value in an integer array. | | [tensorflow::ops::Bucketize](class/tensorflow/ops/bucketize) | Bucketizes 'input' based on 'boundaries'. | | [tensorflow::ops::Cast](class/tensorflow/ops/cast) | [Cast](class/tensorflow/ops/cast#classtensorflow_1_1ops_1_1_cast) x of type SrcT to y of DstT. | | [tensorflow::ops::Ceil](class/tensorflow/ops/ceil) | Returns element-wise smallest integer not less than x. | | [tensorflow::ops::ClipByValue](class/tensorflow/ops/clip-by-value) | Clips tensor values to a specified min and max. | | [tensorflow::ops::Complex](class/tensorflow/ops/complex) | Converts two real numbers to a complex number. | | [tensorflow::ops::ComplexAbs](class/tensorflow/ops/complex-abs) | Computes the complex absolute value of a tensor. | | [tensorflow::ops::Conj](class/tensorflow/ops/conj) | Returns the complex conjugate of a complex number. | | [tensorflow::ops::Cos](class/tensorflow/ops/cos) | Computes cos of x element-wise. | | [tensorflow::ops::Cosh](class/tensorflow/ops/cosh) | Computes hyperbolic cosine of x element-wise. | | [tensorflow::ops::Cross](class/tensorflow/ops/cross) | Compute the pairwise cross product. | | [tensorflow::ops::Cumprod](class/tensorflow/ops/cumprod) | Compute the cumulative product of the tensor `x` along `axis`. | | [tensorflow::ops::Cumsum](class/tensorflow/ops/cumsum) | Compute the cumulative sum of the tensor `x` along `axis`. | | [tensorflow::ops::DenseBincount](class/tensorflow/ops/dense-bincount) | Counts the number of occurrences of each value in an integer array. | | [tensorflow::ops::Digamma](class/tensorflow/ops/digamma) | Computes Psi, the derivative of [Lgamma](class/tensorflow/ops/lgamma#classtensorflow_1_1ops_1_1_lgamma) (the log of the absolute value of. | | [tensorflow::ops::Div](class/tensorflow/ops/div) | Returns x / y element-wise. | | [tensorflow::ops::DivNoNan](class/tensorflow/ops/div-no-nan) | Returns 0 if the denominator is zero. | | [tensorflow::ops::Equal](class/tensorflow/ops/equal) | Returns the truth value of (x == y) element-wise. | | [tensorflow::ops::Erf](class/tensorflow/ops/erf) | Computes the [Gauss error function](https://en.wikipedia.org/wiki/Error_function) of `x` element-wise. | | [tensorflow::ops::Erfc](class/tensorflow/ops/erfc) | Computes the complementary error function of `x` element-wise. | | [tensorflow::ops::Erfinv](class/tensorflow/ops/erfinv) | TODO: add doc. | | [tensorflow::ops::EuclideanNorm](class/tensorflow/ops/euclidean-norm) | Computes the euclidean norm of elements across dimensions of a tensor. | | [tensorflow::ops::Exp](class/tensorflow/ops/exp) | Computes exponential of x element-wise. | | [tensorflow::ops::Expm1](class/tensorflow/ops/expm1) | Computes `exp(x) - 1` element-wise. | | [tensorflow::ops::Floor](class/tensorflow/ops/floor) | Returns element-wise largest integer not greater than x. | | [tensorflow::ops::FloorDiv](class/tensorflow/ops/floor-div) | Returns x // y element-wise. | | [tensorflow::ops::FloorMod](class/tensorflow/ops/floor-mod) | Returns element-wise remainder of division. | | [tensorflow::ops::Greater](class/tensorflow/ops/greater) | Returns the truth value of (x > y) element-wise. | | [tensorflow::ops::GreaterEqual](class/tensorflow/ops/greater-equal) | Returns the truth value of (x >= y) element-wise. | | [tensorflow::ops::HistogramFixedWidth](class/tensorflow/ops/histogram-fixed-width) | Return histogram of values. | | [tensorflow::ops::Igamma](class/tensorflow/ops/igamma) | Compute the lower regularized incomplete Gamma function `P(a, x)`. | | [tensorflow::ops::Igammac](class/tensorflow/ops/igammac) | Compute the upper regularized incomplete Gamma function `Q(a, x)`. | | [tensorflow::ops::Imag](class/tensorflow/ops/imag) | Returns the imaginary part of a complex number. | | [tensorflow::ops::Inv](class/tensorflow/ops/inv) | Computes the reciprocal of x element-wise. | | [tensorflow::ops::IsFinite](class/tensorflow/ops/is-finite) | Returns which elements of x are finite. | | [tensorflow::ops::IsInf](class/tensorflow/ops/is-inf) | Returns which elements of x are Inf. | | [tensorflow::ops::IsNan](class/tensorflow/ops/is-nan) | Returns which elements of x are NaN. | | [tensorflow::ops::Less](class/tensorflow/ops/less) | Returns the truth value of (x < y) element-wise. | | [tensorflow::ops::LessEqual](class/tensorflow/ops/less-equal) | Returns the truth value of (x <= y) element-wise. | | [tensorflow::ops::Lgamma](class/tensorflow/ops/lgamma) | Computes the log of the absolute value of `Gamma(x)` element-wise. | | [tensorflow::ops::Log](class/tensorflow/ops/log) | Computes natural logarithm of x element-wise. | | [tensorflow::ops::Log1p](class/tensorflow/ops/log1p) | Computes natural logarithm of (1 + x) element-wise. | | [tensorflow::ops::LogicalAnd](class/tensorflow/ops/logical-and) | Returns the truth value of x AND y element-wise. | | [tensorflow::ops::LogicalNot](class/tensorflow/ops/logical-not) | Returns the truth value of `NOT x` element-wise. | | [tensorflow::ops::LogicalOr](class/tensorflow/ops/logical-or) | Returns the truth value of x OR y element-wise. | | [tensorflow::ops::MatMul](class/tensorflow/ops/mat-mul) | [Multiply](class/tensorflow/ops/multiply#classtensorflow_1_1ops_1_1_multiply) the matrix "a" by the matrix "b". | | [tensorflow::ops::Max](class/tensorflow/ops/max) | Computes the maximum of elements across dimensions of a tensor. | | [tensorflow::ops::Maximum](class/tensorflow/ops/maximum) | Returns the max of x and y (i.e. | | [tensorflow::ops::Mean](class/tensorflow/ops/mean) | Computes the mean of elements across dimensions of a tensor. | | [tensorflow::ops::Min](class/tensorflow/ops/min) | Computes the minimum of elements across dimensions of a tensor. | | [tensorflow::ops::Minimum](class/tensorflow/ops/minimum) | Returns the min of x and y (i.e. | | [tensorflow::ops::Mod](class/tensorflow/ops/mod) | Returns element-wise remainder of division. | | [tensorflow::ops::MulNoNan](class/tensorflow/ops/mul-no-nan) | Returns x \* y element-wise. | | [tensorflow::ops::Multiply](class/tensorflow/ops/multiply) | Returns x \* y element-wise. | | [tensorflow::ops::Ndtri](class/tensorflow/ops/ndtri) | TODO: add doc. | | [tensorflow::ops::Negate](class/tensorflow/ops/negate) | Computes numerical negative value element-wise. | | [tensorflow::ops::NextAfter](class/tensorflow/ops/next-after) | Returns the next representable value of `x1` in the direction of `x2`, element-wise. | | [tensorflow::ops::NotEqual](class/tensorflow/ops/not-equal) | Returns the truth value of (x != y) element-wise. | | [tensorflow::ops::Polygamma](class/tensorflow/ops/polygamma) | Compute the polygamma function \(\psi^{(n)}(x)\). | | [tensorflow::ops::Pow](class/tensorflow/ops/pow) | Computes the power of one value to another. | | [tensorflow::ops::Prod](class/tensorflow/ops/prod) | Computes the product of elements across dimensions of a tensor. | | [tensorflow::ops::QuantizeDownAndShrinkRange](class/tensorflow/ops/quantize-down-and-shrink-range) | Convert the quantized 'input' tensor into a lower-precision 'output', using the. | | [tensorflow::ops::QuantizedAdd](class/tensorflow/ops/quantized-add) | Returns x + y element-wise, working on quantized buffers. | | [tensorflow::ops::QuantizedMatMul](class/tensorflow/ops/quantized-mat-mul) | Perform a quantized matrix multiplication of `a` by the matrix `b`. | | [tensorflow::ops::QuantizedMul](class/tensorflow/ops/quantized-mul) | Returns x \* y element-wise, working on quantized buffers. | | [tensorflow::ops::RaggedBincount](class/tensorflow/ops/ragged-bincount) | Counts the number of occurrences of each value in an integer array. | | [tensorflow::ops::Range](class/tensorflow/ops/range) | Creates a sequence of numbers. | | [tensorflow::ops::Real](class/tensorflow/ops/real) | Returns the real part of a complex number. | | [tensorflow::ops::RealDiv](class/tensorflow/ops/real-div) | Returns x / y element-wise for real types. | | [tensorflow::ops::Reciprocal](class/tensorflow/ops/reciprocal) | Computes the reciprocal of x element-wise. | | [tensorflow::ops::RequantizationRange](class/tensorflow/ops/requantization-range) | Computes a range that covers the actual values present in a quantized tensor. | | [tensorflow::ops::Requantize](class/tensorflow/ops/requantize) | Converts the quantized `input` tensor into a lower-precision `output`. | | [tensorflow::ops::Rint](class/tensorflow/ops/rint) | Returns element-wise integer closest to x. | | [tensorflow::ops::Round](class/tensorflow/ops/round) | Rounds the values of a tensor to the nearest integer, element-wise. | | [tensorflow::ops::Rsqrt](class/tensorflow/ops/rsqrt) | Computes reciprocal of square root of x element-wise. | | [tensorflow::ops::SegmentMax](class/tensorflow/ops/segment-max) | Computes the maximum along segments of a tensor. | | [tensorflow::ops::SegmentMean](class/tensorflow/ops/segment-mean) | Computes the mean along segments of a tensor. | | [tensorflow::ops::SegmentMin](class/tensorflow/ops/segment-min) | Computes the minimum along segments of a tensor. | | [tensorflow::ops::SegmentProd](class/tensorflow/ops/segment-prod) | Computes the product along segments of a tensor. | | [tensorflow::ops::SegmentSum](class/tensorflow/ops/segment-sum) | Computes the sum along segments of a tensor. | | [tensorflow::ops::SelectV2](class/tensorflow/ops/select-v2) | TODO: add doc. | | [tensorflow::ops::Sigmoid](class/tensorflow/ops/sigmoid) | Computes sigmoid of `x` element-wise. | | [tensorflow::ops::Sign](class/tensorflow/ops/sign) | Returns an element-wise indication of the sign of a number. | | [tensorflow::ops::Sin](class/tensorflow/ops/sin) | Computes sine of x element-wise. | | [tensorflow::ops::Sinh](class/tensorflow/ops/sinh) | Computes hyperbolic sine of x element-wise. | | [tensorflow::ops::SparseBincount](class/tensorflow/ops/sparse-bincount) | Counts the number of occurrences of each value in an integer array. | | [tensorflow::ops::SparseMatMul](class/tensorflow/ops/sparse-mat-mul) | [Multiply](class/tensorflow/ops/multiply#classtensorflow_1_1ops_1_1_multiply) matrix "a" by matrix "b". | | [tensorflow::ops::SparseSegmentMean](class/tensorflow/ops/sparse-segment-mean) | Computes the mean along sparse segments of a tensor. | | [tensorflow::ops::SparseSegmentMeanGrad](class/tensorflow/ops/sparse-segment-mean-grad) | Computes gradients for [SparseSegmentMean](class/tensorflow/ops/sparse-segment-mean#classtensorflow_1_1ops_1_1_sparse_segment_mean). | | [tensorflow::ops::SparseSegmentMeanWithNumSegments](class/tensorflow/ops/sparse-segment-mean-with-num-segments) | Computes the mean along sparse segments of a tensor. | | [tensorflow::ops::SparseSegmentSqrtN](class/tensorflow/ops/sparse-segment-sqrt-n) | Computes the sum along sparse segments of a tensor divided by the sqrt of N. | | [tensorflow::ops::SparseSegmentSqrtNGrad](class/tensorflow/ops/sparse-segment-sqrt-n-grad) | Computes gradients for [SparseSegmentSqrtN](class/tensorflow/ops/sparse-segment-sqrt-n#classtensorflow_1_1ops_1_1_sparse_segment_sqrt_n). | | [tensorflow::ops::SparseSegmentSqrtNWithNumSegments](class/tensorflow/ops/sparse-segment-sqrt-n-with-num-segments) | Computes the sum along sparse segments of a tensor divided by the sqrt of N. | | [tensorflow::ops::SparseSegmentSum](class/tensorflow/ops/sparse-segment-sum) | Computes the sum along sparse segments of a tensor. | | [tensorflow::ops::SparseSegmentSumGrad](class/tensorflow/ops/sparse-segment-sum-grad) | Computes gradients for [SparseSegmentSum](class/tensorflow/ops/sparse-segment-sum#classtensorflow_1_1ops_1_1_sparse_segment_sum). | | [tensorflow::ops::SparseSegmentSumWithNumSegments](class/tensorflow/ops/sparse-segment-sum-with-num-segments) | Computes the sum along sparse segments of a tensor. | | [tensorflow::ops::Sqrt](class/tensorflow/ops/sqrt) | Computes square root of x element-wise. | | [tensorflow::ops::Square](class/tensorflow/ops/square) | Computes square of x element-wise. | | [tensorflow::ops::SquaredDifference](class/tensorflow/ops/squared-difference) | Returns conj(x - y)(x - y) element-wise. | | [tensorflow::ops::Subtract](class/tensorflow/ops/subtract) | Returns x - y element-wise. | | [tensorflow::ops::Sum](class/tensorflow/ops/sum) | Computes the sum of elements across dimensions of a tensor. | | [tensorflow::ops::Tan](class/tensorflow/ops/tan) | Computes tan of x element-wise. | | [tensorflow::ops::Tanh](class/tensorflow/ops/tanh) | Computes hyperbolic tangent of `x` element-wise. | | [tensorflow::ops::TruncateDiv](class/tensorflow/ops/truncate-div) | Returns x / y element-wise for integer types. | | [tensorflow::ops::TruncateMod](class/tensorflow/ops/truncate-mod) | Returns element-wise remainder of division. | | [tensorflow::ops::UnsortedSegmentMax](class/tensorflow/ops/unsorted-segment-max) | Computes the maximum along segments of a tensor. | | [tensorflow::ops::UnsortedSegmentMin](class/tensorflow/ops/unsorted-segment-min) | Computes the minimum along segments of a tensor. | | [tensorflow::ops::UnsortedSegmentProd](class/tensorflow/ops/unsorted-segment-prod) | Computes the product along segments of a tensor. | | [tensorflow::ops::UnsortedSegmentSum](class/tensorflow/ops/unsorted-segment-sum) | Computes the sum along segments of a tensor. | | [tensorflow::ops::Where3](class/tensorflow/ops/where3) | Selects elements from `x` or `y`, depending on `condition`. | | [tensorflow::ops::Xdivy](class/tensorflow/ops/xdivy) | Returns 0 if x == 0, and x / y otherwise, elementwise. | | [tensorflow::ops::Xlog1py](class/tensorflow/ops/xlog1py) | Returns 0 if x == 0, and x \* log1p(y) otherwise, elementwise. | | [tensorflow::ops::Xlogy](class/tensorflow/ops/xlogy) | Returns 0 if x == 0, and x \* log(y) otherwise, elementwise. | | [tensorflow::ops::Zeta](class/tensorflow/ops/zeta) | Compute the Hurwitz zeta function \(\zeta(x, q)\). | [nn\_ops](group/nn-ops) ------------------------ | Members | | --- | | [tensorflow::ops::AvgPool](class/tensorflow/ops/avg-pool) | Performs average pooling on the input. | | [tensorflow::ops::AvgPool3D](class/tensorflow/ops/avg-pool3-d) | Performs 3D average pooling on the input. | | [tensorflow::ops::AvgPool3DGrad](class/tensorflow/ops/avg-pool3-d-grad) | Computes gradients of average pooling function. | | [tensorflow::ops::BiasAdd](class/tensorflow/ops/bias-add) | Adds `bias` to `value`. | | [tensorflow::ops::BiasAddGrad](class/tensorflow/ops/bias-add-grad) | The backward operation for "BiasAdd" on the "bias" tensor. | | [tensorflow::ops::Conv2D](class/tensorflow/ops/conv2-d) | Computes a 2-D convolution given 4-D `input` and `filter` tensors. | | [tensorflow::ops::Conv2DBackpropFilter](class/tensorflow/ops/conv2-d-backprop-filter) | Computes the gradients of convolution with respect to the filter. | | [tensorflow::ops::Conv2DBackpropInput](class/tensorflow/ops/conv2-d-backprop-input) | Computes the gradients of convolution with respect to the input. | | [tensorflow::ops::Conv3D](class/tensorflow/ops/conv3-d) | Computes a 3-D convolution given 5-D `input` and `filter` tensors. | | [tensorflow::ops::Conv3DBackpropFilterV2](class/tensorflow/ops/conv3-d-backprop-filter-v2) | Computes the gradients of 3-D convolution with respect to the filter. | | [tensorflow::ops::Conv3DBackpropInputV2](class/tensorflow/ops/conv3-d-backprop-input-v2) | Computes the gradients of 3-D convolution with respect to the input. | | [tensorflow::ops::DataFormatDimMap](class/tensorflow/ops/data-format-dim-map) | Returns the dimension index in the destination data format given the one in. | | [tensorflow::ops::DataFormatVecPermute](class/tensorflow/ops/data-format-vec-permute) | Permute input tensor from `src_format` to `dst_format`. | | [tensorflow::ops::DepthwiseConv2dNative](class/tensorflow/ops/depthwise-conv2d-native) | Computes a 2-D depthwise convolution given 4-D `input` and `filter` tensors. | | [tensorflow::ops::DepthwiseConv2dNativeBackpropFilter](class/tensorflow/ops/depthwise-conv2d-native-backprop-filter) | Computes the gradients of depthwise convolution with respect to the filter. | | [tensorflow::ops::DepthwiseConv2dNativeBackpropInput](class/tensorflow/ops/depthwise-conv2d-native-backprop-input) | Computes the gradients of depthwise convolution with respect to the input. | | [tensorflow::ops::Dilation2D](class/tensorflow/ops/dilation2-d) | Computes the grayscale dilation of 4-D `input` and 3-D `filter` tensors. | | [tensorflow::ops::Dilation2DBackpropFilter](class/tensorflow/ops/dilation2-d-backprop-filter) | Computes the gradient of morphological 2-D dilation with respect to the filter. | | [tensorflow::ops::Dilation2DBackpropInput](class/tensorflow/ops/dilation2-d-backprop-input) | Computes the gradient of morphological 2-D dilation with respect to the input. | | [tensorflow::ops::Elu](class/tensorflow/ops/elu) | Computes the exponential linear function. | | [tensorflow::ops::FractionalAvgPool](class/tensorflow/ops/fractional-avg-pool) | Performs fractional average pooling on the input. | | [tensorflow::ops::FractionalMaxPool](class/tensorflow/ops/fractional-max-pool) | Performs fractional max pooling on the input. | | [tensorflow::ops::FusedBatchNorm](class/tensorflow/ops/fused-batch-norm) | Batch normalization. | | [tensorflow::ops::FusedBatchNormGrad](class/tensorflow/ops/fused-batch-norm-grad) | Gradient for batch normalization. | | [tensorflow::ops::FusedBatchNormGradV2](class/tensorflow/ops/fused-batch-norm-grad-v2) | Gradient for batch normalization. | | [tensorflow::ops::FusedBatchNormGradV3](class/tensorflow/ops/fused-batch-norm-grad-v3) | Gradient for batch normalization. | | [tensorflow::ops::FusedBatchNormV2](class/tensorflow/ops/fused-batch-norm-v2) | Batch normalization. | | [tensorflow::ops::FusedBatchNormV3](class/tensorflow/ops/fused-batch-norm-v3) | Batch normalization. | | [tensorflow::ops::FusedPadConv2D](class/tensorflow/ops/fused-pad-conv2-d) | Performs a padding as a preprocess during a convolution. | | [tensorflow::ops::FusedResizeAndPadConv2D](class/tensorflow/ops/fused-resize-and-pad-conv2-d) | Performs a resize and padding as a preprocess during a convolution. | | [tensorflow::ops::InTopK](class/tensorflow/ops/in-top-k) | Says whether the targets are in the top `K` predictions. | | [tensorflow::ops::InTopKV2](class/tensorflow/ops/in-top-k-v2) | Says whether the targets are in the top `K` predictions. | | [tensorflow::ops::L2Loss](class/tensorflow/ops/l2-loss) | L2 Loss. | | [tensorflow::ops::LRN](class/tensorflow/ops/l-r-n) | Local Response Normalization. | | [tensorflow::ops::LogSoftmax](class/tensorflow/ops/log-softmax) | Computes log softmax activations. | | [tensorflow::ops::MaxPool](class/tensorflow/ops/max-pool) | Performs max pooling on the input. | | [tensorflow::ops::MaxPool3D](class/tensorflow/ops/max-pool3-d) | Performs 3D max pooling on the input. | | [tensorflow::ops::MaxPool3DGrad](class/tensorflow/ops/max-pool3-d-grad) | Computes gradients of 3D max pooling function. | | [tensorflow::ops::MaxPool3DGradGrad](class/tensorflow/ops/max-pool3-d-grad-grad) | Computes second-order gradients of the maxpooling function. | | [tensorflow::ops::MaxPoolGradGrad](class/tensorflow/ops/max-pool-grad-grad) | Computes second-order gradients of the maxpooling function. | | [tensorflow::ops::MaxPoolGradGradV2](class/tensorflow/ops/max-pool-grad-grad-v2) | Computes second-order gradients of the maxpooling function. | | [tensorflow::ops::MaxPoolGradGradWithArgmax](class/tensorflow/ops/max-pool-grad-grad-with-argmax) | Computes second-order gradients of the maxpooling function. | | [tensorflow::ops::MaxPoolGradV2](class/tensorflow/ops/max-pool-grad-v2) | Computes gradients of the maxpooling function. | | [tensorflow::ops::MaxPoolV2](class/tensorflow/ops/max-pool-v2) | Performs max pooling on the input. | | [tensorflow::ops::MaxPoolWithArgmax](class/tensorflow/ops/max-pool-with-argmax) | Performs max pooling on the input and outputs both max values and indices. | | [tensorflow::ops::NthElement](class/tensorflow/ops/nth-element) | Finds values of the `n`-th order statistic for the last dimension. | | [tensorflow::ops::QuantizedAvgPool](class/tensorflow/ops/quantized-avg-pool) | Produces the average pool of the input tensor for quantized types. | | [tensorflow::ops::QuantizedBatchNormWithGlobalNormalization](class/tensorflow/ops/quantized-batch-norm-with-global-normalization) | Quantized Batch normalization. | | [tensorflow::ops::QuantizedBiasAdd](class/tensorflow/ops/quantized-bias-add) | Adds [Tensor](class/tensorflow/tensor#classtensorflow_1_1_tensor) 'bias' to [Tensor](class/tensorflow/tensor#classtensorflow_1_1_tensor) 'input' for Quantized types. | | [tensorflow::ops::QuantizedConv2D](class/tensorflow/ops/quantized-conv2-d) | Computes a 2D convolution given quantized 4D input and filter tensors. | | [tensorflow::ops::QuantizedMaxPool](class/tensorflow/ops/quantized-max-pool) | Produces the max pool of the input tensor for quantized types. | | [tensorflow::ops::QuantizedRelu](class/tensorflow/ops/quantized-relu) | Computes Quantized Rectified Linear: `max(features, 0)` | | [tensorflow::ops::QuantizedRelu6](class/tensorflow/ops/quantized-relu6) | Computes Quantized Rectified Linear 6: `min(max(features, 0), 6)` | | [tensorflow::ops::QuantizedReluX](class/tensorflow/ops/quantized-relu-x) | Computes Quantized Rectified Linear X: `min(max(features, 0), max_value)` | | [tensorflow::ops::Relu](class/tensorflow/ops/relu) | Computes rectified linear: `max(features, 0)`. | | [tensorflow::ops::Relu6](class/tensorflow/ops/relu6) | Computes rectified linear 6: `min(max(features, 0), 6)`. | | [tensorflow::ops::Selu](class/tensorflow/ops/selu) | Computes scaled exponential linear: `scale * alpha * (exp(features) - 1)` | | [tensorflow::ops::Softmax](class/tensorflow/ops/softmax) | Computes softmax activations. | | [tensorflow::ops::SoftmaxCrossEntropyWithLogits](class/tensorflow/ops/softmax-cross-entropy-with-logits) | Computes softmax cross entropy cost and gradients to backpropagate. | | [tensorflow::ops::Softplus](class/tensorflow/ops/softplus) | TODO: add doc. | | [tensorflow::ops::Softsign](class/tensorflow/ops/softsign) | Computes softsign: `features / (abs(features) + 1)`. | | [tensorflow::ops::SparseSoftmaxCrossEntropyWithLogits](class/tensorflow/ops/sparse-softmax-cross-entropy-with-logits) | Computes softmax cross entropy cost and gradients to backpropagate. | | [tensorflow::ops::TopK](class/tensorflow/ops/top-k) | Finds values and indices of the `k` largest elements for the last dimension. | [no\_op](group/no-op) ---------------------- | Members | | --- | | [tensorflow::ops::NoOp](class/tensorflow/ops/no-op) | Does nothing. | [parsing\_ops](group/parsing-ops) ---------------------------------- | Members | | --- | | [tensorflow::ops::DecodeCSV](class/tensorflow/ops/decode-c-s-v) | Convert CSV records to tensors. | | [tensorflow::ops::DecodeCompressed](class/tensorflow/ops/decode-compressed) | Decompress strings. | | [tensorflow::ops::DecodeJSONExample](class/tensorflow/ops/decode-j-s-o-n-example) | Convert JSON-encoded Example records to binary protocol buffer strings. | | [tensorflow::ops::DecodePaddedRaw](class/tensorflow/ops/decode-padded-raw) | Reinterpret the bytes of a string as a vector of numbers. | | [tensorflow::ops::DecodeRaw](class/tensorflow/ops/decode-raw) | Reinterpret the bytes of a string as a vector of numbers. | | [tensorflow::ops::ParseExample](class/tensorflow/ops/parse-example) | Transforms a vector of brain.Example protos (as strings) into typed tensors. | | [tensorflow::ops::ParseExampleV2](class/tensorflow/ops/parse-example-v2) | Transforms a vector of tf.Example protos (as strings) into typed tensors. | | [tensorflow::ops::ParseSequenceExample](class/tensorflow/ops/parse-sequence-example) | Transforms a vector of brain.SequenceExample protos (as strings) into typed tensors. | | [tensorflow::ops::ParseSequenceExampleV2](class/tensorflow/ops/parse-sequence-example-v2) | Transforms a vector of tf.io.SequenceExample protos (as strings) into typed tensors. | | [tensorflow::ops::ParseSingleExample](class/tensorflow/ops/parse-single-example) | Transforms a tf.Example proto (as a string) into typed tensors. | | [tensorflow::ops::ParseSingleSequenceExample](class/tensorflow/ops/parse-single-sequence-example) | Transforms a scalar brain.SequenceExample proto (as strings) into typed tensors. | | [tensorflow::ops::ParseTensor](class/tensorflow/ops/parse-tensor) | Transforms a serialized tensorflow.TensorProto proto into a [Tensor](class/tensorflow/tensor#classtensorflow_1_1_tensor). | | [tensorflow::ops::SerializeTensor](class/tensorflow/ops/serialize-tensor) | Transforms a [Tensor](class/tensorflow/tensor#classtensorflow_1_1_tensor) into a serialized TensorProto proto. | | [tensorflow::ops::StringToNumber](class/tensorflow/ops/string-to-number) | Converts each string in the input [Tensor](class/tensorflow/tensor#classtensorflow_1_1_tensor) to the specified numeric type. | [random\_ops](group/random-ops) -------------------------------- | Members | | --- | | [tensorflow::ops::Multinomial](class/tensorflow/ops/multinomial) | Draws samples from a multinomial distribution. | | [tensorflow::ops::ParameterizedTruncatedNormal](class/tensorflow/ops/parameterized-truncated-normal) | Outputs random values from a normal distribution. | | [tensorflow::ops::RandomGamma](class/tensorflow/ops/random-gamma) | Outputs random values from the Gamma distribution(s) described by alpha. | | [tensorflow::ops::RandomNormal](class/tensorflow/ops/random-normal) | Outputs random values from a normal distribution. | | [tensorflow::ops::RandomPoissonV2](class/tensorflow/ops/random-poisson-v2) | Outputs random values from the Poisson distribution(s) described by rate. | | [tensorflow::ops::RandomShuffle](class/tensorflow/ops/random-shuffle) | Randomly shuffles a tensor along its first dimension. | | [tensorflow::ops::RandomUniform](class/tensorflow/ops/random-uniform) | Outputs random values from a uniform distribution. | | [tensorflow::ops::RandomUniformInt](class/tensorflow/ops/random-uniform-int) | Outputs random integers from a uniform distribution. | | [tensorflow::ops::TruncatedNormal](class/tensorflow/ops/truncated-normal) | Outputs random values from a truncated normal distribution. | [sparse\_ops](group/sparse-ops) -------------------------------- | Members | | --- | | [tensorflow::ops::AddManySparseToTensorsMap](class/tensorflow/ops/add-many-sparse-to-tensors-map) | [Add](class/tensorflow/ops/add#classtensorflow_1_1ops_1_1_add) an `N`-minibatch `SparseTensor` to a `SparseTensorsMap`, return `N` handles. | | [tensorflow::ops::AddSparseToTensorsMap](class/tensorflow/ops/add-sparse-to-tensors-map) | [Add](class/tensorflow/ops/add#classtensorflow_1_1ops_1_1_add) a `SparseTensor` to a `SparseTensorsMap` return its handle. | | [tensorflow::ops::DeserializeManySparse](class/tensorflow/ops/deserialize-many-sparse) | Deserialize and concatenate `SparseTensors` from a serialized minibatch. | | [tensorflow::ops::DeserializeSparse](class/tensorflow/ops/deserialize-sparse) | Deserialize `SparseTensor` objects. | | [tensorflow::ops::SerializeManySparse](class/tensorflow/ops/serialize-many-sparse) | Serialize an `N`-minibatch `SparseTensor` into an `[N, 3]``[Tensor](class/tensorflow/tensor#classtensorflow_1_1_tensor)` object. | | [tensorflow::ops::SerializeSparse](class/tensorflow/ops/serialize-sparse) | Serialize a `SparseTensor` into a `[3]``[Tensor](class/tensorflow/tensor#classtensorflow_1_1_tensor)` object. | | [tensorflow::ops::SparseAdd](class/tensorflow/ops/sparse-add) | Adds two `SparseTensor` objects to produce another `SparseTensor`. | | [tensorflow::ops::SparseAddGrad](class/tensorflow/ops/sparse-add-grad) | The gradient operator for the [SparseAdd](class/tensorflow/ops/sparse-add#classtensorflow_1_1ops_1_1_sparse_add) op. | | [tensorflow::ops::SparseConcat](class/tensorflow/ops/sparse-concat) | Concatenates a list of `SparseTensor` along the specified dimension. | | [tensorflow::ops::SparseCross](class/tensorflow/ops/sparse-cross) | Generates sparse cross from a list of sparse and dense tensors. | | [tensorflow::ops::SparseCrossHashed](class/tensorflow/ops/sparse-cross-hashed) | Generates sparse cross from a list of sparse and dense tensors. | | [tensorflow::ops::SparseCrossV2](class/tensorflow/ops/sparse-cross-v2) | Generates sparse cross from a list of sparse and dense tensors. | | [tensorflow::ops::SparseDenseCwiseAdd](class/tensorflow/ops/sparse-dense-cwise-add) | Adds up a SparseTensor and a dense [Tensor](class/tensorflow/tensor#classtensorflow_1_1_tensor), using these special rules: | | [tensorflow::ops::SparseDenseCwiseDiv](class/tensorflow/ops/sparse-dense-cwise-div) | Component-wise divides a SparseTensor by a dense [Tensor](class/tensorflow/tensor#classtensorflow_1_1_tensor). | | [tensorflow::ops::SparseDenseCwiseMul](class/tensorflow/ops/sparse-dense-cwise-mul) | Component-wise multiplies a SparseTensor by a dense [Tensor](class/tensorflow/tensor#classtensorflow_1_1_tensor). | | [tensorflow::ops::SparseFillEmptyRows](class/tensorflow/ops/sparse-fill-empty-rows) | Fills empty rows in the input 2-D `SparseTensor` with a default value. | | [tensorflow::ops::SparseFillEmptyRowsGrad](class/tensorflow/ops/sparse-fill-empty-rows-grad) | The gradient of [SparseFillEmptyRows](class/tensorflow/ops/sparse-fill-empty-rows#classtensorflow_1_1ops_1_1_sparse_fill_empty_rows). | | [tensorflow::ops::SparseReduceMax](class/tensorflow/ops/sparse-reduce-max) | Computes the max of elements across dimensions of a SparseTensor. | | [tensorflow::ops::SparseReduceMaxSparse](class/tensorflow/ops/sparse-reduce-max-sparse) | Computes the max of elements across dimensions of a SparseTensor. | | [tensorflow::ops::SparseReduceSum](class/tensorflow/ops/sparse-reduce-sum) | Computes the sum of elements across dimensions of a SparseTensor. | | [tensorflow::ops::SparseReduceSumSparse](class/tensorflow/ops/sparse-reduce-sum-sparse) | Computes the sum of elements across dimensions of a SparseTensor. | | [tensorflow::ops::SparseReorder](class/tensorflow/ops/sparse-reorder) | Reorders a SparseTensor into the canonical, row-major ordering. | | [tensorflow::ops::SparseReshape](class/tensorflow/ops/sparse-reshape) | Reshapes a SparseTensor to represent values in a new dense shape. | | [tensorflow::ops::SparseSlice](class/tensorflow/ops/sparse-slice) | Slice a `SparseTensor` based on the `start` and `size`. | | [tensorflow::ops::SparseSliceGrad](class/tensorflow/ops/sparse-slice-grad) | The gradient operator for the [SparseSlice](class/tensorflow/ops/sparse-slice#classtensorflow_1_1ops_1_1_sparse_slice) op. | | [tensorflow::ops::SparseSoftmax](class/tensorflow/ops/sparse-softmax) | Applies softmax to a batched N-D `SparseTensor`. | | [tensorflow::ops::SparseSparseMaximum](class/tensorflow/ops/sparse-sparse-maximum) | Returns the element-wise max of two SparseTensors. | | [tensorflow::ops::SparseSparseMinimum](class/tensorflow/ops/sparse-sparse-minimum) | Returns the element-wise min of two SparseTensors. | | [tensorflow::ops::SparseSplit](class/tensorflow/ops/sparse-split) | Split a `SparseTensor` into `num_split` tensors along one dimension. | | [tensorflow::ops::SparseTensorDenseAdd](class/tensorflow/ops/sparse-tensor-dense-add) | Adds up a `SparseTensor` and a dense `[Tensor](class/tensorflow/tensor#classtensorflow_1_1_tensor)`, producing a dense `[Tensor](class/tensorflow/tensor#classtensorflow_1_1_tensor)`. | | [tensorflow::ops::SparseTensorDenseMatMul](class/tensorflow/ops/sparse-tensor-dense-mat-mul) | [Multiply](class/tensorflow/ops/multiply#classtensorflow_1_1ops_1_1_multiply) SparseTensor (of rank 2) "A" by dense matrix "B". | | [tensorflow::ops::TakeManySparseFromTensorsMap](class/tensorflow/ops/take-many-sparse-from-tensors-map) | Converts a sparse representation into a dense tensor. | [state\_ops](group/state-ops) ------------------------------ | Members | | --- | | [tensorflow::ops::Assign](class/tensorflow/ops/assign) | Update 'ref' by assigning 'value' to it. | | [tensorflow::ops::AssignAdd](class/tensorflow/ops/assign-add) | Update 'ref' by adding 'value' to it. | | [tensorflow::ops::AssignSub](class/tensorflow/ops/assign-sub) | Update 'ref' by subtracting 'value' from it. | | [tensorflow::ops::CountUpTo](class/tensorflow/ops/count-up-to) | Increments 'ref' until it reaches 'limit'. | | [tensorflow::ops::DestroyTemporaryVariable](class/tensorflow/ops/destroy-temporary-variable) | Destroys the temporary variable and returns its final value. | | [tensorflow::ops::IsVariableInitialized](class/tensorflow/ops/is-variable-initialized) | Checks whether a tensor has been initialized. | | [tensorflow::ops::ResourceCountUpTo](class/tensorflow/ops/resource-count-up-to) | Increments variable pointed to by 'resource' until it reaches 'limit'. | | [tensorflow::ops::ResourceScatterNdAdd](class/tensorflow/ops/resource-scatter-nd-add) | Applies sparse addition to individual values or slices in a [Variable](class/tensorflow/ops/variable#classtensorflow_1_1ops_1_1_variable). | | [tensorflow::ops::ResourceScatterNdMax](class/tensorflow/ops/resource-scatter-nd-max) | TODO: add doc. | | [tensorflow::ops::ResourceScatterNdMin](class/tensorflow/ops/resource-scatter-nd-min) | TODO: add doc. | | [tensorflow::ops::ResourceScatterNdSub](class/tensorflow/ops/resource-scatter-nd-sub) | Applies sparse subtraction to individual values or slices in a [Variable](class/tensorflow/ops/variable#classtensorflow_1_1ops_1_1_variable). | | [tensorflow::ops::ResourceScatterNdUpdate](class/tensorflow/ops/resource-scatter-nd-update) | Applies sparse `updates` to individual values or slices within a given. | | [tensorflow::ops::ScatterAdd](class/tensorflow/ops/scatter-add) | Adds sparse updates to a variable reference. | | [tensorflow::ops::ScatterDiv](class/tensorflow/ops/scatter-div) | Divides a variable reference by sparse updates. | | [tensorflow::ops::ScatterMax](class/tensorflow/ops/scatter-max) | Reduces sparse updates into a variable reference using the `max` operation. | | [tensorflow::ops::ScatterMin](class/tensorflow/ops/scatter-min) | Reduces sparse updates into a variable reference using the `min` operation. | | [tensorflow::ops::ScatterMul](class/tensorflow/ops/scatter-mul) | Multiplies sparse updates into a variable reference. | | [tensorflow::ops::ScatterNdAdd](class/tensorflow/ops/scatter-nd-add) | Applies sparse addition to individual values or slices in a [Variable](class/tensorflow/ops/variable#classtensorflow_1_1ops_1_1_variable). | | [tensorflow::ops::ScatterNdSub](class/tensorflow/ops/scatter-nd-sub) | Applies sparse subtraction to individual values or slices in a [Variable](class/tensorflow/ops/variable#classtensorflow_1_1ops_1_1_variable). | | [tensorflow::ops::ScatterNdUpdate](class/tensorflow/ops/scatter-nd-update) | Applies sparse `updates` to individual values or slices within a given. | | [tensorflow::ops::ScatterSub](class/tensorflow/ops/scatter-sub) | Subtracts sparse updates to a variable reference. | | [tensorflow::ops::ScatterUpdate](class/tensorflow/ops/scatter-update) | Applies sparse updates to a variable reference. | | [tensorflow::ops::TemporaryVariable](class/tensorflow/ops/temporary-variable) | Returns a tensor that may be mutated, but only persists within a single step. | | [tensorflow::ops::Variable](class/tensorflow/ops/variable) | Holds state in the form of a tensor that persists across steps. | [string\_ops](group/string-ops) -------------------------------- | Members | | --- | | [tensorflow::ops::AsString](class/tensorflow/ops/as-string) | Converts each entry in the given tensor to strings. | | [tensorflow::ops::DecodeBase64](class/tensorflow/ops/decode-base64) | Decode web-safe base64-encoded strings. | | [tensorflow::ops::EncodeBase64](class/tensorflow/ops/encode-base64) | Encode strings into web-safe base64 format. | | [tensorflow::ops::ReduceJoin](class/tensorflow/ops/reduce-join) | Joins a string [Tensor](class/tensorflow/tensor#classtensorflow_1_1_tensor) across the given dimensions. | | [tensorflow::ops::RegexFullMatch](class/tensorflow/ops/regex-full-match) | Check if the input matches the regex pattern. | | [tensorflow::ops::RegexReplace](class/tensorflow/ops/regex-replace) | Replaces matches of the `pattern` regular expression in `input` with the replacement string provided in `rewrite`. | | [tensorflow::ops::StringFormat](class/tensorflow/ops/string-format) | Formats a string template using a list of tensors. | | [tensorflow::ops::StringJoin](class/tensorflow/ops/string-join) | Joins the strings in the given list of string tensors into one tensor;. | | [tensorflow::ops::StringLength](class/tensorflow/ops/string-length) | String lengths of `input`. | | [tensorflow::ops::StringLower](class/tensorflow/ops/string-lower) | Converts all uppercase characters into their respective lowercase replacements. | | [tensorflow::ops::StringNGrams](class/tensorflow/ops/string-n-grams) | Creates ngrams from ragged string data. | | [tensorflow::ops::StringSplit](class/tensorflow/ops/string-split) | Split elements of `input` based on `delimiter` into a `SparseTensor`. | | [tensorflow::ops::StringSplitV2](class/tensorflow/ops/string-split-v2) | Split elements of `source` based on `sep` into a `SparseTensor`. | | [tensorflow::ops::StringStrip](class/tensorflow/ops/string-strip) | Strip leading and trailing whitespaces from the [Tensor](class/tensorflow/tensor#classtensorflow_1_1_tensor). | | [tensorflow::ops::StringToHashBucket](class/tensorflow/ops/string-to-hash-bucket) | Converts each string in the input [Tensor](class/tensorflow/tensor#classtensorflow_1_1_tensor) to its hash mod by a number of buckets. | | [tensorflow::ops::StringToHashBucketFast](class/tensorflow/ops/string-to-hash-bucket-fast) | Converts each string in the input [Tensor](class/tensorflow/tensor#classtensorflow_1_1_tensor) to its hash mod by a number of buckets. | | [tensorflow::ops::StringToHashBucketStrong](class/tensorflow/ops/string-to-hash-bucket-strong) | Converts each string in the input [Tensor](class/tensorflow/tensor#classtensorflow_1_1_tensor) to its hash mod by a number of buckets. | | [tensorflow::ops::StringUpper](class/tensorflow/ops/string-upper) | Converts all lowercase characters into their respective uppercase replacements. | | [tensorflow::ops::Substr](class/tensorflow/ops/substr) | Return substrings from `[Tensor](class/tensorflow/tensor#classtensorflow_1_1_tensor)` of strings. | | [tensorflow::ops::UnicodeScript](class/tensorflow/ops/unicode-script) | Determine the script codes of a given tensor of Unicode integer code points. | | [tensorflow::ops::UnicodeTranscode](class/tensorflow/ops/unicode-transcode) | Transcode the input text from a source encoding to a destination encoding. | | [tensorflow::ops::UnsortedSegmentJoin](class/tensorflow/ops/unsorted-segment-join) | Joins the elements of `inputs` based on `segment_ids`. | [training\_ops](group/training-ops) ------------------------------------ | Members | | --- | | [tensorflow::ops::ApplyAdadelta](class/tensorflow/ops/apply-adadelta) | Update '\*var' according to the adadelta scheme. | | [tensorflow::ops::ApplyAdagrad](class/tensorflow/ops/apply-adagrad) | Update '\*var' according to the adagrad scheme. | | [tensorflow::ops::ApplyAdagradDA](class/tensorflow/ops/apply-adagrad-d-a) | Update '\*var' according to the proximal adagrad scheme. | | [tensorflow::ops::ApplyAdam](class/tensorflow/ops/apply-adam) | Update '\*var' according to the Adam algorithm. | | [tensorflow::ops::ApplyAddSign](class/tensorflow/ops/apply-add-sign) | Update '\*var' according to the AddSign update. | | [tensorflow::ops::ApplyCenteredRMSProp](class/tensorflow/ops/apply-centered-r-m-s-prop) | Update '\*var' according to the centered RMSProp algorithm. | | [tensorflow::ops::ApplyFtrl](class/tensorflow/ops/apply-ftrl) | Update '\*var' according to the Ftrl-proximal scheme. | | [tensorflow::ops::ApplyFtrlV2](class/tensorflow/ops/apply-ftrl-v2) | Update '\*var' according to the Ftrl-proximal scheme. | | [tensorflow::ops::ApplyGradientDescent](class/tensorflow/ops/apply-gradient-descent) | Update '\*var' by subtracting 'alpha' \* 'delta' from it. | | [tensorflow::ops::ApplyMomentum](class/tensorflow/ops/apply-momentum) | Update '\*var' according to the momentum scheme. | | [tensorflow::ops::ApplyPowerSign](class/tensorflow/ops/apply-power-sign) | Update '\*var' according to the AddSign update. | | [tensorflow::ops::ApplyProximalAdagrad](class/tensorflow/ops/apply-proximal-adagrad) | Update '\*var' and '\*accum' according to FOBOS with Adagrad learning rate. | | [tensorflow::ops::ApplyProximalGradientDescent](class/tensorflow/ops/apply-proximal-gradient-descent) | Update '\*var' as FOBOS algorithm with fixed learning rate. | | [tensorflow::ops::ApplyRMSProp](class/tensorflow/ops/apply-r-m-s-prop) | Update '\*var' according to the RMSProp algorithm. | | [tensorflow::ops::ResourceApplyAdadelta](class/tensorflow/ops/resource-apply-adadelta) | Update '\*var' according to the adadelta scheme. | | [tensorflow::ops::ResourceApplyAdagrad](class/tensorflow/ops/resource-apply-adagrad) | Update '\*var' according to the adagrad scheme. | | [tensorflow::ops::ResourceApplyAdagradDA](class/tensorflow/ops/resource-apply-adagrad-d-a) | Update '\*var' according to the proximal adagrad scheme. | | [tensorflow::ops::ResourceApplyAdam](class/tensorflow/ops/resource-apply-adam) | Update '\*var' according to the Adam algorithm. | | [tensorflow::ops::ResourceApplyAdamWithAmsgrad](class/tensorflow/ops/resource-apply-adam-with-amsgrad) | Update '\*var' according to the Adam algorithm. | | [tensorflow::ops::ResourceApplyAddSign](class/tensorflow/ops/resource-apply-add-sign) | Update '\*var' according to the AddSign update. | | [tensorflow::ops::ResourceApplyCenteredRMSProp](class/tensorflow/ops/resource-apply-centered-r-m-s-prop) | Update '\*var' according to the centered RMSProp algorithm. | | [tensorflow::ops::ResourceApplyFtrl](class/tensorflow/ops/resource-apply-ftrl) | Update '\*var' according to the Ftrl-proximal scheme. | | [tensorflow::ops::ResourceApplyFtrlV2](class/tensorflow/ops/resource-apply-ftrl-v2) | Update '\*var' according to the Ftrl-proximal scheme. | | [tensorflow::ops::ResourceApplyGradientDescent](class/tensorflow/ops/resource-apply-gradient-descent) | Update '\*var' by subtracting 'alpha' \* 'delta' from it. | | [tensorflow::ops::ResourceApplyKerasMomentum](class/tensorflow/ops/resource-apply-keras-momentum) | Update '\*var' according to the momentum scheme. | | [tensorflow::ops::ResourceApplyMomentum](class/tensorflow/ops/resource-apply-momentum) | Update '\*var' according to the momentum scheme. | | [tensorflow::ops::ResourceApplyPowerSign](class/tensorflow/ops/resource-apply-power-sign) | Update '\*var' according to the AddSign update. | | [tensorflow::ops::ResourceApplyProximalAdagrad](class/tensorflow/ops/resource-apply-proximal-adagrad) | Update '\*var' and '\*accum' according to FOBOS with Adagrad learning rate. | | [tensorflow::ops::ResourceApplyProximalGradientDescent](class/tensorflow/ops/resource-apply-proximal-gradient-descent) | Update '\*var' as FOBOS algorithm with fixed learning rate. | | [tensorflow::ops::ResourceApplyRMSProp](class/tensorflow/ops/resource-apply-r-m-s-prop) | Update '\*var' according to the RMSProp algorithm. | | [tensorflow::ops::ResourceSparseApplyAdadelta](class/tensorflow/ops/resource-sparse-apply-adadelta) | var: Should be from a Variable(). | | [tensorflow::ops::ResourceSparseApplyAdagrad](class/tensorflow/ops/resource-sparse-apply-adagrad) | Update relevant entries in '\*var' and '\*accum' according to the adagrad scheme. | | [tensorflow::ops::ResourceSparseApplyAdagradDA](class/tensorflow/ops/resource-sparse-apply-adagrad-d-a) | Update entries in '\*var' and '\*accum' according to the proximal adagrad scheme. | | [tensorflow::ops::ResourceSparseApplyCenteredRMSProp](class/tensorflow/ops/resource-sparse-apply-centered-r-m-s-prop) | Update '\*var' according to the centered RMSProp algorithm. | | [tensorflow::ops::ResourceSparseApplyFtrl](class/tensorflow/ops/resource-sparse-apply-ftrl) | Update relevant entries in '\*var' according to the Ftrl-proximal scheme. | | [tensorflow::ops::ResourceSparseApplyFtrlV2](class/tensorflow/ops/resource-sparse-apply-ftrl-v2) | Update relevant entries in '\*var' according to the Ftrl-proximal scheme. | | [tensorflow::ops::ResourceSparseApplyKerasMomentum](class/tensorflow/ops/resource-sparse-apply-keras-momentum) | Update relevant entries in '\*var' and '\*accum' according to the momentum scheme. | | [tensorflow::ops::ResourceSparseApplyMomentum](class/tensorflow/ops/resource-sparse-apply-momentum) | Update relevant entries in '\*var' and '\*accum' according to the momentum scheme. | | [tensorflow::ops::ResourceSparseApplyProximalAdagrad](class/tensorflow/ops/resource-sparse-apply-proximal-adagrad) | Sparse update entries in '\*var' and '\*accum' according to FOBOS algorithm. | | [tensorflow::ops::ResourceSparseApplyProximalGradientDescent](class/tensorflow/ops/resource-sparse-apply-proximal-gradient-descent) | Sparse update '\*var' as FOBOS algorithm with fixed learning rate. | | [tensorflow::ops::ResourceSparseApplyRMSProp](class/tensorflow/ops/resource-sparse-apply-r-m-s-prop) | Update '\*var' according to the RMSProp algorithm. | | [tensorflow::ops::SparseApplyAdadelta](class/tensorflow/ops/sparse-apply-adadelta) | var: Should be from a Variable(). | | [tensorflow::ops::SparseApplyAdagrad](class/tensorflow/ops/sparse-apply-adagrad) | Update relevant entries in '\*var' and '\*accum' according to the adagrad scheme. | | [tensorflow::ops::SparseApplyAdagradDA](class/tensorflow/ops/sparse-apply-adagrad-d-a) | Update entries in '\*var' and '\*accum' according to the proximal adagrad scheme. | | [tensorflow::ops::SparseApplyCenteredRMSProp](class/tensorflow/ops/sparse-apply-centered-r-m-s-prop) | Update '\*var' according to the centered RMSProp algorithm. | | [tensorflow::ops::SparseApplyFtrl](class/tensorflow/ops/sparse-apply-ftrl) | Update relevant entries in '\*var' according to the Ftrl-proximal scheme. | | [tensorflow::ops::SparseApplyFtrlV2](class/tensorflow/ops/sparse-apply-ftrl-v2) | Update relevant entries in '\*var' according to the Ftrl-proximal scheme. | | [tensorflow::ops::SparseApplyMomentum](class/tensorflow/ops/sparse-apply-momentum) | Update relevant entries in '\*var' and '\*accum' according to the momentum scheme. | | [tensorflow::ops::SparseApplyProximalAdagrad](class/tensorflow/ops/sparse-apply-proximal-adagrad) | Sparse update entries in '\*var' and '\*accum' according to FOBOS algorithm. | | [tensorflow::ops::SparseApplyProximalGradientDescent](class/tensorflow/ops/sparse-apply-proximal-gradient-descent) | Sparse update '\*var' as FOBOS algorithm with fixed learning rate. | | [tensorflow::ops::SparseApplyRMSProp](class/tensorflow/ops/sparse-apply-r-m-s-prop) | Update '\*var' according to the RMSProp algorithm. | [user\_ops](group/user-ops) ---------------------------- | Members | | --- | | [tensorflow::ops::Fact](class/tensorflow/ops/fact) | [Output](class/tensorflow/output#classtensorflow_1_1_output) a fact about factorials. |
programming_docs
tensorflow_cpp Image Ops Image Ops ========= Summary ------- | Classes | | --- | | [tensorflow::ops::AdjustContrast](../class/tensorflow/ops/adjust-contrast) | Adjust the contrast of one or more images. | | [tensorflow::ops::AdjustHue](../class/tensorflow/ops/adjust-hue) | Adjust the hue of one or more images. | | [tensorflow::ops::AdjustSaturation](../class/tensorflow/ops/adjust-saturation) | Adjust the saturation of one or more images. | | [tensorflow::ops::CombinedNonMaxSuppression](../class/tensorflow/ops/combined-non-max-suppression) | Greedily selects a subset of bounding boxes in descending order of score,. | | [tensorflow::ops::CropAndResize](../class/tensorflow/ops/crop-and-resize) | Extracts crops from the input image tensor and resizes them. | | [tensorflow::ops::CropAndResizeGradBoxes](../class/tensorflow/ops/crop-and-resize-grad-boxes) | Computes the gradient of the crop\_and\_resize op wrt the input boxes tensor. | | [tensorflow::ops::CropAndResizeGradImage](../class/tensorflow/ops/crop-and-resize-grad-image) | Computes the gradient of the crop\_and\_resize op wrt the input image tensor. | | [tensorflow::ops::DecodeAndCropJpeg](../class/tensorflow/ops/decode-and-crop-jpeg) | Decode and Crop a JPEG-encoded image to a uint8 tensor. | | [tensorflow::ops::DecodeBmp](../class/tensorflow/ops/decode-bmp) | Decode the first frame of a BMP-encoded image to a uint8 tensor. | | [tensorflow::ops::DecodeGif](../class/tensorflow/ops/decode-gif) | Decode the frame(s) of a GIF-encoded image to a uint8 tensor. | | [tensorflow::ops::DecodeImage](../class/tensorflow/ops/decode-image) | Function for decode\_bmp, decode\_gif, decode\_jpeg, and decode\_png. | | [tensorflow::ops::DecodeJpeg](../class/tensorflow/ops/decode-jpeg) | Decode a JPEG-encoded image to a uint8 tensor. | | [tensorflow::ops::DecodePng](../class/tensorflow/ops/decode-png) | Decode a PNG-encoded image to a uint8 or uint16 tensor. | | [tensorflow::ops::DrawBoundingBoxes](../class/tensorflow/ops/draw-bounding-boxes) | Draw bounding boxes on a batch of images. | | [tensorflow::ops::DrawBoundingBoxesV2](../class/tensorflow/ops/draw-bounding-boxes-v2) | Draw bounding boxes on a batch of images. | | [tensorflow::ops::EncodeJpeg](../class/tensorflow/ops/encode-jpeg) | JPEG-encode an image. | | [tensorflow::ops::EncodeJpegVariableQuality](../class/tensorflow/ops/encode-jpeg-variable-quality) | JPEG encode input image with provided compression quality. | | [tensorflow::ops::EncodePng](../class/tensorflow/ops/encode-png) | PNG-encode an image. | | [tensorflow::ops::ExtractGlimpse](../class/tensorflow/ops/extract-glimpse) | Extracts a glimpse from the input tensor. | | [tensorflow::ops::ExtractJpegShape](../class/tensorflow/ops/extract-jpeg-shape) | Extract the shape information of a JPEG-encoded image. | | [tensorflow::ops::HSVToRGB](../class/tensorflow/ops/h-s-v-to-r-g-b) | Convert one or more images from HSV to RGB. | | [tensorflow::ops::NonMaxSuppression](../class/tensorflow/ops/non-max-suppression) | Greedily selects a subset of bounding boxes in descending order of score,. | | [tensorflow::ops::NonMaxSuppressionV2](../class/tensorflow/ops/non-max-suppression-v2) | Greedily selects a subset of bounding boxes in descending order of score,. | | [tensorflow::ops::NonMaxSuppressionV3](../class/tensorflow/ops/non-max-suppression-v3) | Greedily selects a subset of bounding boxes in descending order of score,. | | [tensorflow::ops::NonMaxSuppressionV4](../class/tensorflow/ops/non-max-suppression-v4) | Greedily selects a subset of bounding boxes in descending order of score,. | | [tensorflow::ops::NonMaxSuppressionV5](../class/tensorflow/ops/non-max-suppression-v5) | Greedily selects a subset of bounding boxes in descending order of score,. | | [tensorflow::ops::NonMaxSuppressionWithOverlaps](../class/tensorflow/ops/non-max-suppression-with-overlaps) | Greedily selects a subset of bounding boxes in descending order of score,. | | [tensorflow::ops::QuantizedResizeBilinear](../class/tensorflow/ops/quantized-resize-bilinear) | Resize quantized `images` to `size` using quantized bilinear interpolation. | | [tensorflow::ops::RGBToHSV](../class/tensorflow/ops/r-g-b-to-h-s-v) | Converts one or more images from RGB to HSV. | | [tensorflow::ops::ResizeArea](../class/tensorflow/ops/resize-area) | Resize `images` to `size` using area interpolation. | | [tensorflow::ops::ResizeBicubic](../class/tensorflow/ops/resize-bicubic) | Resize `images` to `size` using bicubic interpolation. | | [tensorflow::ops::ResizeBilinear](../class/tensorflow/ops/resize-bilinear) | Resize `images` to `size` using bilinear interpolation. | | [tensorflow::ops::ResizeNearestNeighbor](../class/tensorflow/ops/resize-nearest-neighbor) | Resize `images` to `size` using nearest neighbor interpolation. | | [tensorflow::ops::SampleDistortedBoundingBox](../class/tensorflow/ops/sample-distorted-bounding-box) | Generate a single randomly distorted bounding box for an image. | | [tensorflow::ops::SampleDistortedBoundingBoxV2](../class/tensorflow/ops/sample-distorted-bounding-box-v2) | Generate a single randomly distorted bounding box for an image. | | [tensorflow::ops::ScaleAndTranslate](../class/tensorflow/ops/scale-and-translate) | TODO: add doc. | | [tensorflow::ops::StatelessSampleDistortedBoundingBox](../class/tensorflow/ops/stateless-sample-distorted-bounding-box) | Generate a randomly distorted bounding box for an image deterministically. | tensorflow_cpp Sparse Ops Sparse Ops ========== Summary ------- | Classes | | --- | | [tensorflow::ops::AddManySparseToTensorsMap](../class/tensorflow/ops/add-many-sparse-to-tensors-map) | [Add](../class/tensorflow/ops/add#classtensorflow_1_1ops_1_1_add) an `N`-minibatch `SparseTensor` to a `SparseTensorsMap`, return `N` handles. | | [tensorflow::ops::AddSparseToTensorsMap](../class/tensorflow/ops/add-sparse-to-tensors-map) | [Add](../class/tensorflow/ops/add#classtensorflow_1_1ops_1_1_add) a `SparseTensor` to a `SparseTensorsMap` return its handle. | | [tensorflow::ops::DeserializeManySparse](../class/tensorflow/ops/deserialize-many-sparse) | Deserialize and concatenate `SparseTensors` from a serialized minibatch. | | [tensorflow::ops::DeserializeSparse](../class/tensorflow/ops/deserialize-sparse) | Deserialize `SparseTensor` objects. | | [tensorflow::ops::SerializeManySparse](../class/tensorflow/ops/serialize-many-sparse) | Serialize an `N`-minibatch `SparseTensor` into an `[N, 3]``[Tensor](../class/tensorflow/tensor#classtensorflow_1_1_tensor)` object. | | [tensorflow::ops::SerializeSparse](../class/tensorflow/ops/serialize-sparse) | Serialize a `SparseTensor` into a `[3]``[Tensor](../class/tensorflow/tensor#classtensorflow_1_1_tensor)` object. | | [tensorflow::ops::SparseAdd](../class/tensorflow/ops/sparse-add) | Adds two `SparseTensor` objects to produce another `SparseTensor`. | | [tensorflow::ops::SparseAddGrad](../class/tensorflow/ops/sparse-add-grad) | The gradient operator for the [SparseAdd](../class/tensorflow/ops/sparse-add#classtensorflow_1_1ops_1_1_sparse_add) op. | | [tensorflow::ops::SparseConcat](../class/tensorflow/ops/sparse-concat) | Concatenates a list of `SparseTensor` along the specified dimension. | | [tensorflow::ops::SparseCross](../class/tensorflow/ops/sparse-cross) | Generates sparse cross from a list of sparse and dense tensors. | | [tensorflow::ops::SparseCrossHashed](../class/tensorflow/ops/sparse-cross-hashed) | Generates sparse cross from a list of sparse and dense tensors. | | [tensorflow::ops::SparseCrossV2](../class/tensorflow/ops/sparse-cross-v2) | Generates sparse cross from a list of sparse and dense tensors. | | [tensorflow::ops::SparseDenseCwiseAdd](../class/tensorflow/ops/sparse-dense-cwise-add) | Adds up a SparseTensor and a dense [Tensor](../class/tensorflow/tensor#classtensorflow_1_1_tensor), using these special rules: | | [tensorflow::ops::SparseDenseCwiseDiv](../class/tensorflow/ops/sparse-dense-cwise-div) | Component-wise divides a SparseTensor by a dense [Tensor](../class/tensorflow/tensor#classtensorflow_1_1_tensor). | | [tensorflow::ops::SparseDenseCwiseMul](../class/tensorflow/ops/sparse-dense-cwise-mul) | Component-wise multiplies a SparseTensor by a dense [Tensor](../class/tensorflow/tensor#classtensorflow_1_1_tensor). | | [tensorflow::ops::SparseFillEmptyRows](../class/tensorflow/ops/sparse-fill-empty-rows) | Fills empty rows in the input 2-D `SparseTensor` with a default value. | | [tensorflow::ops::SparseFillEmptyRowsGrad](../class/tensorflow/ops/sparse-fill-empty-rows-grad) | The gradient of [SparseFillEmptyRows](../class/tensorflow/ops/sparse-fill-empty-rows#classtensorflow_1_1ops_1_1_sparse_fill_empty_rows). | | [tensorflow::ops::SparseReduceMax](../class/tensorflow/ops/sparse-reduce-max) | Computes the max of elements across dimensions of a SparseTensor. | | [tensorflow::ops::SparseReduceMaxSparse](../class/tensorflow/ops/sparse-reduce-max-sparse) | Computes the max of elements across dimensions of a SparseTensor. | | [tensorflow::ops::SparseReduceSum](../class/tensorflow/ops/sparse-reduce-sum) | Computes the sum of elements across dimensions of a SparseTensor. | | [tensorflow::ops::SparseReduceSumSparse](../class/tensorflow/ops/sparse-reduce-sum-sparse) | Computes the sum of elements across dimensions of a SparseTensor. | | [tensorflow::ops::SparseReorder](../class/tensorflow/ops/sparse-reorder) | Reorders a SparseTensor into the canonical, row-major ordering. | | [tensorflow::ops::SparseReshape](../class/tensorflow/ops/sparse-reshape) | Reshapes a SparseTensor to represent values in a new dense shape. | | [tensorflow::ops::SparseSlice](../class/tensorflow/ops/sparse-slice) | Slice a `SparseTensor` based on the `start` and `size`. | | [tensorflow::ops::SparseSliceGrad](../class/tensorflow/ops/sparse-slice-grad) | The gradient operator for the [SparseSlice](../class/tensorflow/ops/sparse-slice#classtensorflow_1_1ops_1_1_sparse_slice) op. | | [tensorflow::ops::SparseSoftmax](../class/tensorflow/ops/sparse-softmax) | Applies softmax to a batched N-D `SparseTensor`. | | [tensorflow::ops::SparseSparseMaximum](../class/tensorflow/ops/sparse-sparse-maximum) | Returns the element-wise max of two SparseTensors. | | [tensorflow::ops::SparseSparseMinimum](../class/tensorflow/ops/sparse-sparse-minimum) | Returns the element-wise min of two SparseTensors. | | [tensorflow::ops::SparseSplit](../class/tensorflow/ops/sparse-split) | Split a `SparseTensor` into `num_split` tensors along one dimension. | | [tensorflow::ops::SparseTensorDenseAdd](../class/tensorflow/ops/sparse-tensor-dense-add) | Adds up a `SparseTensor` and a dense `[Tensor](../class/tensorflow/tensor#classtensorflow_1_1_tensor)`, producing a dense `[Tensor](../class/tensorflow/tensor#classtensorflow_1_1_tensor)`. | | [tensorflow::ops::SparseTensorDenseMatMul](../class/tensorflow/ops/sparse-tensor-dense-mat-mul) | [Multiply](../class/tensorflow/ops/multiply#classtensorflow_1_1ops_1_1_multiply) SparseTensor (of rank 2) "A" by dense matrix "B". | | [tensorflow::ops::TakeManySparseFromTensorsMap](../class/tensorflow/ops/take-many-sparse-from-tensors-map) | Converts a sparse representation into a dense tensor. | tensorflow_cpp Math Ops Math Ops ======== Summary ------- | Typedefs | | --- | | `[Mul](#group__math__ops_1ga140a37e1e470845b8367ad7f8fadfe62)` | typedef `Multiply` | | `[Neg](#group__math__ops_1ga4297d27638dcfcc5e2170cba4400ddc6)` | typedef `Negate` | | `[ReduceAll](#group__math__ops_1gab1830bf25a0925bbedf68012b34d2c40)` | typedef `All` | | `[ReduceAny](#group__math__ops_1gaff6970829de27cbeb20bbbe1fa32a9da)` | typedef `Any` | | `[ReduceMax](#group__math__ops_1gaf8bcf39ada7fa6d47cd3b3645a67bf39)` | typedef `Max` | | `[ReduceMean](#group__math__ops_1ga221ddf7df1fd59241146eacd0f37a140)` | typedef `Mean` | | `[ReduceMin](#group__math__ops_1gab24f67f5842374309f39e725d41daa84)` | typedef `Min` | | `[ReduceProd](#group__math__ops_1ga1c49c2968b61a54bad7b9b0583c2891a)` | typedef `Prod` | | `[ReduceSum](#group__math__ops_1gaeafa8f7448f93b4d545eec05f9b7a83b)` | typedef `Sum` | | `[Sub](#group__math__ops_1ga8872d71afb365f8e9c3547011fb33183)` | typedef `Subtract` | | Classes | | --- | | [tensorflow::ops::Abs](../class/tensorflow/ops/abs) | Computes the absolute value of a tensor. | | [tensorflow::ops::AccumulateNV2](../class/tensorflow/ops/accumulate-n-v2) | Returns the element-wise sum of a list of tensors. | | [tensorflow::ops::Acos](../class/tensorflow/ops/acos) | Computes acos of x element-wise. | | [tensorflow::ops::Acosh](../class/tensorflow/ops/acosh) | Computes inverse hyperbolic cosine of x element-wise. | | [tensorflow::ops::Add](../class/tensorflow/ops/add) | Returns x + y element-wise. | | [tensorflow::ops::AddN](../class/tensorflow/ops/add-n) | [Add](../class/tensorflow/ops/add#classtensorflow_1_1ops_1_1_add) all input tensors element wise. | | [tensorflow::ops::AddV2](../class/tensorflow/ops/add-v2) | Returns x + y element-wise. | | [tensorflow::ops::All](../class/tensorflow/ops/all) | Computes the "logical and" of elements across dimensions of a tensor. | | [tensorflow::ops::Angle](../class/tensorflow/ops/angle) | Returns the argument of a complex number. | | [tensorflow::ops::Any](../class/tensorflow/ops/any) | Computes the "logical or" of elements across dimensions of a tensor. | | [tensorflow::ops::ApproximateEqual](../class/tensorflow/ops/approximate-equal) | Returns the truth value of abs(x-y) < tolerance element-wise. | | [tensorflow::ops::ArgMax](../class/tensorflow/ops/arg-max) | Returns the index with the largest value across dimensions of a tensor. | | [tensorflow::ops::ArgMin](../class/tensorflow/ops/arg-min) | Returns the index with the smallest value across dimensions of a tensor. | | [tensorflow::ops::Asin](../class/tensorflow/ops/asin) | Computes the trignometric inverse sine of x element-wise. | | [tensorflow::ops::Asinh](../class/tensorflow/ops/asinh) | Computes inverse hyperbolic sine of x element-wise. | | [tensorflow::ops::Atan](../class/tensorflow/ops/atan) | Computes the trignometric inverse tangent of x element-wise. | | [tensorflow::ops::Atan2](../class/tensorflow/ops/atan2) | Computes arctangent of `y/x` element-wise, respecting signs of the arguments. | | [tensorflow::ops::Atanh](../class/tensorflow/ops/atanh) | Computes inverse hyperbolic tangent of x element-wise. | | [tensorflow::ops::BatchMatMul](../class/tensorflow/ops/batch-mat-mul) | Multiplies slices of two tensors in batches. | | [tensorflow::ops::BatchMatMulV2](../class/tensorflow/ops/batch-mat-mul-v2) | Multiplies slices of two tensors in batches. | | [tensorflow::ops::BatchMatMulV3](../class/tensorflow/ops/batch-mat-mul-v3) | Multiplies slices of two tensors in batches. | | [tensorflow::ops::Betainc](../class/tensorflow/ops/betainc) | Compute the regularized incomplete beta integral \(I\_x(a, b)\). | | [tensorflow::ops::Bincount](../class/tensorflow/ops/bincount) | Counts the number of occurrences of each value in an integer array. | | [tensorflow::ops::Bucketize](../class/tensorflow/ops/bucketize) | Bucketizes 'input' based on 'boundaries'. | | [tensorflow::ops::Cast](../class/tensorflow/ops/cast) | [Cast](../class/tensorflow/ops/cast#classtensorflow_1_1ops_1_1_cast) x of type SrcT to y of DstT. | | [tensorflow::ops::Ceil](../class/tensorflow/ops/ceil) | Returns element-wise smallest integer not less than x. | | [tensorflow::ops::ClipByValue](../class/tensorflow/ops/clip-by-value) | Clips tensor values to a specified min and max. | | [tensorflow::ops::Complex](../class/tensorflow/ops/complex) | Converts two real numbers to a complex number. | | [tensorflow::ops::ComplexAbs](../class/tensorflow/ops/complex-abs) | Computes the complex absolute value of a tensor. | | [tensorflow::ops::Conj](../class/tensorflow/ops/conj) | Returns the complex conjugate of a complex number. | | [tensorflow::ops::Cos](../class/tensorflow/ops/cos) | Computes cos of x element-wise. | | [tensorflow::ops::Cosh](../class/tensorflow/ops/cosh) | Computes hyperbolic cosine of x element-wise. | | [tensorflow::ops::Cross](../class/tensorflow/ops/cross) | Compute the pairwise cross product. | | [tensorflow::ops::Cumprod](../class/tensorflow/ops/cumprod) | Compute the cumulative product of the tensor `x` along `axis`. | | [tensorflow::ops::Cumsum](../class/tensorflow/ops/cumsum) | Compute the cumulative sum of the tensor `x` along `axis`. | | [tensorflow::ops::DenseBincount](../class/tensorflow/ops/dense-bincount) | Counts the number of occurrences of each value in an integer array. | | [tensorflow::ops::Digamma](../class/tensorflow/ops/digamma) | Computes Psi, the derivative of [Lgamma](../class/tensorflow/ops/lgamma#classtensorflow_1_1ops_1_1_lgamma) (the log of the absolute value of. | | [tensorflow::ops::Div](../class/tensorflow/ops/div) | Returns x / y element-wise. | | [tensorflow::ops::DivNoNan](../class/tensorflow/ops/div-no-nan) | Returns 0 if the denominator is zero. | | [tensorflow::ops::Equal](../class/tensorflow/ops/equal) | Returns the truth value of (x == y) element-wise. | | [tensorflow::ops::Erf](../class/tensorflow/ops/erf) | Computes the [Gauss error function](https://en.wikipedia.org/wiki/Error_function) of `x` element-wise. | | [tensorflow::ops::Erfc](../class/tensorflow/ops/erfc) | Computes the complementary error function of `x` element-wise. | | [tensorflow::ops::Erfinv](../class/tensorflow/ops/erfinv) | TODO: add doc. | | [tensorflow::ops::EuclideanNorm](../class/tensorflow/ops/euclidean-norm) | Computes the euclidean norm of elements across dimensions of a tensor. | | [tensorflow::ops::Exp](../class/tensorflow/ops/exp) | Computes exponential of x element-wise. | | [tensorflow::ops::Expm1](../class/tensorflow/ops/expm1) | Computes `exp(x) - 1` element-wise. | | [tensorflow::ops::Floor](../class/tensorflow/ops/floor) | Returns element-wise largest integer not greater than x. | | [tensorflow::ops::FloorDiv](../class/tensorflow/ops/floor-div) | Returns x // y element-wise. | | [tensorflow::ops::FloorMod](../class/tensorflow/ops/floor-mod) | Returns element-wise remainder of division. | | [tensorflow::ops::Greater](../class/tensorflow/ops/greater) | Returns the truth value of (x > y) element-wise. | | [tensorflow::ops::GreaterEqual](../class/tensorflow/ops/greater-equal) | Returns the truth value of (x >= y) element-wise. | | [tensorflow::ops::HistogramFixedWidth](../class/tensorflow/ops/histogram-fixed-width) | Return histogram of values. | | [tensorflow::ops::Igamma](../class/tensorflow/ops/igamma) | Compute the lower regularized incomplete Gamma function `P(a, x)`. | | [tensorflow::ops::Igammac](../class/tensorflow/ops/igammac) | Compute the upper regularized incomplete Gamma function `Q(a, x)`. | | [tensorflow::ops::Imag](../class/tensorflow/ops/imag) | Returns the imaginary part of a complex number. | | [tensorflow::ops::Inv](../class/tensorflow/ops/inv) | Computes the reciprocal of x element-wise. | | [tensorflow::ops::IsFinite](../class/tensorflow/ops/is-finite) | Returns which elements of x are finite. | | [tensorflow::ops::IsInf](../class/tensorflow/ops/is-inf) | Returns which elements of x are Inf. | | [tensorflow::ops::IsNan](../class/tensorflow/ops/is-nan) | Returns which elements of x are NaN. | | [tensorflow::ops::Less](../class/tensorflow/ops/less) | Returns the truth value of (x < y) element-wise. | | [tensorflow::ops::LessEqual](../class/tensorflow/ops/less-equal) | Returns the truth value of (x <= y) element-wise. | | [tensorflow::ops::Lgamma](../class/tensorflow/ops/lgamma) | Computes the log of the absolute value of `Gamma(x)` element-wise. | | [tensorflow::ops::Log](../class/tensorflow/ops/log) | Computes natural logarithm of x element-wise. | | [tensorflow::ops::Log1p](../class/tensorflow/ops/log1p) | Computes natural logarithm of (1 + x) element-wise. | | [tensorflow::ops::LogicalAnd](../class/tensorflow/ops/logical-and) | Returns the truth value of x AND y element-wise. | | [tensorflow::ops::LogicalNot](../class/tensorflow/ops/logical-not) | Returns the truth value of `NOT x` element-wise. | | [tensorflow::ops::LogicalOr](../class/tensorflow/ops/logical-or) | Returns the truth value of x OR y element-wise. | | [tensorflow::ops::MatMul](../class/tensorflow/ops/mat-mul) | [Multiply](../class/tensorflow/ops/multiply#classtensorflow_1_1ops_1_1_multiply) the matrix "a" by the matrix "b". | | [tensorflow::ops::Max](../class/tensorflow/ops/max) | Computes the maximum of elements across dimensions of a tensor. | | [tensorflow::ops::Maximum](../class/tensorflow/ops/maximum) | Returns the max of x and y (i.e. | | [tensorflow::ops::Mean](../class/tensorflow/ops/mean) | Computes the mean of elements across dimensions of a tensor. | | [tensorflow::ops::Min](../class/tensorflow/ops/min) | Computes the minimum of elements across dimensions of a tensor. | | [tensorflow::ops::Minimum](../class/tensorflow/ops/minimum) | Returns the min of x and y (i.e. | | [tensorflow::ops::Mod](../class/tensorflow/ops/mod) | Returns element-wise remainder of division. | | [tensorflow::ops::MulNoNan](../class/tensorflow/ops/mul-no-nan) | Returns x \* y element-wise. | | [tensorflow::ops::Multiply](../class/tensorflow/ops/multiply) | Returns x \* y element-wise. | | [tensorflow::ops::Ndtri](../class/tensorflow/ops/ndtri) | TODO: add doc. | | [tensorflow::ops::Negate](../class/tensorflow/ops/negate) | Computes numerical negative value element-wise. | | [tensorflow::ops::NextAfter](../class/tensorflow/ops/next-after) | Returns the next representable value of `x1` in the direction of `x2`, element-wise. | | [tensorflow::ops::NotEqual](../class/tensorflow/ops/not-equal) | Returns the truth value of (x != y) element-wise. | | [tensorflow::ops::Polygamma](../class/tensorflow/ops/polygamma) | Compute the polygamma function \(\psi^{(n)}(x)\). | | [tensorflow::ops::Pow](../class/tensorflow/ops/pow) | Computes the power of one value to another. | | [tensorflow::ops::Prod](../class/tensorflow/ops/prod) | Computes the product of elements across dimensions of a tensor. | | [tensorflow::ops::QuantizeDownAndShrinkRange](../class/tensorflow/ops/quantize-down-and-shrink-range) | Convert the quantized 'input' tensor into a lower-precision 'output', using the. | | [tensorflow::ops::QuantizedAdd](../class/tensorflow/ops/quantized-add) | Returns x + y element-wise, working on quantized buffers. | | [tensorflow::ops::QuantizedMatMul](../class/tensorflow/ops/quantized-mat-mul) | Perform a quantized matrix multiplication of `a` by the matrix `b`. | | [tensorflow::ops::QuantizedMul](../class/tensorflow/ops/quantized-mul) | Returns x \* y element-wise, working on quantized buffers. | | [tensorflow::ops::RaggedBincount](../class/tensorflow/ops/ragged-bincount) | Counts the number of occurrences of each value in an integer array. | | [tensorflow::ops::Range](../class/tensorflow/ops/range) | Creates a sequence of numbers. | | [tensorflow::ops::Real](../class/tensorflow/ops/real) | Returns the real part of a complex number. | | [tensorflow::ops::RealDiv](../class/tensorflow/ops/real-div) | Returns x / y element-wise for real types. | | [tensorflow::ops::Reciprocal](../class/tensorflow/ops/reciprocal) | Computes the reciprocal of x element-wise. | | [tensorflow::ops::RequantizationRange](../class/tensorflow/ops/requantization-range) | Computes a range that covers the actual values present in a quantized tensor. | | [tensorflow::ops::Requantize](../class/tensorflow/ops/requantize) | Converts the quantized `input` tensor into a lower-precision `output`. | | [tensorflow::ops::Rint](../class/tensorflow/ops/rint) | Returns element-wise integer closest to x. | | [tensorflow::ops::Round](../class/tensorflow/ops/round) | Rounds the values of a tensor to the nearest integer, element-wise. | | [tensorflow::ops::Rsqrt](../class/tensorflow/ops/rsqrt) | Computes reciprocal of square root of x element-wise. | | [tensorflow::ops::SegmentMax](../class/tensorflow/ops/segment-max) | Computes the maximum along segments of a tensor. | | [tensorflow::ops::SegmentMean](../class/tensorflow/ops/segment-mean) | Computes the mean along segments of a tensor. | | [tensorflow::ops::SegmentMin](../class/tensorflow/ops/segment-min) | Computes the minimum along segments of a tensor. | | [tensorflow::ops::SegmentProd](../class/tensorflow/ops/segment-prod) | Computes the product along segments of a tensor. | | [tensorflow::ops::SegmentSum](../class/tensorflow/ops/segment-sum) | Computes the sum along segments of a tensor. | | [tensorflow::ops::SelectV2](../class/tensorflow/ops/select-v2) | TODO: add doc. | | [tensorflow::ops::Sigmoid](../class/tensorflow/ops/sigmoid) | Computes sigmoid of `x` element-wise. | | [tensorflow::ops::Sign](../class/tensorflow/ops/sign) | Returns an element-wise indication of the sign of a number. | | [tensorflow::ops::Sin](../class/tensorflow/ops/sin) | Computes sine of x element-wise. | | [tensorflow::ops::Sinh](../class/tensorflow/ops/sinh) | Computes hyperbolic sine of x element-wise. | | [tensorflow::ops::SparseBincount](../class/tensorflow/ops/sparse-bincount) | Counts the number of occurrences of each value in an integer array. | | [tensorflow::ops::SparseMatMul](../class/tensorflow/ops/sparse-mat-mul) | [Multiply](../class/tensorflow/ops/multiply#classtensorflow_1_1ops_1_1_multiply) matrix "a" by matrix "b". | | [tensorflow::ops::SparseSegmentMean](../class/tensorflow/ops/sparse-segment-mean) | Computes the mean along sparse segments of a tensor. | | [tensorflow::ops::SparseSegmentMeanGrad](../class/tensorflow/ops/sparse-segment-mean-grad) | Computes gradients for [SparseSegmentMean](../class/tensorflow/ops/sparse-segment-mean#classtensorflow_1_1ops_1_1_sparse_segment_mean). | | [tensorflow::ops::SparseSegmentMeanWithNumSegments](../class/tensorflow/ops/sparse-segment-mean-with-num-segments) | Computes the mean along sparse segments of a tensor. | | [tensorflow::ops::SparseSegmentSqrtN](../class/tensorflow/ops/sparse-segment-sqrt-n) | Computes the sum along sparse segments of a tensor divided by the sqrt of N. | | [tensorflow::ops::SparseSegmentSqrtNGrad](../class/tensorflow/ops/sparse-segment-sqrt-n-grad) | Computes gradients for [SparseSegmentSqrtN](../class/tensorflow/ops/sparse-segment-sqrt-n#classtensorflow_1_1ops_1_1_sparse_segment_sqrt_n). | | [tensorflow::ops::SparseSegmentSqrtNWithNumSegments](../class/tensorflow/ops/sparse-segment-sqrt-n-with-num-segments) | Computes the sum along sparse segments of a tensor divided by the sqrt of N. | | [tensorflow::ops::SparseSegmentSum](../class/tensorflow/ops/sparse-segment-sum) | Computes the sum along sparse segments of a tensor. | | [tensorflow::ops::SparseSegmentSumGrad](../class/tensorflow/ops/sparse-segment-sum-grad) | Computes gradients for [SparseSegmentSum](../class/tensorflow/ops/sparse-segment-sum#classtensorflow_1_1ops_1_1_sparse_segment_sum). | | [tensorflow::ops::SparseSegmentSumWithNumSegments](../class/tensorflow/ops/sparse-segment-sum-with-num-segments) | Computes the sum along sparse segments of a tensor. | | [tensorflow::ops::Sqrt](../class/tensorflow/ops/sqrt) | Computes square root of x element-wise. | | [tensorflow::ops::Square](../class/tensorflow/ops/square) | Computes square of x element-wise. | | [tensorflow::ops::SquaredDifference](../class/tensorflow/ops/squared-difference) | Returns conj(x - y)(x - y) element-wise. | | [tensorflow::ops::Subtract](../class/tensorflow/ops/subtract) | Returns x - y element-wise. | | [tensorflow::ops::Sum](../class/tensorflow/ops/sum) | Computes the sum of elements across dimensions of a tensor. | | [tensorflow::ops::Tan](../class/tensorflow/ops/tan) | Computes tan of x element-wise. | | [tensorflow::ops::Tanh](../class/tensorflow/ops/tanh) | Computes hyperbolic tangent of `x` element-wise. | | [tensorflow::ops::TruncateDiv](../class/tensorflow/ops/truncate-div) | Returns x / y element-wise for integer types. | | [tensorflow::ops::TruncateMod](../class/tensorflow/ops/truncate-mod) | Returns element-wise remainder of division. | | [tensorflow::ops::UnsortedSegmentMax](../class/tensorflow/ops/unsorted-segment-max) | Computes the maximum along segments of a tensor. | | [tensorflow::ops::UnsortedSegmentMin](../class/tensorflow/ops/unsorted-segment-min) | Computes the minimum along segments of a tensor. | | [tensorflow::ops::UnsortedSegmentProd](../class/tensorflow/ops/unsorted-segment-prod) | Computes the product along segments of a tensor. | | [tensorflow::ops::UnsortedSegmentSum](../class/tensorflow/ops/unsorted-segment-sum) | Computes the sum along segments of a tensor. | | [tensorflow::ops::Where3](../class/tensorflow/ops/where3) | Selects elements from `x` or `y`, depending on `condition`. | | [tensorflow::ops::Xdivy](../class/tensorflow/ops/xdivy) | Returns 0 if x == 0, and x / y otherwise, elementwise. | | [tensorflow::ops::Xlog1py](../class/tensorflow/ops/xlog1py) | Returns 0 if x == 0, and x \* log1p(y) otherwise, elementwise. | | [tensorflow::ops::Xlogy](../class/tensorflow/ops/xlogy) | Returns 0 if x == 0, and x \* log(y) otherwise, elementwise. | | [tensorflow::ops::Zeta](../class/tensorflow/ops/zeta) | Compute the Hurwitz zeta function \(\zeta(x, q)\). | Typedefs -------- ### Mul ``` Multiply Mul ``` ### Neg ``` Negate Neg ``` ### ReduceAll ``` All ReduceAll ``` ### ReduceAny ``` Any ReduceAny ``` ### ReduceMax ``` Max ReduceMax ``` ### ReduceMean ``` Mean ReduceMean ``` ### ReduceMin ``` Min ReduceMin ``` ### ReduceProd ``` Prod ReduceProd ``` ### ReduceSum ``` Sum ReduceSum ``` ### Sub ``` Subtract Sub ```
programming_docs
tensorflow_cpp User Ops User Ops ======== Summary ------- | Classes | | --- | | [tensorflow::ops::Fact](../class/tensorflow/ops/fact) | [Output](../class/tensorflow/output#classtensorflow_1_1_output) a fact about factorials. | tensorflow_cpp Random Ops Random Ops ========== Summary ------- | Classes | | --- | | [tensorflow::ops::Multinomial](../class/tensorflow/ops/multinomial) | Draws samples from a multinomial distribution. | | [tensorflow::ops::ParameterizedTruncatedNormal](../class/tensorflow/ops/parameterized-truncated-normal) | Outputs random values from a normal distribution. | | [tensorflow::ops::RandomGamma](../class/tensorflow/ops/random-gamma) | Outputs random values from the Gamma distribution(s) described by alpha. | | [tensorflow::ops::RandomNormal](../class/tensorflow/ops/random-normal) | Outputs random values from a normal distribution. | | [tensorflow::ops::RandomPoissonV2](../class/tensorflow/ops/random-poisson-v2) | Outputs random values from the Poisson distribution(s) described by rate. | | [tensorflow::ops::RandomShuffle](../class/tensorflow/ops/random-shuffle) | Randomly shuffles a tensor along its first dimension. | | [tensorflow::ops::RandomUniform](../class/tensorflow/ops/random-uniform) | Outputs random values from a uniform distribution. | | [tensorflow::ops::RandomUniformInt](../class/tensorflow/ops/random-uniform-int) | Outputs random integers from a uniform distribution. | | [tensorflow::ops::TruncatedNormal](../class/tensorflow/ops/truncated-normal) | Outputs random values from a truncated normal distribution. | tensorflow_cpp Array Ops Array Ops ========= Summary ------- | Classes | | --- | | [tensorflow::ops::BatchToSpace](../class/tensorflow/ops/batch-to-space) | [BatchToSpace](../class/tensorflow/ops/batch-to-space#classtensorflow_1_1ops_1_1_batch_to_space) for 4-D tensors of type T. | | [tensorflow::ops::BatchToSpaceND](../class/tensorflow/ops/batch-to-space-n-d) | [BatchToSpace](../class/tensorflow/ops/batch-to-space#classtensorflow_1_1ops_1_1_batch_to_space) for N-D tensors of type T. | | [tensorflow::ops::Bitcast](../class/tensorflow/ops/bitcast) | Bitcasts a tensor from one type to another without copying data. | | [tensorflow::ops::BroadcastDynamicShape](../class/tensorflow/ops/broadcast-dynamic-shape) | Return the shape of s0 op s1 with broadcast. | | [tensorflow::ops::BroadcastTo](../class/tensorflow/ops/broadcast-to) | Broadcast an array for a compatible shape. | | [tensorflow::ops::CheckNumerics](../class/tensorflow/ops/check-numerics) | Checks a tensor for NaN and Inf values. | | [tensorflow::ops::Concat](../class/tensorflow/ops/concat) | Concatenates tensors along one dimension. | | [tensorflow::ops::ConjugateTranspose](../class/tensorflow/ops/conjugate-transpose) | Shuffle dimensions of x according to a permutation and conjugate the result. | | [tensorflow::ops::DebugGradientIdentity](../class/tensorflow/ops/debug-gradient-identity) | [Identity](../class/tensorflow/ops/identity#classtensorflow_1_1ops_1_1_identity) op for gradient debugging. | | [tensorflow::ops::DebugGradientRefIdentity](../class/tensorflow/ops/debug-gradient-ref-identity) | [Identity](../class/tensorflow/ops/identity#classtensorflow_1_1ops_1_1_identity) op for gradient debugging. | | [tensorflow::ops::DeepCopy](../class/tensorflow/ops/deep-copy) | Makes a copy of `x`. | | [tensorflow::ops::DepthToSpace](../class/tensorflow/ops/depth-to-space) | [DepthToSpace](../class/tensorflow/ops/depth-to-space#classtensorflow_1_1ops_1_1_depth_to_space) for tensors of type T. | | [tensorflow::ops::Dequantize](../class/tensorflow/ops/dequantize) | [Dequantize](../class/tensorflow/ops/dequantize#classtensorflow_1_1ops_1_1_dequantize) the 'input' tensor into a float or bfloat16 [Tensor](../class/tensorflow/tensor#classtensorflow_1_1_tensor). | | [tensorflow::ops::Diag](../class/tensorflow/ops/diag) | Returns a diagonal tensor with a given diagonal values. | | [tensorflow::ops::DiagPart](../class/tensorflow/ops/diag-part) | Returns the diagonal part of the tensor. | | [tensorflow::ops::EditDistance](../class/tensorflow/ops/edit-distance) | Computes the (possibly normalized) Levenshtein Edit Distance. | | [tensorflow::ops::Empty](../class/tensorflow/ops/empty) | Creates a tensor with the given shape. | | [tensorflow::ops::EnsureShape](../class/tensorflow/ops/ensure-shape) | Ensures that the tensor's shape matches the expected shape. | | [tensorflow::ops::ExpandDims](../class/tensorflow/ops/expand-dims) | Inserts a dimension of 1 into a tensor's shape. | | [tensorflow::ops::ExtractImagePatches](../class/tensorflow/ops/extract-image-patches) | Extract `patches` from `images` and put them in the "depth" output dimension. | | [tensorflow::ops::ExtractVolumePatches](../class/tensorflow/ops/extract-volume-patches) | Extract `patches` from `input` and put them in the `"depth"` output dimension. | | [tensorflow::ops::FakeQuantWithMinMaxArgs](../class/tensorflow/ops/fake-quant-with-min-max-args) | Fake-quantize the 'inputs' tensor, type float to 'outputs' tensor of same type. | | [tensorflow::ops::FakeQuantWithMinMaxArgsGradient](../class/tensorflow/ops/fake-quant-with-min-max-args-gradient) | Compute gradients for a [FakeQuantWithMinMaxArgs](../class/tensorflow/ops/fake-quant-with-min-max-args#classtensorflow_1_1ops_1_1_fake_quant_with_min_max_args) operation. | | [tensorflow::ops::FakeQuantWithMinMaxVars](../class/tensorflow/ops/fake-quant-with-min-max-vars) | Fake-quantize the 'inputs' tensor of type float via global float scalars. | | [tensorflow::ops::FakeQuantWithMinMaxVarsGradient](../class/tensorflow/ops/fake-quant-with-min-max-vars-gradient) | Compute gradients for a [FakeQuantWithMinMaxVars](../class/tensorflow/ops/fake-quant-with-min-max-vars#classtensorflow_1_1ops_1_1_fake_quant_with_min_max_vars) operation. | | [tensorflow::ops::FakeQuantWithMinMaxVarsPerChannel](../class/tensorflow/ops/fake-quant-with-min-max-vars-per-channel) | Fake-quantize the 'inputs' tensor of type float via per-channel floats. | | [tensorflow::ops::FakeQuantWithMinMaxVarsPerChannelGradient](../class/tensorflow/ops/fake-quant-with-min-max-vars-per-channel-gradient) | Compute gradients for a [FakeQuantWithMinMaxVarsPerChannel](../class/tensorflow/ops/fake-quant-with-min-max-vars-per-channel#classtensorflow_1_1ops_1_1_fake_quant_with_min_max_vars_per_channel) operation. | | [tensorflow::ops::Fill](../class/tensorflow/ops/fill) | Creates a tensor filled with a scalar value. | | [tensorflow::ops::Fingerprint](../class/tensorflow/ops/fingerprint) | Generates fingerprint values. | | [tensorflow::ops::Gather](../class/tensorflow/ops/gather) | [Gather](../class/tensorflow/ops/gather#classtensorflow_1_1ops_1_1_gather) slices from `params` according to `indices`. | | [tensorflow::ops::GatherNd](../class/tensorflow/ops/gather-nd) | [Gather](../class/tensorflow/ops/gather#classtensorflow_1_1ops_1_1_gather) slices from `params` into a [Tensor](../class/tensorflow/tensor#classtensorflow_1_1_tensor) with shape specified by `indices`. | | [tensorflow::ops::GatherV2](../class/tensorflow/ops/gather-v2) | [Gather](../class/tensorflow/ops/gather#classtensorflow_1_1ops_1_1_gather) slices from `params` axis `axis` according to `indices`. | | [tensorflow::ops::GuaranteeConst](../class/tensorflow/ops/guarantee-const) | Gives a guarantee to the TF runtime that the input tensor is a constant. | | [tensorflow::ops::Identity](../class/tensorflow/ops/identity) | Return a tensor with the same shape and contents as the input tensor or value. | | [tensorflow::ops::IdentityN](../class/tensorflow/ops/identity-n) | Returns a list of tensors with the same shapes and contents as the input. | | [tensorflow::ops::ImmutableConst](../class/tensorflow/ops/immutable-const) | Returns immutable tensor from memory region. | | [tensorflow::ops::InplaceAdd](../class/tensorflow/ops/inplace-add) | Adds v into specified rows of x. | | [tensorflow::ops::InplaceSub](../class/tensorflow/ops/inplace-sub) | Subtracts `v` into specified rows of `x`. | | [tensorflow::ops::InplaceUpdate](../class/tensorflow/ops/inplace-update) | Updates specified rows 'i' with values 'v'. | | [tensorflow::ops::InvertPermutation](../class/tensorflow/ops/invert-permutation) | Computes the inverse permutation of a tensor. | | [tensorflow::ops::MatrixBandPart](../class/tensorflow/ops/matrix-band-part) | Copy a tensor setting everything outside a central band in each innermost matrix to zero. | | [tensorflow::ops::MatrixDiag](../class/tensorflow/ops/matrix-diag) | Returns a batched diagonal tensor with a given batched diagonal values. | | [tensorflow::ops::MatrixDiagPart](../class/tensorflow/ops/matrix-diag-part) | Returns the batched diagonal part of a batched tensor. | | [tensorflow::ops::MatrixDiagPartV2](../class/tensorflow/ops/matrix-diag-part-v2) | Returns the batched diagonal part of a batched tensor. | | [tensorflow::ops::MatrixDiagPartV3](../class/tensorflow/ops/matrix-diag-part-v3) | Returns the batched diagonal part of a batched tensor. | | [tensorflow::ops::MatrixDiagV2](../class/tensorflow/ops/matrix-diag-v2) | Returns a batched diagonal tensor with given batched diagonal values. | | [tensorflow::ops::MatrixDiagV3](../class/tensorflow/ops/matrix-diag-v3) | Returns a batched diagonal tensor with given batched diagonal values. | | [tensorflow::ops::MatrixSetDiag](../class/tensorflow/ops/matrix-set-diag) | Returns a batched matrix tensor with new batched diagonal values. | | [tensorflow::ops::MatrixSetDiagV2](../class/tensorflow/ops/matrix-set-diag-v2) | Returns a batched matrix tensor with new batched diagonal values. | | [tensorflow::ops::MatrixSetDiagV3](../class/tensorflow/ops/matrix-set-diag-v3) | Returns a batched matrix tensor with new batched diagonal values. | | [tensorflow::ops::MirrorPad](../class/tensorflow/ops/mirror-pad) | Pads a tensor with mirrored values. | | [tensorflow::ops::OneHot](../class/tensorflow/ops/one-hot) | Returns a one-hot tensor. | | [tensorflow::ops::OnesLike](../class/tensorflow/ops/ones-like) | Returns a tensor of ones with the same shape and type as x. | | [tensorflow::ops::Pad](../class/tensorflow/ops/pad) | Pads a tensor with zeros. | | [tensorflow::ops::PadV2](../class/tensorflow/ops/pad-v2) | Pads a tensor. | | [tensorflow::ops::ParallelConcat](../class/tensorflow/ops/parallel-concat) | Concatenates a list of `N` tensors along the first dimension. | | [tensorflow::ops::Placeholder](../class/tensorflow/ops/placeholder) | A placeholder op for a value that will be fed into the computation. | | [tensorflow::ops::PlaceholderWithDefault](../class/tensorflow/ops/placeholder-with-default) | A placeholder op that passes through `input` when its output is not fed. | | [tensorflow::ops::PreventGradient](../class/tensorflow/ops/prevent-gradient) | An identity op that triggers an error if a gradient is requested. | | [tensorflow::ops::QuantizeAndDequantizeV2](../class/tensorflow/ops/quantize-and-dequantize-v2) | Quantizes then dequantizes a tensor. | | [tensorflow::ops::QuantizeAndDequantizeV3](../class/tensorflow/ops/quantize-and-dequantize-v3) | Quantizes then dequantizes a tensor. | | [tensorflow::ops::QuantizeAndDequantizeV4](../class/tensorflow/ops/quantize-and-dequantize-v4) | Quantizes then dequantizes a tensor. | | [tensorflow::ops::QuantizeAndDequantizeV4Grad](../class/tensorflow/ops/quantize-and-dequantize-v4-grad) | Returns the gradient of `[QuantizeAndDequantizeV4](../class/tensorflow/ops/quantize-and-dequantize-v4#classtensorflow_1_1ops_1_1_quantize_and_dequantize_v4)`. | | [tensorflow::ops::QuantizeV2](../class/tensorflow/ops/quantize-v2) | Quantize the 'input' tensor of type float to 'output' tensor of type 'T'. | | [tensorflow::ops::QuantizedConcat](../class/tensorflow/ops/quantized-concat) | Concatenates quantized tensors along one dimension. | | [tensorflow::ops::QuantizedInstanceNorm](../class/tensorflow/ops/quantized-instance-norm) | Quantized Instance normalization. | | [tensorflow::ops::SetDiff1D](../class/tensorflow/ops/set-diff1-d) | Computes the difference between two lists of numbers or strings. | | [tensorflow::ops::Stack](../class/tensorflow/ops/stack) | Packs a list of `N` rank-`R` tensors into one rank-`(R+1)` tensor. | | [tensorflow::ops::Where](../class/tensorflow/ops/where) | Reshapes a quantized tensor as per the Reshape op. | | [tensorflow::ops::ZerosLike](../class/tensorflow/ops/zeros-like) | Returns a tensor of zeros with the same shape and type as x. | tensorflow_cpp Data Flow Ops Data Flow Ops ============= Summary ------- | Classes | | --- | | [tensorflow::ops::AccumulatorApplyGradient](../class/tensorflow/ops/accumulator-apply-gradient) | Applies a gradient to a given accumulator. | | [tensorflow::ops::AccumulatorNumAccumulated](../class/tensorflow/ops/accumulator-num-accumulated) | Returns the number of gradients aggregated in the given accumulators. | | [tensorflow::ops::AccumulatorSetGlobalStep](../class/tensorflow/ops/accumulator-set-global-step) | Updates the accumulator with a new value for global\_step. | | [tensorflow::ops::AccumulatorTakeGradient](../class/tensorflow/ops/accumulator-take-gradient) | Extracts the average gradient in the given [ConditionalAccumulator](../class/tensorflow/ops/conditional-accumulator#classtensorflow_1_1ops_1_1_conditional_accumulator). | | [tensorflow::ops::Barrier](../class/tensorflow/ops/barrier) | Defines a barrier that persists across different graph executions. | | [tensorflow::ops::BarrierClose](../class/tensorflow/ops/barrier-close) | Closes the given barrier. | | [tensorflow::ops::BarrierIncompleteSize](../class/tensorflow/ops/barrier-incomplete-size) | Computes the number of incomplete elements in the given barrier. | | [tensorflow::ops::BarrierInsertMany](../class/tensorflow/ops/barrier-insert-many) | For each key, assigns the respective value to the specified component. | | [tensorflow::ops::BarrierReadySize](../class/tensorflow/ops/barrier-ready-size) | Computes the number of complete elements in the given barrier. | | [tensorflow::ops::BarrierTakeMany](../class/tensorflow/ops/barrier-take-many) | Takes the given number of completed elements from a barrier. | | [tensorflow::ops::ConditionalAccumulator](../class/tensorflow/ops/conditional-accumulator) | A conditional accumulator for aggregating gradients. | | [tensorflow::ops::DeleteSessionTensor](../class/tensorflow/ops/delete-session-tensor) | Delete the tensor specified by its handle in the session. | | [tensorflow::ops::DynamicPartition](../class/tensorflow/ops/dynamic-partition) | Partitions `data` into `num_partitions` tensors using indices from `partitions`. | | [tensorflow::ops::DynamicStitch](../class/tensorflow/ops/dynamic-stitch) | Interleave the values from the `data` tensors into a single tensor. | | [tensorflow::ops::FIFOQueue](../class/tensorflow/ops/f-i-f-o-queue) | A queue that produces elements in first-in first-out order. | | [tensorflow::ops::GetSessionHandle](../class/tensorflow/ops/get-session-handle) | Store the input tensor in the state of the current session. | | [tensorflow::ops::GetSessionHandleV2](../class/tensorflow/ops/get-session-handle-v2) | Store the input tensor in the state of the current session. | | [tensorflow::ops::GetSessionTensor](../class/tensorflow/ops/get-session-tensor) | Get the value of the tensor specified by its handle. | | [tensorflow::ops::MapClear](../class/tensorflow/ops/map-clear) | Op removes all elements in the underlying container. | | [tensorflow::ops::MapIncompleteSize](../class/tensorflow/ops/map-incomplete-size) | Op returns the number of incomplete elements in the underlying container. | | [tensorflow::ops::MapPeek](../class/tensorflow/ops/map-peek) | Op peeks at the values at the specified key. | | [tensorflow::ops::MapSize](../class/tensorflow/ops/map-size) | Op returns the number of elements in the underlying container. | | [tensorflow::ops::MapStage](../class/tensorflow/ops/map-stage) | [Stage](../class/tensorflow/ops/stage#classtensorflow_1_1ops_1_1_stage) (key, values) in the underlying container which behaves like a hashtable. | | [tensorflow::ops::MapUnstage](../class/tensorflow/ops/map-unstage) | Op removes and returns the values associated with the key. | | [tensorflow::ops::MapUnstageNoKey](../class/tensorflow/ops/map-unstage-no-key) | Op removes and returns a random (key, value) | | [tensorflow::ops::OrderedMapClear](../class/tensorflow/ops/ordered-map-clear) | Op removes all elements in the underlying container. | | [tensorflow::ops::OrderedMapIncompleteSize](../class/tensorflow/ops/ordered-map-incomplete-size) | Op returns the number of incomplete elements in the underlying container. | | [tensorflow::ops::OrderedMapPeek](../class/tensorflow/ops/ordered-map-peek) | Op peeks at the values at the specified key. | | [tensorflow::ops::OrderedMapSize](../class/tensorflow/ops/ordered-map-size) | Op returns the number of elements in the underlying container. | | [tensorflow::ops::OrderedMapStage](../class/tensorflow/ops/ordered-map-stage) | [Stage](../class/tensorflow/ops/stage#classtensorflow_1_1ops_1_1_stage) (key, values) in the underlying container which behaves like a ordered. | | [tensorflow::ops::OrderedMapUnstage](../class/tensorflow/ops/ordered-map-unstage) | Op removes and returns the values associated with the key. | | [tensorflow::ops::OrderedMapUnstageNoKey](../class/tensorflow/ops/ordered-map-unstage-no-key) | Op removes and returns the (key, value) element with the smallest. | | [tensorflow::ops::PaddingFIFOQueue](../class/tensorflow/ops/padding-f-i-f-o-queue) | A queue that produces elements in first-in first-out order. | | [tensorflow::ops::ParallelDynamicStitch](../class/tensorflow/ops/parallel-dynamic-stitch) | Interleave the values from the `data` tensors into a single tensor. | | [tensorflow::ops::PriorityQueue](../class/tensorflow/ops/priority-queue) | A queue that produces elements sorted by the first component value. | | [tensorflow::ops::QueueClose](../class/tensorflow/ops/queue-close) | Closes the given queue. | | [tensorflow::ops::QueueDequeue](../class/tensorflow/ops/queue-dequeue) | Dequeues a tuple of one or more tensors from the given queue. | | [tensorflow::ops::QueueDequeueMany](../class/tensorflow/ops/queue-dequeue-many) | Dequeues `n` tuples of one or more tensors from the given queue. | | [tensorflow::ops::QueueDequeueUpTo](../class/tensorflow/ops/queue-dequeue-up-to) | Dequeues `n` tuples of one or more tensors from the given queue. | | [tensorflow::ops::QueueEnqueue](../class/tensorflow/ops/queue-enqueue) | Enqueues a tuple of one or more tensors in the given queue. | | [tensorflow::ops::QueueEnqueueMany](../class/tensorflow/ops/queue-enqueue-many) | Enqueues zero or more tuples of one or more tensors in the given queue. | | [tensorflow::ops::QueueIsClosed](../class/tensorflow/ops/queue-is-closed) | Returns true if queue is closed. | | [tensorflow::ops::QueueIsClosedV2](../class/tensorflow/ops/queue-is-closed-v2) | Returns true if queue is closed. | | [tensorflow::ops::QueueSize](../class/tensorflow/ops/queue-size) | Computes the number of elements in the given queue. | | [tensorflow::ops::RandomShuffleQueue](../class/tensorflow/ops/random-shuffle-queue) | A queue that randomizes the order of elements. | | [tensorflow::ops::RecordInput](../class/tensorflow/ops/record-input) | Emits randomized records. | | [tensorflow::ops::SparseAccumulatorApplyGradient](../class/tensorflow/ops/sparse-accumulator-apply-gradient) | Applies a sparse gradient to a given accumulator. | | [tensorflow::ops::SparseAccumulatorTakeGradient](../class/tensorflow/ops/sparse-accumulator-take-gradient) | Extracts the average sparse gradient in a [SparseConditionalAccumulator](../class/tensorflow/ops/sparse-conditional-accumulator#classtensorflow_1_1ops_1_1_sparse_conditional_accumulator). | | [tensorflow::ops::SparseConditionalAccumulator](../class/tensorflow/ops/sparse-conditional-accumulator) | A conditional accumulator for aggregating sparse gradients. | | [tensorflow::ops::Stage](../class/tensorflow/ops/stage) | [Stage](../class/tensorflow/ops/stage#classtensorflow_1_1ops_1_1_stage) values similar to a lightweight Enqueue. | | [tensorflow::ops::StageClear](../class/tensorflow/ops/stage-clear) | Op removes all elements in the underlying container. | | [tensorflow::ops::StagePeek](../class/tensorflow/ops/stage-peek) | Op peeks at the values at the specified index. | | [tensorflow::ops::StageSize](../class/tensorflow/ops/stage-size) | Op returns the number of elements in the underlying container. | | [tensorflow::ops::TensorArray](../class/tensorflow/ops/tensor-array) | An array of Tensors of given size. | | [tensorflow::ops::TensorArrayClose](../class/tensorflow/ops/tensor-array-close) | Delete the [TensorArray](../class/tensorflow/ops/tensor-array#classtensorflow_1_1ops_1_1_tensor_array) from its resource container. | | [tensorflow::ops::TensorArrayConcat](../class/tensorflow/ops/tensor-array-concat) | [Concat](../class/tensorflow/ops/concat#classtensorflow_1_1ops_1_1_concat) the elements from the [TensorArray](../class/tensorflow/ops/tensor-array#classtensorflow_1_1ops_1_1_tensor_array) into value `value`. | | [tensorflow::ops::TensorArrayGather](../class/tensorflow/ops/tensor-array-gather) | [Gather](../class/tensorflow/ops/gather#classtensorflow_1_1ops_1_1_gather) specific elements from the [TensorArray](../class/tensorflow/ops/tensor-array#classtensorflow_1_1ops_1_1_tensor_array) into output `value`. | | [tensorflow::ops::TensorArrayGrad](../class/tensorflow/ops/tensor-array-grad) | Creates a [TensorArray](../class/tensorflow/ops/tensor-array#classtensorflow_1_1ops_1_1_tensor_array) for storing the gradients of values in the given handle. | | [tensorflow::ops::TensorArrayGradWithShape](../class/tensorflow/ops/tensor-array-grad-with-shape) | Creates a [TensorArray](../class/tensorflow/ops/tensor-array#classtensorflow_1_1ops_1_1_tensor_array) for storing multiple gradients of values in the given handle. | | [tensorflow::ops::TensorArrayRead](../class/tensorflow/ops/tensor-array-read) | Read an element from the [TensorArray](../class/tensorflow/ops/tensor-array#classtensorflow_1_1ops_1_1_tensor_array) into output `value`. | | [tensorflow::ops::TensorArrayScatter](../class/tensorflow/ops/tensor-array-scatter) | Scatter the data from the input value into specific [TensorArray](../class/tensorflow/ops/tensor-array#classtensorflow_1_1ops_1_1_tensor_array) elements. | | [tensorflow::ops::TensorArraySize](../class/tensorflow/ops/tensor-array-size) | Get the current size of the [TensorArray](../class/tensorflow/ops/tensor-array#classtensorflow_1_1ops_1_1_tensor_array). | | [tensorflow::ops::TensorArraySplit](../class/tensorflow/ops/tensor-array-split) | Split the data from the input value into [TensorArray](../class/tensorflow/ops/tensor-array#classtensorflow_1_1ops_1_1_tensor_array) elements. | | [tensorflow::ops::TensorArrayWrite](../class/tensorflow/ops/tensor-array-write) | Push an element onto the tensor\_array. | | [tensorflow::ops::Unstage](../class/tensorflow/ops/unstage) | Op is similar to a lightweight Dequeue. |
programming_docs
tensorflow_cpp Control Flow Ops Control Flow Ops ================ Summary ------- | Classes | | --- | | [tensorflow::ops::Abort](../class/tensorflow/ops/abort) | Raise a exception to abort the process when called. | | [tensorflow::ops::ControlTrigger](../class/tensorflow/ops/control-trigger) | Does nothing. | | [tensorflow::ops::LoopCond](../class/tensorflow/ops/loop-cond) | Forwards the input to the output. | | [tensorflow::ops::Merge](../class/tensorflow/ops/merge) | Forwards the value of an available tensor from `inputs` to `output`. | | [tensorflow::ops::NextIteration](../class/tensorflow/ops/next-iteration) | Makes its input available to the next iteration. | | [tensorflow::ops::RefNextIteration](../class/tensorflow/ops/ref-next-iteration) | Makes its input available to the next iteration. | | [tensorflow::ops::RefSelect](../class/tensorflow/ops/ref-select) | Forwards the `index`th element of `inputs` to `output`. | | [tensorflow::ops::RefSwitch](../class/tensorflow/ops/ref-switch) | Forwards the ref tensor `data` to the output port determined by `pred`. | | [tensorflow::ops::Switch](../class/tensorflow/ops/switch) | Forwards `data` to the output port determined by `pred`. | tensorflow_cpp Core Tensorflow API Core Tensorflow API =================== Summary ------- | Typedefs | | --- | | `[OutputList](#group__core_1gab449e6a3abd500c2f4ea93f9e89ba96c)` | typedef `std::vector< Output >` A type for representing the output of ops that produce more than one output, or a list of tensors. | | Functions | | --- | | `[CreateOutputWithScope](#group__core_1gaef88caf2b9d160822f9641a621dbb5c4)(string op_name, absl::Span< const ::[tensorflow::Input](../class/tensorflow/input#classtensorflow_1_1_input) > inputs, const Scope & scope, Output *output)` | `Status` | | Classes | | --- | | [tensorflow::ClientSession](../class/tensorflow/client-session) | A `[ClientSession](../class/tensorflow/client-session#classtensorflow_1_1_client_session)` object lets the caller drive the evaluation of the TensorFlow graph constructed with the C++ API. | | [tensorflow::Input](../class/tensorflow/input) | Represents a tensor value that can be used as an operand to an [Operation](../class/tensorflow/operation#classtensorflow_1_1_operation). | | [tensorflow::InputList](../class/tensorflow/input-list) | A type for representing the input to ops that require a list of tensors. | | [tensorflow::Operation](../class/tensorflow/operation) | Represents a node in the computation graph. | | [tensorflow::Output](../class/tensorflow/output) | Represents a tensor value produced by an [Operation](../class/tensorflow/operation#classtensorflow_1_1_operation). | | [tensorflow::Scope](../class/tensorflow/scope) | A `[Scope](../class/tensorflow/scope#classtensorflow_1_1_scope)` object represents a set of related TensorFlow ops that have the same properties such as a common name prefix. | | [tensorflow::TensorBuffer](../class/tensorflow/tensor-buffer) | | Typedefs -------- ### OutputList ``` std::vector< Output > OutputList ``` A type for representing the output of ops that produce more than one output, or a list of tensors. Functions --------- ### CreateOutputWithScope ``` Status CreateOutputWithScope( string op_name, absl::Span< const ::tensorflow::Input > inputs, const Scope & scope, Output *output ) ``` tensorflow_cpp State Ops State Ops ========= Summary ------- | Classes | | --- | | [tensorflow::ops::Assign](../class/tensorflow/ops/assign) | Update 'ref' by assigning 'value' to it. | | [tensorflow::ops::AssignAdd](../class/tensorflow/ops/assign-add) | Update 'ref' by adding 'value' to it. | | [tensorflow::ops::AssignSub](../class/tensorflow/ops/assign-sub) | Update 'ref' by subtracting 'value' from it. | | [tensorflow::ops::CountUpTo](../class/tensorflow/ops/count-up-to) | Increments 'ref' until it reaches 'limit'. | | [tensorflow::ops::DestroyTemporaryVariable](../class/tensorflow/ops/destroy-temporary-variable) | Destroys the temporary variable and returns its final value. | | [tensorflow::ops::IsVariableInitialized](../class/tensorflow/ops/is-variable-initialized) | Checks whether a tensor has been initialized. | | [tensorflow::ops::ResourceCountUpTo](../class/tensorflow/ops/resource-count-up-to) | Increments variable pointed to by 'resource' until it reaches 'limit'. | | [tensorflow::ops::ResourceScatterNdAdd](../class/tensorflow/ops/resource-scatter-nd-add) | Applies sparse addition to individual values or slices in a [Variable](../class/tensorflow/ops/variable#classtensorflow_1_1ops_1_1_variable). | | [tensorflow::ops::ResourceScatterNdMax](../class/tensorflow/ops/resource-scatter-nd-max) | TODO: add doc. | | [tensorflow::ops::ResourceScatterNdMin](../class/tensorflow/ops/resource-scatter-nd-min) | TODO: add doc. | | [tensorflow::ops::ResourceScatterNdSub](../class/tensorflow/ops/resource-scatter-nd-sub) | Applies sparse subtraction to individual values or slices in a [Variable](../class/tensorflow/ops/variable#classtensorflow_1_1ops_1_1_variable). | | [tensorflow::ops::ResourceScatterNdUpdate](../class/tensorflow/ops/resource-scatter-nd-update) | Applies sparse `updates` to individual values or slices within a given. | | [tensorflow::ops::ScatterAdd](../class/tensorflow/ops/scatter-add) | Adds sparse updates to a variable reference. | | [tensorflow::ops::ScatterDiv](../class/tensorflow/ops/scatter-div) | Divides a variable reference by sparse updates. | | [tensorflow::ops::ScatterMax](../class/tensorflow/ops/scatter-max) | Reduces sparse updates into a variable reference using the `max` operation. | | [tensorflow::ops::ScatterMin](../class/tensorflow/ops/scatter-min) | Reduces sparse updates into a variable reference using the `min` operation. | | [tensorflow::ops::ScatterMul](../class/tensorflow/ops/scatter-mul) | Multiplies sparse updates into a variable reference. | | [tensorflow::ops::ScatterNdAdd](../class/tensorflow/ops/scatter-nd-add) | Applies sparse addition to individual values or slices in a [Variable](../class/tensorflow/ops/variable#classtensorflow_1_1ops_1_1_variable). | | [tensorflow::ops::ScatterNdSub](../class/tensorflow/ops/scatter-nd-sub) | Applies sparse subtraction to individual values or slices in a [Variable](../class/tensorflow/ops/variable#classtensorflow_1_1ops_1_1_variable). | | [tensorflow::ops::ScatterNdUpdate](../class/tensorflow/ops/scatter-nd-update) | Applies sparse `updates` to individual values or slices within a given. | | [tensorflow::ops::ScatterSub](../class/tensorflow/ops/scatter-sub) | Subtracts sparse updates to a variable reference. | | [tensorflow::ops::ScatterUpdate](../class/tensorflow/ops/scatter-update) | Applies sparse updates to a variable reference. | | [tensorflow::ops::TemporaryVariable](../class/tensorflow/ops/temporary-variable) | Returns a tensor that may be mutated, but only persists within a single step. | | [tensorflow::ops::Variable](../class/tensorflow/ops/variable) | Holds state in the form of a tensor that persists across steps. | tensorflow_cpp String Ops String Ops ========== Summary ------- | Classes | | --- | | [tensorflow::ops::AsString](../class/tensorflow/ops/as-string) | Converts each entry in the given tensor to strings. | | [tensorflow::ops::DecodeBase64](../class/tensorflow/ops/decode-base64) | Decode web-safe base64-encoded strings. | | [tensorflow::ops::EncodeBase64](../class/tensorflow/ops/encode-base64) | Encode strings into web-safe base64 format. | | [tensorflow::ops::ReduceJoin](../class/tensorflow/ops/reduce-join) | Joins a string [Tensor](../class/tensorflow/tensor#classtensorflow_1_1_tensor) across the given dimensions. | | [tensorflow::ops::RegexFullMatch](../class/tensorflow/ops/regex-full-match) | Check if the input matches the regex pattern. | | [tensorflow::ops::RegexReplace](../class/tensorflow/ops/regex-replace) | Replaces matches of the `pattern` regular expression in `input` with the replacement string provided in `rewrite`. | | [tensorflow::ops::StringFormat](../class/tensorflow/ops/string-format) | Formats a string template using a list of tensors. | | [tensorflow::ops::StringJoin](../class/tensorflow/ops/string-join) | Joins the strings in the given list of string tensors into one tensor;. | | [tensorflow::ops::StringLength](../class/tensorflow/ops/string-length) | String lengths of `input`. | | [tensorflow::ops::StringLower](../class/tensorflow/ops/string-lower) | Converts all uppercase characters into their respective lowercase replacements. | | [tensorflow::ops::StringNGrams](../class/tensorflow/ops/string-n-grams) | Creates ngrams from ragged string data. | | [tensorflow::ops::StringSplit](../class/tensorflow/ops/string-split) | Split elements of `input` based on `delimiter` into a `SparseTensor`. | | [tensorflow::ops::StringSplitV2](../class/tensorflow/ops/string-split-v2) | Split elements of `source` based on `sep` into a `SparseTensor`. | | [tensorflow::ops::StringStrip](../class/tensorflow/ops/string-strip) | Strip leading and trailing whitespaces from the [Tensor](../class/tensorflow/tensor#classtensorflow_1_1_tensor). | | [tensorflow::ops::StringToHashBucket](../class/tensorflow/ops/string-to-hash-bucket) | Converts each string in the input [Tensor](../class/tensorflow/tensor#classtensorflow_1_1_tensor) to its hash mod by a number of buckets. | | [tensorflow::ops::StringToHashBucketFast](../class/tensorflow/ops/string-to-hash-bucket-fast) | Converts each string in the input [Tensor](../class/tensorflow/tensor#classtensorflow_1_1_tensor) to its hash mod by a number of buckets. | | [tensorflow::ops::StringToHashBucketStrong](../class/tensorflow/ops/string-to-hash-bucket-strong) | Converts each string in the input [Tensor](../class/tensorflow/tensor#classtensorflow_1_1_tensor) to its hash mod by a number of buckets. | | [tensorflow::ops::StringUpper](../class/tensorflow/ops/string-upper) | Converts all lowercase characters into their respective uppercase replacements. | | [tensorflow::ops::Substr](../class/tensorflow/ops/substr) | Return substrings from `[Tensor](../class/tensorflow/tensor#classtensorflow_1_1_tensor)` of strings. | | [tensorflow::ops::UnicodeScript](../class/tensorflow/ops/unicode-script) | Determine the script codes of a given tensor of Unicode integer code points. | | [tensorflow::ops::UnicodeTranscode](../class/tensorflow/ops/unicode-transcode) | Transcode the input text from a source encoding to a destination encoding. | | [tensorflow::ops::UnsortedSegmentJoin](../class/tensorflow/ops/unsorted-segment-join) | Joins the elements of `inputs` based on `segment_ids`. | tensorflow_cpp No Op No Op ===== Summary ------- | Classes | | --- | | [tensorflow::ops::NoOp](../class/tensorflow/ops/no-op) | Does nothing. | tensorflow_cpp Candidate Sampling Ops Candidate Sampling Ops ====================== Summary ------- | Classes | | --- | | [tensorflow::ops::AllCandidateSampler](../class/tensorflow/ops/all-candidate-sampler) | Generates labels for candidate sampling with a learned unigram distribution. | | [tensorflow::ops::ComputeAccidentalHits](../class/tensorflow/ops/compute-accidental-hits) | Computes the ids of the positions in sampled\_candidates that match true\_labels. | | [tensorflow::ops::FixedUnigramCandidateSampler](../class/tensorflow/ops/fixed-unigram-candidate-sampler) | Generates labels for candidate sampling with a learned unigram distribution. | | [tensorflow::ops::LearnedUnigramCandidateSampler](../class/tensorflow/ops/learned-unigram-candidate-sampler) | Generates labels for candidate sampling with a learned unigram distribution. | | [tensorflow::ops::LogUniformCandidateSampler](../class/tensorflow/ops/log-uniform-candidate-sampler) | Generates labels for candidate sampling with a log-uniform distribution. | | [tensorflow::ops::UniformCandidateSampler](../class/tensorflow/ops/uniform-candidate-sampler) | Generates labels for candidate sampling with a uniform distribution. | tensorflow_cpp Training Ops Training Ops ============ Summary ------- | Classes | | --- | | [tensorflow::ops::ApplyAdadelta](../class/tensorflow/ops/apply-adadelta) | Update '\*var' according to the adadelta scheme. | | [tensorflow::ops::ApplyAdagrad](../class/tensorflow/ops/apply-adagrad) | Update '\*var' according to the adagrad scheme. | | [tensorflow::ops::ApplyAdagradDA](../class/tensorflow/ops/apply-adagrad-d-a) | Update '\*var' according to the proximal adagrad scheme. | | [tensorflow::ops::ApplyAdam](../class/tensorflow/ops/apply-adam) | Update '\*var' according to the Adam algorithm. | | [tensorflow::ops::ApplyAddSign](../class/tensorflow/ops/apply-add-sign) | Update '\*var' according to the AddSign update. | | [tensorflow::ops::ApplyCenteredRMSProp](../class/tensorflow/ops/apply-centered-r-m-s-prop) | Update '\*var' according to the centered RMSProp algorithm. | | [tensorflow::ops::ApplyFtrl](../class/tensorflow/ops/apply-ftrl) | Update '\*var' according to the Ftrl-proximal scheme. | | [tensorflow::ops::ApplyFtrlV2](../class/tensorflow/ops/apply-ftrl-v2) | Update '\*var' according to the Ftrl-proximal scheme. | | [tensorflow::ops::ApplyGradientDescent](../class/tensorflow/ops/apply-gradient-descent) | Update '\*var' by subtracting 'alpha' \* 'delta' from it. | | [tensorflow::ops::ApplyMomentum](../class/tensorflow/ops/apply-momentum) | Update '\*var' according to the momentum scheme. | | [tensorflow::ops::ApplyPowerSign](../class/tensorflow/ops/apply-power-sign) | Update '\*var' according to the AddSign update. | | [tensorflow::ops::ApplyProximalAdagrad](../class/tensorflow/ops/apply-proximal-adagrad) | Update '\*var' and '\*accum' according to FOBOS with Adagrad learning rate. | | [tensorflow::ops::ApplyProximalGradientDescent](../class/tensorflow/ops/apply-proximal-gradient-descent) | Update '\*var' as FOBOS algorithm with fixed learning rate. | | [tensorflow::ops::ApplyRMSProp](../class/tensorflow/ops/apply-r-m-s-prop) | Update '\*var' according to the RMSProp algorithm. | | [tensorflow::ops::ResourceApplyAdadelta](../class/tensorflow/ops/resource-apply-adadelta) | Update '\*var' according to the adadelta scheme. | | [tensorflow::ops::ResourceApplyAdagrad](../class/tensorflow/ops/resource-apply-adagrad) | Update '\*var' according to the adagrad scheme. | | [tensorflow::ops::ResourceApplyAdagradDA](../class/tensorflow/ops/resource-apply-adagrad-d-a) | Update '\*var' according to the proximal adagrad scheme. | | [tensorflow::ops::ResourceApplyAdam](../class/tensorflow/ops/resource-apply-adam) | Update '\*var' according to the Adam algorithm. | | [tensorflow::ops::ResourceApplyAdamWithAmsgrad](../class/tensorflow/ops/resource-apply-adam-with-amsgrad) | Update '\*var' according to the Adam algorithm. | | [tensorflow::ops::ResourceApplyAddSign](../class/tensorflow/ops/resource-apply-add-sign) | Update '\*var' according to the AddSign update. | | [tensorflow::ops::ResourceApplyCenteredRMSProp](../class/tensorflow/ops/resource-apply-centered-r-m-s-prop) | Update '\*var' according to the centered RMSProp algorithm. | | [tensorflow::ops::ResourceApplyFtrl](../class/tensorflow/ops/resource-apply-ftrl) | Update '\*var' according to the Ftrl-proximal scheme. | | [tensorflow::ops::ResourceApplyFtrlV2](../class/tensorflow/ops/resource-apply-ftrl-v2) | Update '\*var' according to the Ftrl-proximal scheme. | | [tensorflow::ops::ResourceApplyGradientDescent](../class/tensorflow/ops/resource-apply-gradient-descent) | Update '\*var' by subtracting 'alpha' \* 'delta' from it. | | [tensorflow::ops::ResourceApplyKerasMomentum](../class/tensorflow/ops/resource-apply-keras-momentum) | Update '\*var' according to the momentum scheme. | | [tensorflow::ops::ResourceApplyMomentum](../class/tensorflow/ops/resource-apply-momentum) | Update '\*var' according to the momentum scheme. | | [tensorflow::ops::ResourceApplyPowerSign](../class/tensorflow/ops/resource-apply-power-sign) | Update '\*var' according to the AddSign update. | | [tensorflow::ops::ResourceApplyProximalAdagrad](../class/tensorflow/ops/resource-apply-proximal-adagrad) | Update '\*var' and '\*accum' according to FOBOS with Adagrad learning rate. | | [tensorflow::ops::ResourceApplyProximalGradientDescent](../class/tensorflow/ops/resource-apply-proximal-gradient-descent) | Update '\*var' as FOBOS algorithm with fixed learning rate. | | [tensorflow::ops::ResourceApplyRMSProp](../class/tensorflow/ops/resource-apply-r-m-s-prop) | Update '\*var' according to the RMSProp algorithm. | | [tensorflow::ops::ResourceSparseApplyAdadelta](../class/tensorflow/ops/resource-sparse-apply-adadelta) | var: Should be from a Variable(). | | [tensorflow::ops::ResourceSparseApplyAdagrad](../class/tensorflow/ops/resource-sparse-apply-adagrad) | Update relevant entries in '\*var' and '\*accum' according to the adagrad scheme. | | [tensorflow::ops::ResourceSparseApplyAdagradDA](../class/tensorflow/ops/resource-sparse-apply-adagrad-d-a) | Update entries in '\*var' and '\*accum' according to the proximal adagrad scheme. | | [tensorflow::ops::ResourceSparseApplyCenteredRMSProp](../class/tensorflow/ops/resource-sparse-apply-centered-r-m-s-prop) | Update '\*var' according to the centered RMSProp algorithm. | | [tensorflow::ops::ResourceSparseApplyFtrl](../class/tensorflow/ops/resource-sparse-apply-ftrl) | Update relevant entries in '\*var' according to the Ftrl-proximal scheme. | | [tensorflow::ops::ResourceSparseApplyFtrlV2](../class/tensorflow/ops/resource-sparse-apply-ftrl-v2) | Update relevant entries in '\*var' according to the Ftrl-proximal scheme. | | [tensorflow::ops::ResourceSparseApplyKerasMomentum](../class/tensorflow/ops/resource-sparse-apply-keras-momentum) | Update relevant entries in '\*var' and '\*accum' according to the momentum scheme. | | [tensorflow::ops::ResourceSparseApplyMomentum](../class/tensorflow/ops/resource-sparse-apply-momentum) | Update relevant entries in '\*var' and '\*accum' according to the momentum scheme. | | [tensorflow::ops::ResourceSparseApplyProximalAdagrad](../class/tensorflow/ops/resource-sparse-apply-proximal-adagrad) | Sparse update entries in '\*var' and '\*accum' according to FOBOS algorithm. | | [tensorflow::ops::ResourceSparseApplyProximalGradientDescent](../class/tensorflow/ops/resource-sparse-apply-proximal-gradient-descent) | Sparse update '\*var' as FOBOS algorithm with fixed learning rate. | | [tensorflow::ops::ResourceSparseApplyRMSProp](../class/tensorflow/ops/resource-sparse-apply-r-m-s-prop) | Update '\*var' according to the RMSProp algorithm. | | [tensorflow::ops::SparseApplyAdadelta](../class/tensorflow/ops/sparse-apply-adadelta) | var: Should be from a Variable(). | | [tensorflow::ops::SparseApplyAdagrad](../class/tensorflow/ops/sparse-apply-adagrad) | Update relevant entries in '\*var' and '\*accum' according to the adagrad scheme. | | [tensorflow::ops::SparseApplyAdagradDA](../class/tensorflow/ops/sparse-apply-adagrad-d-a) | Update entries in '\*var' and '\*accum' according to the proximal adagrad scheme. | | [tensorflow::ops::SparseApplyCenteredRMSProp](../class/tensorflow/ops/sparse-apply-centered-r-m-s-prop) | Update '\*var' according to the centered RMSProp algorithm. | | [tensorflow::ops::SparseApplyFtrl](../class/tensorflow/ops/sparse-apply-ftrl) | Update relevant entries in '\*var' according to the Ftrl-proximal scheme. | | [tensorflow::ops::SparseApplyFtrlV2](../class/tensorflow/ops/sparse-apply-ftrl-v2) | Update relevant entries in '\*var' according to the Ftrl-proximal scheme. | | [tensorflow::ops::SparseApplyMomentum](../class/tensorflow/ops/sparse-apply-momentum) | Update relevant entries in '\*var' and '\*accum' according to the momentum scheme. | | [tensorflow::ops::SparseApplyProximalAdagrad](../class/tensorflow/ops/sparse-apply-proximal-adagrad) | Sparse update entries in '\*var' and '\*accum' according to FOBOS algorithm. | | [tensorflow::ops::SparseApplyProximalGradientDescent](../class/tensorflow/ops/sparse-apply-proximal-gradient-descent) | Sparse update '\*var' as FOBOS algorithm with fixed learning rate. | | [tensorflow::ops::SparseApplyRMSProp](../class/tensorflow/ops/sparse-apply-r-m-s-prop) | Update '\*var' according to the RMSProp algorithm. |
programming_docs
tensorflow_cpp Io Ops Io Ops ====== Summary ------- | Classes | | --- | | [tensorflow::ops::FixedLengthRecordReader](../class/tensorflow/ops/fixed-length-record-reader) | A Reader that outputs fixed-length records from a file. | | [tensorflow::ops::IdentityReader](../class/tensorflow/ops/identity-reader) | A Reader that outputs the queued work as both the key and value. | | [tensorflow::ops::LMDBReader](../class/tensorflow/ops/l-m-d-b-reader) | A Reader that outputs the records from a LMDB file. | | [tensorflow::ops::MatchingFiles](../class/tensorflow/ops/matching-files) | Returns the set of files matching one or more glob patterns. | | [tensorflow::ops::MergeV2Checkpoints](../class/tensorflow/ops/merge-v2-checkpoints) | V2 format specific: merges the metadata files of sharded checkpoints. | | [tensorflow::ops::ReadFile](../class/tensorflow/ops/read-file) | Reads and outputs the entire contents of the input filename. | | [tensorflow::ops::ReaderNumRecordsProduced](../class/tensorflow/ops/reader-num-records-produced) | Returns the number of records this Reader has produced. | | [tensorflow::ops::ReaderNumWorkUnitsCompleted](../class/tensorflow/ops/reader-num-work-units-completed) | Returns the number of work units this Reader has finished processing. | | [tensorflow::ops::ReaderRead](../class/tensorflow/ops/reader-read) | Returns the next record (key, value pair) produced by a Reader. | | [tensorflow::ops::ReaderReadUpTo](../class/tensorflow/ops/reader-read-up-to) | Returns up to `num_records` (key, value) pairs produced by a Reader. | | [tensorflow::ops::ReaderReset](../class/tensorflow/ops/reader-reset) | [Restore](../class/tensorflow/ops/restore#classtensorflow_1_1ops_1_1_restore) a Reader to its initial clean state. | | [tensorflow::ops::ReaderRestoreState](../class/tensorflow/ops/reader-restore-state) | [Restore](../class/tensorflow/ops/restore#classtensorflow_1_1ops_1_1_restore) a reader to a previously saved state. | | [tensorflow::ops::ReaderSerializeState](../class/tensorflow/ops/reader-serialize-state) | Produce a string tensor that encodes the state of a Reader. | | [tensorflow::ops::Restore](../class/tensorflow/ops/restore) | Restores a tensor from checkpoint files. | | [tensorflow::ops::RestoreSlice](../class/tensorflow/ops/restore-slice) | Restores a tensor from checkpoint files. | | [tensorflow::ops::RestoreV2](../class/tensorflow/ops/restore-v2) | Restores tensors from a V2 checkpoint. | | [tensorflow::ops::Save](../class/tensorflow/ops/save) | Saves the input tensors to disk. | | [tensorflow::ops::SaveSlices](../class/tensorflow/ops/save-slices) | Saves input tensors slices to disk. | | [tensorflow::ops::SaveV2](../class/tensorflow/ops/save-v2) | Saves tensors in V2 checkpoint format. | | [tensorflow::ops::ShardedFilename](../class/tensorflow/ops/sharded-filename) | Generate a sharded filename. | | [tensorflow::ops::ShardedFilespec](../class/tensorflow/ops/sharded-filespec) | Generate a glob pattern matching all sharded file names. | | [tensorflow::ops::TFRecordReader](../class/tensorflow/ops/t-f-record-reader) | A Reader that outputs the records from a TensorFlow Records file. | | [tensorflow::ops::TextLineReader](../class/tensorflow/ops/text-line-reader) | A Reader that outputs the lines of a file delimited by '\n'. | | [tensorflow::ops::WholeFileReader](../class/tensorflow/ops/whole-file-reader) | A Reader that outputs the entire contents of a file as a value. | | [tensorflow::ops::WriteFile](../class/tensorflow/ops/write-file) | Writes `contents` to the file at input `filename`. | tensorflow_cpp Parsing Ops Parsing Ops =========== Summary ------- | Classes | | --- | | [tensorflow::ops::DecodeCSV](../class/tensorflow/ops/decode-c-s-v) | Convert CSV records to tensors. | | [tensorflow::ops::DecodeCompressed](../class/tensorflow/ops/decode-compressed) | Decompress strings. | | [tensorflow::ops::DecodeJSONExample](../class/tensorflow/ops/decode-j-s-o-n-example) | Convert JSON-encoded Example records to binary protocol buffer strings. | | [tensorflow::ops::DecodePaddedRaw](../class/tensorflow/ops/decode-padded-raw) | Reinterpret the bytes of a string as a vector of numbers. | | [tensorflow::ops::DecodeRaw](../class/tensorflow/ops/decode-raw) | Reinterpret the bytes of a string as a vector of numbers. | | [tensorflow::ops::ParseExample](../class/tensorflow/ops/parse-example) | Transforms a vector of brain.Example protos (as strings) into typed tensors. | | [tensorflow::ops::ParseExampleV2](../class/tensorflow/ops/parse-example-v2) | Transforms a vector of tf.Example protos (as strings) into typed tensors. | | [tensorflow::ops::ParseSequenceExample](../class/tensorflow/ops/parse-sequence-example) | Transforms a vector of brain.SequenceExample protos (as strings) into typed tensors. | | [tensorflow::ops::ParseSequenceExampleV2](../class/tensorflow/ops/parse-sequence-example-v2) | Transforms a vector of tf.io.SequenceExample protos (as strings) into typed tensors. | | [tensorflow::ops::ParseSingleExample](../class/tensorflow/ops/parse-single-example) | Transforms a tf.Example proto (as a string) into typed tensors. | | [tensorflow::ops::ParseSingleSequenceExample](../class/tensorflow/ops/parse-single-sequence-example) | Transforms a scalar brain.SequenceExample proto (as strings) into typed tensors. | | [tensorflow::ops::ParseTensor](../class/tensorflow/ops/parse-tensor) | Transforms a serialized tensorflow.TensorProto proto into a [Tensor](../class/tensorflow/tensor#classtensorflow_1_1_tensor). | | [tensorflow::ops::SerializeTensor](../class/tensorflow/ops/serialize-tensor) | Transforms a [Tensor](../class/tensorflow/tensor#classtensorflow_1_1_tensor) into a serialized TensorProto proto. | | [tensorflow::ops::StringToNumber](../class/tensorflow/ops/string-to-number) | Converts each string in the input [Tensor](../class/tensorflow/tensor#classtensorflow_1_1_tensor) to the specified numeric type. | tensorflow_cpp Nn Ops Nn Ops ====== Summary ------- | Classes | | --- | | [tensorflow::ops::AvgPool](../class/tensorflow/ops/avg-pool) | Performs average pooling on the input. | | [tensorflow::ops::AvgPool3D](../class/tensorflow/ops/avg-pool3-d) | Performs 3D average pooling on the input. | | [tensorflow::ops::AvgPool3DGrad](../class/tensorflow/ops/avg-pool3-d-grad) | Computes gradients of average pooling function. | | [tensorflow::ops::BiasAdd](../class/tensorflow/ops/bias-add) | Adds `bias` to `value`. | | [tensorflow::ops::BiasAddGrad](../class/tensorflow/ops/bias-add-grad) | The backward operation for "BiasAdd" on the "bias" tensor. | | [tensorflow::ops::Conv2D](../class/tensorflow/ops/conv2-d) | Computes a 2-D convolution given 4-D `input` and `filter` tensors. | | [tensorflow::ops::Conv2DBackpropFilter](../class/tensorflow/ops/conv2-d-backprop-filter) | Computes the gradients of convolution with respect to the filter. | | [tensorflow::ops::Conv2DBackpropInput](../class/tensorflow/ops/conv2-d-backprop-input) | Computes the gradients of convolution with respect to the input. | | [tensorflow::ops::Conv3D](../class/tensorflow/ops/conv3-d) | Computes a 3-D convolution given 5-D `input` and `filter` tensors. | | [tensorflow::ops::Conv3DBackpropFilterV2](../class/tensorflow/ops/conv3-d-backprop-filter-v2) | Computes the gradients of 3-D convolution with respect to the filter. | | [tensorflow::ops::Conv3DBackpropInputV2](../class/tensorflow/ops/conv3-d-backprop-input-v2) | Computes the gradients of 3-D convolution with respect to the input. | | [tensorflow::ops::DataFormatDimMap](../class/tensorflow/ops/data-format-dim-map) | Returns the dimension index in the destination data format given the one in. | | [tensorflow::ops::DataFormatVecPermute](../class/tensorflow/ops/data-format-vec-permute) | Permute input tensor from `src_format` to `dst_format`. | | [tensorflow::ops::DepthwiseConv2dNative](../class/tensorflow/ops/depthwise-conv2d-native) | Computes a 2-D depthwise convolution given 4-D `input` and `filter` tensors. | | [tensorflow::ops::DepthwiseConv2dNativeBackpropFilter](../class/tensorflow/ops/depthwise-conv2d-native-backprop-filter) | Computes the gradients of depthwise convolution with respect to the filter. | | [tensorflow::ops::DepthwiseConv2dNativeBackpropInput](../class/tensorflow/ops/depthwise-conv2d-native-backprop-input) | Computes the gradients of depthwise convolution with respect to the input. | | [tensorflow::ops::Dilation2D](../class/tensorflow/ops/dilation2-d) | Computes the grayscale dilation of 4-D `input` and 3-D `filter` tensors. | | [tensorflow::ops::Dilation2DBackpropFilter](../class/tensorflow/ops/dilation2-d-backprop-filter) | Computes the gradient of morphological 2-D dilation with respect to the filter. | | [tensorflow::ops::Dilation2DBackpropInput](../class/tensorflow/ops/dilation2-d-backprop-input) | Computes the gradient of morphological 2-D dilation with respect to the input. | | [tensorflow::ops::Elu](../class/tensorflow/ops/elu) | Computes the exponential linear function. | | [tensorflow::ops::FractionalAvgPool](../class/tensorflow/ops/fractional-avg-pool) | Performs fractional average pooling on the input. | | [tensorflow::ops::FractionalMaxPool](../class/tensorflow/ops/fractional-max-pool) | Performs fractional max pooling on the input. | | [tensorflow::ops::FusedBatchNorm](../class/tensorflow/ops/fused-batch-norm) | Batch normalization. | | [tensorflow::ops::FusedBatchNormGrad](../class/tensorflow/ops/fused-batch-norm-grad) | Gradient for batch normalization. | | [tensorflow::ops::FusedBatchNormGradV2](../class/tensorflow/ops/fused-batch-norm-grad-v2) | Gradient for batch normalization. | | [tensorflow::ops::FusedBatchNormGradV3](../class/tensorflow/ops/fused-batch-norm-grad-v3) | Gradient for batch normalization. | | [tensorflow::ops::FusedBatchNormV2](../class/tensorflow/ops/fused-batch-norm-v2) | Batch normalization. | | [tensorflow::ops::FusedBatchNormV3](../class/tensorflow/ops/fused-batch-norm-v3) | Batch normalization. | | [tensorflow::ops::FusedPadConv2D](../class/tensorflow/ops/fused-pad-conv2-d) | Performs a padding as a preprocess during a convolution. | | [tensorflow::ops::FusedResizeAndPadConv2D](../class/tensorflow/ops/fused-resize-and-pad-conv2-d) | Performs a resize and padding as a preprocess during a convolution. | | [tensorflow::ops::InTopK](../class/tensorflow/ops/in-top-k) | Says whether the targets are in the top `K` predictions. | | [tensorflow::ops::InTopKV2](../class/tensorflow/ops/in-top-k-v2) | Says whether the targets are in the top `K` predictions. | | [tensorflow::ops::L2Loss](../class/tensorflow/ops/l2-loss) | L2 Loss. | | [tensorflow::ops::LRN](../class/tensorflow/ops/l-r-n) | Local Response Normalization. | | [tensorflow::ops::LogSoftmax](../class/tensorflow/ops/log-softmax) | Computes log softmax activations. | | [tensorflow::ops::MaxPool](../class/tensorflow/ops/max-pool) | Performs max pooling on the input. | | [tensorflow::ops::MaxPool3D](../class/tensorflow/ops/max-pool3-d) | Performs 3D max pooling on the input. | | [tensorflow::ops::MaxPool3DGrad](../class/tensorflow/ops/max-pool3-d-grad) | Computes gradients of 3D max pooling function. | | [tensorflow::ops::MaxPool3DGradGrad](../class/tensorflow/ops/max-pool3-d-grad-grad) | Computes second-order gradients of the maxpooling function. | | [tensorflow::ops::MaxPoolGradGrad](../class/tensorflow/ops/max-pool-grad-grad) | Computes second-order gradients of the maxpooling function. | | [tensorflow::ops::MaxPoolGradGradV2](../class/tensorflow/ops/max-pool-grad-grad-v2) | Computes second-order gradients of the maxpooling function. | | [tensorflow::ops::MaxPoolGradGradWithArgmax](../class/tensorflow/ops/max-pool-grad-grad-with-argmax) | Computes second-order gradients of the maxpooling function. | | [tensorflow::ops::MaxPoolGradV2](../class/tensorflow/ops/max-pool-grad-v2) | Computes gradients of the maxpooling function. | | [tensorflow::ops::MaxPoolV2](../class/tensorflow/ops/max-pool-v2) | Performs max pooling on the input. | | [tensorflow::ops::MaxPoolWithArgmax](../class/tensorflow/ops/max-pool-with-argmax) | Performs max pooling on the input and outputs both max values and indices. | | [tensorflow::ops::NthElement](../class/tensorflow/ops/nth-element) | Finds values of the `n`-th order statistic for the last dimension. | | [tensorflow::ops::QuantizedAvgPool](../class/tensorflow/ops/quantized-avg-pool) | Produces the average pool of the input tensor for quantized types. | | [tensorflow::ops::QuantizedBatchNormWithGlobalNormalization](../class/tensorflow/ops/quantized-batch-norm-with-global-normalization) | Quantized Batch normalization. | | [tensorflow::ops::QuantizedBiasAdd](../class/tensorflow/ops/quantized-bias-add) | Adds [Tensor](../class/tensorflow/tensor#classtensorflow_1_1_tensor) 'bias' to [Tensor](../class/tensorflow/tensor#classtensorflow_1_1_tensor) 'input' for Quantized types. | | [tensorflow::ops::QuantizedConv2D](../class/tensorflow/ops/quantized-conv2-d) | Computes a 2D convolution given quantized 4D input and filter tensors. | | [tensorflow::ops::QuantizedMaxPool](../class/tensorflow/ops/quantized-max-pool) | Produces the max pool of the input tensor for quantized types. | | [tensorflow::ops::QuantizedRelu](../class/tensorflow/ops/quantized-relu) | Computes Quantized Rectified Linear: `max(features, 0)` | | [tensorflow::ops::QuantizedRelu6](../class/tensorflow/ops/quantized-relu6) | Computes Quantized Rectified Linear 6: `min(max(features, 0), 6)` | | [tensorflow::ops::QuantizedReluX](../class/tensorflow/ops/quantized-relu-x) | Computes Quantized Rectified Linear X: `min(max(features, 0), max_value)` | | [tensorflow::ops::Relu](../class/tensorflow/ops/relu) | Computes rectified linear: `max(features, 0)`. | | [tensorflow::ops::Relu6](../class/tensorflow/ops/relu6) | Computes rectified linear 6: `min(max(features, 0), 6)`. | | [tensorflow::ops::Selu](../class/tensorflow/ops/selu) | Computes scaled exponential linear: `scale * alpha * (exp(features) - 1)` | | [tensorflow::ops::Softmax](../class/tensorflow/ops/softmax) | Computes softmax activations. | | [tensorflow::ops::SoftmaxCrossEntropyWithLogits](../class/tensorflow/ops/softmax-cross-entropy-with-logits) | Computes softmax cross entropy cost and gradients to backpropagate. | | [tensorflow::ops::Softplus](../class/tensorflow/ops/softplus) | TODO: add doc. | | [tensorflow::ops::Softsign](../class/tensorflow/ops/softsign) | Computes softsign: `features / (abs(features) + 1)`. | | [tensorflow::ops::SparseSoftmaxCrossEntropyWithLogits](../class/tensorflow/ops/sparse-softmax-cross-entropy-with-logits) | Computes softmax cross entropy cost and gradients to backpropagate. | | [tensorflow::ops::TopK](../class/tensorflow/ops/top-k) | Finds values and indices of the `k` largest elements for the last dimension. | tensorflow_cpp Logging Ops Logging Ops =========== Summary ------- | Variables | | --- | | `[Args](#group__logging__ops_1ga8d1d526e56892b4b10793fca9d92079b)` | `audio **If max_outputs is greater the summary value tags are *generated sequentially as *tag *tag etc **` | | `[audio](#group__logging__ops_1ga65d7ebf0274699b2d64b24b67c035e59)` | `audio **If max_outputs is greater the summary value tags are *generated sequentially as *tag *` | | `[bad\_color\_](#group__logging__ops_1gafd756df725c5b0089be916a30f635431) = Input::Initializer({255, 0, 0, 255}, {4}).AsTensorProto()` | `TensorProto` | | `[image](#group__logging__ops_1ga85e7dc53b6506cd9c3c658f9fdf5ea53)` | `image **If max_images is greater the summary value tags are *generated sequentially as *tag *` | | `[max\_images\_](#group__logging__ops_1ga040606df10cca932d89a77ac9cb8df11) = 3` | `int64` | | `[max\_outputs\_](#group__logging__ops_1gaab9dcd615e7a411c753129c41d70de9e) = x` | `ret` | | `[operation](#group__logging__ops_1gaa6c3cc9394c1341fe26e89ab95c86a4a)` | `Operation` | | `[ret](#group__logging__ops_1ga9384efccdd5ddf0d91d45e6c07ec74a3)` | `return` | | `[sample\_rate](#group__logging__ops_1gac5f0ed1ac243df5eb5c8c01c734a5551)` | `audio **If max_outputs is greater the summary value tags are *generated sequentially as *tag *tag etc frames **` | | `[summary](#group__logging__ops_1ga9c084831edc827b81bc2343b019d02cb)` | `::[tensorflow::Output](../class/tensorflow/output#classtensorflow_1_1_output)` | | `[than](#group__logging__ops_1ga443e7a28df492f4a0a6adc6f3d57919c)` | `audio **If max_outputs is greater` Outputs a `Summary` protocol buffer with audio. | | Functions | | --- | | `[AudioSummary](#group__logging__ops_1ga8aed7a42d0ca30d3a3ab4ccd255ce67e)(const ::[tensorflow::Scope](../class/tensorflow/scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../class/tensorflow/input#classtensorflow_1_1_input) tag, ::[tensorflow::Input](../class/tensorflow/input#classtensorflow_1_1_input) tensor, ::[tensorflow::Input](../class/tensorflow/input#classtensorflow_1_1_input) sample_rate)` | | | `[AudioSummary](#group__logging__ops_1ga09af34bc2ffdb04cf50a99dc80af1270)(const ::[tensorflow::Scope](../class/tensorflow/scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../class/tensorflow/input#classtensorflow_1_1_input) tag, ::[tensorflow::Input](../class/tensorflow/input#classtensorflow_1_1_input) tensor, ::[tensorflow::Input](../class/tensorflow/input#classtensorflow_1_1_input) sample_rate, const AudioSummary::Attrs & attrs)` | | | `[BadColor](#group__logging__ops_1ga7176bae75b2c957dad310936ece963e0)(const TensorProto & x)` | `TF_MUST_USE_RESULT Attrs` Color to use for pixels with non-finite values. | | `[ImageSummary](#group__logging__ops_1ga2a33be603203e103a752eb85bb18ee8a)(const ::[tensorflow::Scope](../class/tensorflow/scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../class/tensorflow/input#classtensorflow_1_1_input) tag, ::[tensorflow::Input](../class/tensorflow/input#classtensorflow_1_1_input) tensor)` | | | `[ImageSummary](#group__logging__ops_1ga8c0191c0b683fa90ad82e001da1f090a)(const ::[tensorflow::Scope](../class/tensorflow/scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../class/tensorflow/input#classtensorflow_1_1_input) tag, ::[tensorflow::Input](../class/tensorflow/input#classtensorflow_1_1_input) tensor, const ImageSummary::Attrs & attrs)` | | | `[MaxImages](#group__logging__ops_1ga882604c458700a6464ff6fc98c06a418)(int64 x)` | `Attrs` | | `[MaxOutputs](#group__logging__ops_1gab25b29f077c1f74d45026b1078f33359)(int64 x)` | `Attrs` | | `[node](#group__logging__ops_1ga9d6a6481d9f898bf8f65bb7ceeee1825)() const` | `::tensorflow::Node *` | | `[range](#group__logging__ops_1ga64a160cb78d78b90f7e6a88597902f9a)(It represents the value of a *pixel in the output image).Non-finite values in the input tensor are *replaced by this tensor in the output image.The default value is the color *red.**Args` | `image **If max_images is greater the summary value tags are *generated sequentially as *tag *tag etc **The bad_color argument is the color to use in the generated images for *non finite input values It is a uint8 D tensor of length channels *Each element must be in the` [Max](../class/tensorflow/ops/max#classtensorflow_1_1ops_1_1_max) number of batch elements to generate images for. | | Classes | | --- | | [tensorflow::ops::Assert](../class/tensorflow/ops/assert) | Asserts that the given condition is true. | | [tensorflow::ops::HistogramSummary](../class/tensorflow/ops/histogram-summary) | Outputs a `Summary` protocol buffer with a histogram. | | [tensorflow::ops::MergeSummary](../class/tensorflow/ops/merge-summary) | Merges summaries. | | [tensorflow::ops::Print](../class/tensorflow/ops/print) | Prints a list of tensors. | | [tensorflow::ops::PrintV2](../class/tensorflow/ops/print-v2) | Prints a string scalar. | | [tensorflow::ops::ScalarSummary](../class/tensorflow/ops/scalar-summary) | Outputs a `Summary` protocol buffer with scalar values. | | [tensorflow::ops::TensorSummary](../class/tensorflow/ops/tensor-summary) | Outputs a `Summary` protocol buffer with a tensor. | | [tensorflow::ops::TensorSummaryV2](../class/tensorflow/ops/tensor-summary-v2) | Outputs a `Summary` protocol buffer with a tensor and per-plugin data. | | [tensorflow::ops::Timestamp](../class/tensorflow/ops/timestamp) | Provides the time since epoch in seconds. | Variables --------- ### Args ``` audio **If max_outputs is greater the summary value tags are *generated sequentially as *tag *tag etc ** Args ``` ### audio ``` audio **If max_outputs is greater the summary value tags are *generated sequentially as *tag * audio ``` ### bad\_color\_ ``` TensorProto bad_color_ = Input::Initializer({255, 0, 0, 255}, {4}).AsTensorProto() ``` ### image ``` image **If max_images is greater the summary value tags are *generated sequentially as *tag * image ``` ### max\_images\_ ``` int64 max_images_ = 3 ``` ### max\_outputs\_ ``` ret max_outputs_ = x ``` ### operation ``` Operation operation ``` ### ret ``` return ret ``` ### sample\_rate ``` audio **If max_outputs is greater the summary value tags are *generated sequentially as *tag *tag etc frames ** sample_rate ``` ### summary ``` ::tensorflow::Output summary ``` ### than ``` audio **If max_outputs is greater than ``` Outputs a `Summary` protocol buffer with audio. Outputs a `Summary` protocol buffer with images. The summary has up to `max_outputs` summary values containing audio. The audio is built from `tensor` which must be 3-D with shape `[batch_size, frames, channels]` or 2-D with shape `[batch_size, frames]`. The values are assumed to be in the range of `[-1.0, 1.0]` with a sample rate of `sample_rate`. The `tag` argument is a scalar `[Tensor](../class/tensorflow/tensor#classtensorflow_1_1_tensor)` of type `string`. It is used to build the `tag` of the summary values: * If `max_outputs` is 1, the summary value tag is '\*tag The summary has up to `max_images` summary values containing images. The images are built from `tensor` which must be 4-D with shape `[batch_size, height, width, channels]` and where `channels` can be: * 1: `tensor` is interpreted as Grayscale. * 3: `tensor` is interpreted as RGB. * 4: `tensor` is interpreted as RGBA. The images have the same number of channels as the input tensor. For float input, the values are normalized one image at a time to fit in the range `[0, 255]`. `uint8` values are unchanged. The op uses two different normalization algorithms: * If the input values are all positive, they are rescaled so the largest one is 255. * If any input value is negative, the values are shifted so input value 0.0 is at 127. They are then rescaled so that either the smallest value is 0, or the largest one is 255. The `tag` argument is a scalar `[Tensor](../class/tensorflow/tensor#classtensorflow_1_1_tensor)` of type `string`. It is used to build the `tag` of the summary values: * If `max_images` is 1, the summary value tag is '\*tag Functions --------- ### AudioSummary ``` AudioSummary( const ::tensorflow::Scope & scope, ::tensorflow::Input tag, ::tensorflow::Input tensor, ::tensorflow::Input sample_rate ) ``` ### AudioSummary ``` AudioSummary( const ::tensorflow::Scope & scope, ::tensorflow::Input tag, ::tensorflow::Input tensor, ::tensorflow::Input sample_rate, const AudioSummary::Attrs & attrs ) ``` ### BadColor ``` TF_MUST_USE_RESULT Attrs BadColor( const TensorProto & x ) ``` Color to use for pixels with non-finite values. Defaults to Tensor ### ImageSummary ``` ImageSummary( const ::tensorflow::Scope & scope, ::tensorflow::Input tag, ::tensorflow::Input tensor ) ``` ### ImageSummary ``` ImageSummary( const ::tensorflow::Scope & scope, ::tensorflow::Input tag, ::tensorflow::Input tensor, const ImageSummary::Attrs & attrs ) ``` ### MaxImages ``` Attrs MaxImages( int64 x ) ``` ### MaxOutputs ``` Attrs MaxOutputs( int64 x ) ``` ### node ``` ::tensorflow::Node * node() const ``` ### range ``` image **If max_images is greater the summary value tags are *generated sequentially as *tag *tag etc **The bad_color argument is the color to use in the generated images for *non finite input values It is a uint8 D tensor of length channels *Each element must be in the range( It represents the value of a *pixel in the output image ).Non-finite values in the input tensor are *replaced by this tensor in the output image.The default value is the color *red.**Args ``` [Max](../class/tensorflow/ops/max#classtensorflow_1_1ops_1_1_max) number of batch elements to generate images for. Defaults to 3
programming_docs
tensorflow_cpp tensorflow::CompositeOpScopes tensorflow::CompositeOpScopes ============================= `#include <scope.h>` A helper struct to hold the scopes that would be used by a function constructing a composite op. Summary ------- | Public attributes | | --- | | `[child](#structtensorflow_1_1_composite_op_scopes_1a42bd242957a603263a27d75356fb646d)` | `[Scope](../../class/tensorflow/scope#classtensorflow_1_1_scope)` [Scope](../../class/tensorflow/scope#classtensorflow_1_1_scope) to be used for creating the local ops (primitive or other composite ops). | | `[last](#structtensorflow_1_1_composite_op_scopes_1ad9d8188b0dd80e7d51e7870b9b57a5b2)` | `[Scope](../../class/tensorflow/scope#classtensorflow_1_1_scope)` [Scope](../../class/tensorflow/scope#classtensorflow_1_1_scope) to be used for creating the last op. | Public attributes ----------------- ### child ``` Scope tensorflow::CompositeOpScopes::child ``` [Scope](../../class/tensorflow/scope#classtensorflow_1_1_scope) to be used for creating the local ops (primitive or other composite ops). ### last ``` Scope tensorflow::CompositeOpScopes::last ``` [Scope](../../class/tensorflow/scope#classtensorflow_1_1_scope) to be used for creating the last op. tensorflow_cpp tensorflow::OutputHash tensorflow::OutputHash ====================== `#include <ops.h>` Hash class that can be used for e.g. storing Outputs in an unordered\_map. Summary ------- | Public functions | | --- | | `[operator()](#structtensorflow_1_1_output_hash_1a23d0909ee56d17fba82f2f77bee0583e)(const [Output](../../class/tensorflow/output#classtensorflow_1_1_output) & output) const` | `std::size_t` | Public functions ---------------- ### operator() ``` std::size_t tensorflow::OutputHash::operator()( const Output & output ) const ``` tensorflow_cpp tensorflow::Input::Initializer tensorflow::Input::Initializer ============================== `#include <ops.h>` [Initializer](initializer#structtensorflow_1_1_input_1_1_initializer) enables constructing an [Input](../../../class/tensorflow/input#classtensorflow_1_1_input) object from various kinds of C++ constants such as simple primitive constants and nested initializer lists representing a multi-dimensional array. Summary ------- [Initializer](initializer#structtensorflow_1_1_input_1_1_initializer) constructors are all templates, so the aforementioned kinds of C++ constants can be used to construct an [Initializer](initializer#structtensorflow_1_1_input_1_1_initializer). [Initializer](initializer#structtensorflow_1_1_input_1_1_initializer) stores the value it got constructed with in a [Tensor](../../../class/tensorflow/tensor#classtensorflow_1_1_tensor) object. | Constructors and Destructors | | --- | | `[Initializer](#structtensorflow_1_1_input_1_1_initializer_1ade60a4fdcfa9a530604fbf39d3b5be12)(const T & v)` Construct from a scalar value of an arithmetic type or a type that can be converted to a string (eg. | | `[Initializer](#structtensorflow_1_1_input_1_1_initializer_1a9314222b3303dcf97314a4bcbcaa94ad)(const [Tensor](../../../class/tensorflow/tensor#classtensorflow_1_1_tensor) & t)` | | `[Initializer](#structtensorflow_1_1_input_1_1_initializer_1ab77d0712180868a7311936ca9a034835)(const T & v, const TensorShape & shape)` Construct from a scalar value and an explicit shape. | | `[Initializer](#structtensorflow_1_1_input_1_1_initializer_1a91bd52431434dc5358ae8aa39070fe5f)(const std::initializer_list< T > & v)` Construct from a initializer list of scalars (a one-dimensional tensor). | | `[Initializer](#structtensorflow_1_1_input_1_1_initializer_1a3f572c2835a2310e2d5c28138e69ae76)(const std::initializer_list< T > & v, const TensorShape & shape)` Construct from a initializer list of scalars and an explicit shape. | | `[Initializer](#structtensorflow_1_1_input_1_1_initializer_1a8099f954da757c77ac7d8e1c32df88ce)(const std::initializer_list< [Initializer](initializer#structtensorflow_1_1_input_1_1_initializer) > & v)` Construct a multi-dimensional tensor from a nested initializer list. | | Public attributes | | --- | | `[status](#structtensorflow_1_1_input_1_1_initializer_1af0ab9526e575fd7d4b9d5f7dbabcb7e4)` | `Status` | | `[tensor](#structtensorflow_1_1_input_1_1_initializer_1a7b520438780dc80f0162a480a3cadb74)` | `[Tensor](../../../class/tensorflow/tensor#classtensorflow_1_1_tensor)` | | Public functions | | --- | | `[AsTensorProto](#structtensorflow_1_1_input_1_1_initializer_1a6b1e360b983fec2140b756971fe7699d)()` | `TensorProto` | Public attributes ----------------- ### status ``` Status tensorflow::Input::Initializer::status ``` ### tensor ``` Tensor tensorflow::Input::Initializer::tensor ``` Public functions ---------------- ### AsTensorProto ``` TensorProto tensorflow::Input::Initializer::AsTensorProto() ``` ### Initializer ``` tensorflow::Input::Initializer::Initializer( const T & v ) ``` Construct from a scalar value of an arithmetic type or a type that can be converted to a string (eg. a string literal). ### Initializer ``` tensorflow::Input::Initializer::Initializer( const Tensor & t ) ``` ### Initializer ``` tensorflow::Input::Initializer::Initializer( const T & v, const TensorShape & shape ) ``` Construct from a scalar value and an explicit shape. ### Initializer ``` tensorflow::Input::Initializer::Initializer( const std::initializer_list< T > & v ) ``` Construct from a initializer list of scalars (a one-dimensional tensor). ### Initializer ``` tensorflow::Input::Initializer::Initializer( const std::initializer_list< T > & v, const TensorShape & shape ) ``` Construct from a initializer list of scalars and an explicit shape. ### Initializer ``` tensorflow::Input::Initializer::Initializer( const std::initializer_list< Initializer > & v ) ``` Construct a multi-dimensional tensor from a nested initializer list. Note that C++ syntax allows nesting of arbitrarily typed initializer lists, so such invalid initializers cannot be disallowed at compile time. This function performs checks to make sure that the nested initializer list is indeed a valid multi-dimensional tensor. tensorflow_cpp tensorflow::ops::ResizeNearestNeighbor::Attrs tensorflow::ops::ResizeNearestNeighbor::Attrs ============================================= `#include <image_ops.h>` Optional attribute setters for [ResizeNearestNeighbor](../../../../class/tensorflow/ops/resize-nearest-neighbor#classtensorflow_1_1ops_1_1_resize_nearest_neighbor). Summary ------- | Public attributes | | --- | | `[align\_corners\_](#structtensorflow_1_1ops_1_1_resize_nearest_neighbor_1_1_attrs_1a402aac078e97256eb36a2c506fd7fa08) = false` | `bool` | | `[half\_pixel\_centers\_](#structtensorflow_1_1ops_1_1_resize_nearest_neighbor_1_1_attrs_1a2746d2e7059065b351c89aaacb980c20) = false` | `bool` | | Public functions | | --- | | `[AlignCorners](#structtensorflow_1_1ops_1_1_resize_nearest_neighbor_1_1_attrs_1ad232beade15d5da475d0c6ed4fb427a2)(bool x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_resize_nearest_neighbor_1_1_attrs)` If true, the centers of the 4 corner pixels of the input and output tensors are aligned, preserving the values at the corner pixels. | | `[HalfPixelCenters](#structtensorflow_1_1ops_1_1_resize_nearest_neighbor_1_1_attrs_1aaab11af146fef7106824c2fbefb4a93e)(bool x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_resize_nearest_neighbor_1_1_attrs)` Defaults to false. | Public attributes ----------------- ### align\_corners\_ ``` bool tensorflow::ops::ResizeNearestNeighbor::Attrs::align_corners_ = false ``` ### half\_pixel\_centers\_ ``` bool tensorflow::ops::ResizeNearestNeighbor::Attrs::half_pixel_centers_ = false ``` Public functions ---------------- ### AlignCorners ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::ResizeNearestNeighbor::Attrs::AlignCorners( bool x ) ``` If true, the centers of the 4 corner pixels of the input and output tensors are aligned, preserving the values at the corner pixels. Defaults to false. Defaults to false ### HalfPixelCenters ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::ResizeNearestNeighbor::Attrs::HalfPixelCenters( bool x ) ``` Defaults to false. tensorflow_cpp tensorflow::ops::OrderedMapClear::Attrs tensorflow::ops::OrderedMapClear::Attrs ======================================= `#include <data_flow_ops.h>` Optional attribute setters for [OrderedMapClear](../../../../class/tensorflow/ops/ordered-map-clear#classtensorflow_1_1ops_1_1_ordered_map_clear). Summary ------- | Public attributes | | --- | | `[capacity\_](#structtensorflow_1_1ops_1_1_ordered_map_clear_1_1_attrs_1a99ef97e6d755d0eae99bcb0fcad03aca) = 0` | `int64` | | `[container\_](#structtensorflow_1_1ops_1_1_ordered_map_clear_1_1_attrs_1ae9b914c8c79d3837b67cf51a628147cf) = ""` | `StringPiece` | | `[memory\_limit\_](#structtensorflow_1_1ops_1_1_ordered_map_clear_1_1_attrs_1a002316cf240081ab68772446656b42c5) = 0` | `int64` | | `[shared\_name\_](#structtensorflow_1_1ops_1_1_ordered_map_clear_1_1_attrs_1afb6062ff7cd57d50032098b7f0fd5ff9) = ""` | `StringPiece` | | Public functions | | --- | | `[Capacity](#structtensorflow_1_1ops_1_1_ordered_map_clear_1_1_attrs_1a075e30ed42636da74d7be6806f10a94a)(int64 x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_ordered_map_clear_1_1_attrs)` Defaults to 0. | | `[Container](#structtensorflow_1_1ops_1_1_ordered_map_clear_1_1_attrs_1a93900ada4696979cc7e7c124701cc0fd)(StringPiece x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_ordered_map_clear_1_1_attrs)` Defaults to "". | | `[MemoryLimit](#structtensorflow_1_1ops_1_1_ordered_map_clear_1_1_attrs_1a3756d1b2df40e0ba7c3a1f4331b0b489)(int64 x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_ordered_map_clear_1_1_attrs)` Defaults to 0. | | `[SharedName](#structtensorflow_1_1ops_1_1_ordered_map_clear_1_1_attrs_1ad0dcfd239e9bf2544d35f7f5f6f4306e)(StringPiece x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_ordered_map_clear_1_1_attrs)` Defaults to "". | Public attributes ----------------- ### capacity\_ ``` int64 tensorflow::ops::OrderedMapClear::Attrs::capacity_ = 0 ``` ### container\_ ``` StringPiece tensorflow::ops::OrderedMapClear::Attrs::container_ = "" ``` ### memory\_limit\_ ``` int64 tensorflow::ops::OrderedMapClear::Attrs::memory_limit_ = 0 ``` ### shared\_name\_ ``` StringPiece tensorflow::ops::OrderedMapClear::Attrs::shared_name_ = "" ``` Public functions ---------------- ### Capacity ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::OrderedMapClear::Attrs::Capacity( int64 x ) ``` Defaults to 0. ### Container ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::OrderedMapClear::Attrs::Container( StringPiece x ) ``` Defaults to "". ### MemoryLimit ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::OrderedMapClear::Attrs::MemoryLimit( int64 x ) ``` Defaults to 0. ### SharedName ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::OrderedMapClear::Attrs::SharedName( StringPiece x ) ``` Defaults to "". tensorflow_cpp tensorflow::ops::SparseApplyRMSProp::Attrs tensorflow::ops::SparseApplyRMSProp::Attrs ========================================== `#include <training_ops.h>` Optional attribute setters for [SparseApplyRMSProp](../../../../class/tensorflow/ops/sparse-apply-r-m-s-prop#classtensorflow_1_1ops_1_1_sparse_apply_r_m_s_prop). Summary ------- | Public attributes | | --- | | `[use\_locking\_](#structtensorflow_1_1ops_1_1_sparse_apply_r_m_s_prop_1_1_attrs_1a9c50586c265016bd074f3977377ffcc9) = false` | `bool` | | Public functions | | --- | | `[UseLocking](#structtensorflow_1_1ops_1_1_sparse_apply_r_m_s_prop_1_1_attrs_1a7944eae5b2364f6ae886848693c6f561)(bool x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_sparse_apply_r_m_s_prop_1_1_attrs)` If `True`, updating of the var, ms, and mom tensors is protected by a lock; otherwise the behavior is undefined, but may exhibit less contention. | Public attributes ----------------- ### use\_locking\_ ``` bool tensorflow::ops::SparseApplyRMSProp::Attrs::use_locking_ = false ``` Public functions ---------------- ### UseLocking ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::SparseApplyRMSProp::Attrs::UseLocking( bool x ) ``` If `True`, updating of the var, ms, and mom tensors is protected by a lock; otherwise the behavior is undefined, but may exhibit less contention. Defaults to false tensorflow_cpp tensorflow::ops::ComputeAccidentalHits::Attrs tensorflow::ops::ComputeAccidentalHits::Attrs ============================================= `#include <candidate_sampling_ops.h>` Optional attribute setters for [ComputeAccidentalHits](../../../../class/tensorflow/ops/compute-accidental-hits#classtensorflow_1_1ops_1_1_compute_accidental_hits). Summary ------- | Public attributes | | --- | | `[seed2\_](#structtensorflow_1_1ops_1_1_compute_accidental_hits_1_1_attrs_1a99fd3bb162e1986c80ce39b89719a1d1) = 0` | `int64` | | `[seed\_](#structtensorflow_1_1ops_1_1_compute_accidental_hits_1_1_attrs_1a10c7cf573d98ea9544d254035f2fd6e3) = 0` | `int64` | | Public functions | | --- | | `[Seed](#structtensorflow_1_1ops_1_1_compute_accidental_hits_1_1_attrs_1af10a5866bca140fdc513f5f56ee46756)(int64 x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_compute_accidental_hits_1_1_attrs)` If either seed or seed2 are set to be non-zero, the random number generator is seeded by the given seed. | | `[Seed2](#structtensorflow_1_1ops_1_1_compute_accidental_hits_1_1_attrs_1aec5aeae0e57560e1629549e7d22a994c)(int64 x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_compute_accidental_hits_1_1_attrs)` An second seed to avoid seed collision. | Public attributes ----------------- ### seed2\_ ``` int64 tensorflow::ops::ComputeAccidentalHits::Attrs::seed2_ = 0 ``` ### seed\_ ``` int64 tensorflow::ops::ComputeAccidentalHits::Attrs::seed_ = 0 ``` Public functions ---------------- ### Seed ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::ComputeAccidentalHits::Attrs::Seed( int64 x ) ``` If either seed or seed2 are set to be non-zero, the random number generator is seeded by the given seed. Otherwise, it is seeded by a random seed. Defaults to 0 ### Seed2 ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::ComputeAccidentalHits::Attrs::Seed2( int64 x ) ``` An second seed to avoid seed collision. Defaults to 0 tensorflow_cpp tensorflow::ops::Prod::Attrs tensorflow::ops::Prod::Attrs ============================ `#include <math_ops.h>` Optional attribute setters for [Prod](../../../../class/tensorflow/ops/prod#classtensorflow_1_1ops_1_1_prod). Summary ------- | Public attributes | | --- | | `[keep\_dims\_](#structtensorflow_1_1ops_1_1_prod_1_1_attrs_1a492286ce91a6802e6da277b08cc092fc) = false` | `bool` | | Public functions | | --- | | `[KeepDims](#structtensorflow_1_1ops_1_1_prod_1_1_attrs_1a7c8a8beeddbd74f172a21bebed14d0aa)(bool x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_prod_1_1_attrs)` If true, retain reduced dimensions with length 1. | Public attributes ----------------- ### keep\_dims\_ ``` bool tensorflow::ops::Prod::Attrs::keep_dims_ = false ``` Public functions ---------------- ### KeepDims ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::Prod::Attrs::KeepDims( bool x ) ``` If true, retain reduced dimensions with length 1. Defaults to false tensorflow_cpp tensorflow::ops::BiasAdd::Attrs tensorflow::ops::BiasAdd::Attrs =============================== `#include <nn_ops.h>` Optional attribute setters for [BiasAdd](../../../../class/tensorflow/ops/bias-add#classtensorflow_1_1ops_1_1_bias_add). Summary ------- | Public attributes | | --- | | `[data\_format\_](#structtensorflow_1_1ops_1_1_bias_add_1_1_attrs_1a33b25792508b49c3a77e2296f9688e69) = "NHWC"` | `StringPiece` | | Public functions | | --- | | `[DataFormat](#structtensorflow_1_1ops_1_1_bias_add_1_1_attrs_1aaf04b461e55a1394eae92a7bc3d0ee40)(StringPiece x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_bias_add_1_1_attrs)` Specify the data format of the input and output data. | Public attributes ----------------- ### data\_format\_ ``` StringPiece tensorflow::ops::BiasAdd::Attrs::data_format_ = "NHWC" ``` Public functions ---------------- ### DataFormat ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::BiasAdd::Attrs::DataFormat( StringPiece x ) ``` Specify the data format of the input and output data. With the default format "NHWC", the bias tensor will be added to the last dimension of the value tensor. Alternatively, the format could be "NCHW", the data storage order of: [batch, in\_channels, in\_height, in\_width]. The tensor will be added to "in\_channels", the third-to-the-last dimension. Defaults to "NHWC" tensorflow_cpp tensorflow::ops::LearnedUnigramCandidateSampler::Attrs tensorflow::ops::LearnedUnigramCandidateSampler::Attrs ====================================================== `#include <candidate_sampling_ops.h>` Optional attribute setters for [LearnedUnigramCandidateSampler](../../../../class/tensorflow/ops/learned-unigram-candidate-sampler#classtensorflow_1_1ops_1_1_learned_unigram_candidate_sampler). Summary ------- | Public attributes | | --- | | `[seed2\_](#structtensorflow_1_1ops_1_1_learned_unigram_candidate_sampler_1_1_attrs_1ad8e2e8e329033e50c24959c1860c2858) = 0` | `int64` | | `[seed\_](#structtensorflow_1_1ops_1_1_learned_unigram_candidate_sampler_1_1_attrs_1aa96c2e366ab7256a6233622c245f0b7e) = 0` | `int64` | | Public functions | | --- | | `[Seed](#structtensorflow_1_1ops_1_1_learned_unigram_candidate_sampler_1_1_attrs_1a1eded3e72beecbdf071ca943bb214d82)(int64 x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_learned_unigram_candidate_sampler_1_1_attrs)` If either seed or seed2 are set to be non-zero, the random number generator is seeded by the given seed. | | `[Seed2](#structtensorflow_1_1ops_1_1_learned_unigram_candidate_sampler_1_1_attrs_1a09b6fb797c2b0649018c97574d2f8405)(int64 x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_learned_unigram_candidate_sampler_1_1_attrs)` An second seed to avoid seed collision. | Public attributes ----------------- ### seed2\_ ``` int64 tensorflow::ops::LearnedUnigramCandidateSampler::Attrs::seed2_ = 0 ``` ### seed\_ ``` int64 tensorflow::ops::LearnedUnigramCandidateSampler::Attrs::seed_ = 0 ``` Public functions ---------------- ### Seed ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::LearnedUnigramCandidateSampler::Attrs::Seed( int64 x ) ``` If either seed or seed2 are set to be non-zero, the random number generator is seeded by the given seed. Otherwise, it is seeded by a random seed. Defaults to 0 ### Seed2 ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::LearnedUnigramCandidateSampler::Attrs::Seed2( int64 x ) ``` An second seed to avoid seed collision. Defaults to 0 tensorflow_cpp tensorflow::ops::ResourceApplyAdagradDA::Attrs tensorflow::ops::ResourceApplyAdagradDA::Attrs ============================================== `#include <training_ops.h>` Optional attribute setters for [ResourceApplyAdagradDA](../../../../class/tensorflow/ops/resource-apply-adagrad-d-a#classtensorflow_1_1ops_1_1_resource_apply_adagrad_d_a). Summary ------- | Public attributes | | --- | | `[use\_locking\_](#structtensorflow_1_1ops_1_1_resource_apply_adagrad_d_a_1_1_attrs_1a6d4b26ef3ca7723d69eea45fd9961d96) = false` | `bool` | | Public functions | | --- | | `[UseLocking](#structtensorflow_1_1ops_1_1_resource_apply_adagrad_d_a_1_1_attrs_1ade3956e86b925a109bad4c23b913cc42)(bool x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_resource_apply_adagrad_d_a_1_1_attrs)` If True, updating of the var and accum tensors will be protected by a lock; otherwise the behavior is undefined, but may exhibit less contention. | Public attributes ----------------- ### use\_locking\_ ``` bool tensorflow::ops::ResourceApplyAdagradDA::Attrs::use_locking_ = false ``` Public functions ---------------- ### UseLocking ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::ResourceApplyAdagradDA::Attrs::UseLocking( bool x ) ``` If True, updating of the var and accum tensors will be protected by a lock; otherwise the behavior is undefined, but may exhibit less contention. Defaults to false
programming_docs
tensorflow_cpp tensorflow::ops::MaxPool::Attrs tensorflow::ops::MaxPool::Attrs =============================== `#include <nn_ops.h>` Optional attribute setters for [MaxPool](../../../../class/tensorflow/ops/max-pool#classtensorflow_1_1ops_1_1_max_pool). Summary ------- | Public attributes | | --- | | `[data\_format\_](#structtensorflow_1_1ops_1_1_max_pool_1_1_attrs_1a0ef1889743d4b66c14d04f4228678a44) = "NHWC"` | `StringPiece` | | `[explicit\_paddings\_](#structtensorflow_1_1ops_1_1_max_pool_1_1_attrs_1a9216908c357f78b7b7468113899ab7b6) = {}` | `gtl::ArraySlice< int >` | | Public functions | | --- | | `[DataFormat](#structtensorflow_1_1ops_1_1_max_pool_1_1_attrs_1ae58819a319133046495923de7bc76753)(StringPiece x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_max_pool_1_1_attrs)` Specify the data format of the input and output data. | | `[ExplicitPaddings](#structtensorflow_1_1ops_1_1_max_pool_1_1_attrs_1a285e9dd0e549a3f01b411057e7dcb45a)(const gtl::ArraySlice< int > & x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_max_pool_1_1_attrs)` Defaults to []. | Public attributes ----------------- ### data\_format\_ ``` StringPiece tensorflow::ops::MaxPool::Attrs::data_format_ = "NHWC" ``` ### explicit\_paddings\_ ``` gtl::ArraySlice< int > tensorflow::ops::MaxPool::Attrs::explicit_paddings_ = {} ``` Public functions ---------------- ### DataFormat ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::MaxPool::Attrs::DataFormat( StringPiece x ) ``` Specify the data format of the input and output data. With the default format "NHWC", the data is stored in the order of: [batch, in\_height, in\_width, in\_channels]. Alternatively, the format could be "NCHW", the data storage order of: [batch, in\_channels, in\_height, in\_width]. Defaults to "NHWC" ### ExplicitPaddings ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::MaxPool::Attrs::ExplicitPaddings( const gtl::ArraySlice< int > & x ) ``` Defaults to []. tensorflow_cpp tensorflow::ops::DepthwiseConv2dNative::Attrs tensorflow::ops::DepthwiseConv2dNative::Attrs ============================================= `#include <nn_ops.h>` Optional attribute setters for [DepthwiseConv2dNative](../../../../class/tensorflow/ops/depthwise-conv2d-native#classtensorflow_1_1ops_1_1_depthwise_conv2d_native). Summary ------- | Public attributes | | --- | | `[data\_format\_](#structtensorflow_1_1ops_1_1_depthwise_conv2d_native_1_1_attrs_1a0d029aaf29f51127d2da6466b8103ead) = "NHWC"` | `StringPiece` | | `[dilations\_](#structtensorflow_1_1ops_1_1_depthwise_conv2d_native_1_1_attrs_1a4e35a2333d2bb5228f4251202d78c0e1) = Default_dilations()` | `gtl::ArraySlice< int >` | | `[explicit\_paddings\_](#structtensorflow_1_1ops_1_1_depthwise_conv2d_native_1_1_attrs_1a755122176f87796e4d88cc5eb4b0267a) = {}` | `gtl::ArraySlice< int >` | | Public functions | | --- | | `[DataFormat](#structtensorflow_1_1ops_1_1_depthwise_conv2d_native_1_1_attrs_1a447e7c3e583e72979fb2ec601f68db73)(StringPiece x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_depthwise_conv2d_native_1_1_attrs)` Specify the data format of the input and output data. | | `[Dilations](#structtensorflow_1_1ops_1_1_depthwise_conv2d_native_1_1_attrs_1aa73e4b11fe5a09060f449fcc49c63ba8)(const gtl::ArraySlice< int > & x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_depthwise_conv2d_native_1_1_attrs)` 1-D tensor of length 4. | | `[ExplicitPaddings](#structtensorflow_1_1ops_1_1_depthwise_conv2d_native_1_1_attrs_1a74bc8bd5a5f6750f0aee226d1ba431ad)(const gtl::ArraySlice< int > & x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_depthwise_conv2d_native_1_1_attrs)` Defaults to []. | Public attributes ----------------- ### data\_format\_ ``` StringPiece tensorflow::ops::DepthwiseConv2dNative::Attrs::data_format_ = "NHWC" ``` ### dilations\_ ``` gtl::ArraySlice< int > tensorflow::ops::DepthwiseConv2dNative::Attrs::dilations_ = Default_dilations() ``` ### explicit\_paddings\_ ``` gtl::ArraySlice< int > tensorflow::ops::DepthwiseConv2dNative::Attrs::explicit_paddings_ = {} ``` Public functions ---------------- ### DataFormat ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::DepthwiseConv2dNative::Attrs::DataFormat( StringPiece x ) ``` Specify the data format of the input and output data. With the default format "NHWC", the data is stored in the order of: [batch, height, width, channels]. Alternatively, the format could be "NCHW", the data storage order of: [batch, channels, height, width]. Defaults to "NHWC" ### Dilations ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::DepthwiseConv2dNative::Attrs::Dilations( const gtl::ArraySlice< int > & x ) ``` 1-D tensor of length 4. The dilation factor for each dimension of `input`. If set to k > 1, there will be k-1 skipped cells between each filter element on that dimension. The dimension order is determined by the value of `data_format`, see above for details. Dilations in the batch and depth dimensions must be 1. Defaults to [1, 1, 1, 1] ### ExplicitPaddings ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::DepthwiseConv2dNative::Attrs::ExplicitPaddings( const gtl::ArraySlice< int > & x ) ``` Defaults to []. tensorflow_cpp tensorflow::ops::TruncatedNormal::Attrs tensorflow::ops::TruncatedNormal::Attrs ======================================= `#include <random_ops.h>` Optional attribute setters for [TruncatedNormal](../../../../class/tensorflow/ops/truncated-normal#classtensorflow_1_1ops_1_1_truncated_normal). Summary ------- | Public attributes | | --- | | `[seed2\_](#structtensorflow_1_1ops_1_1_truncated_normal_1_1_attrs_1a8c7d04cc1166de9126777b9501f02946) = 0` | `int64` | | `[seed\_](#structtensorflow_1_1ops_1_1_truncated_normal_1_1_attrs_1a7ee6c42a0dce4fa66944298387f6dd60) = 0` | `int64` | | Public functions | | --- | | `[Seed](#structtensorflow_1_1ops_1_1_truncated_normal_1_1_attrs_1ac76082d120bb94c94a7774c81ed4a56a)(int64 x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_truncated_normal_1_1_attrs)` If either `seed` or `seed2` are set to be non-zero, the random number generator is seeded by the given seed. | | `[Seed2](#structtensorflow_1_1ops_1_1_truncated_normal_1_1_attrs_1a0464a3146de59f0b0a808a8eb8ef97b9)(int64 x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_truncated_normal_1_1_attrs)` A second seed to avoid seed collision. | Public attributes ----------------- ### seed2\_ ``` int64 tensorflow::ops::TruncatedNormal::Attrs::seed2_ = 0 ``` ### seed\_ ``` int64 tensorflow::ops::TruncatedNormal::Attrs::seed_ = 0 ``` Public functions ---------------- ### Seed ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::TruncatedNormal::Attrs::Seed( int64 x ) ``` If either `seed` or `seed2` are set to be non-zero, the random number generator is seeded by the given seed. Otherwise, it is seeded by a random seed. Defaults to 0 ### Seed2 ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::TruncatedNormal::Attrs::Seed2( int64 x ) ``` A second seed to avoid seed collision. Defaults to 0 tensorflow_cpp tensorflow::ops::ApplyProximalGradientDescent::Attrs tensorflow::ops::ApplyProximalGradientDescent::Attrs ==================================================== `#include <training_ops.h>` Optional attribute setters for [ApplyProximalGradientDescent](../../../../class/tensorflow/ops/apply-proximal-gradient-descent#classtensorflow_1_1ops_1_1_apply_proximal_gradient_descent). Summary ------- | Public attributes | | --- | | `[use\_locking\_](#structtensorflow_1_1ops_1_1_apply_proximal_gradient_descent_1_1_attrs_1ab3cc145d79f624ed249e93bd5b3793f9) = false` | `bool` | | Public functions | | --- | | `[UseLocking](#structtensorflow_1_1ops_1_1_apply_proximal_gradient_descent_1_1_attrs_1a55785247936cf60b978d397750373133)(bool x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_apply_proximal_gradient_descent_1_1_attrs)` If True, the subtraction will be protected by a lock; otherwise the behavior is undefined, but may exhibit less contention. | Public attributes ----------------- ### use\_locking\_ ``` bool tensorflow::ops::ApplyProximalGradientDescent::Attrs::use_locking_ = false ``` Public functions ---------------- ### UseLocking ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::ApplyProximalGradientDescent::Attrs::UseLocking( bool x ) ``` If True, the subtraction will be protected by a lock; otherwise the behavior is undefined, but may exhibit less contention. Defaults to false tensorflow_cpp tensorflow::ops::ResourceApplyAddSign::Attrs tensorflow::ops::ResourceApplyAddSign::Attrs ============================================ `#include <training_ops.h>` Optional attribute setters for [ResourceApplyAddSign](../../../../class/tensorflow/ops/resource-apply-add-sign#classtensorflow_1_1ops_1_1_resource_apply_add_sign). Summary ------- | Public attributes | | --- | | `[use\_locking\_](#structtensorflow_1_1ops_1_1_resource_apply_add_sign_1_1_attrs_1aca0a3763d863def8f637c50a0bde57b5) = false` | `bool` | | Public functions | | --- | | `[UseLocking](#structtensorflow_1_1ops_1_1_resource_apply_add_sign_1_1_attrs_1a94cc99dee195b5f53fca238446a8d122)(bool x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_resource_apply_add_sign_1_1_attrs)` If `True`, updating of the var and m tensors is protected by a lock; otherwise the behavior is undefined, but may exhibit less contention. | Public attributes ----------------- ### use\_locking\_ ``` bool tensorflow::ops::ResourceApplyAddSign::Attrs::use_locking_ = false ``` Public functions ---------------- ### UseLocking ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::ResourceApplyAddSign::Attrs::UseLocking( bool x ) ``` If `True`, updating of the var and m tensors is protected by a lock; otherwise the behavior is undefined, but may exhibit less contention. Defaults to false tensorflow_cpp tensorflow::ops::RandomShuffle::Attrs tensorflow::ops::RandomShuffle::Attrs ===================================== `#include <random_ops.h>` Optional attribute setters for [RandomShuffle](../../../../class/tensorflow/ops/random-shuffle#classtensorflow_1_1ops_1_1_random_shuffle). Summary ------- | Public attributes | | --- | | `[seed2\_](#structtensorflow_1_1ops_1_1_random_shuffle_1_1_attrs_1acb44ea12909cbd2400522daa49f4b95e) = 0` | `int64` | | `[seed\_](#structtensorflow_1_1ops_1_1_random_shuffle_1_1_attrs_1a9193127d22eea45ee4630dc230d2c57e) = 0` | `int64` | | Public functions | | --- | | `[Seed](#structtensorflow_1_1ops_1_1_random_shuffle_1_1_attrs_1ab19824179b7cf8cfb8d29e547e28d1c6)(int64 x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_random_shuffle_1_1_attrs)` If either `seed` or `seed2` are set to be non-zero, the random number generator is seeded by the given seed. | | `[Seed2](#structtensorflow_1_1ops_1_1_random_shuffle_1_1_attrs_1a25965c3e41d807ad3c7c252e1d3a82ea)(int64 x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_random_shuffle_1_1_attrs)` A second seed to avoid seed collision. | Public attributes ----------------- ### seed2\_ ``` int64 tensorflow::ops::RandomShuffle::Attrs::seed2_ = 0 ``` ### seed\_ ``` int64 tensorflow::ops::RandomShuffle::Attrs::seed_ = 0 ``` Public functions ---------------- ### Seed ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::RandomShuffle::Attrs::Seed( int64 x ) ``` If either `seed` or `seed2` are set to be non-zero, the random number generator is seeded by the given seed. Otherwise, it is seeded by a random seed. Defaults to 0 ### Seed2 ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::RandomShuffle::Attrs::Seed2( int64 x ) ``` A second seed to avoid seed collision. Defaults to 0 tensorflow_cpp tensorflow::ops::ParseSequenceExampleV2::Attrs tensorflow::ops::ParseSequenceExampleV2::Attrs ============================================== `#include <parsing_ops.h>` Optional attribute setters for [ParseSequenceExampleV2](../../../../class/tensorflow/ops/parse-sequence-example-v2#classtensorflow_1_1ops_1_1_parse_sequence_example_v2). Summary ------- | Public attributes | | --- | | `[Ncontext\_sparse\_](#structtensorflow_1_1ops_1_1_parse_sequence_example_v2_1_1_attrs_1a030f2ff9c42cb461af32fe50725fa03a) = 0` | `int64` | | `[Nfeature\_list\_dense\_](#structtensorflow_1_1ops_1_1_parse_sequence_example_v2_1_1_attrs_1a7a182e16e6220e509b079a72094d5aec) = 0` | `int64` | | `[Nfeature\_list\_sparse\_](#structtensorflow_1_1ops_1_1_parse_sequence_example_v2_1_1_attrs_1a15a4874859fac74b0c9feb74ea094049) = 0` | `int64` | | `[context\_dense\_shapes\_](#structtensorflow_1_1ops_1_1_parse_sequence_example_v2_1_1_attrs_1abfe429eee7f2d87ebbc8a6ed7ce51b75) = {}` | `gtl::ArraySlice< PartialTensorShape >` | | `[context\_ragged\_split\_types\_](#structtensorflow_1_1ops_1_1_parse_sequence_example_v2_1_1_attrs_1a326240844d13f56c661d7746a03925b0) = {}` | `DataTypeSlice` | | `[context\_ragged\_value\_types\_](#structtensorflow_1_1ops_1_1_parse_sequence_example_v2_1_1_attrs_1a7da69fb1aa6c104f5c15e3e105a99af7) = {}` | `DataTypeSlice` | | `[context\_sparse\_types\_](#structtensorflow_1_1ops_1_1_parse_sequence_example_v2_1_1_attrs_1a34f9a11cd442e9cf271fe18b77897e35) = {}` | `DataTypeSlice` | | `[feature\_list\_dense\_shapes\_](#structtensorflow_1_1ops_1_1_parse_sequence_example_v2_1_1_attrs_1ac8d77d727efe5291780fc9c141920792) = {}` | `gtl::ArraySlice< PartialTensorShape >` | | `[feature\_list\_dense\_types\_](#structtensorflow_1_1ops_1_1_parse_sequence_example_v2_1_1_attrs_1a9738778208a9b15896cc7d78be00d62d) = {}` | `DataTypeSlice` | | `[feature\_list\_ragged\_split\_types\_](#structtensorflow_1_1ops_1_1_parse_sequence_example_v2_1_1_attrs_1a0e3c921566fbb4027a9243d66d91d95f) = {}` | `DataTypeSlice` | | `[feature\_list\_ragged\_value\_types\_](#structtensorflow_1_1ops_1_1_parse_sequence_example_v2_1_1_attrs_1a0fe7d35677e25b032a7caf354b1814b4) = {}` | `DataTypeSlice` | | `[feature\_list\_sparse\_types\_](#structtensorflow_1_1ops_1_1_parse_sequence_example_v2_1_1_attrs_1aee8f0b4795e98a6213854d9bf55cf3d5) = {}` | `DataTypeSlice` | | Public functions | | --- | | `[ContextDenseShapes](#structtensorflow_1_1ops_1_1_parse_sequence_example_v2_1_1_attrs_1a77ff8f512855c452bbe600eb37aa59a7)(const gtl::ArraySlice< PartialTensorShape > & x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_parse_sequence_example_v2_1_1_attrs)` A list of Ncontext\_dense shapes; the shapes of data in each context Feature given in context\_dense\_keys. | | `[ContextRaggedSplitTypes](#structtensorflow_1_1ops_1_1_parse_sequence_example_v2_1_1_attrs_1a7e946796624d85a909ac6e197759de27)(const DataTypeSlice & x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_parse_sequence_example_v2_1_1_attrs)` RaggedTensor.row\_split dtypes for the ragged context features. | | `[ContextRaggedValueTypes](#structtensorflow_1_1ops_1_1_parse_sequence_example_v2_1_1_attrs_1af71af3ff73b3b24503fbbfc7ae79dbc6)(const DataTypeSlice & x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_parse_sequence_example_v2_1_1_attrs)` RaggedTensor.value dtypes for the ragged context features. | | `[ContextSparseTypes](#structtensorflow_1_1ops_1_1_parse_sequence_example_v2_1_1_attrs_1af125563aff1ef3571ac7f9a8bc756b84)(const DataTypeSlice & x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_parse_sequence_example_v2_1_1_attrs)` A list of Ncontext\_sparse types; the data types of data in each context Feature given in context\_sparse\_keys. | | `[FeatureListDenseShapes](#structtensorflow_1_1ops_1_1_parse_sequence_example_v2_1_1_attrs_1afc9000ed3bf79dd8e59c546cdd3bcb21)(const gtl::ArraySlice< PartialTensorShape > & x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_parse_sequence_example_v2_1_1_attrs)` A list of Nfeature\_list\_dense shapes; the shapes of data in each FeatureList given in feature\_list\_dense\_keys. | | `[FeatureListDenseTypes](#structtensorflow_1_1ops_1_1_parse_sequence_example_v2_1_1_attrs_1a55cb43ce7a6cffacbcd1685612361ad3)(const DataTypeSlice & x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_parse_sequence_example_v2_1_1_attrs)` Defaults to []. | | `[FeatureListRaggedSplitTypes](#structtensorflow_1_1ops_1_1_parse_sequence_example_v2_1_1_attrs_1ac5a8d8fe452ca859c662ac9b50ba9790)(const DataTypeSlice & x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_parse_sequence_example_v2_1_1_attrs)` RaggedTensor.row\_split dtypes for the ragged FeatureList features. | | `[FeatureListRaggedValueTypes](#structtensorflow_1_1ops_1_1_parse_sequence_example_v2_1_1_attrs_1ad58741ff00caed17add998b1d55f1977)(const DataTypeSlice & x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_parse_sequence_example_v2_1_1_attrs)` RaggedTensor.value dtypes for the ragged FeatureList features. | | `[FeatureListSparseTypes](#structtensorflow_1_1ops_1_1_parse_sequence_example_v2_1_1_attrs_1aef4c3b08ba2c7ba690b5b3b483dd10ed)(const DataTypeSlice & x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_parse_sequence_example_v2_1_1_attrs)` A list of Nfeature\_list\_sparse types; the data types of data in each FeatureList given in feature\_list\_sparse\_keys. | | `[NcontextSparse](#structtensorflow_1_1ops_1_1_parse_sequence_example_v2_1_1_attrs_1a25feab4daf3d0e468b6e7e608e3f4237)(int64 x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_parse_sequence_example_v2_1_1_attrs)` Defaults to 0. | | `[NfeatureListDense](#structtensorflow_1_1ops_1_1_parse_sequence_example_v2_1_1_attrs_1a63c455d1d852dff7dce1799d28b2428a)(int64 x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_parse_sequence_example_v2_1_1_attrs)` Defaults to 0. | | `[NfeatureListSparse](#structtensorflow_1_1ops_1_1_parse_sequence_example_v2_1_1_attrs_1a3726c5e7bfdf5f996c400e296c0ede5a)(int64 x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_parse_sequence_example_v2_1_1_attrs)` Defaults to 0. | Public attributes ----------------- ### Ncontext\_sparse\_ ``` int64 tensorflow::ops::ParseSequenceExampleV2::Attrs::Ncontext_sparse_ = 0 ``` ### Nfeature\_list\_dense\_ ``` int64 tensorflow::ops::ParseSequenceExampleV2::Attrs::Nfeature_list_dense_ = 0 ``` ### Nfeature\_list\_sparse\_ ``` int64 tensorflow::ops::ParseSequenceExampleV2::Attrs::Nfeature_list_sparse_ = 0 ``` ### context\_dense\_shapes\_ ``` gtl::ArraySlice< PartialTensorShape > tensorflow::ops::ParseSequenceExampleV2::Attrs::context_dense_shapes_ = {} ``` ### context\_ragged\_split\_types\_ ``` DataTypeSlice tensorflow::ops::ParseSequenceExampleV2::Attrs::context_ragged_split_types_ = {} ``` ### context\_ragged\_value\_types\_ ``` DataTypeSlice tensorflow::ops::ParseSequenceExampleV2::Attrs::context_ragged_value_types_ = {} ``` ### context\_sparse\_types\_ ``` DataTypeSlice tensorflow::ops::ParseSequenceExampleV2::Attrs::context_sparse_types_ = {} ``` ### feature\_list\_dense\_shapes\_ ``` gtl::ArraySlice< PartialTensorShape > tensorflow::ops::ParseSequenceExampleV2::Attrs::feature_list_dense_shapes_ = {} ``` ### feature\_list\_dense\_types\_ ``` DataTypeSlice tensorflow::ops::ParseSequenceExampleV2::Attrs::feature_list_dense_types_ = {} ``` ### feature\_list\_ragged\_split\_types\_ ``` DataTypeSlice tensorflow::ops::ParseSequenceExampleV2::Attrs::feature_list_ragged_split_types_ = {} ``` ### feature\_list\_ragged\_value\_types\_ ``` DataTypeSlice tensorflow::ops::ParseSequenceExampleV2::Attrs::feature_list_ragged_value_types_ = {} ``` ### feature\_list\_sparse\_types\_ ``` DataTypeSlice tensorflow::ops::ParseSequenceExampleV2::Attrs::feature_list_sparse_types_ = {} ``` Public functions ---------------- ### ContextDenseShapes ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::ParseSequenceExampleV2::Attrs::ContextDenseShapes( const gtl::ArraySlice< PartialTensorShape > & x ) ``` A list of Ncontext\_dense shapes; the shapes of data in each context Feature given in context\_dense\_keys. The number of elements in the Feature corresponding to context\_dense\_key[j] must always equal context\_dense\_shapes[j].NumEntries(). The shape of context\_dense\_values[j] will match context\_dense\_shapes[j]. Defaults to [] ### ContextRaggedSplitTypes ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::ParseSequenceExampleV2::Attrs::ContextRaggedSplitTypes( const DataTypeSlice & x ) ``` RaggedTensor.row\_split dtypes for the ragged context features. Defaults to [] ### ContextRaggedValueTypes ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::ParseSequenceExampleV2::Attrs::ContextRaggedValueTypes( const DataTypeSlice & x ) ``` RaggedTensor.value dtypes for the ragged context features. Defaults to [] ### ContextSparseTypes ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::ParseSequenceExampleV2::Attrs::ContextSparseTypes( const DataTypeSlice & x ) ``` A list of Ncontext\_sparse types; the data types of data in each context Feature given in context\_sparse\_keys. Currently the [ParseSingleSequenceExample](../../../../class/tensorflow/ops/parse-single-sequence-example#classtensorflow_1_1ops_1_1_parse_single_sequence_example) supports DT\_FLOAT (FloatList), DT\_INT64 (Int64List), and DT\_STRING (BytesList). Defaults to [] ### FeatureListDenseShapes ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::ParseSequenceExampleV2::Attrs::FeatureListDenseShapes( const gtl::ArraySlice< PartialTensorShape > & x ) ``` A list of Nfeature\_list\_dense shapes; the shapes of data in each FeatureList given in feature\_list\_dense\_keys. The shape of each Feature in the FeatureList corresponding to feature\_list\_dense\_key[j] must always equal feature\_list\_dense\_shapes[j].NumEntries(). Defaults to [] ### FeatureListDenseTypes ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::ParseSequenceExampleV2::Attrs::FeatureListDenseTypes( const DataTypeSlice & x ) ``` Defaults to []. ### FeatureListRaggedSplitTypes ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::ParseSequenceExampleV2::Attrs::FeatureListRaggedSplitTypes( const DataTypeSlice & x ) ``` RaggedTensor.row\_split dtypes for the ragged FeatureList features. Defaults to [] ### FeatureListRaggedValueTypes ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::ParseSequenceExampleV2::Attrs::FeatureListRaggedValueTypes( const DataTypeSlice & x ) ``` RaggedTensor.value dtypes for the ragged FeatureList features. Defaults to [] ### FeatureListSparseTypes ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::ParseSequenceExampleV2::Attrs::FeatureListSparseTypes( const DataTypeSlice & x ) ``` A list of Nfeature\_list\_sparse types; the data types of data in each FeatureList given in feature\_list\_sparse\_keys. Currently the [ParseSingleSequenceExample](../../../../class/tensorflow/ops/parse-single-sequence-example#classtensorflow_1_1ops_1_1_parse_single_sequence_example) supports DT\_FLOAT (FloatList), DT\_INT64 (Int64List), and DT\_STRING (BytesList). Defaults to [] ### NcontextSparse ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::ParseSequenceExampleV2::Attrs::NcontextSparse( int64 x ) ``` Defaults to 0. ### NfeatureListDense ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::ParseSequenceExampleV2::Attrs::NfeatureListDense( int64 x ) ``` Defaults to 0. ### NfeatureListSparse ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::ParseSequenceExampleV2::Attrs::NfeatureListSparse( int64 x ) ``` Defaults to 0.
programming_docs
tensorflow_cpp tensorflow::ops::OrderedMapSize::Attrs tensorflow::ops::OrderedMapSize::Attrs ====================================== `#include <data_flow_ops.h>` Optional attribute setters for [OrderedMapSize](../../../../class/tensorflow/ops/ordered-map-size#classtensorflow_1_1ops_1_1_ordered_map_size). Summary ------- | Public attributes | | --- | | `[capacity\_](#structtensorflow_1_1ops_1_1_ordered_map_size_1_1_attrs_1a5d65f2f9871e8d1b79384ef5608d7364) = 0` | `int64` | | `[container\_](#structtensorflow_1_1ops_1_1_ordered_map_size_1_1_attrs_1acabc4f91bad918a60b65cebf1151a0af) = ""` | `StringPiece` | | `[memory\_limit\_](#structtensorflow_1_1ops_1_1_ordered_map_size_1_1_attrs_1abf27c4aef904f32fdfa448b4600de130) = 0` | `int64` | | `[shared\_name\_](#structtensorflow_1_1ops_1_1_ordered_map_size_1_1_attrs_1a731f61a66999a5d1ca856c15d1a00c64) = ""` | `StringPiece` | | Public functions | | --- | | `[Capacity](#structtensorflow_1_1ops_1_1_ordered_map_size_1_1_attrs_1a040e158e9699dbf298b47349a4d18de2)(int64 x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_ordered_map_size_1_1_attrs)` Defaults to 0. | | `[Container](#structtensorflow_1_1ops_1_1_ordered_map_size_1_1_attrs_1a76576bccd0b074b032a2466e96fdca3d)(StringPiece x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_ordered_map_size_1_1_attrs)` Defaults to "". | | `[MemoryLimit](#structtensorflow_1_1ops_1_1_ordered_map_size_1_1_attrs_1a37c546006297ae255b5d346367b6d358)(int64 x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_ordered_map_size_1_1_attrs)` Defaults to 0. | | `[SharedName](#structtensorflow_1_1ops_1_1_ordered_map_size_1_1_attrs_1aacbe12770f5a92bf1507050e252c2e8e)(StringPiece x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_ordered_map_size_1_1_attrs)` Defaults to "". | Public attributes ----------------- ### capacity\_ ``` int64 tensorflow::ops::OrderedMapSize::Attrs::capacity_ = 0 ``` ### container\_ ``` StringPiece tensorflow::ops::OrderedMapSize::Attrs::container_ = "" ``` ### memory\_limit\_ ``` int64 tensorflow::ops::OrderedMapSize::Attrs::memory_limit_ = 0 ``` ### shared\_name\_ ``` StringPiece tensorflow::ops::OrderedMapSize::Attrs::shared_name_ = "" ``` Public functions ---------------- ### Capacity ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::OrderedMapSize::Attrs::Capacity( int64 x ) ``` Defaults to 0. ### Container ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::OrderedMapSize::Attrs::Container( StringPiece x ) ``` Defaults to "". ### MemoryLimit ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::OrderedMapSize::Attrs::MemoryLimit( int64 x ) ``` Defaults to 0. ### SharedName ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::OrderedMapSize::Attrs::SharedName( StringPiece x ) ``` Defaults to "". tensorflow_cpp tensorflow::ops::Abort::Attrs tensorflow::ops::Abort::Attrs ============================= `#include <control_flow_ops.h>` Optional attribute setters for [Abort](../../../../class/tensorflow/ops/abort#classtensorflow_1_1ops_1_1_abort). Summary ------- | Public attributes | | --- | | `[error\_msg\_](#structtensorflow_1_1ops_1_1_abort_1_1_attrs_1a8e6778ce0cc69ac4c93f8487b050178b) = ""` | `StringPiece` | | `[exit\_without\_error\_](#structtensorflow_1_1ops_1_1_abort_1_1_attrs_1af8b1af887b1e0ee0a1700b63a6bbb0ed) = false` | `bool` | | Public functions | | --- | | `[ErrorMsg](#structtensorflow_1_1ops_1_1_abort_1_1_attrs_1a70ea437886112efadb8d0bc28610166b)(StringPiece x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_abort_1_1_attrs)` A string which is the message associated with the exception. | | `[ExitWithoutError](#structtensorflow_1_1ops_1_1_abort_1_1_attrs_1abf792ac0d80e8bbe8cac55b0b54cdf9a)(bool x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_abort_1_1_attrs)` Defaults to false. | Public attributes ----------------- ### error\_msg\_ ``` StringPiece tensorflow::ops::Abort::Attrs::error_msg_ = "" ``` ### exit\_without\_error\_ ``` bool tensorflow::ops::Abort::Attrs::exit_without_error_ = false ``` Public functions ---------------- ### ErrorMsg ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::Abort::Attrs::ErrorMsg( StringPiece x ) ``` A string which is the message associated with the exception. Defaults to "" ### ExitWithoutError ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::Abort::Attrs::ExitWithoutError( bool x ) ``` Defaults to false. tensorflow_cpp tensorflow::ops::ResourceSparseApplyProximalGradientDescent::Attrs tensorflow::ops::ResourceSparseApplyProximalGradientDescent::Attrs ================================================================== `#include <training_ops.h>` Optional attribute setters for [ResourceSparseApplyProximalGradientDescent](../../../../class/tensorflow/ops/resource-sparse-apply-proximal-gradient-descent#classtensorflow_1_1ops_1_1_resource_sparse_apply_proximal_gradient_descent). Summary ------- | Public attributes | | --- | | `[use\_locking\_](#structtensorflow_1_1ops_1_1_resource_sparse_apply_proximal_gradient_descent_1_1_attrs_1a303c6b7abf0bfa5f4fc2e71b2fa76a4b) = false` | `bool` | | Public functions | | --- | | `[UseLocking](#structtensorflow_1_1ops_1_1_resource_sparse_apply_proximal_gradient_descent_1_1_attrs_1aef913531b93329777337d17a7a4f122c)(bool x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_resource_sparse_apply_proximal_gradient_descent_1_1_attrs)` If True, the subtraction will be protected by a lock; otherwise the behavior is undefined, but may exhibit less contention. | Public attributes ----------------- ### use\_locking\_ ``` bool tensorflow::ops::ResourceSparseApplyProximalGradientDescent::Attrs::use_locking_ = false ``` Public functions ---------------- ### UseLocking ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::ResourceSparseApplyProximalGradientDescent::Attrs::UseLocking( bool x ) ``` If True, the subtraction will be protected by a lock; otherwise the behavior is undefined, but may exhibit less contention. Defaults to false tensorflow_cpp tensorflow::ops::Cumprod::Attrs tensorflow::ops::Cumprod::Attrs =============================== `#include <math_ops.h>` Optional attribute setters for [Cumprod](../../../../class/tensorflow/ops/cumprod#classtensorflow_1_1ops_1_1_cumprod). Summary ------- | Public attributes | | --- | | `[exclusive\_](#structtensorflow_1_1ops_1_1_cumprod_1_1_attrs_1a1aac7f14c117364fa5964a3a1067c21d) = false` | `bool` | | `[reverse\_](#structtensorflow_1_1ops_1_1_cumprod_1_1_attrs_1a02f9a120a0bfcc2e9bbd506814e208a9) = false` | `bool` | | Public functions | | --- | | `[Exclusive](#structtensorflow_1_1ops_1_1_cumprod_1_1_attrs_1a4ce0968439a08cb7d03eea5a573fbba0)(bool x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_cumprod_1_1_attrs)` If `True`, perform exclusive cumprod. | | `[Reverse](#structtensorflow_1_1ops_1_1_cumprod_1_1_attrs_1af5c1b8fad1a80c60df04bb9de8d02054)(bool x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_cumprod_1_1_attrs)` A `bool` (default: False). | Public attributes ----------------- ### exclusive\_ ``` bool tensorflow::ops::Cumprod::Attrs::exclusive_ = false ``` ### reverse\_ ``` bool tensorflow::ops::Cumprod::Attrs::reverse_ = false ``` Public functions ---------------- ### Exclusive ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::Cumprod::Attrs::Exclusive( bool x ) ``` If `True`, perform exclusive cumprod. Defaults to false ### Reverse ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::Cumprod::Attrs::Reverse( bool x ) ``` A `bool` (default: False). Defaults to false tensorflow_cpp tensorflow::ops::SparseApplyProximalGradientDescent::Attrs tensorflow::ops::SparseApplyProximalGradientDescent::Attrs ========================================================== `#include <training_ops.h>` Optional attribute setters for [SparseApplyProximalGradientDescent](../../../../class/tensorflow/ops/sparse-apply-proximal-gradient-descent#classtensorflow_1_1ops_1_1_sparse_apply_proximal_gradient_descent). Summary ------- | Public attributes | | --- | | `[use\_locking\_](#structtensorflow_1_1ops_1_1_sparse_apply_proximal_gradient_descent_1_1_attrs_1a6542259402e01d96097e6c4c1298c1ef) = false` | `bool` | | Public functions | | --- | | `[UseLocking](#structtensorflow_1_1ops_1_1_sparse_apply_proximal_gradient_descent_1_1_attrs_1a38a235c3d769285aee3b7a0c939df684)(bool x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_sparse_apply_proximal_gradient_descent_1_1_attrs)` If True, the subtraction will be protected by a lock; otherwise the behavior is undefined, but may exhibit less contention. | Public attributes ----------------- ### use\_locking\_ ``` bool tensorflow::ops::SparseApplyProximalGradientDescent::Attrs::use_locking_ = false ``` Public functions ---------------- ### UseLocking ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::SparseApplyProximalGradientDescent::Attrs::UseLocking( bool x ) ``` If True, the subtraction will be protected by a lock; otherwise the behavior is undefined, but may exhibit less contention. Defaults to false tensorflow_cpp tensorflow::ops::TopK::Attrs tensorflow::ops::TopK::Attrs ============================ `#include <nn_ops.h>` Optional attribute setters for [TopK](../../../../class/tensorflow/ops/top-k#classtensorflow_1_1ops_1_1_top_k). Summary ------- | Public attributes | | --- | | `[sorted\_](#structtensorflow_1_1ops_1_1_top_k_1_1_attrs_1abbbe7daa73e35807a6e801d71818d7d6) = true` | `bool` | | Public functions | | --- | | `[Sorted](#structtensorflow_1_1ops_1_1_top_k_1_1_attrs_1ae56fc99e004be4f8fc11ecaefb1bedc4)(bool x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_top_k_1_1_attrs)` If true the resulting `k` elements will be sorted by the values in descending order. | Public attributes ----------------- ### sorted\_ ``` bool tensorflow::ops::TopK::Attrs::sorted_ = true ``` Public functions ---------------- ### Sorted ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::TopK::Attrs::Sorted( bool x ) ``` If true the resulting `k` elements will be sorted by the values in descending order. Defaults to true tensorflow_cpp tensorflow::ops::DecodeRaw::Attrs tensorflow::ops::DecodeRaw::Attrs ================================= `#include <parsing_ops.h>` Optional attribute setters for [DecodeRaw](../../../../class/tensorflow/ops/decode-raw#classtensorflow_1_1ops_1_1_decode_raw). Summary ------- | Public attributes | | --- | | `[little\_endian\_](#structtensorflow_1_1ops_1_1_decode_raw_1_1_attrs_1aed7aa1275ffc8c2e6ba4f3eeea8f1e4c) = true` | `bool` | | Public functions | | --- | | `[LittleEndian](#structtensorflow_1_1ops_1_1_decode_raw_1_1_attrs_1a789c8bb2340a650d5d347861774b257a)(bool x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_decode_raw_1_1_attrs)` Whether the input `bytes` are in little-endian order. | Public attributes ----------------- ### little\_endian\_ ``` bool tensorflow::ops::DecodeRaw::Attrs::little_endian_ = true ``` Public functions ---------------- ### LittleEndian ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::DecodeRaw::Attrs::LittleEndian( bool x ) ``` Whether the input `bytes` are in little-endian order. Ignored for `out_type` values that are stored in a single byte like `uint8`. Defaults to true tensorflow_cpp tensorflow::ops::ResourceApplyGradientDescent::Attrs tensorflow::ops::ResourceApplyGradientDescent::Attrs ==================================================== `#include <training_ops.h>` Optional attribute setters for [ResourceApplyGradientDescent](../../../../class/tensorflow/ops/resource-apply-gradient-descent#classtensorflow_1_1ops_1_1_resource_apply_gradient_descent). Summary ------- | Public attributes | | --- | | `[use\_locking\_](#structtensorflow_1_1ops_1_1_resource_apply_gradient_descent_1_1_attrs_1a2157f74b6f4793d75c1b8caabf581787) = false` | `bool` | | Public functions | | --- | | `[UseLocking](#structtensorflow_1_1ops_1_1_resource_apply_gradient_descent_1_1_attrs_1a8fbdc538458c0fb02ff0150640cb6b95)(bool x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_resource_apply_gradient_descent_1_1_attrs)` If `True`, the subtraction will be protected by a lock; otherwise the behavior is undefined, but may exhibit less contention. | Public attributes ----------------- ### use\_locking\_ ``` bool tensorflow::ops::ResourceApplyGradientDescent::Attrs::use_locking_ = false ``` Public functions ---------------- ### UseLocking ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::ResourceApplyGradientDescent::Attrs::UseLocking( bool x ) ``` If `True`, the subtraction will be protected by a lock; otherwise the behavior is undefined, but may exhibit less contention. Defaults to false tensorflow_cpp tensorflow::ops::ApplyAdagrad::Attrs tensorflow::ops::ApplyAdagrad::Attrs ==================================== `#include <training_ops.h>` Optional attribute setters for [ApplyAdagrad](../../../../class/tensorflow/ops/apply-adagrad#classtensorflow_1_1ops_1_1_apply_adagrad). Summary ------- | Public attributes | | --- | | `[update\_slots\_](#structtensorflow_1_1ops_1_1_apply_adagrad_1_1_attrs_1aecda1103e1bf5f24ac4a5e9e2db415f0) = true` | `bool` | | `[use\_locking\_](#structtensorflow_1_1ops_1_1_apply_adagrad_1_1_attrs_1a2cebeba0955b69f811c261fc26775150) = false` | `bool` | | Public functions | | --- | | `[UpdateSlots](#structtensorflow_1_1ops_1_1_apply_adagrad_1_1_attrs_1abe5a543d87b9a4dafbb5bb432ef64eae)(bool x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_apply_adagrad_1_1_attrs)` Defaults to true. | | `[UseLocking](#structtensorflow_1_1ops_1_1_apply_adagrad_1_1_attrs_1a2570b9f7d1714e9207dde42c62d1e25f)(bool x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_apply_adagrad_1_1_attrs)` If `True`, updating of the var and accum tensors will be protected by a lock; otherwise the behavior is undefined, but may exhibit less contention. | Public attributes ----------------- ### update\_slots\_ ``` bool tensorflow::ops::ApplyAdagrad::Attrs::update_slots_ = true ``` ### use\_locking\_ ``` bool tensorflow::ops::ApplyAdagrad::Attrs::use_locking_ = false ``` Public functions ---------------- ### UpdateSlots ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::ApplyAdagrad::Attrs::UpdateSlots( bool x ) ``` Defaults to true. ### UseLocking ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::ApplyAdagrad::Attrs::UseLocking( bool x ) ``` If `True`, updating of the var and accum tensors will be protected by a lock; otherwise the behavior is undefined, but may exhibit less contention. Defaults to false tensorflow_cpp tensorflow::ops::ResourceApplyProximalAdagrad::Attrs tensorflow::ops::ResourceApplyProximalAdagrad::Attrs ==================================================== `#include <training_ops.h>` Optional attribute setters for [ResourceApplyProximalAdagrad](../../../../class/tensorflow/ops/resource-apply-proximal-adagrad#classtensorflow_1_1ops_1_1_resource_apply_proximal_adagrad). Summary ------- | Public attributes | | --- | | `[use\_locking\_](#structtensorflow_1_1ops_1_1_resource_apply_proximal_adagrad_1_1_attrs_1ad33562b1fd1cec928e47592ec43c28f6) = false` | `bool` | | Public functions | | --- | | `[UseLocking](#structtensorflow_1_1ops_1_1_resource_apply_proximal_adagrad_1_1_attrs_1abb6642d6b0dcba45be097c232b59842a)(bool x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_resource_apply_proximal_adagrad_1_1_attrs)` If True, updating of the var and accum tensors will be protected by a lock; otherwise the behavior is undefined, but may exhibit less contention. | Public attributes ----------------- ### use\_locking\_ ``` bool tensorflow::ops::ResourceApplyProximalAdagrad::Attrs::use_locking_ = false ``` Public functions ---------------- ### UseLocking ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::ResourceApplyProximalAdagrad::Attrs::UseLocking( bool x ) ``` If True, updating of the var and accum tensors will be protected by a lock; otherwise the behavior is undefined, but may exhibit less contention. Defaults to false tensorflow_cpp tensorflow::ops::MapClear::Attrs tensorflow::ops::MapClear::Attrs ================================ `#include <data_flow_ops.h>` Optional attribute setters for [MapClear](../../../../class/tensorflow/ops/map-clear#classtensorflow_1_1ops_1_1_map_clear). Summary ------- | Public attributes | | --- | | `[capacity\_](#structtensorflow_1_1ops_1_1_map_clear_1_1_attrs_1addaef8a1832788188c1afbbe2b7c7fdf) = 0` | `int64` | | `[container\_](#structtensorflow_1_1ops_1_1_map_clear_1_1_attrs_1a7e0c2814ab59875a34faf58a86b9a592) = ""` | `StringPiece` | | `[memory\_limit\_](#structtensorflow_1_1ops_1_1_map_clear_1_1_attrs_1a67f4312939b6b36ad3c644ab44f6ebfe) = 0` | `int64` | | `[shared\_name\_](#structtensorflow_1_1ops_1_1_map_clear_1_1_attrs_1a16831638f0c760189014986c76ede921) = ""` | `StringPiece` | | Public functions | | --- | | `[Capacity](#structtensorflow_1_1ops_1_1_map_clear_1_1_attrs_1a3bd03e726b87593089f7b64ceaef234d)(int64 x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_map_clear_1_1_attrs)` Defaults to 0. | | `[Container](#structtensorflow_1_1ops_1_1_map_clear_1_1_attrs_1acbf54ca362728d93d8c9f22bebbf29c6)(StringPiece x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_map_clear_1_1_attrs)` Defaults to "". | | `[MemoryLimit](#structtensorflow_1_1ops_1_1_map_clear_1_1_attrs_1aa34063ecf42ca49b52e795f964e6733e)(int64 x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_map_clear_1_1_attrs)` Defaults to 0. | | `[SharedName](#structtensorflow_1_1ops_1_1_map_clear_1_1_attrs_1ae6d3cc3416c66b9f35eee287e5f10046)(StringPiece x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_map_clear_1_1_attrs)` Defaults to "". | Public attributes ----------------- ### capacity\_ ``` int64 tensorflow::ops::MapClear::Attrs::capacity_ = 0 ``` ### container\_ ``` StringPiece tensorflow::ops::MapClear::Attrs::container_ = "" ``` ### memory\_limit\_ ``` int64 tensorflow::ops::MapClear::Attrs::memory_limit_ = 0 ``` ### shared\_name\_ ``` StringPiece tensorflow::ops::MapClear::Attrs::shared_name_ = "" ``` Public functions ---------------- ### Capacity ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::MapClear::Attrs::Capacity( int64 x ) ``` Defaults to 0. ### Container ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::MapClear::Attrs::Container( StringPiece x ) ``` Defaults to "". ### MemoryLimit ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::MapClear::Attrs::MemoryLimit( int64 x ) ``` Defaults to 0. ### SharedName ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::MapClear::Attrs::SharedName( StringPiece x ) ``` Defaults to "". tensorflow_cpp tensorflow::ops::UniformCandidateSampler::Attrs tensorflow::ops::UniformCandidateSampler::Attrs =============================================== `#include <candidate_sampling_ops.h>` Optional attribute setters for [UniformCandidateSampler](../../../../class/tensorflow/ops/uniform-candidate-sampler#classtensorflow_1_1ops_1_1_uniform_candidate_sampler). Summary ------- | Public attributes | | --- | | `[seed2\_](#structtensorflow_1_1ops_1_1_uniform_candidate_sampler_1_1_attrs_1ad12d6aeba80f1d7b9377cf01ff1f6023) = 0` | `int64` | | `[seed\_](#structtensorflow_1_1ops_1_1_uniform_candidate_sampler_1_1_attrs_1ae3e12595a5e546d6b99d2da8be2c2ac9) = 0` | `int64` | | Public functions | | --- | | `[Seed](#structtensorflow_1_1ops_1_1_uniform_candidate_sampler_1_1_attrs_1ad8168ba9cd9ea3cabb9adecdb8b83303)(int64 x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_uniform_candidate_sampler_1_1_attrs)` If either seed or seed2 are set to be non-zero, the random number generator is seeded by the given seed. | | `[Seed2](#structtensorflow_1_1ops_1_1_uniform_candidate_sampler_1_1_attrs_1a8db47fe169f1f7b3b7141fd6b00dfad9)(int64 x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_uniform_candidate_sampler_1_1_attrs)` An second seed to avoid seed collision. | Public attributes ----------------- ### seed2\_ ``` int64 tensorflow::ops::UniformCandidateSampler::Attrs::seed2_ = 0 ``` ### seed\_ ``` int64 tensorflow::ops::UniformCandidateSampler::Attrs::seed_ = 0 ``` Public functions ---------------- ### Seed ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::UniformCandidateSampler::Attrs::Seed( int64 x ) ``` If either seed or seed2 are set to be non-zero, the random number generator is seeded by the given seed. Otherwise, it is seeded by a random seed. Defaults to 0 ### Seed2 ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::UniformCandidateSampler::Attrs::Seed2( int64 x ) ``` An second seed to avoid seed collision. Defaults to 0
programming_docs
tensorflow_cpp tensorflow::ops::Gather::Attrs tensorflow::ops::Gather::Attrs ============================== `#include <array_ops.h>` Optional attribute setters for [Gather](../../../../class/tensorflow/ops/gather#classtensorflow_1_1ops_1_1_gather). Summary ------- | Public attributes | | --- | | `[validate\_indices\_](#structtensorflow_1_1ops_1_1_gather_1_1_attrs_1a25d64e28800785c41fb7a7bffb70c642) = true` | `bool` | | Public functions | | --- | | `[ValidateIndices](#structtensorflow_1_1ops_1_1_gather_1_1_attrs_1a35d2caff6e4841c512b30491f857d41a)(bool x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_gather_1_1_attrs)` Defaults to true. | Public attributes ----------------- ### validate\_indices\_ ``` bool tensorflow::ops::Gather::Attrs::validate_indices_ = true ``` Public functions ---------------- ### ValidateIndices ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::Gather::Attrs::ValidateIndices( bool x ) ``` Defaults to true. tensorflow_cpp tensorflow::ops::ResourceSparseApplyCenteredRMSProp::Attrs tensorflow::ops::ResourceSparseApplyCenteredRMSProp::Attrs ========================================================== `#include <training_ops.h>` Optional attribute setters for [ResourceSparseApplyCenteredRMSProp](../../../../class/tensorflow/ops/resource-sparse-apply-centered-r-m-s-prop#classtensorflow_1_1ops_1_1_resource_sparse_apply_centered_r_m_s_prop). Summary ------- | Public attributes | | --- | | `[use\_locking\_](#structtensorflow_1_1ops_1_1_resource_sparse_apply_centered_r_m_s_prop_1_1_attrs_1a9d25db3148c35d863e3bfc3c5137fc82) = false` | `bool` | | Public functions | | --- | | `[UseLocking](#structtensorflow_1_1ops_1_1_resource_sparse_apply_centered_r_m_s_prop_1_1_attrs_1ab4a4774c086a0ff83fa92994d264f3ce)(bool x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_resource_sparse_apply_centered_r_m_s_prop_1_1_attrs)` If `True`, updating of the var, mg, ms, and mom tensors is protected by a lock; otherwise the behavior is undefined, but may exhibit less contention. | Public attributes ----------------- ### use\_locking\_ ``` bool tensorflow::ops::ResourceSparseApplyCenteredRMSProp::Attrs::use_locking_ = false ``` Public functions ---------------- ### UseLocking ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::ResourceSparseApplyCenteredRMSProp::Attrs::UseLocking( bool x ) ``` If `True`, updating of the var, mg, ms, and mom tensors is protected by a lock; otherwise the behavior is undefined, but may exhibit less contention. Defaults to false tensorflow_cpp tensorflow::ops::ResourceApplyFtrlV2::Attrs tensorflow::ops::ResourceApplyFtrlV2::Attrs =========================================== `#include <training_ops.h>` Optional attribute setters for [ResourceApplyFtrlV2](../../../../class/tensorflow/ops/resource-apply-ftrl-v2#classtensorflow_1_1ops_1_1_resource_apply_ftrl_v2). Summary ------- | Public attributes | | --- | | `[multiply\_linear\_by\_lr\_](#structtensorflow_1_1ops_1_1_resource_apply_ftrl_v2_1_1_attrs_1ab001017fa488a9b92e63d49efd584932) = false` | `bool` | | `[use\_locking\_](#structtensorflow_1_1ops_1_1_resource_apply_ftrl_v2_1_1_attrs_1a41934d538cf5fe45b0f434b09841e8d1) = false` | `bool` | | Public functions | | --- | | `[MultiplyLinearByLr](#structtensorflow_1_1ops_1_1_resource_apply_ftrl_v2_1_1_attrs_1acaddc613e39e64b4ab9e0b70207b50fc)(bool x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_resource_apply_ftrl_v2_1_1_attrs)` Defaults to false. | | `[UseLocking](#structtensorflow_1_1ops_1_1_resource_apply_ftrl_v2_1_1_attrs_1a967da75cde4b3313a91da72c9de1a6c8)(bool x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_resource_apply_ftrl_v2_1_1_attrs)` If `True`, updating of the var and accum tensors will be protected by a lock; otherwise the behavior is undefined, but may exhibit less contention. | Public attributes ----------------- ### multiply\_linear\_by\_lr\_ ``` bool tensorflow::ops::ResourceApplyFtrlV2::Attrs::multiply_linear_by_lr_ = false ``` ### use\_locking\_ ``` bool tensorflow::ops::ResourceApplyFtrlV2::Attrs::use_locking_ = false ``` Public functions ---------------- ### MultiplyLinearByLr ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::ResourceApplyFtrlV2::Attrs::MultiplyLinearByLr( bool x ) ``` Defaults to false. ### UseLocking ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::ResourceApplyFtrlV2::Attrs::UseLocking( bool x ) ``` If `True`, updating of the var and accum tensors will be protected by a lock; otherwise the behavior is undefined, but may exhibit less contention. Defaults to false tensorflow_cpp tensorflow::ops::MapStage::Attrs tensorflow::ops::MapStage::Attrs ================================ `#include <data_flow_ops.h>` Optional attribute setters for [MapStage](../../../../class/tensorflow/ops/map-stage#classtensorflow_1_1ops_1_1_map_stage). Summary ------- | Public attributes | | --- | | `[capacity\_](#structtensorflow_1_1ops_1_1_map_stage_1_1_attrs_1a0b501a7c6f7f1163e8368705b9c4b74e) = 0` | `int64` | | `[container\_](#structtensorflow_1_1ops_1_1_map_stage_1_1_attrs_1a8b5b38512f118f218541ffae00c19309) = ""` | `StringPiece` | | `[memory\_limit\_](#structtensorflow_1_1ops_1_1_map_stage_1_1_attrs_1af093d42b5e45415eafd55517e1eb7a1b) = 0` | `int64` | | `[shared\_name\_](#structtensorflow_1_1ops_1_1_map_stage_1_1_attrs_1abff2ce1e5848ebdd91a38aa6412e6fa4) = ""` | `StringPiece` | | Public functions | | --- | | `[Capacity](#structtensorflow_1_1ops_1_1_map_stage_1_1_attrs_1ad916573ddc7a03c6f5e647beb6b61b8f)(int64 x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_map_stage_1_1_attrs)` [Maximum](../../../../class/tensorflow/ops/maximum#classtensorflow_1_1ops_1_1_maximum) number of elements in the Staging Area. | | `[Container](#structtensorflow_1_1ops_1_1_map_stage_1_1_attrs_1a35b8b396a306ebcbbba55d6b49bee6f2)(StringPiece x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_map_stage_1_1_attrs)` If non-empty, this queue is placed in the given container. | | `[MemoryLimit](#structtensorflow_1_1ops_1_1_map_stage_1_1_attrs_1ae5385eda305b349502491e6c799344df)(int64 x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_map_stage_1_1_attrs)` Defaults to 0. | | `[SharedName](#structtensorflow_1_1ops_1_1_map_stage_1_1_attrs_1abaa998b895a31f19681eab7e458ec781)(StringPiece x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_map_stage_1_1_attrs)` It is necessary to match this name to the matching [Unstage](../../../../class/tensorflow/ops/unstage#classtensorflow_1_1ops_1_1_unstage) Op. | Public attributes ----------------- ### capacity\_ ``` int64 tensorflow::ops::MapStage::Attrs::capacity_ = 0 ``` ### container\_ ``` StringPiece tensorflow::ops::MapStage::Attrs::container_ = "" ``` ### memory\_limit\_ ``` int64 tensorflow::ops::MapStage::Attrs::memory_limit_ = 0 ``` ### shared\_name\_ ``` StringPiece tensorflow::ops::MapStage::Attrs::shared_name_ = "" ``` Public functions ---------------- ### Capacity ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::MapStage::Attrs::Capacity( int64 x ) ``` [Maximum](../../../../class/tensorflow/ops/maximum#classtensorflow_1_1ops_1_1_maximum) number of elements in the Staging Area. If > 0, inserts on the container will block when the capacity is reached. Defaults to 0 ### Container ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::MapStage::Attrs::Container( StringPiece x ) ``` If non-empty, this queue is placed in the given container. Otherwise, a default container is used. Defaults to "" ### MemoryLimit ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::MapStage::Attrs::MemoryLimit( int64 x ) ``` Defaults to 0. ### SharedName ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::MapStage::Attrs::SharedName( StringPiece x ) ``` It is necessary to match this name to the matching [Unstage](../../../../class/tensorflow/ops/unstage#classtensorflow_1_1ops_1_1_unstage) Op. Defaults to "" tensorflow_cpp tensorflow::ops::MatrixSetDiagV3::Attrs tensorflow::ops::MatrixSetDiagV3::Attrs ======================================= `#include <array_ops.h>` Optional attribute setters for [MatrixSetDiagV3](../../../../class/tensorflow/ops/matrix-set-diag-v3#classtensorflow_1_1ops_1_1_matrix_set_diag_v3). Summary ------- | Public attributes | | --- | | `[align\_](#structtensorflow_1_1ops_1_1_matrix_set_diag_v3_1_1_attrs_1ab4717dd168a0bce9a9cf8e1c16f197a3) = "RIGHT_LEFT"` | `StringPiece` | | Public functions | | --- | | `[Align](#structtensorflow_1_1ops_1_1_matrix_set_diag_v3_1_1_attrs_1a752d915f79d47786183ec52d2c3e0b2e)(StringPiece x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_matrix_set_diag_v3_1_1_attrs)` Some diagonals are shorter than `max_diag_len` and need to be padded. | Public attributes ----------------- ### align\_ ``` StringPiece tensorflow::ops::MatrixSetDiagV3::Attrs::align_ = "RIGHT_LEFT" ``` Public functions ---------------- ### Align ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::MatrixSetDiagV3::Attrs::Align( StringPiece x ) ``` Some diagonals are shorter than `max_diag_len` and need to be padded. `align` is a string specifying how superdiagonals and subdiagonals should be aligned, respectively. There are four possible alignments: "RIGHT\_LEFT" (default), "LEFT\_RIGHT", "LEFT\_LEFT", and "RIGHT\_RIGHT". "RIGHT\_LEFT" aligns superdiagonals to the right (left-pads the row) and subdiagonals to the left (right-pads the row). It is the packing format LAPACK uses. cuSPARSE uses "LEFT\_RIGHT", which is the opposite alignment. Defaults to "RIGHT\_LEFT" tensorflow_cpp tensorflow::ops::WholeFileReader::Attrs tensorflow::ops::WholeFileReader::Attrs ======================================= `#include <io_ops.h>` Optional attribute setters for [WholeFileReader](../../../../class/tensorflow/ops/whole-file-reader#classtensorflow_1_1ops_1_1_whole_file_reader). Summary ------- | Public attributes | | --- | | `[container\_](#structtensorflow_1_1ops_1_1_whole_file_reader_1_1_attrs_1ab2be51d49964dfa075607f3bfb540fa1) = ""` | `StringPiece` | | `[shared\_name\_](#structtensorflow_1_1ops_1_1_whole_file_reader_1_1_attrs_1ab18cd1c5a421c4f6622515a46d204d22) = ""` | `StringPiece` | | Public functions | | --- | | `[Container](#structtensorflow_1_1ops_1_1_whole_file_reader_1_1_attrs_1ae951ae9d878ac1752b53321de8fd6ef5)(StringPiece x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_whole_file_reader_1_1_attrs)` If non-empty, this reader is placed in the given container. | | `[SharedName](#structtensorflow_1_1ops_1_1_whole_file_reader_1_1_attrs_1a6c1247f8cc0ac84a910e5577e2bc04de)(StringPiece x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_whole_file_reader_1_1_attrs)` If non-empty, this reader is named in the given bucket with this shared\_name. | Public attributes ----------------- ### container\_ ``` StringPiece tensorflow::ops::WholeFileReader::Attrs::container_ = "" ``` ### shared\_name\_ ``` StringPiece tensorflow::ops::WholeFileReader::Attrs::shared_name_ = "" ``` Public functions ---------------- ### Container ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::WholeFileReader::Attrs::Container( StringPiece x ) ``` If non-empty, this reader is placed in the given container. Otherwise, a default container is used. Defaults to "" ### SharedName ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::WholeFileReader::Attrs::SharedName( StringPiece x ) ``` If non-empty, this reader is named in the given bucket with this shared\_name. Otherwise, the node name is used instead. Defaults to "" tensorflow_cpp tensorflow::ops::ScatterNdUpdate::Attrs tensorflow::ops::ScatterNdUpdate::Attrs ======================================= `#include <state_ops.h>` Optional attribute setters for [ScatterNdUpdate](../../../../class/tensorflow/ops/scatter-nd-update#classtensorflow_1_1ops_1_1_scatter_nd_update). Summary ------- | Public attributes | | --- | | `[use\_locking\_](#structtensorflow_1_1ops_1_1_scatter_nd_update_1_1_attrs_1a3a2c58902fd0624668dd89d39af12477) = true` | `bool` | | Public functions | | --- | | `[UseLocking](#structtensorflow_1_1ops_1_1_scatter_nd_update_1_1_attrs_1a148eab98a186f8a4e7d6e64781de23e1)(bool x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_scatter_nd_update_1_1_attrs)` An optional bool. | Public attributes ----------------- ### use\_locking\_ ``` bool tensorflow::ops::ScatterNdUpdate::Attrs::use_locking_ = true ``` Public functions ---------------- ### UseLocking ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::ScatterNdUpdate::Attrs::UseLocking( bool x ) ``` An optional bool. Defaults to True. If True, the assignment will be protected by a lock; otherwise the behavior is undefined, but may exhibit less contention. Defaults to true tensorflow_cpp tensorflow::ops::FractionalAvgPool::Attrs tensorflow::ops::FractionalAvgPool::Attrs ========================================= `#include <nn_ops.h>` Optional attribute setters for [FractionalAvgPool](../../../../class/tensorflow/ops/fractional-avg-pool#classtensorflow_1_1ops_1_1_fractional_avg_pool). Summary ------- | Public attributes | | --- | | `[deterministic\_](#structtensorflow_1_1ops_1_1_fractional_avg_pool_1_1_attrs_1a61f280a9ce83539a26b89a4651db132c) = false` | `bool` | | `[overlapping\_](#structtensorflow_1_1ops_1_1_fractional_avg_pool_1_1_attrs_1a50e61bdb802b360a726be83b8660daad) = false` | `bool` | | `[pseudo\_random\_](#structtensorflow_1_1ops_1_1_fractional_avg_pool_1_1_attrs_1afac27e665631052f0b4f64af3ceefcfe) = false` | `bool` | | `[seed2\_](#structtensorflow_1_1ops_1_1_fractional_avg_pool_1_1_attrs_1a9faa5b56888e5aa067e9cc4e4ea0ff3a) = 0` | `int64` | | `[seed\_](#structtensorflow_1_1ops_1_1_fractional_avg_pool_1_1_attrs_1adda88abb2a9de85ca5971ef4315d9bb6) = 0` | `int64` | | Public functions | | --- | | `[Deterministic](#structtensorflow_1_1ops_1_1_fractional_avg_pool_1_1_attrs_1a873dc80042303bc7f645e56ebb80f7aa)(bool x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_fractional_avg_pool_1_1_attrs)` When set to True, a fixed pooling region will be used when iterating over a [FractionalAvgPool](../../../../class/tensorflow/ops/fractional-avg-pool#classtensorflow_1_1ops_1_1_fractional_avg_pool) node in the computation graph. | | `[Overlapping](#structtensorflow_1_1ops_1_1_fractional_avg_pool_1_1_attrs_1a4e52f1f09ad181656cef01b39205ed6e)(bool x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_fractional_avg_pool_1_1_attrs)` When set to True, it means when pooling, the values at the boundary of adjacent pooling cells are used by both cells. | | `[PseudoRandom](#structtensorflow_1_1ops_1_1_fractional_avg_pool_1_1_attrs_1ac235854793b77d8528a50eb19c7d3009)(bool x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_fractional_avg_pool_1_1_attrs)` When set to True, generates the pooling sequence in a pseudorandom fashion, otherwise, in a random fashion. | | `[Seed](#structtensorflow_1_1ops_1_1_fractional_avg_pool_1_1_attrs_1a44e0ebd8a59b50d13a18fcce75087c8c)(int64 x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_fractional_avg_pool_1_1_attrs)` If either seed or seed2 are set to be non-zero, the random number generator is seeded by the given seed. | | `[Seed2](#structtensorflow_1_1ops_1_1_fractional_avg_pool_1_1_attrs_1afc60d67272d3e8eea9e3da45b6b17d12)(int64 x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_fractional_avg_pool_1_1_attrs)` An second seed to avoid seed collision. | Public attributes ----------------- ### deterministic\_ ``` bool tensorflow::ops::FractionalAvgPool::Attrs::deterministic_ = false ``` ### overlapping\_ ``` bool tensorflow::ops::FractionalAvgPool::Attrs::overlapping_ = false ``` ### pseudo\_random\_ ``` bool tensorflow::ops::FractionalAvgPool::Attrs::pseudo_random_ = false ``` ### seed2\_ ``` int64 tensorflow::ops::FractionalAvgPool::Attrs::seed2_ = 0 ``` ### seed\_ ``` int64 tensorflow::ops::FractionalAvgPool::Attrs::seed_ = 0 ``` Public functions ---------------- ### Deterministic ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::FractionalAvgPool::Attrs::Deterministic( bool x ) ``` When set to True, a fixed pooling region will be used when iterating over a [FractionalAvgPool](../../../../class/tensorflow/ops/fractional-avg-pool#classtensorflow_1_1ops_1_1_fractional_avg_pool) node in the computation graph. Mainly used in unit test to make [FractionalAvgPool](../../../../class/tensorflow/ops/fractional-avg-pool#classtensorflow_1_1ops_1_1_fractional_avg_pool) deterministic. Defaults to false ### Overlapping ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::FractionalAvgPool::Attrs::Overlapping( bool x ) ``` When set to True, it means when pooling, the values at the boundary of adjacent pooling cells are used by both cells. For example: `index 0 1 2 3 4` `value 20 5 16 3 7` If the pooling sequence is [0, 2, 4], then 16, at index 2 will be used twice. The result would be [41/3, 26/3] for fractional avg pooling. Defaults to false ### PseudoRandom ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::FractionalAvgPool::Attrs::PseudoRandom( bool x ) ``` When set to True, generates the pooling sequence in a pseudorandom fashion, otherwise, in a random fashion. Check paper [Benjamin Graham, Fractional Max-Pooling](http://arxiv.org/abs/1412.6071) for difference between pseudorandom and random. Defaults to false ### Seed ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::FractionalAvgPool::Attrs::Seed( int64 x ) ``` If either seed or seed2 are set to be non-zero, the random number generator is seeded by the given seed. Otherwise, it is seeded by a random seed. Defaults to 0 ### Seed2 ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::FractionalAvgPool::Attrs::Seed2( int64 x ) ``` An second seed to avoid seed collision. Defaults to 0 tensorflow_cpp tensorflow::ops::MapUnstage::Attrs tensorflow::ops::MapUnstage::Attrs ================================== `#include <data_flow_ops.h>` Optional attribute setters for [MapUnstage](../../../../class/tensorflow/ops/map-unstage#classtensorflow_1_1ops_1_1_map_unstage). Summary ------- | Public attributes | | --- | | `[capacity\_](#structtensorflow_1_1ops_1_1_map_unstage_1_1_attrs_1a04c0f08a74bf65e48b49d53066560385) = 0` | `int64` | | `[container\_](#structtensorflow_1_1ops_1_1_map_unstage_1_1_attrs_1a24809d0b5e5ab843e4d18eeecf644b52) = ""` | `StringPiece` | | `[memory\_limit\_](#structtensorflow_1_1ops_1_1_map_unstage_1_1_attrs_1a36320da5b610dcaf6294e2dd779d3761) = 0` | `int64` | | `[shared\_name\_](#structtensorflow_1_1ops_1_1_map_unstage_1_1_attrs_1a354624444682c6eca3bef1b04df83089) = ""` | `StringPiece` | | Public functions | | --- | | `[Capacity](#structtensorflow_1_1ops_1_1_map_unstage_1_1_attrs_1a5e54aba96953fef07626a563001bc6e2)(int64 x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_map_unstage_1_1_attrs)` Defaults to 0. | | `[Container](#structtensorflow_1_1ops_1_1_map_unstage_1_1_attrs_1a8649ee4626dc190308d66ffb83e704cd)(StringPiece x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_map_unstage_1_1_attrs)` Defaults to "". | | `[MemoryLimit](#structtensorflow_1_1ops_1_1_map_unstage_1_1_attrs_1afc4371e35fd9efae3cd9a91038640b55)(int64 x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_map_unstage_1_1_attrs)` Defaults to 0. | | `[SharedName](#structtensorflow_1_1ops_1_1_map_unstage_1_1_attrs_1a2c454a6aeecb1e72c8bf9ae8a7a6c430)(StringPiece x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_map_unstage_1_1_attrs)` Defaults to "". | Public attributes ----------------- ### capacity\_ ``` int64 tensorflow::ops::MapUnstage::Attrs::capacity_ = 0 ``` ### container\_ ``` StringPiece tensorflow::ops::MapUnstage::Attrs::container_ = "" ``` ### memory\_limit\_ ``` int64 tensorflow::ops::MapUnstage::Attrs::memory_limit_ = 0 ``` ### shared\_name\_ ``` StringPiece tensorflow::ops::MapUnstage::Attrs::shared_name_ = "" ``` Public functions ---------------- ### Capacity ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::MapUnstage::Attrs::Capacity( int64 x ) ``` Defaults to 0. ### Container ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::MapUnstage::Attrs::Container( StringPiece x ) ``` Defaults to "". ### MemoryLimit ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::MapUnstage::Attrs::MemoryLimit( int64 x ) ``` Defaults to 0. ### SharedName ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::MapUnstage::Attrs::SharedName( StringPiece x ) ``` Defaults to "".
programming_docs
tensorflow_cpp tensorflow::ops::DecodePaddedRaw::Attrs tensorflow::ops::DecodePaddedRaw::Attrs ======================================= `#include <parsing_ops.h>` Optional attribute setters for [DecodePaddedRaw](../../../../class/tensorflow/ops/decode-padded-raw#classtensorflow_1_1ops_1_1_decode_padded_raw). Summary ------- | Public attributes | | --- | | `[little\_endian\_](#structtensorflow_1_1ops_1_1_decode_padded_raw_1_1_attrs_1ae00bfef25bd3cdf425bf664b5b3eb181) = true` | `bool` | | Public functions | | --- | | `[LittleEndian](#structtensorflow_1_1ops_1_1_decode_padded_raw_1_1_attrs_1a05585e099f21b7a529d6fded528d448c)(bool x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_decode_padded_raw_1_1_attrs)` Whether the input `input_bytes` is in little-endian order. | Public attributes ----------------- ### little\_endian\_ ``` bool tensorflow::ops::DecodePaddedRaw::Attrs::little_endian_ = true ``` Public functions ---------------- ### LittleEndian ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::DecodePaddedRaw::Attrs::LittleEndian( bool x ) ``` Whether the input `input_bytes` is in little-endian order. Ignored for `out_type` values that are stored in a single byte, like `uint8` Defaults to true tensorflow_cpp tensorflow::ops::DecodeCSV::Attrs tensorflow::ops::DecodeCSV::Attrs ================================= `#include <parsing_ops.h>` Optional attribute setters for [DecodeCSV](../../../../class/tensorflow/ops/decode-c-s-v#classtensorflow_1_1ops_1_1_decode_c_s_v). Summary ------- | Public attributes | | --- | | `[field\_delim\_](#structtensorflow_1_1ops_1_1_decode_c_s_v_1_1_attrs_1a49cd1cec281eb0fac9c7252a186b8d7a) = ","` | `StringPiece` | | `[na\_value\_](#structtensorflow_1_1ops_1_1_decode_c_s_v_1_1_attrs_1a9e014d2b608b63a21e70eac80e7af794) = ""` | `StringPiece` | | `[select\_cols\_](#structtensorflow_1_1ops_1_1_decode_c_s_v_1_1_attrs_1a26b3966da17b683a55de1150ef9013ae) = {}` | `gtl::ArraySlice< int >` | | `[use\_quote\_delim\_](#structtensorflow_1_1ops_1_1_decode_c_s_v_1_1_attrs_1ad65426c0581e0d6e4b564113365da483) = true` | `bool` | | Public functions | | --- | | `[FieldDelim](#structtensorflow_1_1ops_1_1_decode_c_s_v_1_1_attrs_1a14f27f9627ddcf636907b8a7c4d7246f)(StringPiece x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_decode_c_s_v_1_1_attrs)` char delimiter to separate fields in a record. | | `[NaValue](#structtensorflow_1_1ops_1_1_decode_c_s_v_1_1_attrs_1adbb0bb6b00e1eafd1e3ff12a74b965db)(StringPiece x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_decode_c_s_v_1_1_attrs)` Additional string to recognize as NA/NaN. | | `[SelectCols](#structtensorflow_1_1ops_1_1_decode_c_s_v_1_1_attrs_1aedde6357cd08b0eb7ef30b85022d0098)(const gtl::ArraySlice< int > & x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_decode_c_s_v_1_1_attrs)` Defaults to []. | | `[UseQuoteDelim](#structtensorflow_1_1ops_1_1_decode_c_s_v_1_1_attrs_1aecfb4b0c7731940997bf4b135dbe2b85)(bool x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_decode_c_s_v_1_1_attrs)` If false, treats double quotation marks as regular characters inside of the string fields (ignoring RFC 4180, Section 2, Bullet 5). | Public attributes ----------------- ### field\_delim\_ ``` StringPiece tensorflow::ops::DecodeCSV::Attrs::field_delim_ = "," ``` ### na\_value\_ ``` StringPiece tensorflow::ops::DecodeCSV::Attrs::na_value_ = "" ``` ### select\_cols\_ ``` gtl::ArraySlice< int > tensorflow::ops::DecodeCSV::Attrs::select_cols_ = {} ``` ### use\_quote\_delim\_ ``` bool tensorflow::ops::DecodeCSV::Attrs::use_quote_delim_ = true ``` Public functions ---------------- ### FieldDelim ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::DecodeCSV::Attrs::FieldDelim( StringPiece x ) ``` char delimiter to separate fields in a record. Defaults to "," ### NaValue ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::DecodeCSV::Attrs::NaValue( StringPiece x ) ``` Additional string to recognize as NA/NaN. Defaults to "" ### SelectCols ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::DecodeCSV::Attrs::SelectCols( const gtl::ArraySlice< int > & x ) ``` Defaults to []. ### UseQuoteDelim ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::DecodeCSV::Attrs::UseQuoteDelim( bool x ) ``` If false, treats double quotation marks as regular characters inside of the string fields (ignoring RFC 4180, Section 2, Bullet 5). Defaults to true tensorflow_cpp tensorflow::ops::SparseApplyAdagrad::Attrs tensorflow::ops::SparseApplyAdagrad::Attrs ========================================== `#include <training_ops.h>` Optional attribute setters for [SparseApplyAdagrad](../../../../class/tensorflow/ops/sparse-apply-adagrad#classtensorflow_1_1ops_1_1_sparse_apply_adagrad). Summary ------- | Public attributes | | --- | | `[update\_slots\_](#structtensorflow_1_1ops_1_1_sparse_apply_adagrad_1_1_attrs_1a9e93e769c55eae625e6b4bdc36a7d585) = true` | `bool` | | `[use\_locking\_](#structtensorflow_1_1ops_1_1_sparse_apply_adagrad_1_1_attrs_1a59092b5d065ea71aa92c93f3127a5a38) = false` | `bool` | | Public functions | | --- | | `[UpdateSlots](#structtensorflow_1_1ops_1_1_sparse_apply_adagrad_1_1_attrs_1ad5118d0ae824d6cdfd4eb05674c52afd)(bool x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_sparse_apply_adagrad_1_1_attrs)` Defaults to true. | | `[UseLocking](#structtensorflow_1_1ops_1_1_sparse_apply_adagrad_1_1_attrs_1a0b32a54c8cd4c6e5421808e6158e9624)(bool x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_sparse_apply_adagrad_1_1_attrs)` If `True`, updating of the var and accum tensors will be protected by a lock; otherwise the behavior is undefined, but may exhibit less contention. | Public attributes ----------------- ### update\_slots\_ ``` bool tensorflow::ops::SparseApplyAdagrad::Attrs::update_slots_ = true ``` ### use\_locking\_ ``` bool tensorflow::ops::SparseApplyAdagrad::Attrs::use_locking_ = false ``` Public functions ---------------- ### UpdateSlots ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::SparseApplyAdagrad::Attrs::UpdateSlots( bool x ) ``` Defaults to true. ### UseLocking ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::SparseApplyAdagrad::Attrs::UseLocking( bool x ) ``` If `True`, updating of the var and accum tensors will be protected by a lock; otherwise the behavior is undefined, but may exhibit less contention. Defaults to false tensorflow_cpp tensorflow::ops::DecodeAndCropJpeg::Attrs tensorflow::ops::DecodeAndCropJpeg::Attrs ========================================= `#include <image_ops.h>` Optional attribute setters for [DecodeAndCropJpeg](../../../../class/tensorflow/ops/decode-and-crop-jpeg#classtensorflow_1_1ops_1_1_decode_and_crop_jpeg). Summary ------- | Public attributes | | --- | | `[acceptable\_fraction\_](#structtensorflow_1_1ops_1_1_decode_and_crop_jpeg_1_1_attrs_1ade4565804d091b2ee9f3f71d7be3ffa2) = 1.0f` | `float` | | `[channels\_](#structtensorflow_1_1ops_1_1_decode_and_crop_jpeg_1_1_attrs_1afe18a96df41f5b94c222496dc5206368) = 0` | `int64` | | `[dct\_method\_](#structtensorflow_1_1ops_1_1_decode_and_crop_jpeg_1_1_attrs_1ab6a1537364211645118c52ac8b3e530e) = ""` | `StringPiece` | | `[fancy\_upscaling\_](#structtensorflow_1_1ops_1_1_decode_and_crop_jpeg_1_1_attrs_1a96af21097f175c4dca629887cdb8acf4) = true` | `bool` | | `[ratio\_](#structtensorflow_1_1ops_1_1_decode_and_crop_jpeg_1_1_attrs_1a09f5eb7adce68e4626c89ab197d0a9ce) = 1` | `int64` | | `[try\_recover\_truncated\_](#structtensorflow_1_1ops_1_1_decode_and_crop_jpeg_1_1_attrs_1ac266a7946265c4dc352d9d70e2259966) = false` | `bool` | | Public functions | | --- | | `[AcceptableFraction](#structtensorflow_1_1ops_1_1_decode_and_crop_jpeg_1_1_attrs_1a1b5661eb7517d6e8b0d137c216cde926)(float x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_decode_and_crop_jpeg_1_1_attrs)` The minimum required fraction of lines before a truncated input is accepted. | | `[Channels](#structtensorflow_1_1ops_1_1_decode_and_crop_jpeg_1_1_attrs_1a9a3c06e5dbbb9e8e7c13b293b2403268)(int64 x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_decode_and_crop_jpeg_1_1_attrs)` Number of color channels for the decoded image. | | `[DctMethod](#structtensorflow_1_1ops_1_1_decode_and_crop_jpeg_1_1_attrs_1a8d2f196496c30966160544ad10836e50)(StringPiece x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_decode_and_crop_jpeg_1_1_attrs)` string specifying a hint about the algorithm used for decompression. | | `[FancyUpscaling](#structtensorflow_1_1ops_1_1_decode_and_crop_jpeg_1_1_attrs_1aee3e9244f85e8b65014b5e036c4f7c0a)(bool x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_decode_and_crop_jpeg_1_1_attrs)` If true use a slower but nicer upscaling of the chroma planes (yuv420/422 only). | | `[Ratio](#structtensorflow_1_1ops_1_1_decode_and_crop_jpeg_1_1_attrs_1af03f99cbc3529d3f66d2c6c7b443216e)(int64 x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_decode_and_crop_jpeg_1_1_attrs)` Downscaling ratio. | | `[TryRecoverTruncated](#structtensorflow_1_1ops_1_1_decode_and_crop_jpeg_1_1_attrs_1a34f9a484aaa2188fc26ac919ee441dbd)(bool x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_decode_and_crop_jpeg_1_1_attrs)` If true try to recover an image from truncated input. | Public attributes ----------------- ### acceptable\_fraction\_ ``` float tensorflow::ops::DecodeAndCropJpeg::Attrs::acceptable_fraction_ = 1.0f ``` ### channels\_ ``` int64 tensorflow::ops::DecodeAndCropJpeg::Attrs::channels_ = 0 ``` ### dct\_method\_ ``` StringPiece tensorflow::ops::DecodeAndCropJpeg::Attrs::dct_method_ = "" ``` ### fancy\_upscaling\_ ``` bool tensorflow::ops::DecodeAndCropJpeg::Attrs::fancy_upscaling_ = true ``` ### ratio\_ ``` int64 tensorflow::ops::DecodeAndCropJpeg::Attrs::ratio_ = 1 ``` ### try\_recover\_truncated\_ ``` bool tensorflow::ops::DecodeAndCropJpeg::Attrs::try_recover_truncated_ = false ``` Public functions ---------------- ### AcceptableFraction ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::DecodeAndCropJpeg::Attrs::AcceptableFraction( float x ) ``` The minimum required fraction of lines before a truncated input is accepted. Defaults to 1 ### Channels ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::DecodeAndCropJpeg::Attrs::Channels( int64 x ) ``` Number of color channels for the decoded image. Defaults to 0 ### DctMethod ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::DecodeAndCropJpeg::Attrs::DctMethod( StringPiece x ) ``` string specifying a hint about the algorithm used for decompression. Defaults to "" which maps to a system-specific default. Currently valid values are ["INTEGER\_FAST", "INTEGER\_ACCURATE"]. The hint may be ignored (e.g., the internal jpeg library changes to a version that does not have that specific option.) Defaults to "" ### FancyUpscaling ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::DecodeAndCropJpeg::Attrs::FancyUpscaling( bool x ) ``` If true use a slower but nicer upscaling of the chroma planes (yuv420/422 only). Defaults to true ### Ratio ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::DecodeAndCropJpeg::Attrs::Ratio( int64 x ) ``` Downscaling ratio. Defaults to 1 ### TryRecoverTruncated ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::DecodeAndCropJpeg::Attrs::TryRecoverTruncated( bool x ) ``` If true try to recover an image from truncated input. Defaults to false tensorflow_cpp tensorflow::ops::RandomPoissonV2::Attrs tensorflow::ops::RandomPoissonV2::Attrs ======================================= `#include <random_ops.h>` Optional attribute setters for [RandomPoissonV2](../../../../class/tensorflow/ops/random-poisson-v2#classtensorflow_1_1ops_1_1_random_poisson_v2). Summary ------- | Public attributes | | --- | | `[dtype\_](#structtensorflow_1_1ops_1_1_random_poisson_v2_1_1_attrs_1af5e37fba5e53547e0571e7c80b8948b1) = DT_INT64` | `DataType` | | `[seed2\_](#structtensorflow_1_1ops_1_1_random_poisson_v2_1_1_attrs_1a2c85360598ed2650e65d38834219dfc4) = 0` | `int64` | | `[seed\_](#structtensorflow_1_1ops_1_1_random_poisson_v2_1_1_attrs_1ae90a1aba0a039f59fde8c789070ffe3c) = 0` | `int64` | | Public functions | | --- | | `[Dtype](#structtensorflow_1_1ops_1_1_random_poisson_v2_1_1_attrs_1a987ceae61e9b0d321f76d91ddac5447a)(DataType x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_random_poisson_v2_1_1_attrs)` Defaults to DT\_INT64. | | `[Seed](#structtensorflow_1_1ops_1_1_random_poisson_v2_1_1_attrs_1afefe4b2b95e899a44715c59de032a52e)(int64 x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_random_poisson_v2_1_1_attrs)` If either `seed` or `seed2` are set to be non-zero, the random number generator is seeded by the given seed. | | `[Seed2](#structtensorflow_1_1ops_1_1_random_poisson_v2_1_1_attrs_1aa06a1ff8926df75b128ec0764a912f99)(int64 x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_random_poisson_v2_1_1_attrs)` A second seed to avoid seed collision. | Public attributes ----------------- ### dtype\_ ``` DataType tensorflow::ops::RandomPoissonV2::Attrs::dtype_ = DT_INT64 ``` ### seed2\_ ``` int64 tensorflow::ops::RandomPoissonV2::Attrs::seed2_ = 0 ``` ### seed\_ ``` int64 tensorflow::ops::RandomPoissonV2::Attrs::seed_ = 0 ``` Public functions ---------------- ### Dtype ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::RandomPoissonV2::Attrs::Dtype( DataType x ) ``` Defaults to DT\_INT64. ### Seed ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::RandomPoissonV2::Attrs::Seed( int64 x ) ``` If either `seed` or `seed2` are set to be non-zero, the random number generator is seeded by the given seed. Otherwise, it is seeded by a random seed. Defaults to 0 ### Seed2 ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::RandomPoissonV2::Attrs::Seed2( int64 x ) ``` A second seed to avoid seed collision. Defaults to 0 tensorflow_cpp tensorflow::ops::Substr::Attrs tensorflow::ops::Substr::Attrs ============================== `#include <string_ops.h>` Optional attribute setters for [Substr](../../../../class/tensorflow/ops/substr#classtensorflow_1_1ops_1_1_substr). Summary ------- | Public attributes | | --- | | `[unit\_](#structtensorflow_1_1ops_1_1_substr_1_1_attrs_1a7c385269db54d4c3e74fb0cd18cd739e) = "BYTE"` | `StringPiece` | | Public functions | | --- | | `[Unit](#structtensorflow_1_1ops_1_1_substr_1_1_attrs_1af6db7bd9466518c3de8793eeb8372886)(StringPiece x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_substr_1_1_attrs)` The unit that is used to create the substring. | Public attributes ----------------- ### unit\_ ``` StringPiece tensorflow::ops::Substr::Attrs::unit_ = "BYTE" ``` Public functions ---------------- ### Unit ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::Substr::Attrs::Unit( StringPiece x ) ``` The unit that is used to create the substring. One of: `"BYTE"` (for defining position and length by bytes) or `"UTF8_CHAR"` (for the UTF-8 encoded Unicode code points). The default is `"BYTE"`. Results are undefined if `unit=UTF8_CHAR` and the `input` strings do not contain structurally valid UTF-8. Defaults to "BYTE" tensorflow_cpp tensorflow::ops::QuantizeAndDequantizeV4::Attrs tensorflow::ops::QuantizeAndDequantizeV4::Attrs =============================================== `#include <array_ops.h>` Optional attribute setters for [QuantizeAndDequantizeV4](../../../../class/tensorflow/ops/quantize-and-dequantize-v4#classtensorflow_1_1ops_1_1_quantize_and_dequantize_v4). Summary ------- | Public attributes | | --- | | `[axis\_](#structtensorflow_1_1ops_1_1_quantize_and_dequantize_v4_1_1_attrs_1aed4f0690b8d5c0d0a6944a1befee89cb) = -1` | `int64` | | `[narrow\_range\_](#structtensorflow_1_1ops_1_1_quantize_and_dequantize_v4_1_1_attrs_1ac5f2d8839cbcb62a73fa09463d89dcbd) = false` | `bool` | | `[num\_bits\_](#structtensorflow_1_1ops_1_1_quantize_and_dequantize_v4_1_1_attrs_1a1a89736832fb7a8b845dd3888a83f638) = 8` | `int64` | | `[range\_given\_](#structtensorflow_1_1ops_1_1_quantize_and_dequantize_v4_1_1_attrs_1ae1b775a9105bb3894a6cd7c98bdd0b75) = false` | `bool` | | `[round\_mode\_](#structtensorflow_1_1ops_1_1_quantize_and_dequantize_v4_1_1_attrs_1ae49e97bbf558b7ff2467e23622cd713a) = "HALF_TO_EVEN"` | `StringPiece` | | `[signed\_input\_](#structtensorflow_1_1ops_1_1_quantize_and_dequantize_v4_1_1_attrs_1aa78cd1c5ab78b90114ef9aebe7488ea1) = true` | `bool` | | Public functions | | --- | | `[Axis](#structtensorflow_1_1ops_1_1_quantize_and_dequantize_v4_1_1_attrs_1a05346052e4983b6fc85ea4bc11c9e697)(int64 x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_quantize_and_dequantize_v4_1_1_attrs)` If specified, this axis is treated as a channel or slice axis, and a separate quantization range is used for each channel or slice along this axis. | | `[NarrowRange](#structtensorflow_1_1ops_1_1_quantize_and_dequantize_v4_1_1_attrs_1aabdd6eed5b5efb96d92fd1744a0a2d55)(bool x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_quantize_and_dequantize_v4_1_1_attrs)` If True, then the absolute value of the quantized minimum value is the same as the quantized maximum value, instead of 1 greater. | | `[NumBits](#structtensorflow_1_1ops_1_1_quantize_and_dequantize_v4_1_1_attrs_1ac75f54dc51bc31498c0dd5849d544095)(int64 x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_quantize_and_dequantize_v4_1_1_attrs)` The bitwidth of the quantization. | | `[RangeGiven](#structtensorflow_1_1ops_1_1_quantize_and_dequantize_v4_1_1_attrs_1aad7aaf17fdc8b303d889a10f048aaeb3)(bool x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_quantize_and_dequantize_v4_1_1_attrs)` Whether the range is given or should be determined from the `input` tensor. | | `[RoundMode](#structtensorflow_1_1ops_1_1_quantize_and_dequantize_v4_1_1_attrs_1aa95ef25cc4ce4076b3cabebb016d690a)(StringPiece x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_quantize_and_dequantize_v4_1_1_attrs)` The 'round\_mode' attribute controls which rounding tie-breaking algorithm is used when rounding float values to their quantized equivalents. | | `[SignedInput](#structtensorflow_1_1ops_1_1_quantize_and_dequantize_v4_1_1_attrs_1abef99d1c39bb4513f049554ab334f9b2)(bool x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_quantize_and_dequantize_v4_1_1_attrs)` Whether the quantization is signed or unsigned. | Public attributes ----------------- ### axis\_ ``` int64 tensorflow::ops::QuantizeAndDequantizeV4::Attrs::axis_ = -1 ``` ### narrow\_range\_ ``` bool tensorflow::ops::QuantizeAndDequantizeV4::Attrs::narrow_range_ = false ``` ### num\_bits\_ ``` int64 tensorflow::ops::QuantizeAndDequantizeV4::Attrs::num_bits_ = 8 ``` ### range\_given\_ ``` bool tensorflow::ops::QuantizeAndDequantizeV4::Attrs::range_given_ = false ``` ### round\_mode\_ ``` StringPiece tensorflow::ops::QuantizeAndDequantizeV4::Attrs::round_mode_ = "HALF_TO_EVEN" ``` ### signed\_input\_ ``` bool tensorflow::ops::QuantizeAndDequantizeV4::Attrs::signed_input_ = true ``` Public functions ---------------- ### Axis ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::QuantizeAndDequantizeV4::Attrs::Axis( int64 x ) ``` If specified, this axis is treated as a channel or slice axis, and a separate quantization range is used for each channel or slice along this axis. Defaults to -1 ### NarrowRange ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::QuantizeAndDequantizeV4::Attrs::NarrowRange( bool x ) ``` If True, then the absolute value of the quantized minimum value is the same as the quantized maximum value, instead of 1 greater. i.e. for 8 bit quantization, the minimum value is -127 instead of -128. Defaults to false ### NumBits ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::QuantizeAndDequantizeV4::Attrs::NumBits( int64 x ) ``` The bitwidth of the quantization. Defaults to 8 ### RangeGiven ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::QuantizeAndDequantizeV4::Attrs::RangeGiven( bool x ) ``` Whether the range is given or should be determined from the `input` tensor. Defaults to false ### RoundMode ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::QuantizeAndDequantizeV4::Attrs::RoundMode( StringPiece x ) ``` The 'round\_mode' attribute controls which rounding tie-breaking algorithm is used when rounding float values to their quantized equivalents. The following rounding modes are currently supported: * HALF\_TO\_EVEN: this is the default round\_mode. * HALF\_UP: round towards positive. In this mode 7.5 rounds up to 8 and -7.5 rounds up to -7. Defaults to "HALF\_TO\_EVEN" ### SignedInput ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::QuantizeAndDequantizeV4::Attrs::SignedInput( bool x ) ``` Whether the quantization is signed or unsigned. (actually this parameter should have been called **`signed_output`** ) Defaults to true
programming_docs
tensorflow_cpp tensorflow::ops::DecodeBmp::Attrs tensorflow::ops::DecodeBmp::Attrs ================================= `#include <image_ops.h>` Optional attribute setters for [DecodeBmp](../../../../class/tensorflow/ops/decode-bmp#classtensorflow_1_1ops_1_1_decode_bmp). Summary ------- | Public attributes | | --- | | `[channels\_](#structtensorflow_1_1ops_1_1_decode_bmp_1_1_attrs_1a4927579dc1ad708d64910b66e50fe542) = 0` | `int64` | | Public functions | | --- | | `[Channels](#structtensorflow_1_1ops_1_1_decode_bmp_1_1_attrs_1a53888156613278159de193a61590c6cb)(int64 x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_decode_bmp_1_1_attrs)` Defaults to 0. | Public attributes ----------------- ### channels\_ ``` int64 tensorflow::ops::DecodeBmp::Attrs::channels_ = 0 ``` Public functions ---------------- ### Channels ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::DecodeBmp::Attrs::Channels( int64 x ) ``` Defaults to 0. tensorflow_cpp tensorflow::ops::DepthToSpace::Attrs tensorflow::ops::DepthToSpace::Attrs ==================================== `#include <array_ops.h>` Optional attribute setters for [DepthToSpace](../../../../class/tensorflow/ops/depth-to-space#classtensorflow_1_1ops_1_1_depth_to_space). Summary ------- | Public attributes | | --- | | `[data\_format\_](#structtensorflow_1_1ops_1_1_depth_to_space_1_1_attrs_1a43e347a2c6fb03eb267657090870daa7) = "NHWC"` | `StringPiece` | | Public functions | | --- | | `[DataFormat](#structtensorflow_1_1ops_1_1_depth_to_space_1_1_attrs_1ad655bb51e58a37d58de60a38a952fbbe)(StringPiece x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_depth_to_space_1_1_attrs)` Defaults to "NHWC". | Public attributes ----------------- ### data\_format\_ ``` StringPiece tensorflow::ops::DepthToSpace::Attrs::data_format_ = "NHWC" ``` Public functions ---------------- ### DataFormat ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::DepthToSpace::Attrs::DataFormat( StringPiece x ) ``` Defaults to "NHWC". tensorflow_cpp tensorflow::ops::MaxPool3DGradGrad::Attrs tensorflow::ops::MaxPool3DGradGrad::Attrs ========================================= `#include <nn_ops.h>` Optional attribute setters for [MaxPool3DGradGrad](../../../../class/tensorflow/ops/max-pool3-d-grad-grad#classtensorflow_1_1ops_1_1_max_pool3_d_grad_grad). Summary ------- | Public attributes | | --- | | `[data\_format\_](#structtensorflow_1_1ops_1_1_max_pool3_d_grad_grad_1_1_attrs_1a8b1601f316f6dc1dd9218256876c464f) = "NDHWC"` | `StringPiece` | | Public functions | | --- | | `[DataFormat](#structtensorflow_1_1ops_1_1_max_pool3_d_grad_grad_1_1_attrs_1ace815c65a020bb34a92af94d169e9da6)(StringPiece x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_max_pool3_d_grad_grad_1_1_attrs)` The data format of the input and output data. | Public attributes ----------------- ### data\_format\_ ``` StringPiece tensorflow::ops::MaxPool3DGradGrad::Attrs::data_format_ = "NDHWC" ``` Public functions ---------------- ### DataFormat ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::MaxPool3DGradGrad::Attrs::DataFormat( StringPiece x ) ``` The data format of the input and output data. With the default format "NDHWC", the data is stored in the order of: [batch, in\_depth, in\_height, in\_width, in\_channels]. Alternatively, the format could be "NCDHW", the data storage order is: [batch, in\_channels, in\_depth, in\_height, in\_width]. Defaults to "NDHWC" tensorflow_cpp tensorflow::ops::Mean::Attrs tensorflow::ops::Mean::Attrs ============================ `#include <math_ops.h>` Optional attribute setters for [Mean](../../../../class/tensorflow/ops/mean#classtensorflow_1_1ops_1_1_mean). Summary ------- | Public attributes | | --- | | `[keep\_dims\_](#structtensorflow_1_1ops_1_1_mean_1_1_attrs_1afc5f582326bc6f91187c8b5581d41bab) = false` | `bool` | | Public functions | | --- | | `[KeepDims](#structtensorflow_1_1ops_1_1_mean_1_1_attrs_1a04d8c8ae13406f933092ffb568878a2d)(bool x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_mean_1_1_attrs)` If true, retain reduced dimensions with length 1. | Public attributes ----------------- ### keep\_dims\_ ``` bool tensorflow::ops::Mean::Attrs::keep_dims_ = false ``` Public functions ---------------- ### KeepDims ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::Mean::Attrs::KeepDims( bool x ) ``` If true, retain reduced dimensions with length 1. Defaults to false tensorflow_cpp tensorflow::ops::QuantizeAndDequantizeV3::Attrs tensorflow::ops::QuantizeAndDequantizeV3::Attrs =============================================== `#include <array_ops.h>` Optional attribute setters for [QuantizeAndDequantizeV3](../../../../class/tensorflow/ops/quantize-and-dequantize-v3#classtensorflow_1_1ops_1_1_quantize_and_dequantize_v3). Summary ------- | Public attributes | | --- | | `[axis\_](#structtensorflow_1_1ops_1_1_quantize_and_dequantize_v3_1_1_attrs_1a29b1985e5b5d174f94fae92c18f5e7ee) = -1` | `int64` | | `[narrow\_range\_](#structtensorflow_1_1ops_1_1_quantize_and_dequantize_v3_1_1_attrs_1a1f6a8c31c6a18ce2f0b1ccddab714d68) = false` | `bool` | | `[range\_given\_](#structtensorflow_1_1ops_1_1_quantize_and_dequantize_v3_1_1_attrs_1a65ec5c6031f64ee60003df0c32818878) = true` | `bool` | | `[signed\_input\_](#structtensorflow_1_1ops_1_1_quantize_and_dequantize_v3_1_1_attrs_1afa9ac30e490c09a96faf215645f0e008) = true` | `bool` | | Public functions | | --- | | `[Axis](#structtensorflow_1_1ops_1_1_quantize_and_dequantize_v3_1_1_attrs_1a5a7176c17a58da234fb603229a2eb5a9)(int64 x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_quantize_and_dequantize_v3_1_1_attrs)` Defaults to -1. | | `[NarrowRange](#structtensorflow_1_1ops_1_1_quantize_and_dequantize_v3_1_1_attrs_1a75850c802d097420673c0cec01cf1c3f)(bool x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_quantize_and_dequantize_v3_1_1_attrs)` Defaults to false. | | `[RangeGiven](#structtensorflow_1_1ops_1_1_quantize_and_dequantize_v3_1_1_attrs_1a9b65091fe5e629a43bbfea0d6716cf50)(bool x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_quantize_and_dequantize_v3_1_1_attrs)` Defaults to true. | | `[SignedInput](#structtensorflow_1_1ops_1_1_quantize_and_dequantize_v3_1_1_attrs_1a9feb1c381a12febda27ee0e5f00705d5)(bool x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_quantize_and_dequantize_v3_1_1_attrs)` Defaults to true. | Public attributes ----------------- ### axis\_ ``` int64 tensorflow::ops::QuantizeAndDequantizeV3::Attrs::axis_ = -1 ``` ### narrow\_range\_ ``` bool tensorflow::ops::QuantizeAndDequantizeV3::Attrs::narrow_range_ = false ``` ### range\_given\_ ``` bool tensorflow::ops::QuantizeAndDequantizeV3::Attrs::range_given_ = true ``` ### signed\_input\_ ``` bool tensorflow::ops::QuantizeAndDequantizeV3::Attrs::signed_input_ = true ``` Public functions ---------------- ### Axis ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::QuantizeAndDequantizeV3::Attrs::Axis( int64 x ) ``` Defaults to -1. ### NarrowRange ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::QuantizeAndDequantizeV3::Attrs::NarrowRange( bool x ) ``` Defaults to false. ### RangeGiven ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::QuantizeAndDequantizeV3::Attrs::RangeGiven( bool x ) ``` Defaults to true. ### SignedInput ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::QuantizeAndDequantizeV3::Attrs::SignedInput( bool x ) ``` Defaults to true. tensorflow_cpp tensorflow::ops::DecodeJpeg::Attrs tensorflow::ops::DecodeJpeg::Attrs ================================== `#include <image_ops.h>` Optional attribute setters for [DecodeJpeg](../../../../class/tensorflow/ops/decode-jpeg#classtensorflow_1_1ops_1_1_decode_jpeg). Summary ------- | Public attributes | | --- | | `[acceptable\_fraction\_](#structtensorflow_1_1ops_1_1_decode_jpeg_1_1_attrs_1a0b10d4d030a8ca14ac7570161190c83a) = 1.0f` | `float` | | `[channels\_](#structtensorflow_1_1ops_1_1_decode_jpeg_1_1_attrs_1a18e020f1e5ff8cfbd4d78478415d1ddb) = 0` | `int64` | | `[dct\_method\_](#structtensorflow_1_1ops_1_1_decode_jpeg_1_1_attrs_1a56dbd1f5b3b6ad2f2f6109d261a1b2c0) = ""` | `StringPiece` | | `[fancy\_upscaling\_](#structtensorflow_1_1ops_1_1_decode_jpeg_1_1_attrs_1a8e1e67750ce05d148e582c0da4a2279e) = true` | `bool` | | `[ratio\_](#structtensorflow_1_1ops_1_1_decode_jpeg_1_1_attrs_1a9e510e74b3307b51218f9ba73bb88299) = 1` | `int64` | | `[try\_recover\_truncated\_](#structtensorflow_1_1ops_1_1_decode_jpeg_1_1_attrs_1aa2cf39a88d8a81dcb7db8e5a5e0d370e) = false` | `bool` | | Public functions | | --- | | `[AcceptableFraction](#structtensorflow_1_1ops_1_1_decode_jpeg_1_1_attrs_1ad1f15f47beae81c3372f7be5fc7b66d2)(float x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_decode_jpeg_1_1_attrs)` The minimum required fraction of lines before a truncated input is accepted. | | `[Channels](#structtensorflow_1_1ops_1_1_decode_jpeg_1_1_attrs_1a0548d6add8de1fae308c6043ae78bc4f)(int64 x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_decode_jpeg_1_1_attrs)` Number of color channels for the decoded image. | | `[DctMethod](#structtensorflow_1_1ops_1_1_decode_jpeg_1_1_attrs_1a6e0f2e6e3603c3b5a4f87f99e01fb7f4)(StringPiece x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_decode_jpeg_1_1_attrs)` string specifying a hint about the algorithm used for decompression. | | `[FancyUpscaling](#structtensorflow_1_1ops_1_1_decode_jpeg_1_1_attrs_1a0ae0fb6313dea00cfcaa043461f9435f)(bool x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_decode_jpeg_1_1_attrs)` If true use a slower but nicer upscaling of the chroma planes (yuv420/422 only). | | `[Ratio](#structtensorflow_1_1ops_1_1_decode_jpeg_1_1_attrs_1abfd175cdcf500dba69dc39803e8fdebf)(int64 x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_decode_jpeg_1_1_attrs)` Downscaling ratio. | | `[TryRecoverTruncated](#structtensorflow_1_1ops_1_1_decode_jpeg_1_1_attrs_1a91511d57ca206a8096ab617a176fca3c)(bool x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_decode_jpeg_1_1_attrs)` If true try to recover an image from truncated input. | Public attributes ----------------- ### acceptable\_fraction\_ ``` float tensorflow::ops::DecodeJpeg::Attrs::acceptable_fraction_ = 1.0f ``` ### channels\_ ``` int64 tensorflow::ops::DecodeJpeg::Attrs::channels_ = 0 ``` ### dct\_method\_ ``` StringPiece tensorflow::ops::DecodeJpeg::Attrs::dct_method_ = "" ``` ### fancy\_upscaling\_ ``` bool tensorflow::ops::DecodeJpeg::Attrs::fancy_upscaling_ = true ``` ### ratio\_ ``` int64 tensorflow::ops::DecodeJpeg::Attrs::ratio_ = 1 ``` ### try\_recover\_truncated\_ ``` bool tensorflow::ops::DecodeJpeg::Attrs::try_recover_truncated_ = false ``` Public functions ---------------- ### AcceptableFraction ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::DecodeJpeg::Attrs::AcceptableFraction( float x ) ``` The minimum required fraction of lines before a truncated input is accepted. Defaults to 1 ### Channels ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::DecodeJpeg::Attrs::Channels( int64 x ) ``` Number of color channels for the decoded image. Defaults to 0 ### DctMethod ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::DecodeJpeg::Attrs::DctMethod( StringPiece x ) ``` string specifying a hint about the algorithm used for decompression. Defaults to "" which maps to a system-specific default. Currently valid values are ["INTEGER\_FAST", "INTEGER\_ACCURATE"]. The hint may be ignored (e.g., the internal jpeg library changes to a version that does not have that specific option.) Defaults to "" ### FancyUpscaling ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::DecodeJpeg::Attrs::FancyUpscaling( bool x ) ``` If true use a slower but nicer upscaling of the chroma planes (yuv420/422 only). Defaults to true ### Ratio ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::DecodeJpeg::Attrs::Ratio( int64 x ) ``` Downscaling ratio. Defaults to 1 ### TryRecoverTruncated ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::DecodeJpeg::Attrs::TryRecoverTruncated( bool x ) ``` If true try to recover an image from truncated input. Defaults to false tensorflow_cpp tensorflow::ops::UnicodeTranscode::Attrs tensorflow::ops::UnicodeTranscode::Attrs ======================================== `#include <string_ops.h>` Optional attribute setters for [UnicodeTranscode](../../../../class/tensorflow/ops/unicode-transcode#classtensorflow_1_1ops_1_1_unicode_transcode). Summary ------- | Public attributes | | --- | | `[errors\_](#structtensorflow_1_1ops_1_1_unicode_transcode_1_1_attrs_1abcd1383b9be66c3a3bb38f35eb35d7c8) = "replace"` | `StringPiece` | | `[replace\_control\_characters\_](#structtensorflow_1_1ops_1_1_unicode_transcode_1_1_attrs_1a98f8a37849498e2da67eac2ad35642a2) = false` | `bool` | | `[replacement\_char\_](#structtensorflow_1_1ops_1_1_unicode_transcode_1_1_attrs_1afe5534f218249f3369c91e047af3775b) = 65533` | `int64` | | Public functions | | --- | | `[Errors](#structtensorflow_1_1ops_1_1_unicode_transcode_1_1_attrs_1ab1e6a46bf9d2cc08d188a8f65ce5af5f)(StringPiece x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_unicode_transcode_1_1_attrs)` Error handling policy when there is invalid formatting found in the input. | | `[ReplaceControlCharacters](#structtensorflow_1_1ops_1_1_unicode_transcode_1_1_attrs_1a14ef90d95676aea36bd25eb2589cf726)(bool x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_unicode_transcode_1_1_attrs)` Whether to replace the C0 control characters (00-1F) with the `replacement_char`. | | `[ReplacementChar](#structtensorflow_1_1ops_1_1_unicode_transcode_1_1_attrs_1aff6611b37bc42f8b41c1341a2588c7eb)(int64 x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_unicode_transcode_1_1_attrs)` The replacement character codepoint to be used in place of any invalid formatting in the input when `errors='replace'`. | Public attributes ----------------- ### errors\_ ``` StringPiece tensorflow::ops::UnicodeTranscode::Attrs::errors_ = "replace" ``` ### replace\_control\_characters\_ ``` bool tensorflow::ops::UnicodeTranscode::Attrs::replace_control_characters_ = false ``` ### replacement\_char\_ ``` int64 tensorflow::ops::UnicodeTranscode::Attrs::replacement_char_ = 65533 ``` Public functions ---------------- ### Errors ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::UnicodeTranscode::Attrs::Errors( StringPiece x ) ``` Error handling policy when there is invalid formatting found in the input. The value of 'strict' will cause the operation to produce a InvalidArgument error on any invalid input formatting. A value of 'replace' (the default) will cause the operation to replace any invalid formatting in the input with the `replacement_char` codepoint. A value of 'ignore' will cause the operation to skip any invalid formatting in the input and produce no corresponding output character. Defaults to "replace" ### ReplaceControlCharacters ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::UnicodeTranscode::Attrs::ReplaceControlCharacters( bool x ) ``` Whether to replace the C0 control characters (00-1F) with the `replacement_char`. Default is false. Defaults to false ### ReplacementChar ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::UnicodeTranscode::Attrs::ReplacementChar( int64 x ) ``` The replacement character codepoint to be used in place of any invalid formatting in the input when `errors='replace'`. [Any](../../../../class/tensorflow/ops/any#classtensorflow_1_1ops_1_1_any) valid unicode codepoint may be used. The default value is the default unicode replacement character is 0xFFFD or U+65533.) Note that for UTF-8, passing a replacement character expressible in 1 byte, such as ' ', will preserve string alignment to the source since invalid bytes will be replaced with a 1-byte replacement. For UTF-16-BE and UTF-16-LE, any 1 or 2 byte replacement character will preserve byte alignment to the source. Defaults to 65533 tensorflow_cpp tensorflow::ops::Conv3DBackpropFilterV2::Attrs tensorflow::ops::Conv3DBackpropFilterV2::Attrs ============================================== `#include <nn_ops.h>` Optional attribute setters for [Conv3DBackpropFilterV2](../../../../class/tensorflow/ops/conv3-d-backprop-filter-v2#classtensorflow_1_1ops_1_1_conv3_d_backprop_filter_v2). Summary ------- | Public attributes | | --- | | `[data\_format\_](#structtensorflow_1_1ops_1_1_conv3_d_backprop_filter_v2_1_1_attrs_1a817dee48e17a4d1656b1a3c6d10fc831) = "NDHWC"` | `StringPiece` | | `[dilations\_](#structtensorflow_1_1ops_1_1_conv3_d_backprop_filter_v2_1_1_attrs_1a55235480274b8bbb9f6e13e64fdffa89) = Default_dilations()` | `gtl::ArraySlice< int >` | | Public functions | | --- | | `[DataFormat](#structtensorflow_1_1ops_1_1_conv3_d_backprop_filter_v2_1_1_attrs_1ac7eafac498c8a737a5cb7a59079ee399)(StringPiece x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_conv3_d_backprop_filter_v2_1_1_attrs)` The data format of the input and output data. | | `[Dilations](#structtensorflow_1_1ops_1_1_conv3_d_backprop_filter_v2_1_1_attrs_1a5a096dd5562a09fc023c1b5f16a0a696)(const gtl::ArraySlice< int > & x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_conv3_d_backprop_filter_v2_1_1_attrs)` 1-D tensor of length 5. | Public attributes ----------------- ### data\_format\_ ``` StringPiece tensorflow::ops::Conv3DBackpropFilterV2::Attrs::data_format_ = "NDHWC" ``` ### dilations\_ ``` gtl::ArraySlice< int > tensorflow::ops::Conv3DBackpropFilterV2::Attrs::dilations_ = Default_dilations() ``` Public functions ---------------- ### DataFormat ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::Conv3DBackpropFilterV2::Attrs::DataFormat( StringPiece x ) ``` The data format of the input and output data. With the default format "NDHWC", the data is stored in the order of: [batch, in\_depth, in\_height, in\_width, in\_channels]. Alternatively, the format could be "NCDHW", the data storage order is: [batch, in\_channels, in\_depth, in\_height, in\_width]. Defaults to "NDHWC" ### Dilations ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::Conv3DBackpropFilterV2::Attrs::Dilations( const gtl::ArraySlice< int > & x ) ``` 1-D tensor of length 5. The dilation factor for each dimension of `input`. If set to k > 1, there will be k-1 skipped cells between each filter element on that dimension. The dimension order is determined by the value of `data_format`, see above for details. Dilations in the batch and depth dimensions must be 1. Defaults to [1, 1, 1, 1, 1] tensorflow_cpp tensorflow::ops::MaxPool3D::Attrs tensorflow::ops::MaxPool3D::Attrs ================================= `#include <nn_ops.h>` Optional attribute setters for [MaxPool3D](../../../../class/tensorflow/ops/max-pool3-d#classtensorflow_1_1ops_1_1_max_pool3_d). Summary ------- | Public attributes | | --- | | `[data\_format\_](#structtensorflow_1_1ops_1_1_max_pool3_d_1_1_attrs_1ae44ee86ea3d7d255eb738976e0cf2122) = "NDHWC"` | `StringPiece` | | Public functions | | --- | | `[DataFormat](#structtensorflow_1_1ops_1_1_max_pool3_d_1_1_attrs_1ac2be31d1ef66e4a847b943893b8ea275)(StringPiece x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_max_pool3_d_1_1_attrs)` The data format of the input and output data. | Public attributes ----------------- ### data\_format\_ ``` StringPiece tensorflow::ops::MaxPool3D::Attrs::data_format_ = "NDHWC" ``` Public functions ---------------- ### DataFormat ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::MaxPool3D::Attrs::DataFormat( StringPiece x ) ``` The data format of the input and output data. With the default format "NDHWC", the data is stored in the order of: [batch, in\_depth, in\_height, in\_width, in\_channels]. Alternatively, the format could be "NCDHW", the data storage order is: [batch, in\_channels, in\_depth, in\_height, in\_width]. Defaults to "NDHWC"
programming_docs
tensorflow_cpp tensorflow::ops::Empty::Attrs tensorflow::ops::Empty::Attrs ============================= `#include <array_ops.h>` Optional attribute setters for [Empty](../../../../class/tensorflow/ops/empty#classtensorflow_1_1ops_1_1_empty). Summary ------- | Public attributes | | --- | | `[init\_](#structtensorflow_1_1ops_1_1_empty_1_1_attrs_1adb5b1a4761d83ec50f0912bcb08f1293) = false` | `bool` | | Public functions | | --- | | `[Init](#structtensorflow_1_1ops_1_1_empty_1_1_attrs_1a96c0e1654265db0e2bf14017a289eb09)(bool x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_empty_1_1_attrs)` If True, initialize the returned tensor with the default value of dtype. | Public attributes ----------------- ### init\_ ``` bool tensorflow::ops::Empty::Attrs::init_ = false ``` Public functions ---------------- ### Init ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::Empty::Attrs::Init( bool x ) ``` If True, initialize the returned tensor with the default value of dtype. Otherwise, the implementation is free not to initializethe tensor's content. Defaults to false tensorflow_cpp tensorflow::ops::SparseReduceSum::Attrs tensorflow::ops::SparseReduceSum::Attrs ======================================= `#include <sparse_ops.h>` Optional attribute setters for [SparseReduceSum](../../../../class/tensorflow/ops/sparse-reduce-sum#classtensorflow_1_1ops_1_1_sparse_reduce_sum). Summary ------- | Public attributes | | --- | | `[keep\_dims\_](#structtensorflow_1_1ops_1_1_sparse_reduce_sum_1_1_attrs_1a7cb8f56a73bd489d4130ad5eb001322a) = false` | `bool` | | Public functions | | --- | | `[KeepDims](#structtensorflow_1_1ops_1_1_sparse_reduce_sum_1_1_attrs_1a25ba2b36df7fb24e5834123f21940354)(bool x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_sparse_reduce_sum_1_1_attrs)` If true, retain reduced dimensions with length 1. | Public attributes ----------------- ### keep\_dims\_ ``` bool tensorflow::ops::SparseReduceSum::Attrs::keep_dims_ = false ``` Public functions ---------------- ### KeepDims ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::SparseReduceSum::Attrs::KeepDims( bool x ) ``` If true, retain reduced dimensions with length 1. Defaults to false tensorflow_cpp tensorflow::ops::StringJoin::Attrs tensorflow::ops::StringJoin::Attrs ================================== `#include <string_ops.h>` Optional attribute setters for [StringJoin](../../../../class/tensorflow/ops/string-join#classtensorflow_1_1ops_1_1_string_join). Summary ------- | Public attributes | | --- | | `[separator\_](#structtensorflow_1_1ops_1_1_string_join_1_1_attrs_1aa45572e4d283d72ec37d60c7b2791db9) = ""` | `StringPiece` | | Public functions | | --- | | `[Separator](#structtensorflow_1_1ops_1_1_string_join_1_1_attrs_1a262f0edc354e8bdb8a5bc73b42b39a5d)(StringPiece x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_string_join_1_1_attrs)` string, an optional join separator. | Public attributes ----------------- ### separator\_ ``` StringPiece tensorflow::ops::StringJoin::Attrs::separator_ = "" ``` Public functions ---------------- ### Separator ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::StringJoin::Attrs::Separator( StringPiece x ) ``` string, an optional join separator. Defaults to "" tensorflow_cpp tensorflow::ops::FakeQuantWithMinMaxVarsGradient::Attrs tensorflow::ops::FakeQuantWithMinMaxVarsGradient::Attrs ======================================================= `#include <array_ops.h>` Optional attribute setters for [FakeQuantWithMinMaxVarsGradient](../../../../class/tensorflow/ops/fake-quant-with-min-max-vars-gradient#classtensorflow_1_1ops_1_1_fake_quant_with_min_max_vars_gradient). Summary ------- | Public attributes | | --- | | `[narrow\_range\_](#structtensorflow_1_1ops_1_1_fake_quant_with_min_max_vars_gradient_1_1_attrs_1acf5b622a8301951bb06a117ee8f469fd) = false` | `bool` | | `[num\_bits\_](#structtensorflow_1_1ops_1_1_fake_quant_with_min_max_vars_gradient_1_1_attrs_1af26251a3f20404321f755be4909b30b0) = 8` | `int64` | | Public functions | | --- | | `[NarrowRange](#structtensorflow_1_1ops_1_1_fake_quant_with_min_max_vars_gradient_1_1_attrs_1a1c24ca7db4de2e1c6b9fff5ed496c742)(bool x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_fake_quant_with_min_max_vars_gradient_1_1_attrs)` Whether to quantize into 2^num\_bits - 1 distinct values. | | `[NumBits](#structtensorflow_1_1ops_1_1_fake_quant_with_min_max_vars_gradient_1_1_attrs_1a81834c121ffed56623556a3f30798089)(int64 x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_fake_quant_with_min_max_vars_gradient_1_1_attrs)` The bitwidth of the quantization; between 2 and 8, inclusive. | Public attributes ----------------- ### narrow\_range\_ ``` bool tensorflow::ops::FakeQuantWithMinMaxVarsGradient::Attrs::narrow_range_ = false ``` ### num\_bits\_ ``` int64 tensorflow::ops::FakeQuantWithMinMaxVarsGradient::Attrs::num_bits_ = 8 ``` Public functions ---------------- ### NarrowRange ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::FakeQuantWithMinMaxVarsGradient::Attrs::NarrowRange( bool x ) ``` Whether to quantize into 2^num\_bits - 1 distinct values. Defaults to false ### NumBits ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::FakeQuantWithMinMaxVarsGradient::Attrs::NumBits( int64 x ) ``` The bitwidth of the quantization; between 2 and 8, inclusive. Defaults to 8 tensorflow_cpp tensorflow::ops::SparseApplyMomentum::Attrs tensorflow::ops::SparseApplyMomentum::Attrs =========================================== `#include <training_ops.h>` Optional attribute setters for [SparseApplyMomentum](../../../../class/tensorflow/ops/sparse-apply-momentum#classtensorflow_1_1ops_1_1_sparse_apply_momentum). Summary ------- | Public attributes | | --- | | `[use\_locking\_](#structtensorflow_1_1ops_1_1_sparse_apply_momentum_1_1_attrs_1a2c1536af4fab8174cc5dbbc245b97060) = false` | `bool` | | `[use\_nesterov\_](#structtensorflow_1_1ops_1_1_sparse_apply_momentum_1_1_attrs_1a877785a9e22822de99cfc1b741a01fac) = false` | `bool` | | Public functions | | --- | | `[UseLocking](#structtensorflow_1_1ops_1_1_sparse_apply_momentum_1_1_attrs_1abc3258f90a307c2b8f7d1048201d7105)(bool x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_sparse_apply_momentum_1_1_attrs)` If `True`, updating of the var and accum tensors will be protected by a lock; otherwise the behavior is undefined, but may exhibit less contention. | | `[UseNesterov](#structtensorflow_1_1ops_1_1_sparse_apply_momentum_1_1_attrs_1acfa0a7c0ee380f32131c5395deba19b0)(bool x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_sparse_apply_momentum_1_1_attrs)` If `True`, the tensor passed to compute grad will be var - lr \* momentum \* accum, so in the end, the var you get is actually var - lr \* momentum \* accum. | Public attributes ----------------- ### use\_locking\_ ``` bool tensorflow::ops::SparseApplyMomentum::Attrs::use_locking_ = false ``` ### use\_nesterov\_ ``` bool tensorflow::ops::SparseApplyMomentum::Attrs::use_nesterov_ = false ``` Public functions ---------------- ### UseLocking ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::SparseApplyMomentum::Attrs::UseLocking( bool x ) ``` If `True`, updating of the var and accum tensors will be protected by a lock; otherwise the behavior is undefined, but may exhibit less contention. Defaults to false ### UseNesterov ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::SparseApplyMomentum::Attrs::UseNesterov( bool x ) ``` If `True`, the tensor passed to compute grad will be var - lr \* momentum \* accum, so in the end, the var you get is actually var - lr \* momentum \* accum. Defaults to false tensorflow_cpp tensorflow::ops::SparseReduceMax::Attrs tensorflow::ops::SparseReduceMax::Attrs ======================================= `#include <sparse_ops.h>` Optional attribute setters for [SparseReduceMax](../../../../class/tensorflow/ops/sparse-reduce-max#classtensorflow_1_1ops_1_1_sparse_reduce_max). Summary ------- | Public attributes | | --- | | `[keep\_dims\_](#structtensorflow_1_1ops_1_1_sparse_reduce_max_1_1_attrs_1a1b9292b8b1018ff3978cd05638fb98c5) = false` | `bool` | | Public functions | | --- | | `[KeepDims](#structtensorflow_1_1ops_1_1_sparse_reduce_max_1_1_attrs_1aed629bc47433937f9ec4d2fccc1414cd)(bool x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_sparse_reduce_max_1_1_attrs)` If true, retain reduced dimensions with length 1. | Public attributes ----------------- ### keep\_dims\_ ``` bool tensorflow::ops::SparseReduceMax::Attrs::keep_dims_ = false ``` Public functions ---------------- ### KeepDims ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::SparseReduceMax::Attrs::KeepDims( bool x ) ``` If true, retain reduced dimensions with length 1. Defaults to false tensorflow_cpp tensorflow::ops::BatchMatMul::Attrs tensorflow::ops::BatchMatMul::Attrs =================================== `#include <math_ops.h>` Optional attribute setters for [BatchMatMul](../../../../class/tensorflow/ops/batch-mat-mul#classtensorflow_1_1ops_1_1_batch_mat_mul). Summary ------- | Public attributes | | --- | | `[adj\_x\_](#structtensorflow_1_1ops_1_1_batch_mat_mul_1_1_attrs_1a9310486cea22bb460240154e047002c9) = false` | `bool` | | `[adj\_y\_](#structtensorflow_1_1ops_1_1_batch_mat_mul_1_1_attrs_1a4db729e315f06f82a72e868974fe36d1) = false` | `bool` | | Public functions | | --- | | `[AdjX](#structtensorflow_1_1ops_1_1_batch_mat_mul_1_1_attrs_1a9162c02bdc41177caa82f4bbbefc10b0)(bool x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_batch_mat_mul_1_1_attrs)` If `True`, adjoint the slices of `x`. | | `[AdjY](#structtensorflow_1_1ops_1_1_batch_mat_mul_1_1_attrs_1afe58828ba6c959fe2e55699b88fbc6a0)(bool x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_batch_mat_mul_1_1_attrs)` If `True`, adjoint the slices of `y`. | Public attributes ----------------- ### adj\_x\_ ``` bool tensorflow::ops::BatchMatMul::Attrs::adj_x_ = false ``` ### adj\_y\_ ``` bool tensorflow::ops::BatchMatMul::Attrs::adj_y_ = false ``` Public functions ---------------- ### AdjX ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::BatchMatMul::Attrs::AdjX( bool x ) ``` If `True`, adjoint the slices of `x`. Defaults to `False`. Defaults to false ### AdjY ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::BatchMatMul::Attrs::AdjY( bool x ) ``` If `True`, adjoint the slices of `y`. Defaults to `False`. Defaults to false tensorflow_cpp tensorflow::ops::FusedResizeAndPadConv2D::Attrs tensorflow::ops::FusedResizeAndPadConv2D::Attrs =============================================== `#include <nn_ops.h>` Optional attribute setters for [FusedResizeAndPadConv2D](../../../../class/tensorflow/ops/fused-resize-and-pad-conv2-d#classtensorflow_1_1ops_1_1_fused_resize_and_pad_conv2_d). Summary ------- | Public attributes | | --- | | `[resize\_align\_corners\_](#structtensorflow_1_1ops_1_1_fused_resize_and_pad_conv2_d_1_1_attrs_1aecba02f7338861b059ba82d5a301bbb3) = false` | `bool` | | Public functions | | --- | | `[ResizeAlignCorners](#structtensorflow_1_1ops_1_1_fused_resize_and_pad_conv2_d_1_1_attrs_1a6e7fb4ea53bd735bd349a39b7a600dc9)(bool x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_fused_resize_and_pad_conv2_d_1_1_attrs)` If true, the centers of the 4 corner pixels of the input and output tensors are aligned, preserving the values at the corner pixels. | Public attributes ----------------- ### resize\_align\_corners\_ ``` bool tensorflow::ops::FusedResizeAndPadConv2D::Attrs::resize_align_corners_ = false ``` Public functions ---------------- ### ResizeAlignCorners ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::FusedResizeAndPadConv2D::Attrs::ResizeAlignCorners( bool x ) ``` If true, the centers of the 4 corner pixels of the input and output tensors are aligned, preserving the values at the corner pixels. Defaults to false. Defaults to false tensorflow_cpp tensorflow::ops::CropAndResizeGradBoxes::Attrs tensorflow::ops::CropAndResizeGradBoxes::Attrs ============================================== `#include <image_ops.h>` Optional attribute setters for [CropAndResizeGradBoxes](../../../../class/tensorflow/ops/crop-and-resize-grad-boxes#classtensorflow_1_1ops_1_1_crop_and_resize_grad_boxes). Summary ------- | Public attributes | | --- | | `[method\_](#structtensorflow_1_1ops_1_1_crop_and_resize_grad_boxes_1_1_attrs_1a50a38d2c041f6f9065bdaab39bb1398b) = "bilinear"` | `StringPiece` | | Public functions | | --- | | `[Method](#structtensorflow_1_1ops_1_1_crop_and_resize_grad_boxes_1_1_attrs_1aad062d0b738121f20c275f4d9714c318)(StringPiece x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_crop_and_resize_grad_boxes_1_1_attrs)` A string specifying the interpolation method. | Public attributes ----------------- ### method\_ ``` StringPiece tensorflow::ops::CropAndResizeGradBoxes::Attrs::method_ = "bilinear" ``` Public functions ---------------- ### Method ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::CropAndResizeGradBoxes::Attrs::Method( StringPiece x ) ``` A string specifying the interpolation method. Only 'bilinear' is supported for now. Defaults to "bilinear" tensorflow_cpp tensorflow::ops::OrderedMapPeek::Attrs tensorflow::ops::OrderedMapPeek::Attrs ====================================== `#include <data_flow_ops.h>` Optional attribute setters for [OrderedMapPeek](../../../../class/tensorflow/ops/ordered-map-peek#classtensorflow_1_1ops_1_1_ordered_map_peek). Summary ------- | Public attributes | | --- | | `[capacity\_](#structtensorflow_1_1ops_1_1_ordered_map_peek_1_1_attrs_1ad858ee2449471d061dfe266d01f56253) = 0` | `int64` | | `[container\_](#structtensorflow_1_1ops_1_1_ordered_map_peek_1_1_attrs_1a0cbe82a7a59072f274b1a5fd2e0664b7) = ""` | `StringPiece` | | `[memory\_limit\_](#structtensorflow_1_1ops_1_1_ordered_map_peek_1_1_attrs_1ad01cc04fa996fb541f70c980d539004d) = 0` | `int64` | | `[shared\_name\_](#structtensorflow_1_1ops_1_1_ordered_map_peek_1_1_attrs_1a362db1c3ae8da417905cb9f4e02a29bf) = ""` | `StringPiece` | | Public functions | | --- | | `[Capacity](#structtensorflow_1_1ops_1_1_ordered_map_peek_1_1_attrs_1a07b924aa7aa39cd246f0247214d1a07a)(int64 x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_ordered_map_peek_1_1_attrs)` Defaults to 0. | | `[Container](#structtensorflow_1_1ops_1_1_ordered_map_peek_1_1_attrs_1abc485bf364f94cab2799c5e4d3617f6e)(StringPiece x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_ordered_map_peek_1_1_attrs)` Defaults to "". | | `[MemoryLimit](#structtensorflow_1_1ops_1_1_ordered_map_peek_1_1_attrs_1ab178773ef30044d0356b3287e0aa9cf0)(int64 x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_ordered_map_peek_1_1_attrs)` Defaults to 0. | | `[SharedName](#structtensorflow_1_1ops_1_1_ordered_map_peek_1_1_attrs_1a93b7dda9659820334d4021a6580dee35)(StringPiece x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_ordered_map_peek_1_1_attrs)` Defaults to "". | Public attributes ----------------- ### capacity\_ ``` int64 tensorflow::ops::OrderedMapPeek::Attrs::capacity_ = 0 ``` ### container\_ ``` StringPiece tensorflow::ops::OrderedMapPeek::Attrs::container_ = "" ``` ### memory\_limit\_ ``` int64 tensorflow::ops::OrderedMapPeek::Attrs::memory_limit_ = 0 ``` ### shared\_name\_ ``` StringPiece tensorflow::ops::OrderedMapPeek::Attrs::shared_name_ = "" ``` Public functions ---------------- ### Capacity ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::OrderedMapPeek::Attrs::Capacity( int64 x ) ``` Defaults to 0. ### Container ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::OrderedMapPeek::Attrs::Container( StringPiece x ) ``` Defaults to "". ### MemoryLimit ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::OrderedMapPeek::Attrs::MemoryLimit( int64 x ) ``` Defaults to 0. ### SharedName ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::OrderedMapPeek::Attrs::SharedName( StringPiece x ) ``` Defaults to "". tensorflow_cpp tensorflow::ops::RestoreSlice::Attrs tensorflow::ops::RestoreSlice::Attrs ==================================== `#include <io_ops.h>` Optional attribute setters for [RestoreSlice](../../../../class/tensorflow/ops/restore-slice#classtensorflow_1_1ops_1_1_restore_slice). Summary ------- | Public attributes | | --- | | `[preferred\_shard\_](#structtensorflow_1_1ops_1_1_restore_slice_1_1_attrs_1a435b3e19b1223b9ea5ef37bcbb1c8915) = -1` | `int64` | | Public functions | | --- | | `[PreferredShard](#structtensorflow_1_1ops_1_1_restore_slice_1_1_attrs_1a137964847b24357bd27f2f06066508bd)(int64 x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_restore_slice_1_1_attrs)` Index of file to open first if multiple files match `file_pattern`. | Public attributes ----------------- ### preferred\_shard\_ ``` int64 tensorflow::ops::RestoreSlice::Attrs::preferred_shard_ = -1 ``` Public functions ---------------- ### PreferredShard ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::RestoreSlice::Attrs::PreferredShard( int64 x ) ``` Index of file to open first if multiple files match `file_pattern`. See the documentation for `[Restore](../../../../class/tensorflow/ops/restore#classtensorflow_1_1ops_1_1_restore)`. Defaults to -1 tensorflow_cpp tensorflow::ops::AddSparseToTensorsMap::Attrs tensorflow::ops::AddSparseToTensorsMap::Attrs ============================================= `#include <sparse_ops.h>` Optional attribute setters for [AddSparseToTensorsMap](../../../../class/tensorflow/ops/add-sparse-to-tensors-map#classtensorflow_1_1ops_1_1_add_sparse_to_tensors_map). Summary ------- | Public attributes | | --- | | `[container\_](#structtensorflow_1_1ops_1_1_add_sparse_to_tensors_map_1_1_attrs_1acc3504200d7324fb459f65fb158e1071) = ""` | `StringPiece` | | `[shared\_name\_](#structtensorflow_1_1ops_1_1_add_sparse_to_tensors_map_1_1_attrs_1ad226ce1b902d797d91066b7e729ab5be) = ""` | `StringPiece` | | Public functions | | --- | | `[Container](#structtensorflow_1_1ops_1_1_add_sparse_to_tensors_map_1_1_attrs_1a6f199ca8eef007518e06b7e4ee2d2a8a)(StringPiece x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_add_sparse_to_tensors_map_1_1_attrs)` The container name for the `SparseTensorsMap` created by this op. | | `[SharedName](#structtensorflow_1_1ops_1_1_add_sparse_to_tensors_map_1_1_attrs_1a37694d0089598479b9b717bf8166883c)(StringPiece x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_add_sparse_to_tensors_map_1_1_attrs)` The shared name for the `SparseTensorsMap` created by this op. | Public attributes ----------------- ### container\_ ``` StringPiece tensorflow::ops::AddSparseToTensorsMap::Attrs::container_ = "" ``` ### shared\_name\_ ``` StringPiece tensorflow::ops::AddSparseToTensorsMap::Attrs::shared_name_ = "" ``` Public functions ---------------- ### Container ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::AddSparseToTensorsMap::Attrs::Container( StringPiece x ) ``` The container name for the `SparseTensorsMap` created by this op. Defaults to "" ### SharedName ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::AddSparseToTensorsMap::Attrs::SharedName( StringPiece x ) ``` The shared name for the `SparseTensorsMap` created by this op. If blank, the new [Operation](../../../../class/tensorflow/operation#classtensorflow_1_1_operation)'s unique name is used. Defaults to ""
programming_docs
tensorflow_cpp tensorflow::ops::QuantizedMatMul::Attrs tensorflow::ops::QuantizedMatMul::Attrs ======================================= `#include <math_ops.h>` Optional attribute setters for [QuantizedMatMul](../../../../class/tensorflow/ops/quantized-mat-mul#classtensorflow_1_1ops_1_1_quantized_mat_mul). Summary ------- | Public attributes | | --- | | `[Tactivation\_](#structtensorflow_1_1ops_1_1_quantized_mat_mul_1_1_attrs_1a4ec61ca1633c71f9778635daa7a1891a) = DT_QUINT8` | `DataType` | | `[Toutput\_](#structtensorflow_1_1ops_1_1_quantized_mat_mul_1_1_attrs_1a2d64400431cee46f3b2f01ebce918312) = DT_QINT32` | `DataType` | | `[transpose\_a\_](#structtensorflow_1_1ops_1_1_quantized_mat_mul_1_1_attrs_1a5be09bd03f0fdf0b4e57cb33664361e8) = false` | `bool` | | `[transpose\_b\_](#structtensorflow_1_1ops_1_1_quantized_mat_mul_1_1_attrs_1a633d7f13c23dea40282a3b296d7f996c) = false` | `bool` | | Public functions | | --- | | `[Tactivation](#structtensorflow_1_1ops_1_1_quantized_mat_mul_1_1_attrs_1a6e5cb6be951ef2554cc04296ad0bffad)(DataType x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_quantized_mat_mul_1_1_attrs)` The type of output produced by activation function following this operation. | | `[Toutput](#structtensorflow_1_1ops_1_1_quantized_mat_mul_1_1_attrs_1af3a761ecd8ebc7dad74137b6a11e172f)(DataType x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_quantized_mat_mul_1_1_attrs)` Defaults to DT\_QINT32. | | `[TransposeA](#structtensorflow_1_1ops_1_1_quantized_mat_mul_1_1_attrs_1a960ecd4efbd8278fac1812933e2ec61a)(bool x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_quantized_mat_mul_1_1_attrs)` If true, `a` is transposed before multiplication. | | `[TransposeB](#structtensorflow_1_1ops_1_1_quantized_mat_mul_1_1_attrs_1af6da7dd47a4cd0b885ee662f29745f93)(bool x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_quantized_mat_mul_1_1_attrs)` If true, `b` is transposed before multiplication. | Public attributes ----------------- ### Tactivation\_ ``` DataType tensorflow::ops::QuantizedMatMul::Attrs::Tactivation_ = DT_QUINT8 ``` ### Toutput\_ ``` DataType tensorflow::ops::QuantizedMatMul::Attrs::Toutput_ = DT_QINT32 ``` ### transpose\_a\_ ``` bool tensorflow::ops::QuantizedMatMul::Attrs::transpose_a_ = false ``` ### transpose\_b\_ ``` bool tensorflow::ops::QuantizedMatMul::Attrs::transpose_b_ = false ``` Public functions ---------------- ### Tactivation ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::QuantizedMatMul::Attrs::Tactivation( DataType x ) ``` The type of output produced by activation function following this operation. Defaults to DT\_QUINT8 ### Toutput ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::QuantizedMatMul::Attrs::Toutput( DataType x ) ``` Defaults to DT\_QINT32. ### TransposeA ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::QuantizedMatMul::Attrs::TransposeA( bool x ) ``` If true, `a` is transposed before multiplication. Defaults to false ### TransposeB ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::QuantizedMatMul::Attrs::TransposeB( bool x ) ``` If true, `b` is transposed before multiplication. Defaults to false tensorflow_cpp tensorflow::ops::ResourceApplyAdadelta::Attrs tensorflow::ops::ResourceApplyAdadelta::Attrs ============================================= `#include <training_ops.h>` Optional attribute setters for [ResourceApplyAdadelta](../../../../class/tensorflow/ops/resource-apply-adadelta#classtensorflow_1_1ops_1_1_resource_apply_adadelta). Summary ------- | Public attributes | | --- | | `[use\_locking\_](#structtensorflow_1_1ops_1_1_resource_apply_adadelta_1_1_attrs_1aedb93047cdafe59c49329a8d8170ad5e) = false` | `bool` | | Public functions | | --- | | `[UseLocking](#structtensorflow_1_1ops_1_1_resource_apply_adadelta_1_1_attrs_1a69a581dad6bc9084ff7479b1e79d503b)(bool x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_resource_apply_adadelta_1_1_attrs)` If True, updating of the var, accum and update\_accum tensors will be protected by a lock; otherwise the behavior is undefined, but may exhibit less contention. | Public attributes ----------------- ### use\_locking\_ ``` bool tensorflow::ops::ResourceApplyAdadelta::Attrs::use_locking_ = false ``` Public functions ---------------- ### UseLocking ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::ResourceApplyAdadelta::Attrs::UseLocking( bool x ) ``` If True, updating of the var, accum and update\_accum tensors will be protected by a lock; otherwise the behavior is undefined, but may exhibit less contention. Defaults to false tensorflow_cpp tensorflow::ops::OrderedMapStage::Attrs tensorflow::ops::OrderedMapStage::Attrs ======================================= `#include <data_flow_ops.h>` Optional attribute setters for [OrderedMapStage](../../../../class/tensorflow/ops/ordered-map-stage#classtensorflow_1_1ops_1_1_ordered_map_stage). Summary ------- | Public attributes | | --- | | `[capacity\_](#structtensorflow_1_1ops_1_1_ordered_map_stage_1_1_attrs_1a45a52b9dc9aba755adc2370e606402ab) = 0` | `int64` | | `[container\_](#structtensorflow_1_1ops_1_1_ordered_map_stage_1_1_attrs_1a0ddc543129edcfcd2a0022975776640e) = ""` | `StringPiece` | | `[memory\_limit\_](#structtensorflow_1_1ops_1_1_ordered_map_stage_1_1_attrs_1a86141369972472225a548dbf9cae092a) = 0` | `int64` | | `[shared\_name\_](#structtensorflow_1_1ops_1_1_ordered_map_stage_1_1_attrs_1af50fabc6f73e4a35f4592d1cb15a3258) = ""` | `StringPiece` | | Public functions | | --- | | `[Capacity](#structtensorflow_1_1ops_1_1_ordered_map_stage_1_1_attrs_1a36ab9438a367ad1eb4ae2fbf3b6edcb0)(int64 x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_ordered_map_stage_1_1_attrs)` [Maximum](../../../../class/tensorflow/ops/maximum#classtensorflow_1_1ops_1_1_maximum) number of elements in the Staging Area. | | `[Container](#structtensorflow_1_1ops_1_1_ordered_map_stage_1_1_attrs_1a39e6ada81b77d3a43ec78dd81d5cee8f)(StringPiece x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_ordered_map_stage_1_1_attrs)` If non-empty, this queue is placed in the given container. | | `[MemoryLimit](#structtensorflow_1_1ops_1_1_ordered_map_stage_1_1_attrs_1a00ceb3471f8a90f66f7a8322a2e00711)(int64 x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_ordered_map_stage_1_1_attrs)` Defaults to 0. | | `[SharedName](#structtensorflow_1_1ops_1_1_ordered_map_stage_1_1_attrs_1a22c56388b4687ac4633cdb29edce7416)(StringPiece x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_ordered_map_stage_1_1_attrs)` It is necessary to match this name to the matching [Unstage](../../../../class/tensorflow/ops/unstage#classtensorflow_1_1ops_1_1_unstage) Op. | Public attributes ----------------- ### capacity\_ ``` int64 tensorflow::ops::OrderedMapStage::Attrs::capacity_ = 0 ``` ### container\_ ``` StringPiece tensorflow::ops::OrderedMapStage::Attrs::container_ = "" ``` ### memory\_limit\_ ``` int64 tensorflow::ops::OrderedMapStage::Attrs::memory_limit_ = 0 ``` ### shared\_name\_ ``` StringPiece tensorflow::ops::OrderedMapStage::Attrs::shared_name_ = "" ``` Public functions ---------------- ### Capacity ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::OrderedMapStage::Attrs::Capacity( int64 x ) ``` [Maximum](../../../../class/tensorflow/ops/maximum#classtensorflow_1_1ops_1_1_maximum) number of elements in the Staging Area. If > 0, inserts on the container will block when the capacity is reached. Defaults to 0 ### Container ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::OrderedMapStage::Attrs::Container( StringPiece x ) ``` If non-empty, this queue is placed in the given container. Otherwise, a default container is used. Defaults to "" ### MemoryLimit ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::OrderedMapStage::Attrs::MemoryLimit( int64 x ) ``` Defaults to 0. ### SharedName ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::OrderedMapStage::Attrs::SharedName( StringPiece x ) ``` It is necessary to match this name to the matching [Unstage](../../../../class/tensorflow/ops/unstage#classtensorflow_1_1ops_1_1_unstage) Op. Defaults to "" tensorflow_cpp tensorflow::ops::Variable::Attrs tensorflow::ops::Variable::Attrs ================================ `#include <state_ops.h>` Optional attribute setters for [Variable](../../../../class/tensorflow/ops/variable#classtensorflow_1_1ops_1_1_variable). Summary ------- | Public attributes | | --- | | `[container\_](#structtensorflow_1_1ops_1_1_variable_1_1_attrs_1a6e4b22d4fd5ffc4577ae074f5e8326fd) = ""` | `StringPiece` | | `[shared\_name\_](#structtensorflow_1_1ops_1_1_variable_1_1_attrs_1ad319f0780ed16ffc06c0b37dde1d48c9) = ""` | `StringPiece` | | Public functions | | --- | | `[Container](#structtensorflow_1_1ops_1_1_variable_1_1_attrs_1a03383bc7015aaa7a15753a1efd13f261)(StringPiece x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_variable_1_1_attrs)` If non-empty, this variable is placed in the given container. | | `[SharedName](#structtensorflow_1_1ops_1_1_variable_1_1_attrs_1aa39e5eb0fe345d5dbf228ead0475f83b)(StringPiece x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_variable_1_1_attrs)` If non-empty, this variable is named in the given bucket with this shared\_name. | Public attributes ----------------- ### container\_ ``` StringPiece tensorflow::ops::Variable::Attrs::container_ = "" ``` ### shared\_name\_ ``` StringPiece tensorflow::ops::Variable::Attrs::shared_name_ = "" ``` Public functions ---------------- ### Container ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::Variable::Attrs::Container( StringPiece x ) ``` If non-empty, this variable is placed in the given container. Otherwise, a default container is used. Defaults to "" ### SharedName ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::Variable::Attrs::SharedName( StringPiece x ) ``` If non-empty, this variable is named in the given bucket with this shared\_name. Otherwise, the node name is used instead. Defaults to "" tensorflow_cpp tensorflow::ops::MaxPoolGradGradV2::Attrs tensorflow::ops::MaxPoolGradGradV2::Attrs ========================================= `#include <nn_ops.h>` Optional attribute setters for [MaxPoolGradGradV2](../../../../class/tensorflow/ops/max-pool-grad-grad-v2#classtensorflow_1_1ops_1_1_max_pool_grad_grad_v2). Summary ------- | Public attributes | | --- | | `[data\_format\_](#structtensorflow_1_1ops_1_1_max_pool_grad_grad_v2_1_1_attrs_1ac7759e6f4fb0ada3020b68d84dbca473) = "NHWC"` | `StringPiece` | | Public functions | | --- | | `[DataFormat](#structtensorflow_1_1ops_1_1_max_pool_grad_grad_v2_1_1_attrs_1a3aaf93ad55a7bef6d47fd97e65ff0d05)(StringPiece x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_max_pool_grad_grad_v2_1_1_attrs)` Specify the data format of the input and output data. | Public attributes ----------------- ### data\_format\_ ``` StringPiece tensorflow::ops::MaxPoolGradGradV2::Attrs::data_format_ = "NHWC" ``` Public functions ---------------- ### DataFormat ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::MaxPoolGradGradV2::Attrs::DataFormat( StringPiece x ) ``` Specify the data format of the input and output data. With the default format "NHWC", the data is stored in the order of: [batch, in\_height, in\_width, in\_channels]. Alternatively, the format could be "NCHW", the data storage order of: [batch, in\_channels, in\_height, in\_width]. Defaults to "NHWC" tensorflow_cpp tensorflow::ops::Angle::Attrs tensorflow::ops::Angle::Attrs ============================= `#include <math_ops.h>` Optional attribute setters for [Angle](../../../../class/tensorflow/ops/angle#classtensorflow_1_1ops_1_1_angle). Summary ------- | Public attributes | | --- | | `[Tout\_](#structtensorflow_1_1ops_1_1_angle_1_1_attrs_1ac72226fad785ff972e1c63a9aae89d8c) = DT_FLOAT` | `DataType` | | Public functions | | --- | | `[Tout](#structtensorflow_1_1ops_1_1_angle_1_1_attrs_1aa50ebbac4ca3d83bad4b6e60ca49a72b)(DataType x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_angle_1_1_attrs)` Defaults to DT\_FLOAT. | Public attributes ----------------- ### Tout\_ ``` DataType tensorflow::ops::Angle::Attrs::Tout_ = DT_FLOAT ``` Public functions ---------------- ### Tout ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::Angle::Attrs::Tout( DataType x ) ``` Defaults to DT\_FLOAT. tensorflow_cpp tensorflow::ops::QuantizeAndDequantizeV2::Attrs tensorflow::ops::QuantizeAndDequantizeV2::Attrs =============================================== `#include <array_ops.h>` Optional attribute setters for [QuantizeAndDequantizeV2](../../../../class/tensorflow/ops/quantize-and-dequantize-v2#classtensorflow_1_1ops_1_1_quantize_and_dequantize_v2). Summary ------- | Public attributes | | --- | | `[axis\_](#structtensorflow_1_1ops_1_1_quantize_and_dequantize_v2_1_1_attrs_1a315bdca31eedd36ca93926e243fa1936) = -1` | `int64` | | `[narrow\_range\_](#structtensorflow_1_1ops_1_1_quantize_and_dequantize_v2_1_1_attrs_1adf347e0c1f8214c14d7694ae285cc9d0) = false` | `bool` | | `[num\_bits\_](#structtensorflow_1_1ops_1_1_quantize_and_dequantize_v2_1_1_attrs_1a11159f89f2414130b6a3ad313b27716c) = 8` | `int64` | | `[range\_given\_](#structtensorflow_1_1ops_1_1_quantize_and_dequantize_v2_1_1_attrs_1a865cf4c82b9089b872eb9b918531f2db) = false` | `bool` | | `[round\_mode\_](#structtensorflow_1_1ops_1_1_quantize_and_dequantize_v2_1_1_attrs_1a6dfc7a75f4a69171c6497bb1edfa0d05) = "HALF_TO_EVEN"` | `StringPiece` | | `[signed\_input\_](#structtensorflow_1_1ops_1_1_quantize_and_dequantize_v2_1_1_attrs_1a790cd895eec69aba604ac8e9cb7f8a9f) = true` | `bool` | | Public functions | | --- | | `[Axis](#structtensorflow_1_1ops_1_1_quantize_and_dequantize_v2_1_1_attrs_1a763f00e13bdab9fb43c917bbc70cf634)(int64 x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_quantize_and_dequantize_v2_1_1_attrs)` If specified, this axis is treated as a channel or slice axis, and a separate quantization range is used for each channel or slice along this axis. | | `[NarrowRange](#structtensorflow_1_1ops_1_1_quantize_and_dequantize_v2_1_1_attrs_1afaceca0792d45c8137aeb043c8cfda94)(bool x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_quantize_and_dequantize_v2_1_1_attrs)` If True, then the absolute value of the quantized minimum value is the same as the quantized maximum value, instead of 1 greater. | | `[NumBits](#structtensorflow_1_1ops_1_1_quantize_and_dequantize_v2_1_1_attrs_1a76057cdbc84759b92af376d7af6e5542)(int64 x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_quantize_and_dequantize_v2_1_1_attrs)` The bitwidth of the quantization. | | `[RangeGiven](#structtensorflow_1_1ops_1_1_quantize_and_dequantize_v2_1_1_attrs_1a6fa06a82baf6f5d343626b0ff362f28b)(bool x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_quantize_and_dequantize_v2_1_1_attrs)` Whether the range is given or should be determined from the `input` tensor. | | `[RoundMode](#structtensorflow_1_1ops_1_1_quantize_and_dequantize_v2_1_1_attrs_1abbc6241855f1eb74e6c30f9bb38a9bea)(StringPiece x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_quantize_and_dequantize_v2_1_1_attrs)` The 'round\_mode' attribute controls which rounding tie-breaking algorithm is used when rounding float values to their quantized equivalents. | | `[SignedInput](#structtensorflow_1_1ops_1_1_quantize_and_dequantize_v2_1_1_attrs_1acc49af3428f348e5f27485c3d72e5598)(bool x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_quantize_and_dequantize_v2_1_1_attrs)` Whether the quantization is signed or unsigned. | Public attributes ----------------- ### axis\_ ``` int64 tensorflow::ops::QuantizeAndDequantizeV2::Attrs::axis_ = -1 ``` ### narrow\_range\_ ``` bool tensorflow::ops::QuantizeAndDequantizeV2::Attrs::narrow_range_ = false ``` ### num\_bits\_ ``` int64 tensorflow::ops::QuantizeAndDequantizeV2::Attrs::num_bits_ = 8 ``` ### range\_given\_ ``` bool tensorflow::ops::QuantizeAndDequantizeV2::Attrs::range_given_ = false ``` ### round\_mode\_ ``` StringPiece tensorflow::ops::QuantizeAndDequantizeV2::Attrs::round_mode_ = "HALF_TO_EVEN" ``` ### signed\_input\_ ``` bool tensorflow::ops::QuantizeAndDequantizeV2::Attrs::signed_input_ = true ``` Public functions ---------------- ### Axis ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::QuantizeAndDequantizeV2::Attrs::Axis( int64 x ) ``` If specified, this axis is treated as a channel or slice axis, and a separate quantization range is used for each channel or slice along this axis. Defaults to -1 ### NarrowRange ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::QuantizeAndDequantizeV2::Attrs::NarrowRange( bool x ) ``` If True, then the absolute value of the quantized minimum value is the same as the quantized maximum value, instead of 1 greater. i.e. for 8 bit quantization, the minimum value is -127 instead of -128. Defaults to false ### NumBits ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::QuantizeAndDequantizeV2::Attrs::NumBits( int64 x ) ``` The bitwidth of the quantization. Defaults to 8 ### RangeGiven ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::QuantizeAndDequantizeV2::Attrs::RangeGiven( bool x ) ``` Whether the range is given or should be determined from the `input` tensor. Defaults to false ### RoundMode ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::QuantizeAndDequantizeV2::Attrs::RoundMode( StringPiece x ) ``` The 'round\_mode' attribute controls which rounding tie-breaking algorithm is used when rounding float values to their quantized equivalents. The following rounding modes are currently supported: * HALF\_TO\_EVEN: this is the default round\_mode. * HALF\_UP: round towards positive. In this mode 7.5 rounds up to 8 and -7.5 rounds up to -7. Defaults to "HALF\_TO\_EVEN" ### SignedInput ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::QuantizeAndDequantizeV2::Attrs::SignedInput( bool x ) ``` Whether the quantization is signed or unsigned. (actually this parameter should have been called **`signed_output`** ) Defaults to true tensorflow_cpp tensorflow::ops::MaxPoolGradGradWithArgmax::Attrs tensorflow::ops::MaxPoolGradGradWithArgmax::Attrs ================================================= `#include <nn_ops.h>` Optional attribute setters for [MaxPoolGradGradWithArgmax](../../../../class/tensorflow/ops/max-pool-grad-grad-with-argmax#classtensorflow_1_1ops_1_1_max_pool_grad_grad_with_argmax). Summary ------- | Public attributes | | --- | | `[include\_batch\_in\_index\_](#structtensorflow_1_1ops_1_1_max_pool_grad_grad_with_argmax_1_1_attrs_1ae4a64a2f9facd6822d3cfc4f5e133cee) = false` | `bool` | | Public functions | | --- | | `[IncludeBatchInIndex](#structtensorflow_1_1ops_1_1_max_pool_grad_grad_with_argmax_1_1_attrs_1a18fe9791479d59f3ec88b432b8813e61)(bool x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_max_pool_grad_grad_with_argmax_1_1_attrs)` Whether to include batch dimension in flattened index of `argmax`. | Public attributes ----------------- ### include\_batch\_in\_index\_ ``` bool tensorflow::ops::MaxPoolGradGradWithArgmax::Attrs::include_batch_in_index_ = false ``` Public functions ---------------- ### IncludeBatchInIndex ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::MaxPoolGradGradWithArgmax::Attrs::IncludeBatchInIndex( bool x ) ``` Whether to include batch dimension in flattened index of `argmax`. Defaults to false
programming_docs
tensorflow_cpp tensorflow::ops::SparseMatMul::Attrs tensorflow::ops::SparseMatMul::Attrs ==================================== `#include <math_ops.h>` Optional attribute setters for [SparseMatMul](../../../../class/tensorflow/ops/sparse-mat-mul#classtensorflow_1_1ops_1_1_sparse_mat_mul). Summary ------- | Public attributes | | --- | | `[a\_is\_sparse\_](#structtensorflow_1_1ops_1_1_sparse_mat_mul_1_1_attrs_1a219dfa0045a43e11367d6fa0e419d694) = false` | `bool` | | `[b\_is\_sparse\_](#structtensorflow_1_1ops_1_1_sparse_mat_mul_1_1_attrs_1ab8bf8ccf3e940a8eefad45deb4235f3e) = false` | `bool` | | `[transpose\_a\_](#structtensorflow_1_1ops_1_1_sparse_mat_mul_1_1_attrs_1afbc567a258f6c37c04b676f7af1b6591) = false` | `bool` | | `[transpose\_b\_](#structtensorflow_1_1ops_1_1_sparse_mat_mul_1_1_attrs_1adfc9b795544db29e532549f1cc88cd3a) = false` | `bool` | | Public functions | | --- | | `[AIsSparse](#structtensorflow_1_1ops_1_1_sparse_mat_mul_1_1_attrs_1a1fbb08d2c79c2827e06031e795c56643)(bool x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_sparse_mat_mul_1_1_attrs)` Defaults to false. | | `[BIsSparse](#structtensorflow_1_1ops_1_1_sparse_mat_mul_1_1_attrs_1af57e5e340bc46d0d80929e1de6c4d427)(bool x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_sparse_mat_mul_1_1_attrs)` Defaults to false. | | `[TransposeA](#structtensorflow_1_1ops_1_1_sparse_mat_mul_1_1_attrs_1a4d68b90356d5ecd0d6a2e5c02d36166a)(bool x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_sparse_mat_mul_1_1_attrs)` Defaults to false. | | `[TransposeB](#structtensorflow_1_1ops_1_1_sparse_mat_mul_1_1_attrs_1a323ae5349e0f7af0a123a752ee8e33fd)(bool x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_sparse_mat_mul_1_1_attrs)` Defaults to false. | Public attributes ----------------- ### a\_is\_sparse\_ ``` bool tensorflow::ops::SparseMatMul::Attrs::a_is_sparse_ = false ``` ### b\_is\_sparse\_ ``` bool tensorflow::ops::SparseMatMul::Attrs::b_is_sparse_ = false ``` ### transpose\_a\_ ``` bool tensorflow::ops::SparseMatMul::Attrs::transpose_a_ = false ``` ### transpose\_b\_ ``` bool tensorflow::ops::SparseMatMul::Attrs::transpose_b_ = false ``` Public functions ---------------- ### AIsSparse ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::SparseMatMul::Attrs::AIsSparse( bool x ) ``` Defaults to false. ### BIsSparse ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::SparseMatMul::Attrs::BIsSparse( bool x ) ``` Defaults to false. ### TransposeA ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::SparseMatMul::Attrs::TransposeA( bool x ) ``` Defaults to false. ### TransposeB ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::SparseMatMul::Attrs::TransposeB( bool x ) ``` Defaults to false. tensorflow_cpp tensorflow::ops::StringLower::Attrs tensorflow::ops::StringLower::Attrs =================================== `#include <string_ops.h>` Optional attribute setters for [StringLower](../../../../class/tensorflow/ops/string-lower#classtensorflow_1_1ops_1_1_string_lower). Summary ------- | Public attributes | | --- | | `[encoding\_](#structtensorflow_1_1ops_1_1_string_lower_1_1_attrs_1ae593720ef576ce19d69cc28a6e65e046) = ""` | `StringPiece` | | Public functions | | --- | | `[Encoding](#structtensorflow_1_1ops_1_1_string_lower_1_1_attrs_1a1c8c82a20caf74e3331df587b36d939a)(StringPiece x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_string_lower_1_1_attrs)` Character encoding of `input`. | Public attributes ----------------- ### encoding\_ ``` StringPiece tensorflow::ops::StringLower::Attrs::encoding_ = "" ``` Public functions ---------------- ### Encoding ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::StringLower::Attrs::Encoding( StringPiece x ) ``` Character encoding of `input`. Allowed values are '' and 'utf-8'. Value '' is interpreted as ASCII. Defaults to "" tensorflow_cpp tensorflow::ops::SparseTensorDenseMatMul::Attrs tensorflow::ops::SparseTensorDenseMatMul::Attrs =============================================== `#include <sparse_ops.h>` Optional attribute setters for [SparseTensorDenseMatMul](../../../../class/tensorflow/ops/sparse-tensor-dense-mat-mul#classtensorflow_1_1ops_1_1_sparse_tensor_dense_mat_mul). Summary ------- | Public attributes | | --- | | `[adjoint\_a\_](#structtensorflow_1_1ops_1_1_sparse_tensor_dense_mat_mul_1_1_attrs_1aba2e77bbaf2a86ba93f57ec7bc468e46) = false` | `bool` | | `[adjoint\_b\_](#structtensorflow_1_1ops_1_1_sparse_tensor_dense_mat_mul_1_1_attrs_1a9f87c8fcf81d584c6c4a76f3967a1a72) = false` | `bool` | | Public functions | | --- | | `[AdjointA](#structtensorflow_1_1ops_1_1_sparse_tensor_dense_mat_mul_1_1_attrs_1a17b67c139195583cd837dd085a1fb0c1)(bool x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_sparse_tensor_dense_mat_mul_1_1_attrs)` Use the adjoint of A in the matrix multiply. | | `[AdjointB](#structtensorflow_1_1ops_1_1_sparse_tensor_dense_mat_mul_1_1_attrs_1a6bb6e41a87b69ca9ff57673c31f6034a)(bool x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_sparse_tensor_dense_mat_mul_1_1_attrs)` Use the adjoint of B in the matrix multiply. | Public attributes ----------------- ### adjoint\_a\_ ``` bool tensorflow::ops::SparseTensorDenseMatMul::Attrs::adjoint_a_ = false ``` ### adjoint\_b\_ ``` bool tensorflow::ops::SparseTensorDenseMatMul::Attrs::adjoint_b_ = false ``` Public functions ---------------- ### AdjointA ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::SparseTensorDenseMatMul::Attrs::AdjointA( bool x ) ``` Use the adjoint of A in the matrix multiply. If A is complex, this is transpose(conj(A)). Otherwise it's transpose(A). Defaults to false ### AdjointB ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::SparseTensorDenseMatMul::Attrs::AdjointB( bool x ) ``` Use the adjoint of B in the matrix multiply. If B is complex, this is transpose(conj(B)). Otherwise it's transpose(B). Defaults to false tensorflow_cpp tensorflow::ops::BarrierClose::Attrs tensorflow::ops::BarrierClose::Attrs ==================================== `#include <data_flow_ops.h>` Optional attribute setters for [BarrierClose](../../../../class/tensorflow/ops/barrier-close#classtensorflow_1_1ops_1_1_barrier_close). Summary ------- | Public attributes | | --- | | `[cancel\_pending\_enqueues\_](#structtensorflow_1_1ops_1_1_barrier_close_1_1_attrs_1ab1dc592b05a8bb3491a8230b43ea719c) = false` | `bool` | | Public functions | | --- | | `[CancelPendingEnqueues](#structtensorflow_1_1ops_1_1_barrier_close_1_1_attrs_1a40057f3edbb48bbc7756552300b69689)(bool x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_barrier_close_1_1_attrs)` If true, all pending enqueue requests that are blocked on the barrier's queue will be canceled. | Public attributes ----------------- ### cancel\_pending\_enqueues\_ ``` bool tensorflow::ops::BarrierClose::Attrs::cancel_pending_enqueues_ = false ``` Public functions ---------------- ### CancelPendingEnqueues ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::BarrierClose::Attrs::CancelPendingEnqueues( bool x ) ``` If true, all pending enqueue requests that are blocked on the barrier's queue will be canceled. InsertMany will fail, even if no new key is introduced. Defaults to false tensorflow_cpp tensorflow::ops::Complex::Attrs tensorflow::ops::Complex::Attrs =============================== `#include <math_ops.h>` Optional attribute setters for [Complex](../../../../class/tensorflow/ops/complex#classtensorflow_1_1ops_1_1_complex). Summary ------- | Public attributes | | --- | | `[Tout\_](#structtensorflow_1_1ops_1_1_complex_1_1_attrs_1a34de604775ababbb94647d66cea5f752) = DT_COMPLEX64` | `DataType` | | Public functions | | --- | | `[Tout](#structtensorflow_1_1ops_1_1_complex_1_1_attrs_1a0371d19656bc10d511909f1a1daf8fe2)(DataType x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_complex_1_1_attrs)` Defaults to DT\_COMPLEX64. | Public attributes ----------------- ### Tout\_ ``` DataType tensorflow::ops::Complex::Attrs::Tout_ = DT_COMPLEX64 ``` Public functions ---------------- ### Tout ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::Complex::Attrs::Tout( DataType x ) ``` Defaults to DT\_COMPLEX64. tensorflow_cpp tensorflow::ops::TensorArray::Attrs tensorflow::ops::TensorArray::Attrs =================================== `#include <data_flow_ops.h>` Optional attribute setters for [TensorArray](../../../../class/tensorflow/ops/tensor-array#classtensorflow_1_1ops_1_1_tensor_array). Summary ------- | Public attributes | | --- | | `[clear\_after\_read\_](#structtensorflow_1_1ops_1_1_tensor_array_1_1_attrs_1adf69f46749934d660c3721550ea1c03a) = true` | `bool` | | `[dynamic\_size\_](#structtensorflow_1_1ops_1_1_tensor_array_1_1_attrs_1a8ad7c8391ad0b235dfdfd5a6db9732e3) = false` | `bool` | | `[element\_shape\_](#structtensorflow_1_1ops_1_1_tensor_array_1_1_attrs_1a72e5eb3fb8c00fe4a457046e3ebbaabf) = ::tensorflow::PartialTensorShape()` | `PartialTensorShape` | | `[identical\_element\_shapes\_](#structtensorflow_1_1ops_1_1_tensor_array_1_1_attrs_1a54f4ec465ff422399336316e2593ecd1) = false` | `bool` | | `[tensor\_array\_name\_](#structtensorflow_1_1ops_1_1_tensor_array_1_1_attrs_1abf20ffc7391f652ec55c110cc1ef6a62) = ""` | `StringPiece` | | Public functions | | --- | | `[ClearAfterRead](#structtensorflow_1_1ops_1_1_tensor_array_1_1_attrs_1afd43b315da52533acfc34c6cf9bb6d0c)(bool x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_tensor_array_1_1_attrs)` If true (default), Tensors in the [TensorArray](../../../../class/tensorflow/ops/tensor-array#classtensorflow_1_1ops_1_1_tensor_array) are cleared after being read. | | `[DynamicSize](#structtensorflow_1_1ops_1_1_tensor_array_1_1_attrs_1a2e7a4d021eec60921c502ca0af09cfd1)(bool x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_tensor_array_1_1_attrs)` A boolean that determines whether writes to the [TensorArray](../../../../class/tensorflow/ops/tensor-array#classtensorflow_1_1ops_1_1_tensor_array) are allowed to grow the size. | | `[ElementShape](#structtensorflow_1_1ops_1_1_tensor_array_1_1_attrs_1aa6759843dcee15a20ca580b47055468c)(PartialTensorShape x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_tensor_array_1_1_attrs)` The expected shape of an element, if known. | | `[IdenticalElementShapes](#structtensorflow_1_1ops_1_1_tensor_array_1_1_attrs_1a821ffb1df33eb2716154fe6c0ed03284)(bool x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_tensor_array_1_1_attrs)` If true (default is false), then all elements in the [TensorArray](../../../../class/tensorflow/ops/tensor-array#classtensorflow_1_1ops_1_1_tensor_array) will be expected to have identical shapes. | | `[TensorArrayName](#structtensorflow_1_1ops_1_1_tensor_array_1_1_attrs_1a8ba097c423bc48c48ee1d8ac417dd021)(StringPiece x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_tensor_array_1_1_attrs)` Overrides the name used for the temporary tensor\_array resource. | Public attributes ----------------- ### clear\_after\_read\_ ``` bool tensorflow::ops::TensorArray::Attrs::clear_after_read_ = true ``` ### dynamic\_size\_ ``` bool tensorflow::ops::TensorArray::Attrs::dynamic_size_ = false ``` ### element\_shape\_ ``` PartialTensorShape tensorflow::ops::TensorArray::Attrs::element_shape_ = ::tensorflow::PartialTensorShape() ``` ### identical\_element\_shapes\_ ``` bool tensorflow::ops::TensorArray::Attrs::identical_element_shapes_ = false ``` ### tensor\_array\_name\_ ``` StringPiece tensorflow::ops::TensorArray::Attrs::tensor_array_name_ = "" ``` Public functions ---------------- ### ClearAfterRead ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::TensorArray::Attrs::ClearAfterRead( bool x ) ``` If true (default), Tensors in the [TensorArray](../../../../class/tensorflow/ops/tensor-array#classtensorflow_1_1ops_1_1_tensor_array) are cleared after being read. This disables multiple read semantics but allows early release of memory. Defaults to true ### DynamicSize ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::TensorArray::Attrs::DynamicSize( bool x ) ``` A boolean that determines whether writes to the [TensorArray](../../../../class/tensorflow/ops/tensor-array#classtensorflow_1_1ops_1_1_tensor_array) are allowed to grow the size. By default, this is not allowed. Defaults to false ### ElementShape ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::TensorArray::Attrs::ElementShape( PartialTensorShape x ) ``` The expected shape of an element, if known. Used to validate the shapes of [TensorArray](../../../../class/tensorflow/ops/tensor-array#classtensorflow_1_1ops_1_1_tensor_array) elements. If this shape is not fully specified, gathering zero-size TensorArrays is an error. Defaults to ### IdenticalElementShapes ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::TensorArray::Attrs::IdenticalElementShapes( bool x ) ``` If true (default is false), then all elements in the [TensorArray](../../../../class/tensorflow/ops/tensor-array#classtensorflow_1_1ops_1_1_tensor_array) will be expected to have identical shapes. This allows certain behaviors, like dynamically checking for consistent shapes on write, and being able to fill in properly shaped zero tensors on stack even if the element\_shape attribute is not fully defined. Defaults to false ### TensorArrayName ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::TensorArray::Attrs::TensorArrayName( StringPiece x ) ``` Overrides the name used for the temporary tensor\_array resource. Default value is the name of the '[TensorArray](../../../../class/tensorflow/ops/tensor-array#classtensorflow_1_1ops_1_1_tensor_array)' op (which is guaranteed unique). Defaults to "" tensorflow_cpp tensorflow::ops::Cast::Attrs tensorflow::ops::Cast::Attrs ============================ `#include <math_ops.h>` Optional attribute setters for [Cast](../../../../class/tensorflow/ops/cast#classtensorflow_1_1ops_1_1_cast). Summary ------- | Public attributes | | --- | | `[Truncate\_](#structtensorflow_1_1ops_1_1_cast_1_1_attrs_1ab3c35dcc1573db2c72a9357c741c4e6e) = false` | `bool` | | Public functions | | --- | | `[Truncate](#structtensorflow_1_1ops_1_1_cast_1_1_attrs_1a1f874413618cb9ba3d302e9f5795ed9f)(bool x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_cast_1_1_attrs)` Defaults to false. | Public attributes ----------------- ### Truncate\_ ``` bool tensorflow::ops::Cast::Attrs::Truncate_ = false ``` Public functions ---------------- ### Truncate ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::Cast::Attrs::Truncate( bool x ) ``` Defaults to false. tensorflow_cpp tensorflow::ops::ApplyFtrl::Attrs tensorflow::ops::ApplyFtrl::Attrs ================================= `#include <training_ops.h>` Optional attribute setters for [ApplyFtrl](../../../../class/tensorflow/ops/apply-ftrl#classtensorflow_1_1ops_1_1_apply_ftrl). Summary ------- | Public attributes | | --- | | `[multiply\_linear\_by\_lr\_](#structtensorflow_1_1ops_1_1_apply_ftrl_1_1_attrs_1af00ba91f7e39936b6fff36a11ddfd68b) = false` | `bool` | | `[use\_locking\_](#structtensorflow_1_1ops_1_1_apply_ftrl_1_1_attrs_1a43866e817d38793fc46f1ff522424205) = false` | `bool` | | Public functions | | --- | | `[MultiplyLinearByLr](#structtensorflow_1_1ops_1_1_apply_ftrl_1_1_attrs_1abf8dad0c2cf1e22a76101ff345918210)(bool x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_apply_ftrl_1_1_attrs)` Defaults to false. | | `[UseLocking](#structtensorflow_1_1ops_1_1_apply_ftrl_1_1_attrs_1a36a310dfa74c9a811cf83d8995e51294)(bool x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_apply_ftrl_1_1_attrs)` If `True`, updating of the var and accum tensors will be protected by a lock; otherwise the behavior is undefined, but may exhibit less contention. | Public attributes ----------------- ### multiply\_linear\_by\_lr\_ ``` bool tensorflow::ops::ApplyFtrl::Attrs::multiply_linear_by_lr_ = false ``` ### use\_locking\_ ``` bool tensorflow::ops::ApplyFtrl::Attrs::use_locking_ = false ``` Public functions ---------------- ### MultiplyLinearByLr ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::ApplyFtrl::Attrs::MultiplyLinearByLr( bool x ) ``` Defaults to false. ### UseLocking ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::ApplyFtrl::Attrs::UseLocking( bool x ) ``` If `True`, updating of the var and accum tensors will be protected by a lock; otherwise the behavior is undefined, but may exhibit less contention. Defaults to false tensorflow_cpp tensorflow::ops::DepthwiseConv2dNativeBackpropInput::Attrs tensorflow::ops::DepthwiseConv2dNativeBackpropInput::Attrs ========================================================== `#include <nn_ops.h>` Optional attribute setters for [DepthwiseConv2dNativeBackpropInput](../../../../class/tensorflow/ops/depthwise-conv2d-native-backprop-input#classtensorflow_1_1ops_1_1_depthwise_conv2d_native_backprop_input). Summary ------- | Public attributes | | --- | | `[data\_format\_](#structtensorflow_1_1ops_1_1_depthwise_conv2d_native_backprop_input_1_1_attrs_1a26f5fbb513bf1e765c25e6c4f1a04cc7) = "NHWC"` | `StringPiece` | | `[dilations\_](#structtensorflow_1_1ops_1_1_depthwise_conv2d_native_backprop_input_1_1_attrs_1acb24883dc03d2d9afad50540635d020d) = Default_dilations()` | `gtl::ArraySlice< int >` | | `[explicit\_paddings\_](#structtensorflow_1_1ops_1_1_depthwise_conv2d_native_backprop_input_1_1_attrs_1ace4fc3544cf9c2a87e36da0c75b958f7) = {}` | `gtl::ArraySlice< int >` | | Public functions | | --- | | `[DataFormat](#structtensorflow_1_1ops_1_1_depthwise_conv2d_native_backprop_input_1_1_attrs_1a9ea5e2ace7b86cb61ba6276927a29be4)(StringPiece x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_depthwise_conv2d_native_backprop_input_1_1_attrs)` Specify the data format of the input and output data. | | `[Dilations](#structtensorflow_1_1ops_1_1_depthwise_conv2d_native_backprop_input_1_1_attrs_1acdab720d55c0c8d0d22f2031e83b6bc1)(const gtl::ArraySlice< int > & x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_depthwise_conv2d_native_backprop_input_1_1_attrs)` 1-D tensor of length 4. | | `[ExplicitPaddings](#structtensorflow_1_1ops_1_1_depthwise_conv2d_native_backprop_input_1_1_attrs_1a643d3bee1772d2fb03abc54ceecd5063)(const gtl::ArraySlice< int > & x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_depthwise_conv2d_native_backprop_input_1_1_attrs)` Defaults to []. | Public attributes ----------------- ### data\_format\_ ``` StringPiece tensorflow::ops::DepthwiseConv2dNativeBackpropInput::Attrs::data_format_ = "NHWC" ``` ### dilations\_ ``` gtl::ArraySlice< int > tensorflow::ops::DepthwiseConv2dNativeBackpropInput::Attrs::dilations_ = Default_dilations() ``` ### explicit\_paddings\_ ``` gtl::ArraySlice< int > tensorflow::ops::DepthwiseConv2dNativeBackpropInput::Attrs::explicit_paddings_ = {} ``` Public functions ---------------- ### DataFormat ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::DepthwiseConv2dNativeBackpropInput::Attrs::DataFormat( StringPiece x ) ``` Specify the data format of the input and output data. With the default format "NHWC", the data is stored in the order of: [batch, height, width, channels]. Alternatively, the format could be "NCHW", the data storage order of: [batch, channels, height, width]. Defaults to "NHWC" ### Dilations ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::DepthwiseConv2dNativeBackpropInput::Attrs::Dilations( const gtl::ArraySlice< int > & x ) ``` 1-D tensor of length 4. The dilation factor for each dimension of `input`. If set to k > 1, there will be k-1 skipped cells between each filter element on that dimension. The dimension order is determined by the value of `data_format`, see above for details. Dilations in the batch and depth dimensions must be 1. Defaults to [1, 1, 1, 1] ### ExplicitPaddings ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::DepthwiseConv2dNativeBackpropInput::Attrs::ExplicitPaddings( const gtl::ArraySlice< int > & x ) ``` Defaults to [].
programming_docs
tensorflow_cpp tensorflow::ops::SampleDistortedBoundingBoxV2::Attrs tensorflow::ops::SampleDistortedBoundingBoxV2::Attrs ==================================================== `#include <image_ops.h>` Optional attribute setters for [SampleDistortedBoundingBoxV2](../../../../class/tensorflow/ops/sample-distorted-bounding-box-v2#classtensorflow_1_1ops_1_1_sample_distorted_bounding_box_v2). Summary ------- | Public attributes | | --- | | `[area\_range\_](#structtensorflow_1_1ops_1_1_sample_distorted_bounding_box_v2_1_1_attrs_1a69ae593a1a5a7780e524e2356d2faff8) = Default_area_range()` | `gtl::ArraySlice< float >` | | `[aspect\_ratio\_range\_](#structtensorflow_1_1ops_1_1_sample_distorted_bounding_box_v2_1_1_attrs_1a0c4e44eabfe7afab174ee2f85df1726d) = Default_aspect_ratio_range()` | `gtl::ArraySlice< float >` | | `[max\_attempts\_](#structtensorflow_1_1ops_1_1_sample_distorted_bounding_box_v2_1_1_attrs_1a730472cdd7975ef9d970e1f8b5023364) = 100` | `int64` | | `[seed2\_](#structtensorflow_1_1ops_1_1_sample_distorted_bounding_box_v2_1_1_attrs_1a7c9b9d92bf0a822f1545d6ca832b0422) = 0` | `int64` | | `[seed\_](#structtensorflow_1_1ops_1_1_sample_distorted_bounding_box_v2_1_1_attrs_1acff1116d6929f772cb713fe9a3d32eeb) = 0` | `int64` | | `[use\_image\_if\_no\_bounding\_boxes\_](#structtensorflow_1_1ops_1_1_sample_distorted_bounding_box_v2_1_1_attrs_1ad86cffc54629ac12206d2c500e0779cb) = false` | `bool` | | Public functions | | --- | | `[AreaRange](#structtensorflow_1_1ops_1_1_sample_distorted_bounding_box_v2_1_1_attrs_1a8df62937b62cff944feb1b8fa311ded7)(const gtl::ArraySlice< float > & x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_sample_distorted_bounding_box_v2_1_1_attrs)` The cropped area of the image must contain a fraction of the supplied image within this range. | | `[AspectRatioRange](#structtensorflow_1_1ops_1_1_sample_distorted_bounding_box_v2_1_1_attrs_1a3cbee228822ba7b22c16480f4b924bf0)(const gtl::ArraySlice< float > & x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_sample_distorted_bounding_box_v2_1_1_attrs)` The cropped area of the image must have an aspect ratio = width / height within this range. | | `[MaxAttempts](#structtensorflow_1_1ops_1_1_sample_distorted_bounding_box_v2_1_1_attrs_1a3d45be2446f3ad2895375dc1dad9cc0b)(int64 x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_sample_distorted_bounding_box_v2_1_1_attrs)` Number of attempts at generating a cropped region of the image of the specified constraints. | | `[Seed](#structtensorflow_1_1ops_1_1_sample_distorted_bounding_box_v2_1_1_attrs_1adc049c4ba5c6fdd2d276098deeb8c992)(int64 x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_sample_distorted_bounding_box_v2_1_1_attrs)` If either `seed` or `seed2` are set to non-zero, the random number generator is seeded by the given `seed`. | | `[Seed2](#structtensorflow_1_1ops_1_1_sample_distorted_bounding_box_v2_1_1_attrs_1a676c3cc02479e14a7f557fe7d469cb93)(int64 x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_sample_distorted_bounding_box_v2_1_1_attrs)` A second seed to avoid seed collision. | | `[UseImageIfNoBoundingBoxes](#structtensorflow_1_1ops_1_1_sample_distorted_bounding_box_v2_1_1_attrs_1a3179a059c42359549522461cb227d6c3)(bool x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_sample_distorted_bounding_box_v2_1_1_attrs)` Controls behavior if no bounding boxes supplied. | Public attributes ----------------- ### area\_range\_ ``` gtl::ArraySlice< float > tensorflow::ops::SampleDistortedBoundingBoxV2::Attrs::area_range_ = Default_area_range() ``` ### aspect\_ratio\_range\_ ``` gtl::ArraySlice< float > tensorflow::ops::SampleDistortedBoundingBoxV2::Attrs::aspect_ratio_range_ = Default_aspect_ratio_range() ``` ### max\_attempts\_ ``` int64 tensorflow::ops::SampleDistortedBoundingBoxV2::Attrs::max_attempts_ = 100 ``` ### seed2\_ ``` int64 tensorflow::ops::SampleDistortedBoundingBoxV2::Attrs::seed2_ = 0 ``` ### seed\_ ``` int64 tensorflow::ops::SampleDistortedBoundingBoxV2::Attrs::seed_ = 0 ``` ### use\_image\_if\_no\_bounding\_boxes\_ ``` bool tensorflow::ops::SampleDistortedBoundingBoxV2::Attrs::use_image_if_no_bounding_boxes_ = false ``` Public functions ---------------- ### AreaRange ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::SampleDistortedBoundingBoxV2::Attrs::AreaRange( const gtl::ArraySlice< float > & x ) ``` The cropped area of the image must contain a fraction of the supplied image within this range. Defaults to [0.05, 1] ### AspectRatioRange ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::SampleDistortedBoundingBoxV2::Attrs::AspectRatioRange( const gtl::ArraySlice< float > & x ) ``` The cropped area of the image must have an aspect ratio = width / height within this range. Defaults to [0.75, 1.33] ### MaxAttempts ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::SampleDistortedBoundingBoxV2::Attrs::MaxAttempts( int64 x ) ``` Number of attempts at generating a cropped region of the image of the specified constraints. After `max_attempts` failures, return the entire image. Defaults to 100 ### Seed ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::SampleDistortedBoundingBoxV2::Attrs::Seed( int64 x ) ``` If either `seed` or `seed2` are set to non-zero, the random number generator is seeded by the given `seed`. Otherwise, it is seeded by a random seed. Defaults to 0 ### Seed2 ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::SampleDistortedBoundingBoxV2::Attrs::Seed2( int64 x ) ``` A second seed to avoid seed collision. Defaults to 0 ### UseImageIfNoBoundingBoxes ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::SampleDistortedBoundingBoxV2::Attrs::UseImageIfNoBoundingBoxes( bool x ) ``` Controls behavior if no bounding boxes supplied. If true, assume an implicit bounding box covering the whole input. If false, raise an error. Defaults to false tensorflow_cpp tensorflow::ops::ExtractJpegShape::Attrs tensorflow::ops::ExtractJpegShape::Attrs ======================================== `#include <image_ops.h>` Optional attribute setters for [ExtractJpegShape](../../../../class/tensorflow/ops/extract-jpeg-shape#classtensorflow_1_1ops_1_1_extract_jpeg_shape). Summary ------- | Public attributes | | --- | | `[output\_type\_](#structtensorflow_1_1ops_1_1_extract_jpeg_shape_1_1_attrs_1a351677b955d77dcb56f49f22495bf4c3) = DT_INT32` | `DataType` | | Public functions | | --- | | `[OutputType](#structtensorflow_1_1ops_1_1_extract_jpeg_shape_1_1_attrs_1a33e9816fa3869da862c20af6aca684b7)(DataType x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_extract_jpeg_shape_1_1_attrs)` (Optional) The output type of the operation (int32 or int64). | Public attributes ----------------- ### output\_type\_ ``` DataType tensorflow::ops::ExtractJpegShape::Attrs::output_type_ = DT_INT32 ``` Public functions ---------------- ### OutputType ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::ExtractJpegShape::Attrs::OutputType( DataType x ) ``` (Optional) The output type of the operation (int32 or int64). Defaults to int32. Defaults to DT\_INT32 tensorflow_cpp tensorflow::ops::ParseSequenceExample::Attrs tensorflow::ops::ParseSequenceExample::Attrs ============================================ `#include <parsing_ops.h>` Optional attribute setters for [ParseSequenceExample](../../../../class/tensorflow/ops/parse-sequence-example#classtensorflow_1_1ops_1_1_parse_sequence_example). Summary ------- | Public attributes | | --- | | `[Ncontext\_dense\_](#structtensorflow_1_1ops_1_1_parse_sequence_example_1_1_attrs_1ac17a70531fb7d9bac99e73220299216f) = 0` | `int64` | | `[Ncontext\_sparse\_](#structtensorflow_1_1ops_1_1_parse_sequence_example_1_1_attrs_1a7267b6a313171b1c379a33e2f25eba25) = 0` | `int64` | | `[Nfeature\_list\_dense\_](#structtensorflow_1_1ops_1_1_parse_sequence_example_1_1_attrs_1a42f6d2c184d5fac2f0cb05c384ff5082) = 0` | `int64` | | `[Nfeature\_list\_sparse\_](#structtensorflow_1_1ops_1_1_parse_sequence_example_1_1_attrs_1a090e20c0b0c1f5be0e30da10b3210d60) = 0` | `int64` | | `[context\_dense\_shapes\_](#structtensorflow_1_1ops_1_1_parse_sequence_example_1_1_attrs_1a1c22599e2208dbf4010e7314b4d8fe59) = {}` | `gtl::ArraySlice< PartialTensorShape >` | | `[context\_sparse\_types\_](#structtensorflow_1_1ops_1_1_parse_sequence_example_1_1_attrs_1a88fd6e4349374bbc5ecea3f5fc666fa0) = {}` | `DataTypeSlice` | | `[feature\_list\_dense\_shapes\_](#structtensorflow_1_1ops_1_1_parse_sequence_example_1_1_attrs_1ad7b925df6db57915b2a79f9209783c7e) = {}` | `gtl::ArraySlice< PartialTensorShape >` | | `[feature\_list\_dense\_types\_](#structtensorflow_1_1ops_1_1_parse_sequence_example_1_1_attrs_1ab2858a6a52415eb9b39d98683e8cb2ca) = {}` | `DataTypeSlice` | | `[feature\_list\_sparse\_types\_](#structtensorflow_1_1ops_1_1_parse_sequence_example_1_1_attrs_1ab11ac986d0e04836f1ff6ae6be8b1165) = {}` | `DataTypeSlice` | | Public functions | | --- | | `[ContextDenseShapes](#structtensorflow_1_1ops_1_1_parse_sequence_example_1_1_attrs_1afda1c2a4f20c141bb94f5b6893b91e90)(const gtl::ArraySlice< PartialTensorShape > & x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_parse_sequence_example_1_1_attrs)` A list of Ncontext\_dense shapes; the shapes of data in each context Feature given in context\_dense\_keys. | | `[ContextSparseTypes](#structtensorflow_1_1ops_1_1_parse_sequence_example_1_1_attrs_1a3c7594d814f40b934bdb96f7c9e1962f)(const DataTypeSlice & x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_parse_sequence_example_1_1_attrs)` A list of Ncontext\_sparse types; the data types of data in each context Feature given in context\_sparse\_keys. | | `[FeatureListDenseShapes](#structtensorflow_1_1ops_1_1_parse_sequence_example_1_1_attrs_1a45e9cfb7e46d71908897a9c7deb1c16f)(const gtl::ArraySlice< PartialTensorShape > & x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_parse_sequence_example_1_1_attrs)` A list of Nfeature\_list\_dense shapes; the shapes of data in each FeatureList given in feature\_list\_dense\_keys. | | `[FeatureListDenseTypes](#structtensorflow_1_1ops_1_1_parse_sequence_example_1_1_attrs_1a251456608b42e19305bef7f870f2c26b)(const DataTypeSlice & x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_parse_sequence_example_1_1_attrs)` Defaults to []. | | `[FeatureListSparseTypes](#structtensorflow_1_1ops_1_1_parse_sequence_example_1_1_attrs_1ad3342f91dc76ca34a46e21922cac216b)(const DataTypeSlice & x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_parse_sequence_example_1_1_attrs)` A list of Nfeature\_list\_sparse types; the data types of data in each FeatureList given in feature\_list\_sparse\_keys. | | `[NcontextDense](#structtensorflow_1_1ops_1_1_parse_sequence_example_1_1_attrs_1a6f3f08b5256e4d3a4a567ee17d2e6b48)(int64 x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_parse_sequence_example_1_1_attrs)` Defaults to 0. | | `[NcontextSparse](#structtensorflow_1_1ops_1_1_parse_sequence_example_1_1_attrs_1a432066b15ab843b1fab687f5c836a862)(int64 x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_parse_sequence_example_1_1_attrs)` Defaults to 0. | | `[NfeatureListDense](#structtensorflow_1_1ops_1_1_parse_sequence_example_1_1_attrs_1ab8d70685df066f0e233ef678998abd98)(int64 x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_parse_sequence_example_1_1_attrs)` Defaults to 0. | | `[NfeatureListSparse](#structtensorflow_1_1ops_1_1_parse_sequence_example_1_1_attrs_1aeabe8ba43df8b1f3bdd2db18303e5642)(int64 x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_parse_sequence_example_1_1_attrs)` Defaults to 0. | Public attributes ----------------- ### Ncontext\_dense\_ ``` int64 tensorflow::ops::ParseSequenceExample::Attrs::Ncontext_dense_ = 0 ``` ### Ncontext\_sparse\_ ``` int64 tensorflow::ops::ParseSequenceExample::Attrs::Ncontext_sparse_ = 0 ``` ### Nfeature\_list\_dense\_ ``` int64 tensorflow::ops::ParseSequenceExample::Attrs::Nfeature_list_dense_ = 0 ``` ### Nfeature\_list\_sparse\_ ``` int64 tensorflow::ops::ParseSequenceExample::Attrs::Nfeature_list_sparse_ = 0 ``` ### context\_dense\_shapes\_ ``` gtl::ArraySlice< PartialTensorShape > tensorflow::ops::ParseSequenceExample::Attrs::context_dense_shapes_ = {} ``` ### context\_sparse\_types\_ ``` DataTypeSlice tensorflow::ops::ParseSequenceExample::Attrs::context_sparse_types_ = {} ``` ### feature\_list\_dense\_shapes\_ ``` gtl::ArraySlice< PartialTensorShape > tensorflow::ops::ParseSequenceExample::Attrs::feature_list_dense_shapes_ = {} ``` ### feature\_list\_dense\_types\_ ``` DataTypeSlice tensorflow::ops::ParseSequenceExample::Attrs::feature_list_dense_types_ = {} ``` ### feature\_list\_sparse\_types\_ ``` DataTypeSlice tensorflow::ops::ParseSequenceExample::Attrs::feature_list_sparse_types_ = {} ``` Public functions ---------------- ### ContextDenseShapes ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::ParseSequenceExample::Attrs::ContextDenseShapes( const gtl::ArraySlice< PartialTensorShape > & x ) ``` A list of Ncontext\_dense shapes; the shapes of data in each context Feature given in context\_dense\_keys. The number of elements in the Feature corresponding to context\_dense\_key[j] must always equal context\_dense\_shapes[j].NumEntries(). The shape of context\_dense\_values[j] will match context\_dense\_shapes[j]. Defaults to [] ### ContextSparseTypes ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::ParseSequenceExample::Attrs::ContextSparseTypes( const DataTypeSlice & x ) ``` A list of Ncontext\_sparse types; the data types of data in each context Feature given in context\_sparse\_keys. Currently the [ParseSingleSequenceExample](../../../../class/tensorflow/ops/parse-single-sequence-example#classtensorflow_1_1ops_1_1_parse_single_sequence_example) supports DT\_FLOAT (FloatList), DT\_INT64 (Int64List), and DT\_STRING (BytesList). Defaults to [] ### FeatureListDenseShapes ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::ParseSequenceExample::Attrs::FeatureListDenseShapes( const gtl::ArraySlice< PartialTensorShape > & x ) ``` A list of Nfeature\_list\_dense shapes; the shapes of data in each FeatureList given in feature\_list\_dense\_keys. The shape of each Feature in the FeatureList corresponding to feature\_list\_dense\_key[j] must always equal feature\_list\_dense\_shapes[j].NumEntries(). Defaults to [] ### FeatureListDenseTypes ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::ParseSequenceExample::Attrs::FeatureListDenseTypes( const DataTypeSlice & x ) ``` Defaults to []. ### FeatureListSparseTypes ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::ParseSequenceExample::Attrs::FeatureListSparseTypes( const DataTypeSlice & x ) ``` A list of Nfeature\_list\_sparse types; the data types of data in each FeatureList given in feature\_list\_sparse\_keys. Currently the [ParseSingleSequenceExample](../../../../class/tensorflow/ops/parse-single-sequence-example#classtensorflow_1_1ops_1_1_parse_single_sequence_example) supports DT\_FLOAT (FloatList), DT\_INT64 (Int64List), and DT\_STRING (BytesList). Defaults to [] ### NcontextDense ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::ParseSequenceExample::Attrs::NcontextDense( int64 x ) ``` Defaults to 0. ### NcontextSparse ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::ParseSequenceExample::Attrs::NcontextSparse( int64 x ) ``` Defaults to 0. ### NfeatureListDense ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::ParseSequenceExample::Attrs::NfeatureListDense( int64 x ) ``` Defaults to 0. ### NfeatureListSparse ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::ParseSequenceExample::Attrs::NfeatureListSparse( int64 x ) ``` Defaults to 0. tensorflow_cpp tensorflow::ops::SparseBincount::Attrs tensorflow::ops::SparseBincount::Attrs ====================================== `#include <math_ops.h>` Optional attribute setters for [SparseBincount](../../../../class/tensorflow/ops/sparse-bincount#classtensorflow_1_1ops_1_1_sparse_bincount). Summary ------- | Public attributes | | --- | | `[binary\_output\_](#structtensorflow_1_1ops_1_1_sparse_bincount_1_1_attrs_1a4ab03243b6cf625d4c87dedca123bf3b) = false` | `bool` | | Public functions | | --- | | `[BinaryOutput](#structtensorflow_1_1ops_1_1_sparse_bincount_1_1_attrs_1a5ebb7b95e5c813f6316b37e0016011d9)(bool x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_sparse_bincount_1_1_attrs)` bool; Whether the kernel should count the appearance or number of occurrences. | Public attributes ----------------- ### binary\_output\_ ``` bool tensorflow::ops::SparseBincount::Attrs::binary_output_ = false ``` Public functions ---------------- ### BinaryOutput ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::SparseBincount::Attrs::BinaryOutput( bool x ) ``` bool; Whether the kernel should count the appearance or number of occurrences. Defaults to false tensorflow_cpp tensorflow::ops::ScatterUpdate::Attrs tensorflow::ops::ScatterUpdate::Attrs ===================================== `#include <state_ops.h>` Optional attribute setters for [ScatterUpdate](../../../../class/tensorflow/ops/scatter-update#classtensorflow_1_1ops_1_1_scatter_update). Summary ------- | Public attributes | | --- | | `[use\_locking\_](#structtensorflow_1_1ops_1_1_scatter_update_1_1_attrs_1ae8abc728e4ef2bb67e3c08a6f30564ee) = true` | `bool` | | Public functions | | --- | | `[UseLocking](#structtensorflow_1_1ops_1_1_scatter_update_1_1_attrs_1a3854967f64055e6443ac3788db8b065e)(bool x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_scatter_update_1_1_attrs)` If True, the assignment will be protected by a lock; otherwise the behavior is undefined, but may exhibit less contention. | Public attributes ----------------- ### use\_locking\_ ``` bool tensorflow::ops::ScatterUpdate::Attrs::use_locking_ = true ``` Public functions ---------------- ### UseLocking ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::ScatterUpdate::Attrs::UseLocking( bool x ) ``` If True, the assignment will be protected by a lock; otherwise the behavior is undefined, but may exhibit less contention. Defaults to true tensorflow_cpp tensorflow::ops::Real::Attrs tensorflow::ops::Real::Attrs ============================ `#include <math_ops.h>` Optional attribute setters for [Real](../../../../class/tensorflow/ops/real#classtensorflow_1_1ops_1_1_real). Summary ------- | Public attributes | | --- | | `[Tout\_](#structtensorflow_1_1ops_1_1_real_1_1_attrs_1a845d1456ddeb117fc306fa2aba350402) = DT_FLOAT` | `DataType` | | Public functions | | --- | | `[Tout](#structtensorflow_1_1ops_1_1_real_1_1_attrs_1a9096405ca60347d2dcffec5d6853ead5)(DataType x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_real_1_1_attrs)` Defaults to DT\_FLOAT. | Public attributes ----------------- ### Tout\_ ``` DataType tensorflow::ops::Real::Attrs::Tout_ = DT_FLOAT ``` Public functions ---------------- ### Tout ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::Real::Attrs::Tout( DataType x ) ``` Defaults to DT\_FLOAT. tensorflow_cpp tensorflow::ops::SparseReduceSumSparse::Attrs tensorflow::ops::SparseReduceSumSparse::Attrs ============================================= `#include <sparse_ops.h>` Optional attribute setters for [SparseReduceSumSparse](../../../../class/tensorflow/ops/sparse-reduce-sum-sparse#classtensorflow_1_1ops_1_1_sparse_reduce_sum_sparse). Summary ------- | Public attributes | | --- | | `[keep\_dims\_](#structtensorflow_1_1ops_1_1_sparse_reduce_sum_sparse_1_1_attrs_1afc4481c785e85f1a631747df05514a8f) = false` | `bool` | | Public functions | | --- | | `[KeepDims](#structtensorflow_1_1ops_1_1_sparse_reduce_sum_sparse_1_1_attrs_1afae6c93ace4eb29ddd8454db16776a54)(bool x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_sparse_reduce_sum_sparse_1_1_attrs)` If true, retain reduced dimensions with length 1. | Public attributes ----------------- ### keep\_dims\_ ``` bool tensorflow::ops::SparseReduceSumSparse::Attrs::keep_dims_ = false ``` Public functions ---------------- ### KeepDims ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::SparseReduceSumSparse::Attrs::KeepDims( bool x ) ``` If true, retain reduced dimensions with length 1. Defaults to false
programming_docs
tensorflow_cpp tensorflow::ops::PreventGradient::Attrs tensorflow::ops::PreventGradient::Attrs ======================================= `#include <array_ops.h>` Optional attribute setters for [PreventGradient](../../../../class/tensorflow/ops/prevent-gradient#classtensorflow_1_1ops_1_1_prevent_gradient). Summary ------- | Public attributes | | --- | | `[message\_](#structtensorflow_1_1ops_1_1_prevent_gradient_1_1_attrs_1a85ca8381a662c1cca8aabfe5a0ebc560) = ""` | `StringPiece` | | Public functions | | --- | | `[Message](#structtensorflow_1_1ops_1_1_prevent_gradient_1_1_attrs_1a5fa5b963ff1b0088230db1ecc380bd41)(StringPiece x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_prevent_gradient_1_1_attrs)` Will be printed in the error when anyone tries to differentiate this operation. | Public attributes ----------------- ### message\_ ``` StringPiece tensorflow::ops::PreventGradient::Attrs::message_ = "" ``` Public functions ---------------- ### Message ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::PreventGradient::Attrs::Message( StringPiece x ) ``` Will be printed in the error when anyone tries to differentiate this operation. Defaults to "" tensorflow_cpp tensorflow::ops::ResourceApplyProximalGradientDescent::Attrs tensorflow::ops::ResourceApplyProximalGradientDescent::Attrs ============================================================ `#include <training_ops.h>` Optional attribute setters for [ResourceApplyProximalGradientDescent](../../../../class/tensorflow/ops/resource-apply-proximal-gradient-descent#classtensorflow_1_1ops_1_1_resource_apply_proximal_gradient_descent). Summary ------- | Public attributes | | --- | | `[use\_locking\_](#structtensorflow_1_1ops_1_1_resource_apply_proximal_gradient_descent_1_1_attrs_1a99aede12bcf9bc881f519d21d658a151) = false` | `bool` | | Public functions | | --- | | `[UseLocking](#structtensorflow_1_1ops_1_1_resource_apply_proximal_gradient_descent_1_1_attrs_1a39ae1d80ab2854693a56ab2373821e69)(bool x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_resource_apply_proximal_gradient_descent_1_1_attrs)` If True, the subtraction will be protected by a lock; otherwise the behavior is undefined, but may exhibit less contention. | Public attributes ----------------- ### use\_locking\_ ``` bool tensorflow::ops::ResourceApplyProximalGradientDescent::Attrs::use_locking_ = false ``` Public functions ---------------- ### UseLocking ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::ResourceApplyProximalGradientDescent::Attrs::UseLocking( bool x ) ``` If True, the subtraction will be protected by a lock; otherwise the behavior is undefined, but may exhibit less contention. Defaults to false tensorflow_cpp tensorflow::ops::StringToNumber::Attrs tensorflow::ops::StringToNumber::Attrs ====================================== `#include <parsing_ops.h>` Optional attribute setters for [StringToNumber](../../../../class/tensorflow/ops/string-to-number#classtensorflow_1_1ops_1_1_string_to_number). Summary ------- | Public attributes | | --- | | `[out\_type\_](#structtensorflow_1_1ops_1_1_string_to_number_1_1_attrs_1a7c2aaeddf561bc69e4d64e95fbedb825) = DT_FLOAT` | `DataType` | | Public functions | | --- | | `[OutType](#structtensorflow_1_1ops_1_1_string_to_number_1_1_attrs_1a2ee0ca8b95677dc82c729a454bba9613)(DataType x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_string_to_number_1_1_attrs)` The numeric type to interpret each string in `string_tensor` as. | Public attributes ----------------- ### out\_type\_ ``` DataType tensorflow::ops::StringToNumber::Attrs::out_type_ = DT_FLOAT ``` Public functions ---------------- ### OutType ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::StringToNumber::Attrs::OutType( DataType x ) ``` The numeric type to interpret each string in `string_tensor` as. Defaults to DT\_FLOAT tensorflow_cpp tensorflow::ops::RaggedBincount::Attrs tensorflow::ops::RaggedBincount::Attrs ====================================== `#include <math_ops.h>` Optional attribute setters for [RaggedBincount](../../../../class/tensorflow/ops/ragged-bincount#classtensorflow_1_1ops_1_1_ragged_bincount). Summary ------- | Public attributes | | --- | | `[binary\_output\_](#structtensorflow_1_1ops_1_1_ragged_bincount_1_1_attrs_1af3831a5fc2a5bbabe51fbe3c10c0c173) = false` | `bool` | | Public functions | | --- | | `[BinaryOutput](#structtensorflow_1_1ops_1_1_ragged_bincount_1_1_attrs_1a1ab77b007fc2e24455cad9b71878edb2)(bool x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_ragged_bincount_1_1_attrs)` bool; Whether the kernel should count the appearance or number of occurrences. | Public attributes ----------------- ### binary\_output\_ ``` bool tensorflow::ops::RaggedBincount::Attrs::binary_output_ = false ``` Public functions ---------------- ### BinaryOutput ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::RaggedBincount::Attrs::BinaryOutput( bool x ) ``` bool; Whether the kernel should count the appearance or number of occurrences. Defaults to false tensorflow_cpp tensorflow::ops::ApplyAdadelta::Attrs tensorflow::ops::ApplyAdadelta::Attrs ===================================== `#include <training_ops.h>` Optional attribute setters for [ApplyAdadelta](../../../../class/tensorflow/ops/apply-adadelta#classtensorflow_1_1ops_1_1_apply_adadelta). Summary ------- | Public attributes | | --- | | `[use\_locking\_](#structtensorflow_1_1ops_1_1_apply_adadelta_1_1_attrs_1ada6434c8064b7147215b62013c566444) = false` | `bool` | | Public functions | | --- | | `[UseLocking](#structtensorflow_1_1ops_1_1_apply_adadelta_1_1_attrs_1ac32ed6309626701bd98e3c71e6e96408)(bool x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_apply_adadelta_1_1_attrs)` If True, updating of the var, accum and update\_accum tensors will be protected by a lock; otherwise the behavior is undefined, but may exhibit less contention. | Public attributes ----------------- ### use\_locking\_ ``` bool tensorflow::ops::ApplyAdadelta::Attrs::use_locking_ = false ``` Public functions ---------------- ### UseLocking ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::ApplyAdadelta::Attrs::UseLocking( bool x ) ``` If True, updating of the var, accum and update\_accum tensors will be protected by a lock; otherwise the behavior is undefined, but may exhibit less contention. Defaults to false tensorflow_cpp tensorflow::ops::QueueDequeue::Attrs tensorflow::ops::QueueDequeue::Attrs ==================================== `#include <data_flow_ops.h>` Optional attribute setters for [QueueDequeue](../../../../class/tensorflow/ops/queue-dequeue#classtensorflow_1_1ops_1_1_queue_dequeue). Summary ------- | Public attributes | | --- | | `[timeout\_ms\_](#structtensorflow_1_1ops_1_1_queue_dequeue_1_1_attrs_1aaee37b7d298921335443893778a85c2c) = -1` | `int64` | | Public functions | | --- | | `[TimeoutMs](#structtensorflow_1_1ops_1_1_queue_dequeue_1_1_attrs_1ae5cae84de31d96ec00fa2c9d4b4684c0)(int64 x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_queue_dequeue_1_1_attrs)` If the queue is empty, this operation will block for up to timeout\_ms milliseconds. | Public attributes ----------------- ### timeout\_ms\_ ``` int64 tensorflow::ops::QueueDequeue::Attrs::timeout_ms_ = -1 ``` Public functions ---------------- ### TimeoutMs ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::QueueDequeue::Attrs::TimeoutMs( int64 x ) ``` If the queue is empty, this operation will block for up to timeout\_ms milliseconds. Note: This option is not supported yet. Defaults to -1 tensorflow_cpp tensorflow::ops::ResourceApplyAdam::Attrs tensorflow::ops::ResourceApplyAdam::Attrs ========================================= `#include <training_ops.h>` Optional attribute setters for [ResourceApplyAdam](../../../../class/tensorflow/ops/resource-apply-adam#classtensorflow_1_1ops_1_1_resource_apply_adam). Summary ------- | Public attributes | | --- | | `[use\_locking\_](#structtensorflow_1_1ops_1_1_resource_apply_adam_1_1_attrs_1afbf55305398352fe1be2d2bbd9339b08) = false` | `bool` | | `[use\_nesterov\_](#structtensorflow_1_1ops_1_1_resource_apply_adam_1_1_attrs_1a5e8a99cedd33f1560c8606040cb01665) = false` | `bool` | | Public functions | | --- | | `[UseLocking](#structtensorflow_1_1ops_1_1_resource_apply_adam_1_1_attrs_1acb981ecfa8182b3cf8a3fdcec6150afe)(bool x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_resource_apply_adam_1_1_attrs)` If `True`, updating of the var, m, and v tensors will be protected by a lock; otherwise the behavior is undefined, but may exhibit less contention. | | `[UseNesterov](#structtensorflow_1_1ops_1_1_resource_apply_adam_1_1_attrs_1a5f9d82cec1b929fbe0776fa57d052f1a)(bool x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_resource_apply_adam_1_1_attrs)` If `True`, uses the nesterov update. | Public attributes ----------------- ### use\_locking\_ ``` bool tensorflow::ops::ResourceApplyAdam::Attrs::use_locking_ = false ``` ### use\_nesterov\_ ``` bool tensorflow::ops::ResourceApplyAdam::Attrs::use_nesterov_ = false ``` Public functions ---------------- ### UseLocking ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::ResourceApplyAdam::Attrs::UseLocking( bool x ) ``` If `True`, updating of the var, m, and v tensors will be protected by a lock; otherwise the behavior is undefined, but may exhibit less contention. Defaults to false ### UseNesterov ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::ResourceApplyAdam::Attrs::UseNesterov( bool x ) ``` If `True`, uses the nesterov update. Defaults to false tensorflow_cpp tensorflow::ops::ComplexAbs::Attrs tensorflow::ops::ComplexAbs::Attrs ================================== `#include <math_ops.h>` Optional attribute setters for [ComplexAbs](../../../../class/tensorflow/ops/complex-abs#classtensorflow_1_1ops_1_1_complex_abs). Summary ------- | Public attributes | | --- | | `[Tout\_](#structtensorflow_1_1ops_1_1_complex_abs_1_1_attrs_1a0a8dd3d1b9ef8a907a80a9b9bb960403) = DT_FLOAT` | `DataType` | | Public functions | | --- | | `[Tout](#structtensorflow_1_1ops_1_1_complex_abs_1_1_attrs_1a0ada0e220e445285f74ec12eb1f6ab33)(DataType x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_complex_abs_1_1_attrs)` Defaults to DT\_FLOAT. | Public attributes ----------------- ### Tout\_ ``` DataType tensorflow::ops::ComplexAbs::Attrs::Tout_ = DT_FLOAT ``` Public functions ---------------- ### Tout ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::ComplexAbs::Attrs::Tout( DataType x ) ``` Defaults to DT\_FLOAT. tensorflow_cpp tensorflow::ops::ApplyRMSProp::Attrs tensorflow::ops::ApplyRMSProp::Attrs ==================================== `#include <training_ops.h>` Optional attribute setters for [ApplyRMSProp](../../../../class/tensorflow/ops/apply-r-m-s-prop#classtensorflow_1_1ops_1_1_apply_r_m_s_prop). Summary ------- | Public attributes | | --- | | `[use\_locking\_](#structtensorflow_1_1ops_1_1_apply_r_m_s_prop_1_1_attrs_1a5845a4dc279d1bbe24ab0980b2b4aead) = false` | `bool` | | Public functions | | --- | | `[UseLocking](#structtensorflow_1_1ops_1_1_apply_r_m_s_prop_1_1_attrs_1adc85b286c7de34836e35cfe1eb49fad1)(bool x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_apply_r_m_s_prop_1_1_attrs)` If `True`, updating of the var, ms, and mom tensors is protected by a lock; otherwise the behavior is undefined, but may exhibit less contention. | Public attributes ----------------- ### use\_locking\_ ``` bool tensorflow::ops::ApplyRMSProp::Attrs::use_locking_ = false ``` Public functions ---------------- ### UseLocking ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::ApplyRMSProp::Attrs::UseLocking( bool x ) ``` If `True`, updating of the var, ms, and mom tensors is protected by a lock; otherwise the behavior is undefined, but may exhibit less contention. Defaults to false tensorflow_cpp tensorflow::ops::Multinomial::Attrs tensorflow::ops::Multinomial::Attrs =================================== `#include <random_ops.h>` Optional attribute setters for [Multinomial](../../../../class/tensorflow/ops/multinomial#classtensorflow_1_1ops_1_1_multinomial). Summary ------- | Public attributes | | --- | | `[output\_dtype\_](#structtensorflow_1_1ops_1_1_multinomial_1_1_attrs_1ab780ef6214c4738f84fa7d7c1d3c30a2) = DT_INT64` | `DataType` | | `[seed2\_](#structtensorflow_1_1ops_1_1_multinomial_1_1_attrs_1a82a08448375e48029c843a9e126aa694) = 0` | `int64` | | `[seed\_](#structtensorflow_1_1ops_1_1_multinomial_1_1_attrs_1adafd3d83def44325b7fddcd51efd6df6) = 0` | `int64` | | Public functions | | --- | | `[OutputDtype](#structtensorflow_1_1ops_1_1_multinomial_1_1_attrs_1a2dca6fdeb27b3d8e36ad70feb3975875)(DataType x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_multinomial_1_1_attrs)` Defaults to DT\_INT64. | | `[Seed](#structtensorflow_1_1ops_1_1_multinomial_1_1_attrs_1ab5e1ab794448ce5c3051f8139ddc94d4)(int64 x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_multinomial_1_1_attrs)` If either seed or seed2 is set to be non-zero, the internal random number generator is seeded by the given seed. | | `[Seed2](#structtensorflow_1_1ops_1_1_multinomial_1_1_attrs_1aa85e306b1ffc2d28da1c1989f1b74108)(int64 x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_multinomial_1_1_attrs)` A second seed to avoid seed collision. | Public attributes ----------------- ### output\_dtype\_ ``` DataType tensorflow::ops::Multinomial::Attrs::output_dtype_ = DT_INT64 ``` ### seed2\_ ``` int64 tensorflow::ops::Multinomial::Attrs::seed2_ = 0 ``` ### seed\_ ``` int64 tensorflow::ops::Multinomial::Attrs::seed_ = 0 ``` Public functions ---------------- ### OutputDtype ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::Multinomial::Attrs::OutputDtype( DataType x ) ``` Defaults to DT\_INT64. ### Seed ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::Multinomial::Attrs::Seed( int64 x ) ``` If either seed or seed2 is set to be non-zero, the internal random number generator is seeded by the given seed. Otherwise, a random seed is used. Defaults to 0 ### Seed2 ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::Multinomial::Attrs::Seed2( int64 x ) ``` A second seed to avoid seed collision. Defaults to 0 tensorflow_cpp tensorflow::ops::StringLength::Attrs tensorflow::ops::StringLength::Attrs ==================================== `#include <string_ops.h>` Optional attribute setters for [StringLength](../../../../class/tensorflow/ops/string-length#classtensorflow_1_1ops_1_1_string_length). Summary ------- | Public attributes | | --- | | `[unit\_](#structtensorflow_1_1ops_1_1_string_length_1_1_attrs_1a20ddf74f682ff45eee049cef9c6ebab1) = "BYTE"` | `StringPiece` | | Public functions | | --- | | `[Unit](#structtensorflow_1_1ops_1_1_string_length_1_1_attrs_1ac8d16dcfea721edfcf1fe9ecd4db17d9)(StringPiece x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_string_length_1_1_attrs)` The unit that is counted to compute string length. | Public attributes ----------------- ### unit\_ ``` StringPiece tensorflow::ops::StringLength::Attrs::unit_ = "BYTE" ``` Public functions ---------------- ### Unit ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::StringLength::Attrs::Unit( StringPiece x ) ``` The unit that is counted to compute string length. One of: `"BYTE"` (for the number of bytes in each string) or `"UTF8_CHAR"` (for the number of UTF-8 encoded Unicode code points in each string). Results are undefined if `unit=UTF8_CHAR` and the `input` strings do not contain structurally valid UTF-8. Defaults to "BYTE" tensorflow_cpp tensorflow::ops::ResourceSparseApplyMomentum::Attrs tensorflow::ops::ResourceSparseApplyMomentum::Attrs =================================================== `#include <training_ops.h>` Optional attribute setters for [ResourceSparseApplyMomentum](../../../../class/tensorflow/ops/resource-sparse-apply-momentum#classtensorflow_1_1ops_1_1_resource_sparse_apply_momentum). Summary ------- | Public attributes | | --- | | `[use\_locking\_](#structtensorflow_1_1ops_1_1_resource_sparse_apply_momentum_1_1_attrs_1a827485c686efacdb60adc43db2cafe50) = false` | `bool` | | `[use\_nesterov\_](#structtensorflow_1_1ops_1_1_resource_sparse_apply_momentum_1_1_attrs_1ac513249f4083ebbdd225e272dcb3c91c) = false` | `bool` | | Public functions | | --- | | `[UseLocking](#structtensorflow_1_1ops_1_1_resource_sparse_apply_momentum_1_1_attrs_1abf98d2e230a34b65f4f1293131a7c04d)(bool x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_resource_sparse_apply_momentum_1_1_attrs)` If `True`, updating of the var and accum tensors will be protected by a lock; otherwise the behavior is undefined, but may exhibit less contention. | | `[UseNesterov](#structtensorflow_1_1ops_1_1_resource_sparse_apply_momentum_1_1_attrs_1ae5c7eb0501d057c11a1354d4c86fb994)(bool x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_resource_sparse_apply_momentum_1_1_attrs)` If `True`, the tensor passed to compute grad will be var - lr \* momentum \* accum, so in the end, the var you get is actually var - lr \* momentum \* accum. | Public attributes ----------------- ### use\_locking\_ ``` bool tensorflow::ops::ResourceSparseApplyMomentum::Attrs::use_locking_ = false ``` ### use\_nesterov\_ ``` bool tensorflow::ops::ResourceSparseApplyMomentum::Attrs::use_nesterov_ = false ``` Public functions ---------------- ### UseLocking ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::ResourceSparseApplyMomentum::Attrs::UseLocking( bool x ) ``` If `True`, updating of the var and accum tensors will be protected by a lock; otherwise the behavior is undefined, but may exhibit less contention. Defaults to false ### UseNesterov ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::ResourceSparseApplyMomentum::Attrs::UseNesterov( bool x ) ``` If `True`, the tensor passed to compute grad will be var - lr \* momentum \* accum, so in the end, the var you get is actually var - lr \* momentum \* accum. Defaults to false tensorflow_cpp tensorflow::ops::QueueEnqueueMany::Attrs tensorflow::ops::QueueEnqueueMany::Attrs ======================================== `#include <data_flow_ops.h>` Optional attribute setters for [QueueEnqueueMany](../../../../class/tensorflow/ops/queue-enqueue-many#classtensorflow_1_1ops_1_1_queue_enqueue_many). Summary ------- | Public attributes | | --- | | `[timeout\_ms\_](#structtensorflow_1_1ops_1_1_queue_enqueue_many_1_1_attrs_1aa2ce27a4dfe0e1b98321e5d4e46c33c6) = -1` | `int64` | | Public functions | | --- | | `[TimeoutMs](#structtensorflow_1_1ops_1_1_queue_enqueue_many_1_1_attrs_1af7c89be412905efba3f4e231b5ed9204)(int64 x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_queue_enqueue_many_1_1_attrs)` If the queue is too full, this operation will block for up to timeout\_ms milliseconds. | Public attributes ----------------- ### timeout\_ms\_ ``` int64 tensorflow::ops::QueueEnqueueMany::Attrs::timeout_ms_ = -1 ``` Public functions ---------------- ### TimeoutMs ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::QueueEnqueueMany::Attrs::TimeoutMs( int64 x ) ``` If the queue is too full, this operation will block for up to timeout\_ms milliseconds. Note: This option is not supported yet. Defaults to -1 tensorflow_cpp tensorflow::ops::MatrixDiagV3::Attrs tensorflow::ops::MatrixDiagV3::Attrs ==================================== `#include <array_ops.h>` Optional attribute setters for [MatrixDiagV3](../../../../class/tensorflow/ops/matrix-diag-v3#classtensorflow_1_1ops_1_1_matrix_diag_v3). Summary ------- | Public attributes | | --- | | `[align\_](#structtensorflow_1_1ops_1_1_matrix_diag_v3_1_1_attrs_1aa8def1154da1ef6b6713204d7446e35a) = "RIGHT_LEFT"` | `StringPiece` | | Public functions | | --- | | `[Align](#structtensorflow_1_1ops_1_1_matrix_diag_v3_1_1_attrs_1ab62e0c57734394da6ff0aab875ba49ea)(StringPiece x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_matrix_diag_v3_1_1_attrs)` Some diagonals are shorter than `max_diag_len` and need to be padded. | Public attributes ----------------- ### align\_ ``` StringPiece tensorflow::ops::MatrixDiagV3::Attrs::align_ = "RIGHT_LEFT" ``` Public functions ---------------- ### Align ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::MatrixDiagV3::Attrs::Align( StringPiece x ) ``` Some diagonals are shorter than `max_diag_len` and need to be padded. `align` is a string specifying how superdiagonals and subdiagonals should be aligned, respectively. There are four possible alignments: "RIGHT\_LEFT" (default), "LEFT\_RIGHT", "LEFT\_LEFT", and "RIGHT\_RIGHT". "RIGHT\_LEFT" aligns superdiagonals to the right (left-pads the row) and subdiagonals to the left (right-pads the row). It is the packing format LAPACK uses. cuSPARSE uses "LEFT\_RIGHT", which is the opposite alignment. Defaults to "RIGHT\_LEFT"
programming_docs
tensorflow_cpp tensorflow::ops::SerializeSparse::Attrs tensorflow::ops::SerializeSparse::Attrs ======================================= `#include <sparse_ops.h>` Optional attribute setters for [SerializeSparse](../../../../class/tensorflow/ops/serialize-sparse#classtensorflow_1_1ops_1_1_serialize_sparse). Summary ------- | Public attributes | | --- | | `[out\_type\_](#structtensorflow_1_1ops_1_1_serialize_sparse_1_1_attrs_1ab088346154d2e50e3b6e376f32993817) = DT_STRING` | `DataType` | | Public functions | | --- | | `[OutType](#structtensorflow_1_1ops_1_1_serialize_sparse_1_1_attrs_1a1f8e34079a2ca362dad40166651acadf)(DataType x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_serialize_sparse_1_1_attrs)` The `dtype` to use for serialization; the supported types are `string` (default) and `variant`. | Public attributes ----------------- ### out\_type\_ ``` DataType tensorflow::ops::SerializeSparse::Attrs::out_type_ = DT_STRING ``` Public functions ---------------- ### OutType ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::SerializeSparse::Attrs::OutType( DataType x ) ``` The `dtype` to use for serialization; the supported types are `string` (default) and `variant`. Defaults to DT\_STRING tensorflow_cpp tensorflow::ops::DepthwiseConv2dNativeBackpropFilter::Attrs tensorflow::ops::DepthwiseConv2dNativeBackpropFilter::Attrs =========================================================== `#include <nn_ops.h>` Optional attribute setters for [DepthwiseConv2dNativeBackpropFilter](../../../../class/tensorflow/ops/depthwise-conv2d-native-backprop-filter#classtensorflow_1_1ops_1_1_depthwise_conv2d_native_backprop_filter). Summary ------- | Public attributes | | --- | | `[data\_format\_](#structtensorflow_1_1ops_1_1_depthwise_conv2d_native_backprop_filter_1_1_attrs_1a38aa9a6d4ab45f48b275ffe570064b0b) = "NHWC"` | `StringPiece` | | `[dilations\_](#structtensorflow_1_1ops_1_1_depthwise_conv2d_native_backprop_filter_1_1_attrs_1a2f436ea64c0324e864e09ef887a66826) = Default_dilations()` | `gtl::ArraySlice< int >` | | `[explicit\_paddings\_](#structtensorflow_1_1ops_1_1_depthwise_conv2d_native_backprop_filter_1_1_attrs_1a47c6399ea81495719aa691ea797b9fc4) = {}` | `gtl::ArraySlice< int >` | | Public functions | | --- | | `[DataFormat](#structtensorflow_1_1ops_1_1_depthwise_conv2d_native_backprop_filter_1_1_attrs_1aa879fafb9519a73c69c066b2c3379b63)(StringPiece x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_depthwise_conv2d_native_backprop_filter_1_1_attrs)` Specify the data format of the input and output data. | | `[Dilations](#structtensorflow_1_1ops_1_1_depthwise_conv2d_native_backprop_filter_1_1_attrs_1a8ccba2565ea76edc1d56800c7cbc9a62)(const gtl::ArraySlice< int > & x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_depthwise_conv2d_native_backprop_filter_1_1_attrs)` 1-D tensor of length 4. | | `[ExplicitPaddings](#structtensorflow_1_1ops_1_1_depthwise_conv2d_native_backprop_filter_1_1_attrs_1a1e851826a1b01615ce4681c9382f3fb5)(const gtl::ArraySlice< int > & x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_depthwise_conv2d_native_backprop_filter_1_1_attrs)` Defaults to []. | Public attributes ----------------- ### data\_format\_ ``` StringPiece tensorflow::ops::DepthwiseConv2dNativeBackpropFilter::Attrs::data_format_ = "NHWC" ``` ### dilations\_ ``` gtl::ArraySlice< int > tensorflow::ops::DepthwiseConv2dNativeBackpropFilter::Attrs::dilations_ = Default_dilations() ``` ### explicit\_paddings\_ ``` gtl::ArraySlice< int > tensorflow::ops::DepthwiseConv2dNativeBackpropFilter::Attrs::explicit_paddings_ = {} ``` Public functions ---------------- ### DataFormat ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::DepthwiseConv2dNativeBackpropFilter::Attrs::DataFormat( StringPiece x ) ``` Specify the data format of the input and output data. With the default format "NHWC", the data is stored in the order of: [batch, height, width, channels]. Alternatively, the format could be "NCHW", the data storage order of: [batch, channels, height, width]. Defaults to "NHWC" ### Dilations ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::DepthwiseConv2dNativeBackpropFilter::Attrs::Dilations( const gtl::ArraySlice< int > & x ) ``` 1-D tensor of length 4. The dilation factor for each dimension of `input`. If set to k > 1, there will be k-1 skipped cells between each filter element on that dimension. The dimension order is determined by the value of `data_format`, see above for details. Dilations in the batch and depth dimensions must be 1. Defaults to [1, 1, 1, 1] ### ExplicitPaddings ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::DepthwiseConv2dNativeBackpropFilter::Attrs::ExplicitPaddings( const gtl::ArraySlice< int > & x ) ``` Defaults to []. tensorflow_cpp tensorflow::ops::LRN::Attrs tensorflow::ops::LRN::Attrs =========================== `#include <nn_ops.h>` Optional attribute setters for [LRN](../../../../class/tensorflow/ops/l-r-n#classtensorflow_1_1ops_1_1_l_r_n). Summary ------- | Public attributes | | --- | | `[alpha\_](#structtensorflow_1_1ops_1_1_l_r_n_1_1_attrs_1a96e4ae15c569f3834c4dc592d059975e) = 1.0f` | `float` | | `[beta\_](#structtensorflow_1_1ops_1_1_l_r_n_1_1_attrs_1ab73612c6eb66d4709bdf6a058fd0c8bd) = 0.5f` | `float` | | `[bias\_](#structtensorflow_1_1ops_1_1_l_r_n_1_1_attrs_1ad01ed0552bcde45fa4286039c403c40b) = 1.0f` | `float` | | `[depth\_radius\_](#structtensorflow_1_1ops_1_1_l_r_n_1_1_attrs_1a93ddf2fa1f86831474fe73832c003868) = 5` | `int64` | | Public functions | | --- | | `[Alpha](#structtensorflow_1_1ops_1_1_l_r_n_1_1_attrs_1a9d252abcaa1d05d285caace0a2754d2a)(float x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_l_r_n_1_1_attrs)` A scale factor, usually positive. | | `[Beta](#structtensorflow_1_1ops_1_1_l_r_n_1_1_attrs_1af7c2036a24ffc2d89f2a589d8e7348be)(float x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_l_r_n_1_1_attrs)` An exponent. | | `[Bias](#structtensorflow_1_1ops_1_1_l_r_n_1_1_attrs_1a76bb974a64ea15024227c37d18b6f6f1)(float x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_l_r_n_1_1_attrs)` An offset (usually positive to avoid dividing by 0). | | `[DepthRadius](#structtensorflow_1_1ops_1_1_l_r_n_1_1_attrs_1aaea5f7c6560e9158ff50a68fbd7e7182)(int64 x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_l_r_n_1_1_attrs)` 0-D. | Public attributes ----------------- ### alpha\_ ``` float tensorflow::ops::LRN::Attrs::alpha_ = 1.0f ``` ### beta\_ ``` float tensorflow::ops::LRN::Attrs::beta_ = 0.5f ``` ### bias\_ ``` float tensorflow::ops::LRN::Attrs::bias_ = 1.0f ``` ### depth\_radius\_ ``` int64 tensorflow::ops::LRN::Attrs::depth_radius_ = 5 ``` Public functions ---------------- ### Alpha ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::LRN::Attrs::Alpha( float x ) ``` A scale factor, usually positive. Defaults to 1 ### Beta ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::LRN::Attrs::Beta( float x ) ``` An exponent. Defaults to 0.5 ### Bias ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::LRN::Attrs::Bias( float x ) ``` An offset (usually positive to avoid dividing by 0). Defaults to 1 ### DepthRadius ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::LRN::Attrs::DepthRadius( int64 x ) ``` 0-D. Half-width of the 1-D normalization window. Defaults to 5 tensorflow_cpp tensorflow::ops::Conv2D::Attrs tensorflow::ops::Conv2D::Attrs ============================== `#include <nn_ops.h>` Optional attribute setters for [Conv2D](../../../../class/tensorflow/ops/conv2-d#classtensorflow_1_1ops_1_1_conv2_d). Summary ------- | Public attributes | | --- | | `[data\_format\_](#structtensorflow_1_1ops_1_1_conv2_d_1_1_attrs_1a826b92a551e53c7d7e3f8990dbbdc328) = "NHWC"` | `StringPiece` | | `[dilations\_](#structtensorflow_1_1ops_1_1_conv2_d_1_1_attrs_1a38cfe8f5a9fd31568b79caff3d5db53f) = Default_dilations()` | `gtl::ArraySlice< int >` | | `[explicit\_paddings\_](#structtensorflow_1_1ops_1_1_conv2_d_1_1_attrs_1af6a0a48d47098676589b0c23d6615b73) = {}` | `gtl::ArraySlice< int >` | | `[use\_cudnn\_on\_gpu\_](#structtensorflow_1_1ops_1_1_conv2_d_1_1_attrs_1ac0181cd1c99e758fff22f356f9c51f12) = true` | `bool` | | Public functions | | --- | | `[DataFormat](#structtensorflow_1_1ops_1_1_conv2_d_1_1_attrs_1abafbedb30c29ed091ff37895bd8b6c6a)(StringPiece x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_conv2_d_1_1_attrs)` Specify the data format of the input and output data. | | `[Dilations](#structtensorflow_1_1ops_1_1_conv2_d_1_1_attrs_1a16869b39ea0a373acb40566ed4235eb1)(const gtl::ArraySlice< int > & x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_conv2_d_1_1_attrs)` 1-D tensor of length 4. | | `[ExplicitPaddings](#structtensorflow_1_1ops_1_1_conv2_d_1_1_attrs_1a69865f8fd6ea1e16ccc3e4b794ed3b56)(const gtl::ArraySlice< int > & x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_conv2_d_1_1_attrs)` If `padding` is `"EXPLICIT"`, the list of explicit padding amounts. | | `[UseCudnnOnGpu](#structtensorflow_1_1ops_1_1_conv2_d_1_1_attrs_1a6fb079456a188df93e329f61671ff674)(bool x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_conv2_d_1_1_attrs)` Defaults to true. | Public attributes ----------------- ### data\_format\_ ``` StringPiece tensorflow::ops::Conv2D::Attrs::data_format_ = "NHWC" ``` ### dilations\_ ``` gtl::ArraySlice< int > tensorflow::ops::Conv2D::Attrs::dilations_ = Default_dilations() ``` ### explicit\_paddings\_ ``` gtl::ArraySlice< int > tensorflow::ops::Conv2D::Attrs::explicit_paddings_ = {} ``` ### use\_cudnn\_on\_gpu\_ ``` bool tensorflow::ops::Conv2D::Attrs::use_cudnn_on_gpu_ = true ``` Public functions ---------------- ### DataFormat ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::Conv2D::Attrs::DataFormat( StringPiece x ) ``` Specify the data format of the input and output data. With the default format "NHWC", the data is stored in the order of: [batch, height, width, channels]. Alternatively, the format could be "NCHW", the data storage order of: [batch, channels, height, width]. Defaults to "NHWC" ### Dilations ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::Conv2D::Attrs::Dilations( const gtl::ArraySlice< int > & x ) ``` 1-D tensor of length 4. The dilation factor for each dimension of `input`. If set to k > 1, there will be k-1 skipped cells between each filter element on that dimension. The dimension order is determined by the value of `data_format`, see above for details. Dilations in the batch and depth dimensions must be 1. Defaults to [1, 1, 1, 1] ### ExplicitPaddings ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::Conv2D::Attrs::ExplicitPaddings( const gtl::ArraySlice< int > & x ) ``` If `padding` is `"EXPLICIT"`, the list of explicit padding amounts. For the ith dimension, the amount of padding inserted before and after the dimension is `explicit_paddings[2 * i]` and `explicit_paddings[2 * i + 1]`, respectively. If `padding` is not `"EXPLICIT"`, `explicit_paddings` must be empty. Defaults to [] ### UseCudnnOnGpu ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::Conv2D::Attrs::UseCudnnOnGpu( bool x ) ``` Defaults to true. tensorflow_cpp tensorflow::ops::RandomNormal::Attrs tensorflow::ops::RandomNormal::Attrs ==================================== `#include <random_ops.h>` Optional attribute setters for [RandomNormal](../../../../class/tensorflow/ops/random-normal#classtensorflow_1_1ops_1_1_random_normal). Summary ------- | Public attributes | | --- | | `[seed2\_](#structtensorflow_1_1ops_1_1_random_normal_1_1_attrs_1ad302367a057050556c4ed270ad82e430) = 0` | `int64` | | `[seed\_](#structtensorflow_1_1ops_1_1_random_normal_1_1_attrs_1a682f5af8e6b2b1f37617d3aca6238971) = 0` | `int64` | | Public functions | | --- | | `[Seed](#structtensorflow_1_1ops_1_1_random_normal_1_1_attrs_1ac097ea8c492d19b5bc842616405ebc33)(int64 x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_random_normal_1_1_attrs)` If either `seed` or `seed2` are set to be non-zero, the random number generator is seeded by the given seed. | | `[Seed2](#structtensorflow_1_1ops_1_1_random_normal_1_1_attrs_1afd07d55bb44d1dcf637cf192ae54c8ee)(int64 x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_random_normal_1_1_attrs)` A second seed to avoid seed collision. | Public attributes ----------------- ### seed2\_ ``` int64 tensorflow::ops::RandomNormal::Attrs::seed2_ = 0 ``` ### seed\_ ``` int64 tensorflow::ops::RandomNormal::Attrs::seed_ = 0 ``` Public functions ---------------- ### Seed ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::RandomNormal::Attrs::Seed( int64 x ) ``` If either `seed` or `seed2` are set to be non-zero, the random number generator is seeded by the given seed. Otherwise, it is seeded by a random seed. Defaults to 0 ### Seed2 ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::RandomNormal::Attrs::Seed2( int64 x ) ``` A second seed to avoid seed collision. Defaults to 0 tensorflow_cpp tensorflow::ops::RandomGamma::Attrs tensorflow::ops::RandomGamma::Attrs =================================== `#include <random_ops.h>` Optional attribute setters for [RandomGamma](../../../../class/tensorflow/ops/random-gamma#classtensorflow_1_1ops_1_1_random_gamma). Summary ------- | Public attributes | | --- | | `[seed2\_](#structtensorflow_1_1ops_1_1_random_gamma_1_1_attrs_1a031cb091ec0798df6524cf0587ac20f2) = 0` | `int64` | | `[seed\_](#structtensorflow_1_1ops_1_1_random_gamma_1_1_attrs_1aef6eba784ccd60b0b640c6fa2f19d662) = 0` | `int64` | | Public functions | | --- | | `[Seed](#structtensorflow_1_1ops_1_1_random_gamma_1_1_attrs_1a8058868cb9c9973929ced3198b40155d)(int64 x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_random_gamma_1_1_attrs)` If either `seed` or `seed2` are set to be non-zero, the random number generator is seeded by the given seed. | | `[Seed2](#structtensorflow_1_1ops_1_1_random_gamma_1_1_attrs_1a3291a6d1283b8defce2f97595c31833f)(int64 x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_random_gamma_1_1_attrs)` A second seed to avoid seed collision. | Public attributes ----------------- ### seed2\_ ``` int64 tensorflow::ops::RandomGamma::Attrs::seed2_ = 0 ``` ### seed\_ ``` int64 tensorflow::ops::RandomGamma::Attrs::seed_ = 0 ``` Public functions ---------------- ### Seed ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::RandomGamma::Attrs::Seed( int64 x ) ``` If either `seed` or `seed2` are set to be non-zero, the random number generator is seeded by the given seed. Otherwise, it is seeded by a random seed. Defaults to 0 ### Seed2 ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::RandomGamma::Attrs::Seed2( int64 x ) ``` A second seed to avoid seed collision. Defaults to 0 tensorflow_cpp tensorflow::ops::SparseApplyCenteredRMSProp::Attrs tensorflow::ops::SparseApplyCenteredRMSProp::Attrs ================================================== `#include <training_ops.h>` Optional attribute setters for [SparseApplyCenteredRMSProp](../../../../class/tensorflow/ops/sparse-apply-centered-r-m-s-prop#classtensorflow_1_1ops_1_1_sparse_apply_centered_r_m_s_prop). Summary ------- | Public attributes | | --- | | `[use\_locking\_](#structtensorflow_1_1ops_1_1_sparse_apply_centered_r_m_s_prop_1_1_attrs_1a2f1e3028543d1a032bc1d781018b2533) = false` | `bool` | | Public functions | | --- | | `[UseLocking](#structtensorflow_1_1ops_1_1_sparse_apply_centered_r_m_s_prop_1_1_attrs_1aaa9a314e53bf7f8e8ef7514fd7e84192)(bool x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_sparse_apply_centered_r_m_s_prop_1_1_attrs)` If `True`, updating of the var, mg, ms, and mom tensors is protected by a lock; otherwise the behavior is undefined, but may exhibit less contention. | Public attributes ----------------- ### use\_locking\_ ``` bool tensorflow::ops::SparseApplyCenteredRMSProp::Attrs::use_locking_ = false ``` Public functions ---------------- ### UseLocking ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::SparseApplyCenteredRMSProp::Attrs::UseLocking( bool x ) ``` If `True`, updating of the var, mg, ms, and mom tensors is protected by a lock; otherwise the behavior is undefined, but may exhibit less contention. Defaults to false tensorflow_cpp tensorflow::ops::QuantizedRelu6::Attrs tensorflow::ops::QuantizedRelu6::Attrs ====================================== `#include <nn_ops.h>` Optional attribute setters for [QuantizedRelu6](../../../../class/tensorflow/ops/quantized-relu6#classtensorflow_1_1ops_1_1_quantized_relu6). Summary ------- | Public attributes | | --- | | `[out\_type\_](#structtensorflow_1_1ops_1_1_quantized_relu6_1_1_attrs_1ae83de0bcc5526b0a0707aa09948eae0e) = DT_QUINT8` | `DataType` | | Public functions | | --- | | `[OutType](#structtensorflow_1_1ops_1_1_quantized_relu6_1_1_attrs_1a575b1524f7a3a9700e4a51a00db57ae3)(DataType x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_quantized_relu6_1_1_attrs)` Defaults to DT\_QUINT8. | Public attributes ----------------- ### out\_type\_ ``` DataType tensorflow::ops::QuantizedRelu6::Attrs::out_type_ = DT_QUINT8 ``` Public functions ---------------- ### OutType ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::QuantizedRelu6::Attrs::OutType( DataType x ) ``` Defaults to DT\_QUINT8. tensorflow_cpp tensorflow::ops::DataFormatDimMap::Attrs tensorflow::ops::DataFormatDimMap::Attrs ======================================== `#include <nn_ops.h>` Optional attribute setters for [DataFormatDimMap](../../../../class/tensorflow/ops/data-format-dim-map#classtensorflow_1_1ops_1_1_data_format_dim_map). Summary ------- | Public attributes | | --- | | `[dst\_format\_](#structtensorflow_1_1ops_1_1_data_format_dim_map_1_1_attrs_1aa589a8906ae5486f102e787baf6bd39e) = "NCHW"` | `StringPiece` | | `[src\_format\_](#structtensorflow_1_1ops_1_1_data_format_dim_map_1_1_attrs_1ad67c04eda733006f13f47209df55f035) = "NHWC"` | `StringPiece` | | Public functions | | --- | | `[DstFormat](#structtensorflow_1_1ops_1_1_data_format_dim_map_1_1_attrs_1a609e00984d50001f44ffedb16c3410de)(StringPiece x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_data_format_dim_map_1_1_attrs)` destination data format. | | `[SrcFormat](#structtensorflow_1_1ops_1_1_data_format_dim_map_1_1_attrs_1a72196d84332efe92819a8e7b1e2963dc)(StringPiece x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_data_format_dim_map_1_1_attrs)` source data format. | Public attributes ----------------- ### dst\_format\_ ``` StringPiece tensorflow::ops::DataFormatDimMap::Attrs::dst_format_ = "NCHW" ``` ### src\_format\_ ``` StringPiece tensorflow::ops::DataFormatDimMap::Attrs::src_format_ = "NHWC" ``` Public functions ---------------- ### DstFormat ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::DataFormatDimMap::Attrs::DstFormat( StringPiece x ) ``` destination data format. Defaults to "NCHW" ### SrcFormat ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::DataFormatDimMap::Attrs::SrcFormat( StringPiece x ) ``` source data format. Defaults to "NHWC" tensorflow_cpp tensorflow::ops::RandomUniform::Attrs tensorflow::ops::RandomUniform::Attrs ===================================== `#include <random_ops.h>` Optional attribute setters for [RandomUniform](../../../../class/tensorflow/ops/random-uniform#classtensorflow_1_1ops_1_1_random_uniform). Summary ------- | Public attributes | | --- | | `[seed2\_](#structtensorflow_1_1ops_1_1_random_uniform_1_1_attrs_1ad689294d25c463a7c73afee76cf8a075) = 0` | `int64` | | `[seed\_](#structtensorflow_1_1ops_1_1_random_uniform_1_1_attrs_1aefa9f61d1ff62dff58b23f2be625b7ca) = 0` | `int64` | | Public functions | | --- | | `[Seed](#structtensorflow_1_1ops_1_1_random_uniform_1_1_attrs_1a8571b5a8e02a087a716746ec72d3ea7b)(int64 x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_random_uniform_1_1_attrs)` If either `seed` or `seed2` are set to be non-zero, the random number generator is seeded by the given seed. | | `[Seed2](#structtensorflow_1_1ops_1_1_random_uniform_1_1_attrs_1a54c50a5e1df50ec7be7ebad10102dce8)(int64 x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_random_uniform_1_1_attrs)` A second seed to avoid seed collision. | Public attributes ----------------- ### seed2\_ ``` int64 tensorflow::ops::RandomUniform::Attrs::seed2_ = 0 ``` ### seed\_ ``` int64 tensorflow::ops::RandomUniform::Attrs::seed_ = 0 ``` Public functions ---------------- ### Seed ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::RandomUniform::Attrs::Seed( int64 x ) ``` If either `seed` or `seed2` are set to be non-zero, the random number generator is seeded by the given seed. Otherwise, it is seeded by a random seed. Defaults to 0 ### Seed2 ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::RandomUniform::Attrs::Seed2( int64 x ) ``` A second seed to avoid seed collision. Defaults to 0
programming_docs
tensorflow_cpp tensorflow::ops::EncodeBase64::Attrs tensorflow::ops::EncodeBase64::Attrs ==================================== `#include <string_ops.h>` Optional attribute setters for [EncodeBase64](../../../../class/tensorflow/ops/encode-base64#classtensorflow_1_1ops_1_1_encode_base64). Summary ------- | Public attributes | | --- | | `[pad\_](#structtensorflow_1_1ops_1_1_encode_base64_1_1_attrs_1a6ebabdec4ee1478b219763f3b5216d1a) = false` | `bool` | | Public functions | | --- | | `[Pad](#structtensorflow_1_1ops_1_1_encode_base64_1_1_attrs_1ab6a27d55643f131436441c6bf37e530a)(bool x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_encode_base64_1_1_attrs)` Bool whether padding is applied at the ends. | Public attributes ----------------- ### pad\_ ``` bool tensorflow::ops::EncodeBase64::Attrs::pad_ = false ``` Public functions ---------------- ### Pad ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::EncodeBase64::Attrs::Pad( bool x ) ``` Bool whether padding is applied at the ends. Defaults to false tensorflow_cpp tensorflow::ops::RegexReplace::Attrs tensorflow::ops::RegexReplace::Attrs ==================================== `#include <string_ops.h>` Optional attribute setters for [RegexReplace](../../../../class/tensorflow/ops/regex-replace#classtensorflow_1_1ops_1_1_regex_replace). Summary ------- | Public attributes | | --- | | `[replace\_global\_](#structtensorflow_1_1ops_1_1_regex_replace_1_1_attrs_1a5af07627be1e5135a19c9447eed1b91d) = true` | `bool` | | Public functions | | --- | | `[ReplaceGlobal](#structtensorflow_1_1ops_1_1_regex_replace_1_1_attrs_1a9d0355cf5575240f3f5f4f053ad64bd1)(bool x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_regex_replace_1_1_attrs)` If True, the replacement is global (that is, all matches of the `pattern` regular expression in each input string are rewritten), otherwise the `rewrite` substitution is only made for the first `pattern` match. | Public attributes ----------------- ### replace\_global\_ ``` bool tensorflow::ops::RegexReplace::Attrs::replace_global_ = true ``` Public functions ---------------- ### ReplaceGlobal ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::RegexReplace::Attrs::ReplaceGlobal( bool x ) ``` If True, the replacement is global (that is, all matches of the `pattern` regular expression in each input string are rewritten), otherwise the `rewrite` substitution is only made for the first `pattern` match. Defaults to true tensorflow_cpp tensorflow::ops::DataFormatVecPermute::Attrs tensorflow::ops::DataFormatVecPermute::Attrs ============================================ `#include <nn_ops.h>` Optional attribute setters for [DataFormatVecPermute](../../../../class/tensorflow/ops/data-format-vec-permute#classtensorflow_1_1ops_1_1_data_format_vec_permute). Summary ------- | Public attributes | | --- | | `[dst\_format\_](#structtensorflow_1_1ops_1_1_data_format_vec_permute_1_1_attrs_1a15e089411778ca5d6c1c4d43b2a65812) = "NCHW"` | `StringPiece` | | `[src\_format\_](#structtensorflow_1_1ops_1_1_data_format_vec_permute_1_1_attrs_1ad5e5955455e256874a73fbf8ad92c157) = "NHWC"` | `StringPiece` | | Public functions | | --- | | `[DstFormat](#structtensorflow_1_1ops_1_1_data_format_vec_permute_1_1_attrs_1a298472d88b8467b09cc437ae435e3434)(StringPiece x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_data_format_vec_permute_1_1_attrs)` destination data format. | | `[SrcFormat](#structtensorflow_1_1ops_1_1_data_format_vec_permute_1_1_attrs_1a07cfb0d6b78cab658b6cea32c3f61680)(StringPiece x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_data_format_vec_permute_1_1_attrs)` source data format. | Public attributes ----------------- ### dst\_format\_ ``` StringPiece tensorflow::ops::DataFormatVecPermute::Attrs::dst_format_ = "NCHW" ``` ### src\_format\_ ``` StringPiece tensorflow::ops::DataFormatVecPermute::Attrs::src_format_ = "NHWC" ``` Public functions ---------------- ### DstFormat ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::DataFormatVecPermute::Attrs::DstFormat( StringPiece x ) ``` destination data format. Defaults to "NCHW" ### SrcFormat ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::DataFormatVecPermute::Attrs::SrcFormat( StringPiece x ) ``` source data format. Defaults to "NHWC" tensorflow_cpp tensorflow::ops::ConditionalAccumulator::Attrs tensorflow::ops::ConditionalAccumulator::Attrs ============================================== `#include <data_flow_ops.h>` Optional attribute setters for [ConditionalAccumulator](../../../../class/tensorflow/ops/conditional-accumulator#classtensorflow_1_1ops_1_1_conditional_accumulator). Summary ------- | Public attributes | | --- | | `[container\_](#structtensorflow_1_1ops_1_1_conditional_accumulator_1_1_attrs_1a7f2f89c42e3cbf95526aa907a77f53d4) = ""` | `StringPiece` | | `[reduction\_type\_](#structtensorflow_1_1ops_1_1_conditional_accumulator_1_1_attrs_1a32ecfc7e8a37074ae856258693dcf747) = "MEAN"` | `StringPiece` | | `[shared\_name\_](#structtensorflow_1_1ops_1_1_conditional_accumulator_1_1_attrs_1a142283e0a1c4e6cc92be292f7ae7f561) = ""` | `StringPiece` | | Public functions | | --- | | `[Container](#structtensorflow_1_1ops_1_1_conditional_accumulator_1_1_attrs_1af778e825f25825f460d90645e79ee5af)(StringPiece x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_conditional_accumulator_1_1_attrs)` If non-empty, this accumulator is placed in the given container. | | `[ReductionType](#structtensorflow_1_1ops_1_1_conditional_accumulator_1_1_attrs_1ae1598d66943f12caae75afdcc7f40e9b)(StringPiece x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_conditional_accumulator_1_1_attrs)` Defaults to "MEAN". | | `[SharedName](#structtensorflow_1_1ops_1_1_conditional_accumulator_1_1_attrs_1a62fd2007c7828997be44f69c19d0829a)(StringPiece x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_conditional_accumulator_1_1_attrs)` If non-empty, this accumulator will be shared under the given name across multiple sessions. | Public attributes ----------------- ### container\_ ``` StringPiece tensorflow::ops::ConditionalAccumulator::Attrs::container_ = "" ``` ### reduction\_type\_ ``` StringPiece tensorflow::ops::ConditionalAccumulator::Attrs::reduction_type_ = "MEAN" ``` ### shared\_name\_ ``` StringPiece tensorflow::ops::ConditionalAccumulator::Attrs::shared_name_ = "" ``` Public functions ---------------- ### Container ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::ConditionalAccumulator::Attrs::Container( StringPiece x ) ``` If non-empty, this accumulator is placed in the given container. Otherwise, a default container is used. Defaults to "" ### ReductionType ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::ConditionalAccumulator::Attrs::ReductionType( StringPiece x ) ``` Defaults to "MEAN". ### SharedName ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::ConditionalAccumulator::Attrs::SharedName( StringPiece x ) ``` If non-empty, this accumulator will be shared under the given name across multiple sessions. Defaults to "" tensorflow_cpp tensorflow::ops::FusedBatchNormGradV3::Attrs tensorflow::ops::FusedBatchNormGradV3::Attrs ============================================ `#include <nn_ops.h>` Optional attribute setters for [FusedBatchNormGradV3](../../../../class/tensorflow/ops/fused-batch-norm-grad-v3#classtensorflow_1_1ops_1_1_fused_batch_norm_grad_v3). Summary ------- | Public attributes | | --- | | `[data\_format\_](#structtensorflow_1_1ops_1_1_fused_batch_norm_grad_v3_1_1_attrs_1a1e9b396bca7ac76c9f4cd713c02c3b30) = "NHWC"` | `StringPiece` | | `[epsilon\_](#structtensorflow_1_1ops_1_1_fused_batch_norm_grad_v3_1_1_attrs_1ad1d4ad184203580c07baab6589232268) = 0.0001f` | `float` | | `[is\_training\_](#structtensorflow_1_1ops_1_1_fused_batch_norm_grad_v3_1_1_attrs_1addb2755bb1e2276516f46691383f4a5f) = true` | `bool` | | Public functions | | --- | | `[DataFormat](#structtensorflow_1_1ops_1_1_fused_batch_norm_grad_v3_1_1_attrs_1a21e259cff246a1ff4380c999c5e94dc7)(StringPiece x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_fused_batch_norm_grad_v3_1_1_attrs)` The data format for y\_backprop, x, x\_backprop. | | `[Epsilon](#structtensorflow_1_1ops_1_1_fused_batch_norm_grad_v3_1_1_attrs_1a81064057922396feb1efa5082c2c5e04)(float x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_fused_batch_norm_grad_v3_1_1_attrs)` A small float number added to the variance of x. | | `[IsTraining](#structtensorflow_1_1ops_1_1_fused_batch_norm_grad_v3_1_1_attrs_1aacf4248afad76a4ff0bb4e2cd7f73218)(bool x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_fused_batch_norm_grad_v3_1_1_attrs)` A bool value to indicate the operation is for training (default) or inference. | Public attributes ----------------- ### data\_format\_ ``` StringPiece tensorflow::ops::FusedBatchNormGradV3::Attrs::data_format_ = "NHWC" ``` ### epsilon\_ ``` float tensorflow::ops::FusedBatchNormGradV3::Attrs::epsilon_ = 0.0001f ``` ### is\_training\_ ``` bool tensorflow::ops::FusedBatchNormGradV3::Attrs::is_training_ = true ``` Public functions ---------------- ### DataFormat ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::FusedBatchNormGradV3::Attrs::DataFormat( StringPiece x ) ``` The data format for y\_backprop, x, x\_backprop. Either "NHWC" (default) or "NCHW". Defaults to "NHWC" ### Epsilon ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::FusedBatchNormGradV3::Attrs::Epsilon( float x ) ``` A small float number added to the variance of x. Defaults to 0.0001 ### IsTraining ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::FusedBatchNormGradV3::Attrs::IsTraining( bool x ) ``` A bool value to indicate the operation is for training (default) or inference. Defaults to true tensorflow_cpp tensorflow::ops::OrderedMapIncompleteSize::Attrs tensorflow::ops::OrderedMapIncompleteSize::Attrs ================================================ `#include <data_flow_ops.h>` Optional attribute setters for [OrderedMapIncompleteSize](../../../../class/tensorflow/ops/ordered-map-incomplete-size#classtensorflow_1_1ops_1_1_ordered_map_incomplete_size). Summary ------- | Public attributes | | --- | | `[capacity\_](#structtensorflow_1_1ops_1_1_ordered_map_incomplete_size_1_1_attrs_1abaee19709106ed7475f95c7ddf929aeb) = 0` | `int64` | | `[container\_](#structtensorflow_1_1ops_1_1_ordered_map_incomplete_size_1_1_attrs_1a79dfa579668b48ba1bf03b05e1a0e58e) = ""` | `StringPiece` | | `[memory\_limit\_](#structtensorflow_1_1ops_1_1_ordered_map_incomplete_size_1_1_attrs_1a0f92537f4fd4013fb462b4c5c8e556fd) = 0` | `int64` | | `[shared\_name\_](#structtensorflow_1_1ops_1_1_ordered_map_incomplete_size_1_1_attrs_1aec98fcd170a3f1813b627f5ae0a10e3a) = ""` | `StringPiece` | | Public functions | | --- | | `[Capacity](#structtensorflow_1_1ops_1_1_ordered_map_incomplete_size_1_1_attrs_1a7f8b3a3583da3e32ae1e98f428613f01)(int64 x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_ordered_map_incomplete_size_1_1_attrs)` Defaults to 0. | | `[Container](#structtensorflow_1_1ops_1_1_ordered_map_incomplete_size_1_1_attrs_1af7ae7ba047002dcb207ac6a11a4a739e)(StringPiece x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_ordered_map_incomplete_size_1_1_attrs)` Defaults to "". | | `[MemoryLimit](#structtensorflow_1_1ops_1_1_ordered_map_incomplete_size_1_1_attrs_1ab4a2c1bdeda50a793d7b7d65adc06130)(int64 x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_ordered_map_incomplete_size_1_1_attrs)` Defaults to 0. | | `[SharedName](#structtensorflow_1_1ops_1_1_ordered_map_incomplete_size_1_1_attrs_1a28fec9cbc83bb667f62e92bb982a2b5f)(StringPiece x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_ordered_map_incomplete_size_1_1_attrs)` Defaults to "". | Public attributes ----------------- ### capacity\_ ``` int64 tensorflow::ops::OrderedMapIncompleteSize::Attrs::capacity_ = 0 ``` ### container\_ ``` StringPiece tensorflow::ops::OrderedMapIncompleteSize::Attrs::container_ = "" ``` ### memory\_limit\_ ``` int64 tensorflow::ops::OrderedMapIncompleteSize::Attrs::memory_limit_ = 0 ``` ### shared\_name\_ ``` StringPiece tensorflow::ops::OrderedMapIncompleteSize::Attrs::shared_name_ = "" ``` Public functions ---------------- ### Capacity ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::OrderedMapIncompleteSize::Attrs::Capacity( int64 x ) ``` Defaults to 0. ### Container ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::OrderedMapIncompleteSize::Attrs::Container( StringPiece x ) ``` Defaults to "". ### MemoryLimit ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::OrderedMapIncompleteSize::Attrs::MemoryLimit( int64 x ) ``` Defaults to 0. ### SharedName ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::OrderedMapIncompleteSize::Attrs::SharedName( StringPiece x ) ``` Defaults to "". tensorflow_cpp tensorflow::ops::TensorArrayGather::Attrs tensorflow::ops::TensorArrayGather::Attrs ========================================= `#include <data_flow_ops.h>` Optional attribute setters for [TensorArrayGather](../../../../class/tensorflow/ops/tensor-array-gather#classtensorflow_1_1ops_1_1_tensor_array_gather). Summary ------- | Public attributes | | --- | | `[element\_shape\_](#structtensorflow_1_1ops_1_1_tensor_array_gather_1_1_attrs_1adcea1b30f6c6ffe54440623285a89bb6) = ::tensorflow::PartialTensorShape()` | `PartialTensorShape` | | Public functions | | --- | | `[ElementShape](#structtensorflow_1_1ops_1_1_tensor_array_gather_1_1_attrs_1a35f9ef8b692ec2975934b78823699ece)(PartialTensorShape x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_tensor_array_gather_1_1_attrs)` The expected shape of an element, if known. | Public attributes ----------------- ### element\_shape\_ ``` PartialTensorShape tensorflow::ops::TensorArrayGather::Attrs::element_shape_ = ::tensorflow::PartialTensorShape() ``` Public functions ---------------- ### ElementShape ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::TensorArrayGather::Attrs::ElementShape( PartialTensorShape x ) ``` The expected shape of an element, if known. Used to validate the shapes of [TensorArray](../../../../class/tensorflow/ops/tensor-array#classtensorflow_1_1ops_1_1_tensor_array) elements. If this shape is not fully specified, gathering zero-size TensorArrays is an error. Defaults to tensorflow_cpp tensorflow::ops::ScatterMul::Attrs tensorflow::ops::ScatterMul::Attrs ================================== `#include <state_ops.h>` Optional attribute setters for [ScatterMul](../../../../class/tensorflow/ops/scatter-mul#classtensorflow_1_1ops_1_1_scatter_mul). Summary ------- | Public attributes | | --- | | `[use\_locking\_](#structtensorflow_1_1ops_1_1_scatter_mul_1_1_attrs_1a405b9fb435653650cc8dca7214bcbb03) = false` | `bool` | | Public functions | | --- | | `[UseLocking](#structtensorflow_1_1ops_1_1_scatter_mul_1_1_attrs_1a1f3676d9548f25b51e34f12c84dffe4e)(bool x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_scatter_mul_1_1_attrs)` If True, the operation will be protected by a lock; otherwise the behavior is undefined, but may exhibit less contention. | Public attributes ----------------- ### use\_locking\_ ``` bool tensorflow::ops::ScatterMul::Attrs::use_locking_ = false ``` Public functions ---------------- ### UseLocking ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::ScatterMul::Attrs::UseLocking( bool x ) ``` If True, the operation will be protected by a lock; otherwise the behavior is undefined, but may exhibit less contention. Defaults to false tensorflow_cpp tensorflow::ops::ResizeBicubic::Attrs tensorflow::ops::ResizeBicubic::Attrs ===================================== `#include <image_ops.h>` Optional attribute setters for [ResizeBicubic](../../../../class/tensorflow/ops/resize-bicubic#classtensorflow_1_1ops_1_1_resize_bicubic). Summary ------- | Public attributes | | --- | | `[align\_corners\_](#structtensorflow_1_1ops_1_1_resize_bicubic_1_1_attrs_1a9387d45e5f6a7969b6f7d4dfa499aa7a) = false` | `bool` | | `[half\_pixel\_centers\_](#structtensorflow_1_1ops_1_1_resize_bicubic_1_1_attrs_1a8d5369b389deb26ec05c64a3febedeb9) = false` | `bool` | | Public functions | | --- | | `[AlignCorners](#structtensorflow_1_1ops_1_1_resize_bicubic_1_1_attrs_1a1f6d1321882333f9eafbdef3ba2af139)(bool x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_resize_bicubic_1_1_attrs)` If true, the centers of the 4 corner pixels of the input and output tensors are aligned, preserving the values at the corner pixels. | | `[HalfPixelCenters](#structtensorflow_1_1ops_1_1_resize_bicubic_1_1_attrs_1a302dd55406cf5a4920a20a5506184e08)(bool x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_resize_bicubic_1_1_attrs)` Defaults to false. | Public attributes ----------------- ### align\_corners\_ ``` bool tensorflow::ops::ResizeBicubic::Attrs::align_corners_ = false ``` ### half\_pixel\_centers\_ ``` bool tensorflow::ops::ResizeBicubic::Attrs::half_pixel_centers_ = false ``` Public functions ---------------- ### AlignCorners ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::ResizeBicubic::Attrs::AlignCorners( bool x ) ``` If true, the centers of the 4 corner pixels of the input and output tensors are aligned, preserving the values at the corner pixels. Defaults to false. Defaults to false ### HalfPixelCenters ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::ResizeBicubic::Attrs::HalfPixelCenters( bool x ) ``` Defaults to false. tensorflow_cpp tensorflow::ops::QueueEnqueue::Attrs tensorflow::ops::QueueEnqueue::Attrs ==================================== `#include <data_flow_ops.h>` Optional attribute setters for [QueueEnqueue](../../../../class/tensorflow/ops/queue-enqueue#classtensorflow_1_1ops_1_1_queue_enqueue). Summary ------- | Public attributes | | --- | | `[timeout\_ms\_](#structtensorflow_1_1ops_1_1_queue_enqueue_1_1_attrs_1a5dba91a3cd3161bcafc637a4b4d7e38d) = -1` | `int64` | | Public functions | | --- | | `[TimeoutMs](#structtensorflow_1_1ops_1_1_queue_enqueue_1_1_attrs_1a24e1a87bed144aaa228067e168d0a121)(int64 x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_queue_enqueue_1_1_attrs)` If the queue is full, this operation will block for up to timeout\_ms milliseconds. | Public attributes ----------------- ### timeout\_ms\_ ``` int64 tensorflow::ops::QueueEnqueue::Attrs::timeout_ms_ = -1 ``` Public functions ---------------- ### TimeoutMs ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::QueueEnqueue::Attrs::TimeoutMs( int64 x ) ``` If the queue is full, this operation will block for up to timeout\_ms milliseconds. Note: This option is not supported yet. Defaults to -1 tensorflow_cpp tensorflow::ops::All::Attrs tensorflow::ops::All::Attrs =========================== `#include <math_ops.h>` Optional attribute setters for [All](../../../../class/tensorflow/ops/all#classtensorflow_1_1ops_1_1_all). Summary ------- | Public attributes | | --- | | `[keep\_dims\_](#structtensorflow_1_1ops_1_1_all_1_1_attrs_1a3dab616ed516d36c38e7979783a41723) = false` | `bool` | | Public functions | | --- | | `[KeepDims](#structtensorflow_1_1ops_1_1_all_1_1_attrs_1a2ba832434076fdbebff915e1aa88a466)(bool x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_all_1_1_attrs)` If true, retain reduced dimensions with length 1. | Public attributes ----------------- ### keep\_dims\_ ``` bool tensorflow::ops::All::Attrs::keep_dims_ = false ``` Public functions ---------------- ### KeepDims ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::All::Attrs::KeepDims( bool x ) ``` If true, retain reduced dimensions with length 1. Defaults to false
programming_docs
tensorflow_cpp tensorflow::ops::LMDBReader::Attrs tensorflow::ops::LMDBReader::Attrs ================================== `#include <io_ops.h>` Optional attribute setters for [LMDBReader](../../../../class/tensorflow/ops/l-m-d-b-reader#classtensorflow_1_1ops_1_1_l_m_d_b_reader). Summary ------- | Public attributes | | --- | | `[container\_](#structtensorflow_1_1ops_1_1_l_m_d_b_reader_1_1_attrs_1add25e46bffe36a475068240d1fea1b2c) = ""` | `StringPiece` | | `[shared\_name\_](#structtensorflow_1_1ops_1_1_l_m_d_b_reader_1_1_attrs_1a77fcbb16282f6b91fc7e7bdf7d2dbd77) = ""` | `StringPiece` | | Public functions | | --- | | `[Container](#structtensorflow_1_1ops_1_1_l_m_d_b_reader_1_1_attrs_1abf48a4f6d18deda52c9a64d31082023c)(StringPiece x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_l_m_d_b_reader_1_1_attrs)` If non-empty, this reader is placed in the given container. | | `[SharedName](#structtensorflow_1_1ops_1_1_l_m_d_b_reader_1_1_attrs_1af0cddfe15c6ccc66a682decb3a1ff644)(StringPiece x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_l_m_d_b_reader_1_1_attrs)` If non-empty, this reader is named in the given bucket with this shared\_name. | Public attributes ----------------- ### container\_ ``` StringPiece tensorflow::ops::LMDBReader::Attrs::container_ = "" ``` ### shared\_name\_ ``` StringPiece tensorflow::ops::LMDBReader::Attrs::shared_name_ = "" ``` Public functions ---------------- ### Container ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::LMDBReader::Attrs::Container( StringPiece x ) ``` If non-empty, this reader is placed in the given container. Otherwise, a default container is used. Defaults to "" ### SharedName ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::LMDBReader::Attrs::SharedName( StringPiece x ) ``` If non-empty, this reader is named in the given bucket with this shared\_name. Otherwise, the node name is used instead. Defaults to "" tensorflow_cpp tensorflow::ops::FusedBatchNorm::Attrs tensorflow::ops::FusedBatchNorm::Attrs ====================================== `#include <nn_ops.h>` Optional attribute setters for [FusedBatchNorm](../../../../class/tensorflow/ops/fused-batch-norm#classtensorflow_1_1ops_1_1_fused_batch_norm). Summary ------- | Public attributes | | --- | | `[data\_format\_](#structtensorflow_1_1ops_1_1_fused_batch_norm_1_1_attrs_1ad08bbe8f4a5e2b88a0b6782556f7a7af) = "NHWC"` | `StringPiece` | | `[epsilon\_](#structtensorflow_1_1ops_1_1_fused_batch_norm_1_1_attrs_1a2f380f8f4752e9caf2aefc61f503a840) = 0.0001f` | `float` | | `[exponential\_avg\_factor\_](#structtensorflow_1_1ops_1_1_fused_batch_norm_1_1_attrs_1a16c8b5d0b198b34d61d560400aebfabb) = 1.0f` | `float` | | `[is\_training\_](#structtensorflow_1_1ops_1_1_fused_batch_norm_1_1_attrs_1a1c18cc285c005e17c7a2295bee77df99) = true` | `bool` | | Public functions | | --- | | `[DataFormat](#structtensorflow_1_1ops_1_1_fused_batch_norm_1_1_attrs_1a70965ec834a9dd0a0c7db2914c88b1a3)(StringPiece x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_fused_batch_norm_1_1_attrs)` The data format for x and y. | | `[Epsilon](#structtensorflow_1_1ops_1_1_fused_batch_norm_1_1_attrs_1a3a6de6a7b5a477a973b8d403eeeb93c0)(float x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_fused_batch_norm_1_1_attrs)` A small float number added to the variance of x. | | `[ExponentialAvgFactor](#structtensorflow_1_1ops_1_1_fused_batch_norm_1_1_attrs_1a3e60737f356014bbde0d25ed4c8d3f81)(float x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_fused_batch_norm_1_1_attrs)` Defaults to 1. | | `[IsTraining](#structtensorflow_1_1ops_1_1_fused_batch_norm_1_1_attrs_1a4dd34686bbdd16f758fb0b5725e92a28)(bool x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_fused_batch_norm_1_1_attrs)` A bool value to indicate the operation is for training (default) or inference. | Public attributes ----------------- ### data\_format\_ ``` StringPiece tensorflow::ops::FusedBatchNorm::Attrs::data_format_ = "NHWC" ``` ### epsilon\_ ``` float tensorflow::ops::FusedBatchNorm::Attrs::epsilon_ = 0.0001f ``` ### exponential\_avg\_factor\_ ``` float tensorflow::ops::FusedBatchNorm::Attrs::exponential_avg_factor_ = 1.0f ``` ### is\_training\_ ``` bool tensorflow::ops::FusedBatchNorm::Attrs::is_training_ = true ``` Public functions ---------------- ### DataFormat ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::FusedBatchNorm::Attrs::DataFormat( StringPiece x ) ``` The data format for x and y. Either "NHWC" (default) or "NCHW". Defaults to "NHWC" ### Epsilon ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::FusedBatchNorm::Attrs::Epsilon( float x ) ``` A small float number added to the variance of x. Defaults to 0.0001 ### ExponentialAvgFactor ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::FusedBatchNorm::Attrs::ExponentialAvgFactor( float x ) ``` Defaults to 1. ### IsTraining ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::FusedBatchNorm::Attrs::IsTraining( bool x ) ``` A bool value to indicate the operation is for training (default) or inference. Defaults to true tensorflow_cpp tensorflow::ops::ApplyPowerSign::Attrs tensorflow::ops::ApplyPowerSign::Attrs ====================================== `#include <training_ops.h>` Optional attribute setters for [ApplyPowerSign](../../../../class/tensorflow/ops/apply-power-sign#classtensorflow_1_1ops_1_1_apply_power_sign). Summary ------- | Public attributes | | --- | | `[use\_locking\_](#structtensorflow_1_1ops_1_1_apply_power_sign_1_1_attrs_1ac0532be3b22aee7b02a566f343c98e2f) = false` | `bool` | | Public functions | | --- | | `[UseLocking](#structtensorflow_1_1ops_1_1_apply_power_sign_1_1_attrs_1a58be8ab834a7a2b52c583915a0b277f1)(bool x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_apply_power_sign_1_1_attrs)` If `True`, updating of the var and m tensors is protected by a lock; otherwise the behavior is undefined, but may exhibit less contention. | Public attributes ----------------- ### use\_locking\_ ``` bool tensorflow::ops::ApplyPowerSign::Attrs::use_locking_ = false ``` Public functions ---------------- ### UseLocking ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::ApplyPowerSign::Attrs::UseLocking( bool x ) ``` If `True`, updating of the var and m tensors is protected by a lock; otherwise the behavior is undefined, but may exhibit less contention. Defaults to false tensorflow_cpp tensorflow::ops::FakeQuantWithMinMaxVarsPerChannelGradient::Attrs tensorflow::ops::FakeQuantWithMinMaxVarsPerChannelGradient::Attrs ================================================================= `#include <array_ops.h>` Optional attribute setters for [FakeQuantWithMinMaxVarsPerChannelGradient](../../../../class/tensorflow/ops/fake-quant-with-min-max-vars-per-channel-gradient#classtensorflow_1_1ops_1_1_fake_quant_with_min_max_vars_per_channel_gradient). Summary ------- | Public attributes | | --- | | `[narrow\_range\_](#structtensorflow_1_1ops_1_1_fake_quant_with_min_max_vars_per_channel_gradient_1_1_attrs_1a19bcc6e3056cc06a975a5a7236e38607) = false` | `bool` | | `[num\_bits\_](#structtensorflow_1_1ops_1_1_fake_quant_with_min_max_vars_per_channel_gradient_1_1_attrs_1a1d8955c276cd7afe9a8cc3b3cec65b80) = 8` | `int64` | | Public functions | | --- | | `[NarrowRange](#structtensorflow_1_1ops_1_1_fake_quant_with_min_max_vars_per_channel_gradient_1_1_attrs_1a7c6086869fd2c913591598734e50c734)(bool x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_fake_quant_with_min_max_vars_per_channel_gradient_1_1_attrs)` Whether to quantize into 2^num\_bits - 1 distinct values. | | `[NumBits](#structtensorflow_1_1ops_1_1_fake_quant_with_min_max_vars_per_channel_gradient_1_1_attrs_1aa00e6a2d0d011a7cec018693b25d8311)(int64 x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_fake_quant_with_min_max_vars_per_channel_gradient_1_1_attrs)` The bitwidth of the quantization; between 2 and 16, inclusive. | Public attributes ----------------- ### narrow\_range\_ ``` bool tensorflow::ops::FakeQuantWithMinMaxVarsPerChannelGradient::Attrs::narrow_range_ = false ``` ### num\_bits\_ ``` int64 tensorflow::ops::FakeQuantWithMinMaxVarsPerChannelGradient::Attrs::num_bits_ = 8 ``` Public functions ---------------- ### NarrowRange ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::FakeQuantWithMinMaxVarsPerChannelGradient::Attrs::NarrowRange( bool x ) ``` Whether to quantize into 2^num\_bits - 1 distinct values. Defaults to false ### NumBits ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::FakeQuantWithMinMaxVarsPerChannelGradient::Attrs::NumBits( int64 x ) ``` The bitwidth of the quantization; between 2 and 16, inclusive. Defaults to 8 tensorflow_cpp tensorflow::ops::ResourceSparseApplyAdagrad::Attrs tensorflow::ops::ResourceSparseApplyAdagrad::Attrs ================================================== `#include <training_ops.h>` Optional attribute setters for [ResourceSparseApplyAdagrad](../../../../class/tensorflow/ops/resource-sparse-apply-adagrad#classtensorflow_1_1ops_1_1_resource_sparse_apply_adagrad). Summary ------- | Public attributes | | --- | | `[update\_slots\_](#structtensorflow_1_1ops_1_1_resource_sparse_apply_adagrad_1_1_attrs_1add9900d54523022af9ab319328c113eb) = true` | `bool` | | `[use\_locking\_](#structtensorflow_1_1ops_1_1_resource_sparse_apply_adagrad_1_1_attrs_1ad0d78ec68788389d53f10a6fda8b95c4) = false` | `bool` | | Public functions | | --- | | `[UpdateSlots](#structtensorflow_1_1ops_1_1_resource_sparse_apply_adagrad_1_1_attrs_1a5177c70a70d341386319a4bc29631f61)(bool x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_resource_sparse_apply_adagrad_1_1_attrs)` Defaults to true. | | `[UseLocking](#structtensorflow_1_1ops_1_1_resource_sparse_apply_adagrad_1_1_attrs_1a60bbfdffa3b0c4dc715302e35b098a15)(bool x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_resource_sparse_apply_adagrad_1_1_attrs)` If `True`, updating of the var and accum tensors will be protected by a lock; otherwise the behavior is undefined, but may exhibit less contention. | Public attributes ----------------- ### update\_slots\_ ``` bool tensorflow::ops::ResourceSparseApplyAdagrad::Attrs::update_slots_ = true ``` ### use\_locking\_ ``` bool tensorflow::ops::ResourceSparseApplyAdagrad::Attrs::use_locking_ = false ``` Public functions ---------------- ### UpdateSlots ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::ResourceSparseApplyAdagrad::Attrs::UpdateSlots( bool x ) ``` Defaults to true. ### UseLocking ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::ResourceSparseApplyAdagrad::Attrs::UseLocking( bool x ) ``` If `True`, updating of the var and accum tensors will be protected by a lock; otherwise the behavior is undefined, but may exhibit less contention. Defaults to false tensorflow_cpp tensorflow::ops::DecodeCompressed::Attrs tensorflow::ops::DecodeCompressed::Attrs ======================================== `#include <parsing_ops.h>` Optional attribute setters for [DecodeCompressed](../../../../class/tensorflow/ops/decode-compressed#classtensorflow_1_1ops_1_1_decode_compressed). Summary ------- | Public attributes | | --- | | `[compression\_type\_](#structtensorflow_1_1ops_1_1_decode_compressed_1_1_attrs_1a7f8f41d913a4298bb9828f4064791216) = ""` | `StringPiece` | | Public functions | | --- | | `[CompressionType](#structtensorflow_1_1ops_1_1_decode_compressed_1_1_attrs_1a3b096b03b678baf20a16ca63748cf254)(StringPiece x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_decode_compressed_1_1_attrs)` A scalar containing either (i) the empty string (no compression), (ii) "ZLIB", or (iii) "GZIP". | Public attributes ----------------- ### compression\_type\_ ``` StringPiece tensorflow::ops::DecodeCompressed::Attrs::compression_type_ = "" ``` Public functions ---------------- ### CompressionType ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::DecodeCompressed::Attrs::CompressionType( StringPiece x ) ``` A scalar containing either (i) the empty string (no compression), (ii) "ZLIB", or (iii) "GZIP". Defaults to "" tensorflow_cpp tensorflow::ops::TensorArrayConcat::Attrs tensorflow::ops::TensorArrayConcat::Attrs ========================================= `#include <data_flow_ops.h>` Optional attribute setters for [TensorArrayConcat](../../../../class/tensorflow/ops/tensor-array-concat#classtensorflow_1_1ops_1_1_tensor_array_concat). Summary ------- | Public attributes | | --- | | `[element\_shape\_except0\_](#structtensorflow_1_1ops_1_1_tensor_array_concat_1_1_attrs_1a83886275dd85074d8df00d1577a7e265) = ::tensorflow::PartialTensorShape()` | `PartialTensorShape` | | Public functions | | --- | | `[ElementShapeExcept0](#structtensorflow_1_1ops_1_1_tensor_array_concat_1_1_attrs_1a96d3d8037460da28207e2429a528c337)(PartialTensorShape x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_tensor_array_concat_1_1_attrs)` The expected shape of an element, if known, excluding the first dimension. | Public attributes ----------------- ### element\_shape\_except0\_ ``` PartialTensorShape tensorflow::ops::TensorArrayConcat::Attrs::element_shape_except0_ = ::tensorflow::PartialTensorShape() ``` Public functions ---------------- ### ElementShapeExcept0 ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::TensorArrayConcat::Attrs::ElementShapeExcept0( PartialTensorShape x ) ``` The expected shape of an element, if known, excluding the first dimension. Used to validate the shapes of [TensorArray](../../../../class/tensorflow/ops/tensor-array#classtensorflow_1_1ops_1_1_tensor_array) elements. If this shape is not fully specified, concatenating zero-size TensorArrays is an error. Defaults to tensorflow_cpp tensorflow::ops::SparseApplyFtrl::Attrs tensorflow::ops::SparseApplyFtrl::Attrs ======================================= `#include <training_ops.h>` Optional attribute setters for [SparseApplyFtrl](../../../../class/tensorflow/ops/sparse-apply-ftrl#classtensorflow_1_1ops_1_1_sparse_apply_ftrl). Summary ------- | Public attributes | | --- | | `[multiply\_linear\_by\_lr\_](#structtensorflow_1_1ops_1_1_sparse_apply_ftrl_1_1_attrs_1a51b2e88d51b156f4ad35fc90958106f9) = false` | `bool` | | `[use\_locking\_](#structtensorflow_1_1ops_1_1_sparse_apply_ftrl_1_1_attrs_1af07d24dc4d04d09a22316ff156f23a67) = false` | `bool` | | Public functions | | --- | | `[MultiplyLinearByLr](#structtensorflow_1_1ops_1_1_sparse_apply_ftrl_1_1_attrs_1aaf25b36e3ec20fbb390b86229688e3ec)(bool x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_sparse_apply_ftrl_1_1_attrs)` Defaults to false. | | `[UseLocking](#structtensorflow_1_1ops_1_1_sparse_apply_ftrl_1_1_attrs_1aac0de93b764d419e084c136984829248)(bool x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_sparse_apply_ftrl_1_1_attrs)` If `True`, updating of the var and accum tensors will be protected by a lock; otherwise the behavior is undefined, but may exhibit less contention. | Public attributes ----------------- ### multiply\_linear\_by\_lr\_ ``` bool tensorflow::ops::SparseApplyFtrl::Attrs::multiply_linear_by_lr_ = false ``` ### use\_locking\_ ``` bool tensorflow::ops::SparseApplyFtrl::Attrs::use_locking_ = false ``` Public functions ---------------- ### MultiplyLinearByLr ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::SparseApplyFtrl::Attrs::MultiplyLinearByLr( bool x ) ``` Defaults to false. ### UseLocking ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::SparseApplyFtrl::Attrs::UseLocking( bool x ) ``` If `True`, updating of the var and accum tensors will be protected by a lock; otherwise the behavior is undefined, but may exhibit less contention. Defaults to false tensorflow_cpp tensorflow::ops::LogUniformCandidateSampler::Attrs tensorflow::ops::LogUniformCandidateSampler::Attrs ================================================== `#include <candidate_sampling_ops.h>` Optional attribute setters for [LogUniformCandidateSampler](../../../../class/tensorflow/ops/log-uniform-candidate-sampler#classtensorflow_1_1ops_1_1_log_uniform_candidate_sampler). Summary ------- | Public attributes | | --- | | `[seed2\_](#structtensorflow_1_1ops_1_1_log_uniform_candidate_sampler_1_1_attrs_1aad453bfe9dc8b74a66515880fbdda5da) = 0` | `int64` | | `[seed\_](#structtensorflow_1_1ops_1_1_log_uniform_candidate_sampler_1_1_attrs_1a5f4efdafbee0cdd913582206a3272e4f) = 0` | `int64` | | Public functions | | --- | | `[Seed](#structtensorflow_1_1ops_1_1_log_uniform_candidate_sampler_1_1_attrs_1a9208c134bcda3d1204670d2a6e41e30d)(int64 x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_log_uniform_candidate_sampler_1_1_attrs)` If either seed or seed2 are set to be non-zero, the random number generator is seeded by the given seed. | | `[Seed2](#structtensorflow_1_1ops_1_1_log_uniform_candidate_sampler_1_1_attrs_1a50c68717bb84ce7fe23286e89328853f)(int64 x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_log_uniform_candidate_sampler_1_1_attrs)` An second seed to avoid seed collision. | Public attributes ----------------- ### seed2\_ ``` int64 tensorflow::ops::LogUniformCandidateSampler::Attrs::seed2_ = 0 ``` ### seed\_ ``` int64 tensorflow::ops::LogUniformCandidateSampler::Attrs::seed_ = 0 ``` Public functions ---------------- ### Seed ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::LogUniformCandidateSampler::Attrs::Seed( int64 x ) ``` If either seed or seed2 are set to be non-zero, the random number generator is seeded by the given seed. Otherwise, it is seeded by a random seed. Defaults to 0 ### Seed2 ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::LogUniformCandidateSampler::Attrs::Seed2( int64 x ) ``` An second seed to avoid seed collision. Defaults to 0 tensorflow_cpp tensorflow::ops::Conv2DBackpropInput::Attrs tensorflow::ops::Conv2DBackpropInput::Attrs =========================================== `#include <nn_ops.h>` Optional attribute setters for [Conv2DBackpropInput](../../../../class/tensorflow/ops/conv2-d-backprop-input#classtensorflow_1_1ops_1_1_conv2_d_backprop_input). Summary ------- | Public attributes | | --- | | `[data\_format\_](#structtensorflow_1_1ops_1_1_conv2_d_backprop_input_1_1_attrs_1a0c1c7f7d2cbf215df9dc979b0fc2f1b2) = "NHWC"` | `StringPiece` | | `[dilations\_](#structtensorflow_1_1ops_1_1_conv2_d_backprop_input_1_1_attrs_1ae1d90c85a264053bf6ace3e7c8998ee3) = Default_dilations()` | `gtl::ArraySlice< int >` | | `[explicit\_paddings\_](#structtensorflow_1_1ops_1_1_conv2_d_backprop_input_1_1_attrs_1a56d59dc45e96f03d6289660936e4f78a) = {}` | `gtl::ArraySlice< int >` | | `[use\_cudnn\_on\_gpu\_](#structtensorflow_1_1ops_1_1_conv2_d_backprop_input_1_1_attrs_1aeda7580c5db6f5c41aa8c2e447e5cc66) = true` | `bool` | | Public functions | | --- | | `[DataFormat](#structtensorflow_1_1ops_1_1_conv2_d_backprop_input_1_1_attrs_1a6c39cb6a5daf9fab2fe4861667e94c8c)(StringPiece x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_conv2_d_backprop_input_1_1_attrs)` Specify the data format of the input and output data. | | `[Dilations](#structtensorflow_1_1ops_1_1_conv2_d_backprop_input_1_1_attrs_1a46e0bc68887b3aa0ab727f45de1e2a1b)(const gtl::ArraySlice< int > & x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_conv2_d_backprop_input_1_1_attrs)` 1-D tensor of length 4. | | `[ExplicitPaddings](#structtensorflow_1_1ops_1_1_conv2_d_backprop_input_1_1_attrs_1a4b187401b5a1bd9344fb0e8a9b7a2363)(const gtl::ArraySlice< int > & x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_conv2_d_backprop_input_1_1_attrs)` If `padding` is `"EXPLICIT"`, the list of explicit padding amounts. | | `[UseCudnnOnGpu](#structtensorflow_1_1ops_1_1_conv2_d_backprop_input_1_1_attrs_1a7aff147907d16ee4db66d8e6a6782cf0)(bool x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_conv2_d_backprop_input_1_1_attrs)` Defaults to true. | Public attributes ----------------- ### data\_format\_ ``` StringPiece tensorflow::ops::Conv2DBackpropInput::Attrs::data_format_ = "NHWC" ``` ### dilations\_ ``` gtl::ArraySlice< int > tensorflow::ops::Conv2DBackpropInput::Attrs::dilations_ = Default_dilations() ``` ### explicit\_paddings\_ ``` gtl::ArraySlice< int > tensorflow::ops::Conv2DBackpropInput::Attrs::explicit_paddings_ = {} ``` ### use\_cudnn\_on\_gpu\_ ``` bool tensorflow::ops::Conv2DBackpropInput::Attrs::use_cudnn_on_gpu_ = true ``` Public functions ---------------- ### DataFormat ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::Conv2DBackpropInput::Attrs::DataFormat( StringPiece x ) ``` Specify the data format of the input and output data. With the default format "NHWC", the data is stored in the order of: [batch, in\_height, in\_width, in\_channels]. Alternatively, the format could be "NCHW", the data storage order of: [batch, in\_channels, in\_height, in\_width]. Defaults to "NHWC" ### Dilations ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::Conv2DBackpropInput::Attrs::Dilations( const gtl::ArraySlice< int > & x ) ``` 1-D tensor of length 4. The dilation factor for each dimension of `input`. If set to k > 1, there will be k-1 skipped cells between each filter element on that dimension. The dimension order is determined by the value of `data_format`, see above for details. Dilations in the batch and depth dimensions must be 1. Defaults to [1, 1, 1, 1] ### ExplicitPaddings ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::Conv2DBackpropInput::Attrs::ExplicitPaddings( const gtl::ArraySlice< int > & x ) ``` If `padding` is `"EXPLICIT"`, the list of explicit padding amounts. For the ith dimension, the amount of padding inserted before and after the dimension is `explicit_paddings[2 * i]` and `explicit_paddings[2 * i + 1]`, respectively. If `padding` is not `"EXPLICIT"`, `explicit_paddings` must be empty. Defaults to [] ### UseCudnnOnGpu ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::Conv2DBackpropInput::Attrs::UseCudnnOnGpu( bool x ) ``` Defaults to true.
programming_docs
tensorflow_cpp tensorflow::ops::HistogramFixedWidth::Attrs tensorflow::ops::HistogramFixedWidth::Attrs =========================================== `#include <math_ops.h>` Optional attribute setters for [HistogramFixedWidth](../../../../class/tensorflow/ops/histogram-fixed-width#classtensorflow_1_1ops_1_1_histogram_fixed_width). Summary ------- | Public attributes | | --- | | `[dtype\_](#structtensorflow_1_1ops_1_1_histogram_fixed_width_1_1_attrs_1a473c502538ba1aa8508ce06805f4ed55) = DT_INT32` | `DataType` | | Public functions | | --- | | `[Dtype](#structtensorflow_1_1ops_1_1_histogram_fixed_width_1_1_attrs_1a475fd0e212143ce0d9ac578fce8c1ac0)(DataType x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_histogram_fixed_width_1_1_attrs)` Defaults to DT\_INT32. | Public attributes ----------------- ### dtype\_ ``` DataType tensorflow::ops::HistogramFixedWidth::Attrs::dtype_ = DT_INT32 ``` Public functions ---------------- ### Dtype ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::HistogramFixedWidth::Attrs::Dtype( DataType x ) ``` Defaults to DT\_INT32. tensorflow_cpp tensorflow::ops::StageClear::Attrs tensorflow::ops::StageClear::Attrs ================================== `#include <data_flow_ops.h>` Optional attribute setters for [StageClear](../../../../class/tensorflow/ops/stage-clear#classtensorflow_1_1ops_1_1_stage_clear). Summary ------- | Public attributes | | --- | | `[capacity\_](#structtensorflow_1_1ops_1_1_stage_clear_1_1_attrs_1ab3bb59097f7edcfe2353045fa513749d) = 0` | `int64` | | `[container\_](#structtensorflow_1_1ops_1_1_stage_clear_1_1_attrs_1a7781fc35f63953ebe2c1d164ff6b6037) = ""` | `StringPiece` | | `[memory\_limit\_](#structtensorflow_1_1ops_1_1_stage_clear_1_1_attrs_1a79826340fa9fd273a126854e71906806) = 0` | `int64` | | `[shared\_name\_](#structtensorflow_1_1ops_1_1_stage_clear_1_1_attrs_1a64ef88f5b60fffeb6c76443c0cee166a) = ""` | `StringPiece` | | Public functions | | --- | | `[Capacity](#structtensorflow_1_1ops_1_1_stage_clear_1_1_attrs_1a63eff608fbda56431f32fe8a5fd7870e)(int64 x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_stage_clear_1_1_attrs)` Defaults to 0. | | `[Container](#structtensorflow_1_1ops_1_1_stage_clear_1_1_attrs_1a5c18ee17f7961b178394d033269b6dcd)(StringPiece x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_stage_clear_1_1_attrs)` Defaults to "". | | `[MemoryLimit](#structtensorflow_1_1ops_1_1_stage_clear_1_1_attrs_1a8e0efd4c07ddaab58360fccb067c0ab3)(int64 x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_stage_clear_1_1_attrs)` Defaults to 0. | | `[SharedName](#structtensorflow_1_1ops_1_1_stage_clear_1_1_attrs_1ad07b0e60097b47201d553cb5000f0150)(StringPiece x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_stage_clear_1_1_attrs)` Defaults to "". | Public attributes ----------------- ### capacity\_ ``` int64 tensorflow::ops::StageClear::Attrs::capacity_ = 0 ``` ### container\_ ``` StringPiece tensorflow::ops::StageClear::Attrs::container_ = "" ``` ### memory\_limit\_ ``` int64 tensorflow::ops::StageClear::Attrs::memory_limit_ = 0 ``` ### shared\_name\_ ``` StringPiece tensorflow::ops::StageClear::Attrs::shared_name_ = "" ``` Public functions ---------------- ### Capacity ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::StageClear::Attrs::Capacity( int64 x ) ``` Defaults to 0. ### Container ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::StageClear::Attrs::Container( StringPiece x ) ``` Defaults to "". ### MemoryLimit ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::StageClear::Attrs::MemoryLimit( int64 x ) ``` Defaults to 0. ### SharedName ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::StageClear::Attrs::SharedName( StringPiece x ) ``` Defaults to "". tensorflow_cpp tensorflow::ops::ScatterDiv::Attrs tensorflow::ops::ScatterDiv::Attrs ================================== `#include <state_ops.h>` Optional attribute setters for [ScatterDiv](../../../../class/tensorflow/ops/scatter-div#classtensorflow_1_1ops_1_1_scatter_div). Summary ------- | Public attributes | | --- | | `[use\_locking\_](#structtensorflow_1_1ops_1_1_scatter_div_1_1_attrs_1aa58e1c3de4e2c48c076259513ba968a4) = false` | `bool` | | Public functions | | --- | | `[UseLocking](#structtensorflow_1_1ops_1_1_scatter_div_1_1_attrs_1ace75949cb44e95d846517e822cf91e29)(bool x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_scatter_div_1_1_attrs)` If True, the operation will be protected by a lock; otherwise the behavior is undefined, but may exhibit less contention. | Public attributes ----------------- ### use\_locking\_ ``` bool tensorflow::ops::ScatterDiv::Attrs::use_locking_ = false ``` Public functions ---------------- ### UseLocking ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::ScatterDiv::Attrs::UseLocking( bool x ) ``` If True, the operation will be protected by a lock; otherwise the behavior is undefined, but may exhibit less contention. Defaults to false tensorflow_cpp tensorflow::ops::FusedBatchNormGradV2::Attrs tensorflow::ops::FusedBatchNormGradV2::Attrs ============================================ `#include <nn_ops.h>` Optional attribute setters for [FusedBatchNormGradV2](../../../../class/tensorflow/ops/fused-batch-norm-grad-v2#classtensorflow_1_1ops_1_1_fused_batch_norm_grad_v2). Summary ------- | Public attributes | | --- | | `[data\_format\_](#structtensorflow_1_1ops_1_1_fused_batch_norm_grad_v2_1_1_attrs_1a5c7e5651428b698cd994fc8a81d33908) = "NHWC"` | `StringPiece` | | `[epsilon\_](#structtensorflow_1_1ops_1_1_fused_batch_norm_grad_v2_1_1_attrs_1a3ec2c53bad089cfc23146de77cbc3666) = 0.0001f` | `float` | | `[is\_training\_](#structtensorflow_1_1ops_1_1_fused_batch_norm_grad_v2_1_1_attrs_1afb0be5403a6c70a701ec4192098aa58e) = true` | `bool` | | Public functions | | --- | | `[DataFormat](#structtensorflow_1_1ops_1_1_fused_batch_norm_grad_v2_1_1_attrs_1a91225bbb0dc8413eafb12acd0e862616)(StringPiece x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_fused_batch_norm_grad_v2_1_1_attrs)` The data format for y\_backprop, x, x\_backprop. | | `[Epsilon](#structtensorflow_1_1ops_1_1_fused_batch_norm_grad_v2_1_1_attrs_1a9afb73d357cab1d8204b4f0ade6e5362)(float x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_fused_batch_norm_grad_v2_1_1_attrs)` A small float number added to the variance of x. | | `[IsTraining](#structtensorflow_1_1ops_1_1_fused_batch_norm_grad_v2_1_1_attrs_1aae977c700d666da2b88a0777b191145a)(bool x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_fused_batch_norm_grad_v2_1_1_attrs)` A bool value to indicate the operation is for training (default) or inference. | Public attributes ----------------- ### data\_format\_ ``` StringPiece tensorflow::ops::FusedBatchNormGradV2::Attrs::data_format_ = "NHWC" ``` ### epsilon\_ ``` float tensorflow::ops::FusedBatchNormGradV2::Attrs::epsilon_ = 0.0001f ``` ### is\_training\_ ``` bool tensorflow::ops::FusedBatchNormGradV2::Attrs::is_training_ = true ``` Public functions ---------------- ### DataFormat ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::FusedBatchNormGradV2::Attrs::DataFormat( StringPiece x ) ``` The data format for y\_backprop, x, x\_backprop. Either "NHWC" (default) or "NCHW". Defaults to "NHWC" ### Epsilon ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::FusedBatchNormGradV2::Attrs::Epsilon( float x ) ``` A small float number added to the variance of x. Defaults to 0.0001 ### IsTraining ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::FusedBatchNormGradV2::Attrs::IsTraining( bool x ) ``` A bool value to indicate the operation is for training (default) or inference. Defaults to true tensorflow_cpp tensorflow::ops::MapUnstageNoKey::Attrs tensorflow::ops::MapUnstageNoKey::Attrs ======================================= `#include <data_flow_ops.h>` Optional attribute setters for [MapUnstageNoKey](../../../../class/tensorflow/ops/map-unstage-no-key#classtensorflow_1_1ops_1_1_map_unstage_no_key). Summary ------- | Public attributes | | --- | | `[capacity\_](#structtensorflow_1_1ops_1_1_map_unstage_no_key_1_1_attrs_1ada7c0546e3b57d495b49c1865ba4f90a) = 0` | `int64` | | `[container\_](#structtensorflow_1_1ops_1_1_map_unstage_no_key_1_1_attrs_1a09ac2b6010cbde381b1e197fc26e05eb) = ""` | `StringPiece` | | `[memory\_limit\_](#structtensorflow_1_1ops_1_1_map_unstage_no_key_1_1_attrs_1a5e1727d27ed08aa92c6fa8e585c5dbec) = 0` | `int64` | | `[shared\_name\_](#structtensorflow_1_1ops_1_1_map_unstage_no_key_1_1_attrs_1aed7ecbd2df2bd9ada87e17071dcc276b) = ""` | `StringPiece` | | Public functions | | --- | | `[Capacity](#structtensorflow_1_1ops_1_1_map_unstage_no_key_1_1_attrs_1a4882c2b2bbb0e0ae9b3f1b6cab044f70)(int64 x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_map_unstage_no_key_1_1_attrs)` Defaults to 0. | | `[Container](#structtensorflow_1_1ops_1_1_map_unstage_no_key_1_1_attrs_1a0e2a70850291fca8acc7c4ee6a9d434e)(StringPiece x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_map_unstage_no_key_1_1_attrs)` Defaults to "". | | `[MemoryLimit](#structtensorflow_1_1ops_1_1_map_unstage_no_key_1_1_attrs_1a2154def815dc7aeea3e45b95f2e9ef4a)(int64 x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_map_unstage_no_key_1_1_attrs)` Defaults to 0. | | `[SharedName](#structtensorflow_1_1ops_1_1_map_unstage_no_key_1_1_attrs_1a9fba18ced8db91ba63e65c0464ed1921)(StringPiece x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_map_unstage_no_key_1_1_attrs)` Defaults to "". | Public attributes ----------------- ### capacity\_ ``` int64 tensorflow::ops::MapUnstageNoKey::Attrs::capacity_ = 0 ``` ### container\_ ``` StringPiece tensorflow::ops::MapUnstageNoKey::Attrs::container_ = "" ``` ### memory\_limit\_ ``` int64 tensorflow::ops::MapUnstageNoKey::Attrs::memory_limit_ = 0 ``` ### shared\_name\_ ``` StringPiece tensorflow::ops::MapUnstageNoKey::Attrs::shared_name_ = "" ``` Public functions ---------------- ### Capacity ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::MapUnstageNoKey::Attrs::Capacity( int64 x ) ``` Defaults to 0. ### Container ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::MapUnstageNoKey::Attrs::Container( StringPiece x ) ``` Defaults to "". ### MemoryLimit ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::MapUnstageNoKey::Attrs::MemoryLimit( int64 x ) ``` Defaults to 0. ### SharedName ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::MapUnstageNoKey::Attrs::SharedName( StringPiece x ) ``` Defaults to "". tensorflow_cpp tensorflow::ops::Conv2DBackpropFilter::Attrs tensorflow::ops::Conv2DBackpropFilter::Attrs ============================================ `#include <nn_ops.h>` Optional attribute setters for [Conv2DBackpropFilter](../../../../class/tensorflow/ops/conv2-d-backprop-filter#classtensorflow_1_1ops_1_1_conv2_d_backprop_filter). Summary ------- | Public attributes | | --- | | `[data\_format\_](#structtensorflow_1_1ops_1_1_conv2_d_backprop_filter_1_1_attrs_1ab788ee7ac4f5f35cd378b72a16ffa4b4) = "NHWC"` | `StringPiece` | | `[dilations\_](#structtensorflow_1_1ops_1_1_conv2_d_backprop_filter_1_1_attrs_1a79546d6119012f60099e8f3181e6747a) = Default_dilations()` | `gtl::ArraySlice< int >` | | `[explicit\_paddings\_](#structtensorflow_1_1ops_1_1_conv2_d_backprop_filter_1_1_attrs_1a4b78f8da2bda52b7a29e665363574d50) = {}` | `gtl::ArraySlice< int >` | | `[use\_cudnn\_on\_gpu\_](#structtensorflow_1_1ops_1_1_conv2_d_backprop_filter_1_1_attrs_1ad2eb40045a7d8e7653db2afe5a438a03) = true` | `bool` | | Public functions | | --- | | `[DataFormat](#structtensorflow_1_1ops_1_1_conv2_d_backprop_filter_1_1_attrs_1aac94e92662684e3d1b54af99d128f200)(StringPiece x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_conv2_d_backprop_filter_1_1_attrs)` Specify the data format of the input and output data. | | `[Dilations](#structtensorflow_1_1ops_1_1_conv2_d_backprop_filter_1_1_attrs_1aff107625c8a4f728d6e22ca4ba9a4603)(const gtl::ArraySlice< int > & x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_conv2_d_backprop_filter_1_1_attrs)` 1-D tensor of length 4. | | `[ExplicitPaddings](#structtensorflow_1_1ops_1_1_conv2_d_backprop_filter_1_1_attrs_1a643f46a636d206a091cae4ea4a1aa227)(const gtl::ArraySlice< int > & x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_conv2_d_backprop_filter_1_1_attrs)` If `padding` is `"EXPLICIT"`, the list of explicit padding amounts. | | `[UseCudnnOnGpu](#structtensorflow_1_1ops_1_1_conv2_d_backprop_filter_1_1_attrs_1a67c1ad99212a2d266ce6975a2e090565)(bool x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_conv2_d_backprop_filter_1_1_attrs)` Defaults to true. | Public attributes ----------------- ### data\_format\_ ``` StringPiece tensorflow::ops::Conv2DBackpropFilter::Attrs::data_format_ = "NHWC" ``` ### dilations\_ ``` gtl::ArraySlice< int > tensorflow::ops::Conv2DBackpropFilter::Attrs::dilations_ = Default_dilations() ``` ### explicit\_paddings\_ ``` gtl::ArraySlice< int > tensorflow::ops::Conv2DBackpropFilter::Attrs::explicit_paddings_ = {} ``` ### use\_cudnn\_on\_gpu\_ ``` bool tensorflow::ops::Conv2DBackpropFilter::Attrs::use_cudnn_on_gpu_ = true ``` Public functions ---------------- ### DataFormat ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::Conv2DBackpropFilter::Attrs::DataFormat( StringPiece x ) ``` Specify the data format of the input and output data. With the default format "NHWC", the data is stored in the order of: [batch, in\_height, in\_width, in\_channels]. Alternatively, the format could be "NCHW", the data storage order of: [batch, in\_channels, in\_height, in\_width]. Defaults to "NHWC" ### Dilations ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::Conv2DBackpropFilter::Attrs::Dilations( const gtl::ArraySlice< int > & x ) ``` 1-D tensor of length 4. The dilation factor for each dimension of `input`. If set to k > 1, there will be k-1 skipped cells between each filter element on that dimension. The dimension order is determined by the value of `data_format`, see above for details. Dilations in the batch and depth dimensions must be 1. Defaults to [1, 1, 1, 1] ### ExplicitPaddings ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::Conv2DBackpropFilter::Attrs::ExplicitPaddings( const gtl::ArraySlice< int > & x ) ``` If `padding` is `"EXPLICIT"`, the list of explicit padding amounts. For the ith dimension, the amount of padding inserted before and after the dimension is `explicit_paddings[2 * i]` and `explicit_paddings[2 * i + 1]`, respectively. If `padding` is not `"EXPLICIT"`, `explicit_paddings` must be empty. Defaults to [] ### UseCudnnOnGpu ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::Conv2DBackpropFilter::Attrs::UseCudnnOnGpu( bool x ) ``` Defaults to true. tensorflow_cpp tensorflow::ops::Assert::Attrs tensorflow::ops::Assert::Attrs ============================== `#include <logging_ops.h>` Optional attribute setters for [Assert](../../../../class/tensorflow/ops/assert#classtensorflow_1_1ops_1_1_assert). Summary ------- | Public attributes | | --- | | `[summarize\_](#structtensorflow_1_1ops_1_1_assert_1_1_attrs_1a5e2693cdc96611aa28c1df2902031de8) = 3` | `int64` | | Public functions | | --- | | `[Summarize](#structtensorflow_1_1ops_1_1_assert_1_1_attrs_1a2c4e720fa4aa57c2bd1ac2df5e53dd5b)(int64 x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_assert_1_1_attrs)` [Print](../../../../class/tensorflow/ops/print#classtensorflow_1_1ops_1_1_print) this many entries of each tensor. | Public attributes ----------------- ### summarize\_ ``` int64 tensorflow::ops::Assert::Attrs::summarize_ = 3 ``` Public functions ---------------- ### Summarize ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::Assert::Attrs::Summarize( int64 x ) ``` [Print](../../../../class/tensorflow/ops/print#classtensorflow_1_1ops_1_1_print) this many entries of each tensor. Defaults to 3 tensorflow_cpp tensorflow::ops::EncodeJpeg::Attrs tensorflow::ops::EncodeJpeg::Attrs ================================== `#include <image_ops.h>` Optional attribute setters for [EncodeJpeg](../../../../class/tensorflow/ops/encode-jpeg#classtensorflow_1_1ops_1_1_encode_jpeg). Summary ------- | Public attributes | | --- | | `[chroma\_downsampling\_](#structtensorflow_1_1ops_1_1_encode_jpeg_1_1_attrs_1a3bb34c71aefd52e42a9b1aa4b432e6f7) = true` | `bool` | | `[density\_unit\_](#structtensorflow_1_1ops_1_1_encode_jpeg_1_1_attrs_1ad473f931a23a1df4840975896b684184) = "in"` | `StringPiece` | | `[format\_](#structtensorflow_1_1ops_1_1_encode_jpeg_1_1_attrs_1a5ceef55471c0fad353271762846f6e78) = ""` | `StringPiece` | | `[optimize\_size\_](#structtensorflow_1_1ops_1_1_encode_jpeg_1_1_attrs_1a65568fb0962da850389a89098f550966) = false` | `bool` | | `[progressive\_](#structtensorflow_1_1ops_1_1_encode_jpeg_1_1_attrs_1ac759c38a17868cbc2af1ae8778b29bd8) = false` | `bool` | | `[quality\_](#structtensorflow_1_1ops_1_1_encode_jpeg_1_1_attrs_1a4281376a8af08b15d19bc2764daf126a) = 95` | `int64` | | `[x\_density\_](#structtensorflow_1_1ops_1_1_encode_jpeg_1_1_attrs_1ac2a312998c63610c614fa0394b41dc53) = 300` | `int64` | | `[xmp\_metadata\_](#structtensorflow_1_1ops_1_1_encode_jpeg_1_1_attrs_1ac679a3e0a3e768adc7538f5b2aa4d319) = ""` | `StringPiece` | | `[y\_density\_](#structtensorflow_1_1ops_1_1_encode_jpeg_1_1_attrs_1a3ef30dc71da3a445598d940e9609c192) = 300` | `int64` | | Public functions | | --- | | `[ChromaDownsampling](#structtensorflow_1_1ops_1_1_encode_jpeg_1_1_attrs_1a13b9ec4a7bab1d72fd3c0b57b7056f2b)(bool x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_encode_jpeg_1_1_attrs)` See <http://en.wikipedia.org/wiki/Chroma_subsampling>. | | `[DensityUnit](#structtensorflow_1_1ops_1_1_encode_jpeg_1_1_attrs_1a6290e4f8249e42e91deea2f7e0a2111e)(StringPiece x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_encode_jpeg_1_1_attrs)` Unit used to specify `x_density` and `y_density`: pixels per inch (`'in'`) or centimeter (`'cm'`). | | `[Format](#structtensorflow_1_1ops_1_1_encode_jpeg_1_1_attrs_1ae0b58eaebd511e6c6375c1e0f7821bd8)(StringPiece x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_encode_jpeg_1_1_attrs)` Per pixel image format. | | `[OptimizeSize](#structtensorflow_1_1ops_1_1_encode_jpeg_1_1_attrs_1a27a061d0e31415fd10027bc490ed2631)(bool x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_encode_jpeg_1_1_attrs)` If True, spend CPU/RAM to reduce size with no quality change. | | `[Progressive](#structtensorflow_1_1ops_1_1_encode_jpeg_1_1_attrs_1a4957bb2decc4e5e7e7cf9d20af36205e)(bool x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_encode_jpeg_1_1_attrs)` If True, create a JPEG that loads progressively (coarse to fine). | | `[Quality](#structtensorflow_1_1ops_1_1_encode_jpeg_1_1_attrs_1ac835e75cc50848e902fc1ba2b240a162)(int64 x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_encode_jpeg_1_1_attrs)` Quality of the compression from 0 to 100 (higher is better and slower). | | `[XDensity](#structtensorflow_1_1ops_1_1_encode_jpeg_1_1_attrs_1abd11bc13eae4b694f40ecd4d670eee8e)(int64 x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_encode_jpeg_1_1_attrs)` Horizontal pixels per density unit. | | `[XmpMetadata](#structtensorflow_1_1ops_1_1_encode_jpeg_1_1_attrs_1ae0b968290e4b22a90fda1612b09313c6)(StringPiece x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_encode_jpeg_1_1_attrs)` If not empty, embed this XMP metadata in the image header. | | `[YDensity](#structtensorflow_1_1ops_1_1_encode_jpeg_1_1_attrs_1aba76539bfbaf2e7361710f632a630555)(int64 x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_encode_jpeg_1_1_attrs)` Vertical pixels per density unit. | Public attributes ----------------- ### chroma\_downsampling\_ ``` bool tensorflow::ops::EncodeJpeg::Attrs::chroma_downsampling_ = true ``` ### density\_unit\_ ``` StringPiece tensorflow::ops::EncodeJpeg::Attrs::density_unit_ = "in" ``` ### format\_ ``` StringPiece tensorflow::ops::EncodeJpeg::Attrs::format_ = "" ``` ### optimize\_size\_ ``` bool tensorflow::ops::EncodeJpeg::Attrs::optimize_size_ = false ``` ### progressive\_ ``` bool tensorflow::ops::EncodeJpeg::Attrs::progressive_ = false ``` ### quality\_ ``` int64 tensorflow::ops::EncodeJpeg::Attrs::quality_ = 95 ``` ### x\_density\_ ``` int64 tensorflow::ops::EncodeJpeg::Attrs::x_density_ = 300 ``` ### xmp\_metadata\_ ``` StringPiece tensorflow::ops::EncodeJpeg::Attrs::xmp_metadata_ = "" ``` ### y\_density\_ ``` int64 tensorflow::ops::EncodeJpeg::Attrs::y_density_ = 300 ``` Public functions ---------------- ### ChromaDownsampling ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::EncodeJpeg::Attrs::ChromaDownsampling( bool x ) ``` See <http://en.wikipedia.org/wiki/Chroma_subsampling>. Defaults to true ### DensityUnit ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::EncodeJpeg::Attrs::DensityUnit( StringPiece x ) ``` Unit used to specify `x_density` and `y_density`: pixels per inch (`'in'`) or centimeter (`'cm'`). Defaults to "in" ### Format ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::EncodeJpeg::Attrs::Format( StringPiece x ) ``` Per pixel image format. Defaults to "" ### OptimizeSize ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::EncodeJpeg::Attrs::OptimizeSize( bool x ) ``` If True, spend CPU/RAM to reduce size with no quality change. Defaults to false ### Progressive ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::EncodeJpeg::Attrs::Progressive( bool x ) ``` If True, create a JPEG that loads progressively (coarse to fine). Defaults to false ### Quality ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::EncodeJpeg::Attrs::Quality( int64 x ) ``` Quality of the compression from 0 to 100 (higher is better and slower). Defaults to 95 ### XDensity ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::EncodeJpeg::Attrs::XDensity( int64 x ) ``` Horizontal pixels per density unit. Defaults to 300 ### XmpMetadata ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::EncodeJpeg::Attrs::XmpMetadata( StringPiece x ) ``` If not empty, embed this XMP metadata in the image header. Defaults to "" ### YDensity ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::EncodeJpeg::Attrs::YDensity( int64 x ) ``` Vertical pixels per density unit. Defaults to 300
programming_docs
tensorflow_cpp tensorflow::ops::NotEqual::Attrs tensorflow::ops::NotEqual::Attrs ================================ `#include <math_ops.h>` Optional attribute setters for [NotEqual](../../../../class/tensorflow/ops/not-equal#classtensorflow_1_1ops_1_1_not_equal). Summary ------- | Public attributes | | --- | | `[incompatible\_shape\_error\_](#structtensorflow_1_1ops_1_1_not_equal_1_1_attrs_1aa0b79d78b138f37dde2ce39f5654c302) = true` | `bool` | | Public functions | | --- | | `[IncompatibleShapeError](#structtensorflow_1_1ops_1_1_not_equal_1_1_attrs_1aa320717bfcf1876ce2b8d0a106cf53d0)(bool x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_not_equal_1_1_attrs)` Defaults to true. | Public attributes ----------------- ### incompatible\_shape\_error\_ ``` bool tensorflow::ops::NotEqual::Attrs::incompatible_shape_error_ = true ``` Public functions ---------------- ### IncompatibleShapeError ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::NotEqual::Attrs::IncompatibleShapeError( bool x ) ``` Defaults to true. tensorflow_cpp tensorflow::ops::MapIncompleteSize::Attrs tensorflow::ops::MapIncompleteSize::Attrs ========================================= `#include <data_flow_ops.h>` Optional attribute setters for [MapIncompleteSize](../../../../class/tensorflow/ops/map-incomplete-size#classtensorflow_1_1ops_1_1_map_incomplete_size). Summary ------- | Public attributes | | --- | | `[capacity\_](#structtensorflow_1_1ops_1_1_map_incomplete_size_1_1_attrs_1a599eb597fb9b67aa8ef78c2fb4c5b235) = 0` | `int64` | | `[container\_](#structtensorflow_1_1ops_1_1_map_incomplete_size_1_1_attrs_1aee9b268a2e457986310e3a17382e0ee9) = ""` | `StringPiece` | | `[memory\_limit\_](#structtensorflow_1_1ops_1_1_map_incomplete_size_1_1_attrs_1a3ede6bbcbedd3829900566b0a6b3de0c) = 0` | `int64` | | `[shared\_name\_](#structtensorflow_1_1ops_1_1_map_incomplete_size_1_1_attrs_1a100d1f3eb8790c9e9863f26cc22d3dca) = ""` | `StringPiece` | | Public functions | | --- | | `[Capacity](#structtensorflow_1_1ops_1_1_map_incomplete_size_1_1_attrs_1a6953ec40d9e69715ea8c58c4b82220f0)(int64 x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_map_incomplete_size_1_1_attrs)` Defaults to 0. | | `[Container](#structtensorflow_1_1ops_1_1_map_incomplete_size_1_1_attrs_1a24c5b06cd62df816d897f951e33fcbe5)(StringPiece x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_map_incomplete_size_1_1_attrs)` Defaults to "". | | `[MemoryLimit](#structtensorflow_1_1ops_1_1_map_incomplete_size_1_1_attrs_1a09afa84dfae128240a7885db9f855001)(int64 x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_map_incomplete_size_1_1_attrs)` Defaults to 0. | | `[SharedName](#structtensorflow_1_1ops_1_1_map_incomplete_size_1_1_attrs_1a289fceaa9b10de84792d3eb2c3370971)(StringPiece x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_map_incomplete_size_1_1_attrs)` Defaults to "". | Public attributes ----------------- ### capacity\_ ``` int64 tensorflow::ops::MapIncompleteSize::Attrs::capacity_ = 0 ``` ### container\_ ``` StringPiece tensorflow::ops::MapIncompleteSize::Attrs::container_ = "" ``` ### memory\_limit\_ ``` int64 tensorflow::ops::MapIncompleteSize::Attrs::memory_limit_ = 0 ``` ### shared\_name\_ ``` StringPiece tensorflow::ops::MapIncompleteSize::Attrs::shared_name_ = "" ``` Public functions ---------------- ### Capacity ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::MapIncompleteSize::Attrs::Capacity( int64 x ) ``` Defaults to 0. ### Container ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::MapIncompleteSize::Attrs::Container( StringPiece x ) ``` Defaults to "". ### MemoryLimit ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::MapIncompleteSize::Attrs::MemoryLimit( int64 x ) ``` Defaults to 0. ### SharedName ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::MapIncompleteSize::Attrs::SharedName( StringPiece x ) ``` Defaults to "". tensorflow_cpp tensorflow::ops::QueueDequeueUpTo::Attrs tensorflow::ops::QueueDequeueUpTo::Attrs ======================================== `#include <data_flow_ops.h>` Optional attribute setters for [QueueDequeueUpTo](../../../../class/tensorflow/ops/queue-dequeue-up-to#classtensorflow_1_1ops_1_1_queue_dequeue_up_to). Summary ------- | Public attributes | | --- | | `[timeout\_ms\_](#structtensorflow_1_1ops_1_1_queue_dequeue_up_to_1_1_attrs_1abaac78c782d26a2e84020cc0c4cac2e0) = -1` | `int64` | | Public functions | | --- | | `[TimeoutMs](#structtensorflow_1_1ops_1_1_queue_dequeue_up_to_1_1_attrs_1a3b1219833301ec7415f777387a13e95b)(int64 x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_queue_dequeue_up_to_1_1_attrs)` If the queue has fewer than n elements, this operation will block for up to timeout\_ms milliseconds. | Public attributes ----------------- ### timeout\_ms\_ ``` int64 tensorflow::ops::QueueDequeueUpTo::Attrs::timeout_ms_ = -1 ``` Public functions ---------------- ### TimeoutMs ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::QueueDequeueUpTo::Attrs::TimeoutMs( int64 x ) ``` If the queue has fewer than n elements, this operation will block for up to timeout\_ms milliseconds. Note: This option is not supported yet. Defaults to -1 tensorflow_cpp tensorflow::ops::StringUpper::Attrs tensorflow::ops::StringUpper::Attrs =================================== `#include <string_ops.h>` Optional attribute setters for [StringUpper](../../../../class/tensorflow/ops/string-upper#classtensorflow_1_1ops_1_1_string_upper). Summary ------- | Public attributes | | --- | | `[encoding\_](#structtensorflow_1_1ops_1_1_string_upper_1_1_attrs_1aa0f31d592917b9c831967cac5b68d62b) = ""` | `StringPiece` | | Public functions | | --- | | `[Encoding](#structtensorflow_1_1ops_1_1_string_upper_1_1_attrs_1a5d0f092934edbdd87c0fce2bf26ee7c1)(StringPiece x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_string_upper_1_1_attrs)` Character encoding of `input`. | Public attributes ----------------- ### encoding\_ ``` StringPiece tensorflow::ops::StringUpper::Attrs::encoding_ = "" ``` Public functions ---------------- ### Encoding ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::StringUpper::Attrs::Encoding( StringPiece x ) ``` Character encoding of `input`. Allowed values are '' and 'utf-8'. Value '' is interpreted as ASCII. Defaults to "" tensorflow_cpp tensorflow::ops::ApplyAddSign::Attrs tensorflow::ops::ApplyAddSign::Attrs ==================================== `#include <training_ops.h>` Optional attribute setters for [ApplyAddSign](../../../../class/tensorflow/ops/apply-add-sign#classtensorflow_1_1ops_1_1_apply_add_sign). Summary ------- | Public attributes | | --- | | `[use\_locking\_](#structtensorflow_1_1ops_1_1_apply_add_sign_1_1_attrs_1afb814de9d0d68a5870c9250bd4227316) = false` | `bool` | | Public functions | | --- | | `[UseLocking](#structtensorflow_1_1ops_1_1_apply_add_sign_1_1_attrs_1aa3393b462bb1ba26f25adf75294f366c)(bool x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_apply_add_sign_1_1_attrs)` If `True`, updating of the var and m tensors is protected by a lock; otherwise the behavior is undefined, but may exhibit less contention. | Public attributes ----------------- ### use\_locking\_ ``` bool tensorflow::ops::ApplyAddSign::Attrs::use_locking_ = false ``` Public functions ---------------- ### UseLocking ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::ApplyAddSign::Attrs::UseLocking( bool x ) ``` If `True`, updating of the var and m tensors is protected by a lock; otherwise the behavior is undefined, but may exhibit less contention. Defaults to false tensorflow_cpp tensorflow::ops::Print::Attrs tensorflow::ops::Print::Attrs ============================= `#include <logging_ops.h>` Optional attribute setters for [Print](../../../../class/tensorflow/ops/print#classtensorflow_1_1ops_1_1_print). Summary ------- | Public attributes | | --- | | `[first\_n\_](#structtensorflow_1_1ops_1_1_print_1_1_attrs_1af8f25a20580117a952bad2c9a57d85ac) = -1` | `int64` | | `[message\_](#structtensorflow_1_1ops_1_1_print_1_1_attrs_1ad56f4fff8a98e993f8d7a4be46c29ece) = ""` | `StringPiece` | | `[summarize\_](#structtensorflow_1_1ops_1_1_print_1_1_attrs_1a265944d8a91cd87abe8dcbddafe2e397) = 3` | `int64` | | Public functions | | --- | | `[FirstN](#structtensorflow_1_1ops_1_1_print_1_1_attrs_1ad50937bb415b3f37ec896083ff06233d)(int64 x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_print_1_1_attrs)` Only log `first_n` number of times. | | `[Message](#structtensorflow_1_1ops_1_1_print_1_1_attrs_1aa3075f81bbcad5e3730d0270c1f1f050)(StringPiece x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_print_1_1_attrs)` A string, prefix of the error message. | | `[Summarize](#structtensorflow_1_1ops_1_1_print_1_1_attrs_1afa5fb4638ead2a216f5dbd69dd88f5f2)(int64 x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_print_1_1_attrs)` Only print this many entries of each tensor. | Public attributes ----------------- ### first\_n\_ ``` int64 tensorflow::ops::Print::Attrs::first_n_ = -1 ``` ### message\_ ``` StringPiece tensorflow::ops::Print::Attrs::message_ = "" ``` ### summarize\_ ``` int64 tensorflow::ops::Print::Attrs::summarize_ = 3 ``` Public functions ---------------- ### FirstN ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::Print::Attrs::FirstN( int64 x ) ``` Only log `first_n` number of times. -1 disables logging. Defaults to -1 ### Message ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::Print::Attrs::Message( StringPiece x ) ``` A string, prefix of the error message. Defaults to "" ### Summarize ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::Print::Attrs::Summarize( int64 x ) ``` Only print this many entries of each tensor. Defaults to 3 tensorflow_cpp tensorflow::ops::FakeQuantWithMinMaxArgs::Attrs tensorflow::ops::FakeQuantWithMinMaxArgs::Attrs =============================================== `#include <array_ops.h>` Optional attribute setters for [FakeQuantWithMinMaxArgs](../../../../class/tensorflow/ops/fake-quant-with-min-max-args#classtensorflow_1_1ops_1_1_fake_quant_with_min_max_args). Summary ------- | Public attributes | | --- | | `[max\_](#structtensorflow_1_1ops_1_1_fake_quant_with_min_max_args_1_1_attrs_1a48dd23ab11f3429d0308da5b7705b0d2) = 6.0f` | `float` | | `[min\_](#structtensorflow_1_1ops_1_1_fake_quant_with_min_max_args_1_1_attrs_1a644b4702b16410ad8d78a88c987d05fb) = -6.0f` | `float` | | `[narrow\_range\_](#structtensorflow_1_1ops_1_1_fake_quant_with_min_max_args_1_1_attrs_1a3e690971aa8fef6a4fc67bd48454175e) = false` | `bool` | | `[num\_bits\_](#structtensorflow_1_1ops_1_1_fake_quant_with_min_max_args_1_1_attrs_1ac0792d6daf9b36ff688bf98a7c638b09) = 8` | `int64` | | Public functions | | --- | | `[Max](#structtensorflow_1_1ops_1_1_fake_quant_with_min_max_args_1_1_attrs_1aa20627ac87a81f2cfb9845180b46fb82)(float x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_fake_quant_with_min_max_args_1_1_attrs)` Defaults to 6. | | `[Min](#structtensorflow_1_1ops_1_1_fake_quant_with_min_max_args_1_1_attrs_1afa770ce5ab4dcf1e8d2d87fe7d064395)(float x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_fake_quant_with_min_max_args_1_1_attrs)` Defaults to -6. | | `[NarrowRange](#structtensorflow_1_1ops_1_1_fake_quant_with_min_max_args_1_1_attrs_1a5eb0011f6a7ea4ee9d58ec552f0baa40)(bool x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_fake_quant_with_min_max_args_1_1_attrs)` Defaults to false. | | `[NumBits](#structtensorflow_1_1ops_1_1_fake_quant_with_min_max_args_1_1_attrs_1afed4a295aeff41bfc6ab47841e6276e9)(int64 x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_fake_quant_with_min_max_args_1_1_attrs)` Defaults to 8. | Public attributes ----------------- ### max\_ ``` float tensorflow::ops::FakeQuantWithMinMaxArgs::Attrs::max_ = 6.0f ``` ### min\_ ``` float tensorflow::ops::FakeQuantWithMinMaxArgs::Attrs::min_ = -6.0f ``` ### narrow\_range\_ ``` bool tensorflow::ops::FakeQuantWithMinMaxArgs::Attrs::narrow_range_ = false ``` ### num\_bits\_ ``` int64 tensorflow::ops::FakeQuantWithMinMaxArgs::Attrs::num_bits_ = 8 ``` Public functions ---------------- ### Max ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::FakeQuantWithMinMaxArgs::Attrs::Max( float x ) ``` Defaults to 6. ### Min ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::FakeQuantWithMinMaxArgs::Attrs::Min( float x ) ``` Defaults to -6. ### NarrowRange ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::FakeQuantWithMinMaxArgs::Attrs::NarrowRange( bool x ) ``` Defaults to false. ### NumBits ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::FakeQuantWithMinMaxArgs::Attrs::NumBits( int64 x ) ``` Defaults to 8. tensorflow_cpp tensorflow::ops::PriorityQueue::Attrs tensorflow::ops::PriorityQueue::Attrs ===================================== `#include <data_flow_ops.h>` Optional attribute setters for [PriorityQueue](../../../../class/tensorflow/ops/priority-queue#classtensorflow_1_1ops_1_1_priority_queue). Summary ------- | Public attributes | | --- | | `[capacity\_](#structtensorflow_1_1ops_1_1_priority_queue_1_1_attrs_1aa65ffe44dc2714109f19e52992569fec) = -1` | `int64` | | `[component\_types\_](#structtensorflow_1_1ops_1_1_priority_queue_1_1_attrs_1aa839a218bb8127538e1149e179d2acd4) = {}` | `DataTypeSlice` | | `[container\_](#structtensorflow_1_1ops_1_1_priority_queue_1_1_attrs_1a963c0211187034f0a378b5156205d87d) = ""` | `StringPiece` | | `[shared\_name\_](#structtensorflow_1_1ops_1_1_priority_queue_1_1_attrs_1a5499e28c72d1d604fabb04d1d18d45d5) = ""` | `StringPiece` | | Public functions | | --- | | `[Capacity](#structtensorflow_1_1ops_1_1_priority_queue_1_1_attrs_1aae9a59255a2ba82121cf2ac12fb3be6b)(int64 x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_priority_queue_1_1_attrs)` The upper bound on the number of elements in this queue. | | `[ComponentTypes](#structtensorflow_1_1ops_1_1_priority_queue_1_1_attrs_1aeecbf3906b679e8d2947a6da73dcbebe)(const DataTypeSlice & x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_priority_queue_1_1_attrs)` The type of each component in a value. | | `[Container](#structtensorflow_1_1ops_1_1_priority_queue_1_1_attrs_1ab62e40df0008369c3717067be30e9f80)(StringPiece x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_priority_queue_1_1_attrs)` If non-empty, this queue is placed in the given container. | | `[SharedName](#structtensorflow_1_1ops_1_1_priority_queue_1_1_attrs_1a0c6e77bf1243bca2aad8a9b695ed47cb)(StringPiece x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_priority_queue_1_1_attrs)` If non-empty, this queue will be shared under the given name across multiple sessions. | Public attributes ----------------- ### capacity\_ ``` int64 tensorflow::ops::PriorityQueue::Attrs::capacity_ = -1 ``` ### component\_types\_ ``` DataTypeSlice tensorflow::ops::PriorityQueue::Attrs::component_types_ = {} ``` ### container\_ ``` StringPiece tensorflow::ops::PriorityQueue::Attrs::container_ = "" ``` ### shared\_name\_ ``` StringPiece tensorflow::ops::PriorityQueue::Attrs::shared_name_ = "" ``` Public functions ---------------- ### Capacity ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::PriorityQueue::Attrs::Capacity( int64 x ) ``` The upper bound on the number of elements in this queue. Negative numbers mean no limit. Defaults to -1 ### ComponentTypes ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::PriorityQueue::Attrs::ComponentTypes( const DataTypeSlice & x ) ``` The type of each component in a value. Defaults to [] ### Container ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::PriorityQueue::Attrs::Container( StringPiece x ) ``` If non-empty, this queue is placed in the given container. Otherwise, a default container is used. Defaults to "" ### SharedName ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::PriorityQueue::Attrs::SharedName( StringPiece x ) ``` If non-empty, this queue will be shared under the given name across multiple sessions. Defaults to "" tensorflow_cpp tensorflow::ops::PrintV2::Attrs tensorflow::ops::PrintV2::Attrs =============================== `#include <logging_ops.h>` Optional attribute setters for [PrintV2](../../../../class/tensorflow/ops/print-v2#classtensorflow_1_1ops_1_1_print_v2). Summary ------- | Public attributes | | --- | | `[end\_](#structtensorflow_1_1ops_1_1_print_v2_1_1_attrs_1ac10b313283d5257168d8dc6b2d57d05b) = "\\n"` | `StringPiece` | | `[output\_stream\_](#structtensorflow_1_1ops_1_1_print_v2_1_1_attrs_1abd0359af427791696047ce10fe9f7d0c) = "stderr"` | `StringPiece` | | Public functions | | --- | | `[End](#structtensorflow_1_1ops_1_1_print_v2_1_1_attrs_1ac177607fbaa6ba05332cecb2431dc84f)(StringPiece x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_print_v2_1_1_attrs)` Defaults to "\\n". | | `[OutputStream](#structtensorflow_1_1ops_1_1_print_v2_1_1_attrs_1a93f32d572e42b2abacef0f940b9fb10b)(StringPiece x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_print_v2_1_1_attrs)` A string specifying the output stream or logging level to print to. | Public attributes ----------------- ### end\_ ``` StringPiece tensorflow::ops::PrintV2::Attrs::end_ = "\\n" ``` ### output\_stream\_ ``` StringPiece tensorflow::ops::PrintV2::Attrs::output_stream_ = "stderr" ``` Public functions ---------------- ### End ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::PrintV2::Attrs::End( StringPiece x ) ``` Defaults to "\\n". ### OutputStream ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::PrintV2::Attrs::OutputStream( StringPiece x ) ``` A string specifying the output stream or logging level to print to. Defaults to "stderr" tensorflow_cpp tensorflow::ops::CombinedNonMaxSuppression::Attrs tensorflow::ops::CombinedNonMaxSuppression::Attrs ================================================= `#include <image_ops.h>` Optional attribute setters for [CombinedNonMaxSuppression](../../../../class/tensorflow/ops/combined-non-max-suppression#classtensorflow_1_1ops_1_1_combined_non_max_suppression). Summary ------- | Public attributes | | --- | | `[clip\_boxes\_](#structtensorflow_1_1ops_1_1_combined_non_max_suppression_1_1_attrs_1ad7e61b94fc93be4f425d60c6720079fa) = true` | `bool` | | `[pad\_per\_class\_](#structtensorflow_1_1ops_1_1_combined_non_max_suppression_1_1_attrs_1aee9d101891a954cc2a915bf34c833c30) = false` | `bool` | | Public functions | | --- | | `[ClipBoxes](#structtensorflow_1_1ops_1_1_combined_non_max_suppression_1_1_attrs_1a56ed657f3c5601271e4af26c6b5aa640)(bool x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_combined_non_max_suppression_1_1_attrs)` If true, assume the box coordinates are between [0, 1] and clip the output boxes if they fall beyond [0, 1]. | | `[PadPerClass](#structtensorflow_1_1ops_1_1_combined_non_max_suppression_1_1_attrs_1afd666c4521f060268a85ef59ec6aeb9c)(bool x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_combined_non_max_suppression_1_1_attrs)` If false, the output nmsed boxes, scores and classes are padded/clipped to `max_total_size`. | Public attributes ----------------- ### clip\_boxes\_ ``` bool tensorflow::ops::CombinedNonMaxSuppression::Attrs::clip_boxes_ = true ``` ### pad\_per\_class\_ ``` bool tensorflow::ops::CombinedNonMaxSuppression::Attrs::pad_per_class_ = false ``` Public functions ---------------- ### ClipBoxes ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::CombinedNonMaxSuppression::Attrs::ClipBoxes( bool x ) ``` If true, assume the box coordinates are between [0, 1] and clip the output boxes if they fall beyond [0, 1]. If false, do not do clipping and output the box coordinates as it is. Defaults to true ### PadPerClass ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::CombinedNonMaxSuppression::Attrs::PadPerClass( bool x ) ``` If false, the output nmsed boxes, scores and classes are padded/clipped to `max_total_size`. If true, the output nmsed boxes, scores and classes are padded to be of length `max_size_per_class`\*`num_classes`, unless it exceeds `max_total_size` in which case it is clipped to `max_total_size`. Defaults to false. Defaults to false
programming_docs
tensorflow_cpp tensorflow::ops::QuantizedMul::Attrs tensorflow::ops::QuantizedMul::Attrs ==================================== `#include <math_ops.h>` Optional attribute setters for [QuantizedMul](../../../../class/tensorflow/ops/quantized-mul#classtensorflow_1_1ops_1_1_quantized_mul). Summary ------- | Public attributes | | --- | | `[Toutput\_](#structtensorflow_1_1ops_1_1_quantized_mul_1_1_attrs_1a1d9dfc76337ced9d010b6dc802444cda) = DT_QINT32` | `DataType` | | Public functions | | --- | | `[Toutput](#structtensorflow_1_1ops_1_1_quantized_mul_1_1_attrs_1a496cf320358e9c175876c9cafacece6a)(DataType x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_quantized_mul_1_1_attrs)` Defaults to DT\_QINT32. | Public attributes ----------------- ### Toutput\_ ``` DataType tensorflow::ops::QuantizedMul::Attrs::Toutput_ = DT_QINT32 ``` Public functions ---------------- ### Toutput ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::QuantizedMul::Attrs::Toutput( DataType x ) ``` Defaults to DT\_QINT32. tensorflow_cpp tensorflow::ops::AvgPool3DGrad::Attrs tensorflow::ops::AvgPool3DGrad::Attrs ===================================== `#include <nn_ops.h>` Optional attribute setters for [AvgPool3DGrad](../../../../class/tensorflow/ops/avg-pool3-d-grad#classtensorflow_1_1ops_1_1_avg_pool3_d_grad). Summary ------- | Public attributes | | --- | | `[data\_format\_](#structtensorflow_1_1ops_1_1_avg_pool3_d_grad_1_1_attrs_1a5a6c933896a01f928632c2f59b4f34af) = "NDHWC"` | `StringPiece` | | Public functions | | --- | | `[DataFormat](#structtensorflow_1_1ops_1_1_avg_pool3_d_grad_1_1_attrs_1a8a241e4ab1e60afe34124d193fcca40a)(StringPiece x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_avg_pool3_d_grad_1_1_attrs)` The data format of the input and output data. | Public attributes ----------------- ### data\_format\_ ``` StringPiece tensorflow::ops::AvgPool3DGrad::Attrs::data_format_ = "NDHWC" ``` Public functions ---------------- ### DataFormat ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::AvgPool3DGrad::Attrs::DataFormat( StringPiece x ) ``` The data format of the input and output data. With the default format "NDHWC", the data is stored in the order of: [batch, in\_depth, in\_height, in\_width, in\_channels]. Alternatively, the format could be "NCDHW", the data storage order is: [batch, in\_channels, in\_depth, in\_height, in\_width]. Defaults to "NDHWC" tensorflow_cpp tensorflow::ops::Dequantize::Attrs tensorflow::ops::Dequantize::Attrs ================================== `#include <array_ops.h>` Optional attribute setters for [Dequantize](../../../../class/tensorflow/ops/dequantize#classtensorflow_1_1ops_1_1_dequantize). Summary ------- | Public attributes | | --- | | `[axis\_](#structtensorflow_1_1ops_1_1_dequantize_1_1_attrs_1af432ad7e9303ee6c76c19a9afda0ca89) = -1` | `int64` | | `[dtype\_](#structtensorflow_1_1ops_1_1_dequantize_1_1_attrs_1a68b0e8b37645f29a888b531684cff039) = DT_FLOAT` | `DataType` | | `[mode\_](#structtensorflow_1_1ops_1_1_dequantize_1_1_attrs_1a2e72e17bf315adb13470a951b4e0ae05) = "MIN_COMBINED"` | `StringPiece` | | `[narrow\_range\_](#structtensorflow_1_1ops_1_1_dequantize_1_1_attrs_1a945ba2aa0ec8debc8651c5452262189b) = false` | `bool` | | Public functions | | --- | | `[Axis](#structtensorflow_1_1ops_1_1_dequantize_1_1_attrs_1a419b6b66d5587f5528fc9515d9fff5aa)(int64 x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_dequantize_1_1_attrs)` Defaults to -1. | | `[Dtype](#structtensorflow_1_1ops_1_1_dequantize_1_1_attrs_1ab247f7c724a2428f98ebb271428dc842)(DataType x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_dequantize_1_1_attrs)` Type of the output tensor. | | `[Mode](#structtensorflow_1_1ops_1_1_dequantize_1_1_attrs_1a5d92cbf9b00f4a13f79095f6921bff33)(StringPiece x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_dequantize_1_1_attrs)` Defaults to "MIN\_COMBINED". | | `[NarrowRange](#structtensorflow_1_1ops_1_1_dequantize_1_1_attrs_1acb7be40f55b2d45f7169ba175baf77c4)(bool x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_dequantize_1_1_attrs)` Defaults to false. | Public attributes ----------------- ### axis\_ ``` int64 tensorflow::ops::Dequantize::Attrs::axis_ = -1 ``` ### dtype\_ ``` DataType tensorflow::ops::Dequantize::Attrs::dtype_ = DT_FLOAT ``` ### mode\_ ``` StringPiece tensorflow::ops::Dequantize::Attrs::mode_ = "MIN_COMBINED" ``` ### narrow\_range\_ ``` bool tensorflow::ops::Dequantize::Attrs::narrow_range_ = false ``` Public functions ---------------- ### Axis ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::Dequantize::Attrs::Axis( int64 x ) ``` Defaults to -1. ### Dtype ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::Dequantize::Attrs::Dtype( DataType x ) ``` Type of the output tensor. Currently [Dequantize](../../../../class/tensorflow/ops/dequantize#classtensorflow_1_1ops_1_1_dequantize) supports float and bfloat16. If 'dtype' is 'bfloat16', it only supports 'MIN\_COMBINED' mode. Defaults to DT\_FLOAT ### Mode ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::Dequantize::Attrs::Mode( StringPiece x ) ``` Defaults to "MIN\_COMBINED". ### NarrowRange ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::Dequantize::Attrs::NarrowRange( bool x ) ``` Defaults to false. tensorflow_cpp tensorflow::ops::FakeQuantWithMinMaxVarsPerChannel::Attrs tensorflow::ops::FakeQuantWithMinMaxVarsPerChannel::Attrs ========================================================= `#include <array_ops.h>` Optional attribute setters for [FakeQuantWithMinMaxVarsPerChannel](../../../../class/tensorflow/ops/fake-quant-with-min-max-vars-per-channel#classtensorflow_1_1ops_1_1_fake_quant_with_min_max_vars_per_channel). Summary ------- | Public attributes | | --- | | `[narrow\_range\_](#structtensorflow_1_1ops_1_1_fake_quant_with_min_max_vars_per_channel_1_1_attrs_1a3f477abb6b0401bcf964d5dd1e867b8a) = false` | `bool` | | `[num\_bits\_](#structtensorflow_1_1ops_1_1_fake_quant_with_min_max_vars_per_channel_1_1_attrs_1a1302d92f33ddb3a3315216fc89583608) = 8` | `int64` | | Public functions | | --- | | `[NarrowRange](#structtensorflow_1_1ops_1_1_fake_quant_with_min_max_vars_per_channel_1_1_attrs_1a1257bc0b0af1a6fd417f2b72104bfe2a)(bool x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_fake_quant_with_min_max_vars_per_channel_1_1_attrs)` Defaults to false. | | `[NumBits](#structtensorflow_1_1ops_1_1_fake_quant_with_min_max_vars_per_channel_1_1_attrs_1a173be1ed9fa185296ba6e53953fc6bf7)(int64 x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_fake_quant_with_min_max_vars_per_channel_1_1_attrs)` Defaults to 8. | Public attributes ----------------- ### narrow\_range\_ ``` bool tensorflow::ops::FakeQuantWithMinMaxVarsPerChannel::Attrs::narrow_range_ = false ``` ### num\_bits\_ ``` int64 tensorflow::ops::FakeQuantWithMinMaxVarsPerChannel::Attrs::num_bits_ = 8 ``` Public functions ---------------- ### NarrowRange ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::FakeQuantWithMinMaxVarsPerChannel::Attrs::NarrowRange( bool x ) ``` Defaults to false. ### NumBits ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::FakeQuantWithMinMaxVarsPerChannel::Attrs::NumBits( int64 x ) ``` Defaults to 8. tensorflow_cpp tensorflow::ops::NonMaxSuppressionV5::Attrs tensorflow::ops::NonMaxSuppressionV5::Attrs =========================================== `#include <image_ops.h>` Optional attribute setters for [NonMaxSuppressionV5](../../../../class/tensorflow/ops/non-max-suppression-v5#classtensorflow_1_1ops_1_1_non_max_suppression_v5). Summary ------- | Public attributes | | --- | | `[pad\_to\_max\_output\_size\_](#structtensorflow_1_1ops_1_1_non_max_suppression_v5_1_1_attrs_1afbfb173e3952c05c73208fe81e6aa91f) = false` | `bool` | | Public functions | | --- | | `[PadToMaxOutputSize](#structtensorflow_1_1ops_1_1_non_max_suppression_v5_1_1_attrs_1acee802376c3d8847d7c7cf2afede2cd6)(bool x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_non_max_suppression_v5_1_1_attrs)` If true, the output `selected_indices` is padded to be of length `max_output_size`. | Public attributes ----------------- ### pad\_to\_max\_output\_size\_ ``` bool tensorflow::ops::NonMaxSuppressionV5::Attrs::pad_to_max_output_size_ = false ``` Public functions ---------------- ### PadToMaxOutputSize ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::NonMaxSuppressionV5::Attrs::PadToMaxOutputSize( bool x ) ``` If true, the output `selected_indices` is padded to be of length `max_output_size`. Defaults to false. Defaults to false tensorflow_cpp tensorflow::ops::MapPeek::Attrs tensorflow::ops::MapPeek::Attrs =============================== `#include <data_flow_ops.h>` Optional attribute setters for [MapPeek](../../../../class/tensorflow/ops/map-peek#classtensorflow_1_1ops_1_1_map_peek). Summary ------- | Public attributes | | --- | | `[capacity\_](#structtensorflow_1_1ops_1_1_map_peek_1_1_attrs_1a37d5813ff2708e131871622731254a08) = 0` | `int64` | | `[container\_](#structtensorflow_1_1ops_1_1_map_peek_1_1_attrs_1a56cec070756e11cac5d9e0789ae0da96) = ""` | `StringPiece` | | `[memory\_limit\_](#structtensorflow_1_1ops_1_1_map_peek_1_1_attrs_1ab623ba66b602a1be0c349d675cac9376) = 0` | `int64` | | `[shared\_name\_](#structtensorflow_1_1ops_1_1_map_peek_1_1_attrs_1a6f90246d180d4ff0774d6fdb841dbcf9) = ""` | `StringPiece` | | Public functions | | --- | | `[Capacity](#structtensorflow_1_1ops_1_1_map_peek_1_1_attrs_1a33e195f68449cb5cf6981cef5499502c)(int64 x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_map_peek_1_1_attrs)` Defaults to 0. | | `[Container](#structtensorflow_1_1ops_1_1_map_peek_1_1_attrs_1aa7ec46a6dd35b87b89f4be17b99c27b0)(StringPiece x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_map_peek_1_1_attrs)` Defaults to "". | | `[MemoryLimit](#structtensorflow_1_1ops_1_1_map_peek_1_1_attrs_1a4b9482dfe4843b3640505d3590187a49)(int64 x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_map_peek_1_1_attrs)` Defaults to 0. | | `[SharedName](#structtensorflow_1_1ops_1_1_map_peek_1_1_attrs_1ab721fc873a41eca4efd03994e1182418)(StringPiece x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_map_peek_1_1_attrs)` Defaults to "". | Public attributes ----------------- ### capacity\_ ``` int64 tensorflow::ops::MapPeek::Attrs::capacity_ = 0 ``` ### container\_ ``` StringPiece tensorflow::ops::MapPeek::Attrs::container_ = "" ``` ### memory\_limit\_ ``` int64 tensorflow::ops::MapPeek::Attrs::memory_limit_ = 0 ``` ### shared\_name\_ ``` StringPiece tensorflow::ops::MapPeek::Attrs::shared_name_ = "" ``` Public functions ---------------- ### Capacity ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::MapPeek::Attrs::Capacity( int64 x ) ``` Defaults to 0. ### Container ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::MapPeek::Attrs::Container( StringPiece x ) ``` Defaults to "". ### MemoryLimit ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::MapPeek::Attrs::MemoryLimit( int64 x ) ``` Defaults to 0. ### SharedName ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::MapPeek::Attrs::SharedName( StringPiece x ) ``` Defaults to "". tensorflow_cpp tensorflow::ops::FakeQuantWithMinMaxArgsGradient::Attrs tensorflow::ops::FakeQuantWithMinMaxArgsGradient::Attrs ======================================================= `#include <array_ops.h>` Optional attribute setters for [FakeQuantWithMinMaxArgsGradient](../../../../class/tensorflow/ops/fake-quant-with-min-max-args-gradient#classtensorflow_1_1ops_1_1_fake_quant_with_min_max_args_gradient). Summary ------- | Public attributes | | --- | | `[max\_](#structtensorflow_1_1ops_1_1_fake_quant_with_min_max_args_gradient_1_1_attrs_1a2946b59d8e6247c5ff79b4137c3a3d77) = 6.0f` | `float` | | `[min\_](#structtensorflow_1_1ops_1_1_fake_quant_with_min_max_args_gradient_1_1_attrs_1aeeda11bffea42f79d8db21164ce05619) = -6.0f` | `float` | | `[narrow\_range\_](#structtensorflow_1_1ops_1_1_fake_quant_with_min_max_args_gradient_1_1_attrs_1a5dae68faf5fe587cedc739a970bf10d9) = false` | `bool` | | `[num\_bits\_](#structtensorflow_1_1ops_1_1_fake_quant_with_min_max_args_gradient_1_1_attrs_1a4914428b8dd7854ca67a165b254c45cf) = 8` | `int64` | | Public functions | | --- | | `[Max](#structtensorflow_1_1ops_1_1_fake_quant_with_min_max_args_gradient_1_1_attrs_1ac53fcc80cfb057ae0d66eafe0492e00b)(float x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_fake_quant_with_min_max_args_gradient_1_1_attrs)` Defaults to 6. | | `[Min](#structtensorflow_1_1ops_1_1_fake_quant_with_min_max_args_gradient_1_1_attrs_1a6e931015f464dc07eba994848b116ac6)(float x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_fake_quant_with_min_max_args_gradient_1_1_attrs)` Defaults to -6. | | `[NarrowRange](#structtensorflow_1_1ops_1_1_fake_quant_with_min_max_args_gradient_1_1_attrs_1a04d8916ac676cbb755d6e30be484421f)(bool x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_fake_quant_with_min_max_args_gradient_1_1_attrs)` Defaults to false. | | `[NumBits](#structtensorflow_1_1ops_1_1_fake_quant_with_min_max_args_gradient_1_1_attrs_1a6c2dd332ac497f6e8a814339a021f6ed)(int64 x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_fake_quant_with_min_max_args_gradient_1_1_attrs)` Defaults to 8. | Public attributes ----------------- ### max\_ ``` float tensorflow::ops::FakeQuantWithMinMaxArgsGradient::Attrs::max_ = 6.0f ``` ### min\_ ``` float tensorflow::ops::FakeQuantWithMinMaxArgsGradient::Attrs::min_ = -6.0f ``` ### narrow\_range\_ ``` bool tensorflow::ops::FakeQuantWithMinMaxArgsGradient::Attrs::narrow_range_ = false ``` ### num\_bits\_ ``` int64 tensorflow::ops::FakeQuantWithMinMaxArgsGradient::Attrs::num_bits_ = 8 ``` Public functions ---------------- ### Max ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::FakeQuantWithMinMaxArgsGradient::Attrs::Max( float x ) ``` Defaults to 6. ### Min ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::FakeQuantWithMinMaxArgsGradient::Attrs::Min( float x ) ``` Defaults to -6. ### NarrowRange ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::FakeQuantWithMinMaxArgsGradient::Attrs::NarrowRange( bool x ) ``` Defaults to false. ### NumBits ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::FakeQuantWithMinMaxArgsGradient::Attrs::NumBits( int64 x ) ``` Defaults to 8. tensorflow_cpp tensorflow::ops::Max::Attrs tensorflow::ops::Max::Attrs =========================== `#include <math_ops.h>` Optional attribute setters for [Max](../../../../class/tensorflow/ops/max#classtensorflow_1_1ops_1_1_max). Summary ------- | Public attributes | | --- | | `[keep\_dims\_](#structtensorflow_1_1ops_1_1_max_1_1_attrs_1a36cb4d21d2e2f524365a41bc54de8a43) = false` | `bool` | | Public functions | | --- | | `[KeepDims](#structtensorflow_1_1ops_1_1_max_1_1_attrs_1adee9428c3207ef97ad5df286b14cde4f)(bool x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_max_1_1_attrs)` If true, retain reduced dimensions with length 1. | Public attributes ----------------- ### keep\_dims\_ ``` bool tensorflow::ops::Max::Attrs::keep_dims_ = false ``` Public functions ---------------- ### KeepDims ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::Max::Attrs::KeepDims( bool x ) ``` If true, retain reduced dimensions with length 1. Defaults to false tensorflow_cpp tensorflow::ops::DecodePng::Attrs tensorflow::ops::DecodePng::Attrs ================================= `#include <image_ops.h>` Optional attribute setters for [DecodePng](../../../../class/tensorflow/ops/decode-png#classtensorflow_1_1ops_1_1_decode_png). Summary ------- | Public attributes | | --- | | `[channels\_](#structtensorflow_1_1ops_1_1_decode_png_1_1_attrs_1a296bee037590187a3fa206943066ee6d) = 0` | `int64` | | `[dtype\_](#structtensorflow_1_1ops_1_1_decode_png_1_1_attrs_1aafa6582904e4e041c6f7310f5e803457) = DT_UINT8` | `DataType` | | Public functions | | --- | | `[Channels](#structtensorflow_1_1ops_1_1_decode_png_1_1_attrs_1a1cc5701d219d1fc703182a7f5e7f3123)(int64 x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_decode_png_1_1_attrs)` Number of color channels for the decoded image. | | `[Dtype](#structtensorflow_1_1ops_1_1_decode_png_1_1_attrs_1a1b6ba5a08baab6e53804e735a6f0f544)(DataType x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_decode_png_1_1_attrs)` Defaults to DT\_UINT8. | Public attributes ----------------- ### channels\_ ``` int64 tensorflow::ops::DecodePng::Attrs::channels_ = 0 ``` ### dtype\_ ``` DataType tensorflow::ops::DecodePng::Attrs::dtype_ = DT_UINT8 ``` Public functions ---------------- ### Channels ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::DecodePng::Attrs::Channels( int64 x ) ``` Number of color channels for the decoded image. Defaults to 0 ### Dtype ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::DecodePng::Attrs::Dtype( DataType x ) ``` Defaults to DT\_UINT8. tensorflow_cpp tensorflow::ops::ScatterNdAdd::Attrs tensorflow::ops::ScatterNdAdd::Attrs ==================================== `#include <state_ops.h>` Optional attribute setters for [ScatterNdAdd](../../../../class/tensorflow/ops/scatter-nd-add#classtensorflow_1_1ops_1_1_scatter_nd_add). Summary ------- | Public attributes | | --- | | `[use\_locking\_](#structtensorflow_1_1ops_1_1_scatter_nd_add_1_1_attrs_1abd5dc8d950202b99e8c65b00481c89cf) = false` | `bool` | | Public functions | | --- | | `[UseLocking](#structtensorflow_1_1ops_1_1_scatter_nd_add_1_1_attrs_1a23efeea30a06e44e8960e0d513f969cb)(bool x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_scatter_nd_add_1_1_attrs)` An optional bool. | Public attributes ----------------- ### use\_locking\_ ``` bool tensorflow::ops::ScatterNdAdd::Attrs::use_locking_ = false ``` Public functions ---------------- ### UseLocking ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::ScatterNdAdd::Attrs::UseLocking( bool x ) ``` An optional bool. Defaults to True. If True, the assignment will be protected by a lock; otherwise the behavior is undefined, but may exhibit less contention. Defaults to false tensorflow_cpp tensorflow::ops::ApplyAdagradDA::Attrs tensorflow::ops::ApplyAdagradDA::Attrs ====================================== `#include <training_ops.h>` Optional attribute setters for [ApplyAdagradDA](../../../../class/tensorflow/ops/apply-adagrad-d-a#classtensorflow_1_1ops_1_1_apply_adagrad_d_a). Summary ------- | Public attributes | | --- | | `[use\_locking\_](#structtensorflow_1_1ops_1_1_apply_adagrad_d_a_1_1_attrs_1adb9e28d2c1c8d7fe7747342173c398fa) = false` | `bool` | | Public functions | | --- | | `[UseLocking](#structtensorflow_1_1ops_1_1_apply_adagrad_d_a_1_1_attrs_1af7a0ae1564a713554d86509f786ccd1e)(bool x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_apply_adagrad_d_a_1_1_attrs)` If True, updating of the var and accum tensors will be protected by a lock; otherwise the behavior is undefined, but may exhibit less contention. | Public attributes ----------------- ### use\_locking\_ ``` bool tensorflow::ops::ApplyAdagradDA::Attrs::use_locking_ = false ``` Public functions ---------------- ### UseLocking ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::ApplyAdagradDA::Attrs::UseLocking( bool x ) ``` If True, updating of the var and accum tensors will be protected by a lock; otherwise the behavior is undefined, but may exhibit less contention. Defaults to false
programming_docs
tensorflow_cpp tensorflow::ops::Barrier::Attrs tensorflow::ops::Barrier::Attrs =============================== `#include <data_flow_ops.h>` Optional attribute setters for [Barrier](../../../../class/tensorflow/ops/barrier#classtensorflow_1_1ops_1_1_barrier). Summary ------- | Public attributes | | --- | | `[capacity\_](#structtensorflow_1_1ops_1_1_barrier_1_1_attrs_1a69050e8ab6942c26170a259770beb612) = -1` | `int64` | | `[container\_](#structtensorflow_1_1ops_1_1_barrier_1_1_attrs_1a12a926ec571515bc3d7f263b29e80930) = ""` | `StringPiece` | | `[shapes\_](#structtensorflow_1_1ops_1_1_barrier_1_1_attrs_1a9427afb384416c3b614e93464421d3d2) = {}` | `gtl::ArraySlice< PartialTensorShape >` | | `[shared\_name\_](#structtensorflow_1_1ops_1_1_barrier_1_1_attrs_1aa08c6738f5454d724dea56d2f412f773) = ""` | `StringPiece` | | Public functions | | --- | | `[Capacity](#structtensorflow_1_1ops_1_1_barrier_1_1_attrs_1af3bd6950840f3ff42a55315285da416f)(int64 x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_barrier_1_1_attrs)` The capacity of the barrier. | | `[Container](#structtensorflow_1_1ops_1_1_barrier_1_1_attrs_1a9efc1dc034650d56b150d89cb7867450)(StringPiece x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_barrier_1_1_attrs)` If non-empty, this barrier is placed in the given container. | | `[Shapes](#structtensorflow_1_1ops_1_1_barrier_1_1_attrs_1a418b729afcfe333b28907730793ffd60)(const gtl::ArraySlice< PartialTensorShape > & x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_barrier_1_1_attrs)` The shape of each component in a value. | | `[SharedName](#structtensorflow_1_1ops_1_1_barrier_1_1_attrs_1a81b69b1d5a7eaaa0aa32c6e19af28c5b)(StringPiece x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_barrier_1_1_attrs)` If non-empty, this barrier will be shared under the given name across multiple sessions. | Public attributes ----------------- ### capacity\_ ``` int64 tensorflow::ops::Barrier::Attrs::capacity_ = -1 ``` ### container\_ ``` StringPiece tensorflow::ops::Barrier::Attrs::container_ = "" ``` ### shapes\_ ``` gtl::ArraySlice< PartialTensorShape > tensorflow::ops::Barrier::Attrs::shapes_ = {} ``` ### shared\_name\_ ``` StringPiece tensorflow::ops::Barrier::Attrs::shared_name_ = "" ``` Public functions ---------------- ### Capacity ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::Barrier::Attrs::Capacity( int64 x ) ``` The capacity of the barrier. The default capacity is MAX\_INT32, which is the largest capacity of the underlying queue. Defaults to -1 ### Container ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::Barrier::Attrs::Container( StringPiece x ) ``` If non-empty, this barrier is placed in the given container. Otherwise, a default container is used. Defaults to "" ### Shapes ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::Barrier::Attrs::Shapes( const gtl::ArraySlice< PartialTensorShape > & x ) ``` The shape of each component in a value. Each shape must be 1 in the first dimension. The length of this attr must be the same as the length of component\_types. Defaults to [] ### SharedName ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::Barrier::Attrs::SharedName( StringPiece x ) ``` If non-empty, this barrier will be shared under the given name across multiple sessions. Defaults to "" tensorflow_cpp tensorflow::ops::DenseBincount::Attrs tensorflow::ops::DenseBincount::Attrs ===================================== `#include <math_ops.h>` Optional attribute setters for [DenseBincount](../../../../class/tensorflow/ops/dense-bincount#classtensorflow_1_1ops_1_1_dense_bincount). Summary ------- | Public attributes | | --- | | `[binary\_output\_](#structtensorflow_1_1ops_1_1_dense_bincount_1_1_attrs_1a955ce1d6b99fa4a24116d17cb0de255a) = false` | `bool` | | Public functions | | --- | | `[BinaryOutput](#structtensorflow_1_1ops_1_1_dense_bincount_1_1_attrs_1a6fb44a502dd6391a5352ced0b10eff8b)(bool x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_dense_bincount_1_1_attrs)` bool; Whether the kernel should count the appearance or number of occurrences. | Public attributes ----------------- ### binary\_output\_ ``` bool tensorflow::ops::DenseBincount::Attrs::binary_output_ = false ``` Public functions ---------------- ### BinaryOutput ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::DenseBincount::Attrs::BinaryOutput( bool x ) ``` bool; Whether the kernel should count the appearance or number of occurrences. Defaults to false tensorflow_cpp tensorflow::ops::TensorSummary::Attrs tensorflow::ops::TensorSummary::Attrs ===================================== `#include <logging_ops.h>` Optional attribute setters for [TensorSummary](../../../../class/tensorflow/ops/tensor-summary#classtensorflow_1_1ops_1_1_tensor_summary). Summary ------- | Public attributes | | --- | | `[description\_](#structtensorflow_1_1ops_1_1_tensor_summary_1_1_attrs_1a976f01922653dc7effd8481455dc7fa2) = ""` | `StringPiece` | | `[display\_name\_](#structtensorflow_1_1ops_1_1_tensor_summary_1_1_attrs_1a6d66b030638bbea93c4150c1a4f3c9e3) = ""` | `StringPiece` | | `[labels\_](#structtensorflow_1_1ops_1_1_tensor_summary_1_1_attrs_1a637a10dfecbb3ddcbd82eb347489ae27) = {}` | `gtl::ArraySlice<::tensorflow::tstring >` | | Public functions | | --- | | `[Description](#structtensorflow_1_1ops_1_1_tensor_summary_1_1_attrs_1af586e1802efa1ab75c8f58d92421ab32)(StringPiece x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_tensor_summary_1_1_attrs)` A json-encoded SummaryDescription proto. | | `[DisplayName](#structtensorflow_1_1ops_1_1_tensor_summary_1_1_attrs_1a4c5bf3f8233602c417b8868462d36cbb)(StringPiece x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_tensor_summary_1_1_attrs)` An unused string. | | `[Labels](#structtensorflow_1_1ops_1_1_tensor_summary_1_1_attrs_1a3ee4dc54c01121d0975dec25aa5d1e6d)(const gtl::ArraySlice<::tensorflow::tstring > & x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_tensor_summary_1_1_attrs)` An unused list of strings. | Public attributes ----------------- ### description\_ ``` StringPiece tensorflow::ops::TensorSummary::Attrs::description_ = "" ``` ### display\_name\_ ``` StringPiece tensorflow::ops::TensorSummary::Attrs::display_name_ = "" ``` ### labels\_ ``` gtl::ArraySlice<::tensorflow::tstring > tensorflow::ops::TensorSummary::Attrs::labels_ = {} ``` Public functions ---------------- ### Description ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::TensorSummary::Attrs::Description( StringPiece x ) ``` A json-encoded SummaryDescription proto. Defaults to "" ### DisplayName ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::TensorSummary::Attrs::DisplayName( StringPiece x ) ``` An unused string. Defaults to "" ### Labels ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::TensorSummary::Attrs::Labels( const gtl::ArraySlice<::tensorflow::tstring > & x ) ``` An unused list of strings. Defaults to [] tensorflow_cpp tensorflow::ops::ResourceScatterNdMin::Attrs tensorflow::ops::ResourceScatterNdMin::Attrs ============================================ `#include <state_ops.h>` Optional attribute setters for [ResourceScatterNdMin](../../../../class/tensorflow/ops/resource-scatter-nd-min#classtensorflow_1_1ops_1_1_resource_scatter_nd_min). Summary ------- | Public attributes | | --- | | `[use\_locking\_](#structtensorflow_1_1ops_1_1_resource_scatter_nd_min_1_1_attrs_1ab298080b6aa4adb9eef6b6864c62ae8b) = true` | `bool` | | Public functions | | --- | | `[UseLocking](#structtensorflow_1_1ops_1_1_resource_scatter_nd_min_1_1_attrs_1a3af7d19be885d9b33025b4a26eeee05e)(bool x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_resource_scatter_nd_min_1_1_attrs)` An optional bool. | Public attributes ----------------- ### use\_locking\_ ``` bool tensorflow::ops::ResourceScatterNdMin::Attrs::use_locking_ = true ``` Public functions ---------------- ### UseLocking ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::ResourceScatterNdMin::Attrs::UseLocking( bool x ) ``` An optional bool. Defaults to True. If True, the assignment will be protected by a lock; otherwise the behavior is undefined, but may exhibit less contention. Defaults to true tensorflow_cpp tensorflow::ops::QuantizeAndDequantizeV4Grad::Attrs tensorflow::ops::QuantizeAndDequantizeV4Grad::Attrs =================================================== `#include <array_ops.h>` Optional attribute setters for [QuantizeAndDequantizeV4Grad](../../../../class/tensorflow/ops/quantize-and-dequantize-v4-grad#classtensorflow_1_1ops_1_1_quantize_and_dequantize_v4_grad). Summary ------- | Public attributes | | --- | | `[axis\_](#structtensorflow_1_1ops_1_1_quantize_and_dequantize_v4_grad_1_1_attrs_1aef2f767e254e55db1078273eafa0b8ac) = -1` | `int64` | | Public functions | | --- | | `[Axis](#structtensorflow_1_1ops_1_1_quantize_and_dequantize_v4_grad_1_1_attrs_1a8e4189bc7497e0bc3a3edbe89a8cc66d)(int64 x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_quantize_and_dequantize_v4_grad_1_1_attrs)` Defaults to -1. | Public attributes ----------------- ### axis\_ ``` int64 tensorflow::ops::QuantizeAndDequantizeV4Grad::Attrs::axis_ = -1 ``` Public functions ---------------- ### Axis ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::QuantizeAndDequantizeV4Grad::Attrs::Axis( int64 x ) ``` Defaults to -1. tensorflow_cpp tensorflow::ops::OrderedMapUnstageNoKey::Attrs tensorflow::ops::OrderedMapUnstageNoKey::Attrs ============================================== `#include <data_flow_ops.h>` Optional attribute setters for [OrderedMapUnstageNoKey](../../../../class/tensorflow/ops/ordered-map-unstage-no-key#classtensorflow_1_1ops_1_1_ordered_map_unstage_no_key). Summary ------- | Public attributes | | --- | | `[capacity\_](#structtensorflow_1_1ops_1_1_ordered_map_unstage_no_key_1_1_attrs_1af627cfc531f4ec689303caa77824e1a7) = 0` | `int64` | | `[container\_](#structtensorflow_1_1ops_1_1_ordered_map_unstage_no_key_1_1_attrs_1a496d00d8b0e46cb81e8eb3ce74b521eb) = ""` | `StringPiece` | | `[memory\_limit\_](#structtensorflow_1_1ops_1_1_ordered_map_unstage_no_key_1_1_attrs_1a6d4afcbd798d6656861dadb30502262d) = 0` | `int64` | | `[shared\_name\_](#structtensorflow_1_1ops_1_1_ordered_map_unstage_no_key_1_1_attrs_1a24ed3ab1936022a50e05a44d5f281725) = ""` | `StringPiece` | | Public functions | | --- | | `[Capacity](#structtensorflow_1_1ops_1_1_ordered_map_unstage_no_key_1_1_attrs_1adde7c29898eb761e201387a8b90aa373)(int64 x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_ordered_map_unstage_no_key_1_1_attrs)` Defaults to 0. | | `[Container](#structtensorflow_1_1ops_1_1_ordered_map_unstage_no_key_1_1_attrs_1a015c7300caf990f1a8406783844f7ef1)(StringPiece x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_ordered_map_unstage_no_key_1_1_attrs)` Defaults to "". | | `[MemoryLimit](#structtensorflow_1_1ops_1_1_ordered_map_unstage_no_key_1_1_attrs_1ab96b0dc5dd3e946d514bd0008f23858e)(int64 x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_ordered_map_unstage_no_key_1_1_attrs)` Defaults to 0. | | `[SharedName](#structtensorflow_1_1ops_1_1_ordered_map_unstage_no_key_1_1_attrs_1ab1091b33f20d66d4a5bb870297ddd23b)(StringPiece x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_ordered_map_unstage_no_key_1_1_attrs)` Defaults to "". | Public attributes ----------------- ### capacity\_ ``` int64 tensorflow::ops::OrderedMapUnstageNoKey::Attrs::capacity_ = 0 ``` ### container\_ ``` StringPiece tensorflow::ops::OrderedMapUnstageNoKey::Attrs::container_ = "" ``` ### memory\_limit\_ ``` int64 tensorflow::ops::OrderedMapUnstageNoKey::Attrs::memory_limit_ = 0 ``` ### shared\_name\_ ``` StringPiece tensorflow::ops::OrderedMapUnstageNoKey::Attrs::shared_name_ = "" ``` Public functions ---------------- ### Capacity ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::OrderedMapUnstageNoKey::Attrs::Capacity( int64 x ) ``` Defaults to 0. ### Container ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::OrderedMapUnstageNoKey::Attrs::Container( StringPiece x ) ``` Defaults to "". ### MemoryLimit ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::OrderedMapUnstageNoKey::Attrs::MemoryLimit( int64 x ) ``` Defaults to 0. ### SharedName ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::OrderedMapUnstageNoKey::Attrs::SharedName( StringPiece x ) ``` Defaults to "". tensorflow_cpp tensorflow::ops::OneHot::Attrs tensorflow::ops::OneHot::Attrs ============================== `#include <array_ops.h>` Optional attribute setters for [OneHot](../../../../class/tensorflow/ops/one-hot#classtensorflow_1_1ops_1_1_one_hot). Summary ------- | Public attributes | | --- | | `[axis\_](#structtensorflow_1_1ops_1_1_one_hot_1_1_attrs_1a2652b47252da31a8ca3eff67d677ccc4) = -1` | `int64` | | Public functions | | --- | | `[Axis](#structtensorflow_1_1ops_1_1_one_hot_1_1_attrs_1afc9b5c290d8fefa2f67f82b640d27ab9)(int64 x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_one_hot_1_1_attrs)` The axis to fill (default: -1, a new inner-most axis). | Public attributes ----------------- ### axis\_ ``` int64 tensorflow::ops::OneHot::Attrs::axis_ = -1 ``` Public functions ---------------- ### Axis ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::OneHot::Attrs::Axis( int64 x ) ``` The axis to fill (default: -1, a new inner-most axis). Defaults to -1 tensorflow_cpp tensorflow::ops::AssignAdd::Attrs tensorflow::ops::AssignAdd::Attrs ================================= `#include <state_ops.h>` Optional attribute setters for [AssignAdd](../../../../class/tensorflow/ops/assign-add#classtensorflow_1_1ops_1_1_assign_add). Summary ------- | Public attributes | | --- | | `[use\_locking\_](#structtensorflow_1_1ops_1_1_assign_add_1_1_attrs_1ac27e0592f30dbde9e1331a9ac492dd25) = false` | `bool` | | Public functions | | --- | | `[UseLocking](#structtensorflow_1_1ops_1_1_assign_add_1_1_attrs_1a25c329a432fabe22e46b782c005fcf7b)(bool x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_assign_add_1_1_attrs)` If True, the addition will be protected by a lock; otherwise the behavior is undefined, but may exhibit less contention. | Public attributes ----------------- ### use\_locking\_ ``` bool tensorflow::ops::AssignAdd::Attrs::use_locking_ = false ``` Public functions ---------------- ### UseLocking ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::AssignAdd::Attrs::UseLocking( bool x ) ``` If True, the addition will be protected by a lock; otherwise the behavior is undefined, but may exhibit less contention. Defaults to false tensorflow_cpp tensorflow::ops::Any::Attrs tensorflow::ops::Any::Attrs =========================== `#include <math_ops.h>` Optional attribute setters for [Any](../../../../class/tensorflow/ops/any#classtensorflow_1_1ops_1_1_any). Summary ------- | Public attributes | | --- | | `[keep\_dims\_](#structtensorflow_1_1ops_1_1_any_1_1_attrs_1a1bdea43600313c5afbd5a1907ab22ed6) = false` | `bool` | | Public functions | | --- | | `[KeepDims](#structtensorflow_1_1ops_1_1_any_1_1_attrs_1aa6fc5fa8a823cfc8a002edd48f4c1198)(bool x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_any_1_1_attrs)` If true, retain reduced dimensions with length 1. | Public attributes ----------------- ### keep\_dims\_ ``` bool tensorflow::ops::Any::Attrs::keep_dims_ = false ``` Public functions ---------------- ### KeepDims ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::Any::Attrs::KeepDims( bool x ) ``` If true, retain reduced dimensions with length 1. Defaults to false tensorflow_cpp tensorflow::ops::ScaleAndTranslate::Attrs tensorflow::ops::ScaleAndTranslate::Attrs ========================================= `#include <image_ops.h>` Optional attribute setters for [ScaleAndTranslate](../../../../class/tensorflow/ops/scale-and-translate#classtensorflow_1_1ops_1_1_scale_and_translate). Summary ------- | Public attributes | | --- | | `[antialias\_](#structtensorflow_1_1ops_1_1_scale_and_translate_1_1_attrs_1a814f5f8841dfb151ef12a422aa459958) = true` | `bool` | | `[kernel\_type\_](#structtensorflow_1_1ops_1_1_scale_and_translate_1_1_attrs_1ade21a4b03c7f0d88095920e7db877df3) = "lanczos3"` | `StringPiece` | | Public functions | | --- | | `[Antialias](#structtensorflow_1_1ops_1_1_scale_and_translate_1_1_attrs_1aed3f62f4ef3dea964bdeffb272bbd2e7)(bool x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_scale_and_translate_1_1_attrs)` Defaults to true. | | `[KernelType](#structtensorflow_1_1ops_1_1_scale_and_translate_1_1_attrs_1a486f15e7171e4febf2fb2ec638d1e389)(StringPiece x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_scale_and_translate_1_1_attrs)` Defaults to "lanczos3". | Public attributes ----------------- ### antialias\_ ``` bool tensorflow::ops::ScaleAndTranslate::Attrs::antialias_ = true ``` ### kernel\_type\_ ``` StringPiece tensorflow::ops::ScaleAndTranslate::Attrs::kernel_type_ = "lanczos3" ``` Public functions ---------------- ### Antialias ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::ScaleAndTranslate::Attrs::Antialias( bool x ) ``` Defaults to true. ### KernelType ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::ScaleAndTranslate::Attrs::KernelType( StringPiece x ) ``` Defaults to "lanczos3". tensorflow_cpp tensorflow::ops::StagePeek::Attrs tensorflow::ops::StagePeek::Attrs ================================= `#include <data_flow_ops.h>` Optional attribute setters for [StagePeek](../../../../class/tensorflow/ops/stage-peek#classtensorflow_1_1ops_1_1_stage_peek). Summary ------- | Public attributes | | --- | | `[capacity\_](#structtensorflow_1_1ops_1_1_stage_peek_1_1_attrs_1a5569cb22b60c349f42155a759e0cb7de) = 0` | `int64` | | `[container\_](#structtensorflow_1_1ops_1_1_stage_peek_1_1_attrs_1a3dc299482f154779c3b22b52faa97fcc) = ""` | `StringPiece` | | `[memory\_limit\_](#structtensorflow_1_1ops_1_1_stage_peek_1_1_attrs_1a510674ab69bff6590392c97d678ea956) = 0` | `int64` | | `[shared\_name\_](#structtensorflow_1_1ops_1_1_stage_peek_1_1_attrs_1a4923f9de353bec90cbc8098d69d70d5e) = ""` | `StringPiece` | | Public functions | | --- | | `[Capacity](#structtensorflow_1_1ops_1_1_stage_peek_1_1_attrs_1a8c38e5f507e1836d371c3790a867cff8)(int64 x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_stage_peek_1_1_attrs)` Defaults to 0. | | `[Container](#structtensorflow_1_1ops_1_1_stage_peek_1_1_attrs_1a26e0373d9ff7e5b7bc5dcaa21436a780)(StringPiece x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_stage_peek_1_1_attrs)` Defaults to "". | | `[MemoryLimit](#structtensorflow_1_1ops_1_1_stage_peek_1_1_attrs_1a936b4dd744402d86966b2a32c88475a4)(int64 x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_stage_peek_1_1_attrs)` Defaults to 0. | | `[SharedName](#structtensorflow_1_1ops_1_1_stage_peek_1_1_attrs_1a6ed6eb32279b09a68b580cd48a85ed13)(StringPiece x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_stage_peek_1_1_attrs)` Defaults to "". | Public attributes ----------------- ### capacity\_ ``` int64 tensorflow::ops::StagePeek::Attrs::capacity_ = 0 ``` ### container\_ ``` StringPiece tensorflow::ops::StagePeek::Attrs::container_ = "" ``` ### memory\_limit\_ ``` int64 tensorflow::ops::StagePeek::Attrs::memory_limit_ = 0 ``` ### shared\_name\_ ``` StringPiece tensorflow::ops::StagePeek::Attrs::shared_name_ = "" ``` Public functions ---------------- ### Capacity ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::StagePeek::Attrs::Capacity( int64 x ) ``` Defaults to 0. ### Container ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::StagePeek::Attrs::Container( StringPiece x ) ``` Defaults to "". ### MemoryLimit ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::StagePeek::Attrs::MemoryLimit( int64 x ) ``` Defaults to 0. ### SharedName ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::StagePeek::Attrs::SharedName( StringPiece x ) ``` Defaults to "".
programming_docs
tensorflow_cpp tensorflow::ops::StringFormat::Attrs tensorflow::ops::StringFormat::Attrs ==================================== `#include <string_ops.h>` Optional attribute setters for [StringFormat](../../../../class/tensorflow/ops/string-format#classtensorflow_1_1ops_1_1_string_format). Summary ------- | Public attributes | | --- | | `[placeholder\_](#structtensorflow_1_1ops_1_1_string_format_1_1_attrs_1ae154169fdc319721c6265fd1564fa6c5) = "%s"` | `StringPiece` | | `[summarize\_](#structtensorflow_1_1ops_1_1_string_format_1_1_attrs_1a4ac645e6fc8777047aab38b524b9b1bf) = 3` | `int64` | | `[template\_](#structtensorflow_1_1ops_1_1_string_format_1_1_attrs_1a49784b093dfa331fba507913ac889721) = "%s"` | `StringPiece` | | Public functions | | --- | | `[Placeholder](#structtensorflow_1_1ops_1_1_string_format_1_1_attrs_1a429fe5e592abbc155c1f6f5a7a8570ce)(StringPiece x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_string_format_1_1_attrs)` A string, at each placeholder in the template a subsequent tensor summary will be inserted. | | `[Summarize](#structtensorflow_1_1ops_1_1_string_format_1_1_attrs_1aba0615598d71a58eb226fe2553559e94)(int64 x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_string_format_1_1_attrs)` When formatting the tensor summaries print the first and last summarize entries of each tensor dimension. | | `[Template](#structtensorflow_1_1ops_1_1_string_format_1_1_attrs_1a928ee0aff5ef8fa9e14e0410bf96afac)(StringPiece x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_string_format_1_1_attrs)` A string, the template to format tensor summaries into. | Public attributes ----------------- ### placeholder\_ ``` StringPiece tensorflow::ops::StringFormat::Attrs::placeholder_ = "%s" ``` ### summarize\_ ``` int64 tensorflow::ops::StringFormat::Attrs::summarize_ = 3 ``` ### template\_ ``` StringPiece tensorflow::ops::StringFormat::Attrs::template_ = "%s" ``` Public functions ---------------- ### Placeholder ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::StringFormat::Attrs::Placeholder( StringPiece x ) ``` A string, at each placeholder in the template a subsequent tensor summary will be inserted. Defaults to "%s" ### Summarize ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::StringFormat::Attrs::Summarize( int64 x ) ``` When formatting the tensor summaries print the first and last summarize entries of each tensor dimension. Defaults to 3 ### Template ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::StringFormat::Attrs::Template( StringPiece x ) ``` A string, the template to format tensor summaries into. Defaults to "%s" tensorflow_cpp tensorflow::ops::FractionalMaxPool::Attrs tensorflow::ops::FractionalMaxPool::Attrs ========================================= `#include <nn_ops.h>` Optional attribute setters for [FractionalMaxPool](../../../../class/tensorflow/ops/fractional-max-pool#classtensorflow_1_1ops_1_1_fractional_max_pool). Summary ------- | Public attributes | | --- | | `[deterministic\_](#structtensorflow_1_1ops_1_1_fractional_max_pool_1_1_attrs_1aafd4ee41920c87adbef0c771e0e4aba4) = false` | `bool` | | `[overlapping\_](#structtensorflow_1_1ops_1_1_fractional_max_pool_1_1_attrs_1a6b8769b5907abc5c5cee931232163a05) = false` | `bool` | | `[pseudo\_random\_](#structtensorflow_1_1ops_1_1_fractional_max_pool_1_1_attrs_1a6c151417d34e214907edbe5759f54558) = false` | `bool` | | `[seed2\_](#structtensorflow_1_1ops_1_1_fractional_max_pool_1_1_attrs_1aefa7cfbd921aed44c3aa965112aae471) = 0` | `int64` | | `[seed\_](#structtensorflow_1_1ops_1_1_fractional_max_pool_1_1_attrs_1a16a5faf4dbc78aa4273a0b4bd1b6bb16) = 0` | `int64` | | Public functions | | --- | | `[Deterministic](#structtensorflow_1_1ops_1_1_fractional_max_pool_1_1_attrs_1a9706cde32d80300611dd0f402e11c260)(bool x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_fractional_max_pool_1_1_attrs)` When set to True, a fixed pooling region will be used when iterating over a [FractionalMaxPool](../../../../class/tensorflow/ops/fractional-max-pool#classtensorflow_1_1ops_1_1_fractional_max_pool) node in the computation graph. | | `[Overlapping](#structtensorflow_1_1ops_1_1_fractional_max_pool_1_1_attrs_1a88e7b77529a3eaad0c669ce58de7c8d6)(bool x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_fractional_max_pool_1_1_attrs)` When set to True, it means when pooling, the values at the boundary of adjacent pooling cells are used by both cells. | | `[PseudoRandom](#structtensorflow_1_1ops_1_1_fractional_max_pool_1_1_attrs_1a79febe1b4fc14f85af705bf34afcb0cb)(bool x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_fractional_max_pool_1_1_attrs)` When set to True, generates the pooling sequence in a pseudorandom fashion, otherwise, in a random fashion. | | `[Seed](#structtensorflow_1_1ops_1_1_fractional_max_pool_1_1_attrs_1a2ddc35d0c34cc172bddeb5d1fe3efb47)(int64 x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_fractional_max_pool_1_1_attrs)` If either seed or seed2 are set to be non-zero, the random number generator is seeded by the given seed. | | `[Seed2](#structtensorflow_1_1ops_1_1_fractional_max_pool_1_1_attrs_1ac3ab59fffb91f5171c0b93e5867dda8c)(int64 x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_fractional_max_pool_1_1_attrs)` An second seed to avoid seed collision. | Public attributes ----------------- ### deterministic\_ ``` bool tensorflow::ops::FractionalMaxPool::Attrs::deterministic_ = false ``` ### overlapping\_ ``` bool tensorflow::ops::FractionalMaxPool::Attrs::overlapping_ = false ``` ### pseudo\_random\_ ``` bool tensorflow::ops::FractionalMaxPool::Attrs::pseudo_random_ = false ``` ### seed2\_ ``` int64 tensorflow::ops::FractionalMaxPool::Attrs::seed2_ = 0 ``` ### seed\_ ``` int64 tensorflow::ops::FractionalMaxPool::Attrs::seed_ = 0 ``` Public functions ---------------- ### Deterministic ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::FractionalMaxPool::Attrs::Deterministic( bool x ) ``` When set to True, a fixed pooling region will be used when iterating over a [FractionalMaxPool](../../../../class/tensorflow/ops/fractional-max-pool#classtensorflow_1_1ops_1_1_fractional_max_pool) node in the computation graph. Mainly used in unit test to make [FractionalMaxPool](../../../../class/tensorflow/ops/fractional-max-pool#classtensorflow_1_1ops_1_1_fractional_max_pool) deterministic. Defaults to false ### Overlapping ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::FractionalMaxPool::Attrs::Overlapping( bool x ) ``` When set to True, it means when pooling, the values at the boundary of adjacent pooling cells are used by both cells. For example: `index 0 1 2 3 4` `value 20 5 16 3 7` If the pooling sequence is [0, 2, 4], then 16, at index 2 will be used twice. The result would be [20, 16] for fractional max pooling. Defaults to false ### PseudoRandom ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::FractionalMaxPool::Attrs::PseudoRandom( bool x ) ``` When set to True, generates the pooling sequence in a pseudorandom fashion, otherwise, in a random fashion. Check paper [Benjamin Graham, Fractional Max-Pooling](http://arxiv.org/abs/1412.6071) for difference between pseudorandom and random. Defaults to false ### Seed ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::FractionalMaxPool::Attrs::Seed( int64 x ) ``` If either seed or seed2 are set to be non-zero, the random number generator is seeded by the given seed. Otherwise, it is seeded by a random seed. Defaults to 0 ### Seed2 ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::FractionalMaxPool::Attrs::Seed2( int64 x ) ``` An second seed to avoid seed collision. Defaults to 0 tensorflow_cpp tensorflow::ops::BiasAddGrad::Attrs tensorflow::ops::BiasAddGrad::Attrs =================================== `#include <nn_ops.h>` Optional attribute setters for [BiasAddGrad](../../../../class/tensorflow/ops/bias-add-grad#classtensorflow_1_1ops_1_1_bias_add_grad). Summary ------- | Public attributes | | --- | | `[data\_format\_](#structtensorflow_1_1ops_1_1_bias_add_grad_1_1_attrs_1a77e104a2910a669f1c39d7b0ab4b2400) = "NHWC"` | `StringPiece` | | Public functions | | --- | | `[DataFormat](#structtensorflow_1_1ops_1_1_bias_add_grad_1_1_attrs_1a995f86e3cabc63ba8f676d3ecdc84ea3)(StringPiece x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_bias_add_grad_1_1_attrs)` Specify the data format of the input and output data. | Public attributes ----------------- ### data\_format\_ ``` StringPiece tensorflow::ops::BiasAddGrad::Attrs::data_format_ = "NHWC" ``` Public functions ---------------- ### DataFormat ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::BiasAddGrad::Attrs::DataFormat( StringPiece x ) ``` Specify the data format of the input and output data. With the default format "NHWC", the bias tensor will be added to the last dimension of the value tensor. Alternatively, the format could be "NCHW", the data storage order of: [batch, in\_channels, in\_height, in\_width]. The tensor will be added to "in\_channels", the third-to-the-last dimension. Defaults to "NHWC" tensorflow_cpp tensorflow::ops::FixedUnigramCandidateSampler::Attrs tensorflow::ops::FixedUnigramCandidateSampler::Attrs ==================================================== `#include <candidate_sampling_ops.h>` Optional attribute setters for [FixedUnigramCandidateSampler](../../../../class/tensorflow/ops/fixed-unigram-candidate-sampler#classtensorflow_1_1ops_1_1_fixed_unigram_candidate_sampler). Summary ------- | Public attributes | | --- | | `[distortion\_](#structtensorflow_1_1ops_1_1_fixed_unigram_candidate_sampler_1_1_attrs_1aaf268f89a26f0acc04e771e1c1a6e6bd) = 1.0f` | `float` | | `[num\_reserved\_ids\_](#structtensorflow_1_1ops_1_1_fixed_unigram_candidate_sampler_1_1_attrs_1a64e5762acf09fc03718c87c760acaa1e) = 0` | `int64` | | `[num\_shards\_](#structtensorflow_1_1ops_1_1_fixed_unigram_candidate_sampler_1_1_attrs_1a047de7fcc4dccbc6d65632f777c1d5a8) = 1` | `int64` | | `[seed2\_](#structtensorflow_1_1ops_1_1_fixed_unigram_candidate_sampler_1_1_attrs_1a7745f33f2eab5114f7259cbe5080bd0b) = 0` | `int64` | | `[seed\_](#structtensorflow_1_1ops_1_1_fixed_unigram_candidate_sampler_1_1_attrs_1af9b0dbb31a29d03a7e405a889173f436) = 0` | `int64` | | `[shard\_](#structtensorflow_1_1ops_1_1_fixed_unigram_candidate_sampler_1_1_attrs_1a421654daea215ea84ba93df3e1fad899) = 0` | `int64` | | `[unigrams\_](#structtensorflow_1_1ops_1_1_fixed_unigram_candidate_sampler_1_1_attrs_1ab6b3dd4be9d50b34457736a2f6a0c8fe) = {}` | `gtl::ArraySlice< float >` | | `[vocab\_file\_](#structtensorflow_1_1ops_1_1_fixed_unigram_candidate_sampler_1_1_attrs_1a65fa5ff8412e37984a4c29a46f8dedd7) = ""` | `StringPiece` | | Public functions | | --- | | `[Distortion](#structtensorflow_1_1ops_1_1_fixed_unigram_candidate_sampler_1_1_attrs_1afa6d5c1ce1309870a306e55464147073)(float x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_fixed_unigram_candidate_sampler_1_1_attrs)` The distortion is used to skew the unigram probability distribution. | | `[NumReservedIds](#structtensorflow_1_1ops_1_1_fixed_unigram_candidate_sampler_1_1_attrs_1a0af965522777ec16183ece108a49d5b5)(int64 x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_fixed_unigram_candidate_sampler_1_1_attrs)` Optionally some reserved IDs can be added in the range [0, ..., num\_reserved\_ids) by the users. | | `[NumShards](#structtensorflow_1_1ops_1_1_fixed_unigram_candidate_sampler_1_1_attrs_1acded26ec0ba617e8908d875979fde856)(int64 x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_fixed_unigram_candidate_sampler_1_1_attrs)` A sampler can be used to sample from a subset of the original range in order to speed up the whole computation through parallelism. | | `[Seed](#structtensorflow_1_1ops_1_1_fixed_unigram_candidate_sampler_1_1_attrs_1a61e8464940474e5861c0f371cfe6219c)(int64 x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_fixed_unigram_candidate_sampler_1_1_attrs)` If either seed or seed2 are set to be non-zero, the random number generator is seeded by the given seed. | | `[Seed2](#structtensorflow_1_1ops_1_1_fixed_unigram_candidate_sampler_1_1_attrs_1ad891e198b14aad370819124a8a5ab8a6)(int64 x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_fixed_unigram_candidate_sampler_1_1_attrs)` An second seed to avoid seed collision. | | `[Shard](#structtensorflow_1_1ops_1_1_fixed_unigram_candidate_sampler_1_1_attrs_1a83543b653378fd4745111fa16095d064)(int64 x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_fixed_unigram_candidate_sampler_1_1_attrs)` A sampler can be used to sample from a subset of the original range in order to speed up the whole computation through parallelism. | | `[Unigrams](#structtensorflow_1_1ops_1_1_fixed_unigram_candidate_sampler_1_1_attrs_1ace2f9e350bf58713db4e9dc7fcd54a9e)(const gtl::ArraySlice< float > & x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_fixed_unigram_candidate_sampler_1_1_attrs)` A list of unigram counts or probabilities, one per ID in sequential order. | | `[VocabFile](#structtensorflow_1_1ops_1_1_fixed_unigram_candidate_sampler_1_1_attrs_1a919fd966d300b5392b4e4100dd9c9882)(StringPiece x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_fixed_unigram_candidate_sampler_1_1_attrs)` Each valid line in this file (which should have a CSV-like format) corresponds to a valid word ID. | Public attributes ----------------- ### distortion\_ ``` float tensorflow::ops::FixedUnigramCandidateSampler::Attrs::distortion_ = 1.0f ``` ### num\_reserved\_ids\_ ``` int64 tensorflow::ops::FixedUnigramCandidateSampler::Attrs::num_reserved_ids_ = 0 ``` ### num\_shards\_ ``` int64 tensorflow::ops::FixedUnigramCandidateSampler::Attrs::num_shards_ = 1 ``` ### seed2\_ ``` int64 tensorflow::ops::FixedUnigramCandidateSampler::Attrs::seed2_ = 0 ``` ### seed\_ ``` int64 tensorflow::ops::FixedUnigramCandidateSampler::Attrs::seed_ = 0 ``` ### shard\_ ``` int64 tensorflow::ops::FixedUnigramCandidateSampler::Attrs::shard_ = 0 ``` ### unigrams\_ ``` gtl::ArraySlice< float > tensorflow::ops::FixedUnigramCandidateSampler::Attrs::unigrams_ = {} ``` ### vocab\_file\_ ``` StringPiece tensorflow::ops::FixedUnigramCandidateSampler::Attrs::vocab_file_ = "" ``` Public functions ---------------- ### Distortion ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::FixedUnigramCandidateSampler::Attrs::Distortion( float x ) ``` The distortion is used to skew the unigram probability distribution. Each weight is first raised to the distortion's power before adding to the internal unigram distribution. As a result, distortion = 1.0 gives regular unigram sampling (as defined by the vocab file), and distortion = 0.0 gives a uniform distribution. Defaults to 1 ### NumReservedIds ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::FixedUnigramCandidateSampler::Attrs::NumReservedIds( int64 x ) ``` Optionally some reserved IDs can be added in the range [0, ..., num\_reserved\_ids) by the users. One use case is that a special unknown word token is used as ID 0. These IDs will have a sampling probability of 0. Defaults to 0 ### NumShards ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::FixedUnigramCandidateSampler::Attrs::NumShards( int64 x ) ``` A sampler can be used to sample from a subset of the original range in order to speed up the whole computation through parallelism. This parameter (together with 'shard') indicates the number of partitions that are being used in the overall computation. Defaults to 1 ### Seed ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::FixedUnigramCandidateSampler::Attrs::Seed( int64 x ) ``` If either seed or seed2 are set to be non-zero, the random number generator is seeded by the given seed. Otherwise, it is seeded by a random seed. Defaults to 0 ### Seed2 ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::FixedUnigramCandidateSampler::Attrs::Seed2( int64 x ) ``` An second seed to avoid seed collision. Defaults to 0 ### Shard ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::FixedUnigramCandidateSampler::Attrs::Shard( int64 x ) ``` A sampler can be used to sample from a subset of the original range in order to speed up the whole computation through parallelism. This parameter (together with 'num\_shards') indicates the particular partition number of a sampler op, when partitioning is being used. Defaults to 0 ### Unigrams ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::FixedUnigramCandidateSampler::Attrs::Unigrams( const gtl::ArraySlice< float > & x ) ``` A list of unigram counts or probabilities, one per ID in sequential order. Exactly one of vocab\_file and unigrams should be passed to this op. Defaults to [] ### VocabFile ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::FixedUnigramCandidateSampler::Attrs::VocabFile( StringPiece x ) ``` Each valid line in this file (which should have a CSV-like format) corresponds to a valid word ID. IDs are in sequential order, starting from num\_reserved\_ids. The last entry in each line is expected to be a value corresponding to the count or relative probability. Exactly one of vocab\_file and unigrams needs to be passed to this op. Defaults to "" tensorflow_cpp tensorflow::ops::ApplyGradientDescent::Attrs tensorflow::ops::ApplyGradientDescent::Attrs ============================================ `#include <training_ops.h>` Optional attribute setters for [ApplyGradientDescent](../../../../class/tensorflow/ops/apply-gradient-descent#classtensorflow_1_1ops_1_1_apply_gradient_descent). Summary ------- | Public attributes | | --- | | `[use\_locking\_](#structtensorflow_1_1ops_1_1_apply_gradient_descent_1_1_attrs_1a9fec359d3ca4c779f95c4a9875578e46) = false` | `bool` | | Public functions | | --- | | `[UseLocking](#structtensorflow_1_1ops_1_1_apply_gradient_descent_1_1_attrs_1a6512e34bb0f3f8579890e101a01e3838)(bool x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_apply_gradient_descent_1_1_attrs)` If `True`, the subtraction will be protected by a lock; otherwise the behavior is undefined, but may exhibit less contention. | Public attributes ----------------- ### use\_locking\_ ``` bool tensorflow::ops::ApplyGradientDescent::Attrs::use_locking_ = false ``` Public functions ---------------- ### UseLocking ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::ApplyGradientDescent::Attrs::UseLocking( bool x ) ``` If `True`, the subtraction will be protected by a lock; otherwise the behavior is undefined, but may exhibit less contention. Defaults to false tensorflow_cpp tensorflow::ops::StatelessSampleDistortedBoundingBox::Attrs tensorflow::ops::StatelessSampleDistortedBoundingBox::Attrs =========================================================== `#include <image_ops.h>` Optional attribute setters for [StatelessSampleDistortedBoundingBox](../../../../class/tensorflow/ops/stateless-sample-distorted-bounding-box#classtensorflow_1_1ops_1_1_stateless_sample_distorted_bounding_box). Summary ------- | Public attributes | | --- | | `[area\_range\_](#structtensorflow_1_1ops_1_1_stateless_sample_distorted_bounding_box_1_1_attrs_1a90f440dff6a8abf604cc2ad1fd4592c0) = Default_area_range()` | `gtl::ArraySlice< float >` | | `[aspect\_ratio\_range\_](#structtensorflow_1_1ops_1_1_stateless_sample_distorted_bounding_box_1_1_attrs_1ab042790a34124474c599a0389a2f2d57) = Default_aspect_ratio_range()` | `gtl::ArraySlice< float >` | | `[max\_attempts\_](#structtensorflow_1_1ops_1_1_stateless_sample_distorted_bounding_box_1_1_attrs_1a4283e87dbb4b8a465694cd56df9fb68e) = 100` | `int64` | | `[use\_image\_if\_no\_bounding\_boxes\_](#structtensorflow_1_1ops_1_1_stateless_sample_distorted_bounding_box_1_1_attrs_1a7dca75121b7c7dda9ee05aa96da5f433) = false` | `bool` | | Public functions | | --- | | `[AreaRange](#structtensorflow_1_1ops_1_1_stateless_sample_distorted_bounding_box_1_1_attrs_1a58a9fbe92441a0ebf575bd5018965aa5)(const gtl::ArraySlice< float > & x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_stateless_sample_distorted_bounding_box_1_1_attrs)` The cropped area of the image must contain a fraction of the supplied image within this range. | | `[AspectRatioRange](#structtensorflow_1_1ops_1_1_stateless_sample_distorted_bounding_box_1_1_attrs_1a6b47c62e73665b407cb863c5396c80ba)(const gtl::ArraySlice< float > & x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_stateless_sample_distorted_bounding_box_1_1_attrs)` The cropped area of the image must have an aspect ratio = width / height within this range. | | `[MaxAttempts](#structtensorflow_1_1ops_1_1_stateless_sample_distorted_bounding_box_1_1_attrs_1a9d5a79f3ead7550d17e939b55f6a2199)(int64 x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_stateless_sample_distorted_bounding_box_1_1_attrs)` Number of attempts at generating a cropped region of the image of the specified constraints. | | `[UseImageIfNoBoundingBoxes](#structtensorflow_1_1ops_1_1_stateless_sample_distorted_bounding_box_1_1_attrs_1a16f7ba28723af58b559921fda2ff2271)(bool x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_stateless_sample_distorted_bounding_box_1_1_attrs)` Controls behavior if no bounding boxes supplied. | Public attributes ----------------- ### area\_range\_ ``` gtl::ArraySlice< float > tensorflow::ops::StatelessSampleDistortedBoundingBox::Attrs::area_range_ = Default_area_range() ``` ### aspect\_ratio\_range\_ ``` gtl::ArraySlice< float > tensorflow::ops::StatelessSampleDistortedBoundingBox::Attrs::aspect_ratio_range_ = Default_aspect_ratio_range() ``` ### max\_attempts\_ ``` int64 tensorflow::ops::StatelessSampleDistortedBoundingBox::Attrs::max_attempts_ = 100 ``` ### use\_image\_if\_no\_bounding\_boxes\_ ``` bool tensorflow::ops::StatelessSampleDistortedBoundingBox::Attrs::use_image_if_no_bounding_boxes_ = false ``` Public functions ---------------- ### AreaRange ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::StatelessSampleDistortedBoundingBox::Attrs::AreaRange( const gtl::ArraySlice< float > & x ) ``` The cropped area of the image must contain a fraction of the supplied image within this range. Defaults to [0.05, 1] ### AspectRatioRange ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::StatelessSampleDistortedBoundingBox::Attrs::AspectRatioRange( const gtl::ArraySlice< float > & x ) ``` The cropped area of the image must have an aspect ratio = width / height within this range. Defaults to [0.75, 1.33] ### MaxAttempts ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::StatelessSampleDistortedBoundingBox::Attrs::MaxAttempts( int64 x ) ``` Number of attempts at generating a cropped region of the image of the specified constraints. After `max_attempts` failures, return the entire image. Defaults to 100 ### UseImageIfNoBoundingBoxes ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::StatelessSampleDistortedBoundingBox::Attrs::UseImageIfNoBoundingBoxes( bool x ) ``` Controls behavior if no bounding boxes supplied. If true, assume an implicit bounding box covering the whole input. If false, raise an error. Defaults to false
programming_docs
tensorflow_cpp tensorflow::ops::Conv3D::Attrs tensorflow::ops::Conv3D::Attrs ============================== `#include <nn_ops.h>` Optional attribute setters for [Conv3D](../../../../class/tensorflow/ops/conv3-d#classtensorflow_1_1ops_1_1_conv3_d). Summary ------- | Public attributes | | --- | | `[data\_format\_](#structtensorflow_1_1ops_1_1_conv3_d_1_1_attrs_1aed2017811fa48a9095b4329677adea1d) = "NDHWC"` | `StringPiece` | | `[dilations\_](#structtensorflow_1_1ops_1_1_conv3_d_1_1_attrs_1a41ef9508f16643fccb3cb6b78b120a54) = Default_dilations()` | `gtl::ArraySlice< int >` | | Public functions | | --- | | `[DataFormat](#structtensorflow_1_1ops_1_1_conv3_d_1_1_attrs_1a8c135a3b483a824e4ae79d3574ae0037)(StringPiece x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_conv3_d_1_1_attrs)` The data format of the input and output data. | | `[Dilations](#structtensorflow_1_1ops_1_1_conv3_d_1_1_attrs_1a86d275095e5694eccb3ed56c1e366e1f)(const gtl::ArraySlice< int > & x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_conv3_d_1_1_attrs)` 1-D tensor of length 5. | Public attributes ----------------- ### data\_format\_ ``` StringPiece tensorflow::ops::Conv3D::Attrs::data_format_ = "NDHWC" ``` ### dilations\_ ``` gtl::ArraySlice< int > tensorflow::ops::Conv3D::Attrs::dilations_ = Default_dilations() ``` Public functions ---------------- ### DataFormat ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::Conv3D::Attrs::DataFormat( StringPiece x ) ``` The data format of the input and output data. With the default format "NDHWC", the data is stored in the order of: [batch, in\_depth, in\_height, in\_width, in\_channels]. Alternatively, the format could be "NCDHW", the data storage order is: [batch, in\_channels, in\_depth, in\_height, in\_width]. Defaults to "NDHWC" ### Dilations ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::Conv3D::Attrs::Dilations( const gtl::ArraySlice< int > & x ) ``` 1-D tensor of length 5. The dilation factor for each dimension of `input`. If set to k > 1, there will be k-1 skipped cells between each filter element on that dimension. The dimension order is determined by the value of `data_format`, see above for details. Dilations in the batch and depth dimensions must be 1. Defaults to [1, 1, 1, 1, 1] tensorflow_cpp tensorflow::ops::TFRecordReader::Attrs tensorflow::ops::TFRecordReader::Attrs ====================================== `#include <io_ops.h>` Optional attribute setters for [TFRecordReader](../../../../class/tensorflow/ops/t-f-record-reader#classtensorflow_1_1ops_1_1_t_f_record_reader). Summary ------- | Public attributes | | --- | | `[compression\_type\_](#structtensorflow_1_1ops_1_1_t_f_record_reader_1_1_attrs_1ad6c6ece01cc56aec90b5ba9c42d58298) = ""` | `StringPiece` | | `[container\_](#structtensorflow_1_1ops_1_1_t_f_record_reader_1_1_attrs_1adc96b2ba85da0541fcdd8c6f3c4d9454) = ""` | `StringPiece` | | `[shared\_name\_](#structtensorflow_1_1ops_1_1_t_f_record_reader_1_1_attrs_1a235d0767d86cca650601dd8f43cbc781) = ""` | `StringPiece` | | Public functions | | --- | | `[CompressionType](#structtensorflow_1_1ops_1_1_t_f_record_reader_1_1_attrs_1abe93f0dd5de400c14a9a37903e1d0a1d)(StringPiece x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_t_f_record_reader_1_1_attrs)` Defaults to "". | | `[Container](#structtensorflow_1_1ops_1_1_t_f_record_reader_1_1_attrs_1a4bc3d6ce12ffb32fb5af2979a3068e8f)(StringPiece x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_t_f_record_reader_1_1_attrs)` If non-empty, this reader is placed in the given container. | | `[SharedName](#structtensorflow_1_1ops_1_1_t_f_record_reader_1_1_attrs_1a013eb774b98a875b83003b7fb716532c)(StringPiece x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_t_f_record_reader_1_1_attrs)` If non-empty, this reader is named in the given bucket with this shared\_name. | Public attributes ----------------- ### compression\_type\_ ``` StringPiece tensorflow::ops::TFRecordReader::Attrs::compression_type_ = "" ``` ### container\_ ``` StringPiece tensorflow::ops::TFRecordReader::Attrs::container_ = "" ``` ### shared\_name\_ ``` StringPiece tensorflow::ops::TFRecordReader::Attrs::shared_name_ = "" ``` Public functions ---------------- ### CompressionType ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::TFRecordReader::Attrs::CompressionType( StringPiece x ) ``` Defaults to "". ### Container ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::TFRecordReader::Attrs::Container( StringPiece x ) ``` If non-empty, this reader is placed in the given container. Otherwise, a default container is used. Defaults to "" ### SharedName ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::TFRecordReader::Attrs::SharedName( StringPiece x ) ``` If non-empty, this reader is named in the given bucket with this shared\_name. Otherwise, the node name is used instead. Defaults to "" tensorflow_cpp tensorflow::ops::SerializeManySparse::Attrs tensorflow::ops::SerializeManySparse::Attrs =========================================== `#include <sparse_ops.h>` Optional attribute setters for [SerializeManySparse](../../../../class/tensorflow/ops/serialize-many-sparse#classtensorflow_1_1ops_1_1_serialize_many_sparse). Summary ------- | Public attributes | | --- | | `[out\_type\_](#structtensorflow_1_1ops_1_1_serialize_many_sparse_1_1_attrs_1a103b0e2b4cbdf31cd2a307acf57dbe36) = DT_STRING` | `DataType` | | Public functions | | --- | | `[OutType](#structtensorflow_1_1ops_1_1_serialize_many_sparse_1_1_attrs_1a32e663890123166d61bfb4d64f0cdee6)(DataType x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_serialize_many_sparse_1_1_attrs)` The `dtype` to use for serialization; the supported types are `string` (default) and `variant`. | Public attributes ----------------- ### out\_type\_ ``` DataType tensorflow::ops::SerializeManySparse::Attrs::out_type_ = DT_STRING ``` Public functions ---------------- ### OutType ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::SerializeManySparse::Attrs::OutType( DataType x ) ``` The `dtype` to use for serialization; the supported types are `string` (default) and `variant`. Defaults to DT\_STRING tensorflow_cpp tensorflow::ops::Cumsum::Attrs tensorflow::ops::Cumsum::Attrs ============================== `#include <math_ops.h>` Optional attribute setters for [Cumsum](../../../../class/tensorflow/ops/cumsum#classtensorflow_1_1ops_1_1_cumsum). Summary ------- | Public attributes | | --- | | `[exclusive\_](#structtensorflow_1_1ops_1_1_cumsum_1_1_attrs_1a86e2370bdc60bc159adbf5791d3e5aa3) = false` | `bool` | | `[reverse\_](#structtensorflow_1_1ops_1_1_cumsum_1_1_attrs_1a1765e654ea75728b30c4572c736b454f) = false` | `bool` | | Public functions | | --- | | `[Exclusive](#structtensorflow_1_1ops_1_1_cumsum_1_1_attrs_1a19496a3e014176d05a8d903490e4dac5)(bool x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_cumsum_1_1_attrs)` If `True`, perform exclusive cumsum. | | `[Reverse](#structtensorflow_1_1ops_1_1_cumsum_1_1_attrs_1aa9e89d07bcff769078d89714f00522b7)(bool x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_cumsum_1_1_attrs)` A `bool` (default: False). | Public attributes ----------------- ### exclusive\_ ``` bool tensorflow::ops::Cumsum::Attrs::exclusive_ = false ``` ### reverse\_ ``` bool tensorflow::ops::Cumsum::Attrs::reverse_ = false ``` Public functions ---------------- ### Exclusive ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::Cumsum::Attrs::Exclusive( bool x ) ``` If `True`, perform exclusive cumsum. Defaults to false ### Reverse ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::Cumsum::Attrs::Reverse( bool x ) ``` A `bool` (default: False). Defaults to false tensorflow_cpp tensorflow::ops::PaddingFIFOQueue::Attrs tensorflow::ops::PaddingFIFOQueue::Attrs ======================================== `#include <data_flow_ops.h>` Optional attribute setters for [PaddingFIFOQueue](../../../../class/tensorflow/ops/padding-f-i-f-o-queue#classtensorflow_1_1ops_1_1_padding_f_i_f_o_queue). Summary ------- | Public attributes | | --- | | `[capacity\_](#structtensorflow_1_1ops_1_1_padding_f_i_f_o_queue_1_1_attrs_1a4f3d638a9ca754c89d42d2eba51d695d) = -1` | `int64` | | `[container\_](#structtensorflow_1_1ops_1_1_padding_f_i_f_o_queue_1_1_attrs_1abbdf45e1046ad7f88ff4affee8a46c61) = ""` | `StringPiece` | | `[shapes\_](#structtensorflow_1_1ops_1_1_padding_f_i_f_o_queue_1_1_attrs_1a3b2834168ccf43cf2e88e937a57e25a2) = {}` | `gtl::ArraySlice< PartialTensorShape >` | | `[shared\_name\_](#structtensorflow_1_1ops_1_1_padding_f_i_f_o_queue_1_1_attrs_1a4049c026c1262b7411d61a0af36660c3) = ""` | `StringPiece` | | Public functions | | --- | | `[Capacity](#structtensorflow_1_1ops_1_1_padding_f_i_f_o_queue_1_1_attrs_1a37b197e3528b7d7f8c8203b12e954701)(int64 x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_padding_f_i_f_o_queue_1_1_attrs)` The upper bound on the number of elements in this queue. | | `[Container](#structtensorflow_1_1ops_1_1_padding_f_i_f_o_queue_1_1_attrs_1ae869c780a3baabe5b04cbee60e17b35e)(StringPiece x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_padding_f_i_f_o_queue_1_1_attrs)` If non-empty, this queue is placed in the given container. | | `[Shapes](#structtensorflow_1_1ops_1_1_padding_f_i_f_o_queue_1_1_attrs_1ab5518933cf19c007b1bb4ba142200a63)(const gtl::ArraySlice< PartialTensorShape > & x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_padding_f_i_f_o_queue_1_1_attrs)` The shape of each component in a value. | | `[SharedName](#structtensorflow_1_1ops_1_1_padding_f_i_f_o_queue_1_1_attrs_1a4ad3be8f42b64182901f8843d58b0a0b)(StringPiece x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_padding_f_i_f_o_queue_1_1_attrs)` If non-empty, this queue will be shared under the given name across multiple sessions. | Public attributes ----------------- ### capacity\_ ``` int64 tensorflow::ops::PaddingFIFOQueue::Attrs::capacity_ = -1 ``` ### container\_ ``` StringPiece tensorflow::ops::PaddingFIFOQueue::Attrs::container_ = "" ``` ### shapes\_ ``` gtl::ArraySlice< PartialTensorShape > tensorflow::ops::PaddingFIFOQueue::Attrs::shapes_ = {} ``` ### shared\_name\_ ``` StringPiece tensorflow::ops::PaddingFIFOQueue::Attrs::shared_name_ = "" ``` Public functions ---------------- ### Capacity ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::PaddingFIFOQueue::Attrs::Capacity( int64 x ) ``` The upper bound on the number of elements in this queue. Negative numbers mean no limit. Defaults to -1 ### Container ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::PaddingFIFOQueue::Attrs::Container( StringPiece x ) ``` If non-empty, this queue is placed in the given container. Otherwise, a default container is used. Defaults to "" ### Shapes ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::PaddingFIFOQueue::Attrs::Shapes( const gtl::ArraySlice< PartialTensorShape > & x ) ``` The shape of each component in a value. The length of this attr must be either 0 or the same as the length of component\_types. Shapes of fixed rank but variable size are allowed by setting any shape dimension to -1. In this case, the inputs' shape may vary along the given dimension, and DequeueMany will pad the given dimension with zeros up to the maximum shape of all elements in the given batch. If the length of this attr is 0, different queue elements may have different ranks and shapes, but only one element may be dequeued at a time. Defaults to [] ### SharedName ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::PaddingFIFOQueue::Attrs::SharedName( StringPiece x ) ``` If non-empty, this queue will be shared under the given name across multiple sessions. Defaults to "" tensorflow_cpp tensorflow::ops::SparseApplyAdagradDA::Attrs tensorflow::ops::SparseApplyAdagradDA::Attrs ============================================ `#include <training_ops.h>` Optional attribute setters for [SparseApplyAdagradDA](../../../../class/tensorflow/ops/sparse-apply-adagrad-d-a#classtensorflow_1_1ops_1_1_sparse_apply_adagrad_d_a). Summary ------- | Public attributes | | --- | | `[use\_locking\_](#structtensorflow_1_1ops_1_1_sparse_apply_adagrad_d_a_1_1_attrs_1ad307c49fb877d3bd642827dd8268e292) = false` | `bool` | | Public functions | | --- | | `[UseLocking](#structtensorflow_1_1ops_1_1_sparse_apply_adagrad_d_a_1_1_attrs_1a21018af208ca0000c35a1f97f11b00ff)(bool x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_sparse_apply_adagrad_d_a_1_1_attrs)` If True, updating of the var and accum tensors will be protected by a lock; otherwise the behavior is undefined, but may exhibit less contention. | Public attributes ----------------- ### use\_locking\_ ``` bool tensorflow::ops::SparseApplyAdagradDA::Attrs::use_locking_ = false ``` Public functions ---------------- ### UseLocking ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::SparseApplyAdagradDA::Attrs::UseLocking( bool x ) ``` If True, updating of the var and accum tensors will be protected by a lock; otherwise the behavior is undefined, but may exhibit less contention. Defaults to false tensorflow_cpp tensorflow::ops::SparseApplyAdadelta::Attrs tensorflow::ops::SparseApplyAdadelta::Attrs =========================================== `#include <training_ops.h>` Optional attribute setters for [SparseApplyAdadelta](../../../../class/tensorflow/ops/sparse-apply-adadelta#classtensorflow_1_1ops_1_1_sparse_apply_adadelta). Summary ------- | Public attributes | | --- | | `[use\_locking\_](#structtensorflow_1_1ops_1_1_sparse_apply_adadelta_1_1_attrs_1af9ed2359fe138f8042887280bea71780) = false` | `bool` | | Public functions | | --- | | `[UseLocking](#structtensorflow_1_1ops_1_1_sparse_apply_adadelta_1_1_attrs_1a44edb6cef478daaaa64fd0d9880fa8c5)(bool x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_sparse_apply_adadelta_1_1_attrs)` If True, updating of the var and accum tensors will be protected by a lock; otherwise the behavior is undefined, but may exhibit less contention. | Public attributes ----------------- ### use\_locking\_ ``` bool tensorflow::ops::SparseApplyAdadelta::Attrs::use_locking_ = false ``` Public functions ---------------- ### UseLocking ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::SparseApplyAdadelta::Attrs::UseLocking( bool x ) ``` If True, updating of the var and accum tensors will be protected by a lock; otherwise the behavior is undefined, but may exhibit less contention. Defaults to false tensorflow_cpp tensorflow::ops::NonMaxSuppressionV4::Attrs tensorflow::ops::NonMaxSuppressionV4::Attrs =========================================== `#include <image_ops.h>` Optional attribute setters for [NonMaxSuppressionV4](../../../../class/tensorflow/ops/non-max-suppression-v4#classtensorflow_1_1ops_1_1_non_max_suppression_v4). Summary ------- | Public attributes | | --- | | `[pad\_to\_max\_output\_size\_](#structtensorflow_1_1ops_1_1_non_max_suppression_v4_1_1_attrs_1acfeff26fceb1da696646c291bff3653b) = false` | `bool` | | Public functions | | --- | | `[PadToMaxOutputSize](#structtensorflow_1_1ops_1_1_non_max_suppression_v4_1_1_attrs_1a777b2a775e08974be74b5d8b67e78ac5)(bool x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_non_max_suppression_v4_1_1_attrs)` If true, the output `selected_indices` is padded to be of length `max_output_size`. | Public attributes ----------------- ### pad\_to\_max\_output\_size\_ ``` bool tensorflow::ops::NonMaxSuppressionV4::Attrs::pad_to_max_output_size_ = false ``` Public functions ---------------- ### PadToMaxOutputSize ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::NonMaxSuppressionV4::Attrs::PadToMaxOutputSize( bool x ) ``` If true, the output `selected_indices` is padded to be of length `max_output_size`. Defaults to false. Defaults to false tensorflow_cpp tensorflow::ops::ScatterNdSub::Attrs tensorflow::ops::ScatterNdSub::Attrs ==================================== `#include <state_ops.h>` Optional attribute setters for [ScatterNdSub](../../../../class/tensorflow/ops/scatter-nd-sub#classtensorflow_1_1ops_1_1_scatter_nd_sub). Summary ------- | Public attributes | | --- | | `[use\_locking\_](#structtensorflow_1_1ops_1_1_scatter_nd_sub_1_1_attrs_1a3b40823bfdb3f818b877d46c40afb6ef) = false` | `bool` | | Public functions | | --- | | `[UseLocking](#structtensorflow_1_1ops_1_1_scatter_nd_sub_1_1_attrs_1ae5de248b4bbe6b737415b2451cc13424)(bool x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_scatter_nd_sub_1_1_attrs)` An optional bool. | Public attributes ----------------- ### use\_locking\_ ``` bool tensorflow::ops::ScatterNdSub::Attrs::use_locking_ = false ``` Public functions ---------------- ### UseLocking ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::ScatterNdSub::Attrs::UseLocking( bool x ) ``` An optional bool. Defaults to True. If True, the assignment will be protected by a lock; otherwise the behavior is undefined, but may exhibit less contention. Defaults to false tensorflow_cpp tensorflow::ops::ResourceApplyRMSProp::Attrs tensorflow::ops::ResourceApplyRMSProp::Attrs ============================================ `#include <training_ops.h>` Optional attribute setters for [ResourceApplyRMSProp](../../../../class/tensorflow/ops/resource-apply-r-m-s-prop#classtensorflow_1_1ops_1_1_resource_apply_r_m_s_prop). Summary ------- | Public attributes | | --- | | `[use\_locking\_](#structtensorflow_1_1ops_1_1_resource_apply_r_m_s_prop_1_1_attrs_1a7de06c05cef6944ca539e2b26f839133) = false` | `bool` | | Public functions | | --- | | `[UseLocking](#structtensorflow_1_1ops_1_1_resource_apply_r_m_s_prop_1_1_attrs_1a4d87d6536d2cdc54dca216cd6b037158)(bool x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_resource_apply_r_m_s_prop_1_1_attrs)` If `True`, updating of the var, ms, and mom tensors is protected by a lock; otherwise the behavior is undefined, but may exhibit less contention. | Public attributes ----------------- ### use\_locking\_ ``` bool tensorflow::ops::ResourceApplyRMSProp::Attrs::use_locking_ = false ``` Public functions ---------------- ### UseLocking ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::ResourceApplyRMSProp::Attrs::UseLocking( bool x ) ``` If `True`, updating of the var, ms, and mom tensors is protected by a lock; otherwise the behavior is undefined, but may exhibit less contention. Defaults to false tensorflow_cpp tensorflow::ops::MergeV2Checkpoints::Attrs tensorflow::ops::MergeV2Checkpoints::Attrs ========================================== `#include <io_ops.h>` Optional attribute setters for [MergeV2Checkpoints](../../../../class/tensorflow/ops/merge-v2-checkpoints#classtensorflow_1_1ops_1_1_merge_v2_checkpoints). Summary ------- | Public attributes | | --- | | `[delete\_old\_dirs\_](#structtensorflow_1_1ops_1_1_merge_v2_checkpoints_1_1_attrs_1a0e53422af3112765f6bae4ddf7ea2915) = true` | `bool` | | Public functions | | --- | | `[DeleteOldDirs](#structtensorflow_1_1ops_1_1_merge_v2_checkpoints_1_1_attrs_1a1fca45f1539ec4d56d9f5373a364779a)(bool x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_merge_v2_checkpoints_1_1_attrs)` see above. | Public attributes ----------------- ### delete\_old\_dirs\_ ``` bool tensorflow::ops::MergeV2Checkpoints::Attrs::delete_old_dirs_ = true ``` Public functions ---------------- ### DeleteOldDirs ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::MergeV2Checkpoints::Attrs::DeleteOldDirs( bool x ) ``` see above. Defaults to true
programming_docs
tensorflow_cpp tensorflow::ops::EditDistance::Attrs tensorflow::ops::EditDistance::Attrs ==================================== `#include <array_ops.h>` Optional attribute setters for [EditDistance](../../../../class/tensorflow/ops/edit-distance#classtensorflow_1_1ops_1_1_edit_distance). Summary ------- | Public attributes | | --- | | `[normalize\_](#structtensorflow_1_1ops_1_1_edit_distance_1_1_attrs_1a8e0d397f56f2b4ea61636081e9ac7480) = true` | `bool` | | Public functions | | --- | | `[Normalize](#structtensorflow_1_1ops_1_1_edit_distance_1_1_attrs_1a9c625bffe6a1e0f589f77c5e643acfd1)(bool x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_edit_distance_1_1_attrs)` boolean (if true, edit distances are normalized by length of truth). | Public attributes ----------------- ### normalize\_ ``` bool tensorflow::ops::EditDistance::Attrs::normalize_ = true ``` Public functions ---------------- ### Normalize ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::EditDistance::Attrs::Normalize( bool x ) ``` boolean (if true, edit distances are normalized by length of truth). The output is: Defaults to true tensorflow_cpp tensorflow::ops::ArgMin::Attrs tensorflow::ops::ArgMin::Attrs ============================== `#include <math_ops.h>` Optional attribute setters for [ArgMin](../../../../class/tensorflow/ops/arg-min#classtensorflow_1_1ops_1_1_arg_min). Summary ------- | Public attributes | | --- | | `[output\_type\_](#structtensorflow_1_1ops_1_1_arg_min_1_1_attrs_1a69a56cff62e74db172faba519964b2f5) = DT_INT64` | `DataType` | | Public functions | | --- | | `[OutputType](#structtensorflow_1_1ops_1_1_arg_min_1_1_attrs_1a7d4fc8d7dadb820b113626169f868e7f)(DataType x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_arg_min_1_1_attrs)` Defaults to DT\_INT64. | Public attributes ----------------- ### output\_type\_ ``` DataType tensorflow::ops::ArgMin::Attrs::output_type_ = DT_INT64 ``` Public functions ---------------- ### OutputType ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::ArgMin::Attrs::OutputType( DataType x ) ``` Defaults to DT\_INT64. tensorflow_cpp tensorflow::ops::ResourceSparseApplyAdagradDA::Attrs tensorflow::ops::ResourceSparseApplyAdagradDA::Attrs ==================================================== `#include <training_ops.h>` Optional attribute setters for [ResourceSparseApplyAdagradDA](../../../../class/tensorflow/ops/resource-sparse-apply-adagrad-d-a#classtensorflow_1_1ops_1_1_resource_sparse_apply_adagrad_d_a). Summary ------- | Public attributes | | --- | | `[use\_locking\_](#structtensorflow_1_1ops_1_1_resource_sparse_apply_adagrad_d_a_1_1_attrs_1a995807678c7156ab49157ca6ace987cc) = false` | `bool` | | Public functions | | --- | | `[UseLocking](#structtensorflow_1_1ops_1_1_resource_sparse_apply_adagrad_d_a_1_1_attrs_1ae684f4cd014fc4230fc4eeb00b7b3d5c)(bool x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_resource_sparse_apply_adagrad_d_a_1_1_attrs)` If True, updating of the var and accum tensors will be protected by a lock; otherwise the behavior is undefined, but may exhibit less contention. | Public attributes ----------------- ### use\_locking\_ ``` bool tensorflow::ops::ResourceSparseApplyAdagradDA::Attrs::use_locking_ = false ``` Public functions ---------------- ### UseLocking ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::ResourceSparseApplyAdagradDA::Attrs::UseLocking( bool x ) ``` If True, updating of the var and accum tensors will be protected by a lock; otherwise the behavior is undefined, but may exhibit less contention. Defaults to false tensorflow_cpp tensorflow::ops::ApplyProximalAdagrad::Attrs tensorflow::ops::ApplyProximalAdagrad::Attrs ============================================ `#include <training_ops.h>` Optional attribute setters for [ApplyProximalAdagrad](../../../../class/tensorflow/ops/apply-proximal-adagrad#classtensorflow_1_1ops_1_1_apply_proximal_adagrad). Summary ------- | Public attributes | | --- | | `[use\_locking\_](#structtensorflow_1_1ops_1_1_apply_proximal_adagrad_1_1_attrs_1ac74571141594c2439a2dc469c78eaad7) = false` | `bool` | | Public functions | | --- | | `[UseLocking](#structtensorflow_1_1ops_1_1_apply_proximal_adagrad_1_1_attrs_1ad3e81a1452067424a5ac121820c847a4)(bool x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_apply_proximal_adagrad_1_1_attrs)` If True, updating of the var and accum tensors will be protected by a lock; otherwise the behavior is undefined, but may exhibit less contention. | Public attributes ----------------- ### use\_locking\_ ``` bool tensorflow::ops::ApplyProximalAdagrad::Attrs::use_locking_ = false ``` Public functions ---------------- ### UseLocking ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::ApplyProximalAdagrad::Attrs::UseLocking( bool x ) ``` If True, updating of the var and accum tensors will be protected by a lock; otherwise the behavior is undefined, but may exhibit less contention. Defaults to false tensorflow_cpp tensorflow::ops::ResourceApplyMomentum::Attrs tensorflow::ops::ResourceApplyMomentum::Attrs ============================================= `#include <training_ops.h>` Optional attribute setters for [ResourceApplyMomentum](../../../../class/tensorflow/ops/resource-apply-momentum#classtensorflow_1_1ops_1_1_resource_apply_momentum). Summary ------- | Public attributes | | --- | | `[use\_locking\_](#structtensorflow_1_1ops_1_1_resource_apply_momentum_1_1_attrs_1a7fa91f4033efd7a1d13113cfb982ea9f) = false` | `bool` | | `[use\_nesterov\_](#structtensorflow_1_1ops_1_1_resource_apply_momentum_1_1_attrs_1aa340071474a79b0a9f9ba2bb8f341780) = false` | `bool` | | Public functions | | --- | | `[UseLocking](#structtensorflow_1_1ops_1_1_resource_apply_momentum_1_1_attrs_1a27048186d5da716199c710dd02f5175b)(bool x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_resource_apply_momentum_1_1_attrs)` If `True`, updating of the var and accum tensors will be protected by a lock; otherwise the behavior is undefined, but may exhibit less contention. | | `[UseNesterov](#structtensorflow_1_1ops_1_1_resource_apply_momentum_1_1_attrs_1aaed047b37f6fea17e9215418172c1b8e)(bool x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_resource_apply_momentum_1_1_attrs)` If `True`, the tensor passed to compute grad will be var - lr \* momentum \* accum, so in the end, the var you get is actually var - lr \* momentum \* accum. | Public attributes ----------------- ### use\_locking\_ ``` bool tensorflow::ops::ResourceApplyMomentum::Attrs::use_locking_ = false ``` ### use\_nesterov\_ ``` bool tensorflow::ops::ResourceApplyMomentum::Attrs::use_nesterov_ = false ``` Public functions ---------------- ### UseLocking ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::ResourceApplyMomentum::Attrs::UseLocking( bool x ) ``` If `True`, updating of the var and accum tensors will be protected by a lock; otherwise the behavior is undefined, but may exhibit less contention. Defaults to false ### UseNesterov ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::ResourceApplyMomentum::Attrs::UseNesterov( bool x ) ``` If `True`, the tensor passed to compute grad will be var - lr \* momentum \* accum, so in the end, the var you get is actually var - lr \* momentum \* accum. Defaults to false tensorflow_cpp tensorflow::ops::AssignSub::Attrs tensorflow::ops::AssignSub::Attrs ================================= `#include <state_ops.h>` Optional attribute setters for [AssignSub](../../../../class/tensorflow/ops/assign-sub#classtensorflow_1_1ops_1_1_assign_sub). Summary ------- | Public attributes | | --- | | `[use\_locking\_](#structtensorflow_1_1ops_1_1_assign_sub_1_1_attrs_1a068c18dac41761ef89b0d8fb8f2f1a1d) = false` | `bool` | | Public functions | | --- | | `[UseLocking](#structtensorflow_1_1ops_1_1_assign_sub_1_1_attrs_1a27ff32b098debf0064284de627eac2b4)(bool x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_assign_sub_1_1_attrs)` If True, the subtraction will be protected by a lock; otherwise the behavior is undefined, but may exhibit less contention. | Public attributes ----------------- ### use\_locking\_ ``` bool tensorflow::ops::AssignSub::Attrs::use_locking_ = false ``` Public functions ---------------- ### UseLocking ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::AssignSub::Attrs::UseLocking( bool x ) ``` If True, the subtraction will be protected by a lock; otherwise the behavior is undefined, but may exhibit less contention. Defaults to false tensorflow_cpp tensorflow::ops::FIFOQueue::Attrs tensorflow::ops::FIFOQueue::Attrs ================================= `#include <data_flow_ops.h>` Optional attribute setters for [FIFOQueue](../../../../class/tensorflow/ops/f-i-f-o-queue#classtensorflow_1_1ops_1_1_f_i_f_o_queue). Summary ------- | Public attributes | | --- | | `[capacity\_](#structtensorflow_1_1ops_1_1_f_i_f_o_queue_1_1_attrs_1ae28ec14fda16522f12c863523082d344) = -1` | `int64` | | `[container\_](#structtensorflow_1_1ops_1_1_f_i_f_o_queue_1_1_attrs_1a3cad0c924b508b6f992b119b773808a7) = ""` | `StringPiece` | | `[shapes\_](#structtensorflow_1_1ops_1_1_f_i_f_o_queue_1_1_attrs_1a14c5fe53dc9b7ac9c4a2d74ded350a87) = {}` | `gtl::ArraySlice< PartialTensorShape >` | | `[shared\_name\_](#structtensorflow_1_1ops_1_1_f_i_f_o_queue_1_1_attrs_1a6969cd51d4824a259e92cbc90c3d0c06) = ""` | `StringPiece` | | Public functions | | --- | | `[Capacity](#structtensorflow_1_1ops_1_1_f_i_f_o_queue_1_1_attrs_1a4a786bc68c2732d8e0d72b2c382101f5)(int64 x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_f_i_f_o_queue_1_1_attrs)` The upper bound on the number of elements in this queue. | | `[Container](#structtensorflow_1_1ops_1_1_f_i_f_o_queue_1_1_attrs_1afcf423b907d26985fab5863459b4bd1b)(StringPiece x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_f_i_f_o_queue_1_1_attrs)` If non-empty, this queue is placed in the given container. | | `[Shapes](#structtensorflow_1_1ops_1_1_f_i_f_o_queue_1_1_attrs_1a77e50ffbad8726bd7f8a7aeec309bf6e)(const gtl::ArraySlice< PartialTensorShape > & x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_f_i_f_o_queue_1_1_attrs)` The shape of each component in a value. | | `[SharedName](#structtensorflow_1_1ops_1_1_f_i_f_o_queue_1_1_attrs_1aa45a52efc11ffde51babdec6ffc57872)(StringPiece x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_f_i_f_o_queue_1_1_attrs)` If non-empty, this queue will be shared under the given name across multiple sessions. | Public attributes ----------------- ### capacity\_ ``` int64 tensorflow::ops::FIFOQueue::Attrs::capacity_ = -1 ``` ### container\_ ``` StringPiece tensorflow::ops::FIFOQueue::Attrs::container_ = "" ``` ### shapes\_ ``` gtl::ArraySlice< PartialTensorShape > tensorflow::ops::FIFOQueue::Attrs::shapes_ = {} ``` ### shared\_name\_ ``` StringPiece tensorflow::ops::FIFOQueue::Attrs::shared_name_ = "" ``` Public functions ---------------- ### Capacity ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::FIFOQueue::Attrs::Capacity( int64 x ) ``` The upper bound on the number of elements in this queue. Negative numbers mean no limit. Defaults to -1 ### Container ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::FIFOQueue::Attrs::Container( StringPiece x ) ``` If non-empty, this queue is placed in the given container. Otherwise, a default container is used. Defaults to "" ### Shapes ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::FIFOQueue::Attrs::Shapes( const gtl::ArraySlice< PartialTensorShape > & x ) ``` The shape of each component in a value. The length of this attr must be either 0 or the same as the length of component\_types. If the length of this attr is 0, the shapes of queue elements are not constrained, and only one element may be dequeued at a time. Defaults to [] ### SharedName ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::FIFOQueue::Attrs::SharedName( StringPiece x ) ``` If non-empty, this queue will be shared under the given name across multiple sessions. Defaults to "" tensorflow_cpp tensorflow::ops::Sum::Attrs tensorflow::ops::Sum::Attrs =========================== `#include <math_ops.h>` Optional attribute setters for [Sum](../../../../class/tensorflow/ops/sum#classtensorflow_1_1ops_1_1_sum). Summary ------- | Public attributes | | --- | | `[keep\_dims\_](#structtensorflow_1_1ops_1_1_sum_1_1_attrs_1addbe9c669ebd0f012e4bfdd30f58dd49) = false` | `bool` | | Public functions | | --- | | `[KeepDims](#structtensorflow_1_1ops_1_1_sum_1_1_attrs_1a7048795c06cbd755f7e40813c9f94b59)(bool x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_sum_1_1_attrs)` If true, retain reduced dimensions with length 1. | Public attributes ----------------- ### keep\_dims\_ ``` bool tensorflow::ops::Sum::Attrs::keep_dims_ = false ``` Public functions ---------------- ### KeepDims ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::Sum::Attrs::KeepDims( bool x ) ``` If true, retain reduced dimensions with length 1. Defaults to false tensorflow_cpp tensorflow::ops::AvgPool3D::Attrs tensorflow::ops::AvgPool3D::Attrs ================================= `#include <nn_ops.h>` Optional attribute setters for [AvgPool3D](../../../../class/tensorflow/ops/avg-pool3-d#classtensorflow_1_1ops_1_1_avg_pool3_d). Summary ------- | Public attributes | | --- | | `[data\_format\_](#structtensorflow_1_1ops_1_1_avg_pool3_d_1_1_attrs_1af155a1ed588d97b3d863841bbe7691a9) = "NDHWC"` | `StringPiece` | | Public functions | | --- | | `[DataFormat](#structtensorflow_1_1ops_1_1_avg_pool3_d_1_1_attrs_1a74cfec85e0dfd6507886efed0d546a11)(StringPiece x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_avg_pool3_d_1_1_attrs)` The data format of the input and output data. | Public attributes ----------------- ### data\_format\_ ``` StringPiece tensorflow::ops::AvgPool3D::Attrs::data_format_ = "NDHWC" ``` Public functions ---------------- ### DataFormat ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::AvgPool3D::Attrs::DataFormat( StringPiece x ) ``` The data format of the input and output data. With the default format "NDHWC", the data is stored in the order of: [batch, in\_depth, in\_height, in\_width, in\_channels]. Alternatively, the format could be "NCDHW", the data storage order is: [batch, in\_channels, in\_depth, in\_height, in\_width]. Defaults to "NDHWC" tensorflow_cpp tensorflow::ops::Assign::Attrs tensorflow::ops::Assign::Attrs ============================== `#include <state_ops.h>` Optional attribute setters for [Assign](../../../../class/tensorflow/ops/assign#classtensorflow_1_1ops_1_1_assign). Summary ------- | Public attributes | | --- | | `[use\_locking\_](#structtensorflow_1_1ops_1_1_assign_1_1_attrs_1ae9bf9c16623a4261e299eb784f104eb4) = true` | `bool` | | `[validate\_shape\_](#structtensorflow_1_1ops_1_1_assign_1_1_attrs_1a3401025d0470b42ec167e96408de3091) = true` | `bool` | | Public functions | | --- | | `[UseLocking](#structtensorflow_1_1ops_1_1_assign_1_1_attrs_1a0d9dfa31afce496359a0994b6c1e43ea)(bool x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_assign_1_1_attrs)` If True, the assignment will be protected by a lock; otherwise the behavior is undefined, but may exhibit less contention. | | `[ValidateShape](#structtensorflow_1_1ops_1_1_assign_1_1_attrs_1a6c63cacd6cce8eabbbb01ffd3ca16746)(bool x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_assign_1_1_attrs)` If true, the operation will validate that the shape of 'value' matches the shape of the [Tensor](../../../../class/tensorflow/tensor#classtensorflow_1_1_tensor) being assigned to. | Public attributes ----------------- ### use\_locking\_ ``` bool tensorflow::ops::Assign::Attrs::use_locking_ = true ``` ### validate\_shape\_ ``` bool tensorflow::ops::Assign::Attrs::validate_shape_ = true ``` Public functions ---------------- ### UseLocking ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::Assign::Attrs::UseLocking( bool x ) ``` If True, the assignment will be protected by a lock; otherwise the behavior is undefined, but may exhibit less contention. Defaults to true ### ValidateShape ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::Assign::Attrs::ValidateShape( bool x ) ``` If true, the operation will validate that the shape of 'value' matches the shape of the [Tensor](../../../../class/tensorflow/tensor#classtensorflow_1_1_tensor) being assigned to. If false, 'ref' will take on the shape of 'value'. Defaults to true tensorflow_cpp tensorflow::ops::MapSize::Attrs tensorflow::ops::MapSize::Attrs =============================== `#include <data_flow_ops.h>` Optional attribute setters for [MapSize](../../../../class/tensorflow/ops/map-size#classtensorflow_1_1ops_1_1_map_size). Summary ------- | Public attributes | | --- | | `[capacity\_](#structtensorflow_1_1ops_1_1_map_size_1_1_attrs_1a555c87f899819b0a2e3d6aa07706f325) = 0` | `int64` | | `[container\_](#structtensorflow_1_1ops_1_1_map_size_1_1_attrs_1a398851a067025aac172e8e4bd117009e) = ""` | `StringPiece` | | `[memory\_limit\_](#structtensorflow_1_1ops_1_1_map_size_1_1_attrs_1a96009fa1afcb892dc1823c16235c95bc) = 0` | `int64` | | `[shared\_name\_](#structtensorflow_1_1ops_1_1_map_size_1_1_attrs_1a6747adc770030036ed9662200555e32a) = ""` | `StringPiece` | | Public functions | | --- | | `[Capacity](#structtensorflow_1_1ops_1_1_map_size_1_1_attrs_1a56f778029b66ff87be9c4c20a36c93a0)(int64 x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_map_size_1_1_attrs)` Defaults to 0. | | `[Container](#structtensorflow_1_1ops_1_1_map_size_1_1_attrs_1a9a110c26c07490df709d8abfabc27a3f)(StringPiece x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_map_size_1_1_attrs)` Defaults to "". | | `[MemoryLimit](#structtensorflow_1_1ops_1_1_map_size_1_1_attrs_1a742bf1616e75cb99d356d80bee3936ab)(int64 x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_map_size_1_1_attrs)` Defaults to 0. | | `[SharedName](#structtensorflow_1_1ops_1_1_map_size_1_1_attrs_1ad1d23ac39e34107f8bfc92bea42325f6)(StringPiece x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_map_size_1_1_attrs)` Defaults to "". | Public attributes ----------------- ### capacity\_ ``` int64 tensorflow::ops::MapSize::Attrs::capacity_ = 0 ``` ### container\_ ``` StringPiece tensorflow::ops::MapSize::Attrs::container_ = "" ``` ### memory\_limit\_ ``` int64 tensorflow::ops::MapSize::Attrs::memory_limit_ = 0 ``` ### shared\_name\_ ``` StringPiece tensorflow::ops::MapSize::Attrs::shared_name_ = "" ``` Public functions ---------------- ### Capacity ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::MapSize::Attrs::Capacity( int64 x ) ``` Defaults to 0. ### Container ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::MapSize::Attrs::Container( StringPiece x ) ``` Defaults to "". ### MemoryLimit ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::MapSize::Attrs::MemoryLimit( int64 x ) ``` Defaults to 0. ### SharedName ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::MapSize::Attrs::SharedName( StringPiece x ) ``` Defaults to "". tensorflow_cpp tensorflow::ops::ParameterizedTruncatedNormal::Attrs tensorflow::ops::ParameterizedTruncatedNormal::Attrs ==================================================== `#include <random_ops.h>` Optional attribute setters for [ParameterizedTruncatedNormal](../../../../class/tensorflow/ops/parameterized-truncated-normal#classtensorflow_1_1ops_1_1_parameterized_truncated_normal). Summary ------- | Public attributes | | --- | | `[seed2\_](#structtensorflow_1_1ops_1_1_parameterized_truncated_normal_1_1_attrs_1acc9733c14f0faad29d416e75d167b42d) = 0` | `int64` | | `[seed\_](#structtensorflow_1_1ops_1_1_parameterized_truncated_normal_1_1_attrs_1a9ad45a09c34e73ed8cf524da25fb6b40) = 0` | `int64` | | Public functions | | --- | | `[Seed](#structtensorflow_1_1ops_1_1_parameterized_truncated_normal_1_1_attrs_1a5281e4a13ec6cc4d7b3a2f399dc86eb8)(int64 x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_parameterized_truncated_normal_1_1_attrs)` If either `seed` or `seed2` are set to be non-zero, the random number generator is seeded by the given seed. | | `[Seed2](#structtensorflow_1_1ops_1_1_parameterized_truncated_normal_1_1_attrs_1a78bfa8b7774314e047cfa31c9ee9e7e6)(int64 x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_parameterized_truncated_normal_1_1_attrs)` A second seed to avoid seed collision. | Public attributes ----------------- ### seed2\_ ``` int64 tensorflow::ops::ParameterizedTruncatedNormal::Attrs::seed2_ = 0 ``` ### seed\_ ``` int64 tensorflow::ops::ParameterizedTruncatedNormal::Attrs::seed_ = 0 ``` Public functions ---------------- ### Seed ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::ParameterizedTruncatedNormal::Attrs::Seed( int64 x ) ``` If either `seed` or `seed2` are set to be non-zero, the random number generator is seeded by the given seed. Otherwise, it is seeded by a random seed. Defaults to 0 ### Seed2 ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::ParameterizedTruncatedNormal::Attrs::Seed2( int64 x ) ``` A second seed to avoid seed collision. Defaults to 0
programming_docs
tensorflow_cpp tensorflow::ops::ResourceScatterNdUpdate::Attrs tensorflow::ops::ResourceScatterNdUpdate::Attrs =============================================== `#include <state_ops.h>` Optional attribute setters for [ResourceScatterNdUpdate](../../../../class/tensorflow/ops/resource-scatter-nd-update#classtensorflow_1_1ops_1_1_resource_scatter_nd_update). Summary ------- | Public attributes | | --- | | `[use\_locking\_](#structtensorflow_1_1ops_1_1_resource_scatter_nd_update_1_1_attrs_1ad9637eaf1ef4a09fe61def886bbf290f) = true` | `bool` | | Public functions | | --- | | `[UseLocking](#structtensorflow_1_1ops_1_1_resource_scatter_nd_update_1_1_attrs_1a686670ee53f8c688b2b311a14b5ab473)(bool x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_resource_scatter_nd_update_1_1_attrs)` An optional bool. | Public attributes ----------------- ### use\_locking\_ ``` bool tensorflow::ops::ResourceScatterNdUpdate::Attrs::use_locking_ = true ``` Public functions ---------------- ### UseLocking ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::ResourceScatterNdUpdate::Attrs::UseLocking( bool x ) ``` An optional bool. Defaults to True. If True, the assignment will be protected by a lock; otherwise the behavior is undefined, but may exhibit less contention. Defaults to true tensorflow_cpp tensorflow::ops::QuantizedReluX::Attrs tensorflow::ops::QuantizedReluX::Attrs ====================================== `#include <nn_ops.h>` Optional attribute setters for [QuantizedReluX](../../../../class/tensorflow/ops/quantized-relu-x#classtensorflow_1_1ops_1_1_quantized_relu_x). Summary ------- | Public attributes | | --- | | `[out\_type\_](#structtensorflow_1_1ops_1_1_quantized_relu_x_1_1_attrs_1a7c41aaf8c42e0a8489da6d78d6f724c3) = DT_QUINT8` | `DataType` | | Public functions | | --- | | `[OutType](#structtensorflow_1_1ops_1_1_quantized_relu_x_1_1_attrs_1ad5d4a48a0e4e88c18426bd4b296c2705)(DataType x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_quantized_relu_x_1_1_attrs)` Defaults to DT\_QUINT8. | Public attributes ----------------- ### out\_type\_ ``` DataType tensorflow::ops::QuantizedReluX::Attrs::out_type_ = DT_QUINT8 ``` Public functions ---------------- ### OutType ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::QuantizedReluX::Attrs::OutType( DataType x ) ``` Defaults to DT\_QUINT8. tensorflow_cpp tensorflow::ops::IdentityReader::Attrs tensorflow::ops::IdentityReader::Attrs ====================================== `#include <io_ops.h>` Optional attribute setters for [IdentityReader](../../../../class/tensorflow/ops/identity-reader#classtensorflow_1_1ops_1_1_identity_reader). Summary ------- | Public attributes | | --- | | `[container\_](#structtensorflow_1_1ops_1_1_identity_reader_1_1_attrs_1adb98c099396304e1bc9a3879c654566a) = ""` | `StringPiece` | | `[shared\_name\_](#structtensorflow_1_1ops_1_1_identity_reader_1_1_attrs_1a2d7456b49fc9a4fc9b70a46192f02413) = ""` | `StringPiece` | | Public functions | | --- | | `[Container](#structtensorflow_1_1ops_1_1_identity_reader_1_1_attrs_1a5ba0879480ce5904f884afd945477bde)(StringPiece x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_identity_reader_1_1_attrs)` If non-empty, this reader is placed in the given container. | | `[SharedName](#structtensorflow_1_1ops_1_1_identity_reader_1_1_attrs_1ac4be4221d08ea67be2b84181068109f1)(StringPiece x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_identity_reader_1_1_attrs)` If non-empty, this reader is named in the given bucket with this shared\_name. | Public attributes ----------------- ### container\_ ``` StringPiece tensorflow::ops::IdentityReader::Attrs::container_ = "" ``` ### shared\_name\_ ``` StringPiece tensorflow::ops::IdentityReader::Attrs::shared_name_ = "" ``` Public functions ---------------- ### Container ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::IdentityReader::Attrs::Container( StringPiece x ) ``` If non-empty, this reader is placed in the given container. Otherwise, a default container is used. Defaults to "" ### SharedName ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::IdentityReader::Attrs::SharedName( StringPiece x ) ``` If non-empty, this reader is named in the given bucket with this shared\_name. Otherwise, the node name is used instead. Defaults to "" tensorflow_cpp tensorflow::ops::FakeQuantWithMinMaxVars::Attrs tensorflow::ops::FakeQuantWithMinMaxVars::Attrs =============================================== `#include <array_ops.h>` Optional attribute setters for [FakeQuantWithMinMaxVars](../../../../class/tensorflow/ops/fake-quant-with-min-max-vars#classtensorflow_1_1ops_1_1_fake_quant_with_min_max_vars). Summary ------- | Public attributes | | --- | | `[narrow\_range\_](#structtensorflow_1_1ops_1_1_fake_quant_with_min_max_vars_1_1_attrs_1abec578a0f196944110f1d11d080a41df) = false` | `bool` | | `[num\_bits\_](#structtensorflow_1_1ops_1_1_fake_quant_with_min_max_vars_1_1_attrs_1acb2747ba3487bcb410741a16f4d44e61) = 8` | `int64` | | Public functions | | --- | | `[NarrowRange](#structtensorflow_1_1ops_1_1_fake_quant_with_min_max_vars_1_1_attrs_1ac79fefb37f8c534d9b72473f7a67dcd2)(bool x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_fake_quant_with_min_max_vars_1_1_attrs)` Defaults to false. | | `[NumBits](#structtensorflow_1_1ops_1_1_fake_quant_with_min_max_vars_1_1_attrs_1a7fb621cbead9980e7ded03d5d01853d5)(int64 x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_fake_quant_with_min_max_vars_1_1_attrs)` Defaults to 8. | Public attributes ----------------- ### narrow\_range\_ ``` bool tensorflow::ops::FakeQuantWithMinMaxVars::Attrs::narrow_range_ = false ``` ### num\_bits\_ ``` int64 tensorflow::ops::FakeQuantWithMinMaxVars::Attrs::num_bits_ = 8 ``` Public functions ---------------- ### NarrowRange ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::FakeQuantWithMinMaxVars::Attrs::NarrowRange( bool x ) ``` Defaults to false. ### NumBits ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::FakeQuantWithMinMaxVars::Attrs::NumBits( int64 x ) ``` Defaults to 8. tensorflow_cpp tensorflow::ops::ExtractGlimpse::Attrs tensorflow::ops::ExtractGlimpse::Attrs ====================================== `#include <image_ops.h>` Optional attribute setters for [ExtractGlimpse](../../../../class/tensorflow/ops/extract-glimpse#classtensorflow_1_1ops_1_1_extract_glimpse). Summary ------- | Public attributes | | --- | | `[centered\_](#structtensorflow_1_1ops_1_1_extract_glimpse_1_1_attrs_1a091aa35c4372414f56642722f0662db5) = true` | `bool` | | `[noise\_](#structtensorflow_1_1ops_1_1_extract_glimpse_1_1_attrs_1ace5ce4b32f313d334089027e08a8afa9) = "uniform"` | `StringPiece` | | `[normalized\_](#structtensorflow_1_1ops_1_1_extract_glimpse_1_1_attrs_1aafca1aa3f4c17329062219124a884db9) = true` | `bool` | | `[uniform\_noise\_](#structtensorflow_1_1ops_1_1_extract_glimpse_1_1_attrs_1a0a0566a1fa43743a25bcd5e8dd9643cb) = true` | `bool` | | Public functions | | --- | | `[Centered](#structtensorflow_1_1ops_1_1_extract_glimpse_1_1_attrs_1a8988355f28f34b1a6ed803cfa297436e)(bool x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_extract_glimpse_1_1_attrs)` indicates if the offset coordinates are centered relative to the image, in which case the (0, 0) offset is relative to the center of the input images. | | `[Noise](#structtensorflow_1_1ops_1_1_extract_glimpse_1_1_attrs_1aa3973de4d55127fbab22be6521c8450d)(StringPiece x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_extract_glimpse_1_1_attrs)` indicates if the noise should `uniform`, `gaussian`, or `zero`. | | `[Normalized](#structtensorflow_1_1ops_1_1_extract_glimpse_1_1_attrs_1a2768807d142893eb4517d6a1ed7f6d06)(bool x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_extract_glimpse_1_1_attrs)` indicates if the offset coordinates are normalized. | | `[UniformNoise](#structtensorflow_1_1ops_1_1_extract_glimpse_1_1_attrs_1abd5583b6d3fa73a9cc9064fdb8320394)(bool x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_extract_glimpse_1_1_attrs)` indicates if the noise should be generated using a uniform distribution or a Gaussian distribution. | Public attributes ----------------- ### centered\_ ``` bool tensorflow::ops::ExtractGlimpse::Attrs::centered_ = true ``` ### noise\_ ``` StringPiece tensorflow::ops::ExtractGlimpse::Attrs::noise_ = "uniform" ``` ### normalized\_ ``` bool tensorflow::ops::ExtractGlimpse::Attrs::normalized_ = true ``` ### uniform\_noise\_ ``` bool tensorflow::ops::ExtractGlimpse::Attrs::uniform_noise_ = true ``` Public functions ---------------- ### Centered ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::ExtractGlimpse::Attrs::Centered( bool x ) ``` indicates if the offset coordinates are centered relative to the image, in which case the (0, 0) offset is relative to the center of the input images. If false, the (0,0) offset corresponds to the upper left corner of the input images. Defaults to true ### Noise ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::ExtractGlimpse::Attrs::Noise( StringPiece x ) ``` indicates if the noise should `uniform`, `gaussian`, or `zero`. The default is `uniform` which means the noise type will be decided by `uniform_noise`. Defaults to "uniform" ### Normalized ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::ExtractGlimpse::Attrs::Normalized( bool x ) ``` indicates if the offset coordinates are normalized. Defaults to true ### UniformNoise ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::ExtractGlimpse::Attrs::UniformNoise( bool x ) ``` indicates if the noise should be generated using a uniform distribution or a Gaussian distribution. Defaults to true tensorflow_cpp tensorflow::ops::Unstage::Attrs tensorflow::ops::Unstage::Attrs =============================== `#include <data_flow_ops.h>` Optional attribute setters for [Unstage](../../../../class/tensorflow/ops/unstage#classtensorflow_1_1ops_1_1_unstage). Summary ------- | Public attributes | | --- | | `[capacity\_](#structtensorflow_1_1ops_1_1_unstage_1_1_attrs_1af8798c090f2cb682f2ac65076387d6ea) = 0` | `int64` | | `[container\_](#structtensorflow_1_1ops_1_1_unstage_1_1_attrs_1ade608e22f3d5ab04f71118d36e5db7bd) = ""` | `StringPiece` | | `[memory\_limit\_](#structtensorflow_1_1ops_1_1_unstage_1_1_attrs_1ab6394c227faf8ec80f8ed41f2d0107dd) = 0` | `int64` | | `[shared\_name\_](#structtensorflow_1_1ops_1_1_unstage_1_1_attrs_1ac34cc6f1c37741783fa4cdf0120be2f6) = ""` | `StringPiece` | | Public functions | | --- | | `[Capacity](#structtensorflow_1_1ops_1_1_unstage_1_1_attrs_1a203fb06963399a04328a465223bfb9be)(int64 x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_unstage_1_1_attrs)` Defaults to 0. | | `[Container](#structtensorflow_1_1ops_1_1_unstage_1_1_attrs_1a8d359030074baa2df9d33195f7119963)(StringPiece x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_unstage_1_1_attrs)` Defaults to "". | | `[MemoryLimit](#structtensorflow_1_1ops_1_1_unstage_1_1_attrs_1a3079168a55c08164997c139ec46f8f30)(int64 x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_unstage_1_1_attrs)` Defaults to 0. | | `[SharedName](#structtensorflow_1_1ops_1_1_unstage_1_1_attrs_1a9b1c1eef76f5d174700104008139bedd)(StringPiece x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_unstage_1_1_attrs)` Defaults to "". | Public attributes ----------------- ### capacity\_ ``` int64 tensorflow::ops::Unstage::Attrs::capacity_ = 0 ``` ### container\_ ``` StringPiece tensorflow::ops::Unstage::Attrs::container_ = "" ``` ### memory\_limit\_ ``` int64 tensorflow::ops::Unstage::Attrs::memory_limit_ = 0 ``` ### shared\_name\_ ``` StringPiece tensorflow::ops::Unstage::Attrs::shared_name_ = "" ``` Public functions ---------------- ### Capacity ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::Unstage::Attrs::Capacity( int64 x ) ``` Defaults to 0. ### Container ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::Unstage::Attrs::Container( StringPiece x ) ``` Defaults to "". ### MemoryLimit ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::Unstage::Attrs::MemoryLimit( int64 x ) ``` Defaults to 0. ### SharedName ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::Unstage::Attrs::SharedName( StringPiece x ) ``` Defaults to "". tensorflow_cpp tensorflow::ops::DecodeImage::Attrs tensorflow::ops::DecodeImage::Attrs =================================== `#include <image_ops.h>` Optional attribute setters for [DecodeImage](../../../../class/tensorflow/ops/decode-image#classtensorflow_1_1ops_1_1_decode_image). Summary ------- | Public attributes | | --- | | `[channels\_](#structtensorflow_1_1ops_1_1_decode_image_1_1_attrs_1a16aa607e1a5151dede520619378ab295) = 0` | `int64` | | `[dtype\_](#structtensorflow_1_1ops_1_1_decode_image_1_1_attrs_1a3a318a0404dd48fa085ea4f22b8c564b) = DT_UINT8` | `DataType` | | `[expand\_animations\_](#structtensorflow_1_1ops_1_1_decode_image_1_1_attrs_1a2ad9fac6cebdeb90187f5aa4b67115e6) = true` | `bool` | | Public functions | | --- | | `[Channels](#structtensorflow_1_1ops_1_1_decode_image_1_1_attrs_1a881c7437b561a550118c5f06841fbe2a)(int64 x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_decode_image_1_1_attrs)` Number of color channels for the decoded image. | | `[Dtype](#structtensorflow_1_1ops_1_1_decode_image_1_1_attrs_1aecdb8e63749abe9fd14ba7c5dca12938)(DataType x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_decode_image_1_1_attrs)` The desired DType of the returned [Tensor](../../../../class/tensorflow/tensor#classtensorflow_1_1_tensor). | | `[ExpandAnimations](#structtensorflow_1_1ops_1_1_decode_image_1_1_attrs_1adb2a6c7b2ca24aa3c01a1e1692e69fab)(bool x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_decode_image_1_1_attrs)` Controls the output shape of the returned op. | Public attributes ----------------- ### channels\_ ``` int64 tensorflow::ops::DecodeImage::Attrs::channels_ = 0 ``` ### dtype\_ ``` DataType tensorflow::ops::DecodeImage::Attrs::dtype_ = DT_UINT8 ``` ### expand\_animations\_ ``` bool tensorflow::ops::DecodeImage::Attrs::expand_animations_ = true ``` Public functions ---------------- ### Channels ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::DecodeImage::Attrs::Channels( int64 x ) ``` Number of color channels for the decoded image. Defaults to 0 ### Dtype ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::DecodeImage::Attrs::Dtype( DataType x ) ``` The desired DType of the returned [Tensor](../../../../class/tensorflow/tensor#classtensorflow_1_1_tensor). Defaults to DT\_UINT8 ### ExpandAnimations ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::DecodeImage::Attrs::ExpandAnimations( bool x ) ``` Controls the output shape of the returned op. If True, the returned op will produce a 3-D tensor for PNG, JPEG, and BMP files; and a 4-D tensor for all GIFs, whether animated or not. If, False, the returned op will produce a 3-D tensor for all file types and will truncate animated GIFs to the first frame. Defaults to true tensorflow_cpp tensorflow::ops::MaxPoolV2::Attrs tensorflow::ops::MaxPoolV2::Attrs ================================= `#include <nn_ops.h>` Optional attribute setters for [MaxPoolV2](../../../../class/tensorflow/ops/max-pool-v2#classtensorflow_1_1ops_1_1_max_pool_v2). Summary ------- | Public attributes | | --- | | `[data\_format\_](#structtensorflow_1_1ops_1_1_max_pool_v2_1_1_attrs_1a0bb80ba632dfd5ac9fe4736d67bd92e8) = "NHWC"` | `StringPiece` | | Public functions | | --- | | `[DataFormat](#structtensorflow_1_1ops_1_1_max_pool_v2_1_1_attrs_1a456ed4a8a4f33a1d278c9aa217ac333f)(StringPiece x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_max_pool_v2_1_1_attrs)` Specify the data format of the input and output data. | Public attributes ----------------- ### data\_format\_ ``` StringPiece tensorflow::ops::MaxPoolV2::Attrs::data_format_ = "NHWC" ``` Public functions ---------------- ### DataFormat ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::MaxPoolV2::Attrs::DataFormat( StringPiece x ) ``` Specify the data format of the input and output data. With the default format "NHWC", the data is stored in the order of: [batch, in\_height, in\_width, in\_channels]. Alternatively, the format could be "NCHW", the data storage order of: [batch, in\_channels, in\_height, in\_width]. Defaults to "NHWC" tensorflow_cpp tensorflow::ops::FixedLengthRecordReader::Attrs tensorflow::ops::FixedLengthRecordReader::Attrs =============================================== `#include <io_ops.h>` Optional attribute setters for [FixedLengthRecordReader](../../../../class/tensorflow/ops/fixed-length-record-reader#classtensorflow_1_1ops_1_1_fixed_length_record_reader). Summary ------- | Public attributes | | --- | | `[container\_](#structtensorflow_1_1ops_1_1_fixed_length_record_reader_1_1_attrs_1a0657b298254345be5b67fdad88a32e35) = ""` | `StringPiece` | | `[encoding\_](#structtensorflow_1_1ops_1_1_fixed_length_record_reader_1_1_attrs_1a422d7f1f8a73657a5d63e25e87062be8) = ""` | `StringPiece` | | `[footer\_bytes\_](#structtensorflow_1_1ops_1_1_fixed_length_record_reader_1_1_attrs_1a7cee5510a829492d7b07dece49991893) = 0` | `int64` | | `[header\_bytes\_](#structtensorflow_1_1ops_1_1_fixed_length_record_reader_1_1_attrs_1a041315cfde664ae5f14a26e052d6d417) = 0` | `int64` | | `[hop\_bytes\_](#structtensorflow_1_1ops_1_1_fixed_length_record_reader_1_1_attrs_1a2bf775253bb84c14e436e27fafa23084) = 0` | `int64` | | `[shared\_name\_](#structtensorflow_1_1ops_1_1_fixed_length_record_reader_1_1_attrs_1a10fc1d7e2719d8b7a41d96b46686a424) = ""` | `StringPiece` | | Public functions | | --- | | `[Container](#structtensorflow_1_1ops_1_1_fixed_length_record_reader_1_1_attrs_1a22600d0f671107ef5fbc1e18666d8480)(StringPiece x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_fixed_length_record_reader_1_1_attrs)` If non-empty, this reader is placed in the given container. | | `[Encoding](#structtensorflow_1_1ops_1_1_fixed_length_record_reader_1_1_attrs_1af785de4403ea4c3b34bb82f550c9b60c)(StringPiece x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_fixed_length_record_reader_1_1_attrs)` The type of encoding for the file. | | `[FooterBytes](#structtensorflow_1_1ops_1_1_fixed_length_record_reader_1_1_attrs_1a9030bf2debd8fa5c62d6aac115503305)(int64 x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_fixed_length_record_reader_1_1_attrs)` Number of bytes in the footer, defaults to 0. | | `[HeaderBytes](#structtensorflow_1_1ops_1_1_fixed_length_record_reader_1_1_attrs_1aa57b6dea873494961b0eac36fcd2130a)(int64 x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_fixed_length_record_reader_1_1_attrs)` Number of bytes in the header, defaults to 0. | | `[HopBytes](#structtensorflow_1_1ops_1_1_fixed_length_record_reader_1_1_attrs_1a447ee44de90ad69590bf0c3258c10836)(int64 x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_fixed_length_record_reader_1_1_attrs)` Number of bytes to hop before each read. | | `[SharedName](#structtensorflow_1_1ops_1_1_fixed_length_record_reader_1_1_attrs_1a6c473ff11caf010e3c896ae1ae5b05f3)(StringPiece x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_fixed_length_record_reader_1_1_attrs)` If non-empty, this reader is named in the given bucket with this shared\_name. | Public attributes ----------------- ### container\_ ``` StringPiece tensorflow::ops::FixedLengthRecordReader::Attrs::container_ = "" ``` ### encoding\_ ``` StringPiece tensorflow::ops::FixedLengthRecordReader::Attrs::encoding_ = "" ``` ### footer\_bytes\_ ``` int64 tensorflow::ops::FixedLengthRecordReader::Attrs::footer_bytes_ = 0 ``` ### header\_bytes\_ ``` int64 tensorflow::ops::FixedLengthRecordReader::Attrs::header_bytes_ = 0 ``` ### hop\_bytes\_ ``` int64 tensorflow::ops::FixedLengthRecordReader::Attrs::hop_bytes_ = 0 ``` ### shared\_name\_ ``` StringPiece tensorflow::ops::FixedLengthRecordReader::Attrs::shared_name_ = "" ``` Public functions ---------------- ### Container ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::FixedLengthRecordReader::Attrs::Container( StringPiece x ) ``` If non-empty, this reader is placed in the given container. Otherwise, a default container is used. Defaults to "" ### Encoding ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::FixedLengthRecordReader::Attrs::Encoding( StringPiece x ) ``` The type of encoding for the file. Currently ZLIB and GZIP are supported. Defaults to none. Defaults to "" ### FooterBytes ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::FixedLengthRecordReader::Attrs::FooterBytes( int64 x ) ``` Number of bytes in the footer, defaults to 0. Defaults to 0 ### HeaderBytes ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::FixedLengthRecordReader::Attrs::HeaderBytes( int64 x ) ``` Number of bytes in the header, defaults to 0. Defaults to 0 ### HopBytes ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::FixedLengthRecordReader::Attrs::HopBytes( int64 x ) ``` Number of bytes to hop before each read. Default of 0 means using record\_bytes. Defaults to 0 ### SharedName ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::FixedLengthRecordReader::Attrs::SharedName( StringPiece x ) ``` If non-empty, this reader is named in the given bucket with this shared\_name. Otherwise, the node name is used instead. Defaults to ""
programming_docs
tensorflow_cpp tensorflow::ops::StageSize::Attrs tensorflow::ops::StageSize::Attrs ================================= `#include <data_flow_ops.h>` Optional attribute setters for [StageSize](../../../../class/tensorflow/ops/stage-size#classtensorflow_1_1ops_1_1_stage_size). Summary ------- | Public attributes | | --- | | `[capacity\_](#structtensorflow_1_1ops_1_1_stage_size_1_1_attrs_1a65fe49a9e62fa8c0e88e0955f218337a) = 0` | `int64` | | `[container\_](#structtensorflow_1_1ops_1_1_stage_size_1_1_attrs_1ab82b270429a506ab31eb5edecb9abf27) = ""` | `StringPiece` | | `[memory\_limit\_](#structtensorflow_1_1ops_1_1_stage_size_1_1_attrs_1a7f656ff31902c85605ac6c043f8d5e5a) = 0` | `int64` | | `[shared\_name\_](#structtensorflow_1_1ops_1_1_stage_size_1_1_attrs_1aa223320d7311e57ff786800fb213884e) = ""` | `StringPiece` | | Public functions | | --- | | `[Capacity](#structtensorflow_1_1ops_1_1_stage_size_1_1_attrs_1a52e797a992cac2366de97afe44ff0b1e)(int64 x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_stage_size_1_1_attrs)` Defaults to 0. | | `[Container](#structtensorflow_1_1ops_1_1_stage_size_1_1_attrs_1a4732619893ec94b7b4cf9c9bfc6d57a5)(StringPiece x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_stage_size_1_1_attrs)` Defaults to "". | | `[MemoryLimit](#structtensorflow_1_1ops_1_1_stage_size_1_1_attrs_1a3c1e383ccab93b026fe414fd1557201b)(int64 x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_stage_size_1_1_attrs)` Defaults to 0. | | `[SharedName](#structtensorflow_1_1ops_1_1_stage_size_1_1_attrs_1a5c2a6345accf3da7d7afe6b14e775046)(StringPiece x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_stage_size_1_1_attrs)` Defaults to "". | Public attributes ----------------- ### capacity\_ ``` int64 tensorflow::ops::StageSize::Attrs::capacity_ = 0 ``` ### container\_ ``` StringPiece tensorflow::ops::StageSize::Attrs::container_ = "" ``` ### memory\_limit\_ ``` int64 tensorflow::ops::StageSize::Attrs::memory_limit_ = 0 ``` ### shared\_name\_ ``` StringPiece tensorflow::ops::StageSize::Attrs::shared_name_ = "" ``` Public functions ---------------- ### Capacity ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::StageSize::Attrs::Capacity( int64 x ) ``` Defaults to 0. ### Container ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::StageSize::Attrs::Container( StringPiece x ) ``` Defaults to "". ### MemoryLimit ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::StageSize::Attrs::MemoryLimit( int64 x ) ``` Defaults to 0. ### SharedName ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::StageSize::Attrs::SharedName( StringPiece x ) ``` Defaults to "". tensorflow_cpp tensorflow::ops::EuclideanNorm::Attrs tensorflow::ops::EuclideanNorm::Attrs ===================================== `#include <math_ops.h>` Optional attribute setters for [EuclideanNorm](../../../../class/tensorflow/ops/euclidean-norm#classtensorflow_1_1ops_1_1_euclidean_norm). Summary ------- | Public attributes | | --- | | `[keep\_dims\_](#structtensorflow_1_1ops_1_1_euclidean_norm_1_1_attrs_1abd75f0e2093c5a330dd97e62611f52f7) = false` | `bool` | | Public functions | | --- | | `[KeepDims](#structtensorflow_1_1ops_1_1_euclidean_norm_1_1_attrs_1a6f536ead29b53292ba6718fd1d9388e2)(bool x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_euclidean_norm_1_1_attrs)` If true, retain reduced dimensions with length 1. | Public attributes ----------------- ### keep\_dims\_ ``` bool tensorflow::ops::EuclideanNorm::Attrs::keep_dims_ = false ``` Public functions ---------------- ### KeepDims ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::EuclideanNorm::Attrs::KeepDims( bool x ) ``` If true, retain reduced dimensions with length 1. Defaults to false tensorflow_cpp tensorflow::ops::FusedBatchNormGrad::Attrs tensorflow::ops::FusedBatchNormGrad::Attrs ========================================== `#include <nn_ops.h>` Optional attribute setters for [FusedBatchNormGrad](../../../../class/tensorflow/ops/fused-batch-norm-grad#classtensorflow_1_1ops_1_1_fused_batch_norm_grad). Summary ------- | Public attributes | | --- | | `[data\_format\_](#structtensorflow_1_1ops_1_1_fused_batch_norm_grad_1_1_attrs_1ae71b771b9db0665a44fd75b59c61fc51) = "NHWC"` | `StringPiece` | | `[epsilon\_](#structtensorflow_1_1ops_1_1_fused_batch_norm_grad_1_1_attrs_1aef11a50c6322301c92a348df3693d53c) = 0.0001f` | `float` | | `[is\_training\_](#structtensorflow_1_1ops_1_1_fused_batch_norm_grad_1_1_attrs_1a8c4f68d91902210a40cf26c38a9fe335) = true` | `bool` | | Public functions | | --- | | `[DataFormat](#structtensorflow_1_1ops_1_1_fused_batch_norm_grad_1_1_attrs_1a10fee31a9497e546fc437360f4cf364f)(StringPiece x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_fused_batch_norm_grad_1_1_attrs)` The data format for y\_backprop, x, x\_backprop. | | `[Epsilon](#structtensorflow_1_1ops_1_1_fused_batch_norm_grad_1_1_attrs_1a5f91a98450585e0951d1b1570469bf1c)(float x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_fused_batch_norm_grad_1_1_attrs)` A small float number added to the variance of x. | | `[IsTraining](#structtensorflow_1_1ops_1_1_fused_batch_norm_grad_1_1_attrs_1a10e394de95847f572463091909294af3)(bool x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_fused_batch_norm_grad_1_1_attrs)` A bool value to indicate the operation is for training (default) or inference. | Public attributes ----------------- ### data\_format\_ ``` StringPiece tensorflow::ops::FusedBatchNormGrad::Attrs::data_format_ = "NHWC" ``` ### epsilon\_ ``` float tensorflow::ops::FusedBatchNormGrad::Attrs::epsilon_ = 0.0001f ``` ### is\_training\_ ``` bool tensorflow::ops::FusedBatchNormGrad::Attrs::is_training_ = true ``` Public functions ---------------- ### DataFormat ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::FusedBatchNormGrad::Attrs::DataFormat( StringPiece x ) ``` The data format for y\_backprop, x, x\_backprop. Either "NHWC" (default) or "NCHW". Defaults to "NHWC" ### Epsilon ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::FusedBatchNormGrad::Attrs::Epsilon( float x ) ``` A small float number added to the variance of x. Defaults to 0.0001 ### IsTraining ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::FusedBatchNormGrad::Attrs::IsTraining( bool x ) ``` A bool value to indicate the operation is for training (default) or inference. Defaults to true tensorflow_cpp tensorflow::ops::ApplyCenteredRMSProp::Attrs tensorflow::ops::ApplyCenteredRMSProp::Attrs ============================================ `#include <training_ops.h>` Optional attribute setters for [ApplyCenteredRMSProp](../../../../class/tensorflow/ops/apply-centered-r-m-s-prop#classtensorflow_1_1ops_1_1_apply_centered_r_m_s_prop). Summary ------- | Public attributes | | --- | | `[use\_locking\_](#structtensorflow_1_1ops_1_1_apply_centered_r_m_s_prop_1_1_attrs_1a1335f477b4911a9c033a3fb5ae227e31) = false` | `bool` | | Public functions | | --- | | `[UseLocking](#structtensorflow_1_1ops_1_1_apply_centered_r_m_s_prop_1_1_attrs_1a78c0665d64a04ef6bfd9366e480e2b13)(bool x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_apply_centered_r_m_s_prop_1_1_attrs)` If `True`, updating of the var, mg, ms, and mom tensors is protected by a lock; otherwise the behavior is undefined, but may exhibit less contention. | Public attributes ----------------- ### use\_locking\_ ``` bool tensorflow::ops::ApplyCenteredRMSProp::Attrs::use_locking_ = false ``` Public functions ---------------- ### UseLocking ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::ApplyCenteredRMSProp::Attrs::UseLocking( bool x ) ``` If `True`, updating of the var, mg, ms, and mom tensors is protected by a lock; otherwise the behavior is undefined, but may exhibit less contention. Defaults to false tensorflow_cpp tensorflow::ops::FusedBatchNormV2::Attrs tensorflow::ops::FusedBatchNormV2::Attrs ======================================== `#include <nn_ops.h>` Optional attribute setters for [FusedBatchNormV2](../../../../class/tensorflow/ops/fused-batch-norm-v2#classtensorflow_1_1ops_1_1_fused_batch_norm_v2). Summary ------- | Public attributes | | --- | | `[data\_format\_](#structtensorflow_1_1ops_1_1_fused_batch_norm_v2_1_1_attrs_1ae5819731a751be04b0d103a9ba0032b5) = "NHWC"` | `StringPiece` | | `[epsilon\_](#structtensorflow_1_1ops_1_1_fused_batch_norm_v2_1_1_attrs_1a3b16ca123558ac26d6fe079087cb96f9) = 0.0001f` | `float` | | `[exponential\_avg\_factor\_](#structtensorflow_1_1ops_1_1_fused_batch_norm_v2_1_1_attrs_1a7ca10b16853665601f8ff9110e6e8b43) = 1.0f` | `float` | | `[is\_training\_](#structtensorflow_1_1ops_1_1_fused_batch_norm_v2_1_1_attrs_1a7c4d1ee913811cd407d4049e8a04cceb) = true` | `bool` | | Public functions | | --- | | `[DataFormat](#structtensorflow_1_1ops_1_1_fused_batch_norm_v2_1_1_attrs_1a0c88b725054b7da0213cce726e13da2f)(StringPiece x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_fused_batch_norm_v2_1_1_attrs)` The data format for x and y. | | `[Epsilon](#structtensorflow_1_1ops_1_1_fused_batch_norm_v2_1_1_attrs_1a2d79b23355a4307f2fa68d49ed92c35f)(float x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_fused_batch_norm_v2_1_1_attrs)` A small float number added to the variance of x. | | `[ExponentialAvgFactor](#structtensorflow_1_1ops_1_1_fused_batch_norm_v2_1_1_attrs_1aece1b25e1f9e816427a668a033143275)(float x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_fused_batch_norm_v2_1_1_attrs)` Defaults to 1. | | `[IsTraining](#structtensorflow_1_1ops_1_1_fused_batch_norm_v2_1_1_attrs_1ad8e622c44d93e0282b77d38d8356e4a4)(bool x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_fused_batch_norm_v2_1_1_attrs)` A bool value to indicate the operation is for training (default) or inference. | Public attributes ----------------- ### data\_format\_ ``` StringPiece tensorflow::ops::FusedBatchNormV2::Attrs::data_format_ = "NHWC" ``` ### epsilon\_ ``` float tensorflow::ops::FusedBatchNormV2::Attrs::epsilon_ = 0.0001f ``` ### exponential\_avg\_factor\_ ``` float tensorflow::ops::FusedBatchNormV2::Attrs::exponential_avg_factor_ = 1.0f ``` ### is\_training\_ ``` bool tensorflow::ops::FusedBatchNormV2::Attrs::is_training_ = true ``` Public functions ---------------- ### DataFormat ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::FusedBatchNormV2::Attrs::DataFormat( StringPiece x ) ``` The data format for x and y. Either "NHWC" (default) or "NCHW". Defaults to "NHWC" ### Epsilon ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::FusedBatchNormV2::Attrs::Epsilon( float x ) ``` A small float number added to the variance of x. Defaults to 0.0001 ### ExponentialAvgFactor ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::FusedBatchNormV2::Attrs::ExponentialAvgFactor( float x ) ``` Defaults to 1. ### IsTraining ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::FusedBatchNormV2::Attrs::IsTraining( bool x ) ``` A bool value to indicate the operation is for training (default) or inference. Defaults to true tensorflow_cpp tensorflow::ops::TextLineReader::Attrs tensorflow::ops::TextLineReader::Attrs ====================================== `#include <io_ops.h>` Optional attribute setters for [TextLineReader](../../../../class/tensorflow/ops/text-line-reader#classtensorflow_1_1ops_1_1_text_line_reader). Summary ------- | Public attributes | | --- | | `[container\_](#structtensorflow_1_1ops_1_1_text_line_reader_1_1_attrs_1ae411d4625bdf3551cd6694b912bef305) = ""` | `StringPiece` | | `[shared\_name\_](#structtensorflow_1_1ops_1_1_text_line_reader_1_1_attrs_1a48a16fb510135a90b7f85fdddd1271d7) = ""` | `StringPiece` | | `[skip\_header\_lines\_](#structtensorflow_1_1ops_1_1_text_line_reader_1_1_attrs_1ae4709b84c31004cd869b2cd4a1bfa4a1) = 0` | `int64` | | Public functions | | --- | | `[Container](#structtensorflow_1_1ops_1_1_text_line_reader_1_1_attrs_1a9ecabd53959b0e6b753c7743cf87f7da)(StringPiece x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_text_line_reader_1_1_attrs)` If non-empty, this reader is placed in the given container. | | `[SharedName](#structtensorflow_1_1ops_1_1_text_line_reader_1_1_attrs_1a28c661e5d45fb89382b6146043653792)(StringPiece x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_text_line_reader_1_1_attrs)` If non-empty, this reader is named in the given bucket with this shared\_name. | | `[SkipHeaderLines](#structtensorflow_1_1ops_1_1_text_line_reader_1_1_attrs_1a2ccb0c50743b51e0fde36f1df23f2550)(int64 x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_text_line_reader_1_1_attrs)` Number of lines to skip from the beginning of every file. | Public attributes ----------------- ### container\_ ``` StringPiece tensorflow::ops::TextLineReader::Attrs::container_ = "" ``` ### shared\_name\_ ``` StringPiece tensorflow::ops::TextLineReader::Attrs::shared_name_ = "" ``` ### skip\_header\_lines\_ ``` int64 tensorflow::ops::TextLineReader::Attrs::skip_header_lines_ = 0 ``` Public functions ---------------- ### Container ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::TextLineReader::Attrs::Container( StringPiece x ) ``` If non-empty, this reader is placed in the given container. Otherwise, a default container is used. Defaults to "" ### SharedName ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::TextLineReader::Attrs::SharedName( StringPiece x ) ``` If non-empty, this reader is named in the given bucket with this shared\_name. Otherwise, the node name is used instead. Defaults to "" ### SkipHeaderLines ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::TextLineReader::Attrs::SkipHeaderLines( int64 x ) ``` Number of lines to skip from the beginning of every file. Defaults to 0 tensorflow_cpp tensorflow::ops::SparseApplyProximalAdagrad::Attrs tensorflow::ops::SparseApplyProximalAdagrad::Attrs ================================================== `#include <training_ops.h>` Optional attribute setters for [SparseApplyProximalAdagrad](../../../../class/tensorflow/ops/sparse-apply-proximal-adagrad#classtensorflow_1_1ops_1_1_sparse_apply_proximal_adagrad). Summary ------- | Public attributes | | --- | | `[use\_locking\_](#structtensorflow_1_1ops_1_1_sparse_apply_proximal_adagrad_1_1_attrs_1abbf2790935f62e02aabbd89c6ec9b014) = false` | `bool` | | Public functions | | --- | | `[UseLocking](#structtensorflow_1_1ops_1_1_sparse_apply_proximal_adagrad_1_1_attrs_1a9bec1710401aa576a20056a8f9527564)(bool x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_sparse_apply_proximal_adagrad_1_1_attrs)` If True, updating of the var and accum tensors will be protected by a lock; otherwise the behavior is undefined, but may exhibit less contention. | Public attributes ----------------- ### use\_locking\_ ``` bool tensorflow::ops::SparseApplyProximalAdagrad::Attrs::use_locking_ = false ``` Public functions ---------------- ### UseLocking ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::SparseApplyProximalAdagrad::Attrs::UseLocking( bool x ) ``` If True, updating of the var and accum tensors will be protected by a lock; otherwise the behavior is undefined, but may exhibit less contention. Defaults to false tensorflow_cpp tensorflow::ops::AvgPool::Attrs tensorflow::ops::AvgPool::Attrs =============================== `#include <nn_ops.h>` Optional attribute setters for [AvgPool](../../../../class/tensorflow/ops/avg-pool#classtensorflow_1_1ops_1_1_avg_pool). Summary ------- | Public attributes | | --- | | `[data\_format\_](#structtensorflow_1_1ops_1_1_avg_pool_1_1_attrs_1a0e4b620e50e4e614300077c6256a2cdf) = "NHWC"` | `StringPiece` | | Public functions | | --- | | `[DataFormat](#structtensorflow_1_1ops_1_1_avg_pool_1_1_attrs_1ae7e7184ac9ff06890002a69cc1591659)(StringPiece x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_avg_pool_1_1_attrs)` Specify the data format of the input and output data. | Public attributes ----------------- ### data\_format\_ ``` StringPiece tensorflow::ops::AvgPool::Attrs::data_format_ = "NHWC" ``` Public functions ---------------- ### DataFormat ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::AvgPool::Attrs::DataFormat( StringPiece x ) ``` Specify the data format of the input and output data. With the default format "NHWC", the data is stored in the order of: [batch, in\_height, in\_width, in\_channels]. Alternatively, the format could be "NCHW", the data storage order of: [batch, in\_channels, in\_height, in\_width]. Defaults to "NHWC" tensorflow_cpp tensorflow::ops::MatrixDiagPartV3::Attrs tensorflow::ops::MatrixDiagPartV3::Attrs ======================================== `#include <array_ops.h>` Optional attribute setters for [MatrixDiagPartV3](../../../../class/tensorflow/ops/matrix-diag-part-v3#classtensorflow_1_1ops_1_1_matrix_diag_part_v3). Summary ------- | Public attributes | | --- | | `[align\_](#structtensorflow_1_1ops_1_1_matrix_diag_part_v3_1_1_attrs_1ae1205a1c8ca51298169e77725f8079aa) = "RIGHT_LEFT"` | `StringPiece` | | Public functions | | --- | | `[Align](#structtensorflow_1_1ops_1_1_matrix_diag_part_v3_1_1_attrs_1afa4bed225de64e118ded946aec30aae6)(StringPiece x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_matrix_diag_part_v3_1_1_attrs)` Some diagonals are shorter than `max_diag_len` and need to be padded. | Public attributes ----------------- ### align\_ ``` StringPiece tensorflow::ops::MatrixDiagPartV3::Attrs::align_ = "RIGHT_LEFT" ``` Public functions ---------------- ### Align ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::MatrixDiagPartV3::Attrs::Align( StringPiece x ) ``` Some diagonals are shorter than `max_diag_len` and need to be padded. `align` is a string specifying how superdiagonals and subdiagonals should be aligned, respectively. There are four possible alignments: "RIGHT\_LEFT" (default), "LEFT\_RIGHT", "LEFT\_LEFT", and "RIGHT\_RIGHT". "RIGHT\_LEFT" aligns superdiagonals to the right (left-pads the row) and subdiagonals to the left (right-pads the row). It is the packing format LAPACK uses. cuSPARSE uses "LEFT\_RIGHT", which is the opposite alignment. Defaults to "RIGHT\_LEFT" tensorflow_cpp tensorflow::ops::Imag::Attrs tensorflow::ops::Imag::Attrs ============================ `#include <math_ops.h>` Optional attribute setters for [Imag](../../../../class/tensorflow/ops/imag#classtensorflow_1_1ops_1_1_imag). Summary ------- | Public attributes | | --- | | `[Tout\_](#structtensorflow_1_1ops_1_1_imag_1_1_attrs_1a18ef3c3c54372f42ff92b3df40da7cb4) = DT_FLOAT` | `DataType` | | Public functions | | --- | | `[Tout](#structtensorflow_1_1ops_1_1_imag_1_1_attrs_1a0ccf52f61e924c28f5e8d8f7cc7e1a46)(DataType x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_imag_1_1_attrs)` Defaults to DT\_FLOAT. | Public attributes ----------------- ### Tout\_ ``` DataType tensorflow::ops::Imag::Attrs::Tout_ = DT_FLOAT ``` Public functions ---------------- ### Tout ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::Imag::Attrs::Tout( DataType x ) ``` Defaults to DT\_FLOAT. tensorflow_cpp tensorflow::ops::CropAndResizeGradImage::Attrs tensorflow::ops::CropAndResizeGradImage::Attrs ============================================== `#include <image_ops.h>` Optional attribute setters for [CropAndResizeGradImage](../../../../class/tensorflow/ops/crop-and-resize-grad-image#classtensorflow_1_1ops_1_1_crop_and_resize_grad_image). Summary ------- | Public attributes | | --- | | `[method\_](#structtensorflow_1_1ops_1_1_crop_and_resize_grad_image_1_1_attrs_1ab27c53859aa59f3889033db0f48a3b8b) = "bilinear"` | `StringPiece` | | Public functions | | --- | | `[Method](#structtensorflow_1_1ops_1_1_crop_and_resize_grad_image_1_1_attrs_1ac731c08e5fca703ef1f7aaf79669071e)(StringPiece x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_crop_and_resize_grad_image_1_1_attrs)` A string specifying the interpolation method. | Public attributes ----------------- ### method\_ ``` StringPiece tensorflow::ops::CropAndResizeGradImage::Attrs::method_ = "bilinear" ``` Public functions ---------------- ### Method ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::CropAndResizeGradImage::Attrs::Method( StringPiece x ) ``` A string specifying the interpolation method. Only 'bilinear' is supported for now. Defaults to "bilinear"
programming_docs
tensorflow_cpp tensorflow::ops::RandomUniformInt::Attrs tensorflow::ops::RandomUniformInt::Attrs ======================================== `#include <random_ops.h>` Optional attribute setters for [RandomUniformInt](../../../../class/tensorflow/ops/random-uniform-int#classtensorflow_1_1ops_1_1_random_uniform_int). Summary ------- | Public attributes | | --- | | `[seed2\_](#structtensorflow_1_1ops_1_1_random_uniform_int_1_1_attrs_1abd95ba9db19210d08fc979340af6cec1) = 0` | `int64` | | `[seed\_](#structtensorflow_1_1ops_1_1_random_uniform_int_1_1_attrs_1af3b4493be3dd984c4c2085efb8c50b32) = 0` | `int64` | | Public functions | | --- | | `[Seed](#structtensorflow_1_1ops_1_1_random_uniform_int_1_1_attrs_1af48e43c642aa6ad2f913a6fed356089e)(int64 x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_random_uniform_int_1_1_attrs)` If either `seed` or `seed2` are set to be non-zero, the random number generator is seeded by the given seed. | | `[Seed2](#structtensorflow_1_1ops_1_1_random_uniform_int_1_1_attrs_1a9b2e556f8747ed2ae0a7d226a69e0589)(int64 x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_random_uniform_int_1_1_attrs)` A second seed to avoid seed collision. | Public attributes ----------------- ### seed2\_ ``` int64 tensorflow::ops::RandomUniformInt::Attrs::seed2_ = 0 ``` ### seed\_ ``` int64 tensorflow::ops::RandomUniformInt::Attrs::seed_ = 0 ``` Public functions ---------------- ### Seed ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::RandomUniformInt::Attrs::Seed( int64 x ) ``` If either `seed` or `seed2` are set to be non-zero, the random number generator is seeded by the given seed. Otherwise, it is seeded by a random seed. Defaults to 0 ### Seed2 ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::RandomUniformInt::Attrs::Seed2( int64 x ) ``` A second seed to avoid seed collision. Defaults to 0 tensorflow_cpp tensorflow::ops::Equal::Attrs tensorflow::ops::Equal::Attrs ============================= `#include <math_ops.h>` Optional attribute setters for [Equal](../../../../class/tensorflow/ops/equal#classtensorflow_1_1ops_1_1_equal). Summary ------- | Public attributes | | --- | | `[incompatible\_shape\_error\_](#structtensorflow_1_1ops_1_1_equal_1_1_attrs_1a5e37c50bb7b305b4b819eb73e53247fc) = true` | `bool` | | Public functions | | --- | | `[IncompatibleShapeError](#structtensorflow_1_1ops_1_1_equal_1_1_attrs_1a0765842c64b30d81569708158a66bcd2)(bool x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_equal_1_1_attrs)` Defaults to true. | Public attributes ----------------- ### incompatible\_shape\_error\_ ``` bool tensorflow::ops::Equal::Attrs::incompatible_shape_error_ = true ``` Public functions ---------------- ### IncompatibleShapeError ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::Equal::Attrs::IncompatibleShapeError( bool x ) ``` Defaults to true. tensorflow_cpp tensorflow::ops::MaxPoolGradGrad::Attrs tensorflow::ops::MaxPoolGradGrad::Attrs ======================================= `#include <nn_ops.h>` Optional attribute setters for [MaxPoolGradGrad](../../../../class/tensorflow/ops/max-pool-grad-grad#classtensorflow_1_1ops_1_1_max_pool_grad_grad). Summary ------- | Public attributes | | --- | | `[data\_format\_](#structtensorflow_1_1ops_1_1_max_pool_grad_grad_1_1_attrs_1a33321f62c140c92a6cae8d3f427ce6ba) = "NHWC"` | `StringPiece` | | Public functions | | --- | | `[DataFormat](#structtensorflow_1_1ops_1_1_max_pool_grad_grad_1_1_attrs_1a60f307808893861130c1b3dab22880ff)(StringPiece x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_max_pool_grad_grad_1_1_attrs)` Specify the data format of the input and output data. | Public attributes ----------------- ### data\_format\_ ``` StringPiece tensorflow::ops::MaxPoolGradGrad::Attrs::data_format_ = "NHWC" ``` Public functions ---------------- ### DataFormat ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::MaxPoolGradGrad::Attrs::DataFormat( StringPiece x ) ``` Specify the data format of the input and output data. With the default format "NHWC", the data is stored in the order of: [batch, in\_height, in\_width, in\_channels]. Alternatively, the format could be "NCHW", the data storage order of: [batch, in\_channels, in\_height, in\_width]. Defaults to "NHWC" tensorflow_cpp tensorflow::ops::ScatterMin::Attrs tensorflow::ops::ScatterMin::Attrs ================================== `#include <state_ops.h>` Optional attribute setters for [ScatterMin](../../../../class/tensorflow/ops/scatter-min#classtensorflow_1_1ops_1_1_scatter_min). Summary ------- | Public attributes | | --- | | `[use\_locking\_](#structtensorflow_1_1ops_1_1_scatter_min_1_1_attrs_1aa9b13fb550210c1135560d0156b5c951) = false` | `bool` | | Public functions | | --- | | `[UseLocking](#structtensorflow_1_1ops_1_1_scatter_min_1_1_attrs_1a627acb8ef96646a80418e97320c2f150)(bool x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_scatter_min_1_1_attrs)` If True, the update will be protected by a lock; otherwise the behavior is undefined, but may exhibit less contention. | Public attributes ----------------- ### use\_locking\_ ``` bool tensorflow::ops::ScatterMin::Attrs::use_locking_ = false ``` Public functions ---------------- ### UseLocking ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::ScatterMin::Attrs::UseLocking( bool x ) ``` If True, the update will be protected by a lock; otherwise the behavior is undefined, but may exhibit less contention. Defaults to false tensorflow_cpp tensorflow::ops::QuantizedConv2D::Attrs tensorflow::ops::QuantizedConv2D::Attrs ======================================= `#include <nn_ops.h>` Optional attribute setters for [QuantizedConv2D](../../../../class/tensorflow/ops/quantized-conv2-d#classtensorflow_1_1ops_1_1_quantized_conv2_d). Summary ------- | Public attributes | | --- | | `[dilations\_](#structtensorflow_1_1ops_1_1_quantized_conv2_d_1_1_attrs_1a9c7e7b8aa805b62ebd16507b3a4285a8) = Default_dilations()` | `gtl::ArraySlice< int >` | | `[out\_type\_](#structtensorflow_1_1ops_1_1_quantized_conv2_d_1_1_attrs_1ab7813f90355fc599f9fd3775c423dbe0) = DT_QINT32` | `DataType` | | Public functions | | --- | | `[Dilations](#structtensorflow_1_1ops_1_1_quantized_conv2_d_1_1_attrs_1a83387d8f43271c912007784178e0ac14)(const gtl::ArraySlice< int > & x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_quantized_conv2_d_1_1_attrs)` 1-D tensor of length 4. | | `[OutType](#structtensorflow_1_1ops_1_1_quantized_conv2_d_1_1_attrs_1ac147ef854700837dcf82521e59859cd2)(DataType x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_quantized_conv2_d_1_1_attrs)` Defaults to DT\_QINT32. | Public attributes ----------------- ### dilations\_ ``` gtl::ArraySlice< int > tensorflow::ops::QuantizedConv2D::Attrs::dilations_ = Default_dilations() ``` ### out\_type\_ ``` DataType tensorflow::ops::QuantizedConv2D::Attrs::out_type_ = DT_QINT32 ``` Public functions ---------------- ### Dilations ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::QuantizedConv2D::Attrs::Dilations( const gtl::ArraySlice< int > & x ) ``` 1-D tensor of length 4. The dilation factor for each dimension of `input`. If set to k > 1, there will be k-1 skipped cells between each filter element on that dimension. The dimension order is determined by the value of `data_format`, see above for details. Dilations in the batch and depth dimensions must be 1. Defaults to [1, 1, 1, 1] ### OutType ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::QuantizedConv2D::Attrs::OutType( DataType x ) ``` Defaults to DT\_QINT32. tensorflow_cpp tensorflow::ops::BarrierTakeMany::Attrs tensorflow::ops::BarrierTakeMany::Attrs ======================================= `#include <data_flow_ops.h>` Optional attribute setters for [BarrierTakeMany](../../../../class/tensorflow/ops/barrier-take-many#classtensorflow_1_1ops_1_1_barrier_take_many). Summary ------- | Public attributes | | --- | | `[allow\_small\_batch\_](#structtensorflow_1_1ops_1_1_barrier_take_many_1_1_attrs_1a34d07b8141f8932782c1220bf109b30a) = false` | `bool` | | `[timeout\_ms\_](#structtensorflow_1_1ops_1_1_barrier_take_many_1_1_attrs_1a2f4ea01b5e1dd39701b7fd0074f6ce54) = -1` | `int64` | | `[wait\_for\_incomplete\_](#structtensorflow_1_1ops_1_1_barrier_take_many_1_1_attrs_1ab4e44ba0532a127592c8b8a94c33a241) = false` | `bool` | | Public functions | | --- | | `[AllowSmallBatch](#structtensorflow_1_1ops_1_1_barrier_take_many_1_1_attrs_1a9dda1e0280b99640abb644c2c60580b3)(bool x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_barrier_take_many_1_1_attrs)` Allow to return less than num\_elements items if barrier is already closed. | | `[TimeoutMs](#structtensorflow_1_1ops_1_1_barrier_take_many_1_1_attrs_1ab19897a86851468f208b286733203b47)(int64 x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_barrier_take_many_1_1_attrs)` If the queue is empty, this operation will block for up to timeout\_ms milliseconds. | | `[WaitForIncomplete](#structtensorflow_1_1ops_1_1_barrier_take_many_1_1_attrs_1a8188671d9e2e1a4791ab4c99fbce732b)(bool x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_barrier_take_many_1_1_attrs)` Defaults to false. | Public attributes ----------------- ### allow\_small\_batch\_ ``` bool tensorflow::ops::BarrierTakeMany::Attrs::allow_small_batch_ = false ``` ### timeout\_ms\_ ``` int64 tensorflow::ops::BarrierTakeMany::Attrs::timeout_ms_ = -1 ``` ### wait\_for\_incomplete\_ ``` bool tensorflow::ops::BarrierTakeMany::Attrs::wait_for_incomplete_ = false ``` Public functions ---------------- ### AllowSmallBatch ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::BarrierTakeMany::Attrs::AllowSmallBatch( bool x ) ``` Allow to return less than num\_elements items if barrier is already closed. Defaults to false ### TimeoutMs ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::BarrierTakeMany::Attrs::TimeoutMs( int64 x ) ``` If the queue is empty, this operation will block for up to timeout\_ms milliseconds. Note: This option is not supported yet. Defaults to -1 ### WaitForIncomplete ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::BarrierTakeMany::Attrs::WaitForIncomplete( bool x ) ``` Defaults to false. tensorflow_cpp tensorflow::ops::TemporaryVariable::Attrs tensorflow::ops::TemporaryVariable::Attrs ========================================= `#include <state_ops.h>` Optional attribute setters for [TemporaryVariable](../../../../class/tensorflow/ops/temporary-variable#classtensorflow_1_1ops_1_1_temporary_variable). Summary ------- | Public attributes | | --- | | `[var\_name\_](#structtensorflow_1_1ops_1_1_temporary_variable_1_1_attrs_1a17b29306c0f954fbc1c53da0e1b484d2) = ""` | `StringPiece` | | Public functions | | --- | | `[VarName](#structtensorflow_1_1ops_1_1_temporary_variable_1_1_attrs_1ac88edaa4690953d0fa26f874e536a4a3)(StringPiece x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_temporary_variable_1_1_attrs)` Overrides the name used for the temporary variable resource. | Public attributes ----------------- ### var\_name\_ ``` StringPiece tensorflow::ops::TemporaryVariable::Attrs::var_name_ = "" ``` Public functions ---------------- ### VarName ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::TemporaryVariable::Attrs::VarName( StringPiece x ) ``` Overrides the name used for the temporary variable resource. Default value is the name of the '[TemporaryVariable](../../../../class/tensorflow/ops/temporary-variable#classtensorflow_1_1ops_1_1_temporary_variable)' op (which is guaranteed unique). Defaults to "" tensorflow_cpp tensorflow::ops::FusedBatchNormV3::Attrs tensorflow::ops::FusedBatchNormV3::Attrs ======================================== `#include <nn_ops.h>` Optional attribute setters for [FusedBatchNormV3](../../../../class/tensorflow/ops/fused-batch-norm-v3#classtensorflow_1_1ops_1_1_fused_batch_norm_v3). Summary ------- | Public attributes | | --- | | `[data\_format\_](#structtensorflow_1_1ops_1_1_fused_batch_norm_v3_1_1_attrs_1a60b4c5dc8d2fde72365cb175e966a43c) = "NHWC"` | `StringPiece` | | `[epsilon\_](#structtensorflow_1_1ops_1_1_fused_batch_norm_v3_1_1_attrs_1a471771f7031bed8e9435724d83c7814d) = 0.0001f` | `float` | | `[exponential\_avg\_factor\_](#structtensorflow_1_1ops_1_1_fused_batch_norm_v3_1_1_attrs_1a4c88b019b9144e032c7fc5d8196454e6) = 1.0f` | `float` | | `[is\_training\_](#structtensorflow_1_1ops_1_1_fused_batch_norm_v3_1_1_attrs_1ab47538d21b863e4214e9e22076733d1c) = true` | `bool` | | Public functions | | --- | | `[DataFormat](#structtensorflow_1_1ops_1_1_fused_batch_norm_v3_1_1_attrs_1a63775942a646cfe49d56384d3320c03b)(StringPiece x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_fused_batch_norm_v3_1_1_attrs)` The data format for x and y. | | `[Epsilon](#structtensorflow_1_1ops_1_1_fused_batch_norm_v3_1_1_attrs_1ae04448c26274c4190ff52bc89ba10e01)(float x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_fused_batch_norm_v3_1_1_attrs)` A small float number added to the variance of x. | | `[ExponentialAvgFactor](#structtensorflow_1_1ops_1_1_fused_batch_norm_v3_1_1_attrs_1a701f677ed8ac842bbcfd0e67ec5224e1)(float x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_fused_batch_norm_v3_1_1_attrs)` Defaults to 1. | | `[IsTraining](#structtensorflow_1_1ops_1_1_fused_batch_norm_v3_1_1_attrs_1adeb3339d5aec66ac387c67a657132b73)(bool x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_fused_batch_norm_v3_1_1_attrs)` A bool value to indicate the operation is for training (default) or inference. | Public attributes ----------------- ### data\_format\_ ``` StringPiece tensorflow::ops::FusedBatchNormV3::Attrs::data_format_ = "NHWC" ``` ### epsilon\_ ``` float tensorflow::ops::FusedBatchNormV3::Attrs::epsilon_ = 0.0001f ``` ### exponential\_avg\_factor\_ ``` float tensorflow::ops::FusedBatchNormV3::Attrs::exponential_avg_factor_ = 1.0f ``` ### is\_training\_ ``` bool tensorflow::ops::FusedBatchNormV3::Attrs::is_training_ = true ``` Public functions ---------------- ### DataFormat ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::FusedBatchNormV3::Attrs::DataFormat( StringPiece x ) ``` The data format for x and y. Either "NHWC" (default) or "NCHW". Defaults to "NHWC" ### Epsilon ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::FusedBatchNormV3::Attrs::Epsilon( float x ) ``` A small float number added to the variance of x. Defaults to 0.0001 ### ExponentialAvgFactor ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::FusedBatchNormV3::Attrs::ExponentialAvgFactor( float x ) ``` Defaults to 1. ### IsTraining ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::FusedBatchNormV3::Attrs::IsTraining( bool x ) ``` A bool value to indicate the operation is for training (default) or inference. Defaults to true tensorflow_cpp tensorflow::ops::ResourceSparseApplyFtrlV2::Attrs tensorflow::ops::ResourceSparseApplyFtrlV2::Attrs ================================================= `#include <training_ops.h>` Optional attribute setters for [ResourceSparseApplyFtrlV2](../../../../class/tensorflow/ops/resource-sparse-apply-ftrl-v2#classtensorflow_1_1ops_1_1_resource_sparse_apply_ftrl_v2). Summary ------- | Public attributes | | --- | | `[multiply\_linear\_by\_lr\_](#structtensorflow_1_1ops_1_1_resource_sparse_apply_ftrl_v2_1_1_attrs_1a0115aeba78578ff39ea3484c6701bc98) = false` | `bool` | | `[use\_locking\_](#structtensorflow_1_1ops_1_1_resource_sparse_apply_ftrl_v2_1_1_attrs_1acee06b590eec3e4c76ff90385ed0c74e) = false` | `bool` | | Public functions | | --- | | `[MultiplyLinearByLr](#structtensorflow_1_1ops_1_1_resource_sparse_apply_ftrl_v2_1_1_attrs_1af987e55a2d4429fb533808d3e1130b3d)(bool x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_resource_sparse_apply_ftrl_v2_1_1_attrs)` Defaults to false. | | `[UseLocking](#structtensorflow_1_1ops_1_1_resource_sparse_apply_ftrl_v2_1_1_attrs_1a7d9c60095f567d054f551d063548072b)(bool x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_resource_sparse_apply_ftrl_v2_1_1_attrs)` If `True`, updating of the var and accum tensors will be protected by a lock; otherwise the behavior is undefined, but may exhibit less contention. | Public attributes ----------------- ### multiply\_linear\_by\_lr\_ ``` bool tensorflow::ops::ResourceSparseApplyFtrlV2::Attrs::multiply_linear_by_lr_ = false ``` ### use\_locking\_ ``` bool tensorflow::ops::ResourceSparseApplyFtrlV2::Attrs::use_locking_ = false ``` Public functions ---------------- ### MultiplyLinearByLr ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::ResourceSparseApplyFtrlV2::Attrs::MultiplyLinearByLr( bool x ) ``` Defaults to false. ### UseLocking ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::ResourceSparseApplyFtrlV2::Attrs::UseLocking( bool x ) ``` If `True`, updating of the var and accum tensors will be protected by a lock; otherwise the behavior is undefined, but may exhibit less contention. Defaults to false tensorflow_cpp tensorflow::ops::ResourceApplyPowerSign::Attrs tensorflow::ops::ResourceApplyPowerSign::Attrs ============================================== `#include <training_ops.h>` Optional attribute setters for [ResourceApplyPowerSign](../../../../class/tensorflow/ops/resource-apply-power-sign#classtensorflow_1_1ops_1_1_resource_apply_power_sign). Summary ------- | Public attributes | | --- | | `[use\_locking\_](#structtensorflow_1_1ops_1_1_resource_apply_power_sign_1_1_attrs_1a357137519c75f5befeede379d7c82bf5) = false` | `bool` | | Public functions | | --- | | `[UseLocking](#structtensorflow_1_1ops_1_1_resource_apply_power_sign_1_1_attrs_1ae7dd5c6fe55d9c8a890d35b04eda181d)(bool x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_resource_apply_power_sign_1_1_attrs)` If `True`, updating of the var and m tensors is protected by a lock; otherwise the behavior is undefined, but may exhibit less contention. | Public attributes ----------------- ### use\_locking\_ ``` bool tensorflow::ops::ResourceApplyPowerSign::Attrs::use_locking_ = false ``` Public functions ---------------- ### UseLocking ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::ResourceApplyPowerSign::Attrs::UseLocking( bool x ) ``` If `True`, updating of the var and m tensors is protected by a lock; otherwise the behavior is undefined, but may exhibit less contention. Defaults to false tensorflow_cpp tensorflow::ops::ResourceApplyKerasMomentum::Attrs tensorflow::ops::ResourceApplyKerasMomentum::Attrs ================================================== `#include <training_ops.h>` Optional attribute setters for [ResourceApplyKerasMomentum](../../../../class/tensorflow/ops/resource-apply-keras-momentum#classtensorflow_1_1ops_1_1_resource_apply_keras_momentum). Summary ------- | Public attributes | | --- | | `[use\_locking\_](#structtensorflow_1_1ops_1_1_resource_apply_keras_momentum_1_1_attrs_1a500be603a2bda28a13f6a0839362c8bd) = false` | `bool` | | `[use\_nesterov\_](#structtensorflow_1_1ops_1_1_resource_apply_keras_momentum_1_1_attrs_1a4cf8fc79fcfcdfbf2a4790540679ed3b) = false` | `bool` | | Public functions | | --- | | `[UseLocking](#structtensorflow_1_1ops_1_1_resource_apply_keras_momentum_1_1_attrs_1a0623f65e94804dbc056493e451e4995e)(bool x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_resource_apply_keras_momentum_1_1_attrs)` If `True`, updating of the var and accum tensors will be protected by a lock; otherwise the behavior is undefined, but may exhibit less contention. | | `[UseNesterov](#structtensorflow_1_1ops_1_1_resource_apply_keras_momentum_1_1_attrs_1a99d3ca35a4eff9b9811647223045d412)(bool x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_resource_apply_keras_momentum_1_1_attrs)` If `True`, the tensor passed to compute grad will be var + momentum \* accum, so in the end, the var you get is actually var + momentum \* accum. | Public attributes ----------------- ### use\_locking\_ ``` bool tensorflow::ops::ResourceApplyKerasMomentum::Attrs::use_locking_ = false ``` ### use\_nesterov\_ ``` bool tensorflow::ops::ResourceApplyKerasMomentum::Attrs::use_nesterov_ = false ``` Public functions ---------------- ### UseLocking ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::ResourceApplyKerasMomentum::Attrs::UseLocking( bool x ) ``` If `True`, updating of the var and accum tensors will be protected by a lock; otherwise the behavior is undefined, but may exhibit less contention. Defaults to false ### UseNesterov ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::ResourceApplyKerasMomentum::Attrs::UseNesterov( bool x ) ``` If `True`, the tensor passed to compute grad will be var + momentum \* accum, so in the end, the var you get is actually var + momentum \* accum. Defaults to false
programming_docs
tensorflow_cpp tensorflow::ops::Placeholder::Attrs tensorflow::ops::Placeholder::Attrs =================================== `#include <array_ops.h>` Optional attribute setters for [Placeholder](../../../../class/tensorflow/ops/placeholder#classtensorflow_1_1ops_1_1_placeholder). Summary ------- | Public attributes | | --- | | `[shape\_](#structtensorflow_1_1ops_1_1_placeholder_1_1_attrs_1a6a6c519ecc364678035bee0c2e15fd62) = ::tensorflow::PartialTensorShape()` | `PartialTensorShape` | | Public functions | | --- | | `[Shape](#structtensorflow_1_1ops_1_1_placeholder_1_1_attrs_1a231b90321d75fb62c9c3e71fc94536d7)(PartialTensorShape x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_placeholder_1_1_attrs)` (Optional) The shape of the tensor. | Public attributes ----------------- ### shape\_ ``` PartialTensorShape tensorflow::ops::Placeholder::Attrs::shape_ = ::tensorflow::PartialTensorShape() ``` Public functions ---------------- ### Shape ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::Placeholder::Attrs::Shape( PartialTensorShape x ) ``` (Optional) The shape of the tensor. If the shape has 0 dimensions, the shape is unconstrained. Defaults to tensorflow_cpp tensorflow::ops::Stage::Attrs tensorflow::ops::Stage::Attrs ============================= `#include <data_flow_ops.h>` Optional attribute setters for [Stage](../../../../class/tensorflow/ops/stage#classtensorflow_1_1ops_1_1_stage). Summary ------- | Public attributes | | --- | | `[capacity\_](#structtensorflow_1_1ops_1_1_stage_1_1_attrs_1aeb5767fc152a20b8cd92e15ad39c5bd8) = 0` | `int64` | | `[container\_](#structtensorflow_1_1ops_1_1_stage_1_1_attrs_1ae5180d0dde62f97e88d7891f439f3af2) = ""` | `StringPiece` | | `[memory\_limit\_](#structtensorflow_1_1ops_1_1_stage_1_1_attrs_1a0a15b1656a545276df8510f0363e3310) = 0` | `int64` | | `[shared\_name\_](#structtensorflow_1_1ops_1_1_stage_1_1_attrs_1a11d9178ead9ed1cbc246ce54e8edbc57) = ""` | `StringPiece` | | Public functions | | --- | | `[Capacity](#structtensorflow_1_1ops_1_1_stage_1_1_attrs_1a92ee88d30535d3c23ccf719af1e1f5ac)(int64 x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_stage_1_1_attrs)` [Maximum](../../../../class/tensorflow/ops/maximum#classtensorflow_1_1ops_1_1_maximum) number of elements in the Staging Area. | | `[Container](#structtensorflow_1_1ops_1_1_stage_1_1_attrs_1a5749fd10abbf367b44f2320d97703e67)(StringPiece x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_stage_1_1_attrs)` If non-empty, this queue is placed in the given container. | | `[MemoryLimit](#structtensorflow_1_1ops_1_1_stage_1_1_attrs_1a73d56e5cb0d4cff96c5f1ceece23f135)(int64 x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_stage_1_1_attrs)` The maximum number of bytes allowed for Tensors in the Staging Area. | | `[SharedName](#structtensorflow_1_1ops_1_1_stage_1_1_attrs_1ab0cb880e9cabeb461cc83b239a048eef)(StringPiece x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_stage_1_1_attrs)` It is necessary to match this name to the matching [Unstage](../../../../class/tensorflow/ops/unstage#classtensorflow_1_1ops_1_1_unstage) Op. | Public attributes ----------------- ### capacity\_ ``` int64 tensorflow::ops::Stage::Attrs::capacity_ = 0 ``` ### container\_ ``` StringPiece tensorflow::ops::Stage::Attrs::container_ = "" ``` ### memory\_limit\_ ``` int64 tensorflow::ops::Stage::Attrs::memory_limit_ = 0 ``` ### shared\_name\_ ``` StringPiece tensorflow::ops::Stage::Attrs::shared_name_ = "" ``` Public functions ---------------- ### Capacity ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::Stage::Attrs::Capacity( int64 x ) ``` [Maximum](../../../../class/tensorflow/ops/maximum#classtensorflow_1_1ops_1_1_maximum) number of elements in the Staging Area. If > 0, inserts on the container will block when the capacity is reached. Defaults to 0 ### Container ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::Stage::Attrs::Container( StringPiece x ) ``` If non-empty, this queue is placed in the given container. Otherwise, a default container is used. Defaults to "" ### MemoryLimit ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::Stage::Attrs::MemoryLimit( int64 x ) ``` The maximum number of bytes allowed for Tensors in the Staging Area. If > 0, inserts will block until sufficient space is available. Defaults to 0 ### SharedName ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::Stage::Attrs::SharedName( StringPiece x ) ``` It is necessary to match this name to the matching [Unstage](../../../../class/tensorflow/ops/unstage#classtensorflow_1_1ops_1_1_unstage) Op. Defaults to "" tensorflow_cpp tensorflow::ops::SparseConditionalAccumulator::Attrs tensorflow::ops::SparseConditionalAccumulator::Attrs ==================================================== `#include <data_flow_ops.h>` Optional attribute setters for [SparseConditionalAccumulator](../../../../class/tensorflow/ops/sparse-conditional-accumulator#classtensorflow_1_1ops_1_1_sparse_conditional_accumulator). Summary ------- | Public attributes | | --- | | `[container\_](#structtensorflow_1_1ops_1_1_sparse_conditional_accumulator_1_1_attrs_1a9eadc03f18ec64b4a24607490bc2bdd1) = ""` | `StringPiece` | | `[reduction\_type\_](#structtensorflow_1_1ops_1_1_sparse_conditional_accumulator_1_1_attrs_1a37876ae182189da5c7622891aeeda107) = "MEAN"` | `StringPiece` | | `[shared\_name\_](#structtensorflow_1_1ops_1_1_sparse_conditional_accumulator_1_1_attrs_1a47f996e0395a673c9feafb332646719c) = ""` | `StringPiece` | | Public functions | | --- | | `[Container](#structtensorflow_1_1ops_1_1_sparse_conditional_accumulator_1_1_attrs_1afe956a4da793d2da300578e27bff1177)(StringPiece x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_sparse_conditional_accumulator_1_1_attrs)` If non-empty, this accumulator is placed in the given container. | | `[ReductionType](#structtensorflow_1_1ops_1_1_sparse_conditional_accumulator_1_1_attrs_1a1584ae8a3920516efe52b01dc0cc174d)(StringPiece x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_sparse_conditional_accumulator_1_1_attrs)` Defaults to "MEAN". | | `[SharedName](#structtensorflow_1_1ops_1_1_sparse_conditional_accumulator_1_1_attrs_1a23089c44351930004ae452aa68113690)(StringPiece x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_sparse_conditional_accumulator_1_1_attrs)` If non-empty, this accumulator will be shared under the given name across multiple sessions. | Public attributes ----------------- ### container\_ ``` StringPiece tensorflow::ops::SparseConditionalAccumulator::Attrs::container_ = "" ``` ### reduction\_type\_ ``` StringPiece tensorflow::ops::SparseConditionalAccumulator::Attrs::reduction_type_ = "MEAN" ``` ### shared\_name\_ ``` StringPiece tensorflow::ops::SparseConditionalAccumulator::Attrs::shared_name_ = "" ``` Public functions ---------------- ### Container ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::SparseConditionalAccumulator::Attrs::Container( StringPiece x ) ``` If non-empty, this accumulator is placed in the given container. Otherwise, a default container is used. Defaults to "" ### ReductionType ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::SparseConditionalAccumulator::Attrs::ReductionType( StringPiece x ) ``` Defaults to "MEAN". ### SharedName ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::SparseConditionalAccumulator::Attrs::SharedName( StringPiece x ) ``` If non-empty, this accumulator will be shared under the given name across multiple sessions. Defaults to "" tensorflow_cpp tensorflow::ops::MaxPoolWithArgmax::Attrs tensorflow::ops::MaxPoolWithArgmax::Attrs ========================================= `#include <nn_ops.h>` Optional attribute setters for [MaxPoolWithArgmax](../../../../class/tensorflow/ops/max-pool-with-argmax#classtensorflow_1_1ops_1_1_max_pool_with_argmax). Summary ------- | Public attributes | | --- | | `[Targmax\_](#structtensorflow_1_1ops_1_1_max_pool_with_argmax_1_1_attrs_1a88f1f25def0bcad5ffb5f00653b83159) = DT_INT64` | `DataType` | | `[include\_batch\_in\_index\_](#structtensorflow_1_1ops_1_1_max_pool_with_argmax_1_1_attrs_1a81e26016c695bd0e1b5c06660d1830b7) = false` | `bool` | | Public functions | | --- | | `[IncludeBatchInIndex](#structtensorflow_1_1ops_1_1_max_pool_with_argmax_1_1_attrs_1a8a5fb21c00b703a7715971775a9d9a7f)(bool x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_max_pool_with_argmax_1_1_attrs)` Whether to include batch dimension in flattened index of `argmax`. | | `[Targmax](#structtensorflow_1_1ops_1_1_max_pool_with_argmax_1_1_attrs_1a74d7ddeb549b848bb1a3973df5747df9)(DataType x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_max_pool_with_argmax_1_1_attrs)` Defaults to DT\_INT64. | Public attributes ----------------- ### Targmax\_ ``` DataType tensorflow::ops::MaxPoolWithArgmax::Attrs::Targmax_ = DT_INT64 ``` ### include\_batch\_in\_index\_ ``` bool tensorflow::ops::MaxPoolWithArgmax::Attrs::include_batch_in_index_ = false ``` Public functions ---------------- ### IncludeBatchInIndex ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::MaxPoolWithArgmax::Attrs::IncludeBatchInIndex( bool x ) ``` Whether to include batch dimension in flattened index of `argmax`. Defaults to false ### Targmax ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::MaxPoolWithArgmax::Attrs::Targmax( DataType x ) ``` Defaults to DT\_INT64. tensorflow_cpp tensorflow::ops::AsString::Attrs tensorflow::ops::AsString::Attrs ================================ `#include <string_ops.h>` Optional attribute setters for [AsString](../../../../class/tensorflow/ops/as-string#classtensorflow_1_1ops_1_1_as_string). Summary ------- | Public attributes | | --- | | `[fill\_](#structtensorflow_1_1ops_1_1_as_string_1_1_attrs_1a8bf611bad8c7bd4345908dbc3cd21786) = ""` | `StringPiece` | | `[precision\_](#structtensorflow_1_1ops_1_1_as_string_1_1_attrs_1a30c509542b89243670993b5347796d9a) = -1` | `int64` | | `[scientific\_](#structtensorflow_1_1ops_1_1_as_string_1_1_attrs_1af02389c5b254a51ada2c93cf41be40f6) = false` | `bool` | | `[shortest\_](#structtensorflow_1_1ops_1_1_as_string_1_1_attrs_1ae2b98a6a89a8b72580585a25a84535bb) = false` | `bool` | | `[width\_](#structtensorflow_1_1ops_1_1_as_string_1_1_attrs_1a3851aec9e144cb466b18571b6fc39541) = -1` | `int64` | | Public functions | | --- | | `[Fill](#structtensorflow_1_1ops_1_1_as_string_1_1_attrs_1accfa54faa153ce4b5e8dff7a8c8e63f8)(StringPiece x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_as_string_1_1_attrs)` The value to pad if width > -1. | | `[Precision](#structtensorflow_1_1ops_1_1_as_string_1_1_attrs_1af2acaa70b9fad5b80d21a664a453bcaa)(int64 x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_as_string_1_1_attrs)` The post-decimal precision to use for floating point numbers. | | `[Scientific](#structtensorflow_1_1ops_1_1_as_string_1_1_attrs_1a119604909bb32fc0da005d1f55757f55)(bool x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_as_string_1_1_attrs)` Use scientific notation for floating point numbers. | | `[Shortest](#structtensorflow_1_1ops_1_1_as_string_1_1_attrs_1a7b38858066b92833780462277b3b6047)(bool x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_as_string_1_1_attrs)` Use shortest representation (either scientific or standard) for floating point numbers. | | `[Width](#structtensorflow_1_1ops_1_1_as_string_1_1_attrs_1af57583d51da956bc8128f61f1d08a284)(int64 x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_as_string_1_1_attrs)` [Pad](../../../../class/tensorflow/ops/pad#classtensorflow_1_1ops_1_1_pad) pre-decimal numbers to this width. | Public attributes ----------------- ### fill\_ ``` StringPiece tensorflow::ops::AsString::Attrs::fill_ = "" ``` ### precision\_ ``` int64 tensorflow::ops::AsString::Attrs::precision_ = -1 ``` ### scientific\_ ``` bool tensorflow::ops::AsString::Attrs::scientific_ = false ``` ### shortest\_ ``` bool tensorflow::ops::AsString::Attrs::shortest_ = false ``` ### width\_ ``` int64 tensorflow::ops::AsString::Attrs::width_ = -1 ``` Public functions ---------------- ### Fill ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::AsString::Attrs::Fill( StringPiece x ) ``` The value to pad if width > -1. If empty, pads with spaces. Another typical value is '0'. String cannot be longer than 1 character. Defaults to "" ### Precision ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::AsString::Attrs::Precision( int64 x ) ``` The post-decimal precision to use for floating point numbers. Only used if precision > -1. Defaults to -1 ### Scientific ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::AsString::Attrs::Scientific( bool x ) ``` Use scientific notation for floating point numbers. Defaults to false ### Shortest ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::AsString::Attrs::Shortest( bool x ) ``` Use shortest representation (either scientific or standard) for floating point numbers. Defaults to false ### Width ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::AsString::Attrs::Width( int64 x ) ``` [Pad](../../../../class/tensorflow/ops/pad#classtensorflow_1_1ops_1_1_pad) pre-decimal numbers to this width. Applies to both floating point and integer numbers. Only used if width > -1. Defaults to -1 tensorflow_cpp tensorflow::ops::ResourceApplyCenteredRMSProp::Attrs tensorflow::ops::ResourceApplyCenteredRMSProp::Attrs ==================================================== `#include <training_ops.h>` Optional attribute setters for [ResourceApplyCenteredRMSProp](../../../../class/tensorflow/ops/resource-apply-centered-r-m-s-prop#classtensorflow_1_1ops_1_1_resource_apply_centered_r_m_s_prop). Summary ------- | Public attributes | | --- | | `[use\_locking\_](#structtensorflow_1_1ops_1_1_resource_apply_centered_r_m_s_prop_1_1_attrs_1aa279f23bb57b8ba9cb353b80530b8a63) = false` | `bool` | | Public functions | | --- | | `[UseLocking](#structtensorflow_1_1ops_1_1_resource_apply_centered_r_m_s_prop_1_1_attrs_1ad768db37f38931dd5076cdd88f0d355d)(bool x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_resource_apply_centered_r_m_s_prop_1_1_attrs)` If `True`, updating of the var, mg, ms, and mom tensors is protected by a lock; otherwise the behavior is undefined, but may exhibit less contention. | Public attributes ----------------- ### use\_locking\_ ``` bool tensorflow::ops::ResourceApplyCenteredRMSProp::Attrs::use_locking_ = false ``` Public functions ---------------- ### UseLocking ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::ResourceApplyCenteredRMSProp::Attrs::UseLocking( bool x ) ``` If `True`, updating of the var, mg, ms, and mom tensors is protected by a lock; otherwise the behavior is undefined, but may exhibit less contention. Defaults to false tensorflow_cpp tensorflow::ops::BatchMatMulV2::Attrs tensorflow::ops::BatchMatMulV2::Attrs ===================================== `#include <math_ops.h>` Optional attribute setters for [BatchMatMulV2](../../../../class/tensorflow/ops/batch-mat-mul-v2#classtensorflow_1_1ops_1_1_batch_mat_mul_v2). Summary ------- | Public attributes | | --- | | `[adj\_x\_](#structtensorflow_1_1ops_1_1_batch_mat_mul_v2_1_1_attrs_1ac734ead138518d8993f0750ed9f68203) = false` | `bool` | | `[adj\_y\_](#structtensorflow_1_1ops_1_1_batch_mat_mul_v2_1_1_attrs_1aa8e6d945482a74d5747e5baea4d6ce3f) = false` | `bool` | | Public functions | | --- | | `[AdjX](#structtensorflow_1_1ops_1_1_batch_mat_mul_v2_1_1_attrs_1ad339cf39d01f492788136c3027ccdfe5)(bool x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_batch_mat_mul_v2_1_1_attrs)` If `True`, adjoint the slices of `x`. | | `[AdjY](#structtensorflow_1_1ops_1_1_batch_mat_mul_v2_1_1_attrs_1a8266000f65314a036959d0ab397256b1)(bool x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_batch_mat_mul_v2_1_1_attrs)` If `True`, adjoint the slices of `y`. | Public attributes ----------------- ### adj\_x\_ ``` bool tensorflow::ops::BatchMatMulV2::Attrs::adj_x_ = false ``` ### adj\_y\_ ``` bool tensorflow::ops::BatchMatMulV2::Attrs::adj_y_ = false ``` Public functions ---------------- ### AdjX ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::BatchMatMulV2::Attrs::AdjX( bool x ) ``` If `True`, adjoint the slices of `x`. Defaults to `False`. Defaults to false ### AdjY ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::BatchMatMulV2::Attrs::AdjY( bool x ) ``` If `True`, adjoint the slices of `y`. Defaults to `False`. Defaults to false tensorflow_cpp tensorflow::ops::ResizeBilinear::Attrs tensorflow::ops::ResizeBilinear::Attrs ====================================== `#include <image_ops.h>` Optional attribute setters for [ResizeBilinear](../../../../class/tensorflow/ops/resize-bilinear#classtensorflow_1_1ops_1_1_resize_bilinear). Summary ------- | Public attributes | | --- | | `[align\_corners\_](#structtensorflow_1_1ops_1_1_resize_bilinear_1_1_attrs_1a3246bf97e2fb66ffeb171d7cc3c07e9e) = false` | `bool` | | `[half\_pixel\_centers\_](#structtensorflow_1_1ops_1_1_resize_bilinear_1_1_attrs_1ae3f29b6dca178510ad75cc27f7e842cb) = false` | `bool` | | Public functions | | --- | | `[AlignCorners](#structtensorflow_1_1ops_1_1_resize_bilinear_1_1_attrs_1ac1bfb65a718ac0d56ad54304606879bf)(bool x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_resize_bilinear_1_1_attrs)` If true, the centers of the 4 corner pixels of the input and output tensors are aligned, preserving the values at the corner pixels. | | `[HalfPixelCenters](#structtensorflow_1_1ops_1_1_resize_bilinear_1_1_attrs_1af1bbd85d3fd8ba097508c11d125978e8)(bool x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_resize_bilinear_1_1_attrs)` Defaults to false. | Public attributes ----------------- ### align\_corners\_ ``` bool tensorflow::ops::ResizeBilinear::Attrs::align_corners_ = false ``` ### half\_pixel\_centers\_ ``` bool tensorflow::ops::ResizeBilinear::Attrs::half_pixel_centers_ = false ``` Public functions ---------------- ### AlignCorners ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::ResizeBilinear::Attrs::AlignCorners( bool x ) ``` If true, the centers of the 4 corner pixels of the input and output tensors are aligned, preserving the values at the corner pixels. Defaults to false. Defaults to false ### HalfPixelCenters ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::ResizeBilinear::Attrs::HalfPixelCenters( bool x ) ``` Defaults to false. tensorflow_cpp tensorflow::ops::ResourceApplyFtrl::Attrs tensorflow::ops::ResourceApplyFtrl::Attrs ========================================= `#include <training_ops.h>` Optional attribute setters for [ResourceApplyFtrl](../../../../class/tensorflow/ops/resource-apply-ftrl#classtensorflow_1_1ops_1_1_resource_apply_ftrl). Summary ------- | Public attributes | | --- | | `[multiply\_linear\_by\_lr\_](#structtensorflow_1_1ops_1_1_resource_apply_ftrl_1_1_attrs_1a4c4b5e530a9291693d008b762a88b575) = false` | `bool` | | `[use\_locking\_](#structtensorflow_1_1ops_1_1_resource_apply_ftrl_1_1_attrs_1a591aa915bd95e62f5736f30cb0ef136e) = false` | `bool` | | Public functions | | --- | | `[MultiplyLinearByLr](#structtensorflow_1_1ops_1_1_resource_apply_ftrl_1_1_attrs_1a96061a0f8e5f405205cbef5006b46aad)(bool x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_resource_apply_ftrl_1_1_attrs)` Defaults to false. | | `[UseLocking](#structtensorflow_1_1ops_1_1_resource_apply_ftrl_1_1_attrs_1a37a2a5438991a78fb5bd0ea0c12ebee7)(bool x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_resource_apply_ftrl_1_1_attrs)` If `True`, updating of the var and accum tensors will be protected by a lock; otherwise the behavior is undefined, but may exhibit less contention. | Public attributes ----------------- ### multiply\_linear\_by\_lr\_ ``` bool tensorflow::ops::ResourceApplyFtrl::Attrs::multiply_linear_by_lr_ = false ``` ### use\_locking\_ ``` bool tensorflow::ops::ResourceApplyFtrl::Attrs::use_locking_ = false ``` Public functions ---------------- ### MultiplyLinearByLr ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::ResourceApplyFtrl::Attrs::MultiplyLinearByLr( bool x ) ``` Defaults to false. ### UseLocking ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::ResourceApplyFtrl::Attrs::UseLocking( bool x ) ``` If `True`, updating of the var and accum tensors will be protected by a lock; otherwise the behavior is undefined, but may exhibit less contention. Defaults to false
programming_docs
tensorflow_cpp tensorflow::ops::StringSplitV2::Attrs tensorflow::ops::StringSplitV2::Attrs ===================================== `#include <string_ops.h>` Optional attribute setters for [StringSplitV2](../../../../class/tensorflow/ops/string-split-v2#classtensorflow_1_1ops_1_1_string_split_v2). Summary ------- | Public attributes | | --- | | `[maxsplit\_](#structtensorflow_1_1ops_1_1_string_split_v2_1_1_attrs_1a36cf177853552272eeef3e33f8fd9a99) = -1` | `int64` | | Public functions | | --- | | `[Maxsplit](#structtensorflow_1_1ops_1_1_string_split_v2_1_1_attrs_1a595bcbb37f8b40d8886e46304050848d)(int64 x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_string_split_v2_1_1_attrs)` An `int`. | Public attributes ----------------- ### maxsplit\_ ``` int64 tensorflow::ops::StringSplitV2::Attrs::maxsplit_ = -1 ``` Public functions ---------------- ### Maxsplit ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::StringSplitV2::Attrs::Maxsplit( int64 x ) ``` An `int`. If `maxsplit > 0`, limit of the split of the result. Defaults to -1 tensorflow_cpp tensorflow::ops::ApplyFtrlV2::Attrs tensorflow::ops::ApplyFtrlV2::Attrs =================================== `#include <training_ops.h>` Optional attribute setters for [ApplyFtrlV2](../../../../class/tensorflow/ops/apply-ftrl-v2#classtensorflow_1_1ops_1_1_apply_ftrl_v2). Summary ------- | Public attributes | | --- | | `[multiply\_linear\_by\_lr\_](#structtensorflow_1_1ops_1_1_apply_ftrl_v2_1_1_attrs_1a303aa892a6b616bab3f4109e7202b047) = false` | `bool` | | `[use\_locking\_](#structtensorflow_1_1ops_1_1_apply_ftrl_v2_1_1_attrs_1ae6ec026364f8044493a95d53b281210b) = false` | `bool` | | Public functions | | --- | | `[MultiplyLinearByLr](#structtensorflow_1_1ops_1_1_apply_ftrl_v2_1_1_attrs_1aee0f6aa307d65a63395e8fa590b6d013)(bool x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_apply_ftrl_v2_1_1_attrs)` Defaults to false. | | `[UseLocking](#structtensorflow_1_1ops_1_1_apply_ftrl_v2_1_1_attrs_1ad21e46334ae8a554025b14f303b2594f)(bool x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_apply_ftrl_v2_1_1_attrs)` If `True`, updating of the var and accum tensors will be protected by a lock; otherwise the behavior is undefined, but may exhibit less contention. | Public attributes ----------------- ### multiply\_linear\_by\_lr\_ ``` bool tensorflow::ops::ApplyFtrlV2::Attrs::multiply_linear_by_lr_ = false ``` ### use\_locking\_ ``` bool tensorflow::ops::ApplyFtrlV2::Attrs::use_locking_ = false ``` Public functions ---------------- ### MultiplyLinearByLr ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::ApplyFtrlV2::Attrs::MultiplyLinearByLr( bool x ) ``` Defaults to false. ### UseLocking ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::ApplyFtrlV2::Attrs::UseLocking( bool x ) ``` If `True`, updating of the var and accum tensors will be protected by a lock; otherwise the behavior is undefined, but may exhibit less contention. Defaults to false tensorflow_cpp tensorflow::ops::QueueClose::Attrs tensorflow::ops::QueueClose::Attrs ================================== `#include <data_flow_ops.h>` Optional attribute setters for [QueueClose](../../../../class/tensorflow/ops/queue-close#classtensorflow_1_1ops_1_1_queue_close). Summary ------- | Public attributes | | --- | | `[cancel\_pending\_enqueues\_](#structtensorflow_1_1ops_1_1_queue_close_1_1_attrs_1a4f65e814e9ccf5bb93dbc6684967079a) = false` | `bool` | | Public functions | | --- | | `[CancelPendingEnqueues](#structtensorflow_1_1ops_1_1_queue_close_1_1_attrs_1a6df78312f774a666b651320ee188550b)(bool x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_queue_close_1_1_attrs)` If true, all pending enqueue requests that are blocked on the given queue will be canceled. | Public attributes ----------------- ### cancel\_pending\_enqueues\_ ``` bool tensorflow::ops::QueueClose::Attrs::cancel_pending_enqueues_ = false ``` Public functions ---------------- ### CancelPendingEnqueues ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::QueueClose::Attrs::CancelPendingEnqueues( bool x ) ``` If true, all pending enqueue requests that are blocked on the given queue will be canceled. Defaults to false tensorflow_cpp tensorflow::ops::UnsortedSegmentJoin::Attrs tensorflow::ops::UnsortedSegmentJoin::Attrs =========================================== `#include <string_ops.h>` Optional attribute setters for [UnsortedSegmentJoin](../../../../class/tensorflow/ops/unsorted-segment-join#classtensorflow_1_1ops_1_1_unsorted_segment_join). Summary ------- | Public attributes | | --- | | `[separator\_](#structtensorflow_1_1ops_1_1_unsorted_segment_join_1_1_attrs_1aa73679fba1626751ea8bd20e07cc589e) = ""` | `StringPiece` | | Public functions | | --- | | `[Separator](#structtensorflow_1_1ops_1_1_unsorted_segment_join_1_1_attrs_1a07385be6aac97f219c154f277ff123ef)(StringPiece x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_unsorted_segment_join_1_1_attrs)` The separator to use when joining. | Public attributes ----------------- ### separator\_ ``` StringPiece tensorflow::ops::UnsortedSegmentJoin::Attrs::separator_ = "" ``` Public functions ---------------- ### Separator ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::UnsortedSegmentJoin::Attrs::Separator( StringPiece x ) ``` The separator to use when joining. Defaults to "" tensorflow_cpp tensorflow::ops::AddManySparseToTensorsMap::Attrs tensorflow::ops::AddManySparseToTensorsMap::Attrs ================================================= `#include <sparse_ops.h>` Optional attribute setters for [AddManySparseToTensorsMap](../../../../class/tensorflow/ops/add-many-sparse-to-tensors-map#classtensorflow_1_1ops_1_1_add_many_sparse_to_tensors_map). Summary ------- | Public attributes | | --- | | `[container\_](#structtensorflow_1_1ops_1_1_add_many_sparse_to_tensors_map_1_1_attrs_1a1db452d24648302257eb4e168c265232) = ""` | `StringPiece` | | `[shared\_name\_](#structtensorflow_1_1ops_1_1_add_many_sparse_to_tensors_map_1_1_attrs_1aa3a3f8bbb3418142bb90c79e1bc2e6f9) = ""` | `StringPiece` | | Public functions | | --- | | `[Container](#structtensorflow_1_1ops_1_1_add_many_sparse_to_tensors_map_1_1_attrs_1aa4cb763da8fe385ed1862d8bf7b739f9)(StringPiece x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_add_many_sparse_to_tensors_map_1_1_attrs)` The container name for the `SparseTensorsMap` created by this op. | | `[SharedName](#structtensorflow_1_1ops_1_1_add_many_sparse_to_tensors_map_1_1_attrs_1a2636bda4fd19e24e4df76df0d1e01aa3)(StringPiece x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_add_many_sparse_to_tensors_map_1_1_attrs)` The shared name for the `SparseTensorsMap` created by this op. | Public attributes ----------------- ### container\_ ``` StringPiece tensorflow::ops::AddManySparseToTensorsMap::Attrs::container_ = "" ``` ### shared\_name\_ ``` StringPiece tensorflow::ops::AddManySparseToTensorsMap::Attrs::shared_name_ = "" ``` Public functions ---------------- ### Container ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::AddManySparseToTensorsMap::Attrs::Container( StringPiece x ) ``` The container name for the `SparseTensorsMap` created by this op. Defaults to "" ### SharedName ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::AddManySparseToTensorsMap::Attrs::SharedName( StringPiece x ) ``` The shared name for the `SparseTensorsMap` created by this op. If blank, the new [Operation](../../../../class/tensorflow/operation#classtensorflow_1_1_operation)'s unique name is used. Defaults to "" tensorflow_cpp tensorflow::ops::ScatterAdd::Attrs tensorflow::ops::ScatterAdd::Attrs ================================== `#include <state_ops.h>` Optional attribute setters for [ScatterAdd](../../../../class/tensorflow/ops/scatter-add#classtensorflow_1_1ops_1_1_scatter_add). Summary ------- | Public attributes | | --- | | `[use\_locking\_](#structtensorflow_1_1ops_1_1_scatter_add_1_1_attrs_1aad7c49095dfc260fd30857a1cdd7fa2f) = false` | `bool` | | Public functions | | --- | | `[UseLocking](#structtensorflow_1_1ops_1_1_scatter_add_1_1_attrs_1acb5b8110fd98315b096b65b9fb297daa)(bool x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_scatter_add_1_1_attrs)` If True, the addition will be protected by a lock; otherwise the behavior is undefined, but may exhibit less contention. | Public attributes ----------------- ### use\_locking\_ ``` bool tensorflow::ops::ScatterAdd::Attrs::use_locking_ = false ``` Public functions ---------------- ### UseLocking ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::ScatterAdd::Attrs::UseLocking( bool x ) ``` If True, the addition will be protected by a lock; otherwise the behavior is undefined, but may exhibit less contention. Defaults to false tensorflow_cpp tensorflow::ops::ResizeArea::Attrs tensorflow::ops::ResizeArea::Attrs ================================== `#include <image_ops.h>` Optional attribute setters for [ResizeArea](../../../../class/tensorflow/ops/resize-area#classtensorflow_1_1ops_1_1_resize_area). Summary ------- | Public attributes | | --- | | `[align\_corners\_](#structtensorflow_1_1ops_1_1_resize_area_1_1_attrs_1a571d0219a2452e935fc586d6d87d5a54) = false` | `bool` | | Public functions | | --- | | `[AlignCorners](#structtensorflow_1_1ops_1_1_resize_area_1_1_attrs_1a1575e533492ddc8042cb264d7e2b37a7)(bool x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_resize_area_1_1_attrs)` If true, the centers of the 4 corner pixels of the input and output tensors are aligned, preserving the values at the corner pixels. | Public attributes ----------------- ### align\_corners\_ ``` bool tensorflow::ops::ResizeArea::Attrs::align_corners_ = false ``` Public functions ---------------- ### AlignCorners ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::ResizeArea::Attrs::AlignCorners( bool x ) ``` If true, the centers of the 4 corner pixels of the input and output tensors are aligned, preserving the values at the corner pixels. Defaults to false. Defaults to false tensorflow_cpp tensorflow::ops::GatherV2::Attrs tensorflow::ops::GatherV2::Attrs ================================ `#include <array_ops.h>` Optional attribute setters for [GatherV2](../../../../class/tensorflow/ops/gather-v2#classtensorflow_1_1ops_1_1_gather_v2). Summary ------- | Public attributes | | --- | | `[batch\_dims\_](#structtensorflow_1_1ops_1_1_gather_v2_1_1_attrs_1a707d0ba637eff2a7a5b670f2234bb168) = 0` | `int64` | | Public functions | | --- | | `[BatchDims](#structtensorflow_1_1ops_1_1_gather_v2_1_1_attrs_1a9ef4ff491d2677cbc35522efa7385031)(int64 x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_gather_v2_1_1_attrs)` Defaults to 0. | Public attributes ----------------- ### batch\_dims\_ ``` int64 tensorflow::ops::GatherV2::Attrs::batch_dims_ = 0 ``` Public functions ---------------- ### BatchDims ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::GatherV2::Attrs::BatchDims( int64 x ) ``` Defaults to 0. tensorflow_cpp tensorflow::ops::QueueDequeueMany::Attrs tensorflow::ops::QueueDequeueMany::Attrs ======================================== `#include <data_flow_ops.h>` Optional attribute setters for [QueueDequeueMany](../../../../class/tensorflow/ops/queue-dequeue-many#classtensorflow_1_1ops_1_1_queue_dequeue_many). Summary ------- | Public attributes | | --- | | `[timeout\_ms\_](#structtensorflow_1_1ops_1_1_queue_dequeue_many_1_1_attrs_1a033181f55e990c4385d5da2d8618c17c) = -1` | `int64` | | Public functions | | --- | | `[TimeoutMs](#structtensorflow_1_1ops_1_1_queue_dequeue_many_1_1_attrs_1a38b5ece5064675b620f251e764f03036)(int64 x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_queue_dequeue_many_1_1_attrs)` If the queue has fewer than n elements, this operation will block for up to timeout\_ms milliseconds. | Public attributes ----------------- ### timeout\_ms\_ ``` int64 tensorflow::ops::QueueDequeueMany::Attrs::timeout_ms_ = -1 ``` Public functions ---------------- ### TimeoutMs ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::QueueDequeueMany::Attrs::TimeoutMs( int64 x ) ``` If the queue has fewer than n elements, this operation will block for up to timeout\_ms milliseconds. Note: This option is not supported yet. Defaults to -1 tensorflow_cpp tensorflow::ops::ApproximateEqual::Attrs tensorflow::ops::ApproximateEqual::Attrs ======================================== `#include <math_ops.h>` Optional attribute setters for [ApproximateEqual](../../../../class/tensorflow/ops/approximate-equal#classtensorflow_1_1ops_1_1_approximate_equal). Summary ------- | Public attributes | | --- | | `[tolerance\_](#structtensorflow_1_1ops_1_1_approximate_equal_1_1_attrs_1afe4e052499ed69000fd03088fec5d46d) = 1e-05f` | `float` | | Public functions | | --- | | `[Tolerance](#structtensorflow_1_1ops_1_1_approximate_equal_1_1_attrs_1ad8877143ea4ad04ddf87036bef1c5eac)(float x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_approximate_equal_1_1_attrs)` Defaults to 1e-05. | Public attributes ----------------- ### tolerance\_ ``` float tensorflow::ops::ApproximateEqual::Attrs::tolerance_ = 1e-05f ``` Public functions ---------------- ### Tolerance ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::ApproximateEqual::Attrs::Tolerance( float x ) ``` Defaults to 1e-05. tensorflow_cpp tensorflow::ops::ApplyAdam::Attrs tensorflow::ops::ApplyAdam::Attrs ================================= `#include <training_ops.h>` Optional attribute setters for [ApplyAdam](../../../../class/tensorflow/ops/apply-adam#classtensorflow_1_1ops_1_1_apply_adam). Summary ------- | Public attributes | | --- | | `[use\_locking\_](#structtensorflow_1_1ops_1_1_apply_adam_1_1_attrs_1ac8731d1313e9d173653d72aa98fd469e) = false` | `bool` | | `[use\_nesterov\_](#structtensorflow_1_1ops_1_1_apply_adam_1_1_attrs_1a9d29f57b29dfb8727abe91e039b845c8) = false` | `bool` | | Public functions | | --- | | `[UseLocking](#structtensorflow_1_1ops_1_1_apply_adam_1_1_attrs_1af74bb7622434e9215eb3e7f9f0c540cd)(bool x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_apply_adam_1_1_attrs)` If `True`, updating of the var, m, and v tensors will be protected by a lock; otherwise the behavior is undefined, but may exhibit less contention. | | `[UseNesterov](#structtensorflow_1_1ops_1_1_apply_adam_1_1_attrs_1a311bb8045db468e4f40e0321a23db614)(bool x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_apply_adam_1_1_attrs)` If `True`, uses the nesterov update. | Public attributes ----------------- ### use\_locking\_ ``` bool tensorflow::ops::ApplyAdam::Attrs::use_locking_ = false ``` ### use\_nesterov\_ ``` bool tensorflow::ops::ApplyAdam::Attrs::use_nesterov_ = false ``` Public functions ---------------- ### UseLocking ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::ApplyAdam::Attrs::UseLocking( bool x ) ``` If `True`, updating of the var, m, and v tensors will be protected by a lock; otherwise the behavior is undefined, but may exhibit less contention. Defaults to false ### UseNesterov ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::ApplyAdam::Attrs::UseNesterov( bool x ) ``` If `True`, uses the nesterov update. Defaults to false tensorflow_cpp tensorflow::ops::SetDiff1D::Attrs tensorflow::ops::SetDiff1D::Attrs ================================= `#include <array_ops.h>` Optional attribute setters for [SetDiff1D](../../../../class/tensorflow/ops/set-diff1-d#classtensorflow_1_1ops_1_1_set_diff1_d). Summary ------- | Public attributes | | --- | | `[out\_idx\_](#structtensorflow_1_1ops_1_1_set_diff1_d_1_1_attrs_1a0683c36d88cd70fd4a89ea9fbde99aa4) = DT_INT32` | `DataType` | | Public functions | | --- | | `[OutIdx](#structtensorflow_1_1ops_1_1_set_diff1_d_1_1_attrs_1a8fa973f1ff78068e9d680d92702a3f0c)(DataType x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_set_diff1_d_1_1_attrs)` Defaults to DT\_INT32. | Public attributes ----------------- ### out\_idx\_ ``` DataType tensorflow::ops::SetDiff1D::Attrs::out_idx_ = DT_INT32 ``` Public functions ---------------- ### OutIdx ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::SetDiff1D::Attrs::OutIdx( DataType x ) ``` Defaults to DT\_INT32. tensorflow_cpp tensorflow::ops::ResourceApplyAdagrad::Attrs tensorflow::ops::ResourceApplyAdagrad::Attrs ============================================ `#include <training_ops.h>` Optional attribute setters for [ResourceApplyAdagrad](../../../../class/tensorflow/ops/resource-apply-adagrad#classtensorflow_1_1ops_1_1_resource_apply_adagrad). Summary ------- | Public attributes | | --- | | `[update\_slots\_](#structtensorflow_1_1ops_1_1_resource_apply_adagrad_1_1_attrs_1a091c7c346704edfe96c711004b7795de) = true` | `bool` | | `[use\_locking\_](#structtensorflow_1_1ops_1_1_resource_apply_adagrad_1_1_attrs_1a06196a468962a266212061613bd6fe10) = false` | `bool` | | Public functions | | --- | | `[UpdateSlots](#structtensorflow_1_1ops_1_1_resource_apply_adagrad_1_1_attrs_1a4012e376800a455f0827b7d2d2eab7ae)(bool x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_resource_apply_adagrad_1_1_attrs)` Defaults to true. | | `[UseLocking](#structtensorflow_1_1ops_1_1_resource_apply_adagrad_1_1_attrs_1a5af717f7f644bc422c739ef339e5126f)(bool x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_resource_apply_adagrad_1_1_attrs)` If `True`, updating of the var and accum tensors will be protected by a lock; otherwise the behavior is undefined, but may exhibit less contention. | Public attributes ----------------- ### update\_slots\_ ``` bool tensorflow::ops::ResourceApplyAdagrad::Attrs::update_slots_ = true ``` ### use\_locking\_ ``` bool tensorflow::ops::ResourceApplyAdagrad::Attrs::use_locking_ = false ``` Public functions ---------------- ### UpdateSlots ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::ResourceApplyAdagrad::Attrs::UpdateSlots( bool x ) ``` Defaults to true. ### UseLocking ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::ResourceApplyAdagrad::Attrs::UseLocking( bool x ) ``` If `True`, updating of the var and accum tensors will be protected by a lock; otherwise the behavior is undefined, but may exhibit less contention. Defaults to false tensorflow_cpp tensorflow::ops::Stack::Attrs tensorflow::ops::Stack::Attrs ============================= `#include <array_ops.h>` Optional attribute setters for [Stack](../../../../class/tensorflow/ops/stack#classtensorflow_1_1ops_1_1_stack). Summary ------- | Public attributes | | --- | | `[axis\_](#structtensorflow_1_1ops_1_1_stack_1_1_attrs_1afd902926ad3ffadddf2eb3725faf28d4) = 0` | `int64` | | Public functions | | --- | | `[Axis](#structtensorflow_1_1ops_1_1_stack_1_1_attrs_1af7e889b2ade154b3993ee7d448425cee)(int64 x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_stack_1_1_attrs)` Dimension along which to pack. | Public attributes ----------------- ### axis\_ ``` int64 tensorflow::ops::Stack::Attrs::axis_ = 0 ``` Public functions ---------------- ### Axis ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::Stack::Attrs::Axis( int64 x ) ``` Dimension along which to pack. Negative values wrap around, so the valid range is `[-(R+1), R+1)`. Defaults to 0 tensorflow_cpp tensorflow::ops::CropAndResize::Attrs tensorflow::ops::CropAndResize::Attrs ===================================== `#include <image_ops.h>` Optional attribute setters for [CropAndResize](../../../../class/tensorflow/ops/crop-and-resize#classtensorflow_1_1ops_1_1_crop_and_resize). Summary ------- | Public attributes | | --- | | `[extrapolation\_value\_](#structtensorflow_1_1ops_1_1_crop_and_resize_1_1_attrs_1a68fe7c5f9f6c6289bd4e674b31290529) = 0.0f` | `float` | | `[method\_](#structtensorflow_1_1ops_1_1_crop_and_resize_1_1_attrs_1a9b39d5075386c3c8a0678ddeb482d1d7) = "bilinear"` | `StringPiece` | | Public functions | | --- | | `[ExtrapolationValue](#structtensorflow_1_1ops_1_1_crop_and_resize_1_1_attrs_1a516eb5e4125c3e4abf0b3a4e86f492ab)(float x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_crop_and_resize_1_1_attrs)` Value used for extrapolation, when applicable. | | `[Method](#structtensorflow_1_1ops_1_1_crop_and_resize_1_1_attrs_1a2e87e7aef6ba8075918fa95259af4b6f)(StringPiece x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_crop_and_resize_1_1_attrs)` A string specifying the sampling method for resizing. | Public attributes ----------------- ### extrapolation\_value\_ ``` float tensorflow::ops::CropAndResize::Attrs::extrapolation_value_ = 0.0f ``` ### method\_ ``` StringPiece tensorflow::ops::CropAndResize::Attrs::method_ = "bilinear" ``` Public functions ---------------- ### ExtrapolationValue ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::CropAndResize::Attrs::ExtrapolationValue( float x ) ``` Value used for extrapolation, when applicable. Defaults to 0 ### Method ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::CropAndResize::Attrs::Method( StringPiece x ) ``` A string specifying the sampling method for resizing. It can be either `"bilinear"` or `"nearest"` and default to `"bilinear"`. Currently two sampling methods are supported: Bilinear and Nearest Neighbor. Defaults to "bilinear"
programming_docs
tensorflow_cpp tensorflow::ops::RandomShuffleQueue::Attrs tensorflow::ops::RandomShuffleQueue::Attrs ========================================== `#include <data_flow_ops.h>` Optional attribute setters for [RandomShuffleQueue](../../../../class/tensorflow/ops/random-shuffle-queue#classtensorflow_1_1ops_1_1_random_shuffle_queue). Summary ------- | Public attributes | | --- | | `[capacity\_](#structtensorflow_1_1ops_1_1_random_shuffle_queue_1_1_attrs_1afb83eefeee0f76422950f84b2f3fce2a) = -1` | `int64` | | `[container\_](#structtensorflow_1_1ops_1_1_random_shuffle_queue_1_1_attrs_1a39b2ecd316bb0a80de0bcd7d1b979afc) = ""` | `StringPiece` | | `[min\_after\_dequeue\_](#structtensorflow_1_1ops_1_1_random_shuffle_queue_1_1_attrs_1a0a23832b159b21ef89a692feb7b53129) = 0` | `int64` | | `[seed2\_](#structtensorflow_1_1ops_1_1_random_shuffle_queue_1_1_attrs_1a1dc3db9c6e75d898bc6783d451815636) = 0` | `int64` | | `[seed\_](#structtensorflow_1_1ops_1_1_random_shuffle_queue_1_1_attrs_1a037b739063be2c8e48a6ec3286476628) = 0` | `int64` | | `[shapes\_](#structtensorflow_1_1ops_1_1_random_shuffle_queue_1_1_attrs_1ab9ff55cf53eab01c47c6f16f65e489af) = {}` | `gtl::ArraySlice< PartialTensorShape >` | | `[shared\_name\_](#structtensorflow_1_1ops_1_1_random_shuffle_queue_1_1_attrs_1a0a6b829ef3cd365ff950779845813201) = ""` | `StringPiece` | | Public functions | | --- | | `[Capacity](#structtensorflow_1_1ops_1_1_random_shuffle_queue_1_1_attrs_1a371ea09e4f32789435cf0e4a540f4b49)(int64 x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_random_shuffle_queue_1_1_attrs)` The upper bound on the number of elements in this queue. | | `[Container](#structtensorflow_1_1ops_1_1_random_shuffle_queue_1_1_attrs_1a1c87319288cf7fa7454cc31538e352f4)(StringPiece x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_random_shuffle_queue_1_1_attrs)` If non-empty, this queue is placed in the given container. | | `[MinAfterDequeue](#structtensorflow_1_1ops_1_1_random_shuffle_queue_1_1_attrs_1a541d34de9c459848ba76c56ab1ab6906)(int64 x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_random_shuffle_queue_1_1_attrs)` Dequeue will block unless there would be this many elements after the dequeue or the queue is closed. | | `[Seed](#structtensorflow_1_1ops_1_1_random_shuffle_queue_1_1_attrs_1ac74e47deedec2bea93ff284e5665c1c2)(int64 x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_random_shuffle_queue_1_1_attrs)` If either seed or seed2 is set to be non-zero, the random number generator is seeded by the given seed. | | `[Seed2](#structtensorflow_1_1ops_1_1_random_shuffle_queue_1_1_attrs_1ad7f04429306636bee9ab53dcf93c790f)(int64 x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_random_shuffle_queue_1_1_attrs)` A second seed to avoid seed collision. | | `[Shapes](#structtensorflow_1_1ops_1_1_random_shuffle_queue_1_1_attrs_1ad059f023ca75b51a287e3c3213b0fff3)(const gtl::ArraySlice< PartialTensorShape > & x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_random_shuffle_queue_1_1_attrs)` The shape of each component in a value. | | `[SharedName](#structtensorflow_1_1ops_1_1_random_shuffle_queue_1_1_attrs_1a09a84a8491819f32042af4814345c095)(StringPiece x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_random_shuffle_queue_1_1_attrs)` If non-empty, this queue will be shared under the given name across multiple sessions. | Public attributes ----------------- ### capacity\_ ``` int64 tensorflow::ops::RandomShuffleQueue::Attrs::capacity_ = -1 ``` ### container\_ ``` StringPiece tensorflow::ops::RandomShuffleQueue::Attrs::container_ = "" ``` ### min\_after\_dequeue\_ ``` int64 tensorflow::ops::RandomShuffleQueue::Attrs::min_after_dequeue_ = 0 ``` ### seed2\_ ``` int64 tensorflow::ops::RandomShuffleQueue::Attrs::seed2_ = 0 ``` ### seed\_ ``` int64 tensorflow::ops::RandomShuffleQueue::Attrs::seed_ = 0 ``` ### shapes\_ ``` gtl::ArraySlice< PartialTensorShape > tensorflow::ops::RandomShuffleQueue::Attrs::shapes_ = {} ``` ### shared\_name\_ ``` StringPiece tensorflow::ops::RandomShuffleQueue::Attrs::shared_name_ = "" ``` Public functions ---------------- ### Capacity ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::RandomShuffleQueue::Attrs::Capacity( int64 x ) ``` The upper bound on the number of elements in this queue. Negative numbers mean no limit. Defaults to -1 ### Container ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::RandomShuffleQueue::Attrs::Container( StringPiece x ) ``` If non-empty, this queue is placed in the given container. Otherwise, a default container is used. Defaults to "" ### MinAfterDequeue ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::RandomShuffleQueue::Attrs::MinAfterDequeue( int64 x ) ``` Dequeue will block unless there would be this many elements after the dequeue or the queue is closed. This ensures a minimum level of mixing of elements. Defaults to 0 ### Seed ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::RandomShuffleQueue::Attrs::Seed( int64 x ) ``` If either seed or seed2 is set to be non-zero, the random number generator is seeded by the given seed. Otherwise, a random seed is used. Defaults to 0 ### Seed2 ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::RandomShuffleQueue::Attrs::Seed2( int64 x ) ``` A second seed to avoid seed collision. Defaults to 0 ### Shapes ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::RandomShuffleQueue::Attrs::Shapes( const gtl::ArraySlice< PartialTensorShape > & x ) ``` The shape of each component in a value. The length of this attr must be either 0 or the same as the length of component\_types. If the length of this attr is 0, the shapes of queue elements are not constrained, and only one element may be dequeued at a time. Defaults to [] ### SharedName ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::RandomShuffleQueue::Attrs::SharedName( StringPiece x ) ``` If non-empty, this queue will be shared under the given name across multiple sessions. Defaults to "" tensorflow_cpp tensorflow::ops::ScatterMax::Attrs tensorflow::ops::ScatterMax::Attrs ================================== `#include <state_ops.h>` Optional attribute setters for [ScatterMax](../../../../class/tensorflow/ops/scatter-max#classtensorflow_1_1ops_1_1_scatter_max). Summary ------- | Public attributes | | --- | | `[use\_locking\_](#structtensorflow_1_1ops_1_1_scatter_max_1_1_attrs_1ab8c350539f8f5914e88735c521e01af9) = false` | `bool` | | Public functions | | --- | | `[UseLocking](#structtensorflow_1_1ops_1_1_scatter_max_1_1_attrs_1adda0676a57e6776301392fe01a19ff7a)(bool x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_scatter_max_1_1_attrs)` If True, the update will be protected by a lock; otherwise the behavior is undefined, but may exhibit less contention. | Public attributes ----------------- ### use\_locking\_ ``` bool tensorflow::ops::ScatterMax::Attrs::use_locking_ = false ``` Public functions ---------------- ### UseLocking ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::ScatterMax::Attrs::UseLocking( bool x ) ``` If True, the update will be protected by a lock; otherwise the behavior is undefined, but may exhibit less contention. Defaults to false tensorflow_cpp tensorflow::ops::QuantizedAdd::Attrs tensorflow::ops::QuantizedAdd::Attrs ==================================== `#include <math_ops.h>` Optional attribute setters for [QuantizedAdd](../../../../class/tensorflow/ops/quantized-add#classtensorflow_1_1ops_1_1_quantized_add). Summary ------- | Public attributes | | --- | | `[Toutput\_](#structtensorflow_1_1ops_1_1_quantized_add_1_1_attrs_1a884a022e77155da621022a82bc78d889) = DT_QINT32` | `DataType` | | Public functions | | --- | | `[Toutput](#structtensorflow_1_1ops_1_1_quantized_add_1_1_attrs_1ab11cd8df5eb03c848f26646e87b47cbc)(DataType x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_quantized_add_1_1_attrs)` Defaults to DT\_QINT32. | Public attributes ----------------- ### Toutput\_ ``` DataType tensorflow::ops::QuantizedAdd::Attrs::Toutput_ = DT_QINT32 ``` Public functions ---------------- ### Toutput ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::QuantizedAdd::Attrs::Toutput( DataType x ) ``` Defaults to DT\_QINT32. tensorflow_cpp tensorflow::ops::OrderedMapUnstage::Attrs tensorflow::ops::OrderedMapUnstage::Attrs ========================================= `#include <data_flow_ops.h>` Optional attribute setters for [OrderedMapUnstage](../../../../class/tensorflow/ops/ordered-map-unstage#classtensorflow_1_1ops_1_1_ordered_map_unstage). Summary ------- | Public attributes | | --- | | `[capacity\_](#structtensorflow_1_1ops_1_1_ordered_map_unstage_1_1_attrs_1a737bde7ec1411629589e7adf550d392c) = 0` | `int64` | | `[container\_](#structtensorflow_1_1ops_1_1_ordered_map_unstage_1_1_attrs_1af5083162e187f2efbb2dd73d649849d8) = ""` | `StringPiece` | | `[memory\_limit\_](#structtensorflow_1_1ops_1_1_ordered_map_unstage_1_1_attrs_1a6192df8bf4ba6925c6260442efabda15) = 0` | `int64` | | `[shared\_name\_](#structtensorflow_1_1ops_1_1_ordered_map_unstage_1_1_attrs_1a39d1de04d2d5f904be0aaa4605446a9e) = ""` | `StringPiece` | | Public functions | | --- | | `[Capacity](#structtensorflow_1_1ops_1_1_ordered_map_unstage_1_1_attrs_1a2b4191c75a468a62abe621dbf0845164)(int64 x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_ordered_map_unstage_1_1_attrs)` Defaults to 0. | | `[Container](#structtensorflow_1_1ops_1_1_ordered_map_unstage_1_1_attrs_1a3d5ba2a5374fe1e94b107127de1e848e)(StringPiece x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_ordered_map_unstage_1_1_attrs)` Defaults to "". | | `[MemoryLimit](#structtensorflow_1_1ops_1_1_ordered_map_unstage_1_1_attrs_1a90ef0b9124d421ebe47010a92fc17e40)(int64 x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_ordered_map_unstage_1_1_attrs)` Defaults to 0. | | `[SharedName](#structtensorflow_1_1ops_1_1_ordered_map_unstage_1_1_attrs_1a4bde20e6a136c4f91927f879ab026102)(StringPiece x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_ordered_map_unstage_1_1_attrs)` Defaults to "". | Public attributes ----------------- ### capacity\_ ``` int64 tensorflow::ops::OrderedMapUnstage::Attrs::capacity_ = 0 ``` ### container\_ ``` StringPiece tensorflow::ops::OrderedMapUnstage::Attrs::container_ = "" ``` ### memory\_limit\_ ``` int64 tensorflow::ops::OrderedMapUnstage::Attrs::memory_limit_ = 0 ``` ### shared\_name\_ ``` StringPiece tensorflow::ops::OrderedMapUnstage::Attrs::shared_name_ = "" ``` Public functions ---------------- ### Capacity ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::OrderedMapUnstage::Attrs::Capacity( int64 x ) ``` Defaults to 0. ### Container ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::OrderedMapUnstage::Attrs::Container( StringPiece x ) ``` Defaults to "". ### MemoryLimit ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::OrderedMapUnstage::Attrs::MemoryLimit( int64 x ) ``` Defaults to 0. ### SharedName ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::OrderedMapUnstage::Attrs::SharedName( StringPiece x ) ``` Defaults to "". tensorflow_cpp tensorflow::ops::RecordInput::Attrs tensorflow::ops::RecordInput::Attrs =================================== `#include <data_flow_ops.h>` Optional attribute setters for [RecordInput](../../../../class/tensorflow/ops/record-input#classtensorflow_1_1ops_1_1_record_input). Summary ------- | Public attributes | | --- | | `[batch\_size\_](#structtensorflow_1_1ops_1_1_record_input_1_1_attrs_1a5e93b5c3afd9d100fa2d826b2eebc6ef) = 32` | `int64` | | `[compression\_type\_](#structtensorflow_1_1ops_1_1_record_input_1_1_attrs_1a7eed7761965f835ba1ace20d5987432e) = ""` | `StringPiece` | | `[file\_buffer\_size\_](#structtensorflow_1_1ops_1_1_record_input_1_1_attrs_1a88c16d81d3320ef5a8e8df9e88e37844) = 10000` | `int64` | | `[file\_parallelism\_](#structtensorflow_1_1ops_1_1_record_input_1_1_attrs_1a052209b9b34024362c66e051ae68b91a) = 16` | `int64` | | `[file\_random\_seed\_](#structtensorflow_1_1ops_1_1_record_input_1_1_attrs_1a4db56cae459a556a0c9e65a506e4c9c9) = 301` | `int64` | | `[file\_shuffle\_shift\_ratio\_](#structtensorflow_1_1ops_1_1_record_input_1_1_attrs_1a620f58ee4cd1533315f6518267466964) = 0.0f` | `float` | | Public functions | | --- | | `[BatchSize](#structtensorflow_1_1ops_1_1_record_input_1_1_attrs_1a9423205364b100fa34c6c9fe995851dc)(int64 x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_record_input_1_1_attrs)` The batch size. | | `[CompressionType](#structtensorflow_1_1ops_1_1_record_input_1_1_attrs_1a6e329660b38cf6032f6d96d5252405c7)(StringPiece x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_record_input_1_1_attrs)` The type of compression for the file. | | `[FileBufferSize](#structtensorflow_1_1ops_1_1_record_input_1_1_attrs_1a43601cd3b615d55ecaf9c7b59adaf9dd)(int64 x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_record_input_1_1_attrs)` The randomization shuffling buffer. | | `[FileParallelism](#structtensorflow_1_1ops_1_1_record_input_1_1_attrs_1af397048dba5fe9974fc5a5813634968d)(int64 x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_record_input_1_1_attrs)` How many sstables are opened and concurrently iterated over. | | `[FileRandomSeed](#structtensorflow_1_1ops_1_1_record_input_1_1_attrs_1a9cd39adb79d949d15fd248da85c39490)(int64 x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_record_input_1_1_attrs)` Random seeds used to produce randomized records. | | `[FileShuffleShiftRatio](#structtensorflow_1_1ops_1_1_record_input_1_1_attrs_1aae62ed429029c914a7e17373f915d5df)(float x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_record_input_1_1_attrs)` Shifts the list of files after the list is randomly shuffled. | Public attributes ----------------- ### batch\_size\_ ``` int64 tensorflow::ops::RecordInput::Attrs::batch_size_ = 32 ``` ### compression\_type\_ ``` StringPiece tensorflow::ops::RecordInput::Attrs::compression_type_ = "" ``` ### file\_buffer\_size\_ ``` int64 tensorflow::ops::RecordInput::Attrs::file_buffer_size_ = 10000 ``` ### file\_parallelism\_ ``` int64 tensorflow::ops::RecordInput::Attrs::file_parallelism_ = 16 ``` ### file\_random\_seed\_ ``` int64 tensorflow::ops::RecordInput::Attrs::file_random_seed_ = 301 ``` ### file\_shuffle\_shift\_ratio\_ ``` float tensorflow::ops::RecordInput::Attrs::file_shuffle_shift_ratio_ = 0.0f ``` Public functions ---------------- ### BatchSize ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::RecordInput::Attrs::BatchSize( int64 x ) ``` The batch size. Defaults to 32 ### CompressionType ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::RecordInput::Attrs::CompressionType( StringPiece x ) ``` The type of compression for the file. Currently ZLIB and GZIP are supported. Defaults to none. Defaults to "" ### FileBufferSize ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::RecordInput::Attrs::FileBufferSize( int64 x ) ``` The randomization shuffling buffer. Defaults to 10000 ### FileParallelism ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::RecordInput::Attrs::FileParallelism( int64 x ) ``` How many sstables are opened and concurrently iterated over. Defaults to 16 ### FileRandomSeed ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::RecordInput::Attrs::FileRandomSeed( int64 x ) ``` Random seeds used to produce randomized records. Defaults to 301 ### FileShuffleShiftRatio ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::RecordInput::Attrs::FileShuffleShiftRatio( float x ) ``` Shifts the list of files after the list is randomly shuffled. Defaults to 0 tensorflow_cpp tensorflow::ops::ResourceSparseApplyProximalAdagrad::Attrs tensorflow::ops::ResourceSparseApplyProximalAdagrad::Attrs ========================================================== `#include <training_ops.h>` Optional attribute setters for [ResourceSparseApplyProximalAdagrad](../../../../class/tensorflow/ops/resource-sparse-apply-proximal-adagrad#classtensorflow_1_1ops_1_1_resource_sparse_apply_proximal_adagrad). Summary ------- | Public attributes | | --- | | `[use\_locking\_](#structtensorflow_1_1ops_1_1_resource_sparse_apply_proximal_adagrad_1_1_attrs_1af5cc6b91830a05496963103bdbb740a3) = false` | `bool` | | Public functions | | --- | | `[UseLocking](#structtensorflow_1_1ops_1_1_resource_sparse_apply_proximal_adagrad_1_1_attrs_1ae76775d1c54dca1cb0aabb5effccc716)(bool x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_resource_sparse_apply_proximal_adagrad_1_1_attrs)` If True, updating of the var and accum tensors will be protected by a lock; otherwise the behavior is undefined, but may exhibit less contention. | Public attributes ----------------- ### use\_locking\_ ``` bool tensorflow::ops::ResourceSparseApplyProximalAdagrad::Attrs::use_locking_ = false ``` Public functions ---------------- ### UseLocking ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::ResourceSparseApplyProximalAdagrad::Attrs::UseLocking( bool x ) ``` If True, updating of the var and accum tensors will be protected by a lock; otherwise the behavior is undefined, but may exhibit less contention. Defaults to false tensorflow_cpp tensorflow::ops::BatchMatMulV3::Attrs tensorflow::ops::BatchMatMulV3::Attrs ===================================== `#include <math_ops.h>` Optional attribute setters for [BatchMatMulV3](../../../../class/tensorflow/ops/batch-mat-mul-v3#classtensorflow_1_1ops_1_1_batch_mat_mul_v3). Summary ------- | Public attributes | | --- | | `[adj\_x\_](#structtensorflow_1_1ops_1_1_batch_mat_mul_v3_1_1_attrs_1a545d5c421dd045309ffb0f02f0883966) = false` | `bool` | | `[adj\_y\_](#structtensorflow_1_1ops_1_1_batch_mat_mul_v3_1_1_attrs_1a5c5044a68a703381169489d109690d5f) = false` | `bool` | | Public functions | | --- | | `[AdjX](#structtensorflow_1_1ops_1_1_batch_mat_mul_v3_1_1_attrs_1a05b7941f75143f39a67f6883178bfda8)(bool x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_batch_mat_mul_v3_1_1_attrs)` If `True`, adjoint the slices of `x`. | | `[AdjY](#structtensorflow_1_1ops_1_1_batch_mat_mul_v3_1_1_attrs_1a82f63447bbf5be18885eac3ef6a84461)(bool x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_batch_mat_mul_v3_1_1_attrs)` If `True`, adjoint the slices of `y`. | Public attributes ----------------- ### adj\_x\_ ``` bool tensorflow::ops::BatchMatMulV3::Attrs::adj_x_ = false ``` ### adj\_y\_ ``` bool tensorflow::ops::BatchMatMulV3::Attrs::adj_y_ = false ``` Public functions ---------------- ### AdjX ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::BatchMatMulV3::Attrs::AdjX( bool x ) ``` If `True`, adjoint the slices of `x`. Defaults to `False`. Defaults to false ### AdjY ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::BatchMatMulV3::Attrs::AdjY( bool x ) ``` If `True`, adjoint the slices of `y`. Defaults to `False`. Defaults to false tensorflow_cpp tensorflow::ops::SparseReduceMaxSparse::Attrs tensorflow::ops::SparseReduceMaxSparse::Attrs ============================================= `#include <sparse_ops.h>` Optional attribute setters for [SparseReduceMaxSparse](../../../../class/tensorflow/ops/sparse-reduce-max-sparse#classtensorflow_1_1ops_1_1_sparse_reduce_max_sparse). Summary ------- | Public attributes | | --- | | `[keep\_dims\_](#structtensorflow_1_1ops_1_1_sparse_reduce_max_sparse_1_1_attrs_1a5f44da89bb2df6c91247f9ea87b51a39) = false` | `bool` | | Public functions | | --- | | `[KeepDims](#structtensorflow_1_1ops_1_1_sparse_reduce_max_sparse_1_1_attrs_1aa62d1fdad9596946ba2e6cb122c8dafa)(bool x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_sparse_reduce_max_sparse_1_1_attrs)` If true, retain reduced dimensions with length 1. | Public attributes ----------------- ### keep\_dims\_ ``` bool tensorflow::ops::SparseReduceMaxSparse::Attrs::keep_dims_ = false ``` Public functions ---------------- ### KeepDims ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::SparseReduceMaxSparse::Attrs::KeepDims( bool x ) ``` If true, retain reduced dimensions with length 1. Defaults to false
programming_docs
tensorflow_cpp tensorflow::ops::MatMul::Attrs tensorflow::ops::MatMul::Attrs ============================== `#include <math_ops.h>` Optional attribute setters for [MatMul](../../../../class/tensorflow/ops/mat-mul#classtensorflow_1_1ops_1_1_mat_mul). Summary ------- | Public attributes | | --- | | `[transpose\_a\_](#structtensorflow_1_1ops_1_1_mat_mul_1_1_attrs_1ada650ed9f122446f44732719c95a3e2c) = false` | `bool` | | `[transpose\_b\_](#structtensorflow_1_1ops_1_1_mat_mul_1_1_attrs_1a9e72214c611b504086cee05306722700) = false` | `bool` | | Public functions | | --- | | `[TransposeA](#structtensorflow_1_1ops_1_1_mat_mul_1_1_attrs_1a42e30ed144cdf5e182158fe2de403bfb)(bool x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_mat_mul_1_1_attrs)` If true, "a" is transposed before multiplication. | | `[TransposeB](#structtensorflow_1_1ops_1_1_mat_mul_1_1_attrs_1adb365fb2b5b71549abe05aee9da5843e)(bool x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_mat_mul_1_1_attrs)` If true, "b" is transposed before multiplication. | Public attributes ----------------- ### transpose\_a\_ ``` bool tensorflow::ops::MatMul::Attrs::transpose_a_ = false ``` ### transpose\_b\_ ``` bool tensorflow::ops::MatMul::Attrs::transpose_b_ = false ``` Public functions ---------------- ### TransposeA ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::MatMul::Attrs::TransposeA( bool x ) ``` If true, "a" is transposed before multiplication. Defaults to false ### TransposeB ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::MatMul::Attrs::TransposeB( bool x ) ``` If true, "b" is transposed before multiplication. Defaults to false tensorflow_cpp tensorflow::ops::Conv3DBackpropInputV2::Attrs tensorflow::ops::Conv3DBackpropInputV2::Attrs ============================================= `#include <nn_ops.h>` Optional attribute setters for [Conv3DBackpropInputV2](../../../../class/tensorflow/ops/conv3-d-backprop-input-v2#classtensorflow_1_1ops_1_1_conv3_d_backprop_input_v2). Summary ------- | Public attributes | | --- | | `[data\_format\_](#structtensorflow_1_1ops_1_1_conv3_d_backprop_input_v2_1_1_attrs_1a8d95a755c2f08dff2053f4b5d47c24e7) = "NDHWC"` | `StringPiece` | | `[dilations\_](#structtensorflow_1_1ops_1_1_conv3_d_backprop_input_v2_1_1_attrs_1a970614d4b21cae7f373eb5d541996777) = Default_dilations()` | `gtl::ArraySlice< int >` | | Public functions | | --- | | `[DataFormat](#structtensorflow_1_1ops_1_1_conv3_d_backprop_input_v2_1_1_attrs_1a651034446294b318eb1278578f55c888)(StringPiece x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_conv3_d_backprop_input_v2_1_1_attrs)` The data format of the input and output data. | | `[Dilations](#structtensorflow_1_1ops_1_1_conv3_d_backprop_input_v2_1_1_attrs_1a77ecbe76279fe0ae9c9fc9c8211a5981)(const gtl::ArraySlice< int > & x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_conv3_d_backprop_input_v2_1_1_attrs)` 1-D tensor of length 5. | Public attributes ----------------- ### data\_format\_ ``` StringPiece tensorflow::ops::Conv3DBackpropInputV2::Attrs::data_format_ = "NDHWC" ``` ### dilations\_ ``` gtl::ArraySlice< int > tensorflow::ops::Conv3DBackpropInputV2::Attrs::dilations_ = Default_dilations() ``` Public functions ---------------- ### DataFormat ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::Conv3DBackpropInputV2::Attrs::DataFormat( StringPiece x ) ``` The data format of the input and output data. With the default format "NDHWC", the data is stored in the order of: [batch, in\_depth, in\_height, in\_width, in\_channels]. Alternatively, the format could be "NCDHW", the data storage order is: [batch, in\_channels, in\_depth, in\_height, in\_width]. Defaults to "NDHWC" ### Dilations ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::Conv3DBackpropInputV2::Attrs::Dilations( const gtl::ArraySlice< int > & x ) ``` 1-D tensor of length 5. The dilation factor for each dimension of `input`. If set to k > 1, there will be k-1 skipped cells between each filter element on that dimension. The dimension order is determined by the value of `data_format`, see above for details. Dilations in the batch and depth dimensions must be 1. Defaults to [1, 1, 1, 1, 1] tensorflow_cpp tensorflow::ops::ResourceApplyAdamWithAmsgrad::Attrs tensorflow::ops::ResourceApplyAdamWithAmsgrad::Attrs ==================================================== `#include <training_ops.h>` Optional attribute setters for [ResourceApplyAdamWithAmsgrad](../../../../class/tensorflow/ops/resource-apply-adam-with-amsgrad#classtensorflow_1_1ops_1_1_resource_apply_adam_with_amsgrad). Summary ------- | Public attributes | | --- | | `[use\_locking\_](#structtensorflow_1_1ops_1_1_resource_apply_adam_with_amsgrad_1_1_attrs_1ae011a197185736393e4d6f05891deeb3) = false` | `bool` | | Public functions | | --- | | `[UseLocking](#structtensorflow_1_1ops_1_1_resource_apply_adam_with_amsgrad_1_1_attrs_1a45f9d87f4c7254c7f93c8a3b2881f489)(bool x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_resource_apply_adam_with_amsgrad_1_1_attrs)` If `True`, updating of the var, m, and v tensors will be protected by a lock; otherwise the behavior is undefined, but may exhibit less contention. | Public attributes ----------------- ### use\_locking\_ ``` bool tensorflow::ops::ResourceApplyAdamWithAmsgrad::Attrs::use_locking_ = false ``` Public functions ---------------- ### UseLocking ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::ResourceApplyAdamWithAmsgrad::Attrs::UseLocking( bool x ) ``` If `True`, updating of the var, m, and v tensors will be protected by a lock; otherwise the behavior is undefined, but may exhibit less contention. Defaults to false tensorflow_cpp tensorflow::ops::ScatterSub::Attrs tensorflow::ops::ScatterSub::Attrs ================================== `#include <state_ops.h>` Optional attribute setters for [ScatterSub](../../../../class/tensorflow/ops/scatter-sub#classtensorflow_1_1ops_1_1_scatter_sub). Summary ------- | Public attributes | | --- | | `[use\_locking\_](#structtensorflow_1_1ops_1_1_scatter_sub_1_1_attrs_1aa15343b752ff389fbf16dae358abe738) = false` | `bool` | | Public functions | | --- | | `[UseLocking](#structtensorflow_1_1ops_1_1_scatter_sub_1_1_attrs_1ae8f41f0f43034b4ef3eead8c8bea1d95)(bool x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_scatter_sub_1_1_attrs)` If True, the subtraction will be protected by a lock; otherwise the behavior is undefined, but may exhibit less contention. | Public attributes ----------------- ### use\_locking\_ ``` bool tensorflow::ops::ScatterSub::Attrs::use_locking_ = false ``` Public functions ---------------- ### UseLocking ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::ScatterSub::Attrs::UseLocking( bool x ) ``` If True, the subtraction will be protected by a lock; otherwise the behavior is undefined, but may exhibit less contention. Defaults to false tensorflow_cpp tensorflow::ops::ReduceJoin::Attrs tensorflow::ops::ReduceJoin::Attrs ================================== `#include <string_ops.h>` Optional attribute setters for [ReduceJoin](../../../../class/tensorflow/ops/reduce-join#classtensorflow_1_1ops_1_1_reduce_join). Summary ------- | Public attributes | | --- | | `[keep\_dims\_](#structtensorflow_1_1ops_1_1_reduce_join_1_1_attrs_1a66a59084a13a6c34e60e508139766811) = false` | `bool` | | `[separator\_](#structtensorflow_1_1ops_1_1_reduce_join_1_1_attrs_1ade2a0c0e567aa8291553cda9780d17fb) = ""` | `StringPiece` | | Public functions | | --- | | `[KeepDims](#structtensorflow_1_1ops_1_1_reduce_join_1_1_attrs_1a0f391c062a0b97f5d54df7b92268f68c)(bool x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_reduce_join_1_1_attrs)` If `True`, retain reduced dimensions with length `1`. | | `[Separator](#structtensorflow_1_1ops_1_1_reduce_join_1_1_attrs_1a9d76fbf57907c183bef70bba3f0f67a4)(StringPiece x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_reduce_join_1_1_attrs)` The separator to use when joining. | Public attributes ----------------- ### keep\_dims\_ ``` bool tensorflow::ops::ReduceJoin::Attrs::keep_dims_ = false ``` ### separator\_ ``` StringPiece tensorflow::ops::ReduceJoin::Attrs::separator_ = "" ``` Public functions ---------------- ### KeepDims ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::ReduceJoin::Attrs::KeepDims( bool x ) ``` If `True`, retain reduced dimensions with length `1`. Defaults to false ### Separator ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::ReduceJoin::Attrs::Separator( StringPiece x ) ``` The separator to use when joining. Defaults to "" tensorflow_cpp tensorflow::ops::NonMaxSuppression::Attrs tensorflow::ops::NonMaxSuppression::Attrs ========================================= `#include <image_ops.h>` Optional attribute setters for [NonMaxSuppression](../../../../class/tensorflow/ops/non-max-suppression#classtensorflow_1_1ops_1_1_non_max_suppression). Summary ------- | Public attributes | | --- | | `[iou\_threshold\_](#structtensorflow_1_1ops_1_1_non_max_suppression_1_1_attrs_1a6ef5d26f3aa092b550acca50049c219c) = 0.5f` | `float` | | Public functions | | --- | | `[IouThreshold](#structtensorflow_1_1ops_1_1_non_max_suppression_1_1_attrs_1aa929f93b47203077cd52f7f3af3d3a58)(float x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_non_max_suppression_1_1_attrs)` A float representing the threshold for deciding whether boxes overlap too much with respect to IOU. | Public attributes ----------------- ### iou\_threshold\_ ``` float tensorflow::ops::NonMaxSuppression::Attrs::iou_threshold_ = 0.5f ``` Public functions ---------------- ### IouThreshold ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::NonMaxSuppression::Attrs::IouThreshold( float x ) ``` A float representing the threshold for deciding whether boxes overlap too much with respect to IOU. Defaults to 0.5 tensorflow_cpp tensorflow::ops::QuantizeV2::Attrs tensorflow::ops::QuantizeV2::Attrs ================================== `#include <array_ops.h>` Optional attribute setters for [QuantizeV2](../../../../class/tensorflow/ops/quantize-v2#classtensorflow_1_1ops_1_1_quantize_v2). Summary ------- | Public attributes | | --- | | `[axis\_](#structtensorflow_1_1ops_1_1_quantize_v2_1_1_attrs_1ae9f5b29be1f64c52ea5184db06ae2130) = -1` | `int64` | | `[ensure\_minimum\_range\_](#structtensorflow_1_1ops_1_1_quantize_v2_1_1_attrs_1a117b1ce5619f8626455dd09aeacc9951) = 0.01f` | `float` | | `[mode\_](#structtensorflow_1_1ops_1_1_quantize_v2_1_1_attrs_1ab20601b9886b94ef53207b77823b692d) = "MIN_COMBINED"` | `StringPiece` | | `[narrow\_range\_](#structtensorflow_1_1ops_1_1_quantize_v2_1_1_attrs_1a47d043300e82e57a1cc66aaca8dd5de8) = false` | `bool` | | `[round\_mode\_](#structtensorflow_1_1ops_1_1_quantize_v2_1_1_attrs_1addb56b3ebcd0dfa9331d7506c05d8a47) = "HALF_AWAY_FROM_ZERO"` | `StringPiece` | | Public functions | | --- | | `[Axis](#structtensorflow_1_1ops_1_1_quantize_v2_1_1_attrs_1addef3a92617cd81a59416eba93e7afb7)(int64 x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_quantize_v2_1_1_attrs)` Defaults to -1. | | `[EnsureMinimumRange](#structtensorflow_1_1ops_1_1_quantize_v2_1_1_attrs_1a36e31baf86669cdfd75cb17f51919c0d)(float x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_quantize_v2_1_1_attrs)` Defaults to 0.01. | | `[Mode](#structtensorflow_1_1ops_1_1_quantize_v2_1_1_attrs_1a7f0adbc174ddea06f065e004f4a1f02d)(StringPiece x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_quantize_v2_1_1_attrs)` Defaults to "MIN\_COMBINED". | | `[NarrowRange](#structtensorflow_1_1ops_1_1_quantize_v2_1_1_attrs_1a0bfae591c360021497e670bf197b2fb5)(bool x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_quantize_v2_1_1_attrs)` Defaults to false. | | `[RoundMode](#structtensorflow_1_1ops_1_1_quantize_v2_1_1_attrs_1a76bb96c1bb8564f95f1a430c7df5b606)(StringPiece x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_quantize_v2_1_1_attrs)` Defaults to "HALF\_AWAY\_FROM\_ZERO". | Public attributes ----------------- ### axis\_ ``` int64 tensorflow::ops::QuantizeV2::Attrs::axis_ = -1 ``` ### ensure\_minimum\_range\_ ``` float tensorflow::ops::QuantizeV2::Attrs::ensure_minimum_range_ = 0.01f ``` ### mode\_ ``` StringPiece tensorflow::ops::QuantizeV2::Attrs::mode_ = "MIN_COMBINED" ``` ### narrow\_range\_ ``` bool tensorflow::ops::QuantizeV2::Attrs::narrow_range_ = false ``` ### round\_mode\_ ``` StringPiece tensorflow::ops::QuantizeV2::Attrs::round_mode_ = "HALF_AWAY_FROM_ZERO" ``` Public functions ---------------- ### Axis ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::QuantizeV2::Attrs::Axis( int64 x ) ``` Defaults to -1. ### EnsureMinimumRange ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::QuantizeV2::Attrs::EnsureMinimumRange( float x ) ``` Defaults to 0.01. ### Mode ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::QuantizeV2::Attrs::Mode( StringPiece x ) ``` Defaults to "MIN\_COMBINED". ### NarrowRange ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::QuantizeV2::Attrs::NarrowRange( bool x ) ``` Defaults to false. ### RoundMode ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::QuantizeV2::Attrs::RoundMode( StringPiece x ) ``` Defaults to "HALF\_AWAY\_FROM\_ZERO". tensorflow_cpp tensorflow::ops::Restore::Attrs tensorflow::ops::Restore::Attrs =============================== `#include <io_ops.h>` Optional attribute setters for [Restore](../../../../class/tensorflow/ops/restore#classtensorflow_1_1ops_1_1_restore). Summary ------- | Public attributes | | --- | | `[preferred\_shard\_](#structtensorflow_1_1ops_1_1_restore_1_1_attrs_1aba196bfd5646d4f04c9d34181d2a5a90) = -1` | `int64` | | Public functions | | --- | | `[PreferredShard](#structtensorflow_1_1ops_1_1_restore_1_1_attrs_1a1a01e09ca33fc5f4aa22450511ea876d)(int64 x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_restore_1_1_attrs)` Index of file to open first if multiple files match `file_pattern`. | Public attributes ----------------- ### preferred\_shard\_ ``` int64 tensorflow::ops::Restore::Attrs::preferred_shard_ = -1 ``` Public functions ---------------- ### PreferredShard ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::Restore::Attrs::PreferredShard( int64 x ) ``` Index of file to open first if multiple files match `file_pattern`. Defaults to -1 tensorflow_cpp tensorflow::ops::ResourceSparseApplyKerasMomentum::Attrs tensorflow::ops::ResourceSparseApplyKerasMomentum::Attrs ======================================================== `#include <training_ops.h>` Optional attribute setters for [ResourceSparseApplyKerasMomentum](../../../../class/tensorflow/ops/resource-sparse-apply-keras-momentum#classtensorflow_1_1ops_1_1_resource_sparse_apply_keras_momentum). Summary ------- | Public attributes | | --- | | `[use\_locking\_](#structtensorflow_1_1ops_1_1_resource_sparse_apply_keras_momentum_1_1_attrs_1af942b37368dcb9f480e43927a742009c) = false` | `bool` | | `[use\_nesterov\_](#structtensorflow_1_1ops_1_1_resource_sparse_apply_keras_momentum_1_1_attrs_1ad11f6bd6b9236d5fe221cc763557a0a2) = false` | `bool` | | Public functions | | --- | | `[UseLocking](#structtensorflow_1_1ops_1_1_resource_sparse_apply_keras_momentum_1_1_attrs_1a4edca02f2dc417b32e2c08ba79e73d2a)(bool x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_resource_sparse_apply_keras_momentum_1_1_attrs)` If `True`, updating of the var and accum tensors will be protected by a lock; otherwise the behavior is undefined, but may exhibit less contention. | | `[UseNesterov](#structtensorflow_1_1ops_1_1_resource_sparse_apply_keras_momentum_1_1_attrs_1a8204904aac23a8290d68a339d6708813)(bool x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_resource_sparse_apply_keras_momentum_1_1_attrs)` If `True`, the tensor passed to compute grad will be var + momentum \* accum, so in the end, the var you get is actually var + momentum \* accum. | Public attributes ----------------- ### use\_locking\_ ``` bool tensorflow::ops::ResourceSparseApplyKerasMomentum::Attrs::use_locking_ = false ``` ### use\_nesterov\_ ``` bool tensorflow::ops::ResourceSparseApplyKerasMomentum::Attrs::use_nesterov_ = false ``` Public functions ---------------- ### UseLocking ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::ResourceSparseApplyKerasMomentum::Attrs::UseLocking( bool x ) ``` If `True`, updating of the var and accum tensors will be protected by a lock; otherwise the behavior is undefined, but may exhibit less contention. Defaults to false ### UseNesterov ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::ResourceSparseApplyKerasMomentum::Attrs::UseNesterov( bool x ) ``` If `True`, the tensor passed to compute grad will be var + momentum \* accum, so in the end, the var you get is actually var + momentum \* accum. Defaults to false tensorflow_cpp tensorflow::ops::ResourceScatterNdSub::Attrs tensorflow::ops::ResourceScatterNdSub::Attrs ============================================ `#include <state_ops.h>` Optional attribute setters for [ResourceScatterNdSub](../../../../class/tensorflow/ops/resource-scatter-nd-sub#classtensorflow_1_1ops_1_1_resource_scatter_nd_sub). Summary ------- | Public attributes | | --- | | `[use\_locking\_](#structtensorflow_1_1ops_1_1_resource_scatter_nd_sub_1_1_attrs_1ad2c0b81c76212239a1d92461d561c14b) = true` | `bool` | | Public functions | | --- | | `[UseLocking](#structtensorflow_1_1ops_1_1_resource_scatter_nd_sub_1_1_attrs_1a921f9694a7ad8d37a88a1e1b1a5a9f11)(bool x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_resource_scatter_nd_sub_1_1_attrs)` An optional bool. | Public attributes ----------------- ### use\_locking\_ ``` bool tensorflow::ops::ResourceScatterNdSub::Attrs::use_locking_ = true ``` Public functions ---------------- ### UseLocking ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::ResourceScatterNdSub::Attrs::UseLocking( bool x ) ``` An optional bool. Defaults to True. If True, the assignment will be protected by a lock; otherwise the behavior is undefined, but may exhibit less contention. Defaults to true tensorflow_cpp tensorflow::ops::StringSplit::Attrs tensorflow::ops::StringSplit::Attrs =================================== `#include <string_ops.h>` Optional attribute setters for [StringSplit](../../../../class/tensorflow/ops/string-split#classtensorflow_1_1ops_1_1_string_split). Summary ------- | Public attributes | | --- | | `[skip\_empty\_](#structtensorflow_1_1ops_1_1_string_split_1_1_attrs_1a9010665ec144a8cf699c3f5d8f1549c2) = true` | `bool` | | Public functions | | --- | | `[SkipEmpty](#structtensorflow_1_1ops_1_1_string_split_1_1_attrs_1a19bac68dc56d18dd4bdaf035dec0c2af)(bool x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_string_split_1_1_attrs)` A `bool`. | Public attributes ----------------- ### skip\_empty\_ ``` bool tensorflow::ops::StringSplit::Attrs::skip_empty_ = true ``` Public functions ---------------- ### SkipEmpty ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::StringSplit::Attrs::SkipEmpty( bool x ) ``` A `bool`. If `True`, skip the empty strings from the result. Defaults to true tensorflow_cpp tensorflow::ops::AllCandidateSampler::Attrs tensorflow::ops::AllCandidateSampler::Attrs =========================================== `#include <candidate_sampling_ops.h>` Optional attribute setters for [AllCandidateSampler](../../../../class/tensorflow/ops/all-candidate-sampler#classtensorflow_1_1ops_1_1_all_candidate_sampler). Summary ------- | Public attributes | | --- | | `[seed2\_](#structtensorflow_1_1ops_1_1_all_candidate_sampler_1_1_attrs_1a106cce50bdfd551481bf8201c25b79e0) = 0` | `int64` | | `[seed\_](#structtensorflow_1_1ops_1_1_all_candidate_sampler_1_1_attrs_1ae932ae96fe5974bab81fe2fd736e1f5d) = 0` | `int64` | | Public functions | | --- | | `[Seed](#structtensorflow_1_1ops_1_1_all_candidate_sampler_1_1_attrs_1a5d1d847987b55a7f774d7ab6622371c8)(int64 x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_all_candidate_sampler_1_1_attrs)` If either seed or seed2 are set to be non-zero, the random number generator is seeded by the given seed. | | `[Seed2](#structtensorflow_1_1ops_1_1_all_candidate_sampler_1_1_attrs_1a13f740f05760bf2cf33ba9b00f163546)(int64 x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_all_candidate_sampler_1_1_attrs)` An second seed to avoid seed collision. | Public attributes ----------------- ### seed2\_ ``` int64 tensorflow::ops::AllCandidateSampler::Attrs::seed2_ = 0 ``` ### seed\_ ``` int64 tensorflow::ops::AllCandidateSampler::Attrs::seed_ = 0 ``` Public functions ---------------- ### Seed ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::AllCandidateSampler::Attrs::Seed( int64 x ) ``` If either seed or seed2 are set to be non-zero, the random number generator is seeded by the given seed. Otherwise, it is seeded by a random seed. Defaults to 0 ### Seed2 ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::AllCandidateSampler::Attrs::Seed2( int64 x ) ``` An second seed to avoid seed collision. Defaults to 0
programming_docs
tensorflow_cpp tensorflow::ops::TakeManySparseFromTensorsMap::Attrs tensorflow::ops::TakeManySparseFromTensorsMap::Attrs ==================================================== `#include <sparse_ops.h>` Optional attribute setters for [TakeManySparseFromTensorsMap](../../../../class/tensorflow/ops/take-many-sparse-from-tensors-map#classtensorflow_1_1ops_1_1_take_many_sparse_from_tensors_map). Summary ------- | Public attributes | | --- | | `[container\_](#structtensorflow_1_1ops_1_1_take_many_sparse_from_tensors_map_1_1_attrs_1a394bb209bedab9d0e13552fd9c65b74f) = ""` | `StringPiece` | | `[shared\_name\_](#structtensorflow_1_1ops_1_1_take_many_sparse_from_tensors_map_1_1_attrs_1a3280d196995bb04a061452c302a34d1e) = ""` | `StringPiece` | | Public functions | | --- | | `[Container](#structtensorflow_1_1ops_1_1_take_many_sparse_from_tensors_map_1_1_attrs_1a9ac99ae4b4795e8e882142a7b1948caa)(StringPiece x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_take_many_sparse_from_tensors_map_1_1_attrs)` The container name for the `SparseTensorsMap` read by this op. | | `[SharedName](#structtensorflow_1_1ops_1_1_take_many_sparse_from_tensors_map_1_1_attrs_1a4c4ccf4388e6b4a569c02fbd50f3f175)(StringPiece x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_take_many_sparse_from_tensors_map_1_1_attrs)` The shared name for the `SparseTensorsMap` read by this op. | Public attributes ----------------- ### container\_ ``` StringPiece tensorflow::ops::TakeManySparseFromTensorsMap::Attrs::container_ = "" ``` ### shared\_name\_ ``` StringPiece tensorflow::ops::TakeManySparseFromTensorsMap::Attrs::shared_name_ = "" ``` Public functions ---------------- ### Container ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::TakeManySparseFromTensorsMap::Attrs::Container( StringPiece x ) ``` The container name for the `SparseTensorsMap` read by this op. Defaults to "" ### SharedName ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::TakeManySparseFromTensorsMap::Attrs::SharedName( StringPiece x ) ``` The shared name for the `SparseTensorsMap` read by this op. It should not be blank; rather the `shared_name` or unique [Operation](../../../../class/tensorflow/operation#classtensorflow_1_1_operation) name of the Op that created the original `SparseTensorsMap` should be used. Defaults to "" tensorflow_cpp tensorflow::ops::ResourceSparseApplyFtrl::Attrs tensorflow::ops::ResourceSparseApplyFtrl::Attrs =============================================== `#include <training_ops.h>` Optional attribute setters for [ResourceSparseApplyFtrl](../../../../class/tensorflow/ops/resource-sparse-apply-ftrl#classtensorflow_1_1ops_1_1_resource_sparse_apply_ftrl). Summary ------- | Public attributes | | --- | | `[multiply\_linear\_by\_lr\_](#structtensorflow_1_1ops_1_1_resource_sparse_apply_ftrl_1_1_attrs_1a2f39f19e459185afc18457576ca5d0f9) = false` | `bool` | | `[use\_locking\_](#structtensorflow_1_1ops_1_1_resource_sparse_apply_ftrl_1_1_attrs_1a7ad2314993fc3353a7eb6e3e3cf279f2) = false` | `bool` | | Public functions | | --- | | `[MultiplyLinearByLr](#structtensorflow_1_1ops_1_1_resource_sparse_apply_ftrl_1_1_attrs_1a305d7a8761522061d4ef3cca29d7797c)(bool x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_resource_sparse_apply_ftrl_1_1_attrs)` Defaults to false. | | `[UseLocking](#structtensorflow_1_1ops_1_1_resource_sparse_apply_ftrl_1_1_attrs_1adba47820fbb9a489efa2dd341744ce6b)(bool x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_resource_sparse_apply_ftrl_1_1_attrs)` If `True`, updating of the var and accum tensors will be protected by a lock; otherwise the behavior is undefined, but may exhibit less contention. | Public attributes ----------------- ### multiply\_linear\_by\_lr\_ ``` bool tensorflow::ops::ResourceSparseApplyFtrl::Attrs::multiply_linear_by_lr_ = false ``` ### use\_locking\_ ``` bool tensorflow::ops::ResourceSparseApplyFtrl::Attrs::use_locking_ = false ``` Public functions ---------------- ### MultiplyLinearByLr ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::ResourceSparseApplyFtrl::Attrs::MultiplyLinearByLr( bool x ) ``` Defaults to false. ### UseLocking ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::ResourceSparseApplyFtrl::Attrs::UseLocking( bool x ) ``` If `True`, updating of the var and accum tensors will be protected by a lock; otherwise the behavior is undefined, but may exhibit less contention. Defaults to false tensorflow_cpp tensorflow::ops::Min::Attrs tensorflow::ops::Min::Attrs =========================== `#include <math_ops.h>` Optional attribute setters for [Min](../../../../class/tensorflow/ops/min#classtensorflow_1_1ops_1_1_min). Summary ------- | Public attributes | | --- | | `[keep\_dims\_](#structtensorflow_1_1ops_1_1_min_1_1_attrs_1af8dc254b5fcc570cc3d2e8d43f9ebd55) = false` | `bool` | | Public functions | | --- | | `[KeepDims](#structtensorflow_1_1ops_1_1_min_1_1_attrs_1a36f03a0e20d3592665212e7890824819)(bool x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_min_1_1_attrs)` If true, retain reduced dimensions with length 1. | Public attributes ----------------- ### keep\_dims\_ ``` bool tensorflow::ops::Min::Attrs::keep_dims_ = false ``` Public functions ---------------- ### KeepDims ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::Min::Attrs::KeepDims( bool x ) ``` If true, retain reduced dimensions with length 1. Defaults to false tensorflow_cpp tensorflow::ops::ApplyMomentum::Attrs tensorflow::ops::ApplyMomentum::Attrs ===================================== `#include <training_ops.h>` Optional attribute setters for [ApplyMomentum](../../../../class/tensorflow/ops/apply-momentum#classtensorflow_1_1ops_1_1_apply_momentum). Summary ------- | Public attributes | | --- | | `[use\_locking\_](#structtensorflow_1_1ops_1_1_apply_momentum_1_1_attrs_1ac7a1ef7431664860ed9091ad79682048) = false` | `bool` | | `[use\_nesterov\_](#structtensorflow_1_1ops_1_1_apply_momentum_1_1_attrs_1aa220959fe76edba4aee5ab6f50805015) = false` | `bool` | | Public functions | | --- | | `[UseLocking](#structtensorflow_1_1ops_1_1_apply_momentum_1_1_attrs_1aee05b419c9af98c90acb3eaf340b229f)(bool x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_apply_momentum_1_1_attrs)` If `True`, updating of the var and accum tensors will be protected by a lock; otherwise the behavior is undefined, but may exhibit less contention. | | `[UseNesterov](#structtensorflow_1_1ops_1_1_apply_momentum_1_1_attrs_1a55fbe297526f05a5ecbcad115457d913)(bool x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_apply_momentum_1_1_attrs)` If `True`, the tensor passed to compute grad will be var - lr \* momentum \* accum, so in the end, the var you get is actually var - lr \* momentum \* accum. | Public attributes ----------------- ### use\_locking\_ ``` bool tensorflow::ops::ApplyMomentum::Attrs::use_locking_ = false ``` ### use\_nesterov\_ ``` bool tensorflow::ops::ApplyMomentum::Attrs::use_nesterov_ = false ``` Public functions ---------------- ### UseLocking ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::ApplyMomentum::Attrs::UseLocking( bool x ) ``` If `True`, updating of the var and accum tensors will be protected by a lock; otherwise the behavior is undefined, but may exhibit less contention. Defaults to false ### UseNesterov ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::ApplyMomentum::Attrs::UseNesterov( bool x ) ``` If `True`, the tensor passed to compute grad will be var - lr \* momentum \* accum, so in the end, the var you get is actually var - lr \* momentum \* accum. Defaults to false tensorflow_cpp tensorflow::ops::NthElement::Attrs tensorflow::ops::NthElement::Attrs ================================== `#include <nn_ops.h>` Optional attribute setters for [NthElement](../../../../class/tensorflow/ops/nth-element#classtensorflow_1_1ops_1_1_nth_element). Summary ------- | Public attributes | | --- | | `[reverse\_](#structtensorflow_1_1ops_1_1_nth_element_1_1_attrs_1a52c83bb2ea2b8689dc3c0107711c9c9c) = false` | `bool` | | Public functions | | --- | | `[Reverse](#structtensorflow_1_1ops_1_1_nth_element_1_1_attrs_1a6fa7514afbcda87cda9c6a9b611c788e)(bool x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_nth_element_1_1_attrs)` When set to True, find the nth-largest value in the vector and vice versa. | Public attributes ----------------- ### reverse\_ ``` bool tensorflow::ops::NthElement::Attrs::reverse_ = false ``` Public functions ---------------- ### Reverse ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::NthElement::Attrs::Reverse( bool x ) ``` When set to True, find the nth-largest value in the vector and vice versa. Defaults to false tensorflow_cpp tensorflow::ops::MaxPoolGradV2::Attrs tensorflow::ops::MaxPoolGradV2::Attrs ===================================== `#include <nn_ops.h>` Optional attribute setters for [MaxPoolGradV2](../../../../class/tensorflow/ops/max-pool-grad-v2#classtensorflow_1_1ops_1_1_max_pool_grad_v2). Summary ------- | Public attributes | | --- | | `[data\_format\_](#structtensorflow_1_1ops_1_1_max_pool_grad_v2_1_1_attrs_1ab8343dfe3d6ce87274b9281275b331a6) = "NHWC"` | `StringPiece` | | Public functions | | --- | | `[DataFormat](#structtensorflow_1_1ops_1_1_max_pool_grad_v2_1_1_attrs_1ac7859d9e3a03d51509906980ac825ac2)(StringPiece x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_max_pool_grad_v2_1_1_attrs)` Specify the data format of the input and output data. | Public attributes ----------------- ### data\_format\_ ``` StringPiece tensorflow::ops::MaxPoolGradV2::Attrs::data_format_ = "NHWC" ``` Public functions ---------------- ### DataFormat ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::MaxPoolGradV2::Attrs::DataFormat( StringPiece x ) ``` Specify the data format of the input and output data. With the default format "NHWC", the data is stored in the order of: [batch, in\_height, in\_width, in\_channels]. Alternatively, the format could be "NCHW", the data storage order of: [batch, in\_channels, in\_height, in\_width]. Defaults to "NHWC" tensorflow_cpp tensorflow::ops::QuantizedResizeBilinear::Attrs tensorflow::ops::QuantizedResizeBilinear::Attrs =============================================== `#include <image_ops.h>` Optional attribute setters for [QuantizedResizeBilinear](../../../../class/tensorflow/ops/quantized-resize-bilinear#classtensorflow_1_1ops_1_1_quantized_resize_bilinear). Summary ------- | Public attributes | | --- | | `[align\_corners\_](#structtensorflow_1_1ops_1_1_quantized_resize_bilinear_1_1_attrs_1a6427dd58a531580369c3bd9572c49a3b) = false` | `bool` | | `[half\_pixel\_centers\_](#structtensorflow_1_1ops_1_1_quantized_resize_bilinear_1_1_attrs_1a0dd844b04e17cf459df4c8dd7a93fea0) = false` | `bool` | | Public functions | | --- | | `[AlignCorners](#structtensorflow_1_1ops_1_1_quantized_resize_bilinear_1_1_attrs_1a8631df7dd3ae2671e0b1a3049c61ce8b)(bool x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_quantized_resize_bilinear_1_1_attrs)` If true, the centers of the 4 corner pixels of the input and output tensors are aligned, preserving the values at the corner pixels. | | `[HalfPixelCenters](#structtensorflow_1_1ops_1_1_quantized_resize_bilinear_1_1_attrs_1a3bfb77dd2c94a1eead885f9524df2abc)(bool x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_quantized_resize_bilinear_1_1_attrs)` Defaults to false. | Public attributes ----------------- ### align\_corners\_ ``` bool tensorflow::ops::QuantizedResizeBilinear::Attrs::align_corners_ = false ``` ### half\_pixel\_centers\_ ``` bool tensorflow::ops::QuantizedResizeBilinear::Attrs::half_pixel_centers_ = false ``` Public functions ---------------- ### AlignCorners ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::QuantizedResizeBilinear::Attrs::AlignCorners( bool x ) ``` If true, the centers of the 4 corner pixels of the input and output tensors are aligned, preserving the values at the corner pixels. Defaults to false. Defaults to false ### HalfPixelCenters ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::QuantizedResizeBilinear::Attrs::HalfPixelCenters( bool x ) ``` Defaults to false. tensorflow_cpp tensorflow::ops::ResourceScatterNdMax::Attrs tensorflow::ops::ResourceScatterNdMax::Attrs ============================================ `#include <state_ops.h>` Optional attribute setters for [ResourceScatterNdMax](../../../../class/tensorflow/ops/resource-scatter-nd-max#classtensorflow_1_1ops_1_1_resource_scatter_nd_max). Summary ------- | Public attributes | | --- | | `[use\_locking\_](#structtensorflow_1_1ops_1_1_resource_scatter_nd_max_1_1_attrs_1abdfb6ef25fa70c756cada1373ad64f8b) = true` | `bool` | | Public functions | | --- | | `[UseLocking](#structtensorflow_1_1ops_1_1_resource_scatter_nd_max_1_1_attrs_1a397d95c49759fb517d4d77e334838fc6)(bool x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_resource_scatter_nd_max_1_1_attrs)` An optional bool. | Public attributes ----------------- ### use\_locking\_ ``` bool tensorflow::ops::ResourceScatterNdMax::Attrs::use_locking_ = true ``` Public functions ---------------- ### UseLocking ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::ResourceScatterNdMax::Attrs::UseLocking( bool x ) ``` An optional bool. Defaults to True. If True, the assignment will be protected by a lock; otherwise the behavior is undefined, but may exhibit less contention. Defaults to true tensorflow_cpp tensorflow::ops::SampleDistortedBoundingBox::Attrs tensorflow::ops::SampleDistortedBoundingBox::Attrs ================================================== `#include <image_ops.h>` Optional attribute setters for [SampleDistortedBoundingBox](../../../../class/tensorflow/ops/sample-distorted-bounding-box#classtensorflow_1_1ops_1_1_sample_distorted_bounding_box). Summary ------- | Public attributes | | --- | | `[area\_range\_](#structtensorflow_1_1ops_1_1_sample_distorted_bounding_box_1_1_attrs_1a10fa9ed4bcc56bf19d120a96314d459f) = Default_area_range()` | `gtl::ArraySlice< float >` | | `[aspect\_ratio\_range\_](#structtensorflow_1_1ops_1_1_sample_distorted_bounding_box_1_1_attrs_1a5f94da07d6c4a62a9b3cbd0d6dde8e90) = Default_aspect_ratio_range()` | `gtl::ArraySlice< float >` | | `[max\_attempts\_](#structtensorflow_1_1ops_1_1_sample_distorted_bounding_box_1_1_attrs_1a1837a276fcc1de5e7b55d07d858b5f07) = 100` | `int64` | | `[min\_object\_covered\_](#structtensorflow_1_1ops_1_1_sample_distorted_bounding_box_1_1_attrs_1a77c354b0dea4c72fd36240d38597d6cd) = 0.1f` | `float` | | `[seed2\_](#structtensorflow_1_1ops_1_1_sample_distorted_bounding_box_1_1_attrs_1a23a9b203d607b14cb185c5b6673a4d68) = 0` | `int64` | | `[seed\_](#structtensorflow_1_1ops_1_1_sample_distorted_bounding_box_1_1_attrs_1acbf4b2d65cb72b4194d1b019b1dd5f55) = 0` | `int64` | | `[use\_image\_if\_no\_bounding\_boxes\_](#structtensorflow_1_1ops_1_1_sample_distorted_bounding_box_1_1_attrs_1a47ec3773a7ebbb2de5f98e480b6ec441) = false` | `bool` | | Public functions | | --- | | `[AreaRange](#structtensorflow_1_1ops_1_1_sample_distorted_bounding_box_1_1_attrs_1a257ad0daeac9027e5d07969fbbadaaf9)(const gtl::ArraySlice< float > & x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_sample_distorted_bounding_box_1_1_attrs)` The cropped area of the image must contain a fraction of the supplied image within this range. | | `[AspectRatioRange](#structtensorflow_1_1ops_1_1_sample_distorted_bounding_box_1_1_attrs_1abd0d9435fb51a57125f07b7c1e62e044)(const gtl::ArraySlice< float > & x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_sample_distorted_bounding_box_1_1_attrs)` The cropped area of the image must have an aspect ratio = width / height within this range. | | `[MaxAttempts](#structtensorflow_1_1ops_1_1_sample_distorted_bounding_box_1_1_attrs_1a034b461ec785997b27dfc07d1564cff6)(int64 x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_sample_distorted_bounding_box_1_1_attrs)` Number of attempts at generating a cropped region of the image of the specified constraints. | | `[MinObjectCovered](#structtensorflow_1_1ops_1_1_sample_distorted_bounding_box_1_1_attrs_1afac93755afa1a142f5b274e1865e6383)(float x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_sample_distorted_bounding_box_1_1_attrs)` The cropped area of the image must contain at least this fraction of any bounding box supplied. | | `[Seed](#structtensorflow_1_1ops_1_1_sample_distorted_bounding_box_1_1_attrs_1a8b49b8d1dd2eba77f1e133a8a632aa9e)(int64 x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_sample_distorted_bounding_box_1_1_attrs)` If either `seed` or `seed2` are set to non-zero, the random number generator is seeded by the given `seed`. | | `[Seed2](#structtensorflow_1_1ops_1_1_sample_distorted_bounding_box_1_1_attrs_1aa93767e1d93eddea4f1df2d1936a1a7e)(int64 x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_sample_distorted_bounding_box_1_1_attrs)` A second seed to avoid seed collision. | | `[UseImageIfNoBoundingBoxes](#structtensorflow_1_1ops_1_1_sample_distorted_bounding_box_1_1_attrs_1a8ee810c28bbcf6321174142224218bc9)(bool x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_sample_distorted_bounding_box_1_1_attrs)` Controls behavior if no bounding boxes supplied. | Public attributes ----------------- ### area\_range\_ ``` gtl::ArraySlice< float > tensorflow::ops::SampleDistortedBoundingBox::Attrs::area_range_ = Default_area_range() ``` ### aspect\_ratio\_range\_ ``` gtl::ArraySlice< float > tensorflow::ops::SampleDistortedBoundingBox::Attrs::aspect_ratio_range_ = Default_aspect_ratio_range() ``` ### max\_attempts\_ ``` int64 tensorflow::ops::SampleDistortedBoundingBox::Attrs::max_attempts_ = 100 ``` ### min\_object\_covered\_ ``` float tensorflow::ops::SampleDistortedBoundingBox::Attrs::min_object_covered_ = 0.1f ``` ### seed2\_ ``` int64 tensorflow::ops::SampleDistortedBoundingBox::Attrs::seed2_ = 0 ``` ### seed\_ ``` int64 tensorflow::ops::SampleDistortedBoundingBox::Attrs::seed_ = 0 ``` ### use\_image\_if\_no\_bounding\_boxes\_ ``` bool tensorflow::ops::SampleDistortedBoundingBox::Attrs::use_image_if_no_bounding_boxes_ = false ``` Public functions ---------------- ### AreaRange ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::SampleDistortedBoundingBox::Attrs::AreaRange( const gtl::ArraySlice< float > & x ) ``` The cropped area of the image must contain a fraction of the supplied image within this range. Defaults to [0.05, 1] ### AspectRatioRange ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::SampleDistortedBoundingBox::Attrs::AspectRatioRange( const gtl::ArraySlice< float > & x ) ``` The cropped area of the image must have an aspect ratio = width / height within this range. Defaults to [0.75, 1.33] ### MaxAttempts ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::SampleDistortedBoundingBox::Attrs::MaxAttempts( int64 x ) ``` Number of attempts at generating a cropped region of the image of the specified constraints. After `max_attempts` failures, return the entire image. Defaults to 100 ### MinObjectCovered ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::SampleDistortedBoundingBox::Attrs::MinObjectCovered( float x ) ``` The cropped area of the image must contain at least this fraction of any bounding box supplied. The value of this parameter should be non-negative. In the case of 0, the cropped area does not need to overlap any of the bounding boxes supplied. Defaults to 0.1 ### Seed ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::SampleDistortedBoundingBox::Attrs::Seed( int64 x ) ``` If either `seed` or `seed2` are set to non-zero, the random number generator is seeded by the given `seed`. Otherwise, it is seeded by a random seed. Defaults to 0 ### Seed2 ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::SampleDistortedBoundingBox::Attrs::Seed2( int64 x ) ``` A second seed to avoid seed collision. Defaults to 0 ### UseImageIfNoBoundingBoxes ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::SampleDistortedBoundingBox::Attrs::UseImageIfNoBoundingBoxes( bool x ) ``` Controls behavior if no bounding boxes supplied. If true, assume an implicit bounding box covering the whole input. If false, raise an error. Defaults to false
programming_docs
tensorflow_cpp tensorflow::ops::ArgMax::Attrs tensorflow::ops::ArgMax::Attrs ============================== `#include <math_ops.h>` Optional attribute setters for [ArgMax](../../../../class/tensorflow/ops/arg-max#classtensorflow_1_1ops_1_1_arg_max). Summary ------- | Public attributes | | --- | | `[output\_type\_](#structtensorflow_1_1ops_1_1_arg_max_1_1_attrs_1aa0f5dc123c2fb5f528a34ff3c6a52e5c) = DT_INT64` | `DataType` | | Public functions | | --- | | `[OutputType](#structtensorflow_1_1ops_1_1_arg_max_1_1_attrs_1acc4b21fbfb4825556649b2fbd61c866c)(DataType x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_arg_max_1_1_attrs)` Defaults to DT\_INT64. | Public attributes ----------------- ### output\_type\_ ``` DataType tensorflow::ops::ArgMax::Attrs::output_type_ = DT_INT64 ``` Public functions ---------------- ### OutputType ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::ArgMax::Attrs::OutputType( DataType x ) ``` Defaults to DT\_INT64. tensorflow_cpp tensorflow::ops::EncodePng::Attrs tensorflow::ops::EncodePng::Attrs ================================= `#include <image_ops.h>` Optional attribute setters for [EncodePng](../../../../class/tensorflow/ops/encode-png#classtensorflow_1_1ops_1_1_encode_png). Summary ------- | Public attributes | | --- | | `[compression\_](#structtensorflow_1_1ops_1_1_encode_png_1_1_attrs_1aeee9d1774127b1a08c7ba11e7f957707) = -1` | `int64` | | Public functions | | --- | | `[Compression](#structtensorflow_1_1ops_1_1_encode_png_1_1_attrs_1a41f48d64661771f29f889cb7c45f64b5)(int64 x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_encode_png_1_1_attrs)` Compression level. | Public attributes ----------------- ### compression\_ ``` int64 tensorflow::ops::EncodePng::Attrs::compression_ = -1 ``` Public functions ---------------- ### Compression ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::EncodePng::Attrs::Compression( int64 x ) ``` Compression level. Defaults to -1 tensorflow_cpp tensorflow::ops::ResourceSparseApplyAdadelta::Attrs tensorflow::ops::ResourceSparseApplyAdadelta::Attrs =================================================== `#include <training_ops.h>` Optional attribute setters for [ResourceSparseApplyAdadelta](../../../../class/tensorflow/ops/resource-sparse-apply-adadelta#classtensorflow_1_1ops_1_1_resource_sparse_apply_adadelta). Summary ------- | Public attributes | | --- | | `[use\_locking\_](#structtensorflow_1_1ops_1_1_resource_sparse_apply_adadelta_1_1_attrs_1aefaa0cc062bf54b8b085042fcdd22af7) = false` | `bool` | | Public functions | | --- | | `[UseLocking](#structtensorflow_1_1ops_1_1_resource_sparse_apply_adadelta_1_1_attrs_1adb44a3118dd9f1b31e8ac6f09746dd52)(bool x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_resource_sparse_apply_adadelta_1_1_attrs)` If True, updating of the var and accum tensors will be protected by a lock; otherwise the behavior is undefined, but may exhibit less contention. | Public attributes ----------------- ### use\_locking\_ ``` bool tensorflow::ops::ResourceSparseApplyAdadelta::Attrs::use_locking_ = false ``` Public functions ---------------- ### UseLocking ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::ResourceSparseApplyAdadelta::Attrs::UseLocking( bool x ) ``` If True, updating of the var and accum tensors will be protected by a lock; otherwise the behavior is undefined, but may exhibit less contention. Defaults to false tensorflow_cpp tensorflow::ops::QuantizedRelu::Attrs tensorflow::ops::QuantizedRelu::Attrs ===================================== `#include <nn_ops.h>` Optional attribute setters for [QuantizedRelu](../../../../class/tensorflow/ops/quantized-relu#classtensorflow_1_1ops_1_1_quantized_relu). Summary ------- | Public attributes | | --- | | `[out\_type\_](#structtensorflow_1_1ops_1_1_quantized_relu_1_1_attrs_1a7484181a4dd2e6b0a2a3b45eb229f07f) = DT_QUINT8` | `DataType` | | Public functions | | --- | | `[OutType](#structtensorflow_1_1ops_1_1_quantized_relu_1_1_attrs_1a741d77fdab030edb91be5f7cd8e2c23b)(DataType x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_quantized_relu_1_1_attrs)` Defaults to DT\_QUINT8. | Public attributes ----------------- ### out\_type\_ ``` DataType tensorflow::ops::QuantizedRelu::Attrs::out_type_ = DT_QUINT8 ``` Public functions ---------------- ### OutType ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::QuantizedRelu::Attrs::OutType( DataType x ) ``` Defaults to DT\_QUINT8. tensorflow_cpp tensorflow::ops::ResourceScatterNdAdd::Attrs tensorflow::ops::ResourceScatterNdAdd::Attrs ============================================ `#include <state_ops.h>` Optional attribute setters for [ResourceScatterNdAdd](../../../../class/tensorflow/ops/resource-scatter-nd-add#classtensorflow_1_1ops_1_1_resource_scatter_nd_add). Summary ------- | Public attributes | | --- | | `[use\_locking\_](#structtensorflow_1_1ops_1_1_resource_scatter_nd_add_1_1_attrs_1abf4a3cd91ada4a52799cda0c5de185af) = true` | `bool` | | Public functions | | --- | | `[UseLocking](#structtensorflow_1_1ops_1_1_resource_scatter_nd_add_1_1_attrs_1a681453ca35d48ad093b91296f178edd2)(bool x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_resource_scatter_nd_add_1_1_attrs)` An optional bool. | Public attributes ----------------- ### use\_locking\_ ``` bool tensorflow::ops::ResourceScatterNdAdd::Attrs::use_locking_ = true ``` Public functions ---------------- ### UseLocking ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::ResourceScatterNdAdd::Attrs::UseLocking( bool x ) ``` An optional bool. Defaults to True. If True, the assignment will be protected by a lock; otherwise the behavior is undefined, but may exhibit less contention. Defaults to true tensorflow_cpp tensorflow::ops::ParseSingleSequenceExample::Attrs tensorflow::ops::ParseSingleSequenceExample::Attrs ================================================== `#include <parsing_ops.h>` Optional attribute setters for [ParseSingleSequenceExample](../../../../class/tensorflow/ops/parse-single-sequence-example#classtensorflow_1_1ops_1_1_parse_single_sequence_example). Summary ------- | Public attributes | | --- | | `[context\_dense\_shapes\_](#structtensorflow_1_1ops_1_1_parse_single_sequence_example_1_1_attrs_1aad6cf7ae31b934dfd2dc13eb9a0746b1) = {}` | `gtl::ArraySlice< PartialTensorShape >` | | `[context\_sparse\_types\_](#structtensorflow_1_1ops_1_1_parse_single_sequence_example_1_1_attrs_1ab4cc9eb58ab4b73d4baa2ee7721925d3) = {}` | `DataTypeSlice` | | `[feature\_list\_dense\_shapes\_](#structtensorflow_1_1ops_1_1_parse_single_sequence_example_1_1_attrs_1ac0462913f68045800f9892d642a142db) = {}` | `gtl::ArraySlice< PartialTensorShape >` | | `[feature\_list\_dense\_types\_](#structtensorflow_1_1ops_1_1_parse_single_sequence_example_1_1_attrs_1a09b0af32b56ac1f1b3907fa5fa67383d) = {}` | `DataTypeSlice` | | `[feature\_list\_sparse\_types\_](#structtensorflow_1_1ops_1_1_parse_single_sequence_example_1_1_attrs_1a60f5d2f4edbff448927f6455c2593173) = {}` | `DataTypeSlice` | | Public functions | | --- | | `[ContextDenseShapes](#structtensorflow_1_1ops_1_1_parse_single_sequence_example_1_1_attrs_1a9f211888be3f7b9599c57a531ef7cbeb)(const gtl::ArraySlice< PartialTensorShape > & x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_parse_single_sequence_example_1_1_attrs)` A list of Ncontext\_dense shapes; the shapes of data in each context Feature given in context\_dense\_keys. | | `[ContextSparseTypes](#structtensorflow_1_1ops_1_1_parse_single_sequence_example_1_1_attrs_1a02578158d61d785ebfbaa3f88d570ca2)(const DataTypeSlice & x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_parse_single_sequence_example_1_1_attrs)` A list of Ncontext\_sparse types; the data types of data in each context Feature given in context\_sparse\_keys. | | `[FeatureListDenseShapes](#structtensorflow_1_1ops_1_1_parse_single_sequence_example_1_1_attrs_1a6d40ff38a7db6e3596d5fba41580a664)(const gtl::ArraySlice< PartialTensorShape > & x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_parse_single_sequence_example_1_1_attrs)` A list of Nfeature\_list\_dense shapes; the shapes of data in each FeatureList given in feature\_list\_dense\_keys. | | `[FeatureListDenseTypes](#structtensorflow_1_1ops_1_1_parse_single_sequence_example_1_1_attrs_1ad2db3e1309899be6fbf45b1182c38df5)(const DataTypeSlice & x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_parse_single_sequence_example_1_1_attrs)` Defaults to []. | | `[FeatureListSparseTypes](#structtensorflow_1_1ops_1_1_parse_single_sequence_example_1_1_attrs_1a0cff011782eef4d4792b5254c0390b36)(const DataTypeSlice & x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_parse_single_sequence_example_1_1_attrs)` A list of Nfeature\_list\_sparse types; the data types of data in each FeatureList given in feature\_list\_sparse\_keys. | Public attributes ----------------- ### context\_dense\_shapes\_ ``` gtl::ArraySlice< PartialTensorShape > tensorflow::ops::ParseSingleSequenceExample::Attrs::context_dense_shapes_ = {} ``` ### context\_sparse\_types\_ ``` DataTypeSlice tensorflow::ops::ParseSingleSequenceExample::Attrs::context_sparse_types_ = {} ``` ### feature\_list\_dense\_shapes\_ ``` gtl::ArraySlice< PartialTensorShape > tensorflow::ops::ParseSingleSequenceExample::Attrs::feature_list_dense_shapes_ = {} ``` ### feature\_list\_dense\_types\_ ``` DataTypeSlice tensorflow::ops::ParseSingleSequenceExample::Attrs::feature_list_dense_types_ = {} ``` ### feature\_list\_sparse\_types\_ ``` DataTypeSlice tensorflow::ops::ParseSingleSequenceExample::Attrs::feature_list_sparse_types_ = {} ``` Public functions ---------------- ### ContextDenseShapes ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::ParseSingleSequenceExample::Attrs::ContextDenseShapes( const gtl::ArraySlice< PartialTensorShape > & x ) ``` A list of Ncontext\_dense shapes; the shapes of data in each context Feature given in context\_dense\_keys. The number of elements in the Feature corresponding to context\_dense\_key[j] must always equal context\_dense\_shapes[j].NumEntries(). The shape of context\_dense\_values[j] will match context\_dense\_shapes[j]. Defaults to [] ### ContextSparseTypes ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::ParseSingleSequenceExample::Attrs::ContextSparseTypes( const DataTypeSlice & x ) ``` A list of Ncontext\_sparse types; the data types of data in each context Feature given in context\_sparse\_keys. Currently the [ParseSingleSequenceExample](../../../../class/tensorflow/ops/parse-single-sequence-example#classtensorflow_1_1ops_1_1_parse_single_sequence_example) supports DT\_FLOAT (FloatList), DT\_INT64 (Int64List), and DT\_STRING (BytesList). Defaults to [] ### FeatureListDenseShapes ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::ParseSingleSequenceExample::Attrs::FeatureListDenseShapes( const gtl::ArraySlice< PartialTensorShape > & x ) ``` A list of Nfeature\_list\_dense shapes; the shapes of data in each FeatureList given in feature\_list\_dense\_keys. The shape of each Feature in the FeatureList corresponding to feature\_list\_dense\_key[j] must always equal feature\_list\_dense\_shapes[j].NumEntries(). Defaults to [] ### FeatureListDenseTypes ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::ParseSingleSequenceExample::Attrs::FeatureListDenseTypes( const DataTypeSlice & x ) ``` Defaults to []. ### FeatureListSparseTypes ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::ParseSingleSequenceExample::Attrs::FeatureListSparseTypes( const DataTypeSlice & x ) ``` A list of Nfeature\_list\_sparse types; the data types of data in each FeatureList given in feature\_list\_sparse\_keys. Currently the [ParseSingleSequenceExample](../../../../class/tensorflow/ops/parse-single-sequence-example#classtensorflow_1_1ops_1_1_parse_single_sequence_example) supports DT\_FLOAT (FloatList), DT\_INT64 (Int64List), and DT\_STRING (BytesList). Defaults to [] tensorflow_cpp tensorflow::ops::SparseApplyFtrlV2::Attrs tensorflow::ops::SparseApplyFtrlV2::Attrs ========================================= `#include <training_ops.h>` Optional attribute setters for [SparseApplyFtrlV2](../../../../class/tensorflow/ops/sparse-apply-ftrl-v2#classtensorflow_1_1ops_1_1_sparse_apply_ftrl_v2). Summary ------- | Public attributes | | --- | | `[multiply\_linear\_by\_lr\_](#structtensorflow_1_1ops_1_1_sparse_apply_ftrl_v2_1_1_attrs_1abc1195b5da72d132f10628c1073382a2) = false` | `bool` | | `[use\_locking\_](#structtensorflow_1_1ops_1_1_sparse_apply_ftrl_v2_1_1_attrs_1aea562467c3673519befeab1f5d6952f4) = false` | `bool` | | Public functions | | --- | | `[MultiplyLinearByLr](#structtensorflow_1_1ops_1_1_sparse_apply_ftrl_v2_1_1_attrs_1a6bb95ba69d65115484f72b1a7b8bb8cf)(bool x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_sparse_apply_ftrl_v2_1_1_attrs)` Defaults to false. | | `[UseLocking](#structtensorflow_1_1ops_1_1_sparse_apply_ftrl_v2_1_1_attrs_1afdb3ab039eeb7f246d74014948325f6e)(bool x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_sparse_apply_ftrl_v2_1_1_attrs)` If `True`, updating of the var and accum tensors will be protected by a lock; otherwise the behavior is undefined, but may exhibit less contention. | Public attributes ----------------- ### multiply\_linear\_by\_lr\_ ``` bool tensorflow::ops::SparseApplyFtrlV2::Attrs::multiply_linear_by_lr_ = false ``` ### use\_locking\_ ``` bool tensorflow::ops::SparseApplyFtrlV2::Attrs::use_locking_ = false ``` Public functions ---------------- ### MultiplyLinearByLr ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::SparseApplyFtrlV2::Attrs::MultiplyLinearByLr( bool x ) ``` Defaults to false. ### UseLocking ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::SparseApplyFtrlV2::Attrs::UseLocking( bool x ) ``` If `True`, updating of the var and accum tensors will be protected by a lock; otherwise the behavior is undefined, but may exhibit less contention. Defaults to false tensorflow_cpp tensorflow::ops::MaxPool3DGrad::Attrs tensorflow::ops::MaxPool3DGrad::Attrs ===================================== `#include <nn_ops.h>` Optional attribute setters for [MaxPool3DGrad](../../../../class/tensorflow/ops/max-pool3-d-grad#classtensorflow_1_1ops_1_1_max_pool3_d_grad). Summary ------- | Public attributes | | --- | | `[data\_format\_](#structtensorflow_1_1ops_1_1_max_pool3_d_grad_1_1_attrs_1aad748619a4742756af6b27ddeb112069) = "NDHWC"` | `StringPiece` | | Public functions | | --- | | `[DataFormat](#structtensorflow_1_1ops_1_1_max_pool3_d_grad_1_1_attrs_1a42318cd876ee670ed0e68eb2c0414b97)(StringPiece x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_max_pool3_d_grad_1_1_attrs)` The data format of the input and output data. | Public attributes ----------------- ### data\_format\_ ``` StringPiece tensorflow::ops::MaxPool3DGrad::Attrs::data_format_ = "NDHWC" ``` Public functions ---------------- ### DataFormat ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::MaxPool3DGrad::Attrs::DataFormat( StringPiece x ) ``` The data format of the input and output data. With the default format "NDHWC", the data is stored in the order of: [batch, in\_depth, in\_height, in\_width, in\_channels]. Alternatively, the format could be "NCDHW", the data storage order is: [batch, in\_channels, in\_depth, in\_height, in\_width]. Defaults to "NDHWC" tensorflow_cpp tensorflow::ops::ResourceSparseApplyRMSProp::Attrs tensorflow::ops::ResourceSparseApplyRMSProp::Attrs ================================================== `#include <training_ops.h>` Optional attribute setters for [ResourceSparseApplyRMSProp](../../../../class/tensorflow/ops/resource-sparse-apply-r-m-s-prop#classtensorflow_1_1ops_1_1_resource_sparse_apply_r_m_s_prop). Summary ------- | Public attributes | | --- | | `[use\_locking\_](#structtensorflow_1_1ops_1_1_resource_sparse_apply_r_m_s_prop_1_1_attrs_1a007316ea67efc8009f36a6eb7007e1cf) = false` | `bool` | | Public functions | | --- | | `[UseLocking](#structtensorflow_1_1ops_1_1_resource_sparse_apply_r_m_s_prop_1_1_attrs_1a086b51894e65817af3c7af2d92ba9115)(bool x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_resource_sparse_apply_r_m_s_prop_1_1_attrs)` If `True`, updating of the var, ms, and mom tensors is protected by a lock; otherwise the behavior is undefined, but may exhibit less contention. | Public attributes ----------------- ### use\_locking\_ ``` bool tensorflow::ops::ResourceSparseApplyRMSProp::Attrs::use_locking_ = false ``` Public functions ---------------- ### UseLocking ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::ResourceSparseApplyRMSProp::Attrs::UseLocking( bool x ) ``` If `True`, updating of the var, ms, and mom tensors is protected by a lock; otherwise the behavior is undefined, but may exhibit less contention. Defaults to false tensorflow_cpp tensorflow::ops::QuantizedInstanceNorm::Attrs tensorflow::ops::QuantizedInstanceNorm::Attrs ============================================= `#include <array_ops.h>` Optional attribute setters for [QuantizedInstanceNorm](../../../../class/tensorflow/ops/quantized-instance-norm#classtensorflow_1_1ops_1_1_quantized_instance_norm). Summary ------- | Public attributes | | --- | | `[given\_y\_max\_](#structtensorflow_1_1ops_1_1_quantized_instance_norm_1_1_attrs_1a143f0f1661df75a9345104b53d2a23a1) = 0.0f` | `float` | | `[given\_y\_min\_](#structtensorflow_1_1ops_1_1_quantized_instance_norm_1_1_attrs_1a66a475c41d1d5351475d1b41f4c722b9) = 0.0f` | `float` | | `[min\_separation\_](#structtensorflow_1_1ops_1_1_quantized_instance_norm_1_1_attrs_1a02e61831bb492f7e82ab72cfdd164bcd) = 0.001f` | `float` | | `[output\_range\_given\_](#structtensorflow_1_1ops_1_1_quantized_instance_norm_1_1_attrs_1a90012c405dc0d5545b200b2a7ca74651) = false` | `bool` | | `[variance\_epsilon\_](#structtensorflow_1_1ops_1_1_quantized_instance_norm_1_1_attrs_1a3eb30df9c538c1316ba64edd59220592) = 1e-05f` | `float` | | Public functions | | --- | | `[GivenYMax](#structtensorflow_1_1ops_1_1_quantized_instance_norm_1_1_attrs_1a553ab19eaa986e91efec9bcac303ae9b)(float x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_quantized_instance_norm_1_1_attrs)` [Output](../../../../class/tensorflow/output#classtensorflow_1_1_output) in `y_max` if `output_range_given` is True. | | `[GivenYMin](#structtensorflow_1_1ops_1_1_quantized_instance_norm_1_1_attrs_1a05f250f2de55e37648933a2b078bb1db)(float x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_quantized_instance_norm_1_1_attrs)` [Output](../../../../class/tensorflow/output#classtensorflow_1_1_output) in `y_min` if `output_range_given` is True. | | `[MinSeparation](#structtensorflow_1_1ops_1_1_quantized_instance_norm_1_1_attrs_1a990577e61d1a959e6b16f31deeef2ac3)(float x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_quantized_instance_norm_1_1_attrs)` [Minimum](../../../../class/tensorflow/ops/minimum#classtensorflow_1_1ops_1_1_minimum) value of `y_max - y_min` | | `[OutputRangeGiven](#structtensorflow_1_1ops_1_1_quantized_instance_norm_1_1_attrs_1a7715dcb9ec54a1cd7e45f9a30d1bd226)(bool x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_quantized_instance_norm_1_1_attrs)` If True, `given_y_min` and `given_y_min` and `given_y_max` are used as the output range. | | `[VarianceEpsilon](#structtensorflow_1_1ops_1_1_quantized_instance_norm_1_1_attrs_1abee47b20aa34a84940f8449f1c4179b2)(float x)` | `TF_MUST_USE_RESULT [Attrs](attrs#structtensorflow_1_1ops_1_1_quantized_instance_norm_1_1_attrs)` A small float number to avoid dividing by 0. | Public attributes ----------------- ### given\_y\_max\_ ``` float tensorflow::ops::QuantizedInstanceNorm::Attrs::given_y_max_ = 0.0f ``` ### given\_y\_min\_ ``` float tensorflow::ops::QuantizedInstanceNorm::Attrs::given_y_min_ = 0.0f ``` ### min\_separation\_ ``` float tensorflow::ops::QuantizedInstanceNorm::Attrs::min_separation_ = 0.001f ``` ### output\_range\_given\_ ``` bool tensorflow::ops::QuantizedInstanceNorm::Attrs::output_range_given_ = false ``` ### variance\_epsilon\_ ``` float tensorflow::ops::QuantizedInstanceNorm::Attrs::variance_epsilon_ = 1e-05f ``` Public functions ---------------- ### GivenYMax ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::QuantizedInstanceNorm::Attrs::GivenYMax( float x ) ``` [Output](../../../../class/tensorflow/output#classtensorflow_1_1_output) in `y_max` if `output_range_given` is True. Defaults to 0 ### GivenYMin ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::QuantizedInstanceNorm::Attrs::GivenYMin( float x ) ``` [Output](../../../../class/tensorflow/output#classtensorflow_1_1_output) in `y_min` if `output_range_given` is True. Defaults to 0 ### MinSeparation ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::QuantizedInstanceNorm::Attrs::MinSeparation( float x ) ``` [Minimum](../../../../class/tensorflow/ops/minimum#classtensorflow_1_1ops_1_1_minimum) value of `y_max - y_min` Defaults to 0.001 ### OutputRangeGiven ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::QuantizedInstanceNorm::Attrs::OutputRangeGiven( bool x ) ``` If True, `given_y_min` and `given_y_min` and `given_y_max` are used as the output range. Otherwise, the implementation computes the output range. Defaults to false ### VarianceEpsilon ``` TF_MUST_USE_RESULT Attrs tensorflow::ops::QuantizedInstanceNorm::Attrs::VarianceEpsilon( float x ) ``` A small float number to avoid dividing by 0. Defaults to 1e-05
programming_docs
tensorflow_cpp tensorflow::Operation tensorflow::Operation ===================== `#include <ops.h>` Represents a node in the computation graph. Summary ------- | Constructors and Destructors | | --- | | `[Operation](#classtensorflow_1_1_operation_1affdd1229a28ca12d41c2016dc06bac9c)()` | | `[Operation](#classtensorflow_1_1_operation_1a01d5e9099d2a89c48a0a2c18166bb61c)(Node *n)` | | Public functions | | --- | | `[hash](#classtensorflow_1_1_operation_1a9873ed5cc934c1b995bf8085a9d5bb4b)(int32_t index) const` | `uint64` | | `[input](#classtensorflow_1_1_operation_1a735d944cf3fad511ab0ccd99c35a92b2)(int32_t i) const` | `[Output](output#classtensorflow_1_1_output)` | | `[input\_type](#classtensorflow_1_1_operation_1a98ad05d7ca297d3f4bf071a1ec5c1b97)(int32_t o) const` | `DataType` | | `[node](#classtensorflow_1_1_operation_1a0aaad0fb0775e40848f879780892c62a)() const` | `Node *` | | `[num\_inputs](#classtensorflow_1_1_operation_1a6ea6441affa16d05401440d30c157554)() const` | `int32` | | `[num\_outputs](#classtensorflow_1_1_operation_1a314711a8e16149c0ef823e1100a3a136)() const` | `int32` | | `[operator==](#classtensorflow_1_1_operation_1a59f85b71ca828099976b3f183a37203f)(const [Operation](operation#classtensorflow_1_1_operation) & other) const` | `bool` | | `[output](#classtensorflow_1_1_operation_1a7af4e89729455b7fa7c4c0cc2f72f7bf)(int32_t i) const` | `[Output](output#classtensorflow_1_1_output)` | | `[output\_type](#classtensorflow_1_1_operation_1ab40a3b93ccd0a5d633bcbe4a68b4a1b6)(int32_t o) const` | `DataType` | Public functions ---------------- ### Operation ``` Operation() ``` ### Operation ``` Operation( Node *n ) ``` ### hash ``` uint64 hash( int32_t index ) const ``` ### input ``` Output input( int32_t i ) const ``` ### input\_type ``` DataType input_type( int32_t o ) const ``` ### node ``` Node * node() const ``` ### num\_inputs ``` int32 num_inputs() const ``` ### num\_outputs ``` int32 num_outputs() const ``` ### operator== ``` bool operator==( const Operation & other ) const ``` ### output ``` Output output( int32_t i ) const ``` ### output\_type ``` DataType output_type( int32_t o ) const ``` tensorflow_cpp tensorflow::InputList tensorflow::InputList ===================== `#include <ops.h>` A type for representing the input to ops that require a list of tensors. Summary ------- | Constructors and Destructors | | --- | | `[InputList](#classtensorflow_1_1_input_list_1aab259b2307b68dc10f0f2f7a3c2b5ab9)(const [OutputList](../../group/core#group__core_1gab449e6a3abd500c2f4ea93f9e89ba96c) & out)` Implicitly convert a list of outputs to a list of inputs. | | `[InputList](#classtensorflow_1_1_input_list_1a5acf49a973cf0b63db1f9bd51ab14852)(const std::initializer_list< [Input](input#classtensorflow_1_1_input) > & inputs)` | | `[InputList](#classtensorflow_1_1_input_list_1aa81b65c61d17307d71c42be89ff72c3d)(const tensorflow::gtl::ArraySlice< [Input](input#classtensorflow_1_1_input) > & inputs)` | | `[InputList](#classtensorflow_1_1_input_list_1a4ad9ab5abb1a216c6b94026da43ea1e5)(const std::initializer_list< [Output](output#classtensorflow_1_1_output) > & out)` | | Public functions | | --- | | `[begin](#classtensorflow_1_1_input_list_1a9b532f43dda87d8790cf3ae2d66930f5)()` | `std::vector< [Input](input#classtensorflow_1_1_input) >::iterator` | | `[begin](#classtensorflow_1_1_input_list_1a8d3b8f204452afdc78c1abc37fb8072e)() const` | `std::vector< [Input](input#classtensorflow_1_1_input) >::const_iterator` | | `[end](#classtensorflow_1_1_input_list_1a893f2fa53afefe227bbd8edced8d76aa)()` | `std::vector< [Input](input#classtensorflow_1_1_input) >::iterator` | | `[end](#classtensorflow_1_1_input_list_1a3e4875e643d6a902a259d0ad45a83c55)() const` | `std::vector< [Input](input#classtensorflow_1_1_input) >::const_iterator` | Public functions ---------------- ### InputList ``` InputList( const OutputList & out ) ``` Implicitly convert a list of outputs to a list of inputs. This is useful to write code such as ops::Concat(ops::Split(x, 4)). ### InputList ``` InputList( const std::initializer_list< Input > & inputs ) ``` ### InputList ``` InputList( const tensorflow::gtl::ArraySlice< Input > & inputs ) ``` ### InputList ``` InputList( const std::initializer_list< Output > & out ) ``` ### begin ``` std::vector< Input >::iterator begin() ``` ### begin ``` std::vector< Input >::const_iterator begin() const ``` ### end ``` std::vector< Input >::iterator end() ``` ### end ``` std::vector< Input >::const_iterator end() const ``` tensorflow_cpp tensorflow::TensorBuffer tensorflow::TensorBuffer ======================== **This is an abstract class.** `#include <tensor.h>` Summary ------- Interface to access the raw ref-counted data buffer. ### Inheritance Inherits from: RefCounted | Constructors and Destructors | | --- | | `[TensorBuffer](#classtensorflow_1_1_tensor_buffer_1ade0441d867aabc7d8c4f4a553d1e5fd3)(void *data_ptr)` | | `[~TensorBuffer](#classtensorflow_1_1_tensor_buffer_1a18b48c272459852177bbc653354b5b9a)()` | | Public functions | | --- | | `[FillAllocationDescription](#classtensorflow_1_1_tensor_buffer_1ab705a2c85f480e615dad7e7456fc121a)(AllocationDescription *proto) const =0` | `virtual void` Fills metadata about the allocation into the proto. | | `[GetAllocatedBytes](#classtensorflow_1_1_tensor_buffer_1a4a9ed5ee51dc0ab5c1326fba4fb41e41)(size_t *out_bytes) const` | `virtual bool` | | `[GetMemoryType](#classtensorflow_1_1_tensor_buffer_1ad86309f8fd1ed22f609835b1216871bb)() const` | `virtual AllocatorMemoryType` The type of the underlying memory. | | `[OwnsMemory](#classtensorflow_1_1_tensor_buffer_1a3c7bd551682ef698b66f432c32a3419f)() const` | `virtual bool` Whether this [TensorBuffer](tensor-buffer#classtensorflow_1_1_tensor_buffer) owns the underlying memory. | | `[base](#classtensorflow_1_1_tensor_buffer_1a13f72af307351613523799b8b3944ed5)() const` | `T *` Helper method to reinterpret the buffer as an array of `T`. | | `[data](#classtensorflow_1_1_tensor_buffer_1a7e8cdbb48073e1a8890427acad00a30e)() const` | `void *` [data()](tensor-buffer#classtensorflow_1_1_tensor_buffer_1a7e8cdbb48073e1a8890427acad00a30e) points to a memory region of [size()](tensor-buffer#classtensorflow_1_1_tensor_buffer_1a36b022bd5ed41ce31242d6f3bbe6757b) bytes. | | `[root\_buffer](#classtensorflow_1_1_tensor_buffer_1a0b406028a1e487cca2eacca453381fc3)()=0` | `virtual [TensorBuffer](tensor-buffer#classtensorflow_1_1_tensor_buffer) *` If this [TensorBuffer](tensor-buffer#classtensorflow_1_1_tensor_buffer) is sub-buffer of another [TensorBuffer](tensor-buffer#classtensorflow_1_1_tensor_buffer), returns that [TensorBuffer](tensor-buffer#classtensorflow_1_1_tensor_buffer). | | `[size](#classtensorflow_1_1_tensor_buffer_1a36b022bd5ed41ce31242d6f3bbe6757b)() const =0` | `virtual size_t` Size (in bytes) of the buffer. | Public functions ---------------- ### FillAllocationDescription ``` virtual void FillAllocationDescription( AllocationDescription *proto ) const =0 ``` Fills metadata about the allocation into the proto. ### GetAllocatedBytes ``` virtual bool GetAllocatedBytes( size_t *out_bytes ) const ``` ### GetMemoryType ``` virtual AllocatorMemoryType GetMemoryType() const ``` The type of the underlying memory. ### OwnsMemory ``` virtual bool OwnsMemory() const ``` Whether this [TensorBuffer](tensor-buffer#classtensorflow_1_1_tensor_buffer) owns the underlying memory. ### TensorBuffer ``` TensorBuffer( void *data_ptr ) ``` ### base ``` T * base() const ``` Helper method to reinterpret the buffer as an array of `T`. ### data ``` void * data() const ``` [data()](tensor-buffer#classtensorflow_1_1_tensor_buffer_1a7e8cdbb48073e1a8890427acad00a30e) points to a memory region of [size()](tensor-buffer#classtensorflow_1_1_tensor_buffer_1a36b022bd5ed41ce31242d6f3bbe6757b) bytes. NOTE(mrry): The `[data()](tensor-buffer#classtensorflow_1_1_tensor_buffer_1a7e8cdbb48073e1a8890427acad00a30e)` method is not virtual for performance reasons. It can be called multiple times when the contents of a `[Tensor](tensor#classtensorflow_1_1_tensor)` are accessed, and so making it non-virtual allows the body to be inlined. ### root\_buffer ``` virtual TensorBuffer * root_buffer()=0 ``` If this [TensorBuffer](tensor-buffer#classtensorflow_1_1_tensor_buffer) is sub-buffer of another [TensorBuffer](tensor-buffer#classtensorflow_1_1_tensor_buffer), returns that [TensorBuffer](tensor-buffer#classtensorflow_1_1_tensor_buffer). Otherwise, returns this. ### size ``` virtual size_t size() const =0 ``` Size (in bytes) of the buffer. ### ~TensorBuffer ``` ~TensorBuffer() override ``` tensorflow_cpp tensorflow::ClientSession tensorflow::ClientSession ========================= `#include <client_session.h>` A `[ClientSession](client-session#classtensorflow_1_1_client_session)` object lets the caller drive the evaluation of the TensorFlow graph constructed with the C++ API. Summary ------- Example: ``` Scope root = Scope::NewRootScope(); auto a = Placeholder(root, DT_INT32); auto c = Add(root, a, {41}); ClientSession session(root); std::vector outputs; Status s = session.Run({ {a, {1} } }, {c}, &outputs); if (!s.ok()) { ... } ``` | Constructors and Destructors | | --- | | `[ClientSession](#classtensorflow_1_1_client_session_1ac52798100986741ff24aba4a758d8e4d)(const [Scope](scope#classtensorflow_1_1_scope) & scope, const string & target)` Create a new session to evaluate the graph contained in `scope` by connecting to the TensorFlow runtime specified by `target`. | | `[ClientSession](#classtensorflow_1_1_client_session_1a791dce94ca627aec0c4318b125f60b6f)(const [Scope](scope#classtensorflow_1_1_scope) & scope)` Same as above, but use the empty string ("") as the target specification. | | `[ClientSession](#classtensorflow_1_1_client_session_1a997f25e1940f59e004d99be1ce8b1d6a)(const [Scope](scope#classtensorflow_1_1_scope) & scope, const SessionOptions & session_options)` Create a new session, configuring it with `session_options`. | | `[~ClientSession](#classtensorflow_1_1_client_session_1a9372a82c049463a1197b002f8d08808d)()` | | Public types | | --- | | `[CallableHandle](#classtensorflow_1_1_client_session_1a979abcbe5b61b1c7ef85089f2ddbc5ca)` | typedef `int64_t` A handle to a subgraph, created with `[ClientSession::MakeCallable()](client-session#classtensorflow_1_1_client_session_1a1173b3254b1940937a59c5adfb196316)`. | | `[FeedType](#classtensorflow_1_1_client_session_1acc9df9cd0b78bc70aa100c122e1d0b79)` | typedef `std::unordered_map< [Output](output#classtensorflow_1_1_output), [Input::Initializer](../../struct/tensorflow/input/initializer#structtensorflow_1_1_input_1_1_initializer), [OutputHash](../../struct/tensorflow/output-hash#structtensorflow_1_1_output_hash) >` A data type to represent feeds to a Run call. | | Public functions | | --- | | `[MakeCallable](#classtensorflow_1_1_client_session_1a1173b3254b1940937a59c5adfb196316)(const CallableOptions & callable_options, [CallableHandle](client-session#classtensorflow_1_1_client_session_1a979abcbe5b61b1c7ef85089f2ddbc5ca) *out_handle)` | `Status` Creates a `handle` for invoking the subgraph defined by `callable_options`. | | `[ReleaseCallable](#classtensorflow_1_1_client_session_1a7f028aa32b4b924e1be040c49c44221a)([CallableHandle](client-session#classtensorflow_1_1_client_session_1a979abcbe5b61b1c7ef85089f2ddbc5ca) handle)` | `Status` Releases resources associated with the given `handle` in this session. | | `[Run](#classtensorflow_1_1_client_session_1abba158c5343b74800d2d00b6ce75cf79)(const std::vector< [Output](output#classtensorflow_1_1_output) > & fetch_outputs, std::vector< [Tensor](tensor#classtensorflow_1_1_tensor) > *outputs) const` | `Status` Evaluate the tensors in `fetch_outputs`. | | `[Run](#classtensorflow_1_1_client_session_1a69299ff76cb16b83467e93569870250a)(const [FeedType](client-session#classtensorflow_1_1_client_session_1acc9df9cd0b78bc70aa100c122e1d0b79) & inputs, const std::vector< [Output](output#classtensorflow_1_1_output) > & fetch_outputs, std::vector< [Tensor](tensor#classtensorflow_1_1_tensor) > *outputs) const` | `Status` Same as above, but use the mapping in `inputs` as feeds. | | `[Run](#classtensorflow_1_1_client_session_1a706a9b3dfde4aa64c7ca9e85ac666b1d)(const [FeedType](client-session#classtensorflow_1_1_client_session_1acc9df9cd0b78bc70aa100c122e1d0b79) & inputs, const std::vector< [Output](output#classtensorflow_1_1_output) > & fetch_outputs, const std::vector< [Operation](operation#classtensorflow_1_1_operation) > & run_outputs, std::vector< [Tensor](tensor#classtensorflow_1_1_tensor) > *outputs) const` | `Status` Same as above. Additionally runs the operations ins `run_outputs`. | | `[Run](#classtensorflow_1_1_client_session_1a46e06a478a61001923a545e0922038e2)(const RunOptions & run_options, const [FeedType](client-session#classtensorflow_1_1_client_session_1acc9df9cd0b78bc70aa100c122e1d0b79) & inputs, const std::vector< [Output](output#classtensorflow_1_1_output) > & fetch_outputs, const std::vector< [Operation](operation#classtensorflow_1_1_operation) > & run_outputs, std::vector< [Tensor](tensor#classtensorflow_1_1_tensor) > *outputs, RunMetadata *run_metadata) const` | `Status` Use `run_options` to turn on performance profiling. | | `[Run](#classtensorflow_1_1_client_session_1a823b8483e2f52f37e0369c44f55250c7)(const RunOptions & run_options, const [FeedType](client-session#classtensorflow_1_1_client_session_1acc9df9cd0b78bc70aa100c122e1d0b79) & inputs, const std::vector< [Output](output#classtensorflow_1_1_output) > & fetch_outputs, const std::vector< [Operation](operation#classtensorflow_1_1_operation) > & run_outputs, std::vector< [Tensor](tensor#classtensorflow_1_1_tensor) > *outputs, RunMetadata *run_metadata, const thread::ThreadPoolOptions & threadpool_options) const` | `Status` Same as above. | | `[RunCallable](#classtensorflow_1_1_client_session_1ad5ba274d6e978e36be7aa8e53207faa2)([CallableHandle](client-session#classtensorflow_1_1_client_session_1a979abcbe5b61b1c7ef85089f2ddbc5ca) handle, const std::vector< [Tensor](tensor#classtensorflow_1_1_tensor) > & feed_tensors, std::vector< [Tensor](tensor#classtensorflow_1_1_tensor) > *fetch_tensors, RunMetadata *run_metadata)` | `Status` Invokes the subgraph named by `handle` with the given options and input tensors. | | `[RunCallable](#classtensorflow_1_1_client_session_1aa27cbcc70e682e0e5290821376722c2d)([CallableHandle](client-session#classtensorflow_1_1_client_session_1a979abcbe5b61b1c7ef85089f2ddbc5ca) handle, const std::vector< [Tensor](tensor#classtensorflow_1_1_tensor) > & feed_tensors, std::vector< [Tensor](tensor#classtensorflow_1_1_tensor) > *fetch_tensors, RunMetadata *run_metadata, const thread::ThreadPoolOptions & options)` | `Status` Invokes the subgraph named by `handle` with the given options and input tensors. | Public types ------------ ### CallableHandle ``` int64_t CallableHandle ``` A handle to a subgraph, created with `[ClientSession::MakeCallable()](client-session#classtensorflow_1_1_client_session_1a1173b3254b1940937a59c5adfb196316)`. ### FeedType ``` std::unordered_map< Output, Input::Initializer, OutputHash > FeedType ``` A data type to represent feeds to a Run call. This is a map of `[Output](output#classtensorflow_1_1_output)` objects returned by op-constructors to the value to feed them with. See `[Input::Initializer](../../struct/tensorflow/input/initializer#structtensorflow_1_1_input_1_1_initializer)` for details on what can be used as feed values. Public functions ---------------- ### ClientSession ``` ClientSession( const Scope & scope, const string & target ) ``` Create a new session to evaluate the graph contained in `scope` by connecting to the TensorFlow runtime specified by `target`. ### ClientSession ``` ClientSession( const Scope & scope ) ``` Same as above, but use the empty string ("") as the target specification. ### ClientSession ``` ClientSession( const Scope & scope, const SessionOptions & session_options ) ``` Create a new session, configuring it with `session_options`. ### MakeCallable ``` Status MakeCallable( const CallableOptions & callable_options, CallableHandle *out_handle ) ``` Creates a `handle` for invoking the subgraph defined by `callable_options`. NOTE: This API is still experimental and may change. ### ReleaseCallable ``` Status ReleaseCallable( CallableHandle handle ) ``` Releases resources associated with the given `handle` in this session. NOTE: This API is still experimental and may change. ### Run ``` Status Run( const std::vector< Output > & fetch_outputs, std::vector< Tensor > *outputs ) const ``` Evaluate the tensors in `fetch_outputs`. The values are returned as `[Tensor](tensor#classtensorflow_1_1_tensor)` objects in `outputs`. The number and order of `outputs` will match `fetch_outputs`. ### Run ``` Status Run( const FeedType & inputs, const std::vector< Output > & fetch_outputs, std::vector< Tensor > *outputs ) const ``` Same as above, but use the mapping in `inputs` as feeds. ### Run ``` Status Run( const FeedType & inputs, const std::vector< Output > & fetch_outputs, const std::vector< Operation > & run_outputs, std::vector< Tensor > *outputs ) const ``` Same as above. Additionally runs the operations ins `run_outputs`. ### Run ``` Status Run( const RunOptions & run_options, const FeedType & inputs, const std::vector< Output > & fetch_outputs, const std::vector< Operation > & run_outputs, std::vector< Tensor > *outputs, RunMetadata *run_metadata ) const ``` Use `run_options` to turn on performance profiling. `run_metadata`, if not null, is filled in with the profiling results. ### Run ``` Status Run( const RunOptions & run_options, const FeedType & inputs, const std::vector< Output > & fetch_outputs, const std::vector< Operation > & run_outputs, std::vector< Tensor > *outputs, RunMetadata *run_metadata, const thread::ThreadPoolOptions & threadpool_options ) const ``` Same as above. Additionally allows user to provide custom threadpool implementation via ThreadPoolOptions. ### RunCallable ``` Status RunCallable( CallableHandle handle, const std::vector< Tensor > & feed_tensors, std::vector< Tensor > *fetch_tensors, RunMetadata *run_metadata ) ``` Invokes the subgraph named by `handle` with the given options and input tensors. The order of tensors in `feed_tensors` must match the order of names in `CallableOptions::feed()` and the order of tensors in `fetch_tensors` will match the order of names in `CallableOptions::fetch()` when this subgraph was created. NOTE: This API is still experimental and may change. ### RunCallable ``` Status RunCallable( CallableHandle handle, const std::vector< Tensor > & feed_tensors, std::vector< Tensor > *fetch_tensors, RunMetadata *run_metadata, const thread::ThreadPoolOptions & options ) ``` Invokes the subgraph named by `handle` with the given options and input tensors. The order of tensors in `feed_tensors` must match the order of names in `CallableOptions::feed()` and the order of tensors in `fetch_tensors` will match the order of names in `CallableOptions::fetch()` when this subgraph was created. NOTE: This API is still experimental and may change. ### ~ClientSession ``` ~ClientSession() ``` tensorflow_cpp tensorflow::Tensor tensorflow::Tensor ================== `#include <tensor.h>` Represents an n-dimensional array of values. Summary ------- | Constructors and Destructors | | --- | | `[Tensor](#classtensorflow_1_1_tensor_1aebe57070a84f43b98e63671f52a117fe)()` Creates a 1-dimensional, 0-element float tensor. | | `[Tensor](#classtensorflow_1_1_tensor_1a08e32d524ca560888c76a57e6fab5466)(DataType type, const TensorShape & shape)` Creates a [Tensor](tensor#classtensorflow_1_1_tensor) of the given `type` and `shape`. | | `[Tensor](#classtensorflow_1_1_tensor_1aec608b828b3807c153616598822fa555)(Allocator *a, DataType type, const TensorShape & shape)` Creates a tensor with the input `type` and `shape`, using the allocator `a` to allocate the underlying buffer. | | `[Tensor](#classtensorflow_1_1_tensor_1a55de61e27b842b06b29c954b2c3bf3f3)(Allocator *a, DataType type, const TensorShape & shape, const AllocationAttributes & allocation_attr)` Creates a tensor with the input `type` and `shape`, using the allocator `a` and the specified "allocation\_attr" to allocate the underlying buffer. | | `[Tensor](#classtensorflow_1_1_tensor_1ac57b0c5223af0068c3de94e0f9fdba2c)(DataType type, const TensorShape & shape, [TensorBuffer](tensor-buffer#classtensorflow_1_1_tensor_buffer) *buf)` Creates a tensor with the input datatype, shape and buf. | | `[Tensor](#classtensorflow_1_1_tensor_1a6bb96a5472af5913183741f78b90a857)(DataType type, TensorShape shape, core::RefCountPtr< [TensorBuffer](tensor-buffer#classtensorflow_1_1_tensor_buffer) > buf)` Creates a tensor with the input datatype, shape and buf. | | `[Tensor](#classtensorflow_1_1_tensor_1a306a1c30a4ed610837c775aed23f2a10)(DataType type)` Creates an empty [Tensor](tensor#classtensorflow_1_1_tensor) of the given data type. | | `[Tensor](#classtensorflow_1_1_tensor_1af8969ead84ed648963ae46e691547e9e)(float scalar_value)` | | `[Tensor](#classtensorflow_1_1_tensor_1a5d5e5d7b4a4177f7373b029131bc423b)(double scalar_value)` | | `[Tensor](#classtensorflow_1_1_tensor_1a5601f452904e18cad4aac9e8248ec264)(int32_t scalar_value)` | | `[Tensor](#classtensorflow_1_1_tensor_1ad6998eeb293c0556b7235130e4e30f28)(uint32 scalar_value)` | | `[Tensor](#classtensorflow_1_1_tensor_1a1fa38a7929a9c42f1e85bde0bbb8f8a6)(uint16 scalar_value)` | | `[Tensor](#classtensorflow_1_1_tensor_1ae4cca32e1273ab339a7c45644131f79d)(uint8 scalar_value)` | | `[Tensor](#classtensorflow_1_1_tensor_1a7655927ab8a4550fb477164b93317617)(int16_t scalar_value)` | | `[Tensor](#classtensorflow_1_1_tensor_1a114dda8b130cbd51012d27508ed55c32)(int8_t scalar_value)` | | `[Tensor](#classtensorflow_1_1_tensor_1a76915adb56e0e75fb6ffe310a136dc26)(tstring scalar_value)` | | `[Tensor](#classtensorflow_1_1_tensor_1ac4eebf0208aafd7bb871662330fa0164)(complex64 scalar_value)` | | `[Tensor](#classtensorflow_1_1_tensor_1a9d29b0abca4b31db30c0b10a9f9cbc5f)(complex128 scalar_value)` | | `[Tensor](#classtensorflow_1_1_tensor_1abe2d538fbf66d908e55e6f28d63c0559)(int64_t scalar_value)` | | `[Tensor](#classtensorflow_1_1_tensor_1a1c765a977eb9cfd864586d7afa48a5f0)(uint64 scalar_value)` | | `[Tensor](#classtensorflow_1_1_tensor_1aaf55b6346cd86757991d140d9f0708ad)(bool scalar_value)` | | `[Tensor](#classtensorflow_1_1_tensor_1ae82fabedfb3355965bfa6c950a4d0088)(qint8 scalar_value)` | | `[Tensor](#classtensorflow_1_1_tensor_1a709b3d5127f6daeae56ebe4231a4ff0b)(quint8 scalar_value)` | | `[Tensor](#classtensorflow_1_1_tensor_1aa019552e7ea5d3f350b905829b0d5199)(qint16 scalar_value)` | | `[Tensor](#classtensorflow_1_1_tensor_1a418411132eecce8c0a526df8d7cceaeb)(quint16 scalar_value)` | | `[Tensor](#classtensorflow_1_1_tensor_1af304024fec2e58bec0f93bea580d0be7)(qint32 scalar_value)` | | `[Tensor](#classtensorflow_1_1_tensor_1acbf215151f87c2a19364f15bd69618ad)(bfloat16 scalar_value)` | | `[Tensor](#classtensorflow_1_1_tensor_1ab478fb0c62ce0e56a12f0812642bc16c)(Eigen::half scalar_value)` | | `[Tensor](#classtensorflow_1_1_tensor_1a473a4c38498e06f8e7d1125401cefdea)(ResourceHandle scalar_value)` | | `[Tensor](#classtensorflow_1_1_tensor_1a3da694b6697a62217d01b9c5a4ecfb3d)(const char *scalar_value)` | | `[Tensor](#classtensorflow_1_1_tensor_1a6379ca55abf3e9f475a5fd0615d863d5)(const [Tensor](tensor#classtensorflow_1_1_tensor) & other)` Copy constructor. | | `[Tensor](#classtensorflow_1_1_tensor_1a9ce0ef052f796ecaad68e2000853f339)([Tensor](tensor#classtensorflow_1_1_tensor) && other)` Move constructor. | | `[Tensor](#classtensorflow_1_1_tensor_1a1be48c77fc8291b99b8cfb763f6e3255)(T *t)` | | `[~Tensor](#classtensorflow_1_1_tensor_1a212bdf999f5deef11504d781cf2ab855)()` | | Public functions | | --- | | `[AllocatedBytes](#classtensorflow_1_1_tensor_1a3c21e0423f7577a32583eb96d2a3a5ec)() const` | `size_t` | | `[AsProtoField](#classtensorflow_1_1_tensor_1a55198b51aab7ca4ef312416c2b742eec)(TensorProto *proto) const` | `void` Fills in `proto` with `*this` tensor's content. | | `[AsProtoTensorContent](#classtensorflow_1_1_tensor_1a4b9855ed8179d0611e9bced54dfa3aad)(TensorProto *proto) const` | `void` | | `[BitcastFrom](#classtensorflow_1_1_tensor_1a76ab5c0e7b5f7dc9b12be46e02f9f957)(const [Tensor](tensor#classtensorflow_1_1_tensor) & other, DataType dtype, const TensorShape & shape)` | `Status` Copy the other tensor into this tensor, reshape it and reinterpret the buffer's datatype. | | `[CopyFrom](#classtensorflow_1_1_tensor_1acf6199c97175185c91ccd350e8a6e19c)(const [Tensor](tensor#classtensorflow_1_1_tensor) & other, const TensorShape & shape) TF_MUST_USE_RESULT` | `bool` Copy the other tensor into this tensor and reshape it. | | `[DebugString](#classtensorflow_1_1_tensor_1a227f8e3940b1be0a7c21c2fdccac631b)(int num_values) const` | `std::string` A human-readable summary of the tensor suitable for debugging. | | `[DebugString](#classtensorflow_1_1_tensor_1a69eba2eecb66ff8dc04d7a88c68223f8)() const` | `std::string` | | `[DeviceSafeDebugString](#classtensorflow_1_1_tensor_1ad9e2aacd5689cdfa001fa497ee68919e)() const` | `std::string` | | `[FillDescription](#classtensorflow_1_1_tensor_1a04b83c98a70a80676c94fe1294faa6e1)(TensorDescription *description) const` | `void` Fill in the `TensorDescription` proto with metadata about the tensor that is useful for monitoring and debugging. | | `[FromProto](#classtensorflow_1_1_tensor_1ad7cd0d781683c4cc7e66bd9e1da6fe57)(const TensorProto & other) TF_MUST_USE_RESULT` | `bool` Parse `other` and construct the tensor. | | `[FromProto](#classtensorflow_1_1_tensor_1aea7f15d9d7432ee6ab82c8b1730ab804)(Allocator *a, const TensorProto & other) TF_MUST_USE_RESULT` | `bool` | | `[GetMemoryType](#classtensorflow_1_1_tensor_1ad1260f69b3d0ba06de362f51bb98bb36)() const` | `AllocatorMemoryType` | | `[IsAligned](#classtensorflow_1_1_tensor_1aec1fa00d85d569b344a55ad89f915ce9)() const` | `bool` Returns true iff this tensor is aligned. | | `[IsInitialized](#classtensorflow_1_1_tensor_1aa44336c38c4baf3ed69f63aee131ba87)() const` | `bool` If necessary, has this [Tensor](tensor#classtensorflow_1_1_tensor) been initialized? | | `[IsSameSize](#classtensorflow_1_1_tensor_1a2e0df4f1c6996097c49822d112f0678f)(const [Tensor](tensor#classtensorflow_1_1_tensor) & b) const` | `bool` | | `[NumElements](#classtensorflow_1_1_tensor_1ae187c661b3add739bd7604b8ac053918)() const` | `int64_t` Convenience accessor for the tensor shape. | | `[RefCountIsOne](#classtensorflow_1_1_tensor_1a43490147346ba4d73aab4477dae9c37d)() const` | `bool` | | `[SharesBufferWith](#classtensorflow_1_1_tensor_1a9b9acd3759bc39a23d4691816b2ba05c)(const [Tensor](tensor#classtensorflow_1_1_tensor) & b) const` | `bool` | | `[Slice](#classtensorflow_1_1_tensor_1a5f6fa12cd72397c5dcc6d9a01ebeef7e)(int64_t dim0_start, int64_t dim0_limit) const` | `[Tensor](tensor#classtensorflow_1_1_tensor)` Slice this tensor along the 1st dimension. | | `[SubSlice](#classtensorflow_1_1_tensor_1ae2601c8003fb28b4c3a156510ae15e3f)(int64_t index) const` | `[Tensor](tensor#classtensorflow_1_1_tensor)` Select a subslice from this tensor along the 1st dimension. | | `[SummarizeValue](#classtensorflow_1_1_tensor_1a4516f8fe1bbc948e603418caad29ad5d)(int64_t max_entries, bool print_v2) const` | `std::string` Render the first `max_entries` values in `*this` into a string. | | `[TotalBytes](#classtensorflow_1_1_tensor_1ab2c0b13287edd6d8dec1bbc59794e81c)() const` | `size_t` Returns the estimated memory usage of this tensor. | | `[UnsafeCopyFromInternal](#classtensorflow_1_1_tensor_1a8fab7661ec78cfda7b02a85680070d20)(const [Tensor](tensor#classtensorflow_1_1_tensor) & other, DataType dtype, const TensorShape & shape)` | `void` Like BitcastFrom, but CHECK fails if any preconditions are not met. | | `[bit\_casted\_shaped](#classtensorflow_1_1_tensor_1add9b77889365997588f586f84783933d)(gtl::ArraySlice< int64_t > new_sizes)` | `TTypes< T, NDIMS >::[Tensor](tensor#classtensorflow_1_1_tensor)` Return the tensor data to an `Eigen::Tensor` with the new shape specified in `new_sizes` and cast to a new dtype `T`. | | `[bit\_casted\_shaped](#classtensorflow_1_1_tensor_1a94c3839fd0321644fee9512cf913d3a5)(gtl::ArraySlice< int64_t > new_sizes) const` | `TTypes< T, NDIMS >::ConstTensor` Return the tensor data to an `Eigen::Tensor` with the new shape specified in `new_sizes` and cast to a new dtype `T`. | | `[bit\_casted\_tensor](#classtensorflow_1_1_tensor_1ab479fc449ce2e5da1a99d4cae8f6e47a)()` | `TTypes< T, NDIMS >::[Tensor](tensor#classtensorflow_1_1_tensor)` Return the tensor data to an `Eigen::Tensor` with the same size but a bitwise cast to the specified dtype `T`. | | `[bit\_casted\_tensor](#classtensorflow_1_1_tensor_1afced940422a1e726d9487cb3cb039630)() const` | `TTypes< T, NDIMS >::ConstTensor` Return the tensor data to an `Eigen::Tensor` with the same size but a bitwise cast to the specified dtype `T`. | | `[data](#classtensorflow_1_1_tensor_1a8232f7ab745e48a3b22a8396f7d96e28)() const` | `void *` | | `[dim\_size](#classtensorflow_1_1_tensor_1a6d84417cd610be15a4e61ce44b9edee6)(int d) const` | `int64_t` Convenience accessor for the tensor shape. | | `[dims](#classtensorflow_1_1_tensor_1ac8a173cc6c97184139bfd81ff45e7da9)() const` | `int` Convenience accessor for the tensor shape. | | `[dtype](#classtensorflow_1_1_tensor_1a16a9c0fa93491bbc44377cd7eb58b3c6)() const` | `DataType` Returns the data type. | | `[flat](#classtensorflow_1_1_tensor_1a67ce62becce1e70454d9756d1d5ed996)()` | `TTypes< T >::Flat` Return the tensor data as an `Eigen::Tensor` of the data type and a specified shape. | | `[flat](#classtensorflow_1_1_tensor_1adfe83abc7c7b4834dc9d73ec3ec38f43)() const` | `TTypes< T >::ConstFlat` | | `[flat\_inner\_dims](#classtensorflow_1_1_tensor_1a6f5bf51d9c7f2ebf21d56aa8313a8b5f)()` | `TTypes< T, NDIMS >::[Tensor](tensor#classtensorflow_1_1_tensor)` Returns the data as an Eigen::Tensor with NDIMS dimensions, collapsing all [Tensor](tensor#classtensorflow_1_1_tensor) dimensions but the last NDIMS-1 into the first dimension of the result. | | `[flat\_inner\_dims](#classtensorflow_1_1_tensor_1a2941fc6005d4f9e0197ffe478eac6bc6)() const` | `TTypes< T, NDIMS >::ConstTensor` | | `[flat\_inner\_outer\_dims](#classtensorflow_1_1_tensor_1a07cc1b89360a9a0d090045b008afbbd4)(int64_t begin)` | `TTypes< T, NDIMS >::[Tensor](tensor#classtensorflow_1_1_tensor)` Returns the data as an Eigen::Tensor with NDIMS dimensions, collapsing the first 'begin' [Tensor](tensor#classtensorflow_1_1_tensor) dimensions into the first dimension of the result and the [Tensor](tensor#classtensorflow_1_1_tensor) dimensions of the last [dims()](tensor#classtensorflow_1_1_tensor_1ac8a173cc6c97184139bfd81ff45e7da9) - 'begin' - NDIMS into the last dimension of the result. | | `[flat\_inner\_outer\_dims](#classtensorflow_1_1_tensor_1ac09b416216de9fef0de65712f221283a)(int64_t begin) const` | `TTypes< T, NDIMS >::ConstTensor` | | `[flat\_outer\_dims](#classtensorflow_1_1_tensor_1a290876f00cea56107eeecc49af671c54)()` | `TTypes< T, NDIMS >::[Tensor](tensor#classtensorflow_1_1_tensor)` Returns the data as an Eigen::Tensor with NDIMS dimensions, collapsing all [Tensor](tensor#classtensorflow_1_1_tensor) dimensions but the first NDIMS-1 into the last dimension of the result. | | `[flat\_outer\_dims](#classtensorflow_1_1_tensor_1a49513c7e2fa9c4644760e0d579eb2607)() const` | `TTypes< T, NDIMS >::ConstTensor` | | `[matrix](#classtensorflow_1_1_tensor_1a6afab48885080a80ff0b52437959d929)()` | `TTypes< T >::Matrix` | | `[matrix](#classtensorflow_1_1_tensor_1a4005578d5a8b62e0d6deb86569b6eb14)() const` | `TTypes< T >::ConstMatrix` | | `[operator=](#classtensorflow_1_1_tensor_1a6582b22e47d0ed025ba96698be491225)(const [Tensor](tensor#classtensorflow_1_1_tensor) & other)` | `[Tensor](tensor#classtensorflow_1_1_tensor) &` Assign operator. This tensor shares other's underlying storage. | | `[operator=](#classtensorflow_1_1_tensor_1ab1669f9097b60559467424f901bf3211)([Tensor](tensor#classtensorflow_1_1_tensor) && other)` | `[Tensor](tensor#classtensorflow_1_1_tensor) &` Move operator. See move constructor for details. | | `[reinterpret\_last\_dimension](#classtensorflow_1_1_tensor_1a775ff735c4ec85176bc317f3d2f3e9f1)()` | `TTypes< T, NDIMS >::[Tensor](tensor#classtensorflow_1_1_tensor)` Return the tensor data to an `Eigen::Tensor` with the last dimension elements converted into single elements of a larger type. | | `[reinterpret\_last\_dimension](#classtensorflow_1_1_tensor_1a1c1d8fcb22c6ce7aaefe98b28466a02f)() const` | `TTypes< T, NDIMS >::ConstTensor` Return the tensor data to an `Eigen::Tensor` with the last dimension elements converted into single elements of a larger type. | | `[scalar](#classtensorflow_1_1_tensor_1aacce92855f6b83eea728203de8016c78)()` | `TTypes< T >::Scalar` Return the [Tensor](tensor#classtensorflow_1_1_tensor) data as a `TensorMap` of fixed size 1: `TensorMap>`. | | `[scalar](#classtensorflow_1_1_tensor_1a6d20a479e87d6ef5af2c7f3364e22858)() const` | `TTypes< T >::ConstScalar` | | `[shape](#classtensorflow_1_1_tensor_1ad0065facf49e31e4f48f07dd41528119)() const` | `const TensorShape &` Returns the shape of the tensor. | | `[shaped](#classtensorflow_1_1_tensor_1a470ad77392d8611095d0097833239ffb)(gtl::ArraySlice< int64_t > new_sizes)` | `TTypes< T, NDIMS >::[Tensor](tensor#classtensorflow_1_1_tensor)` | | `[shaped](#classtensorflow_1_1_tensor_1abac0dc6fa26202b35dd66a5bcab1071f)(gtl::ArraySlice< int64_t > new_sizes) const` | `TTypes< T, NDIMS >::ConstTensor` | | `[tensor](#classtensorflow_1_1_tensor_1afd9dc3fa5b64e39221c72f8f6fe44769)()` | `TTypes< T, NDIMS >::[Tensor](tensor#classtensorflow_1_1_tensor)` | | `[tensor](#classtensorflow_1_1_tensor_1ac4f4bbc4c2dd1721e42481fe50c12735)() const` | `TTypes< T, NDIMS >::ConstTensor` | | `[tensor\_data](#classtensorflow_1_1_tensor_1aec0a1c04f8bc4c469453a0c13668b968)() const` | `StringPiece` Returns a `StringPiece` mapping the current tensor's buffer. | | `[unaligned\_flat](#classtensorflow_1_1_tensor_1a93908c637764bdec8bfd08da5fe49a06)()` | `TTypes< T >::UnalignedFlat` | | `[unaligned\_flat](#classtensorflow_1_1_tensor_1a52f9619663d80a05a933d8ee96074b35)() const` | `TTypes< T >::UnalignedConstFlat` | | `[unaligned\_shaped](#classtensorflow_1_1_tensor_1af44433e657d62dd45d85549fa52de162)(gtl::ArraySlice< int64_t > new_sizes)` | `TTypes< T, NDIMS >::UnalignedTensor` | | `[unaligned\_shaped](#classtensorflow_1_1_tensor_1a3300cdb52656e610f907241e737aeafe)(gtl::ArraySlice< int64_t > new_sizes) const` | `TTypes< T, NDIMS >::UnalignedConstTensor` | | `[vec](#classtensorflow_1_1_tensor_1a8714205b3a82f0338c53c31ee93eab95)()` | `TTypes< T >::Vec` Return the tensor data as an `Eigen::Tensor` with the type and sizes of this `[Tensor](tensor#classtensorflow_1_1_tensor)`. | | `[vec](#classtensorflow_1_1_tensor_1a0834fadcc0428f68c9d13bd32a1b20d9)() const` | `TTypes< T >::ConstVec` Const versions of all the methods above. | | Public static functions | | --- | | `[BuildTensor](#classtensorflow_1_1_tensor_1aa4ad1471d84dac07998b889b70172f4f)(DataType type, const TensorShape & shape, [Tensor](tensor#classtensorflow_1_1_tensor) *out_tensor)` | `Status` Initializes a tensor with the input `type` and `shape`, or returns an error and leaves `out_tensor` unmodified. | Public functions ---------------- ### AllocatedBytes ``` size_t AllocatedBytes() const ``` ### AsProtoField ``` void AsProtoField( TensorProto *proto ) const ``` Fills in `proto` with `*this` tensor's content. `[AsProtoField()](tensor#classtensorflow_1_1_tensor_1a55198b51aab7ca4ef312416c2b742eec)` fills in the repeated field for `proto.dtype()`, while `AsProtoTensorContent()` encodes the content in `proto.tensor_content()` in a compact form. ### AsProtoTensorContent ``` void AsProtoTensorContent( TensorProto *proto ) const ``` ### BitcastFrom ``` Status BitcastFrom( const Tensor & other, DataType dtype, const TensorShape & shape ) ``` Copy the other tensor into this tensor, reshape it and reinterpret the buffer's datatype. If Status::OK() is returned, the two tensors now share the same underlying storage. This call requires that the `other` tensor and the given type and shape are "compatible" (i.e. they occupy the same number of bytes). Specifically: shape.num\_elements() \* DataTypeSize(type) must equal other.num\_elements() \* DataTypeSize(other.dtype()) In addition, this function requires: * DataTypeSize(other.dtype()) != 0 * DataTypeSize(type) != 0 If any of the requirements are not met, errors::InvalidArgument is returned. ### CopyFrom ``` bool CopyFrom( const Tensor & other, const TensorShape & shape ) TF_MUST_USE_RESULT ``` Copy the other tensor into this tensor and reshape it. This tensor shares other's underlying storage. Returns `true` iff `other.shape()` has the same number of elements of the given `shape`. ### DebugString ``` std::string DebugString( int num_values ) const ``` A human-readable summary of the tensor suitable for debugging. ### DebugString ``` std::string DebugString() const ``` ### DeviceSafeDebugString ``` std::string DeviceSafeDebugString() const ``` ### FillDescription ``` void FillDescription( TensorDescription *description ) const ``` Fill in the `TensorDescription` proto with metadata about the tensor that is useful for monitoring and debugging. ### FromProto ``` bool FromProto( const TensorProto & other ) TF_MUST_USE_RESULT ``` Parse `other` and construct the tensor. Returns `true` iff the parsing succeeds. If the parsing fails, the state of `*this` is unchanged. ### FromProto ``` bool FromProto( Allocator *a, const TensorProto & other ) TF_MUST_USE_RESULT ``` ### GetMemoryType ``` AllocatorMemoryType GetMemoryType() const ``` ### IsAligned ``` bool IsAligned() const ``` Returns true iff this tensor is aligned. ### IsInitialized ``` bool IsInitialized() const ``` If necessary, has this [Tensor](tensor#classtensorflow_1_1_tensor) been initialized? Zero-element Tensors are always considered initialized, even if they have never been assigned to and do not have any memory allocated. ### IsSameSize ``` bool IsSameSize( const Tensor & b ) const ``` ### NumElements ``` int64_t NumElements() const ``` Convenience accessor for the tensor shape. ### RefCountIsOne ``` bool RefCountIsOne() const ``` ### SharesBufferWith ``` bool SharesBufferWith( const Tensor & b ) const ``` ### Slice ``` Tensor Slice( int64_t dim0_start, int64_t dim0_limit ) const ``` Slice this tensor along the 1st dimension. I.e., the returned tensor satisfies returned[i, ...] == this[dim0\_start + i, ...]. The returned tensor shares the underlying tensor buffer with this tensor. NOTE: The returned tensor may not satisfy the same alignment requirement as this tensor depending on the shape. The caller must check the returned tensor's alignment before calling certain methods that have alignment requirement (e.g., `[flat()](tensor#classtensorflow_1_1_tensor_1a67ce62becce1e70454d9756d1d5ed996)`, `tensor()`). NOTE: When fed with an N-dimensional tensor, this method returns a tensor also with N dimensions. If you want to select a sub tensor, see SubSlice. REQUIRES: `[dims()](tensor#classtensorflow_1_1_tensor_1ac8a173cc6c97184139bfd81ff45e7da9)` >= 1 REQUIRES: `0 <= dim0_start <= dim0_limit <= dim_size(0)` ### SubSlice ``` Tensor SubSlice( int64_t index ) const ``` Select a subslice from this tensor along the 1st dimension. When fed with an N-dimensional tensor, this method returns a tensor with N-1 dimensions, where the returned tensor is a subslice of the input tensor along the first dimension. The N-1 dimensions of the returned tensor are the last N-1 dimensions of the input tensor. NOTE: The returned tensor may not satisfy the same alignment requirement as this tensor depending on the shape. The caller must check the returned tensor's alignment before calling certain methods that have alignment requirement (e.g., `[flat()](tensor#classtensorflow_1_1_tensor_1a67ce62becce1e70454d9756d1d5ed996)`, `tensor()`). REQUIRES: `[dims()](tensor#classtensorflow_1_1_tensor_1ac8a173cc6c97184139bfd81ff45e7da9)` >= 1 REQUIRES: `0 <= index < dim_size(0)` ### SummarizeValue ``` std::string SummarizeValue( int64_t max_entries, bool print_v2 ) const ``` Render the first `max_entries` values in `*this` into a string. ### Tensor ``` Tensor() ``` Creates a 1-dimensional, 0-element float tensor. The returned [Tensor](tensor#classtensorflow_1_1_tensor) is not a scalar (shape {}), but is instead an empty one-dimensional [Tensor](tensor#classtensorflow_1_1_tensor) (shape {0}, [NumElements()](tensor#classtensorflow_1_1_tensor_1ae187c661b3add739bd7604b8ac053918) == 0). Since it has no elements, it does not need to be assigned a value and is initialized by default ([IsInitialized()](tensor#classtensorflow_1_1_tensor_1aa44336c38c4baf3ed69f63aee131ba87) is true). If this is undesirable, consider creating a one-element scalar which does require initialization: ``` Tensor(DT_FLOAT, TensorShape({})) ``` ### Tensor ``` Tensor( DataType type, const TensorShape & shape ) ``` Creates a [Tensor](tensor#classtensorflow_1_1_tensor) of the given `type` and `shape`. If LogMemory::IsEnabled() the allocation is logged as coming from an unknown kernel and step. Calling the [Tensor](tensor#classtensorflow_1_1_tensor) constructor directly from within an Op is deprecated: use the OpKernelConstruction/OpKernelContext allocate\_\* methods to allocate a new tensor, which record the kernel and step. The underlying buffer is allocated using a `CPUAllocator`. ### Tensor ``` Tensor( Allocator *a, DataType type, const TensorShape & shape ) ``` Creates a tensor with the input `type` and `shape`, using the allocator `a` to allocate the underlying buffer. If LogMemory::IsEnabled() the allocation is logged as coming from an unknown kernel and step. Calling the [Tensor](tensor#classtensorflow_1_1_tensor) constructor directly from within an Op is deprecated: use the OpKernelConstruction/OpKernelContext allocate\_\* methods to allocate a new tensor, which record the kernel and step. `a` must outlive the lifetime of this [Tensor](tensor#classtensorflow_1_1_tensor). ### Tensor ``` Tensor( Allocator *a, DataType type, const TensorShape & shape, const AllocationAttributes & allocation_attr ) ``` Creates a tensor with the input `type` and `shape`, using the allocator `a` and the specified "allocation\_attr" to allocate the underlying buffer. If the kernel and step are known allocation\_attr.allocation\_will\_be\_logged should be set to true and LogMemory::RecordTensorAllocation should be called after the tensor is constructed. Calling the [Tensor](tensor#classtensorflow_1_1_tensor) constructor directly from within an Op is deprecated: use the OpKernelConstruction/OpKernelContext allocate\_\* methods to allocate a new tensor, which record the kernel and step. `a` must outlive the lifetime of this [Tensor](tensor#classtensorflow_1_1_tensor). ### Tensor ``` Tensor( DataType type, const TensorShape & shape, TensorBuffer *buf ) ``` Creates a tensor with the input datatype, shape and buf. Acquires a ref on buf that belongs to this [Tensor](tensor#classtensorflow_1_1_tensor). ### Tensor ``` Tensor( DataType type, TensorShape shape, core::RefCountPtr< TensorBuffer > buf ) ``` Creates a tensor with the input datatype, shape and buf. Takes an ownership of the bufffer from the reference counted pointer. ### Tensor ``` Tensor( DataType type ) ``` Creates an empty [Tensor](tensor#classtensorflow_1_1_tensor) of the given data type. Like [Tensor()](tensor#classtensorflow_1_1_tensor_1aebe57070a84f43b98e63671f52a117fe), returns a 1-dimensional, 0-element [Tensor](tensor#classtensorflow_1_1_tensor) with [IsInitialized()](tensor#classtensorflow_1_1_tensor_1aa44336c38c4baf3ed69f63aee131ba87) returning True. See the [Tensor()](tensor#classtensorflow_1_1_tensor_1aebe57070a84f43b98e63671f52a117fe) documentation for details. ### Tensor ``` Tensor( float scalar_value ) ``` ### Tensor ``` Tensor( double scalar_value ) ``` ### Tensor ``` Tensor( int32_t scalar_value ) ``` ### Tensor ``` Tensor( uint32 scalar_value ) ``` ### Tensor ``` Tensor( uint16 scalar_value ) ``` ### Tensor ``` Tensor( uint8 scalar_value ) ``` ### Tensor ``` Tensor( int16_t scalar_value ) ``` ### Tensor ``` Tensor( int8_t scalar_value ) ``` ### Tensor ``` Tensor( tstring scalar_value ) ``` ### Tensor ``` Tensor( complex64 scalar_value ) ``` ### Tensor ``` Tensor( complex128 scalar_value ) ``` ### Tensor ``` Tensor( int64_t scalar_value ) ``` ### Tensor ``` Tensor( uint64 scalar_value ) ``` ### Tensor ``` Tensor( bool scalar_value ) ``` ### Tensor ``` Tensor( qint8 scalar_value ) ``` ### Tensor ``` Tensor( quint8 scalar_value ) ``` ### Tensor ``` Tensor( qint16 scalar_value ) ``` ### Tensor ``` Tensor( quint16 scalar_value ) ``` ### Tensor ``` Tensor( qint32 scalar_value ) ``` ### Tensor ``` Tensor( bfloat16 scalar_value ) ``` ### Tensor ``` Tensor( Eigen::half scalar_value ) ``` ### Tensor ``` Tensor( ResourceHandle scalar_value ) ``` ### Tensor ``` Tensor( const char *scalar_value ) ``` ### Tensor ``` Tensor( const Tensor & other ) ``` Copy constructor. ### Tensor ``` Tensor( Tensor && other ) ``` Move constructor. After this call, is safely destructible can be assigned to, and [IsInitialized()](tensor#classtensorflow_1_1_tensor_1aa44336c38c4baf3ed69f63aee131ba87) can be called and will return false. Other calls on (e.g. shape manipulation) are not valid. ### Tensor ``` Tensor( T *t )=delete ``` ### TotalBytes ``` size_t TotalBytes() const ``` Returns the estimated memory usage of this tensor. ### UnsafeCopyFromInternal ``` void UnsafeCopyFromInternal( const Tensor & other, DataType dtype, const TensorShape & shape ) ``` Like BitcastFrom, but CHECK fails if any preconditions are not met. Deprecated. Use BitcastFrom instead and check the returned Status. ### bit\_casted\_shaped ``` TTypes< T, NDIMS >::Tensor bit_casted_shaped( gtl::ArraySlice< int64_t > new_sizes ) ``` Return the tensor data to an `Eigen::Tensor` with the new shape specified in `new_sizes` and cast to a new dtype `T`. Using a bitcast is useful for move and copy operations. The allowed bitcast is the only difference from `shaped()`. ### bit\_casted\_shaped ``` TTypes< T, NDIMS >::ConstTensor bit_casted_shaped( gtl::ArraySlice< int64_t > new_sizes ) const ``` Return the tensor data to an `Eigen::Tensor` with the new shape specified in `new_sizes` and cast to a new dtype `T`. Using a bitcast is useful for move and copy operations. The allowed bitcast is the only difference from `shaped()`. ### bit\_casted\_tensor ``` TTypes< T, NDIMS >::Tensor bit_casted_tensor() ``` Return the tensor data to an `Eigen::Tensor` with the same size but a bitwise cast to the specified dtype `T`. Using a bitcast is useful for move and copy operations. NOTE: this is the same as `tensor()` except a bitcast is allowed. ### bit\_casted\_tensor ``` TTypes< T, NDIMS >::ConstTensor bit_casted_tensor() const ``` Return the tensor data to an `Eigen::Tensor` with the same size but a bitwise cast to the specified dtype `T`. Using a bitcast is useful for move and copy operations. NOTE: this is the same as `tensor()` except a bitcast is allowed. ### data ``` void * data() const ``` ### dim\_size ``` int64_t dim_size( int d ) const ``` Convenience accessor for the tensor shape. ### dims ``` int dims() const ``` Convenience accessor for the tensor shape. For all shape accessors, see comments for relevant methods of `TensorShape` in `tensor_shape.h`. ### dtype ``` DataType dtype() const ``` Returns the data type. ### flat ``` TTypes< T >::Flat flat() ``` Return the tensor data as an `Eigen::Tensor` of the data type and a specified shape. These methods allow you to access the data with the dimensions and sizes of your choice. You do not need to know the number of dimensions of the [Tensor](tensor#classtensorflow_1_1_tensor) to call them. However, they `CHECK` that the type matches and the dimensions requested creates an `Eigen::Tensor` with the same number of elements as the tensor. Example: ``` typedef float T; Tensor my_ten(...built with Shape{planes: 4, rows: 3, cols: 5}...); // 1D Eigen::Tensor, size 60: auto flat = my_ten.flat(); // 2D Eigen::Tensor 12 x 5: auto inner = my_ten.flat_inner_dims(); // 2D Eigen::Tensor 4 x 15: auto outer = my_ten.shaped({4, 15}); // CHECK fails, bad num elements: auto outer = my_ten.shaped({4, 8}); // 3D Eigen::Tensor 6 x 5 x 2: auto weird = my_ten.shaped({6, 5, 2}); // CHECK fails, type mismatch: auto bad = my_ten.flat(); ``` ### flat ``` TTypes< T >::ConstFlat flat() const ``` ### flat\_inner\_dims ``` TTypes< T, NDIMS >::Tensor flat_inner_dims() ``` Returns the data as an Eigen::Tensor with NDIMS dimensions, collapsing all [Tensor](tensor#classtensorflow_1_1_tensor) dimensions but the last NDIMS-1 into the first dimension of the result. If NDIMS > [dims()](tensor#classtensorflow_1_1_tensor_1ac8a173cc6c97184139bfd81ff45e7da9) then leading dimensions of size 1 will be added to make the output rank NDIMS. ### flat\_inner\_dims ``` TTypes< T, NDIMS >::ConstTensor flat_inner_dims() const ``` ### flat\_inner\_outer\_dims ``` TTypes< T, NDIMS >::Tensor flat_inner_outer_dims( int64_t begin ) ``` Returns the data as an Eigen::Tensor with NDIMS dimensions, collapsing the first 'begin' [Tensor](tensor#classtensorflow_1_1_tensor) dimensions into the first dimension of the result and the [Tensor](tensor#classtensorflow_1_1_tensor) dimensions of the last [dims()](tensor#classtensorflow_1_1_tensor_1ac8a173cc6c97184139bfd81ff45e7da9) - 'begin' - NDIMS into the last dimension of the result. If 'begin' < 0 then the |'begin'| leading dimensions of size 1 will be added. If 'begin' + NDIMS > [dims()](tensor#classtensorflow_1_1_tensor_1ac8a173cc6c97184139bfd81ff45e7da9) then 'begin' + NDIMS - [dims()](tensor#classtensorflow_1_1_tensor_1ac8a173cc6c97184139bfd81ff45e7da9) trailing dimensions of size 1 will be added. ### flat\_inner\_outer\_dims ``` TTypes< T, NDIMS >::ConstTensor flat_inner_outer_dims( int64_t begin ) const ``` ### flat\_outer\_dims ``` TTypes< T, NDIMS >::Tensor flat_outer_dims() ``` Returns the data as an Eigen::Tensor with NDIMS dimensions, collapsing all [Tensor](tensor#classtensorflow_1_1_tensor) dimensions but the first NDIMS-1 into the last dimension of the result. If NDIMS > [dims()](tensor#classtensorflow_1_1_tensor_1ac8a173cc6c97184139bfd81ff45e7da9) then trailing dimensions of size 1 will be added to make the output rank NDIMS. ### flat\_outer\_dims ``` TTypes< T, NDIMS >::ConstTensor flat_outer_dims() const ``` ### matrix ``` TTypes< T >::Matrix matrix() ``` ### matrix ``` TTypes< T >::ConstMatrix matrix() const ``` ### operator= ``` Tensor & operator=( const Tensor & other ) ``` Assign operator. This tensor shares other's underlying storage. ### operator= ``` Tensor & operator=( Tensor && other ) ``` Move operator. See move constructor for details. ### reinterpret\_last\_dimension ``` TTypes< T, NDIMS >::Tensor reinterpret_last_dimension() ``` Return the tensor data to an `Eigen::Tensor` with the last dimension elements converted into single elements of a larger type. For example, this is useful for kernels that can treat NCHW\_VECT\_C int8 tensors as NCHW int32 tensors. The sizeof(T) should equal the size of the original element type \* num elements in the original last dimension. NDIMS should be 1 less than the original number of dimensions. ### reinterpret\_last\_dimension ``` TTypes< T, NDIMS >::ConstTensor reinterpret_last_dimension() const ``` Return the tensor data to an `Eigen::Tensor` with the last dimension elements converted into single elements of a larger type. For example, this is useful for kernels that can treat NCHW\_VECT\_C int8 tensors as NCHW int32 tensors. The sizeof(T) should equal the size of the original element type \* num elements in the original last dimension. NDIMS should be 1 less than the original number of dimensions. ### scalar ``` TTypes< T >::Scalar scalar() ``` Return the [Tensor](tensor#classtensorflow_1_1_tensor) data as a `TensorMap` of fixed size 1: `TensorMap>`. Using `[scalar()](tensor#classtensorflow_1_1_tensor_1aacce92855f6b83eea728203de8016c78)` allows the compiler to perform optimizations as the size of the tensor is known at compile time. ### scalar ``` TTypes< T >::ConstScalar scalar() const ``` ### shape ``` const TensorShape & shape() const ``` Returns the shape of the tensor. ### shaped ``` TTypes< T, NDIMS >::Tensor shaped( gtl::ArraySlice< int64_t > new_sizes ) ``` ### shaped ``` TTypes< T, NDIMS >::ConstTensor shaped( gtl::ArraySlice< int64_t > new_sizes ) const ``` ### tensor ``` TTypes< T, NDIMS >::Tensor tensor() ``` ### tensor ``` TTypes< T, NDIMS >::ConstTensor tensor() const ``` ### tensor\_data ``` StringPiece tensor_data() const ``` Returns a `StringPiece` mapping the current tensor's buffer. The returned `StringPiece` may point to memory location on devices that the CPU cannot address directly. NOTE: The underlying tensor buffer is refcounted, so the lifetime of the contents mapped by the `StringPiece` matches the lifetime of the buffer; callers should arrange to make sure the buffer does not get destroyed while the `StringPiece` is still used. REQUIRES: `DataTypeCanUseMemcpy(dtype())`. ### unaligned\_flat ``` TTypes< T >::UnalignedFlat unaligned_flat() ``` ### unaligned\_flat ``` TTypes< T >::UnalignedConstFlat unaligned_flat() const ``` ### unaligned\_shaped ``` TTypes< T, NDIMS >::UnalignedTensor unaligned_shaped( gtl::ArraySlice< int64_t > new_sizes ) ``` ### unaligned\_shaped ``` TTypes< T, NDIMS >::UnalignedConstTensor unaligned_shaped( gtl::ArraySlice< int64_t > new_sizes ) const ``` ### vec ``` TTypes< T >::Vec vec() ``` Return the tensor data as an `Eigen::Tensor` with the type and sizes of this `[Tensor](tensor#classtensorflow_1_1_tensor)`. Use these methods when you know the data type and the number of dimensions of the [Tensor](tensor#classtensorflow_1_1_tensor) and you want an `Eigen::Tensor` automatically sized to the `[Tensor](tensor#classtensorflow_1_1_tensor)` sizes. The implementation check fails if either type or sizes mismatch. Example: ``` typedef float T; Tensor my_mat(...built with Shape{rows: 3, cols: 5}...); auto mat = my_mat.matrix(); // 2D Eigen::Tensor, 3 x 5. auto mat = my_mat.tensor(); // 2D Eigen::Tensor, 3 x 5. auto vec = my_mat.vec(); // CHECK fails as my_mat is 2D. auto vec = my_mat.tensor(); // CHECK fails as my_mat is 2D. auto mat = my_mat.matrix();// CHECK fails as type mismatch. ``` ### vec ``` TTypes< T >::ConstVec vec() const ``` Const versions of all the methods above. ### ~Tensor ``` ~Tensor() ``` Public static functions ----------------------- ### BuildTensor ``` Status BuildTensor( DataType type, const TensorShape & shape, Tensor *out_tensor ) ``` Initializes a tensor with the input `type` and `shape`, or returns an error and leaves `out_tensor` unmodified. This factory method should be used instead of the corresponding constructor if calling code cannot validate that the `DataType` is valid and supported. The underlying buffer is allocated using a `CPUAllocator`.
programming_docs
tensorflow_cpp tensorflow::Output tensorflow::Output ================== `#include <ops.h>` Represents a tensor value produced by an [Operation](operation#classtensorflow_1_1_operation). Summary ------- | Constructors and Destructors | | --- | | `[Output](#classtensorflow_1_1_output_1a0d2121a99a3d4ed318c7cf9e37e76f8c)()` | | `[Output](#classtensorflow_1_1_output_1a91c6476c6569576149e3fa6cb536ed81)(Node *n)` | | `[Output](#classtensorflow_1_1_output_1af38c71f4b32909a9b4608a4086715ea5)(Node *n, int32_t index)` | | `[Output](#classtensorflow_1_1_output_1a49ee55a8cd3772467564a9e123875e6f)(const [Operation](operation#classtensorflow_1_1_operation) & op, int32_t index)` | | Public functions | | --- | | `[hash](#classtensorflow_1_1_output_1a979abb35b45c059dba3b8d1a1e9f508c)() const` | `uint64` | | `[index](#classtensorflow_1_1_output_1a9024b918efa6c8efb17edc042bc2b380)() const` | `int32` | | `[name](#classtensorflow_1_1_output_1a5942b69be4601aaa3cc5730d686035ff)() const` | `std::string` | | `[node](#classtensorflow_1_1_output_1a7d04f2b1831c26f99bd63157337bee14)() const` | `Node *` | | `[op](#classtensorflow_1_1_output_1ab169b934723369ebfbe40efc83f9898a)() const` | `[Operation](operation#classtensorflow_1_1_operation)` | | `[operator==](#classtensorflow_1_1_output_1a10c4ecbacf9f27e13b8d59ed03d24a81)(const [Output](output#classtensorflow_1_1_output) & other) const` | `bool` | | `[type](#classtensorflow_1_1_output_1add42877fc0530856b137985d9987e9a9)() const` | `DataType` | Public functions ---------------- ### Output ``` Output()=default ``` ### Output ``` Output( Node *n ) ``` ### Output ``` Output( Node *n, int32_t index ) ``` ### Output ``` Output( const Operation & op, int32_t index ) ``` ### hash ``` uint64 hash() const ``` ### index ``` int32 index() const ``` ### name ``` std::string name() const ``` ### node ``` Node * node() const ``` ### op ``` Operation op() const ``` ### operator== ``` bool operator==( const Output & other ) const ``` ### type ``` DataType type() const ``` tensorflow_cpp tensorflow::Input tensorflow::Input ================= `#include <ops.h>` Represents a tensor value that can be used as an operand to an [Operation](operation#classtensorflow_1_1_operation). Summary ------- | Constructors and Destructors | | --- | | `[Input](#classtensorflow_1_1_input_1a0e79ff39192f9c6b9e075f5d03506631)(const [Output](output#classtensorflow_1_1_output) & o)` All of [Input](input#classtensorflow_1_1_input)'s constructors are implicit. | | `[Input](#classtensorflow_1_1_input_1a8c93ccd3e37a114d1435d2277fb06c92)(const T & v)` | | `[Input](#classtensorflow_1_1_input_1a4b3e58f8d74193c929c5c3c786d639c9)(const [Initializer](../../struct/tensorflow/input/initializer#structtensorflow_1_1_input_1_1_initializer) & init)` | | `[Input](#classtensorflow_1_1_input_1a20e29b76fe988c0a318157ff91bcf010)(const [Tensor](tensor#classtensorflow_1_1_tensor) & t)` | | `[Input](#classtensorflow_1_1_input_1ab08681c0de994b089b85320fca7ff787)(const std::initializer_list< [Initializer](../../struct/tensorflow/input/initializer#structtensorflow_1_1_input_1_1_initializer) > & init)` | | `[Input](#classtensorflow_1_1_input_1ae26564fdb8295597dc5493b95d6e8df7)(const std::string & name, int32_t i, DataType dt)` Constructor specifying a node name, index and datatype. | | Public functions | | --- | | `[data\_type](#classtensorflow_1_1_input_1a394b81fd7422c67e7801eed913fa4be5)() const` | `DataType` | | `[index](#classtensorflow_1_1_input_1ae9d029fada720f968ce3994b32eca24c)() const` | `int32` | | `[node](#classtensorflow_1_1_input_1ad10211f35c7502472ad4cc9e91655478)() const` | `Node *` | | `[node\_name](#classtensorflow_1_1_input_1a1e93b0ee7c526df8d650b79705428030)() const` | `std::string` | | `[status](#classtensorflow_1_1_input_1a3ab4cedd88106271069438efb2407ec6)() const` | `Status` | | `[tensor](#classtensorflow_1_1_input_1a7d7fddae545687445f4ac49dd1d62275)() const` | `const [Tensor](tensor#classtensorflow_1_1_tensor) &` | | Structs | | --- | | [tensorflow::Input::Initializer](../../struct/tensorflow/input/initializer) | [Initializer](../../struct/tensorflow/input/initializer#structtensorflow_1_1_input_1_1_initializer) enables constructing an [Input](input#classtensorflow_1_1_input) object from various kinds of C++ constants such as simple primitive constants and nested initializer lists representing a multi-dimensional array. | Public functions ---------------- ### Input ``` Input( const Output & o ) ``` All of [Input](input#classtensorflow_1_1_input)'s constructors are implicit. [Input](input#classtensorflow_1_1_input) can be implicitly constructed from the following objects : * [Output](output#classtensorflow_1_1_output): This is so that the output of an [Operation](operation#classtensorflow_1_1_operation) can be directly used as the input to a op wrapper, which takes Inputs. * A scalar, or a multi-dimensional tensor specified as a recursive initializer list. This enables directly passing constants as inputs to op wrappers. * A [Tensor](tensor#classtensorflow_1_1_tensor) object. ### Input ``` Input( const T & v ) ``` ### Input ``` Input( const Initializer & init ) ``` ### Input ``` Input( const Tensor & t ) ``` ### Input ``` Input( const std::initializer_list< Initializer > & init ) ``` ### Input ``` Input( const std::string & name, int32_t i, DataType dt ) ``` Constructor specifying a node name, index and datatype. This should only be used for specifying a backward edge, needed by control flow. ### data\_type ``` DataType data_type() const ``` ### index ``` int32 index() const ``` ### node ``` Node * node() const ``` ### node\_name ``` std::string node_name() const ``` ### status ``` Status status() const ``` ### tensor ``` const Tensor & tensor() const ``` tensorflow_cpp tensorflow::Scope tensorflow::Scope ================= `#include <scope.h>` A `[Scope](scope#classtensorflow_1_1_scope)` object represents a set of related TensorFlow ops that have the same properties such as a common name prefix. Summary ------- A [Scope](scope#classtensorflow_1_1_scope) object is a container for TensorFlow Op properties. Op constructors get a [Scope](scope#classtensorflow_1_1_scope) object as a mandatory first argument and the constructed op acquires the properties in the object. A simple example: ``` using namespace ops; Scope root = Scope::NewRootScope(); auto c1 = Const(root, { {1, 1} }); auto m = MatMul(root, c1, { {41}, {1} }); GraphDef gdef; Status s = root.ToGraphDef(&gdef); if (!s.ok()) { ... } ``` [Scope](scope#classtensorflow_1_1_scope) hierarchy: The [Scope](scope#classtensorflow_1_1_scope) class provides various With<> functions that create a new scope. The new scope typically has one property changed while other properties are inherited from the parent scope. NewSubScope(name) method appends `name` to the prefix of names for ops created within the scope, and [WithOpName()](scope#classtensorflow_1_1_scope_1aa716951887f54604c548553e1302fdb3) changes the suffix which otherwise defaults to the type of the op. Name examples: ``` Scope root = Scope::NewRootScope(); Scope linear = root.NewSubScope("linear"); // W will be named "linear/W" auto W = Variable(linear.WithOpName("W"), {2, 2}, DT_FLOAT); // b will be named "linear/b_3" int idx = 3; auto b = Variable(linear.WithOpName("b_", idx), {2}, DT_FLOAT); auto x = Const(linear, {...}); // name: "linear/Const" auto m = MatMul(linear, x, W); // name: "linear/MatMul" auto r = BiasAdd(linear, m, b); // name: "linear/BiasAdd" ``` [Scope](scope#classtensorflow_1_1_scope) lifetime: A new scope is created by calling [Scope::NewRootScope](scope#classtensorflow_1_1_scope_1a2bd1e548f919654da8f57402f844326c). This creates some resources that are shared by all the child scopes that inherit from this scope, directly or transitively. For instance, a new scope creates a new Graph object to which operations are added when the new scope or its children are used by an Op constructor. The new scope also has a Status object which will be used to indicate errors by Op-constructor functions called on any child scope. The Op-constructor functions have to check the scope's status by calling the ok() method before proceeding to construct the op. Thread safety: A `[Scope](scope#classtensorflow_1_1_scope)` object is NOT thread-safe. Threads cannot concurrently call op-constructor functions on the same `[Scope](scope#classtensorflow_1_1_scope)` object. | Constructors and Destructors | | --- | | `[Scope](#classtensorflow_1_1_scope_1a1570deec3468ec4b858094b5b1a2f727)(const [Scope](scope#classtensorflow_1_1_scope) & other)` | | `[~Scope](#classtensorflow_1_1_scope_1aa3b7d137ed47ff8d5fcc1cc114a181df)()` | | Public functions | | --- | | `[ClearColocation](#classtensorflow_1_1_scope_1a385a544bd9ed2ef7805edf79e7be684f)() const` | `[Scope](scope#classtensorflow_1_1_scope)` Clear all colocation constraints. | | `[ColocateWith](#classtensorflow_1_1_scope_1a6ad18f3a902eb624f93051812e19705a)(const [Operation](operation#classtensorflow_1_1_operation) & op) const` | `[Scope](scope#classtensorflow_1_1_scope)` Return a new scope. | | `[ColocateWith](#classtensorflow_1_1_scope_1a0968351b7ff04a358364e7754008fbac)(const [Output](output#classtensorflow_1_1_output) & out) const` | `[Scope](scope#classtensorflow_1_1_scope)` Convenience function for above. | | `[ExitOnError](#classtensorflow_1_1_scope_1ad3fd7ca2c3691a174d4ec3d7571277f8)() const` | `[Scope](scope#classtensorflow_1_1_scope)` Return a new scope. | | `[GetCompositeOpScopes](#classtensorflow_1_1_scope_1aaf707349b4c310fd8eb2198037d590cd)(const string & composite_op_name) const` | `[CompositeOpScopes](../../struct/tensorflow/composite-op-scopes#structtensorflow_1_1_composite_op_scopes)` | | `[GetUniqueNameForOp](#classtensorflow_1_1_scope_1adc0862bbd6f5dd7e801e85aef1b3d244)(const string & default_name) const` | `string` Return a unique name, using default\_name if an op name has not been specified. | | `[NewSubScope](#classtensorflow_1_1_scope_1af9f03ca7ef0fdefd9b49378c19421210)(const string & child_scope_name) const` | `[Scope](scope#classtensorflow_1_1_scope)` Return a new scope. | | `[ToGraphDef](#classtensorflow_1_1_scope_1a48c527e5fd2d3735cf89474714fe1fb8)(GraphDef *gdef) const` | `Status` If status() is Status::OK(), convert the Graph object stored in this scope to a GraphDef proto and return Status::OK(). | | `[UpdateStatus](#classtensorflow_1_1_scope_1a3b4f0dbfe674d44c09fe3abb8ad8d743)(const Status & s) const` | `void` Update the status on this scope. | | `[WithAssignedDevice](#classtensorflow_1_1_scope_1ad8e5fff9ad2614f43b59e370525adaec)(const string & assigned_device) const` | `[Scope](scope#classtensorflow_1_1_scope)` Returns a new scope. | | `[WithControlDependencies](#classtensorflow_1_1_scope_1a1df93e2ab5b0ab40ebba3028ac8b34c7)(const gtl::ArraySlice< [Operation](operation#classtensorflow_1_1_operation) > & control_deps) const` | `[Scope](scope#classtensorflow_1_1_scope)` Return a new scope. | | `[WithControlDependencies](#classtensorflow_1_1_scope_1ae11bf1782c17453f8ed2f6338b6e3c18)(const [Output](output#classtensorflow_1_1_output) & control_dep) const` | `[Scope](scope#classtensorflow_1_1_scope)` Same as above, but convenient to add control dependency on the operation producing the control\_dep output. | | `[WithDevice](#classtensorflow_1_1_scope_1a89df9fb352b5c7a258cd05aaf4b244f0)(const string & device) const` | `[Scope](scope#classtensorflow_1_1_scope)` Return a new scope. | | `[WithKernelLabel](#classtensorflow_1_1_scope_1a56c8e5b2a135d7149ec21b7c959d2e76)(const string & kernel_label) const` | `[Scope](scope#classtensorflow_1_1_scope)` Return a new scope. | | `[WithNoControlDependencies](#classtensorflow_1_1_scope_1a36af05b4dc1259caefd99539679e3733)() const` | `[Scope](scope#classtensorflow_1_1_scope)` Return a new scope. | | `[WithOpName](#classtensorflow_1_1_scope_1aa716951887f54604c548553e1302fdb3)(Ty... fragments) const` | `[Scope](scope#classtensorflow_1_1_scope)` Return a new scope. | | `[WithXlaCluster](#classtensorflow_1_1_scope_1a4944da564e7de504b29c534f5f88bfa9)(const string & xla_cluster) const` | `[Scope](scope#classtensorflow_1_1_scope)` Returns a new scope. | | `[control\_deps](#classtensorflow_1_1_scope_1a910cb669ff111f1b3b60a2fb1b18d0c7)() const` | `const std::vector< [Operation](operation#classtensorflow_1_1_operation) > &` | | `[graph](#classtensorflow_1_1_scope_1a19ac1f773b43a58ac8bbb02d6b57e6a0)() const` | `Graph *` | | `[graph\_as\_shared\_ptr](#classtensorflow_1_1_scope_1a4e2e9083eaf863ee2269ecc069dc8544)() const` | `std::shared_ptr< Graph >` | | `[ok](#classtensorflow_1_1_scope_1ab12601e783c660848b2a1d396cddcb03)() const` | `bool` | | `[operator=](#classtensorflow_1_1_scope_1a5d0e6525c7a10d5ff62035281656f25a)(const [Scope](scope#classtensorflow_1_1_scope) & other)` | `[Scope](scope#classtensorflow_1_1_scope) &` | | `[status](#classtensorflow_1_1_scope_1ac00d31d253853dacaab991a685fad31c)() const` | `Status` | | Public static functions | | --- | | `[NewRootScope](#classtensorflow_1_1_scope_1a2bd1e548f919654da8f57402f844326c)()` | `[Scope](scope#classtensorflow_1_1_scope)` Return a new scope. | Public functions ---------------- ### ClearColocation ``` Scope ClearColocation() const ``` Clear all colocation constraints. ### ColocateWith ``` Scope ColocateWith( const Operation & op ) const ``` Return a new scope. All ops created within the returned scope will be co-located on the device where op is placed. NOTE: This function is intended to be use internal libraries only for controlling placement of ops on to devices. Public use is not encouraged because the implementation of device placement is subject to change. ### ColocateWith ``` Scope ColocateWith( const Output & out ) const ``` Convenience function for above. ### ExitOnError ``` Scope ExitOnError() const ``` Return a new scope. The op-constructor functions taking the returned scope as the scope argument will exit as soon as an error is detected, instead of setting the status on the scope. ### GetCompositeOpScopes ``` CompositeOpScopes GetCompositeOpScopes( const string & composite_op_name ) const ``` ### GetUniqueNameForOp ``` string GetUniqueNameForOp( const string & default_name ) const ``` Return a unique name, using default\_name if an op name has not been specified. ### NewSubScope ``` Scope NewSubScope( const string & child_scope_name ) const ``` Return a new scope. Ops created with this scope will have `name/child_scope_name` as the prefix. The actual name will be unique in the current scope. All other properties are inherited from the current scope. If `child_scope_name` is empty, the `/` is elided. ### Scope ``` Scope( const Scope & other ) ``` ### ToGraphDef ``` Status ToGraphDef( GraphDef *gdef ) const ``` If status() is Status::OK(), convert the Graph object stored in this scope to a GraphDef proto and return Status::OK(). Otherwise, return the error status as is without performing GraphDef conversion. ### UpdateStatus ``` void UpdateStatus( const Status & s ) const ``` Update the status on this scope. Note: The status object is shared between all children of this scope. If the resulting status is not Status::OK() and exit\_on\_error\_ is set on this scope, this function exits by calling LOG(FATAL). ### WithAssignedDevice ``` Scope WithAssignedDevice( const string & assigned_device ) const ``` Returns a new scope. All ops created within the returned scope will have their assigned device set to `assigned_device`. ### WithControlDependencies ``` Scope WithControlDependencies( const gtl::ArraySlice< Operation > & control_deps ) const ``` Return a new scope. All ops created within the returned scope will have as control dependencies the union of operations in the control\_deps vector and the control dependencies of the current scope. ### WithControlDependencies ``` Scope WithControlDependencies( const Output & control_dep ) const ``` Same as above, but convenient to add control dependency on the operation producing the control\_dep output. ### WithDevice ``` Scope WithDevice( const string & device ) const ``` Return a new scope. All ops created within the returned scope will have the device field set to 'device'. ### WithKernelLabel ``` Scope WithKernelLabel( const string & kernel_label ) const ``` Return a new scope. All ops created with the new scope will have kernel\_label as the value for their '\_kernel' attribute; ### WithNoControlDependencies ``` Scope WithNoControlDependencies() const ``` Return a new scope. All ops created within the returned scope will have no control dependencies on other operations. ### WithOpName ``` Scope WithOpName( Ty... fragments ) const ``` Return a new scope. All ops created within the returned scope will have names of the form `name/StrCat(fragments...)[_suffix]` ### WithXlaCluster ``` Scope WithXlaCluster( const string & xla_cluster ) const ``` Returns a new scope. All ops created within the returned scope will have their \_XlaCluster attribute set to `xla_cluster`. ### control\_deps ``` const std::vector< Operation > & control_deps() const ``` ### graph ``` Graph * graph() const ``` ### graph\_as\_shared\_ptr ``` std::shared_ptr< Graph > graph_as_shared_ptr() const ``` ### ok ``` bool ok() const ``` ### operator= ``` Scope & operator=( const Scope & other ) ``` ### status ``` Status status() const ``` ### ~Scope ``` ~Scope() ``` Public static functions ----------------------- ### NewRootScope ``` Scope NewRootScope() ``` Return a new scope. This creates a new graph and all operations constructed in this graph should use the returned object as the "root" scope. tensorflow_cpp tensorflow::ops::OrderedMapSize tensorflow::ops::OrderedMapSize =============================== `#include <data_flow_ops.h>` Op returns the number of elements in the underlying container. Summary ------- Args: * scope: A [Scope](../scope#classtensorflow_1_1_scope) object Returns: * `[Output](../output#classtensorflow_1_1_output)`: The size tensor. | Constructors and Destructors | | --- | | `[OrderedMapSize](#classtensorflow_1_1ops_1_1_ordered_map_size_1aae44c852705b9a5fae033b760054bda4)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, const DataTypeSlice & dtypes)` | | `[OrderedMapSize](#classtensorflow_1_1ops_1_1_ordered_map_size_1a3e3f1ed661e041c34c095ae954a233a2)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, const DataTypeSlice & dtypes, const [OrderedMapSize::Attrs](../../../struct/tensorflow/ops/ordered-map-size/attrs#structtensorflow_1_1ops_1_1_ordered_map_size_1_1_attrs) & attrs)` | | Public attributes | | --- | | `[operation](#classtensorflow_1_1ops_1_1_ordered_map_size_1a84782675330e7f54b3a6282139255ef1)` | `[Operation](../operation#classtensorflow_1_1_operation)` | | `[size](#classtensorflow_1_1ops_1_1_ordered_map_size_1a0315fb5fb002c3766754c9ad72eca732)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` | | Public functions | | --- | | `[node](#classtensorflow_1_1ops_1_1_ordered_map_size_1a25fb24fb67917db59123e9d1ee943e73)() const` | `::tensorflow::Node *` | | `[operator::tensorflow::Input](#classtensorflow_1_1ops_1_1_ordered_map_size_1ae2e60b4466f7e94892399fc6c7fef76b)() const` | | | `[operator::tensorflow::Output](#classtensorflow_1_1ops_1_1_ordered_map_size_1abd5c2591832c8e1a572f1a52f3310388)() const` | | | Public static functions | | --- | | `[Capacity](#classtensorflow_1_1ops_1_1_ordered_map_size_1a2bf4beaa89a50aeb89ddd99b7a7ace02)(int64 x)` | `[Attrs](../../../struct/tensorflow/ops/ordered-map-size/attrs#structtensorflow_1_1ops_1_1_ordered_map_size_1_1_attrs)` | | `[Container](#classtensorflow_1_1ops_1_1_ordered_map_size_1a3cc16c2b94272461e70e753d7be62ea1)(StringPiece x)` | `[Attrs](../../../struct/tensorflow/ops/ordered-map-size/attrs#structtensorflow_1_1ops_1_1_ordered_map_size_1_1_attrs)` | | `[MemoryLimit](#classtensorflow_1_1ops_1_1_ordered_map_size_1a3e7894f036a50eec280d365adf447068)(int64 x)` | `[Attrs](../../../struct/tensorflow/ops/ordered-map-size/attrs#structtensorflow_1_1ops_1_1_ordered_map_size_1_1_attrs)` | | `[SharedName](#classtensorflow_1_1ops_1_1_ordered_map_size_1a55f472be8d77cad30d879c72358ce649)(StringPiece x)` | `[Attrs](../../../struct/tensorflow/ops/ordered-map-size/attrs#structtensorflow_1_1ops_1_1_ordered_map_size_1_1_attrs)` | | Structs | | --- | | [tensorflow::ops::OrderedMapSize::Attrs](../../../struct/tensorflow/ops/ordered-map-size/attrs) | Optional attribute setters for [OrderedMapSize](ordered-map-size#classtensorflow_1_1ops_1_1_ordered_map_size). | Public attributes ----------------- ### operation ``` Operation operation ``` ### size ``` ::tensorflow::Output size ``` Public functions ---------------- ### OrderedMapSize ``` OrderedMapSize( const ::tensorflow::Scope & scope, const DataTypeSlice & dtypes ) ``` ### OrderedMapSize ``` OrderedMapSize( const ::tensorflow::Scope & scope, const DataTypeSlice & dtypes, const OrderedMapSize::Attrs & attrs ) ``` ### node ``` ::tensorflow::Node * node() const ``` ### operator::tensorflow::Input ``` operator::tensorflow::Input() const ``` ### operator::tensorflow::Output ``` operator::tensorflow::Output() const ``` Public static functions ----------------------- ### Capacity ``` Attrs Capacity( int64 x ) ``` ### Container ``` Attrs Container( StringPiece x ) ``` ### MemoryLimit ``` Attrs MemoryLimit( int64 x ) ``` ### SharedName ``` Attrs SharedName( StringPiece x ) ```
programming_docs
tensorflow_cpp tensorflow::ops::MaxPoolGradV2 tensorflow::ops::MaxPoolGradV2 ============================== `#include <nn_ops.h>` Computes gradients of the maxpooling function. Summary ------- Args: * scope: A [Scope](../scope#classtensorflow_1_1_scope) object * orig\_input: The original input tensor. * orig\_output: The original output tensor. * grad: 4-D. Gradients w.r.t. the output of `max_pool`. * ksize: The size of the window for each dimension of the input tensor. * strides: The stride of the sliding window for each dimension of the input tensor. * padding: The type of padding algorithm to use. Optional attributes (see `[Attrs](../../../struct/tensorflow/ops/max-pool-grad-v2/attrs#structtensorflow_1_1ops_1_1_max_pool_grad_v2_1_1_attrs)`): * data\_format: Specify the data format of the input and output data. With the default format "NHWC", the data is stored in the order of: [batch, in\_height, in\_width, in\_channels]. Alternatively, the format could be "NCHW", the data storage order of: [batch, in\_channels, in\_height, in\_width]. Returns: * `[Output](../output#classtensorflow_1_1_output)`: Gradients w.r.t. the input to `max_pool`. | Constructors and Destructors | | --- | | `[MaxPoolGradV2](#classtensorflow_1_1ops_1_1_max_pool_grad_v2_1ab05c91a5c4bc07d0805b7dd2aab3270f)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) orig_input, ::[tensorflow::Input](../input#classtensorflow_1_1_input) orig_output, ::[tensorflow::Input](../input#classtensorflow_1_1_input) grad, ::[tensorflow::Input](../input#classtensorflow_1_1_input) ksize, ::[tensorflow::Input](../input#classtensorflow_1_1_input) strides, StringPiece padding)` | | `[MaxPoolGradV2](#classtensorflow_1_1ops_1_1_max_pool_grad_v2_1a8d813c2e82262a2cd8c5fbc9ecdf127f)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) orig_input, ::[tensorflow::Input](../input#classtensorflow_1_1_input) orig_output, ::[tensorflow::Input](../input#classtensorflow_1_1_input) grad, ::[tensorflow::Input](../input#classtensorflow_1_1_input) ksize, ::[tensorflow::Input](../input#classtensorflow_1_1_input) strides, StringPiece padding, const [MaxPoolGradV2::Attrs](../../../struct/tensorflow/ops/max-pool-grad-v2/attrs#structtensorflow_1_1ops_1_1_max_pool_grad_v2_1_1_attrs) & attrs)` | | Public attributes | | --- | | `[operation](#classtensorflow_1_1ops_1_1_max_pool_grad_v2_1aaad457667ae559908a921e1d1c4f2ab9)` | `[Operation](../operation#classtensorflow_1_1_operation)` | | `[output](#classtensorflow_1_1ops_1_1_max_pool_grad_v2_1a7e6ea6a7f4e725e44f3a2a4453da42e1)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` | | Public functions | | --- | | `[node](#classtensorflow_1_1ops_1_1_max_pool_grad_v2_1a3ba2667fa5f803170177b6a35c3a5ea3)() const` | `::tensorflow::Node *` | | `[operator::tensorflow::Input](#classtensorflow_1_1ops_1_1_max_pool_grad_v2_1af364ab8343392987a021cd3e814bad27)() const` | | | `[operator::tensorflow::Output](#classtensorflow_1_1ops_1_1_max_pool_grad_v2_1a1f3db6b67dad10302ab3d01182106bb5)() const` | | | Public static functions | | --- | | `[DataFormat](#classtensorflow_1_1ops_1_1_max_pool_grad_v2_1a4a13c35107a928a801ddff9fc350497b)(StringPiece x)` | `[Attrs](../../../struct/tensorflow/ops/max-pool-grad-v2/attrs#structtensorflow_1_1ops_1_1_max_pool_grad_v2_1_1_attrs)` | | Structs | | --- | | [tensorflow::ops::MaxPoolGradV2::Attrs](../../../struct/tensorflow/ops/max-pool-grad-v2/attrs) | Optional attribute setters for [MaxPoolGradV2](max-pool-grad-v2#classtensorflow_1_1ops_1_1_max_pool_grad_v2). | Public attributes ----------------- ### operation ``` Operation operation ``` ### output ``` ::tensorflow::Output output ``` Public functions ---------------- ### MaxPoolGradV2 ``` MaxPoolGradV2( const ::tensorflow::Scope & scope, ::tensorflow::Input orig_input, ::tensorflow::Input orig_output, ::tensorflow::Input grad, ::tensorflow::Input ksize, ::tensorflow::Input strides, StringPiece padding ) ``` ### MaxPoolGradV2 ``` MaxPoolGradV2( const ::tensorflow::Scope & scope, ::tensorflow::Input orig_input, ::tensorflow::Input orig_output, ::tensorflow::Input grad, ::tensorflow::Input ksize, ::tensorflow::Input strides, StringPiece padding, const MaxPoolGradV2::Attrs & attrs ) ``` ### node ``` ::tensorflow::Node * node() const ``` ### operator::tensorflow::Input ``` operator::tensorflow::Input() const ``` ### operator::tensorflow::Output ``` operator::tensorflow::Output() const ``` Public static functions ----------------------- ### DataFormat ``` Attrs DataFormat( StringPiece x ) ``` tensorflow_cpp tensorflow::ops::SerializeTensor tensorflow::ops::SerializeTensor ================================ `#include <parsing_ops.h>` Transforms a [Tensor](../tensor#classtensorflow_1_1_tensor) into a serialized TensorProto proto. Summary ------- Args: * scope: A [Scope](../scope#classtensorflow_1_1_scope) object * tensor: A [Tensor](../tensor#classtensorflow_1_1_tensor) of type `T`. Returns: * `[Output](../output#classtensorflow_1_1_output)`: A serialized TensorProto proto of the input tensor. | Constructors and Destructors | | --- | | `[SerializeTensor](#classtensorflow_1_1ops_1_1_serialize_tensor_1a8e96e98765e90edc7aebb662247402d7)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) tensor)` | | Public attributes | | --- | | `[operation](#classtensorflow_1_1ops_1_1_serialize_tensor_1abdd8dfe6059f320b50471aac07da37d8)` | `[Operation](../operation#classtensorflow_1_1_operation)` | | `[serialized](#classtensorflow_1_1ops_1_1_serialize_tensor_1a9f1cd2f66c55265e5173426ddca6eacf)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` | | Public functions | | --- | | `[node](#classtensorflow_1_1ops_1_1_serialize_tensor_1a539b7cfcdd7c6871a441ed0364c2352e)() const` | `::tensorflow::Node *` | | `[operator::tensorflow::Input](#classtensorflow_1_1ops_1_1_serialize_tensor_1a45ae2d1c28c6641455567d7d43b3eb73)() const` | | | `[operator::tensorflow::Output](#classtensorflow_1_1ops_1_1_serialize_tensor_1a1935b897e2eddfed9da0aefead0ae905)() const` | | Public attributes ----------------- ### operation ``` Operation operation ``` ### serialized ``` ::tensorflow::Output serialized ``` Public functions ---------------- ### SerializeTensor ``` SerializeTensor( const ::tensorflow::Scope & scope, ::tensorflow::Input tensor ) ``` ### node ``` ::tensorflow::Node * node() const ``` ### operator::tensorflow::Input ``` operator::tensorflow::Input() const ``` ### operator::tensorflow::Output ``` operator::tensorflow::Output() const ``` tensorflow_cpp tensorflow::ops::SparseSparseMaximum tensorflow::ops::SparseSparseMaximum ==================================== `#include <sparse_ops.h>` Returns the element-wise max of two SparseTensors. Summary ------- Assumes the two SparseTensors have the same shape, i.e., no broadcasting. Args: * scope: A [Scope](../scope#classtensorflow_1_1_scope) object * a\_indices: 2-D. `N x R` matrix with the indices of non-empty values in a SparseTensor, in the canonical lexicographic ordering. * a\_values: 1-D. `N` non-empty values corresponding to `a_indices`. * a\_shape: 1-D. Shape of the input SparseTensor. * b\_indices: counterpart to `a_indices` for the other operand. * b\_values: counterpart to `a_values` for the other operand; must be of the same dtype. * b\_shape: counterpart to `a_shape` for the other operand; the two shapes must be equal. Returns: * `[Output](../output#classtensorflow_1_1_output)` output\_indices: 2-D. The indices of the output SparseTensor. * `[Output](../output#classtensorflow_1_1_output)` output\_values: 1-D. The values of the output SparseTensor. | Constructors and Destructors | | --- | | `[SparseSparseMaximum](#classtensorflow_1_1ops_1_1_sparse_sparse_maximum_1a565b62c482eb0b256e0161968b5a5b98)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) a_indices, ::[tensorflow::Input](../input#classtensorflow_1_1_input) a_values, ::[tensorflow::Input](../input#classtensorflow_1_1_input) a_shape, ::[tensorflow::Input](../input#classtensorflow_1_1_input) b_indices, ::[tensorflow::Input](../input#classtensorflow_1_1_input) b_values, ::[tensorflow::Input](../input#classtensorflow_1_1_input) b_shape)` | | Public attributes | | --- | | `[operation](#classtensorflow_1_1ops_1_1_sparse_sparse_maximum_1ab3980c4129285e7e81a781268c810722)` | `[Operation](../operation#classtensorflow_1_1_operation)` | | `[output\_indices](#classtensorflow_1_1ops_1_1_sparse_sparse_maximum_1a72bec4470a0c859b5456bb5298c216c9)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` | | `[output\_values](#classtensorflow_1_1ops_1_1_sparse_sparse_maximum_1a7ca61cc084806e0d598780a6a8e8b11d)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` | Public attributes ----------------- ### operation ``` Operation operation ``` ### output\_indices ``` ::tensorflow::Output output_indices ``` ### output\_values ``` ::tensorflow::Output output_values ``` Public functions ---------------- ### SparseSparseMaximum ``` SparseSparseMaximum( const ::tensorflow::Scope & scope, ::tensorflow::Input a_indices, ::tensorflow::Input a_values, ::tensorflow::Input a_shape, ::tensorflow::Input b_indices, ::tensorflow::Input b_values, ::tensorflow::Input b_shape ) ``` tensorflow_cpp tensorflow::ops::SegmentMin tensorflow::ops::SegmentMin =========================== `#include <math_ops.h>` Computes the minimum along segments of a tensor. Summary ------- Read [the section on segmentation](https://tensorflow.org/api_docs/python/tf/math#Segmentation) for an explanation of segments. Computes a tensor such that \(output\_i = \min\_j(data\_j)\) where `min` is over `j` such that `segment_ids[j] == i`. If the min is empty for a given segment ID `i`, `output[i] = 0`. Caution: On CPU, values in `segment_ids` are always validated to be sorted, and an error is thrown for indices that are not increasing. On GPU, this does not throw an error for unsorted indices. On GPU, out-of-order indices result in safe but unspecified behavior, which may include treating out-of-order indices as the same as a smaller following index. ![](https://www.tensorflow.org/versions/r2.9/api_docs/cc/images/SegmentMin.png) For example: c = tf.constant([[1,2,3,4], [4, 3, 2, 1], [5,6,7,8]]) tf.math.segment\_min(c, tf.constant([0, 0, 1])).numpy() array([[1, 2, 2, 1], [5, 6, 7, 8]], dtype=int32) Args: * scope: A [Scope](../scope#classtensorflow_1_1_scope) object * segment\_ids: A 1-D tensor whose size is equal to the size of `data`'s first dimension. Values should be sorted and can be repeated. Caution: The values are always validated to be sorted on CPU, never validated on GPU. Returns: * `[Output](../output#classtensorflow_1_1_output)`: Has same shape as data, except for dimension 0 which has size `k`, the number of segments. | Constructors and Destructors | | --- | | `[SegmentMin](#classtensorflow_1_1ops_1_1_segment_min_1a3012dce1d5e46fd538083a4543420a89)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) data, ::[tensorflow::Input](../input#classtensorflow_1_1_input) segment_ids)` | | Public attributes | | --- | | `[operation](#classtensorflow_1_1ops_1_1_segment_min_1a1dd3ab9be4244f9e51ee31f1249735ff)` | `[Operation](../operation#classtensorflow_1_1_operation)` | | `[output](#classtensorflow_1_1ops_1_1_segment_min_1aa79a959666dedb9e81ae623ed8ba28a8)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` | | Public functions | | --- | | `[node](#classtensorflow_1_1ops_1_1_segment_min_1a0315622df52ece6431d28d99520c1eef)() const` | `::tensorflow::Node *` | | `[operator::tensorflow::Input](#classtensorflow_1_1ops_1_1_segment_min_1aa2819b4005543663b84fe92fcbbec66a)() const` | | | `[operator::tensorflow::Output](#classtensorflow_1_1ops_1_1_segment_min_1a479837a013d764ff8d54553f71f32b83)() const` | | Public attributes ----------------- ### operation ``` Operation operation ``` ### output ``` ::tensorflow::Output output ``` Public functions ---------------- ### SegmentMin ``` SegmentMin( const ::tensorflow::Scope & scope, ::tensorflow::Input data, ::tensorflow::Input segment_ids ) ``` ### node ``` ::tensorflow::Node * node() const ``` ### operator::tensorflow::Input ``` operator::tensorflow::Input() const ``` ### operator::tensorflow::Output ``` operator::tensorflow::Output() const ``` tensorflow_cpp tensorflow::ops::ArgMin tensorflow::ops::ArgMin ======================= `#include <math_ops.h>` Returns the index with the smallest value across dimensions of a tensor. Summary ------- Note that in case of ties the identity of the return value is not guaranteed. Usage: ``` import tensorflow as tf a = [1, 10, 26.9, 2.8, 166.32, 62.3] b = tf.math.argmin(input = a) c = tf.keras.backend.eval(b) # c = 0 # here a[0] = 1 which is the smallest element of a across axis 0 ``` Args: * scope: A [Scope](../scope#classtensorflow_1_1_scope) object * dimension: int32 or int64, must be in the range `[-rank(input), rank(input))`. Describes which dimension of the input [Tensor](../tensor#classtensorflow_1_1_tensor) to reduce across. For vectors, use dimension = 0. Returns: * `[Output](../output#classtensorflow_1_1_output)`: The output tensor. | Constructors and Destructors | | --- | | `[ArgMin](#classtensorflow_1_1ops_1_1_arg_min_1a168791dd65474f6516ead5c14c228809)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) input, ::[tensorflow::Input](../input#classtensorflow_1_1_input) dimension)` | | `[ArgMin](#classtensorflow_1_1ops_1_1_arg_min_1a585efda09c698305c3b4d4bd52e2ef89)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) input, ::[tensorflow::Input](../input#classtensorflow_1_1_input) dimension, const [ArgMin::Attrs](../../../struct/tensorflow/ops/arg-min/attrs#structtensorflow_1_1ops_1_1_arg_min_1_1_attrs) & attrs)` | | Public attributes | | --- | | `[operation](#classtensorflow_1_1ops_1_1_arg_min_1a2f56dc97fc445cb193387875c3d85750)` | `[Operation](../operation#classtensorflow_1_1_operation)` | | `[output](#classtensorflow_1_1ops_1_1_arg_min_1adf842d8733fb5c05cf8773604ce4e39c)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` | | Public functions | | --- | | `[node](#classtensorflow_1_1ops_1_1_arg_min_1aaa10eba6321c4a8bc4d7cf58a21e3328)() const` | `::tensorflow::Node *` | | `[operator::tensorflow::Input](#classtensorflow_1_1ops_1_1_arg_min_1a03587f44a8e9ecd6778a4a68e0fcf506)() const` | | | `[operator::tensorflow::Output](#classtensorflow_1_1ops_1_1_arg_min_1a191191cb11c666a611ba6e2bf95c15b7)() const` | | | Public static functions | | --- | | `[OutputType](#classtensorflow_1_1ops_1_1_arg_min_1a164b1adce713e1a74f370b6fd657626f)(DataType x)` | `[Attrs](../../../struct/tensorflow/ops/arg-min/attrs#structtensorflow_1_1ops_1_1_arg_min_1_1_attrs)` | | Structs | | --- | | [tensorflow::ops::ArgMin::Attrs](../../../struct/tensorflow/ops/arg-min/attrs) | Optional attribute setters for [ArgMin](arg-min#classtensorflow_1_1ops_1_1_arg_min). | Public attributes ----------------- ### operation ``` Operation operation ``` ### output ``` ::tensorflow::Output output ``` Public functions ---------------- ### ArgMin ``` ArgMin( const ::tensorflow::Scope & scope, ::tensorflow::Input input, ::tensorflow::Input dimension ) ``` ### ArgMin ``` ArgMin( const ::tensorflow::Scope & scope, ::tensorflow::Input input, ::tensorflow::Input dimension, const ArgMin::Attrs & attrs ) ``` ### node ``` ::tensorflow::Node * node() const ``` ### operator::tensorflow::Input ``` operator::tensorflow::Input() const ``` ### operator::tensorflow::Output ``` operator::tensorflow::Output() const ``` Public static functions ----------------------- ### OutputType ``` Attrs OutputType( DataType x ) ``` tensorflow_cpp tensorflow::ops::ConditionalAccumulator tensorflow::ops::ConditionalAccumulator ======================================= `#include <data_flow_ops.h>` A conditional accumulator for aggregating gradients. Summary ------- The accumulator accepts gradients marked with local\_step greater or equal to the most recent global\_step known to the accumulator. The average can be extracted from the accumulator, provided sufficient gradients have been accumulated. Extracting the average automatically resets the aggregate to 0, and increments the global\_step recorded by the accumulator. Args: * scope: A [Scope](../scope#classtensorflow_1_1_scope) object * dtype: The type of the value being accumulated. * shape: The shape of the values, can be [], in which case shape is unknown. Optional attributes (see `[Attrs](../../../struct/tensorflow/ops/conditional-accumulator/attrs#structtensorflow_1_1ops_1_1_conditional_accumulator_1_1_attrs)`): * container: If non-empty, this accumulator is placed in the given container. Otherwise, a default container is used. * shared\_name: If non-empty, this accumulator will be shared under the given name across multiple sessions. Returns: * `[Output](../output#classtensorflow_1_1_output)`: The handle to the accumulator. | Constructors and Destructors | | --- | | `[ConditionalAccumulator](#classtensorflow_1_1ops_1_1_conditional_accumulator_1a00272ac1cf0b035368cf3635f63f6a08)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, DataType dtype, PartialTensorShape shape)` | | `[ConditionalAccumulator](#classtensorflow_1_1ops_1_1_conditional_accumulator_1a081e21332352a96375526ce070986ebd)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, DataType dtype, PartialTensorShape shape, const [ConditionalAccumulator::Attrs](../../../struct/tensorflow/ops/conditional-accumulator/attrs#structtensorflow_1_1ops_1_1_conditional_accumulator_1_1_attrs) & attrs)` | | Public attributes | | --- | | `[handle](#classtensorflow_1_1ops_1_1_conditional_accumulator_1ac3a749ba3341a49ef50a14057e5da60a)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` | | `[operation](#classtensorflow_1_1ops_1_1_conditional_accumulator_1a30b98b6dbd156f113d937ac4275ad048)` | `[Operation](../operation#classtensorflow_1_1_operation)` | | Public functions | | --- | | `[node](#classtensorflow_1_1ops_1_1_conditional_accumulator_1a9cc82ba20297c140bf9f35fe3b6c0ae8)() const` | `::tensorflow::Node *` | | `[operator::tensorflow::Input](#classtensorflow_1_1ops_1_1_conditional_accumulator_1ade4edaefa0b8521b19f8520a78138955)() const` | | | `[operator::tensorflow::Output](#classtensorflow_1_1ops_1_1_conditional_accumulator_1a1dd93d35edd3bcc2637ffa77017bf8cb)() const` | | | Public static functions | | --- | | `[Container](#classtensorflow_1_1ops_1_1_conditional_accumulator_1acaa49be6762015a74847412f577808c1)(StringPiece x)` | `[Attrs](../../../struct/tensorflow/ops/conditional-accumulator/attrs#structtensorflow_1_1ops_1_1_conditional_accumulator_1_1_attrs)` | | `[ReductionType](#classtensorflow_1_1ops_1_1_conditional_accumulator_1a59688e0c97eee5de1ead933f6f8c7815)(StringPiece x)` | `[Attrs](../../../struct/tensorflow/ops/conditional-accumulator/attrs#structtensorflow_1_1ops_1_1_conditional_accumulator_1_1_attrs)` | | `[SharedName](#classtensorflow_1_1ops_1_1_conditional_accumulator_1aa2dce8224a78a988a81866ca421eb42b)(StringPiece x)` | `[Attrs](../../../struct/tensorflow/ops/conditional-accumulator/attrs#structtensorflow_1_1ops_1_1_conditional_accumulator_1_1_attrs)` | | Structs | | --- | | [tensorflow::ops::ConditionalAccumulator::Attrs](../../../struct/tensorflow/ops/conditional-accumulator/attrs) | Optional attribute setters for [ConditionalAccumulator](conditional-accumulator#classtensorflow_1_1ops_1_1_conditional_accumulator). | Public attributes ----------------- ### handle ``` ::tensorflow::Output handle ``` ### operation ``` Operation operation ``` Public functions ---------------- ### ConditionalAccumulator ``` ConditionalAccumulator( const ::tensorflow::Scope & scope, DataType dtype, PartialTensorShape shape ) ``` ### ConditionalAccumulator ``` ConditionalAccumulator( const ::tensorflow::Scope & scope, DataType dtype, PartialTensorShape shape, const ConditionalAccumulator::Attrs & attrs ) ``` ### node ``` ::tensorflow::Node * node() const ``` ### operator::tensorflow::Input ``` operator::tensorflow::Input() const ``` ### operator::tensorflow::Output ``` operator::tensorflow::Output() const ``` Public static functions ----------------------- ### Container ``` Attrs Container( StringPiece x ) ``` ### ReductionType ``` Attrs ReductionType( StringPiece x ) ``` ### SharedName ``` Attrs SharedName( StringPiece x ) ```
programming_docs
tensorflow_cpp tensorflow::ops::Mean tensorflow::ops::Mean ===================== `#include <math_ops.h>` Computes the mean of elements across dimensions of a tensor. Summary ------- Reduces `input` along the dimensions given in `axis`. Unless `keep_dims` is true, the rank of the tensor is reduced by 1 for each entry in `axis`. If `keep_dims` is true, the reduced dimensions are retained with length 1. Args: * scope: A [Scope](../scope#classtensorflow_1_1_scope) object * input: The tensor to reduce. * axis: The dimensions to reduce. Must be in the range `[-rank(input), rank(input))`. Optional attributes (see `[Attrs](../../../struct/tensorflow/ops/mean/attrs#structtensorflow_1_1ops_1_1_mean_1_1_attrs)`): * keep\_dims: If true, retain reduced dimensions with length 1. Returns: * `[Output](../output#classtensorflow_1_1_output)`: The reduced tensor. Aliases: * ReduceMean | Constructors and Destructors | | --- | | `[Mean](#classtensorflow_1_1ops_1_1_mean_1a197238a837bef771356ceef555eb3fc5)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) input, ::[tensorflow::Input](../input#classtensorflow_1_1_input) axis)` | | `[Mean](#classtensorflow_1_1ops_1_1_mean_1a4012ca456e79d366e748b30485e13896)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) input, ::[tensorflow::Input](../input#classtensorflow_1_1_input) axis, const [Mean::Attrs](../../../struct/tensorflow/ops/mean/attrs#structtensorflow_1_1ops_1_1_mean_1_1_attrs) & attrs)` | | Public attributes | | --- | | `[operation](#classtensorflow_1_1ops_1_1_mean_1a2d6d74ce2f11798a21c40e7802d15d30)` | `[Operation](../operation#classtensorflow_1_1_operation)` | | `[output](#classtensorflow_1_1ops_1_1_mean_1a87264bbbee4da96f9ba784e0710505aa)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` | | Public functions | | --- | | `[node](#classtensorflow_1_1ops_1_1_mean_1af104f07bacdeb2d4919e1b53d3e9c06d)() const` | `::tensorflow::Node *` | | `[operator::tensorflow::Input](#classtensorflow_1_1ops_1_1_mean_1a6de63011b12a38e192d945bc750aa38a)() const` | | | `[operator::tensorflow::Output](#classtensorflow_1_1ops_1_1_mean_1a7bcb6958d02f23b2e94caeaa619be29c)() const` | | | Public static functions | | --- | | `[KeepDims](#classtensorflow_1_1ops_1_1_mean_1a9c8b878945fc885afb0f6a74e28efac6)(bool x)` | `[Attrs](../../../struct/tensorflow/ops/mean/attrs#structtensorflow_1_1ops_1_1_mean_1_1_attrs)` | | Structs | | --- | | [tensorflow::ops::Mean::Attrs](../../../struct/tensorflow/ops/mean/attrs) | Optional attribute setters for [Mean](mean#classtensorflow_1_1ops_1_1_mean). | Public attributes ----------------- ### operation ``` Operation operation ``` ### output ``` ::tensorflow::Output output ``` Public functions ---------------- ### Mean ``` Mean( const ::tensorflow::Scope & scope, ::tensorflow::Input input, ::tensorflow::Input axis ) ``` ### Mean ``` Mean( const ::tensorflow::Scope & scope, ::tensorflow::Input input, ::tensorflow::Input axis, const Mean::Attrs & attrs ) ``` ### node ``` ::tensorflow::Node * node() const ``` ### operator::tensorflow::Input ``` operator::tensorflow::Input() const ``` ### operator::tensorflow::Output ``` operator::tensorflow::Output() const ``` Public static functions ----------------------- ### KeepDims ``` Attrs KeepDims( bool x ) ``` tensorflow_cpp tensorflow::ops::QueueEnqueue tensorflow::ops::QueueEnqueue ============================= `#include <data_flow_ops.h>` Enqueues a tuple of one or more tensors in the given queue. Summary ------- The components input has k elements, which correspond to the components of tuples stored in the given queue. N.B. If the queue is full, this operation will block until the given element has been enqueued (or 'timeout\_ms' elapses, if specified). Args: * scope: A [Scope](../scope#classtensorflow_1_1_scope) object * handle: The handle to a queue. * components: One or more tensors from which the enqueued tensors should be taken. Optional attributes (see `[Attrs](../../../struct/tensorflow/ops/queue-enqueue/attrs#structtensorflow_1_1ops_1_1_queue_enqueue_1_1_attrs)`): * timeout\_ms: If the queue is full, this operation will block for up to timeout\_ms milliseconds. Note: This option is not supported yet. Returns: * the created `[Operation](../operation#classtensorflow_1_1_operation)` | Constructors and Destructors | | --- | | `[QueueEnqueue](#classtensorflow_1_1ops_1_1_queue_enqueue_1a0f0c1661cfe21aaf3ab6a9621f898b2b)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) handle, ::[tensorflow::InputList](../input-list#classtensorflow_1_1_input_list) components)` | | `[QueueEnqueue](#classtensorflow_1_1ops_1_1_queue_enqueue_1a90b82cbaf8f3ef9cee2fec35ae559e8f)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) handle, ::[tensorflow::InputList](../input-list#classtensorflow_1_1_input_list) components, const [QueueEnqueue::Attrs](../../../struct/tensorflow/ops/queue-enqueue/attrs#structtensorflow_1_1ops_1_1_queue_enqueue_1_1_attrs) & attrs)` | | Public attributes | | --- | | `[operation](#classtensorflow_1_1ops_1_1_queue_enqueue_1ac2647083cdddc7cdc2b993e219eba7bb)` | `[Operation](../operation#classtensorflow_1_1_operation)` | | Public functions | | --- | | `[operator::tensorflow::Operation](#classtensorflow_1_1ops_1_1_queue_enqueue_1a2f188bd8c727a23ce6c06f4c7cef00ba)() const` | | | Public static functions | | --- | | `[TimeoutMs](#classtensorflow_1_1ops_1_1_queue_enqueue_1a705f7ecc8021d5653e3f3adbd92ca8ff)(int64 x)` | `[Attrs](../../../struct/tensorflow/ops/queue-enqueue/attrs#structtensorflow_1_1ops_1_1_queue_enqueue_1_1_attrs)` | | Structs | | --- | | [tensorflow::ops::QueueEnqueue::Attrs](../../../struct/tensorflow/ops/queue-enqueue/attrs) | Optional attribute setters for [QueueEnqueue](queue-enqueue#classtensorflow_1_1ops_1_1_queue_enqueue). | Public attributes ----------------- ### operation ``` Operation operation ``` Public functions ---------------- ### QueueEnqueue ``` QueueEnqueue( const ::tensorflow::Scope & scope, ::tensorflow::Input handle, ::tensorflow::InputList components ) ``` ### QueueEnqueue ``` QueueEnqueue( const ::tensorflow::Scope & scope, ::tensorflow::Input handle, ::tensorflow::InputList components, const QueueEnqueue::Attrs & attrs ) ``` ### operator::tensorflow::Operation ``` operator::tensorflow::Operation() const ``` Public static functions ----------------------- ### TimeoutMs ``` Attrs TimeoutMs( int64 x ) ``` tensorflow_cpp tensorflow::ops::All tensorflow::ops::All ==================== `#include <math_ops.h>` Computes the "logical and" of elements across dimensions of a tensor. Summary ------- Reduces `input` along the dimensions given in `axis`. Unless `keep_dims` is true, the rank of the tensor is reduced by 1 for each entry in `axis`. If `keep_dims` is true, the reduced dimensions are retained with length 1. Args: * scope: A [Scope](../scope#classtensorflow_1_1_scope) object * input: The tensor to reduce. * axis: The dimensions to reduce. Must be in the range `[-rank(input), rank(input))`. Optional attributes (see `[Attrs](../../../struct/tensorflow/ops/all/attrs#structtensorflow_1_1ops_1_1_all_1_1_attrs)`): * keep\_dims: If true, retain reduced dimensions with length 1. Returns: * `[Output](../output#classtensorflow_1_1_output)`: The reduced tensor. Aliases: * ReduceAll | Constructors and Destructors | | --- | | `[All](#classtensorflow_1_1ops_1_1_all_1afa71dd1622d638bd8b918bc65593e65e)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) input, ::[tensorflow::Input](../input#classtensorflow_1_1_input) axis)` | | `[All](#classtensorflow_1_1ops_1_1_all_1a8794d161cee0c0ba7e985e42a60577d4)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) input, ::[tensorflow::Input](../input#classtensorflow_1_1_input) axis, const [All::Attrs](../../../struct/tensorflow/ops/all/attrs#structtensorflow_1_1ops_1_1_all_1_1_attrs) & attrs)` | | Public attributes | | --- | | `[operation](#classtensorflow_1_1ops_1_1_all_1ada058970f122dd1210fee3e3ecb13293)` | `[Operation](../operation#classtensorflow_1_1_operation)` | | `[output](#classtensorflow_1_1ops_1_1_all_1ad6bd0f7a2b1b3f688c09e946677d1542)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` | | Public functions | | --- | | `[node](#classtensorflow_1_1ops_1_1_all_1a8edc99992721510ec7b9cbf5348c123e)() const` | `::tensorflow::Node *` | | `[operator::tensorflow::Input](#classtensorflow_1_1ops_1_1_all_1ac4be708cfa983d96afbe09f6818afd14)() const` | | | `[operator::tensorflow::Output](#classtensorflow_1_1ops_1_1_all_1af72fb39a903619d8cc8f8a411843dc15)() const` | | | Public static functions | | --- | | `[KeepDims](#classtensorflow_1_1ops_1_1_all_1abe9daccea4c2964938cb9b46bafbdd22)(bool x)` | `[Attrs](../../../struct/tensorflow/ops/all/attrs#structtensorflow_1_1ops_1_1_all_1_1_attrs)` | | Structs | | --- | | [tensorflow::ops::All::Attrs](../../../struct/tensorflow/ops/all/attrs) | Optional attribute setters for [All](all#classtensorflow_1_1ops_1_1_all). | Public attributes ----------------- ### operation ``` Operation operation ``` ### output ``` ::tensorflow::Output output ``` Public functions ---------------- ### All ``` All( const ::tensorflow::Scope & scope, ::tensorflow::Input input, ::tensorflow::Input axis ) ``` ### All ``` All( const ::tensorflow::Scope & scope, ::tensorflow::Input input, ::tensorflow::Input axis, const All::Attrs & attrs ) ``` ### node ``` ::tensorflow::Node * node() const ``` ### operator::tensorflow::Input ``` operator::tensorflow::Input() const ``` ### operator::tensorflow::Output ``` operator::tensorflow::Output() const ``` Public static functions ----------------------- ### KeepDims ``` Attrs KeepDims( bool x ) ``` tensorflow_cpp tensorflow::ops::TemporaryVariable tensorflow::ops::TemporaryVariable ================================== `#include <state_ops.h>` Returns a tensor that may be mutated, but only persists within a single step. Summary ------- This is an experimental op for internal use only and it is possible to use this op in unsafe ways. DO NOT USE unless you fully understand the risks. It is the caller's responsibility to ensure that 'ref' is eventually passed to a matching '[DestroyTemporaryVariable](destroy-temporary-variable#classtensorflow_1_1ops_1_1_destroy_temporary_variable)' op after all other uses have completed. Outputs a ref to the tensor state so it may be read or modified. E.g. var = state\_ops.\_temporary\_variable([1, 2], types.float\_) var\_name = var.op.name var = state\_ops.assign(var, [[4.0, 5.0]]) var = state\_ops.assign\_add(var, [[6.0, 7.0]]) final = state\_ops.\_destroy\_temporary\_variable(var, var\_name=var\_name) Args: * scope: A [Scope](../scope#classtensorflow_1_1_scope) object * shape: The shape of the variable tensor. * dtype: The type of elements in the variable tensor. Optional attributes (see `[Attrs](../../../struct/tensorflow/ops/temporary-variable/attrs#structtensorflow_1_1ops_1_1_temporary_variable_1_1_attrs)`): * var\_name: Overrides the name used for the temporary variable resource. Default value is the name of the '[TemporaryVariable](temporary-variable#classtensorflow_1_1ops_1_1_temporary_variable)' op (which is guaranteed unique). Returns: * `[Output](../output#classtensorflow_1_1_output)`: A reference to the variable tensor. | Constructors and Destructors | | --- | | `[TemporaryVariable](#classtensorflow_1_1ops_1_1_temporary_variable_1a694e6c48eaf39d57f59d52796a9a71d1)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, PartialTensorShape shape, DataType dtype)` | | `[TemporaryVariable](#classtensorflow_1_1ops_1_1_temporary_variable_1a43909369fdad702faf95e5aab8346b1a)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, PartialTensorShape shape, DataType dtype, const [TemporaryVariable::Attrs](../../../struct/tensorflow/ops/temporary-variable/attrs#structtensorflow_1_1ops_1_1_temporary_variable_1_1_attrs) & attrs)` | | Public attributes | | --- | | `[operation](#classtensorflow_1_1ops_1_1_temporary_variable_1abf90e66f914f45a8e9c11f7409917423)` | `[Operation](../operation#classtensorflow_1_1_operation)` | | `[ref](#classtensorflow_1_1ops_1_1_temporary_variable_1a62601e5fd1b28bd28a6f0db0c691fe61)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` | | Public functions | | --- | | `[node](#classtensorflow_1_1ops_1_1_temporary_variable_1a3dbe9a732d4ec4ab4f94240c0ba61210)() const` | `::tensorflow::Node *` | | `[operator::tensorflow::Input](#classtensorflow_1_1ops_1_1_temporary_variable_1a8414b80274ac7ca395a565b59e90cd9e)() const` | | | `[operator::tensorflow::Output](#classtensorflow_1_1ops_1_1_temporary_variable_1a62b24d2f958c91a5a1005127d7056dc9)() const` | | | Public static functions | | --- | | `[VarName](#classtensorflow_1_1ops_1_1_temporary_variable_1a6647c19d0e761d2c6c11ff667576cfb5)(StringPiece x)` | `[Attrs](../../../struct/tensorflow/ops/temporary-variable/attrs#structtensorflow_1_1ops_1_1_temporary_variable_1_1_attrs)` | | Structs | | --- | | [tensorflow::ops::TemporaryVariable::Attrs](../../../struct/tensorflow/ops/temporary-variable/attrs) | Optional attribute setters for [TemporaryVariable](temporary-variable#classtensorflow_1_1ops_1_1_temporary_variable). | Public attributes ----------------- ### operation ``` Operation operation ``` ### ref ``` ::tensorflow::Output ref ``` Public functions ---------------- ### TemporaryVariable ``` TemporaryVariable( const ::tensorflow::Scope & scope, PartialTensorShape shape, DataType dtype ) ``` ### TemporaryVariable ``` TemporaryVariable( const ::tensorflow::Scope & scope, PartialTensorShape shape, DataType dtype, const TemporaryVariable::Attrs & attrs ) ``` ### node ``` ::tensorflow::Node * node() const ``` ### operator::tensorflow::Input ``` operator::tensorflow::Input() const ``` ### operator::tensorflow::Output ``` operator::tensorflow::Output() const ``` Public static functions ----------------------- ### VarName ``` Attrs VarName( StringPiece x ) ``` tensorflow_cpp tensorflow::ops::SparseApplyAdadelta tensorflow::ops::SparseApplyAdadelta ==================================== `#include <training_ops.h>` var: Should be from a Variable(). Summary ------- Args: * scope: A [Scope](../scope#classtensorflow_1_1_scope) object * accum: Should be from a Variable(). * accum\_update: : Should be from a Variable(). * lr: Learning rate. Must be a scalar. * rho: Decay factor. Must be a scalar. * epsilon: Constant factor. Must be a scalar. * grad: The gradient. * indices: A vector of indices into the first dimension of var and accum. Optional attributes (see `[Attrs](../../../struct/tensorflow/ops/sparse-apply-adadelta/attrs#structtensorflow_1_1ops_1_1_sparse_apply_adadelta_1_1_attrs)`): * use\_locking: If True, updating of the var and accum tensors will be protected by a lock; otherwise the behavior is undefined, but may exhibit less contention. Returns: * `[Output](../output#classtensorflow_1_1_output)`: Same as "var". | Constructors and Destructors | | --- | | `[SparseApplyAdadelta](#classtensorflow_1_1ops_1_1_sparse_apply_adadelta_1a10346d215f776d3e4336554f052545cb)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) var, ::[tensorflow::Input](../input#classtensorflow_1_1_input) accum, ::[tensorflow::Input](../input#classtensorflow_1_1_input) accum_update, ::[tensorflow::Input](../input#classtensorflow_1_1_input) lr, ::[tensorflow::Input](../input#classtensorflow_1_1_input) rho, ::[tensorflow::Input](../input#classtensorflow_1_1_input) epsilon, ::[tensorflow::Input](../input#classtensorflow_1_1_input) grad, ::[tensorflow::Input](../input#classtensorflow_1_1_input) indices)` | | `[SparseApplyAdadelta](#classtensorflow_1_1ops_1_1_sparse_apply_adadelta_1a9a4a32f0d7bc40f4c2f4960151b6652d)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) var, ::[tensorflow::Input](../input#classtensorflow_1_1_input) accum, ::[tensorflow::Input](../input#classtensorflow_1_1_input) accum_update, ::[tensorflow::Input](../input#classtensorflow_1_1_input) lr, ::[tensorflow::Input](../input#classtensorflow_1_1_input) rho, ::[tensorflow::Input](../input#classtensorflow_1_1_input) epsilon, ::[tensorflow::Input](../input#classtensorflow_1_1_input) grad, ::[tensorflow::Input](../input#classtensorflow_1_1_input) indices, const [SparseApplyAdadelta::Attrs](../../../struct/tensorflow/ops/sparse-apply-adadelta/attrs#structtensorflow_1_1ops_1_1_sparse_apply_adadelta_1_1_attrs) & attrs)` | | Public attributes | | --- | | `[operation](#classtensorflow_1_1ops_1_1_sparse_apply_adadelta_1a24902e3a0d9ef60b0d3b286887554f70)` | `[Operation](../operation#classtensorflow_1_1_operation)` | | `[out](#classtensorflow_1_1ops_1_1_sparse_apply_adadelta_1a50eabd8a7e93bf722f57c0af4c445d20)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` | | Public functions | | --- | | `[node](#classtensorflow_1_1ops_1_1_sparse_apply_adadelta_1afb4c76f26417ba0b14db299bca528f40)() const` | `::tensorflow::Node *` | | `[operator::tensorflow::Input](#classtensorflow_1_1ops_1_1_sparse_apply_adadelta_1a7bbe6b4f17ecf1a92a119908aba54c77)() const` | | | `[operator::tensorflow::Output](#classtensorflow_1_1ops_1_1_sparse_apply_adadelta_1a18310637d40bc623ca8f548c13bb54aa)() const` | | | Public static functions | | --- | | `[UseLocking](#classtensorflow_1_1ops_1_1_sparse_apply_adadelta_1acbdbc14d33d39c6d7e41685963b0a775)(bool x)` | `[Attrs](../../../struct/tensorflow/ops/sparse-apply-adadelta/attrs#structtensorflow_1_1ops_1_1_sparse_apply_adadelta_1_1_attrs)` | | Structs | | --- | | [tensorflow::ops::SparseApplyAdadelta::Attrs](../../../struct/tensorflow/ops/sparse-apply-adadelta/attrs) | Optional attribute setters for [SparseApplyAdadelta](sparse-apply-adadelta#classtensorflow_1_1ops_1_1_sparse_apply_adadelta). | Public attributes ----------------- ### operation ``` Operation operation ``` ### out ``` ::tensorflow::Output out ``` Public functions ---------------- ### SparseApplyAdadelta ``` SparseApplyAdadelta( const ::tensorflow::Scope & scope, ::tensorflow::Input var, ::tensorflow::Input accum, ::tensorflow::Input accum_update, ::tensorflow::Input lr, ::tensorflow::Input rho, ::tensorflow::Input epsilon, ::tensorflow::Input grad, ::tensorflow::Input indices ) ``` ### SparseApplyAdadelta ``` SparseApplyAdadelta( const ::tensorflow::Scope & scope, ::tensorflow::Input var, ::tensorflow::Input accum, ::tensorflow::Input accum_update, ::tensorflow::Input lr, ::tensorflow::Input rho, ::tensorflow::Input epsilon, ::tensorflow::Input grad, ::tensorflow::Input indices, const SparseApplyAdadelta::Attrs & attrs ) ``` ### node ``` ::tensorflow::Node * node() const ``` ### operator::tensorflow::Input ``` operator::tensorflow::Input() const ``` ### operator::tensorflow::Output ``` operator::tensorflow::Output() const ``` Public static functions ----------------------- ### UseLocking ``` Attrs UseLocking( bool x ) ```
programming_docs
tensorflow_cpp tensorflow::ops::AddV2 tensorflow::ops::AddV2 ====================== `#include <math_ops.h>` Returns x + y element-wise. Summary ------- *NOTE*: `[Add](add#classtensorflow_1_1ops_1_1_add)` supports broadcasting. `[AddN](add-n#classtensorflow_1_1ops_1_1_add_n)` does not. More about broadcasting [here](http://docs.scipy.org/doc/numpy/user/basics.broadcasting.html) Args: * scope: A [Scope](../scope#classtensorflow_1_1_scope) object Returns: * `[Output](../output#classtensorflow_1_1_output)`: The z tensor. | Constructors and Destructors | | --- | | `[AddV2](#classtensorflow_1_1ops_1_1_add_v2_1afafa9e12c4d9359d45eeec306c5019d3)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) x, ::[tensorflow::Input](../input#classtensorflow_1_1_input) y)` | | Public attributes | | --- | | `[operation](#classtensorflow_1_1ops_1_1_add_v2_1a7ad6792d02c3a7832beeb821fff1bc7c)` | `[Operation](../operation#classtensorflow_1_1_operation)` | | `[z](#classtensorflow_1_1ops_1_1_add_v2_1a77fa31fabd16f357b4c19a86f25c92a1)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` | | Public functions | | --- | | `[node](#classtensorflow_1_1ops_1_1_add_v2_1a9b27ea058fcd44cf4644262a32ef82a7)() const` | `::tensorflow::Node *` | | `[operator::tensorflow::Input](#classtensorflow_1_1ops_1_1_add_v2_1a60e88570ad6e71f93aa6c19e467b2bfe)() const` | | | `[operator::tensorflow::Output](#classtensorflow_1_1ops_1_1_add_v2_1a1e64a4daa1d8fe83f60dcff66c529619)() const` | | Public attributes ----------------- ### operation ``` Operation operation ``` ### z ``` ::tensorflow::Output z ``` Public functions ---------------- ### AddV2 ``` AddV2( const ::tensorflow::Scope & scope, ::tensorflow::Input x, ::tensorflow::Input y ) ``` ### node ``` ::tensorflow::Node * node() const ``` ### operator::tensorflow::Input ``` operator::tensorflow::Input() const ``` ### operator::tensorflow::Output ``` operator::tensorflow::Output() const ``` tensorflow_cpp tensorflow::ops::TruncateMod tensorflow::ops::TruncateMod ============================ `#include <math_ops.h>` Returns element-wise remainder of division. Summary ------- This emulates C semantics in that the result here is consistent with a truncating divide. E.g. `truncate(x / y) * y + truncate_mod(x, y) = x`. *NOTE*: `[TruncateMod](truncate-mod#classtensorflow_1_1ops_1_1_truncate_mod)` supports broadcasting. More about broadcasting [here](http://docs.scipy.org/doc/numpy/user/basics.broadcasting.html) Args: * scope: A [Scope](../scope#classtensorflow_1_1_scope) object Returns: * `[Output](../output#classtensorflow_1_1_output)`: The z tensor. | Constructors and Destructors | | --- | | `[TruncateMod](#classtensorflow_1_1ops_1_1_truncate_mod_1acda7b02fb9a2b400c4efeb98d6d70823)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) x, ::[tensorflow::Input](../input#classtensorflow_1_1_input) y)` | | Public attributes | | --- | | `[operation](#classtensorflow_1_1ops_1_1_truncate_mod_1a48def7939c9c249455cad5080e7570ba)` | `[Operation](../operation#classtensorflow_1_1_operation)` | | `[z](#classtensorflow_1_1ops_1_1_truncate_mod_1a74be0c9fba0b11108ec800302c9d6909)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` | | Public functions | | --- | | `[node](#classtensorflow_1_1ops_1_1_truncate_mod_1a6478ee2c965178820079636d148206b6)() const` | `::tensorflow::Node *` | | `[operator::tensorflow::Input](#classtensorflow_1_1ops_1_1_truncate_mod_1a5fe0aa9e2fd46f42913cb5a203f85eb4)() const` | | | `[operator::tensorflow::Output](#classtensorflow_1_1ops_1_1_truncate_mod_1a897f0c94d3f8917526cbb848a092051b)() const` | | Public attributes ----------------- ### operation ``` Operation operation ``` ### z ``` ::tensorflow::Output z ``` Public functions ---------------- ### TruncateMod ``` TruncateMod( const ::tensorflow::Scope & scope, ::tensorflow::Input x, ::tensorflow::Input y ) ``` ### node ``` ::tensorflow::Node * node() const ``` ### operator::tensorflow::Input ``` operator::tensorflow::Input() const ``` ### operator::tensorflow::Output ``` operator::tensorflow::Output() const ``` tensorflow_cpp tensorflow::ops::TextLineReader tensorflow::ops::TextLineReader =============================== `#include <io_ops.h>` A Reader that outputs the lines of a file delimited by '\n'. Summary ------- Args: * scope: A [Scope](../scope#classtensorflow_1_1_scope) object Optional attributes (see `[Attrs](../../../struct/tensorflow/ops/text-line-reader/attrs#structtensorflow_1_1ops_1_1_text_line_reader_1_1_attrs)`): * skip\_header\_lines: Number of lines to skip from the beginning of every file. * container: If non-empty, this reader is placed in the given container. Otherwise, a default container is used. * shared\_name: If non-empty, this reader is named in the given bucket with this shared\_name. Otherwise, the node name is used instead. Returns: * `[Output](../output#classtensorflow_1_1_output)`: The handle to reference the Reader. | Constructors and Destructors | | --- | | `[TextLineReader](#classtensorflow_1_1ops_1_1_text_line_reader_1a66fa9fed28552565e58024d687635c20)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope)` | | `[TextLineReader](#classtensorflow_1_1ops_1_1_text_line_reader_1aed74d51b4278508aa1d6faedcc0a0826)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, const [TextLineReader::Attrs](../../../struct/tensorflow/ops/text-line-reader/attrs#structtensorflow_1_1ops_1_1_text_line_reader_1_1_attrs) & attrs)` | | Public attributes | | --- | | `[operation](#classtensorflow_1_1ops_1_1_text_line_reader_1ab85e9d7259c373ad27fb3dddd606d03f)` | `[Operation](../operation#classtensorflow_1_1_operation)` | | `[reader\_handle](#classtensorflow_1_1ops_1_1_text_line_reader_1ac4ab46ef63e3cb743a68e39c4e11a609)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` | | Public functions | | --- | | `[node](#classtensorflow_1_1ops_1_1_text_line_reader_1a790db7925f50f5bc0571510dc97ab3a3)() const` | `::tensorflow::Node *` | | `[operator::tensorflow::Input](#classtensorflow_1_1ops_1_1_text_line_reader_1a7496b2588d4ceb8baffab128769c8434)() const` | | | `[operator::tensorflow::Output](#classtensorflow_1_1ops_1_1_text_line_reader_1a92aefc229676182bd1fbdde2d0907543)() const` | | | Public static functions | | --- | | `[Container](#classtensorflow_1_1ops_1_1_text_line_reader_1a1b17fd2027469c3e6a649fb2df0e66e2)(StringPiece x)` | `[Attrs](../../../struct/tensorflow/ops/text-line-reader/attrs#structtensorflow_1_1ops_1_1_text_line_reader_1_1_attrs)` | | `[SharedName](#classtensorflow_1_1ops_1_1_text_line_reader_1ad4b36848bb237ab744e75cee38d09040)(StringPiece x)` | `[Attrs](../../../struct/tensorflow/ops/text-line-reader/attrs#structtensorflow_1_1ops_1_1_text_line_reader_1_1_attrs)` | | `[SkipHeaderLines](#classtensorflow_1_1ops_1_1_text_line_reader_1af30a762e73b55a5d4e14feaccd55d14e)(int64 x)` | `[Attrs](../../../struct/tensorflow/ops/text-line-reader/attrs#structtensorflow_1_1ops_1_1_text_line_reader_1_1_attrs)` | | Structs | | --- | | [tensorflow::ops::TextLineReader::Attrs](../../../struct/tensorflow/ops/text-line-reader/attrs) | Optional attribute setters for [TextLineReader](text-line-reader#classtensorflow_1_1ops_1_1_text_line_reader). | Public attributes ----------------- ### operation ``` Operation operation ``` ### reader\_handle ``` ::tensorflow::Output reader_handle ``` Public functions ---------------- ### TextLineReader ``` TextLineReader( const ::tensorflow::Scope & scope ) ``` ### TextLineReader ``` TextLineReader( const ::tensorflow::Scope & scope, const TextLineReader::Attrs & attrs ) ``` ### node ``` ::tensorflow::Node * node() const ``` ### operator::tensorflow::Input ``` operator::tensorflow::Input() const ``` ### operator::tensorflow::Output ``` operator::tensorflow::Output() const ``` Public static functions ----------------------- ### Container ``` Attrs Container( StringPiece x ) ``` ### SharedName ``` Attrs SharedName( StringPiece x ) ``` ### SkipHeaderLines ``` Attrs SkipHeaderLines( int64 x ) ``` tensorflow_cpp tensorflow::ops::SparseConcat tensorflow::ops::SparseConcat ============================= `#include <sparse_ops.h>` Concatenates a list of `SparseTensor` along the specified dimension. Summary ------- Concatenation is with respect to the dense versions of these sparse tensors. It is assumed that each input is a `SparseTensor` whose elements are ordered along increasing dimension number. [All](all#classtensorflow_1_1ops_1_1_all) inputs' shapes must match, except for the concat dimension. The `indices`, `values`, and `shapes` lists must have the same length. The output shape is identical to the inputs', except along the concat dimension, where it is the sum of the inputs' sizes along that dimension. The output elements will be resorted to preserve the sort order along increasing dimension number. This op runs in `O(M log M)` time, where `M` is the total number of non-empty values across all inputs. This is due to the need for an internal sort in order to concatenate efficiently across an arbitrary dimension. For example, if `concat_dim = 1` and the inputs are ``` sp_inputs[0]: shape = [2, 3] [0, 2]: "a" [1, 0]: "b" [1, 1]: "c" sp_inputs[1]: shape = [2, 4] [0, 1]: "d" [0, 2]: "e" ``` then the output will be ``` shape = [2, 7] [0, 2]: "a" [0, 4]: "d" [0, 5]: "e" [1, 0]: "b" [1, 1]: "c" ``` Graphically this is equivalent to doing ``` [ a] concat [ d e ] = [ a d e ] [b c ] [ ] [b c ] ``` Args: * scope: A [Scope](../scope#classtensorflow_1_1_scope) object * indices: 2-D. Indices of each input `SparseTensor`. * values: 1-D. Non-empty values of each `SparseTensor`. * shapes: 1-D. Shapes of each `SparseTensor`. * concat\_dim: Dimension to concatenate along. Must be in range [-rank, rank), where rank is the number of dimensions in each input `SparseTensor`. Returns: * `[Output](../output#classtensorflow_1_1_output)` output\_indices: 2-D. Indices of the concatenated `SparseTensor`. * `[Output](../output#classtensorflow_1_1_output)` output\_values: 1-D. Non-empty values of the concatenated `SparseTensor`. * `[Output](../output#classtensorflow_1_1_output)` output\_shape: 1-D. Shape of the concatenated `SparseTensor`. | Constructors and Destructors | | --- | | `[SparseConcat](#classtensorflow_1_1ops_1_1_sparse_concat_1a50aa275ec5a88496fd4e99f0f1003616)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::InputList](../input-list#classtensorflow_1_1_input_list) indices, ::[tensorflow::InputList](../input-list#classtensorflow_1_1_input_list) values, ::[tensorflow::InputList](../input-list#classtensorflow_1_1_input_list) shapes, int64 concat_dim)` | | Public attributes | | --- | | `[operation](#classtensorflow_1_1ops_1_1_sparse_concat_1a8db5a398751bcf0e460c5032ae1ab292)` | `[Operation](../operation#classtensorflow_1_1_operation)` | | `[output\_indices](#classtensorflow_1_1ops_1_1_sparse_concat_1a79b9cef174b8488e90f52907d6d64a0f)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` | | `[output\_shape](#classtensorflow_1_1ops_1_1_sparse_concat_1ae3130991367ac10382b9a6a310b1eff5)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` | | `[output\_values](#classtensorflow_1_1ops_1_1_sparse_concat_1a626bd96bc86fb8ecddbd8cbb7a6828cf)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` | Public attributes ----------------- ### operation ``` Operation operation ``` ### output\_indices ``` ::tensorflow::Output output_indices ``` ### output\_shape ``` ::tensorflow::Output output_shape ``` ### output\_values ``` ::tensorflow::Output output_values ``` Public functions ---------------- ### SparseConcat ``` SparseConcat( const ::tensorflow::Scope & scope, ::tensorflow::InputList indices, ::tensorflow::InputList values, ::tensorflow::InputList shapes, int64 concat_dim ) ``` tensorflow_cpp tensorflow::ops::NonMaxSuppressionV2 tensorflow::ops::NonMaxSuppressionV2 ==================================== `#include <image_ops.h>` Greedily selects a subset of bounding boxes in descending order of score,. Summary ------- pruning away boxes that have high intersection-over-union (IOU) overlap with previously selected boxes. Bounding boxes are supplied as [y1, x1, y2, x2], where (y1, x1) and (y2, x2) are the coordinates of any diagonal pair of box corners and the coordinates can be provided as normalized (i.e., lying in the interval [0, 1]) or absolute. Note that this algorithm is agnostic to where the origin is in the coordinate system. Note that this algorithm is invariant to orthogonal transformations and translations of the coordinate system; thus translating or reflections of the coordinate system result in the same boxes being selected by the algorithm. The output of this operation is a set of integers indexing into the input collection of bounding boxes representing the selected boxes. The bounding box coordinates corresponding to the selected indices can then be obtained using the `tf.gather operation`. For example: selected\_indices = tf.image.non\_max\_suppression\_v2( boxes, scores, max\_output\_size, iou\_threshold) selected\_boxes = tf.gather(boxes, selected\_indices) Args: * scope: A [Scope](../scope#classtensorflow_1_1_scope) object * boxes: A 2-D float tensor of shape `[num_boxes, 4]`. * scores: A 1-D float tensor of shape `[num_boxes]` representing a single score corresponding to each box (each row of boxes). * max\_output\_size: A scalar integer tensor representing the maximum number of boxes to be selected by non max suppression. * iou\_threshold: A 0-D float tensor representing the threshold for deciding whether boxes overlap too much with respect to IOU. Returns: * `[Output](../output#classtensorflow_1_1_output)`: A 1-D integer tensor of shape `[M]` representing the selected indices from the boxes tensor, where `M <= max_output_size`. | Constructors and Destructors | | --- | | `[NonMaxSuppressionV2](#classtensorflow_1_1ops_1_1_non_max_suppression_v2_1aa344ba54e3c8ecdf351160841d620b90)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) boxes, ::[tensorflow::Input](../input#classtensorflow_1_1_input) scores, ::[tensorflow::Input](../input#classtensorflow_1_1_input) max_output_size, ::[tensorflow::Input](../input#classtensorflow_1_1_input) iou_threshold)` | | Public attributes | | --- | | `[operation](#classtensorflow_1_1ops_1_1_non_max_suppression_v2_1aa5c9890c89f51ea289a417dc96e5155e)` | `[Operation](../operation#classtensorflow_1_1_operation)` | | `[selected\_indices](#classtensorflow_1_1ops_1_1_non_max_suppression_v2_1abd7f6df70942924aba1f37d144c96bf6)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` | | Public functions | | --- | | `[node](#classtensorflow_1_1ops_1_1_non_max_suppression_v2_1a74b7fd12711f34637858a5695ed0c654)() const` | `::tensorflow::Node *` | | `[operator::tensorflow::Input](#classtensorflow_1_1ops_1_1_non_max_suppression_v2_1a204a073b24bbf63d20c616abcf020a48)() const` | | | `[operator::tensorflow::Output](#classtensorflow_1_1ops_1_1_non_max_suppression_v2_1aaf3f8cdfaf63a67e5f7afdc2eb714271)() const` | | Public attributes ----------------- ### operation ``` Operation operation ``` ### selected\_indices ``` ::tensorflow::Output selected_indices ``` Public functions ---------------- ### NonMaxSuppressionV2 ``` NonMaxSuppressionV2( const ::tensorflow::Scope & scope, ::tensorflow::Input boxes, ::tensorflow::Input scores, ::tensorflow::Input max_output_size, ::tensorflow::Input iou_threshold ) ``` ### node ``` ::tensorflow::Node * node() const ``` ### operator::tensorflow::Input ``` operator::tensorflow::Input() const ``` ### operator::tensorflow::Output ``` operator::tensorflow::Output() const ``` tensorflow_cpp tensorflow::ops::IsInf tensorflow::ops::IsInf ====================== `#include <math_ops.h>` Returns which elements of x are Inf. Summary ------- (numpy) Equivalent to np.isinf Example: ``` x = tf.constant([5.0, np.inf, 6.8, np.inf]) tf.math.is_inf(x) ==> [False, True, False, True] ``` Args: * scope: A [Scope](../scope#classtensorflow_1_1_scope) object Returns: * `[Output](../output#classtensorflow_1_1_output)`: The y tensor. | Constructors and Destructors | | --- | | `[IsInf](#classtensorflow_1_1ops_1_1_is_inf_1a7c7fcee82e00e60f696632ff14fdd097)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) x)` | | Public attributes | | --- | | `[operation](#classtensorflow_1_1ops_1_1_is_inf_1a6bed9939f8fc4928ea60eecaeca314ef)` | `[Operation](../operation#classtensorflow_1_1_operation)` | | `[y](#classtensorflow_1_1ops_1_1_is_inf_1afd605e85bb9052746f50777f091680b1)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` | | Public functions | | --- | | `[node](#classtensorflow_1_1ops_1_1_is_inf_1a24e713541e540b6195a3443503a51520)() const` | `::tensorflow::Node *` | | `[operator::tensorflow::Input](#classtensorflow_1_1ops_1_1_is_inf_1a05916b740b2661cbd91ac476f4ddaf3e)() const` | | | `[operator::tensorflow::Output](#classtensorflow_1_1ops_1_1_is_inf_1a57a821c0ee27789af989fac5c4a69a59)() const` | | Public attributes ----------------- ### operation ``` Operation operation ``` ### y ``` ::tensorflow::Output y ``` Public functions ---------------- ### IsInf ``` IsInf( const ::tensorflow::Scope & scope, ::tensorflow::Input x ) ``` ### node ``` ::tensorflow::Node * node() const ``` ### operator::tensorflow::Input ``` operator::tensorflow::Input() const ``` ### operator::tensorflow::Output ``` operator::tensorflow::Output() const ``` tensorflow_cpp tensorflow::ops::BatchToSpace tensorflow::ops::BatchToSpace ============================= `#include <array_ops.h>` [BatchToSpace](batch-to-space#classtensorflow_1_1ops_1_1_batch_to_space) for 4-D tensors of type T. Summary ------- This is a legacy version of the more general [BatchToSpaceND](batch-to-space-n-d#classtensorflow_1_1ops_1_1_batch_to_space_n_d). Rearranges (permutes) data from batch into blocks of spatial data, followed by cropping. This is the reverse transformation of SpaceToBatch. More specifically, this op outputs a copy of the input tensor where values from the `batch` dimension are moved in spatial blocks to the `height` and `width` dimensions, followed by cropping along the `height` and `width` dimensions. Args: * scope: A [Scope](../scope#classtensorflow_1_1_scope) object * input: 4-D tensor with shape `[batch*block_size*block_size, height_pad/block_size, width_pad/block_size, depth]`. Note that the batch size of the input tensor must be divisible by `block_size * block_size`. * crops: 2-D tensor of non-negative integers with shape `[2, 2]`. It specifies how many elements to crop from the intermediate result across the spatial dimensions as follows: ``` crops = [[crop_top, crop_bottom], [crop_left, crop_right]] ``` Returns: * `[Output](../output#classtensorflow_1_1_output)`: 4-D with shape `[batch, height, width, depth]`, where: ``` height = height_pad - crop_top - crop_bottom width = width_pad - crop_left - crop_right ``` The attr `block_size` must be greater than one. It indicates the block size. Some examples: (1) For the following input of shape `[4, 1, 1, 1]` and block\_size of 2: ``` [[[[1]]], [[[2]]], [[[3]]], [[[4]]]] ``` The output tensor has shape `[1, 2, 2, 1]` and value: ``` x = [[[[1], [2]], [[3], [4]]]] ``` (2) For the following input of shape `[4, 1, 1, 3]` and block\_size of 2: ``` [[[[1, 2, 3]]], [[[4, 5, 6]]], [[[7, 8, 9]]], [[[10, 11, 12]]]] ``` The output tensor has shape `[1, 2, 2, 3]` and value: ``` x = [[[[1, 2, 3], [4, 5, 6]], [[7, 8, 9], [10, 11, 12]]]] ``` (3) For the following input of shape `[4, 2, 2, 1]` and block\_size of 2: ``` x = [[[[1], [3]], [[9], [11]]], [[[2], [4]], [[10], [12]]], [[[5], [7]], [[13], [15]]], [[[6], [8]], [[14], [16]]]] ``` The output tensor has shape `[1, 4, 4, 1]` and value: ``` x = [[[[1], [2], [3], [4]], [[5], [6], [7], [8]], [[9], [10], [11], [12]], [[13], [14], [15], [16]]]] ``` (4) For the following input of shape `[8, 1, 2, 1]` and block\_size of 2: ``` x = [[[[1], [3]]], [[[9], [11]]], [[[2], [4]]], [[[10], [12]]], [[[5], [7]]], [[[13], [15]]], [[[6], [8]]], [[[14], [16]]]] ``` The output tensor has shape `[2, 2, 4, 1]` and value: ``` x = [[[[1], [3]], [[5], [7]]], [[[2], [4]], [[10], [12]]], [[[5], [7]], [[13], [15]]], [[[6], [8]], [[14], [16]]]] ``` | Constructors and Destructors | | --- | | `[BatchToSpace](#classtensorflow_1_1ops_1_1_batch_to_space_1a813bf5c031d4af21a394ba903c8dd8e7)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) input, ::[tensorflow::Input](../input#classtensorflow_1_1_input) crops, int64 block_size)` | | Public attributes | | --- | | `[operation](#classtensorflow_1_1ops_1_1_batch_to_space_1a4f9b292d9339c4c44142a6dcec013410)` | `[Operation](../operation#classtensorflow_1_1_operation)` | | `[output](#classtensorflow_1_1ops_1_1_batch_to_space_1aacc62122ef498fc3a9ee89afdbcc6b74)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` | | Public functions | | --- | | `[node](#classtensorflow_1_1ops_1_1_batch_to_space_1a54c1c787b320c2f52099bc7bc02a85ed)() const` | `::tensorflow::Node *` | | `[operator::tensorflow::Input](#classtensorflow_1_1ops_1_1_batch_to_space_1a23f9170b61d8e17feb37f1615a383de2)() const` | | | `[operator::tensorflow::Output](#classtensorflow_1_1ops_1_1_batch_to_space_1a6e84c3b9b55d05ad30e6bcf376278c1d)() const` | | Public attributes ----------------- ### operation ``` Operation operation ``` ### output ``` ::tensorflow::Output output ``` Public functions ---------------- ### BatchToSpace ``` BatchToSpace( const ::tensorflow::Scope & scope, ::tensorflow::Input input, ::tensorflow::Input crops, int64 block_size ) ``` ### node ``` ::tensorflow::Node * node() const ``` ### operator::tensorflow::Input ``` operator::tensorflow::Input() const ``` ### operator::tensorflow::Output ``` operator::tensorflow::Output() const ```
programming_docs
tensorflow_cpp tensorflow::ops::RecordInput tensorflow::ops::RecordInput ============================ `#include <data_flow_ops.h>` Emits randomized records. Summary ------- Args: * scope: A [Scope](../scope#classtensorflow_1_1_scope) object * file\_pattern: Glob pattern for the data files. Optional attributes (see `[Attrs](../../../struct/tensorflow/ops/record-input/attrs#structtensorflow_1_1ops_1_1_record_input_1_1_attrs)`): * file\_random\_seed: Random seeds used to produce randomized records. * file\_shuffle\_shift\_ratio: Shifts the list of files after the list is randomly shuffled. * file\_buffer\_size: The randomization shuffling buffer. * file\_parallelism: How many sstables are opened and concurrently iterated over. * batch\_size: The batch size. * compression\_type: The type of compression for the file. Currently ZLIB and GZIP are supported. Defaults to none. Returns: * `[Output](../output#classtensorflow_1_1_output)`: A tensor of shape [batch\_size]. | Constructors and Destructors | | --- | | `[RecordInput](#classtensorflow_1_1ops_1_1_record_input_1a26e51531e5c0542bd24f55dba61221ae)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, StringPiece file_pattern)` | | `[RecordInput](#classtensorflow_1_1ops_1_1_record_input_1ae26a3c80b78f1c3123122b57250d2e1c)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, StringPiece file_pattern, const [RecordInput::Attrs](../../../struct/tensorflow/ops/record-input/attrs#structtensorflow_1_1ops_1_1_record_input_1_1_attrs) & attrs)` | | Public attributes | | --- | | `[operation](#classtensorflow_1_1ops_1_1_record_input_1a62134892e7237616282ce15d0cbddfb8)` | `[Operation](../operation#classtensorflow_1_1_operation)` | | `[records](#classtensorflow_1_1ops_1_1_record_input_1a95bec6ed7fc088ae5e33dce3df3e10c9)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` | | Public functions | | --- | | `[node](#classtensorflow_1_1ops_1_1_record_input_1ab90acc0d521544c16095592c023a0bd6)() const` | `::tensorflow::Node *` | | `[operator::tensorflow::Input](#classtensorflow_1_1ops_1_1_record_input_1a8c3725ea7466c860d0094502f83c3758)() const` | | | `[operator::tensorflow::Output](#classtensorflow_1_1ops_1_1_record_input_1a81dea1e6e25486fcc6c8eabd37f4160d)() const` | | | Public static functions | | --- | | `[BatchSize](#classtensorflow_1_1ops_1_1_record_input_1a24754dad89c4e9c994ecbb5eefc394e9)(int64 x)` | `[Attrs](../../../struct/tensorflow/ops/record-input/attrs#structtensorflow_1_1ops_1_1_record_input_1_1_attrs)` | | `[CompressionType](#classtensorflow_1_1ops_1_1_record_input_1a37f4ac12cc85c0f43e79b1873b283306)(StringPiece x)` | `[Attrs](../../../struct/tensorflow/ops/record-input/attrs#structtensorflow_1_1ops_1_1_record_input_1_1_attrs)` | | `[FileBufferSize](#classtensorflow_1_1ops_1_1_record_input_1a967b712c3342641c3b5cd4238d9dd123)(int64 x)` | `[Attrs](../../../struct/tensorflow/ops/record-input/attrs#structtensorflow_1_1ops_1_1_record_input_1_1_attrs)` | | `[FileParallelism](#classtensorflow_1_1ops_1_1_record_input_1a0bc86f167dbe3e24d0e72f5ea3126a84)(int64 x)` | `[Attrs](../../../struct/tensorflow/ops/record-input/attrs#structtensorflow_1_1ops_1_1_record_input_1_1_attrs)` | | `[FileRandomSeed](#classtensorflow_1_1ops_1_1_record_input_1a7e8b28adca52696f37fc119b4c5f27e0)(int64 x)` | `[Attrs](../../../struct/tensorflow/ops/record-input/attrs#structtensorflow_1_1ops_1_1_record_input_1_1_attrs)` | | `[FileShuffleShiftRatio](#classtensorflow_1_1ops_1_1_record_input_1abf3d0890e42b0646036a3c3b0224708f)(float x)` | `[Attrs](../../../struct/tensorflow/ops/record-input/attrs#structtensorflow_1_1ops_1_1_record_input_1_1_attrs)` | | Structs | | --- | | [tensorflow::ops::RecordInput::Attrs](../../../struct/tensorflow/ops/record-input/attrs) | Optional attribute setters for [RecordInput](record-input#classtensorflow_1_1ops_1_1_record_input). | Public attributes ----------------- ### operation ``` Operation operation ``` ### records ``` ::tensorflow::Output records ``` Public functions ---------------- ### RecordInput ``` RecordInput( const ::tensorflow::Scope & scope, StringPiece file_pattern ) ``` ### RecordInput ``` RecordInput( const ::tensorflow::Scope & scope, StringPiece file_pattern, const RecordInput::Attrs & attrs ) ``` ### node ``` ::tensorflow::Node * node() const ``` ### operator::tensorflow::Input ``` operator::tensorflow::Input() const ``` ### operator::tensorflow::Output ``` operator::tensorflow::Output() const ``` Public static functions ----------------------- ### BatchSize ``` Attrs BatchSize( int64 x ) ``` ### CompressionType ``` Attrs CompressionType( StringPiece x ) ``` ### FileBufferSize ``` Attrs FileBufferSize( int64 x ) ``` ### FileParallelism ``` Attrs FileParallelism( int64 x ) ``` ### FileRandomSeed ``` Attrs FileRandomSeed( int64 x ) ``` ### FileShuffleShiftRatio ``` Attrs FileShuffleShiftRatio( float x ) ``` tensorflow_cpp tensorflow::ops::SparseSegmentSumWithNumSegments tensorflow::ops::SparseSegmentSumWithNumSegments ================================================ `#include <math_ops.h>` Computes the sum along sparse segments of a tensor. Summary ------- Like `[SparseSegmentSum](sparse-segment-sum#classtensorflow_1_1ops_1_1_sparse_segment_sum)`, but allows missing ids in `segment_ids`. If an id is missing, the `output` tensor at that position will be zeroed. Read [the section on segmentation](https://tensorflow.org/api_docs/python/tf/sparse#Segmentation) for an explanation of segments. For example: ``` c = tf.constant([[1,2,3,4], [-1,-2,-3,-4], [5,6,7,8]]) ``` ``` tf.sparse_segment_sum_with_num_segments( c, tf.constant([0, 1]), tf.constant([0, 0]), num_segments=3) # => [[0 0 0 0] # [0 0 0 0] # [0 0 0 0]] ``` ``` tf.sparse_segment_sum_with_num_segments(c, tf.constant([0, 1]), tf.constant([0, 2], num_segments=4)) # => [[ 1 2 3 4] # [ 0 0 0 0] # [-1 -2 -3 -4] # [ 0 0 0 0]] ``` Args: * scope: A [Scope](../scope#classtensorflow_1_1_scope) object * indices: A 1-D tensor. Has same rank as `segment_ids`. * segment\_ids: A 1-D tensor. Values should be sorted and can be repeated. * num\_segments: Should equal the number of distinct segment IDs. Returns: * `[Output](../output#classtensorflow_1_1_output)`: Has same shape as data, except for dimension 0 which has size `num_segments`. | Constructors and Destructors | | --- | | `[SparseSegmentSumWithNumSegments](#classtensorflow_1_1ops_1_1_sparse_segment_sum_with_num_segments_1aa42ca6fe6f82686ab6e7bf1696c6cf95)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) data, ::[tensorflow::Input](../input#classtensorflow_1_1_input) indices, ::[tensorflow::Input](../input#classtensorflow_1_1_input) segment_ids, ::[tensorflow::Input](../input#classtensorflow_1_1_input) num_segments)` | | Public attributes | | --- | | `[operation](#classtensorflow_1_1ops_1_1_sparse_segment_sum_with_num_segments_1aef731be5257efe05dd4fcab3b8bc1a97)` | `[Operation](../operation#classtensorflow_1_1_operation)` | | `[output](#classtensorflow_1_1ops_1_1_sparse_segment_sum_with_num_segments_1a0268bacaeeeaa16b2034d2bbbce8fbe4)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` | | Public functions | | --- | | `[node](#classtensorflow_1_1ops_1_1_sparse_segment_sum_with_num_segments_1a26167428eac960c8c69c07839a55d289)() const` | `::tensorflow::Node *` | | `[operator::tensorflow::Input](#classtensorflow_1_1ops_1_1_sparse_segment_sum_with_num_segments_1a59838fffe06404d59d3a86d7a1a664ab)() const` | | | `[operator::tensorflow::Output](#classtensorflow_1_1ops_1_1_sparse_segment_sum_with_num_segments_1a0540eaea9f382d555400bcda1f86c781)() const` | | Public attributes ----------------- ### operation ``` Operation operation ``` ### output ``` ::tensorflow::Output output ``` Public functions ---------------- ### SparseSegmentSumWithNumSegments ``` SparseSegmentSumWithNumSegments( const ::tensorflow::Scope & scope, ::tensorflow::Input data, ::tensorflow::Input indices, ::tensorflow::Input segment_ids, ::tensorflow::Input num_segments ) ``` ### node ``` ::tensorflow::Node * node() const ``` ### operator::tensorflow::Input ``` operator::tensorflow::Input() const ``` ### operator::tensorflow::Output ``` operator::tensorflow::Output() const ``` tensorflow_cpp tensorflow::ops::StringToHashBucket tensorflow::ops::StringToHashBucket =================================== `#include <string_ops.h>` Converts each string in the input [Tensor](../tensor#classtensorflow_1_1_tensor) to its hash mod by a number of buckets. Summary ------- The hash function is deterministic on the content of the string within the process. Note that the hash function may change from time to time. This functionality will be deprecated and it's recommended to use `tf.string_to_hash_bucket_fast()` or `tf.string_to_hash_bucket_strong()`. Args: * scope: A [Scope](../scope#classtensorflow_1_1_scope) object * num\_buckets: The number of buckets. Returns: * `[Output](../output#classtensorflow_1_1_output)`: A [Tensor](../tensor#classtensorflow_1_1_tensor) of the same shape as the input `string_tensor`. | Constructors and Destructors | | --- | | `[StringToHashBucket](#classtensorflow_1_1ops_1_1_string_to_hash_bucket_1a45ffa748a3113aebc478191777156e23)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) string_tensor, int64 num_buckets)` | | Public attributes | | --- | | `[operation](#classtensorflow_1_1ops_1_1_string_to_hash_bucket_1a8e8161468ccb2b34fb9d2ee060e04dae)` | `[Operation](../operation#classtensorflow_1_1_operation)` | | `[output](#classtensorflow_1_1ops_1_1_string_to_hash_bucket_1aa9bf9eee8fb7b9e5590cf5591057b40a)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` | | Public functions | | --- | | `[node](#classtensorflow_1_1ops_1_1_string_to_hash_bucket_1ad01f6ca8a9542ce9a2d082c3e8aa3deb)() const` | `::tensorflow::Node *` | | `[operator::tensorflow::Input](#classtensorflow_1_1ops_1_1_string_to_hash_bucket_1a796c5fc80d4ca7bc537f783ec6c40c51)() const` | | | `[operator::tensorflow::Output](#classtensorflow_1_1ops_1_1_string_to_hash_bucket_1a9ae43cc82a78a8e8958dcc0fdf944aab)() const` | | Public attributes ----------------- ### operation ``` Operation operation ``` ### output ``` ::tensorflow::Output output ``` Public functions ---------------- ### StringToHashBucket ``` StringToHashBucket( const ::tensorflow::Scope & scope, ::tensorflow::Input string_tensor, int64 num_buckets ) ``` ### node ``` ::tensorflow::Node * node() const ``` ### operator::tensorflow::Input ``` operator::tensorflow::Input() const ``` ### operator::tensorflow::Output ``` operator::tensorflow::Output() const ``` tensorflow_cpp tensorflow::ops::ExtractImagePatches tensorflow::ops::ExtractImagePatches ==================================== `#include <array_ops.h>` Extract `patches` from `images` and put them in the "depth" output dimension. Summary ------- Args: * scope: A [Scope](../scope#classtensorflow_1_1_scope) object * images: 4-D [Tensor](../tensor#classtensorflow_1_1_tensor) with shape `[batch, in_rows, in_cols, depth]`. * ksizes: The size of the sliding window for each dimension of `images`. * strides: How far the centers of two consecutive patches are in the images. Must be: `[1, stride_rows, stride_cols, 1]`. * rates: Must be: `[1, rate_rows, rate_cols, 1]`. This is the input stride, specifying how far two consecutive patch samples are in the input. Equivalent to extracting patches with `patch_sizes_eff = patch_sizes + (patch_sizes - 1) * (rates - 1)`, followed by subsampling them spatially by a factor of `rates`. This is equivalent to `rate` in dilated (a.k.a. Atrous) convolutions. * padding: The type of padding algorithm to use. Returns: * `[Output](../output#classtensorflow_1_1_output)`: 4-D [Tensor](../tensor#classtensorflow_1_1_tensor) with shape `[batch, out_rows, out_cols, ksize_rows * ksize_cols * depth]` containing image patches with size `ksize_rows x ksize_cols x depth` vectorized in the "depth" dimension. Note `out_rows` and `out_cols` are the dimensions of the output patches. | Constructors and Destructors | | --- | | `[ExtractImagePatches](#classtensorflow_1_1ops_1_1_extract_image_patches_1a48a27e59bf001d9d0599c4a4ad3abcf9)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) images, const gtl::ArraySlice< int > & ksizes, const gtl::ArraySlice< int > & strides, const gtl::ArraySlice< int > & rates, StringPiece padding)` | | Public attributes | | --- | | `[operation](#classtensorflow_1_1ops_1_1_extract_image_patches_1a20f65de6816816f98d46af224137110d)` | `[Operation](../operation#classtensorflow_1_1_operation)` | | `[patches](#classtensorflow_1_1ops_1_1_extract_image_patches_1a282b671f1a0d52422cd35c75d6819ee1)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` | | Public functions | | --- | | `[node](#classtensorflow_1_1ops_1_1_extract_image_patches_1a812a245b3efe85c0003da911be95b891)() const` | `::tensorflow::Node *` | | `[operator::tensorflow::Input](#classtensorflow_1_1ops_1_1_extract_image_patches_1a3dbc12d46ac43f4e5cb6868030310880)() const` | | | `[operator::tensorflow::Output](#classtensorflow_1_1ops_1_1_extract_image_patches_1a7a11be91c9fd8c6b3c5d48ae30630a18)() const` | | Public attributes ----------------- ### operation ``` Operation operation ``` ### patches ``` ::tensorflow::Output patches ``` Public functions ---------------- ### ExtractImagePatches ``` ExtractImagePatches( const ::tensorflow::Scope & scope, ::tensorflow::Input images, const gtl::ArraySlice< int > & ksizes, const gtl::ArraySlice< int > & strides, const gtl::ArraySlice< int > & rates, StringPiece padding ) ``` ### node ``` ::tensorflow::Node * node() const ``` ### operator::tensorflow::Input ``` operator::tensorflow::Input() const ``` ### operator::tensorflow::Output ``` operator::tensorflow::Output() const ``` tensorflow_cpp tensorflow::ops::ScatterMul tensorflow::ops::ScatterMul =========================== `#include <state_ops.h>` Multiplies sparse updates into a variable reference. Summary ------- This operation computes ``` # Scalar indices ref[indices, ...] *= updates[...] ``` ``` # Vector indices (for each i) ref[indices[i], ...] *= updates[i, ...] ``` ``` # High rank indices (for each i, ..., j) ref[indices[i, ..., j], ...] *= updates[i, ..., j, ...] ``` This operation outputs `ref` after the update is done. This makes it easier to chain operations that need to use the reset value. Duplicate entries are handled correctly: if multiple `indices` reference the same location, their contributions multiply. Requires `updates.shape = indices.shape + ref.shape[1:]` or `updates.shape = []`. Args: * scope: A [Scope](../scope#classtensorflow_1_1_scope) object * ref: Should be from a `[Variable](variable#classtensorflow_1_1ops_1_1_variable)` node. * indices: A tensor of indices into the first dimension of `ref`. * updates: A tensor of updated values to multiply to `ref`. Optional attributes (see `[Attrs](../../../struct/tensorflow/ops/scatter-mul/attrs#structtensorflow_1_1ops_1_1_scatter_mul_1_1_attrs)`): * use\_locking: If True, the operation will be protected by a lock; otherwise the behavior is undefined, but may exhibit less contention. Returns: * `[Output](../output#classtensorflow_1_1_output)`: = Same as `ref`. Returned as a convenience for operations that want to use the updated values after the update is done. | Constructors and Destructors | | --- | | `[ScatterMul](#classtensorflow_1_1ops_1_1_scatter_mul_1a7db6b5ac554e784855d78d429e7574e3)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) ref, ::[tensorflow::Input](../input#classtensorflow_1_1_input) indices, ::[tensorflow::Input](../input#classtensorflow_1_1_input) updates)` | | `[ScatterMul](#classtensorflow_1_1ops_1_1_scatter_mul_1a59f4787f45824ffa7053c4184caea38f)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) ref, ::[tensorflow::Input](../input#classtensorflow_1_1_input) indices, ::[tensorflow::Input](../input#classtensorflow_1_1_input) updates, const [ScatterMul::Attrs](../../../struct/tensorflow/ops/scatter-mul/attrs#structtensorflow_1_1ops_1_1_scatter_mul_1_1_attrs) & attrs)` | | Public attributes | | --- | | `[operation](#classtensorflow_1_1ops_1_1_scatter_mul_1a3e2e0e89df1f658634f7268ac3785dd8)` | `[Operation](../operation#classtensorflow_1_1_operation)` | | `[output\_ref](#classtensorflow_1_1ops_1_1_scatter_mul_1a6c4d285e1c8631ca2fad4529c134bd60)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` | | Public functions | | --- | | `[node](#classtensorflow_1_1ops_1_1_scatter_mul_1a643d99a44650276080fea233a3649261)() const` | `::tensorflow::Node *` | | `[operator::tensorflow::Input](#classtensorflow_1_1ops_1_1_scatter_mul_1a1c452250deb719e0fea5fb0714fa7231)() const` | | | `[operator::tensorflow::Output](#classtensorflow_1_1ops_1_1_scatter_mul_1ab7c16cd28461b1d78e7b1d1efd4811da)() const` | | | Public static functions | | --- | | `[UseLocking](#classtensorflow_1_1ops_1_1_scatter_mul_1aaacc375e6d81db93be7d7823990b3b9b)(bool x)` | `[Attrs](../../../struct/tensorflow/ops/scatter-mul/attrs#structtensorflow_1_1ops_1_1_scatter_mul_1_1_attrs)` | | Structs | | --- | | [tensorflow::ops::ScatterMul::Attrs](../../../struct/tensorflow/ops/scatter-mul/attrs) | Optional attribute setters for [ScatterMul](scatter-mul#classtensorflow_1_1ops_1_1_scatter_mul). | Public attributes ----------------- ### operation ``` Operation operation ``` ### output\_ref ``` ::tensorflow::Output output_ref ``` Public functions ---------------- ### ScatterMul ``` ScatterMul( const ::tensorflow::Scope & scope, ::tensorflow::Input ref, ::tensorflow::Input indices, ::tensorflow::Input updates ) ``` ### ScatterMul ``` ScatterMul( const ::tensorflow::Scope & scope, ::tensorflow::Input ref, ::tensorflow::Input indices, ::tensorflow::Input updates, const ScatterMul::Attrs & attrs ) ``` ### node ``` ::tensorflow::Node * node() const ``` ### operator::tensorflow::Input ``` operator::tensorflow::Input() const ``` ### operator::tensorflow::Output ``` operator::tensorflow::Output() const ``` Public static functions ----------------------- ### UseLocking ``` Attrs UseLocking( bool x ) ``` tensorflow_cpp tensorflow::ops::DeserializeManySparse tensorflow::ops::DeserializeManySparse ====================================== `#include <sparse_ops.h>` Deserialize and concatenate `SparseTensors` from a serialized minibatch. Summary ------- The input `serialized_sparse` must be a string matrix of shape `[N x 3]` where `N` is the minibatch size and the rows correspond to packed outputs of `[SerializeSparse](serialize-sparse#classtensorflow_1_1ops_1_1_serialize_sparse)`. The ranks of the original `SparseTensor` objects must all match. When the final `SparseTensor` is created, it has rank one higher than the ranks of the incoming `SparseTensor` objects (they have been concatenated along a new row dimension). The output `SparseTensor` object's shape values for all dimensions but the first are the max across the input `SparseTensor` objects' shape values for the corresponding dimensions. Its first shape value is `N`, the minibatch size. The input `SparseTensor` objects' indices are assumed ordered in standard lexicographic order. If this is not the case, after this step run `[SparseReorder](sparse-reorder#classtensorflow_1_1ops_1_1_sparse_reorder)` to restore index ordering. For example, if the serialized input is a `[2 x 3]` matrix representing two original `SparseTensor` objects: ``` index = [ 0] [10] [20] values = [1, 2, 3] shape = [50] ``` and ``` index = [ 2] [10] values = [4, 5] shape = [30] ``` then the final deserialized `SparseTensor` will be: ``` index = [0 0] [0 10] [0 20] [1 2] [1 10] values = [1, 2, 3, 4, 5] shape = [2 50] ``` Args: * scope: A [Scope](../scope#classtensorflow_1_1_scope) object * serialized\_sparse: 2-D, The `N` serialized `SparseTensor` objects. Must have 3 columns. * dtype: The `dtype` of the serialized `SparseTensor` objects. Returns: * `[Output](../output#classtensorflow_1_1_output)` sparse\_indices * `[Output](../output#classtensorflow_1_1_output)` sparse\_values * `[Output](../output#classtensorflow_1_1_output)` sparse\_shape | Constructors and Destructors | | --- | | `[DeserializeManySparse](#classtensorflow_1_1ops_1_1_deserialize_many_sparse_1ab7cf9797d35b97c6d82e4000573b7839)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) serialized_sparse, DataType dtype)` | | Public attributes | | --- | | `[operation](#classtensorflow_1_1ops_1_1_deserialize_many_sparse_1ac7cd19536afb9e162240583e49e59e8d)` | `[Operation](../operation#classtensorflow_1_1_operation)` | | `[sparse\_indices](#classtensorflow_1_1ops_1_1_deserialize_many_sparse_1a047caae64f0cea6d6dc1659d15bfe4b9)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` | | `[sparse\_shape](#classtensorflow_1_1ops_1_1_deserialize_many_sparse_1a248aaedf66a2ba1733b1f2e541c4d3e2)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` | | `[sparse\_values](#classtensorflow_1_1ops_1_1_deserialize_many_sparse_1a1047d48275c3140bedd5e8737af534f2)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` | Public attributes ----------------- ### operation ``` Operation operation ``` ### sparse\_indices ``` ::tensorflow::Output sparse_indices ``` ### sparse\_shape ``` ::tensorflow::Output sparse_shape ``` ### sparse\_values ``` ::tensorflow::Output sparse_values ``` Public functions ---------------- ### DeserializeManySparse ``` DeserializeManySparse( const ::tensorflow::Scope & scope, ::tensorflow::Input serialized_sparse, DataType dtype ) ```
programming_docs
tensorflow_cpp tensorflow::ops::QuantizeDownAndShrinkRange tensorflow::ops::QuantizeDownAndShrinkRange =========================================== `#include <math_ops.h>` Convert the quantized 'input' tensor into a lower-precision 'output', using the. Summary ------- actual distribution of the values to maximize the usage of the lower bit depth and adjusting the output min and max ranges accordingly. [input\_min, input\_max] are scalar floats that specify the range for the float interpretation of the 'input' data. For example, if input\_min is -1.0f and input\_max is 1.0f, and we are dealing with quint16 quantized data, then a 0 value in the 16-bit data should be interpreted as -1.0f, and a 65535 means 1.0f. This operator tries to squeeze as much precision as possible into an output with a lower bit depth by calculating the actual min and max values found in the data. For example, maybe that quint16 input has no values lower than 16,384 and none higher than 49,152. That means only half the range is actually needed, all the float interpretations are between -0.5f and 0.5f, so if we want to compress the data into a quint8 output, we can use that range rather than the theoretical -1.0f to 1.0f that is suggested by the input min and max. In practice, this is most useful for taking output from operations like [QuantizedMatMul](quantized-mat-mul#classtensorflow_1_1ops_1_1_quantized_mat_mul) that can produce higher bit-depth outputs than their inputs and may have large potential output ranges, but in practice have a distribution of input values that only uses a small fraction of the possible range. By feeding that output into this operator, we can reduce it from 32 bits down to 8 with minimal loss of accuracy. Args: * scope: A [Scope](../scope#classtensorflow_1_1_scope) object * input\_min: The float value that the minimum quantized input value represents. * input\_max: The float value that the maximum quantized input value represents. * out\_type: The type of the output. Should be a lower bit depth than Tinput. Returns: * `[Output](../output#classtensorflow_1_1_output)` output * `[Output](../output#classtensorflow_1_1_output)` output\_min: The float value that the minimum quantized output value represents. * `[Output](../output#classtensorflow_1_1_output)` output\_max: The float value that the maximum quantized output value represents. | Constructors and Destructors | | --- | | `[QuantizeDownAndShrinkRange](#classtensorflow_1_1ops_1_1_quantize_down_and_shrink_range_1a19ee578c7b888e9aca48d291a1a0d5da)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) input, ::[tensorflow::Input](../input#classtensorflow_1_1_input) input_min, ::[tensorflow::Input](../input#classtensorflow_1_1_input) input_max, DataType out_type)` | | Public attributes | | --- | | `[operation](#classtensorflow_1_1ops_1_1_quantize_down_and_shrink_range_1a3ab13cf6f6f7814f990022d1a49b3a99)` | `[Operation](../operation#classtensorflow_1_1_operation)` | | `[output](#classtensorflow_1_1ops_1_1_quantize_down_and_shrink_range_1a02ce18813489b86884040f42ddcfca87)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` | | `[output\_max](#classtensorflow_1_1ops_1_1_quantize_down_and_shrink_range_1a3c2857dfc27b8777dc82845ec0a4919a)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` | | `[output\_min](#classtensorflow_1_1ops_1_1_quantize_down_and_shrink_range_1aa8dddbbd62576e4961029ce5ed846677)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` | Public attributes ----------------- ### operation ``` Operation operation ``` ### output ``` ::tensorflow::Output output ``` ### output\_max ``` ::tensorflow::Output output_max ``` ### output\_min ``` ::tensorflow::Output output_min ``` Public functions ---------------- ### QuantizeDownAndShrinkRange ``` QuantizeDownAndShrinkRange( const ::tensorflow::Scope & scope, ::tensorflow::Input input, ::tensorflow::Input input_min, ::tensorflow::Input input_max, DataType out_type ) ``` tensorflow_cpp tensorflow::ops::QueueIsClosed tensorflow::ops::QueueIsClosed ============================== `#include <data_flow_ops.h>` Returns true if queue is closed. Summary ------- This operation returns true if the queue is closed and false if the queue is open. Args: * scope: A [Scope](../scope#classtensorflow_1_1_scope) object * handle: The handle to a queue. Returns: * `[Output](../output#classtensorflow_1_1_output)`: The is\_closed tensor. | Constructors and Destructors | | --- | | `[QueueIsClosed](#classtensorflow_1_1ops_1_1_queue_is_closed_1ae12a5764b754352e9e0a419bfe062679)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) handle)` | | Public attributes | | --- | | `[is\_closed](#classtensorflow_1_1ops_1_1_queue_is_closed_1adec9d25751b44ab1c1cba1d7ff727436)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` | | `[operation](#classtensorflow_1_1ops_1_1_queue_is_closed_1aacb9cb6c4bc0469cd9a49d6342a33582)` | `[Operation](../operation#classtensorflow_1_1_operation)` | | Public functions | | --- | | `[node](#classtensorflow_1_1ops_1_1_queue_is_closed_1a96b25db51c9f655c1e054e62e0987a80)() const` | `::tensorflow::Node *` | | `[operator::tensorflow::Input](#classtensorflow_1_1ops_1_1_queue_is_closed_1a3d26785bdb91d160ceeaba5d1e4b9628)() const` | | | `[operator::tensorflow::Output](#classtensorflow_1_1ops_1_1_queue_is_closed_1adc477394408ce66c1be820d7b5e6deb5)() const` | | Public attributes ----------------- ### is\_closed ``` ::tensorflow::Output is_closed ``` ### operation ``` Operation operation ``` Public functions ---------------- ### QueueIsClosed ``` QueueIsClosed( const ::tensorflow::Scope & scope, ::tensorflow::Input handle ) ``` ### node ``` ::tensorflow::Node * node() const ``` ### operator::tensorflow::Input ``` operator::tensorflow::Input() const ``` ### operator::tensorflow::Output ``` operator::tensorflow::Output() const ``` tensorflow_cpp tensorflow::ops::ResourceApplyRMSProp tensorflow::ops::ResourceApplyRMSProp ===================================== `#include <training_ops.h>` Update '\*var' according to the RMSProp algorithm. Summary ------- Note that in dense implementation of this algorithm, ms and mom will update even if the grad is zero, but in this sparse implementation, ms and mom will not update in iterations during which the grad is zero. mean\_square = decay \* mean\_square + (1-decay) \* gradient \*\* 2 Delta = learning\_rate \* gradient / sqrt(mean\_square + epsilon) ms <- rho \* ms\_{t-1} + (1-rho) \* grad \* grad mom <- momentum \* mom\_{t-1} + lr \* grad / sqrt(ms + epsilon) var <- var - mom Args: * scope: A [Scope](../scope#classtensorflow_1_1_scope) object * var: Should be from a Variable(). * ms: Should be from a Variable(). * mom: Should be from a Variable(). * lr: Scaling factor. Must be a scalar. * rho: Decay rate. Must be a scalar. * epsilon: Ridge term. Must be a scalar. * grad: The gradient. Optional attributes (see `[Attrs](../../../struct/tensorflow/ops/resource-apply-r-m-s-prop/attrs#structtensorflow_1_1ops_1_1_resource_apply_r_m_s_prop_1_1_attrs)`): * use\_locking: If `True`, updating of the var, ms, and mom tensors is protected by a lock; otherwise the behavior is undefined, but may exhibit less contention. Returns: * the created `[Operation](../operation#classtensorflow_1_1_operation)` | Constructors and Destructors | | --- | | `[ResourceApplyRMSProp](#classtensorflow_1_1ops_1_1_resource_apply_r_m_s_prop_1ae91eb1e2b6b3e0c166963715954c5122)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) var, ::[tensorflow::Input](../input#classtensorflow_1_1_input) ms, ::[tensorflow::Input](../input#classtensorflow_1_1_input) mom, ::[tensorflow::Input](../input#classtensorflow_1_1_input) lr, ::[tensorflow::Input](../input#classtensorflow_1_1_input) rho, ::[tensorflow::Input](../input#classtensorflow_1_1_input) momentum, ::[tensorflow::Input](../input#classtensorflow_1_1_input) epsilon, ::[tensorflow::Input](../input#classtensorflow_1_1_input) grad)` | | `[ResourceApplyRMSProp](#classtensorflow_1_1ops_1_1_resource_apply_r_m_s_prop_1a75df67ab1eea661cf727de50a0a7fb98)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) var, ::[tensorflow::Input](../input#classtensorflow_1_1_input) ms, ::[tensorflow::Input](../input#classtensorflow_1_1_input) mom, ::[tensorflow::Input](../input#classtensorflow_1_1_input) lr, ::[tensorflow::Input](../input#classtensorflow_1_1_input) rho, ::[tensorflow::Input](../input#classtensorflow_1_1_input) momentum, ::[tensorflow::Input](../input#classtensorflow_1_1_input) epsilon, ::[tensorflow::Input](../input#classtensorflow_1_1_input) grad, const [ResourceApplyRMSProp::Attrs](../../../struct/tensorflow/ops/resource-apply-r-m-s-prop/attrs#structtensorflow_1_1ops_1_1_resource_apply_r_m_s_prop_1_1_attrs) & attrs)` | | Public attributes | | --- | | `[operation](#classtensorflow_1_1ops_1_1_resource_apply_r_m_s_prop_1a48b8adc2f5de282222027a49c23ff42d)` | `[Operation](../operation#classtensorflow_1_1_operation)` | | Public functions | | --- | | `[operator::tensorflow::Operation](#classtensorflow_1_1ops_1_1_resource_apply_r_m_s_prop_1afe6e89eae46d27e22c2ac94cc2c7aadc)() const` | | | Public static functions | | --- | | `[UseLocking](#classtensorflow_1_1ops_1_1_resource_apply_r_m_s_prop_1aacf915d8791a673d2e19b0af3d86af3a)(bool x)` | `[Attrs](../../../struct/tensorflow/ops/resource-apply-r-m-s-prop/attrs#structtensorflow_1_1ops_1_1_resource_apply_r_m_s_prop_1_1_attrs)` | | Structs | | --- | | [tensorflow::ops::ResourceApplyRMSProp::Attrs](../../../struct/tensorflow/ops/resource-apply-r-m-s-prop/attrs) | Optional attribute setters for [ResourceApplyRMSProp](resource-apply-r-m-s-prop#classtensorflow_1_1ops_1_1_resource_apply_r_m_s_prop). | Public attributes ----------------- ### operation ``` Operation operation ``` Public functions ---------------- ### ResourceApplyRMSProp ``` ResourceApplyRMSProp( const ::tensorflow::Scope & scope, ::tensorflow::Input var, ::tensorflow::Input ms, ::tensorflow::Input mom, ::tensorflow::Input lr, ::tensorflow::Input rho, ::tensorflow::Input momentum, ::tensorflow::Input epsilon, ::tensorflow::Input grad ) ``` ### ResourceApplyRMSProp ``` ResourceApplyRMSProp( const ::tensorflow::Scope & scope, ::tensorflow::Input var, ::tensorflow::Input ms, ::tensorflow::Input mom, ::tensorflow::Input lr, ::tensorflow::Input rho, ::tensorflow::Input momentum, ::tensorflow::Input epsilon, ::tensorflow::Input grad, const ResourceApplyRMSProp::Attrs & attrs ) ``` ### operator::tensorflow::Operation ``` operator::tensorflow::Operation() const ``` Public static functions ----------------------- ### UseLocking ``` Attrs UseLocking( bool x ) ``` tensorflow_cpp tensorflow::ops::RefSwitch tensorflow::ops::RefSwitch ========================== `#include <control_flow_ops.h>` Forwards the ref tensor `data` to the output port determined by `pred`. Summary ------- If `pred` is true, the `data` input is forwarded to `output_true`. Otherwise, the data goes to `output_false`. See also `[Switch](switch#classtensorflow_1_1ops_1_1_switch)` and `[Merge](merge#classtensorflow_1_1ops_1_1_merge)`. Args: * scope: A [Scope](../scope#classtensorflow_1_1_scope) object * data: The ref tensor to be forwarded to the appropriate output. * pred: A scalar that specifies which output port will receive data. Returns: * `[Output](../output#classtensorflow_1_1_output)` output\_false: If `pred` is false, data will be forwarded to this output. * `[Output](../output#classtensorflow_1_1_output)` output\_true: If `pred` is true, data will be forwarded to this output. | Constructors and Destructors | | --- | | `[RefSwitch](#classtensorflow_1_1ops_1_1_ref_switch_1a6776369f0966446feb0aa0f9d413aba0)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) data, ::[tensorflow::Input](../input#classtensorflow_1_1_input) pred)` | | Public attributes | | --- | | `[operation](#classtensorflow_1_1ops_1_1_ref_switch_1a2ccd0f134fb8e9af48737d5ba0434056)` | `[Operation](../operation#classtensorflow_1_1_operation)` | | `[output\_false](#classtensorflow_1_1ops_1_1_ref_switch_1a070534567ff9bb630bfee0c600d75ae4)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` | | `[output\_true](#classtensorflow_1_1ops_1_1_ref_switch_1ae47dda15cdabd3d3badf4eaadb5f91b7)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` | Public attributes ----------------- ### operation ``` Operation operation ``` ### output\_false ``` ::tensorflow::Output output_false ``` ### output\_true ``` ::tensorflow::Output output_true ``` Public functions ---------------- ### RefSwitch ``` RefSwitch( const ::tensorflow::Scope & scope, ::tensorflow::Input data, ::tensorflow::Input pred ) ``` tensorflow_cpp tensorflow::ops::Betainc tensorflow::ops::Betainc ======================== `#include <math_ops.h>` Compute the regularized incomplete beta integral \(I\_x(a, b)\). Summary ------- The regularized incomplete beta integral is defined as: \(I\_x(a, b) = \frac{B(x; a, b)}{B(a, b)}\) where \(B(x; a, b) = \int\_0^x t^{a-1} (1 - t)^{b-1} dt\) is the incomplete beta function and \(B(a, b)\) is the *complete* beta function. Args: * scope: A [Scope](../scope#classtensorflow_1_1_scope) object Returns: * `[Output](../output#classtensorflow_1_1_output)`: The z tensor. | Constructors and Destructors | | --- | | `[Betainc](#classtensorflow_1_1ops_1_1_betainc_1a13ab92c26e4387e364ba1f747bc9666e)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) a, ::[tensorflow::Input](../input#classtensorflow_1_1_input) b, ::[tensorflow::Input](../input#classtensorflow_1_1_input) x)` | | Public attributes | | --- | | `[operation](#classtensorflow_1_1ops_1_1_betainc_1ade71245746ebd8d4da5b1a783f504024)` | `[Operation](../operation#classtensorflow_1_1_operation)` | | `[z](#classtensorflow_1_1ops_1_1_betainc_1a37abcada8caac0061566b13386cb10bd)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` | | Public functions | | --- | | `[node](#classtensorflow_1_1ops_1_1_betainc_1aa6563406641f7654459e830ce110d1b9)() const` | `::tensorflow::Node *` | | `[operator::tensorflow::Input](#classtensorflow_1_1ops_1_1_betainc_1a4705fedd870694c57911f00ca4c83103)() const` | | | `[operator::tensorflow::Output](#classtensorflow_1_1ops_1_1_betainc_1ad60f6197b9d3bd810c4f53bcaf034076)() const` | | Public attributes ----------------- ### operation ``` Operation operation ``` ### z ``` ::tensorflow::Output z ``` Public functions ---------------- ### Betainc ``` Betainc( const ::tensorflow::Scope & scope, ::tensorflow::Input a, ::tensorflow::Input b, ::tensorflow::Input x ) ``` ### node ``` ::tensorflow::Node * node() const ``` ### operator::tensorflow::Input ``` operator::tensorflow::Input() const ``` ### operator::tensorflow::Output ``` operator::tensorflow::Output() const ``` tensorflow_cpp tensorflow::ops::UnicodeScript tensorflow::ops::UnicodeScript ============================== `#include <string_ops.h>` Determine the script codes of a given tensor of Unicode integer code points. Summary ------- This operation converts Unicode code points to script codes corresponding to each code point. Script codes correspond to International Components for Unicode (ICU) UScriptCode values. See [ICU project docs](http://icu-project.org/apiref/icu4c/uscript_8h.html) for more details on script codes. For an example, see the unicode strings guide on [unicode scripts](https://www.tensorflow.org/tutorials/load_data/unicode#representing_unicode). Returns -1 (USCRIPT\_INVALID\_CODE) for invalid codepoints. [Output](../output#classtensorflow_1_1_output) shape will match input shape. Examples: tf.strings.unicode\_script([1, 31, 38]) Args: * scope: A [Scope](../scope#classtensorflow_1_1_scope) object * input: A [Tensor](../tensor#classtensorflow_1_1_tensor) of int32 Unicode code points. Returns: * `[Output](../output#classtensorflow_1_1_output)`: A [Tensor](../tensor#classtensorflow_1_1_tensor) of int32 script codes corresponding to each input code point. | Constructors and Destructors | | --- | | `[UnicodeScript](#classtensorflow_1_1ops_1_1_unicode_script_1a3c2f38d3c9ff7884807dc6e6660d6224)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) input)` | | Public attributes | | --- | | `[operation](#classtensorflow_1_1ops_1_1_unicode_script_1a6b62e38d971b7c2f49b7f46ca75a79e9)` | `[Operation](../operation#classtensorflow_1_1_operation)` | | `[output](#classtensorflow_1_1ops_1_1_unicode_script_1a3e6135cd756ada3ee51b37c8f879e0a1)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` | | Public functions | | --- | | `[node](#classtensorflow_1_1ops_1_1_unicode_script_1a3b95cdc9894e77ef015829cf931510bc)() const` | `::tensorflow::Node *` | | `[operator::tensorflow::Input](#classtensorflow_1_1ops_1_1_unicode_script_1aa515662748bc0cb5a41ff152999c3c41)() const` | | | `[operator::tensorflow::Output](#classtensorflow_1_1ops_1_1_unicode_script_1a7fb25478d3dbc1e89e0dce2dbdcf425f)() const` | | Public attributes ----------------- ### operation ``` Operation operation ``` ### output ``` ::tensorflow::Output output ``` Public functions ---------------- ### UnicodeScript ``` UnicodeScript( const ::tensorflow::Scope & scope, ::tensorflow::Input input ) ``` ### node ``` ::tensorflow::Node * node() const ``` ### operator::tensorflow::Input ``` operator::tensorflow::Input() const ``` ### operator::tensorflow::Output ``` operator::tensorflow::Output() const ``` tensorflow_cpp tensorflow::ops::FakeQuantWithMinMaxVars tensorflow::ops::FakeQuantWithMinMaxVars ======================================== `#include <array_ops.h>` Fake-quantize the 'inputs' tensor of type float via global float scalars. Summary ------- Fake-quantize the `inputs` tensor of type float via global float scalars `min` and `max` to `outputs` tensor of same shape as `inputs`. Attributes * `[min; max]` define the clamping range for the `inputs` data. * `inputs` values are quantized into the quantization range ( `[0; 2^num_bits - 1]` when `narrow_range` is false and `[1; 2^num_bits - 1]` when it is true) and then de-quantized and output as floats in `[min; max]` interval. * `num_bits` is the bitwidth of the quantization; between 2 and 16, inclusive. Before quantization, `min` and `max` values are adjusted with the following logic. It is suggested to have `min <= 0 <= max`. If `0` is not in the range of values, the behavior can be unexpected: * If `0 < min < max`: `min_adj = 0` and `max_adj = max - min`. * If `min < max < 0`: `min_adj = min - max` and `max_adj = 0`. * If `min <= 0 <= max`: `scale = (max - min) / (2^num_bits - 1)`, `min_adj = scale * round(min / scale)` and `max_adj = max + min_adj - min`. This operation has a gradient and thus allows for training `min` and `max` values. Args: * scope: A [Scope](../scope#classtensorflow_1_1_scope) object Returns: * `[Output](../output#classtensorflow_1_1_output)`: The outputs tensor. | Constructors and Destructors | | --- | | `[FakeQuantWithMinMaxVars](#classtensorflow_1_1ops_1_1_fake_quant_with_min_max_vars_1a00ee58aabd6226983d344471c6956521)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) inputs, ::[tensorflow::Input](../input#classtensorflow_1_1_input) min, ::[tensorflow::Input](../input#classtensorflow_1_1_input) max)` | | `[FakeQuantWithMinMaxVars](#classtensorflow_1_1ops_1_1_fake_quant_with_min_max_vars_1a86e17a607800b4a82880a67535ed4395)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) inputs, ::[tensorflow::Input](../input#classtensorflow_1_1_input) min, ::[tensorflow::Input](../input#classtensorflow_1_1_input) max, const [FakeQuantWithMinMaxVars::Attrs](../../../struct/tensorflow/ops/fake-quant-with-min-max-vars/attrs#structtensorflow_1_1ops_1_1_fake_quant_with_min_max_vars_1_1_attrs) & attrs)` | | Public attributes | | --- | | `[operation](#classtensorflow_1_1ops_1_1_fake_quant_with_min_max_vars_1af7b295d43fd540e49c6a4e1621d8ed30)` | `[Operation](../operation#classtensorflow_1_1_operation)` | | `[outputs](#classtensorflow_1_1ops_1_1_fake_quant_with_min_max_vars_1a9fc018d2523132a82d3e60c8e7dc465f)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` | | Public functions | | --- | | `[node](#classtensorflow_1_1ops_1_1_fake_quant_with_min_max_vars_1a1d4aaa7a38907c46fc2ea3372028d94c)() const` | `::tensorflow::Node *` | | `[operator::tensorflow::Input](#classtensorflow_1_1ops_1_1_fake_quant_with_min_max_vars_1a384ba596b1a4aebcb314a87e7411fd62)() const` | | | `[operator::tensorflow::Output](#classtensorflow_1_1ops_1_1_fake_quant_with_min_max_vars_1ac698bada55ee29951a83182f80ee6395)() const` | | | Public static functions | | --- | | `[NarrowRange](#classtensorflow_1_1ops_1_1_fake_quant_with_min_max_vars_1aee3dc1525e2c3837ac1b66757ec20823)(bool x)` | `[Attrs](../../../struct/tensorflow/ops/fake-quant-with-min-max-vars/attrs#structtensorflow_1_1ops_1_1_fake_quant_with_min_max_vars_1_1_attrs)` | | `[NumBits](#classtensorflow_1_1ops_1_1_fake_quant_with_min_max_vars_1a08eae0ee7977569586e1a3fadb261b95)(int64 x)` | `[Attrs](../../../struct/tensorflow/ops/fake-quant-with-min-max-vars/attrs#structtensorflow_1_1ops_1_1_fake_quant_with_min_max_vars_1_1_attrs)` | | Structs | | --- | | [tensorflow::ops::FakeQuantWithMinMaxVars::Attrs](../../../struct/tensorflow/ops/fake-quant-with-min-max-vars/attrs) | Optional attribute setters for [FakeQuantWithMinMaxVars](fake-quant-with-min-max-vars#classtensorflow_1_1ops_1_1_fake_quant_with_min_max_vars). | Public attributes ----------------- ### operation ``` Operation operation ``` ### outputs ``` ::tensorflow::Output outputs ``` Public functions ---------------- ### FakeQuantWithMinMaxVars ``` FakeQuantWithMinMaxVars( const ::tensorflow::Scope & scope, ::tensorflow::Input inputs, ::tensorflow::Input min, ::tensorflow::Input max ) ``` ### FakeQuantWithMinMaxVars ``` FakeQuantWithMinMaxVars( const ::tensorflow::Scope & scope, ::tensorflow::Input inputs, ::tensorflow::Input min, ::tensorflow::Input max, const FakeQuantWithMinMaxVars::Attrs & attrs ) ``` ### node ``` ::tensorflow::Node * node() const ``` ### operator::tensorflow::Input ``` operator::tensorflow::Input() const ``` ### operator::tensorflow::Output ``` operator::tensorflow::Output() const ``` Public static functions ----------------------- ### NarrowRange ``` Attrs NarrowRange( bool x ) ``` ### NumBits ``` Attrs NumBits( int64 x ) ```
programming_docs
tensorflow_cpp tensorflow::ops::GetSessionHandle tensorflow::ops::GetSessionHandle ================================= `#include <data_flow_ops.h>` Store the input tensor in the state of the current session. Summary ------- Args: * scope: A [Scope](../scope#classtensorflow_1_1_scope) object * value: The tensor to be stored. Returns: * `[Output](../output#classtensorflow_1_1_output)`: The handle for the tensor stored in the session state, represented as a string. | Constructors and Destructors | | --- | | `[GetSessionHandle](#classtensorflow_1_1ops_1_1_get_session_handle_1aebbd1388b00e4cecc9c86c25951cf202)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) value)` | | Public attributes | | --- | | `[handle](#classtensorflow_1_1ops_1_1_get_session_handle_1ae7de2cb7539259135ef2db684a185a10)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` | | `[operation](#classtensorflow_1_1ops_1_1_get_session_handle_1a7d5521ae5797783f4765ec6d152b511e)` | `[Operation](../operation#classtensorflow_1_1_operation)` | | Public functions | | --- | | `[node](#classtensorflow_1_1ops_1_1_get_session_handle_1a7d1957030c45e417e1fd6dbab8f449dc)() const` | `::tensorflow::Node *` | | `[operator::tensorflow::Input](#classtensorflow_1_1ops_1_1_get_session_handle_1ab6e0dc559a6efeab1fb6205782e04a3e)() const` | | | `[operator::tensorflow::Output](#classtensorflow_1_1ops_1_1_get_session_handle_1a28b94979f521f4b48c43070317aad4ec)() const` | | Public attributes ----------------- ### handle ``` ::tensorflow::Output handle ``` ### operation ``` Operation operation ``` Public functions ---------------- ### GetSessionHandle ``` GetSessionHandle( const ::tensorflow::Scope & scope, ::tensorflow::Input value ) ``` ### node ``` ::tensorflow::Node * node() const ``` ### operator::tensorflow::Input ``` operator::tensorflow::Input() const ``` ### operator::tensorflow::Output ``` operator::tensorflow::Output() const ``` tensorflow_cpp tensorflow::ops::Ndtri tensorflow::ops::Ndtri ====================== `#include <math_ops.h>` TODO: add doc. Summary ------- Args: * scope: A [Scope](../scope#classtensorflow_1_1_scope) object Returns: * `[Output](../output#classtensorflow_1_1_output)`: The y tensor. | Constructors and Destructors | | --- | | `[Ndtri](#classtensorflow_1_1ops_1_1_ndtri_1a6ad592e3598c98a9fd54d664b9a60cf3)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) x)` | | Public attributes | | --- | | `[operation](#classtensorflow_1_1ops_1_1_ndtri_1aa20bf179725cf8ccf02dda29c2d66fe7)` | `[Operation](../operation#classtensorflow_1_1_operation)` | | `[y](#classtensorflow_1_1ops_1_1_ndtri_1a95eac712274893c344c3cf9c45f73670)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` | | Public functions | | --- | | `[node](#classtensorflow_1_1ops_1_1_ndtri_1a40c367407d90456c8f499ebc88a3f69f)() const` | `::tensorflow::Node *` | | `[operator::tensorflow::Input](#classtensorflow_1_1ops_1_1_ndtri_1a6134f981e0de4004a1b1229a361defb4)() const` | | | `[operator::tensorflow::Output](#classtensorflow_1_1ops_1_1_ndtri_1a6fbddf9073d733967da76be00dc7d5b1)() const` | | Public attributes ----------------- ### operation ``` Operation operation ``` ### y ``` ::tensorflow::Output y ``` Public functions ---------------- ### Ndtri ``` Ndtri( const ::tensorflow::Scope & scope, ::tensorflow::Input x ) ``` ### node ``` ::tensorflow::Node * node() const ``` ### operator::tensorflow::Input ``` operator::tensorflow::Input() const ``` ### operator::tensorflow::Output ``` operator::tensorflow::Output() const ``` tensorflow_cpp tensorflow::ops::DeleteSessionTensor tensorflow::ops::DeleteSessionTensor ==================================== `#include <data_flow_ops.h>` Delete the tensor specified by its handle in the session. Summary ------- Args: * scope: A [Scope](../scope#classtensorflow_1_1_scope) object * handle: The handle for a tensor stored in the session state. Returns: * the created `[Operation](../operation#classtensorflow_1_1_operation)` | Constructors and Destructors | | --- | | `[DeleteSessionTensor](#classtensorflow_1_1ops_1_1_delete_session_tensor_1a05f039c1efd57eb82c81e7f46ad6853b)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) handle)` | | Public attributes | | --- | | `[operation](#classtensorflow_1_1ops_1_1_delete_session_tensor_1a09f9eef4ce54e6d1e5c02ac5dc121121)` | `[Operation](../operation#classtensorflow_1_1_operation)` | | Public functions | | --- | | `[operator::tensorflow::Operation](#classtensorflow_1_1ops_1_1_delete_session_tensor_1a6f6017395a1e565d0ddc56f163640545)() const` | | Public attributes ----------------- ### operation ``` Operation operation ``` Public functions ---------------- ### DeleteSessionTensor ``` DeleteSessionTensor( const ::tensorflow::Scope & scope, ::tensorflow::Input handle ) ``` ### operator::tensorflow::Operation ``` operator::tensorflow::Operation() const ``` tensorflow_cpp tensorflow::ops::DestroyTemporaryVariable tensorflow::ops::DestroyTemporaryVariable ========================================= `#include <state_ops.h>` Destroys the temporary variable and returns its final value. Summary ------- Sets output to the value of the [Tensor](../tensor#classtensorflow_1_1_tensor) pointed to by 'ref', then destroys the temporary variable called 'var\_name'. [All](all#classtensorflow_1_1ops_1_1_all) other uses of 'ref' *must* have executed before this op. This is typically achieved by chaining the ref through each assign op, or by using control dependencies. Outputs the final value of the tensor pointed to by 'ref'. Args: * scope: A [Scope](../scope#classtensorflow_1_1_scope) object * ref: A reference to the temporary variable tensor. * var\_name: Name of the temporary variable, usually the name of the matching '[TemporaryVariable](temporary-variable#classtensorflow_1_1ops_1_1_temporary_variable)' op. Returns: * `[Output](../output#classtensorflow_1_1_output)`: The value tensor. | Constructors and Destructors | | --- | | `[DestroyTemporaryVariable](#classtensorflow_1_1ops_1_1_destroy_temporary_variable_1a01f12d953d9078e0133345ecad76f629)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) ref, StringPiece var_name)` | | Public attributes | | --- | | `[operation](#classtensorflow_1_1ops_1_1_destroy_temporary_variable_1a0bfa0ecb725488b9065e4dfa42addfdc)` | `[Operation](../operation#classtensorflow_1_1_operation)` | | `[value](#classtensorflow_1_1ops_1_1_destroy_temporary_variable_1a2a3151dd005ff60e1fbc92d9f72c51d0)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` | | Public functions | | --- | | `[node](#classtensorflow_1_1ops_1_1_destroy_temporary_variable_1ab3002dc3d20c1e4e20f1fb219714c7e8)() const` | `::tensorflow::Node *` | | `[operator::tensorflow::Input](#classtensorflow_1_1ops_1_1_destroy_temporary_variable_1a36cd6c9de3fec498a9b6f32078402e1a)() const` | | | `[operator::tensorflow::Output](#classtensorflow_1_1ops_1_1_destroy_temporary_variable_1a94ad142b7443111409db522488894175)() const` | | Public attributes ----------------- ### operation ``` Operation operation ``` ### value ``` ::tensorflow::Output value ``` Public functions ---------------- ### DestroyTemporaryVariable ``` DestroyTemporaryVariable( const ::tensorflow::Scope & scope, ::tensorflow::Input ref, StringPiece var_name ) ``` ### node ``` ::tensorflow::Node * node() const ``` ### operator::tensorflow::Input ``` operator::tensorflow::Input() const ``` ### operator::tensorflow::Output ``` operator::tensorflow::Output() const ``` tensorflow_cpp tensorflow::ops::ResizeBicubic tensorflow::ops::ResizeBicubic ============================== `#include <image_ops.h>` Resize `images` to `size` using bicubic interpolation. Summary ------- [Input](../input#classtensorflow_1_1_input) images can be of different types but output images are always float. Args: * scope: A [Scope](../scope#classtensorflow_1_1_scope) object * images: 4-D with shape `[batch, height, width, channels]`. * size: = A 1-D int32 [Tensor](../tensor#classtensorflow_1_1_tensor) of 2 elements: `new_height, new_width`. The new size for the images. Optional attributes (see `[Attrs](../../../struct/tensorflow/ops/resize-bicubic/attrs#structtensorflow_1_1ops_1_1_resize_bicubic_1_1_attrs)`): * align\_corners: If true, the centers of the 4 corner pixels of the input and output tensors are aligned, preserving the values at the corner pixels. Defaults to false. Returns: * `[Output](../output#classtensorflow_1_1_output)`: 4-D with shape `[batch, new_height, new_width, channels]`. | Constructors and Destructors | | --- | | `[ResizeBicubic](#classtensorflow_1_1ops_1_1_resize_bicubic_1a096d544f83cc6f082255083cb48d02fe)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) images, ::[tensorflow::Input](../input#classtensorflow_1_1_input) size)` | | `[ResizeBicubic](#classtensorflow_1_1ops_1_1_resize_bicubic_1a9ab221a334d2ffb94c5adf308f8b6bfd)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) images, ::[tensorflow::Input](../input#classtensorflow_1_1_input) size, const [ResizeBicubic::Attrs](../../../struct/tensorflow/ops/resize-bicubic/attrs#structtensorflow_1_1ops_1_1_resize_bicubic_1_1_attrs) & attrs)` | | Public attributes | | --- | | `[operation](#classtensorflow_1_1ops_1_1_resize_bicubic_1a843ff0ef59ba5d108883bc783791dc13)` | `[Operation](../operation#classtensorflow_1_1_operation)` | | `[resized\_images](#classtensorflow_1_1ops_1_1_resize_bicubic_1abacd676e0eccfa1ed35dce58f9b1baea)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` | | Public functions | | --- | | `[node](#classtensorflow_1_1ops_1_1_resize_bicubic_1a53f33ac8a7c45193dc998500b92f8b39)() const` | `::tensorflow::Node *` | | `[operator::tensorflow::Input](#classtensorflow_1_1ops_1_1_resize_bicubic_1ab5a27bb0ada787a04cba91cf8511ce13)() const` | | | `[operator::tensorflow::Output](#classtensorflow_1_1ops_1_1_resize_bicubic_1a31ee74b6628f0dfd0a3721d7f306d5a7)() const` | | | Public static functions | | --- | | `[AlignCorners](#classtensorflow_1_1ops_1_1_resize_bicubic_1af6ac21d35f211eaeff6d5eb37dc3f9ba)(bool x)` | `[Attrs](../../../struct/tensorflow/ops/resize-bicubic/attrs#structtensorflow_1_1ops_1_1_resize_bicubic_1_1_attrs)` | | `[HalfPixelCenters](#classtensorflow_1_1ops_1_1_resize_bicubic_1ab7631fc0294bef994e8a9b00b8137849)(bool x)` | `[Attrs](../../../struct/tensorflow/ops/resize-bicubic/attrs#structtensorflow_1_1ops_1_1_resize_bicubic_1_1_attrs)` | | Structs | | --- | | [tensorflow::ops::ResizeBicubic::Attrs](../../../struct/tensorflow/ops/resize-bicubic/attrs) | Optional attribute setters for [ResizeBicubic](resize-bicubic#classtensorflow_1_1ops_1_1_resize_bicubic). | Public attributes ----------------- ### operation ``` Operation operation ``` ### resized\_images ``` ::tensorflow::Output resized_images ``` Public functions ---------------- ### ResizeBicubic ``` ResizeBicubic( const ::tensorflow::Scope & scope, ::tensorflow::Input images, ::tensorflow::Input size ) ``` ### ResizeBicubic ``` ResizeBicubic( const ::tensorflow::Scope & scope, ::tensorflow::Input images, ::tensorflow::Input size, const ResizeBicubic::Attrs & attrs ) ``` ### node ``` ::tensorflow::Node * node() const ``` ### operator::tensorflow::Input ``` operator::tensorflow::Input() const ``` ### operator::tensorflow::Output ``` operator::tensorflow::Output() const ``` Public static functions ----------------------- ### AlignCorners ``` Attrs AlignCorners( bool x ) ``` ### HalfPixelCenters ``` Attrs HalfPixelCenters( bool x ) ``` tensorflow_cpp tensorflow::ops::Selu tensorflow::ops::Selu ===================== `#include <nn_ops.h>` Computes scaled exponential linear: `scale * alpha * (exp(features) - 1)` Summary ------- if < 0, `scale * features` otherwise. To be used together with `initializer = tf.variance\_scaling\_initializer(factor=1.0, mode='FAN\_IN')`. For correct dropout, use`tf.contrib.nn.alpha\_dropout`. See [Self-Normalizing Neural Networks](https://arxiv.org/abs/1706.02515) Args: * scope: A [Scope](../scope#classtensorflow_1_1_scope) object Returns: * `[Output](../output#classtensorflow_1_1_output)`: The activations tensor. | Constructors and Destructors | | --- | | `[Selu](#classtensorflow_1_1ops_1_1_selu_1a88f67ba3de20218b6f358fe1b42a2c0e)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) features)` | | Public attributes | | --- | | `[activations](#classtensorflow_1_1ops_1_1_selu_1a9f56fd12aa8ff91d72bdc1ddf78a25a4)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` | | `[operation](#classtensorflow_1_1ops_1_1_selu_1af165a25926d9e6d6d8ed7a8a92669708)` | `[Operation](../operation#classtensorflow_1_1_operation)` | | Public functions | | --- | | `[node](#classtensorflow_1_1ops_1_1_selu_1a4181a5102bde25d44784c848747d66aa)() const` | `::tensorflow::Node *` | | `[operator::tensorflow::Input](#classtensorflow_1_1ops_1_1_selu_1a809153677a62b584a98e0d72c08c4b79)() const` | | | `[operator::tensorflow::Output](#classtensorflow_1_1ops_1_1_selu_1a5632258afc78d8ed6dd80dc8739e8c30)() const` | | Public attributes ----------------- ### activations ``` ::tensorflow::Output activations ``` ### operation ``` Operation operation ``` Public functions ---------------- ### Selu ``` Selu( const ::tensorflow::Scope & scope, ::tensorflow::Input features ) ``` ### node ``` ::tensorflow::Node * node() const ``` ### operator::tensorflow::Input ``` operator::tensorflow::Input() const ``` ### operator::tensorflow::Output ``` operator::tensorflow::Output() const ``` tensorflow_cpp tensorflow::ops::SparseApplyFtrlV2 tensorflow::ops::SparseApplyFtrlV2 ================================== `#include <training_ops.h>` Update relevant entries in '\*var' according to the Ftrl-proximal scheme. Summary ------- That is for rows we have grad for, we update var, accum and linear as follows: grad\_with\_shrinkage = grad + 2 \* l2\_shrinkage \* var accum\_new = accum + grad \* grad linear += grad\_with\_shrinkage - (accum\_new^(-lr\_power) - accum^(-lr\_power)) / lr \* var quadratic = 1.0 / (accum\_new^(lr\_power) \* lr) + 2 \* l2 var = (sign(linear) \* l1 - linear) / quadratic if |linear| > l1 else 0.0 accum = accum\_new Args: * scope: A [Scope](../scope#classtensorflow_1_1_scope) object * var: Should be from a Variable(). * accum: Should be from a Variable(). * linear: Should be from a Variable(). * grad: The gradient. * indices: A vector of indices into the first dimension of var and accum. * lr: Scaling factor. Must be a scalar. * l1: L1 regularization. Must be a scalar. * l2: L2 shrinkage regularization. Must be a scalar. * lr\_power: Scaling factor. Must be a scalar. Optional attributes (see `[Attrs](../../../struct/tensorflow/ops/sparse-apply-ftrl-v2/attrs#structtensorflow_1_1ops_1_1_sparse_apply_ftrl_v2_1_1_attrs)`): * use\_locking: If `True`, updating of the var and accum tensors will be protected by a lock; otherwise the behavior is undefined, but may exhibit less contention. Returns: * `[Output](../output#classtensorflow_1_1_output)`: Same as "var". | Constructors and Destructors | | --- | | `[SparseApplyFtrlV2](#classtensorflow_1_1ops_1_1_sparse_apply_ftrl_v2_1a5aac85294ef2fe3491d385699c320466)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) var, ::[tensorflow::Input](../input#classtensorflow_1_1_input) accum, ::[tensorflow::Input](../input#classtensorflow_1_1_input) linear, ::[tensorflow::Input](../input#classtensorflow_1_1_input) grad, ::[tensorflow::Input](../input#classtensorflow_1_1_input) indices, ::[tensorflow::Input](../input#classtensorflow_1_1_input) lr, ::[tensorflow::Input](../input#classtensorflow_1_1_input) l1, ::[tensorflow::Input](../input#classtensorflow_1_1_input) l2, ::[tensorflow::Input](../input#classtensorflow_1_1_input) l2_shrinkage, ::[tensorflow::Input](../input#classtensorflow_1_1_input) lr_power)` | | `[SparseApplyFtrlV2](#classtensorflow_1_1ops_1_1_sparse_apply_ftrl_v2_1abf2e6f5633ae8e3bf9dfbeb7222d1f5e)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) var, ::[tensorflow::Input](../input#classtensorflow_1_1_input) accum, ::[tensorflow::Input](../input#classtensorflow_1_1_input) linear, ::[tensorflow::Input](../input#classtensorflow_1_1_input) grad, ::[tensorflow::Input](../input#classtensorflow_1_1_input) indices, ::[tensorflow::Input](../input#classtensorflow_1_1_input) lr, ::[tensorflow::Input](../input#classtensorflow_1_1_input) l1, ::[tensorflow::Input](../input#classtensorflow_1_1_input) l2, ::[tensorflow::Input](../input#classtensorflow_1_1_input) l2_shrinkage, ::[tensorflow::Input](../input#classtensorflow_1_1_input) lr_power, const [SparseApplyFtrlV2::Attrs](../../../struct/tensorflow/ops/sparse-apply-ftrl-v2/attrs#structtensorflow_1_1ops_1_1_sparse_apply_ftrl_v2_1_1_attrs) & attrs)` | | Public attributes | | --- | | `[operation](#classtensorflow_1_1ops_1_1_sparse_apply_ftrl_v2_1a52c8adace57b2f5a40dba99db1ad4e88)` | `[Operation](../operation#classtensorflow_1_1_operation)` | | `[out](#classtensorflow_1_1ops_1_1_sparse_apply_ftrl_v2_1ae87d85671d97e97a7662c7c680fc8884)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` | | Public functions | | --- | | `[node](#classtensorflow_1_1ops_1_1_sparse_apply_ftrl_v2_1ae9527252eb9b5e39d1cc50fe962c03dd)() const` | `::tensorflow::Node *` | | `[operator::tensorflow::Input](#classtensorflow_1_1ops_1_1_sparse_apply_ftrl_v2_1a1acf8e4ced3659d1ceecb99da65de05d)() const` | | | `[operator::tensorflow::Output](#classtensorflow_1_1ops_1_1_sparse_apply_ftrl_v2_1ac88538dc7963ebfe36cb619839f53581)() const` | | | Public static functions | | --- | | `[MultiplyLinearByLr](#classtensorflow_1_1ops_1_1_sparse_apply_ftrl_v2_1ade792da0a6f7add88bff4d13d98f32c3)(bool x)` | `[Attrs](../../../struct/tensorflow/ops/sparse-apply-ftrl-v2/attrs#structtensorflow_1_1ops_1_1_sparse_apply_ftrl_v2_1_1_attrs)` | | `[UseLocking](#classtensorflow_1_1ops_1_1_sparse_apply_ftrl_v2_1a0ca751635f400261887fe95775ea4c48)(bool x)` | `[Attrs](../../../struct/tensorflow/ops/sparse-apply-ftrl-v2/attrs#structtensorflow_1_1ops_1_1_sparse_apply_ftrl_v2_1_1_attrs)` | | Structs | | --- | | [tensorflow::ops::SparseApplyFtrlV2::Attrs](../../../struct/tensorflow/ops/sparse-apply-ftrl-v2/attrs) | Optional attribute setters for [SparseApplyFtrlV2](sparse-apply-ftrl-v2#classtensorflow_1_1ops_1_1_sparse_apply_ftrl_v2). | Public attributes ----------------- ### operation ``` Operation operation ``` ### out ``` ::tensorflow::Output out ``` Public functions ---------------- ### SparseApplyFtrlV2 ``` SparseApplyFtrlV2( const ::tensorflow::Scope & scope, ::tensorflow::Input var, ::tensorflow::Input accum, ::tensorflow::Input linear, ::tensorflow::Input grad, ::tensorflow::Input indices, ::tensorflow::Input lr, ::tensorflow::Input l1, ::tensorflow::Input l2, ::tensorflow::Input l2_shrinkage, ::tensorflow::Input lr_power ) ``` ### SparseApplyFtrlV2 ``` SparseApplyFtrlV2( const ::tensorflow::Scope & scope, ::tensorflow::Input var, ::tensorflow::Input accum, ::tensorflow::Input linear, ::tensorflow::Input grad, ::tensorflow::Input indices, ::tensorflow::Input lr, ::tensorflow::Input l1, ::tensorflow::Input l2, ::tensorflow::Input l2_shrinkage, ::tensorflow::Input lr_power, const SparseApplyFtrlV2::Attrs & attrs ) ``` ### node ``` ::tensorflow::Node * node() const ``` ### operator::tensorflow::Input ``` operator::tensorflow::Input() const ``` ### operator::tensorflow::Output ``` operator::tensorflow::Output() const ``` Public static functions ----------------------- ### MultiplyLinearByLr ``` Attrs MultiplyLinearByLr( bool x ) ``` ### UseLocking ``` Attrs UseLocking( bool x ) ```
programming_docs
tensorflow_cpp tensorflow::ops::ZerosLike tensorflow::ops::ZerosLike ========================== `#include <array_ops.h>` Returns a tensor of zeros with the same shape and type as x. Summary ------- Args: * scope: A [Scope](../scope#classtensorflow_1_1_scope) object * x: a tensor of type T. Returns: * `[Output](../output#classtensorflow_1_1_output)`: a tensor of the same shape and type as x but filled with zeros. | Constructors and Destructors | | --- | | `[ZerosLike](#classtensorflow_1_1ops_1_1_zeros_like_1ad2ae74639fafac0e61d9a516236ce8d8)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) x)` | | Public attributes | | --- | | `[operation](#classtensorflow_1_1ops_1_1_zeros_like_1a7074a7af2bc2a55a8a9476388490209f)` | `[Operation](../operation#classtensorflow_1_1_operation)` | | `[y](#classtensorflow_1_1ops_1_1_zeros_like_1a1ae080181bce9eb78fc444a45b830ea1)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` | | Public functions | | --- | | `[node](#classtensorflow_1_1ops_1_1_zeros_like_1af0ed758768d221ee5888d33e999474dd)() const` | `::tensorflow::Node *` | | `[operator::tensorflow::Input](#classtensorflow_1_1ops_1_1_zeros_like_1a3f3649f0c2579c1cd96fcc7fcfc2aef3)() const` | | | `[operator::tensorflow::Output](#classtensorflow_1_1ops_1_1_zeros_like_1a9267852a5b701bb1670554449e3b1226)() const` | | Public attributes ----------------- ### operation ``` Operation operation ``` ### y ``` ::tensorflow::Output y ``` Public functions ---------------- ### ZerosLike ``` ZerosLike( const ::tensorflow::Scope & scope, ::tensorflow::Input x ) ``` ### node ``` ::tensorflow::Node * node() const ``` ### operator::tensorflow::Input ``` operator::tensorflow::Input() const ``` ### operator::tensorflow::Output ``` operator::tensorflow::Output() const ``` tensorflow_cpp tensorflow::ops::MaxPoolGradGradV2 tensorflow::ops::MaxPoolGradGradV2 ================================== `#include <nn_ops.h>` Computes second-order gradients of the maxpooling function. Summary ------- Args: * scope: A [Scope](../scope#classtensorflow_1_1_scope) object * orig\_input: The original input tensor. * orig\_output: The original output tensor. * grad: 4-D. Gradients of gradients w.r.t. the input of `max_pool`. * ksize: The size of the window for each dimension of the input tensor. * strides: The stride of the sliding window for each dimension of the input tensor. * padding: The type of padding algorithm to use. Optional attributes (see `[Attrs](../../../struct/tensorflow/ops/max-pool-grad-grad-v2/attrs#structtensorflow_1_1ops_1_1_max_pool_grad_grad_v2_1_1_attrs)`): * data\_format: Specify the data format of the input and output data. With the default format "NHWC", the data is stored in the order of: [batch, in\_height, in\_width, in\_channels]. Alternatively, the format could be "NCHW", the data storage order of: [batch, in\_channels, in\_height, in\_width]. Returns: * `[Output](../output#classtensorflow_1_1_output)`: Gradients of gradients w.r.t. the input to `max_pool`. | Constructors and Destructors | | --- | | `[MaxPoolGradGradV2](#classtensorflow_1_1ops_1_1_max_pool_grad_grad_v2_1a8522a6993112d51b0270fec6eaa2f07e)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) orig_input, ::[tensorflow::Input](../input#classtensorflow_1_1_input) orig_output, ::[tensorflow::Input](../input#classtensorflow_1_1_input) grad, ::[tensorflow::Input](../input#classtensorflow_1_1_input) ksize, ::[tensorflow::Input](../input#classtensorflow_1_1_input) strides, StringPiece padding)` | | `[MaxPoolGradGradV2](#classtensorflow_1_1ops_1_1_max_pool_grad_grad_v2_1ae888a15ef1033e80c14e809bf63c40ce)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) orig_input, ::[tensorflow::Input](../input#classtensorflow_1_1_input) orig_output, ::[tensorflow::Input](../input#classtensorflow_1_1_input) grad, ::[tensorflow::Input](../input#classtensorflow_1_1_input) ksize, ::[tensorflow::Input](../input#classtensorflow_1_1_input) strides, StringPiece padding, const [MaxPoolGradGradV2::Attrs](../../../struct/tensorflow/ops/max-pool-grad-grad-v2/attrs#structtensorflow_1_1ops_1_1_max_pool_grad_grad_v2_1_1_attrs) & attrs)` | | Public attributes | | --- | | `[operation](#classtensorflow_1_1ops_1_1_max_pool_grad_grad_v2_1a4b1ea28bd24c8a99e78971caa985c0a5)` | `[Operation](../operation#classtensorflow_1_1_operation)` | | `[output](#classtensorflow_1_1ops_1_1_max_pool_grad_grad_v2_1a8029b0f95b9d1741f79c0168be835fa8)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` | | Public functions | | --- | | `[node](#classtensorflow_1_1ops_1_1_max_pool_grad_grad_v2_1a126542d8e910a815bffb50d68dd4a8ab)() const` | `::tensorflow::Node *` | | `[operator::tensorflow::Input](#classtensorflow_1_1ops_1_1_max_pool_grad_grad_v2_1adfafcdf81de0a5dbf0177f88b7ceebdd)() const` | | | `[operator::tensorflow::Output](#classtensorflow_1_1ops_1_1_max_pool_grad_grad_v2_1abe4f5361ad71a740a4a680fb897b8b62)() const` | | | Public static functions | | --- | | `[DataFormat](#classtensorflow_1_1ops_1_1_max_pool_grad_grad_v2_1a363950312155aad1825d37b0dafb09d4)(StringPiece x)` | `[Attrs](../../../struct/tensorflow/ops/max-pool-grad-grad-v2/attrs#structtensorflow_1_1ops_1_1_max_pool_grad_grad_v2_1_1_attrs)` | | Structs | | --- | | [tensorflow::ops::MaxPoolGradGradV2::Attrs](../../../struct/tensorflow/ops/max-pool-grad-grad-v2/attrs) | Optional attribute setters for [MaxPoolGradGradV2](max-pool-grad-grad-v2#classtensorflow_1_1ops_1_1_max_pool_grad_grad_v2). | Public attributes ----------------- ### operation ``` Operation operation ``` ### output ``` ::tensorflow::Output output ``` Public functions ---------------- ### MaxPoolGradGradV2 ``` MaxPoolGradGradV2( const ::tensorflow::Scope & scope, ::tensorflow::Input orig_input, ::tensorflow::Input orig_output, ::tensorflow::Input grad, ::tensorflow::Input ksize, ::tensorflow::Input strides, StringPiece padding ) ``` ### MaxPoolGradGradV2 ``` MaxPoolGradGradV2( const ::tensorflow::Scope & scope, ::tensorflow::Input orig_input, ::tensorflow::Input orig_output, ::tensorflow::Input grad, ::tensorflow::Input ksize, ::tensorflow::Input strides, StringPiece padding, const MaxPoolGradGradV2::Attrs & attrs ) ``` ### node ``` ::tensorflow::Node * node() const ``` ### operator::tensorflow::Input ``` operator::tensorflow::Input() const ``` ### operator::tensorflow::Output ``` operator::tensorflow::Output() const ``` Public static functions ----------------------- ### DataFormat ``` Attrs DataFormat( StringPiece x ) ``` tensorflow_cpp tensorflow::ops::AvgPool3D tensorflow::ops::AvgPool3D ========================== `#include <nn_ops.h>` Performs 3D average pooling on the input. Summary ------- Each entry in `output` is the mean of the corresponding size `ksize` window in `value`. Args: * scope: A [Scope](../scope#classtensorflow_1_1_scope) object * input: Shape `[batch, depth, rows, cols, channels]` tensor to pool over. * ksize: 1-D tensor of length 5. The size of the window for each dimension of the input tensor. Must have `ksize[0] = ksize[4] = 1`. * strides: 1-D tensor of length 5. The stride of the sliding window for each dimension of `input`. Must have `strides[0] = strides[4] = 1`. * padding: The type of padding algorithm to use. Optional attributes (see `[Attrs](../../../struct/tensorflow/ops/avg-pool3-d/attrs#structtensorflow_1_1ops_1_1_avg_pool3_d_1_1_attrs)`): * data\_format: The data format of the input and output data. With the default format "NDHWC", the data is stored in the order of: [batch, in\_depth, in\_height, in\_width, in\_channels]. Alternatively, the format could be "NCDHW", the data storage order is: [batch, in\_channels, in\_depth, in\_height, in\_width]. Returns: * `[Output](../output#classtensorflow_1_1_output)`: The average pooled output tensor. | Constructors and Destructors | | --- | | `[AvgPool3D](#classtensorflow_1_1ops_1_1_avg_pool3_d_1ad52fa7270df230a429102dff7f270dfb)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) input, const gtl::ArraySlice< int > & ksize, const gtl::ArraySlice< int > & strides, StringPiece padding)` | | `[AvgPool3D](#classtensorflow_1_1ops_1_1_avg_pool3_d_1a25cc864885d8a535be290334b7668495)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) input, const gtl::ArraySlice< int > & ksize, const gtl::ArraySlice< int > & strides, StringPiece padding, const [AvgPool3D::Attrs](../../../struct/tensorflow/ops/avg-pool3-d/attrs#structtensorflow_1_1ops_1_1_avg_pool3_d_1_1_attrs) & attrs)` | | Public attributes | | --- | | `[operation](#classtensorflow_1_1ops_1_1_avg_pool3_d_1adb5a5628c948f83bb5e4c630cecc165e)` | `[Operation](../operation#classtensorflow_1_1_operation)` | | `[output](#classtensorflow_1_1ops_1_1_avg_pool3_d_1a6c96677783666eb38f1aa8f0e8022e06)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` | | Public functions | | --- | | `[node](#classtensorflow_1_1ops_1_1_avg_pool3_d_1adda4d693e393a8be80546fcdd7c35bc3)() const` | `::tensorflow::Node *` | | `[operator::tensorflow::Input](#classtensorflow_1_1ops_1_1_avg_pool3_d_1a4d137ee8e20345c4e418c5b1d1d4d514)() const` | | | `[operator::tensorflow::Output](#classtensorflow_1_1ops_1_1_avg_pool3_d_1ad8f6042e68441acfb5f32682f5af5492)() const` | | | Public static functions | | --- | | `[DataFormat](#classtensorflow_1_1ops_1_1_avg_pool3_d_1a9f02a15e10745fc4a9af9a7a15f32412)(StringPiece x)` | `[Attrs](../../../struct/tensorflow/ops/avg-pool3-d/attrs#structtensorflow_1_1ops_1_1_avg_pool3_d_1_1_attrs)` | | Structs | | --- | | [tensorflow::ops::AvgPool3D::Attrs](../../../struct/tensorflow/ops/avg-pool3-d/attrs) | Optional attribute setters for [AvgPool3D](avg-pool3-d#classtensorflow_1_1ops_1_1_avg_pool3_d). | Public attributes ----------------- ### operation ``` Operation operation ``` ### output ``` ::tensorflow::Output output ``` Public functions ---------------- ### AvgPool3D ``` AvgPool3D( const ::tensorflow::Scope & scope, ::tensorflow::Input input, const gtl::ArraySlice< int > & ksize, const gtl::ArraySlice< int > & strides, StringPiece padding ) ``` ### AvgPool3D ``` AvgPool3D( const ::tensorflow::Scope & scope, ::tensorflow::Input input, const gtl::ArraySlice< int > & ksize, const gtl::ArraySlice< int > & strides, StringPiece padding, const AvgPool3D::Attrs & attrs ) ``` ### node ``` ::tensorflow::Node * node() const ``` ### operator::tensorflow::Input ``` operator::tensorflow::Input() const ``` ### operator::tensorflow::Output ``` operator::tensorflow::Output() const ``` Public static functions ----------------------- ### DataFormat ``` Attrs DataFormat( StringPiece x ) ``` tensorflow_cpp tensorflow::ops::Fill tensorflow::ops::Fill ===================== `#include <array_ops.h>` Creates a tensor filled with a scalar value. Summary ------- This operation creates a tensor of shape `dims` and fills it with `value`. For example: ``` # Output tensor has shape [2, 3]. fill([2, 3], 9) ==> [[9, 9, 9] [9, 9, 9]] ``` `tf.fill` differs from `tf.constant` in a few ways: * `tf.fill` only supports scalar contents, whereas `tf.constant` supports [Tensor](../tensor#classtensorflow_1_1_tensor) values. * `tf.fill` creates an Op in the computation graph that constructs the actual [Tensor](../tensor#classtensorflow_1_1_tensor) value at runtime. This is in contrast to `tf.constant` which embeds the entire [Tensor](../tensor#classtensorflow_1_1_tensor) into the graph with a `Const` node. * Because `tf.fill` evaluates at graph runtime, it supports dynamic shapes based on other runtime Tensors, unlike `tf.constant`. Args: * scope: A [Scope](../scope#classtensorflow_1_1_scope) object * dims: 1-D. Represents the shape of the output tensor. * value: 0-D (scalar). Value to fill the returned tensor. (numpy) Equivalent to np.full Returns: * `[Output](../output#classtensorflow_1_1_output)`: The output tensor. | Constructors and Destructors | | --- | | `[Fill](#classtensorflow_1_1ops_1_1_fill_1a01c1c041aa66636af36c215a28cad8f8)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) dims, ::[tensorflow::Input](../input#classtensorflow_1_1_input) value)` | | Public attributes | | --- | | `[operation](#classtensorflow_1_1ops_1_1_fill_1ab58dad131aa0ced03a7b508cb5f17ee8)` | `[Operation](../operation#classtensorflow_1_1_operation)` | | `[output](#classtensorflow_1_1ops_1_1_fill_1af59efc826ad951c4bb994ccf186b0e3c)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` | | Public functions | | --- | | `[node](#classtensorflow_1_1ops_1_1_fill_1a470a2e887eb44734252766d0f4759b04)() const` | `::tensorflow::Node *` | | `[operator::tensorflow::Input](#classtensorflow_1_1ops_1_1_fill_1a7eb9e821e29fbfa81a25dd5ae382ce1f)() const` | | | `[operator::tensorflow::Output](#classtensorflow_1_1ops_1_1_fill_1a952032189c0e55332094cc69e197ae06)() const` | | Public attributes ----------------- ### operation ``` Operation operation ``` ### output ``` ::tensorflow::Output output ``` Public functions ---------------- ### Fill ``` Fill( const ::tensorflow::Scope & scope, ::tensorflow::Input dims, ::tensorflow::Input value ) ``` ### node ``` ::tensorflow::Node * node() const ``` ### operator::tensorflow::Input ``` operator::tensorflow::Input() const ``` ### operator::tensorflow::Output ``` operator::tensorflow::Output() const ``` tensorflow_cpp tensorflow::ops::Multiply tensorflow::ops::Multiply ========================= `#include <math_ops.h>` Returns x \* y element-wise. Summary ------- *NOTE*: `[Multiply](multiply#classtensorflow_1_1ops_1_1_multiply)` supports broadcasting. More about broadcasting [here](http://docs.scipy.org/doc/numpy/user/basics.broadcasting.html) Args: * scope: A [Scope](../scope#classtensorflow_1_1_scope) object Returns: * `[Output](../output#classtensorflow_1_1_output)`: The z tensor. Aliases: * Mul | Constructors and Destructors | | --- | | `[Multiply](#classtensorflow_1_1ops_1_1_multiply_1a81ca041d3a1afee5eca809af18108856)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) x, ::[tensorflow::Input](../input#classtensorflow_1_1_input) y)` | | Public attributes | | --- | | `[operation](#classtensorflow_1_1ops_1_1_multiply_1a96cdf869220746330162e7b385800767)` | `[Operation](../operation#classtensorflow_1_1_operation)` | | `[z](#classtensorflow_1_1ops_1_1_multiply_1a334bbd6664fc8beaf5c34e7a3768d935)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` | | Public functions | | --- | | `[node](#classtensorflow_1_1ops_1_1_multiply_1a850b12a447e7a2572185a91ce349b37c)() const` | `::tensorflow::Node *` | | `[operator::tensorflow::Input](#classtensorflow_1_1ops_1_1_multiply_1aedfed2757a39e153bd538eb953a4b46b)() const` | | | `[operator::tensorflow::Output](#classtensorflow_1_1ops_1_1_multiply_1a87a2e735638703f3fb84464b7cd5b385)() const` | | Public attributes ----------------- ### operation ``` Operation operation ``` ### z ``` ::tensorflow::Output z ``` Public functions ---------------- ### Multiply ``` Multiply( const ::tensorflow::Scope & scope, ::tensorflow::Input x, ::tensorflow::Input y ) ``` ### node ``` ::tensorflow::Node * node() const ``` ### operator::tensorflow::Input ``` operator::tensorflow::Input() const ``` ### operator::tensorflow::Output ``` operator::tensorflow::Output() const ``` tensorflow_cpp tensorflow::ops::Any tensorflow::ops::Any ==================== `#include <math_ops.h>` Computes the "logical or" of elements across dimensions of a tensor. Summary ------- Reduces `input` along the dimensions given in `axis`. Unless `keep_dims` is true, the rank of the tensor is reduced by 1 for each entry in `axis`. If `keep_dims` is true, the reduced dimensions are retained with length 1. Args: * scope: A [Scope](../scope#classtensorflow_1_1_scope) object * input: The tensor to reduce. * axis: The dimensions to reduce. Must be in the range `[-rank(input), rank(input))`. Optional attributes (see `[Attrs](../../../struct/tensorflow/ops/any/attrs#structtensorflow_1_1ops_1_1_any_1_1_attrs)`): * keep\_dims: If true, retain reduced dimensions with length 1. Returns: * `[Output](../output#classtensorflow_1_1_output)`: The reduced tensor. Aliases: * ReduceAny | Constructors and Destructors | | --- | | `[Any](#classtensorflow_1_1ops_1_1_any_1a9be141de430b6d3f762162391320ae4b)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) input, ::[tensorflow::Input](../input#classtensorflow_1_1_input) axis)` | | `[Any](#classtensorflow_1_1ops_1_1_any_1a721eef08c1a6c56258a4cb043e87fc75)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) input, ::[tensorflow::Input](../input#classtensorflow_1_1_input) axis, const [Any::Attrs](../../../struct/tensorflow/ops/any/attrs#structtensorflow_1_1ops_1_1_any_1_1_attrs) & attrs)` | | Public attributes | | --- | | `[operation](#classtensorflow_1_1ops_1_1_any_1ac5ba2460f8126a91fcb68168b9951a90)` | `[Operation](../operation#classtensorflow_1_1_operation)` | | `[output](#classtensorflow_1_1ops_1_1_any_1a4431c9cc3a60415c5900421f0ab251fa)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` | | Public functions | | --- | | `[node](#classtensorflow_1_1ops_1_1_any_1a449ddceef1fcc05c33a3441304a3f045)() const` | `::tensorflow::Node *` | | `[operator::tensorflow::Input](#classtensorflow_1_1ops_1_1_any_1adf8cdeb9cfa420de9ecf720c397dba61)() const` | | | `[operator::tensorflow::Output](#classtensorflow_1_1ops_1_1_any_1a17306381a192301c5357760e70f34718)() const` | | | Public static functions | | --- | | `[KeepDims](#classtensorflow_1_1ops_1_1_any_1a87792f3f167fce28918c0c05b87bd7c7)(bool x)` | `[Attrs](../../../struct/tensorflow/ops/any/attrs#structtensorflow_1_1ops_1_1_any_1_1_attrs)` | | Structs | | --- | | [tensorflow::ops::Any::Attrs](../../../struct/tensorflow/ops/any/attrs) | Optional attribute setters for [Any](any#classtensorflow_1_1ops_1_1_any). | Public attributes ----------------- ### operation ``` Operation operation ``` ### output ``` ::tensorflow::Output output ``` Public functions ---------------- ### Any ``` Any( const ::tensorflow::Scope & scope, ::tensorflow::Input input, ::tensorflow::Input axis ) ``` ### Any ``` Any( const ::tensorflow::Scope & scope, ::tensorflow::Input input, ::tensorflow::Input axis, const Any::Attrs & attrs ) ``` ### node ``` ::tensorflow::Node * node() const ``` ### operator::tensorflow::Input ``` operator::tensorflow::Input() const ``` ### operator::tensorflow::Output ``` operator::tensorflow::Output() const ``` Public static functions ----------------------- ### KeepDims ``` Attrs KeepDims( bool x ) ``` tensorflow_cpp tensorflow::ops::Imag tensorflow::ops::Imag ===================== `#include <math_ops.h>` Returns the imaginary part of a complex number. Summary ------- Given a tensor `input` of complex numbers, this operation returns a tensor of type `float` that is the imaginary part of each element in `input`. [All](all#classtensorflow_1_1ops_1_1_all) elements in `input` must be complex numbers of the form \(a + bj\), where *a* is the real part and *b* is the imaginary part returned by this operation. For example: ``` # tensor 'input' is [-2.25 + 4.75j, 3.25 + 5.75j] tf.imag(input) ==> [4.75, 5.75] ``` Args: * scope: A [Scope](../scope#classtensorflow_1_1_scope) object Returns: * `[Output](../output#classtensorflow_1_1_output)`: The output tensor. | Constructors and Destructors | | --- | | `[Imag](#classtensorflow_1_1ops_1_1_imag_1a406c38bf970910d1b58248e9feccd27a)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) input)` | | `[Imag](#classtensorflow_1_1ops_1_1_imag_1a2bdbce17d9777d3c89abd2119f8b4fb5)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) input, const [Imag::Attrs](../../../struct/tensorflow/ops/imag/attrs#structtensorflow_1_1ops_1_1_imag_1_1_attrs) & attrs)` | | Public attributes | | --- | | `[operation](#classtensorflow_1_1ops_1_1_imag_1aa302f5369963935318220e2bb607871f)` | `[Operation](../operation#classtensorflow_1_1_operation)` | | `[output](#classtensorflow_1_1ops_1_1_imag_1af53e5f297c5f3549d3b850f55236e02f)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` | | Public functions | | --- | | `[node](#classtensorflow_1_1ops_1_1_imag_1af1badb37efafaa8b189b8808921ff53f)() const` | `::tensorflow::Node *` | | `[operator::tensorflow::Input](#classtensorflow_1_1ops_1_1_imag_1a33696d39c41ab48057a23c8b98b762bf)() const` | | | `[operator::tensorflow::Output](#classtensorflow_1_1ops_1_1_imag_1a833743732a3dfa7acfc167a529386580)() const` | | | Public static functions | | --- | | `[Tout](#classtensorflow_1_1ops_1_1_imag_1a4de42f03c8df0d3972028cebd8bab495)(DataType x)` | `[Attrs](../../../struct/tensorflow/ops/imag/attrs#structtensorflow_1_1ops_1_1_imag_1_1_attrs)` | | Structs | | --- | | [tensorflow::ops::Imag::Attrs](../../../struct/tensorflow/ops/imag/attrs) | Optional attribute setters for [Imag](imag#classtensorflow_1_1ops_1_1_imag). | Public attributes ----------------- ### operation ``` Operation operation ``` ### output ``` ::tensorflow::Output output ``` Public functions ---------------- ### Imag ``` Imag( const ::tensorflow::Scope & scope, ::tensorflow::Input input ) ``` ### Imag ``` Imag( const ::tensorflow::Scope & scope, ::tensorflow::Input input, const Imag::Attrs & attrs ) ``` ### node ``` ::tensorflow::Node * node() const ``` ### operator::tensorflow::Input ``` operator::tensorflow::Input() const ``` ### operator::tensorflow::Output ``` operator::tensorflow::Output() const ``` Public static functions ----------------------- ### Tout ``` Attrs Tout( DataType x ) ```
programming_docs
tensorflow_cpp tensorflow::ops::UnsortedSegmentJoin tensorflow::ops::UnsortedSegmentJoin ==================================== `#include <string_ops.h>` Joins the elements of `inputs` based on `segment_ids`. Summary ------- Computes the string join along segments of a tensor. Given `segment_ids` with rank `N` and `data` with rank `N+M`: ``` `output[i, k1...kM] = strings.join([data[j1...jN, k1...kM])` ``` where the join is over all [j1...jN] such that segment\_ids[j1...jN] = i. Strings are joined in row-major order. For example: ``` inputs = [['Y', 'q', 'c'], ['Y', '6', '6'], ['p', 'G', 'a']] output_array = string_ops.unsorted_segment_join(inputs=inputs, segment_ids=[1, 0, 1], num_segments=2, separator=':')) # output_array ==> [['Y', '6', '6'], ['Y:p', 'q:G', 'c:a']] ``` ``` inputs = ['this', 'is', 'a', 'test'] output_array = string_ops.unsorted_segment_join(inputs=inputs, segment_ids=[0, 0, 0, 0], num_segments=1, separator=':')) # output_array ==> ['this:is:a:test'] ``` Args: * scope: A [Scope](../scope#classtensorflow_1_1_scope) object * inputs: The input to be joined. * segment\_ids: A tensor whose shape is a prefix of data.shape. Negative segment ids are not supported. * num\_segments: A scalar. Optional attributes (see `[Attrs](../../../struct/tensorflow/ops/unsorted-segment-join/attrs#structtensorflow_1_1ops_1_1_unsorted_segment_join_1_1_attrs)`): * separator: The separator to use when joining. Returns: * `[Output](../output#classtensorflow_1_1_output)`: The output tensor. | Constructors and Destructors | | --- | | `[UnsortedSegmentJoin](#classtensorflow_1_1ops_1_1_unsorted_segment_join_1adf447c61ece272dac8d94f7eff7f3f9e)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) inputs, ::[tensorflow::Input](../input#classtensorflow_1_1_input) segment_ids, ::[tensorflow::Input](../input#classtensorflow_1_1_input) num_segments)` | | `[UnsortedSegmentJoin](#classtensorflow_1_1ops_1_1_unsorted_segment_join_1ab5ed8a524316ccca59dc46002c597b27)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) inputs, ::[tensorflow::Input](../input#classtensorflow_1_1_input) segment_ids, ::[tensorflow::Input](../input#classtensorflow_1_1_input) num_segments, const [UnsortedSegmentJoin::Attrs](../../../struct/tensorflow/ops/unsorted-segment-join/attrs#structtensorflow_1_1ops_1_1_unsorted_segment_join_1_1_attrs) & attrs)` | | Public attributes | | --- | | `[operation](#classtensorflow_1_1ops_1_1_unsorted_segment_join_1a230139fb5802e8fcf8e15887dbe2b992)` | `[Operation](../operation#classtensorflow_1_1_operation)` | | `[output](#classtensorflow_1_1ops_1_1_unsorted_segment_join_1ab9ac7ec5286de7b5b7171611e04877e0)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` | | Public functions | | --- | | `[node](#classtensorflow_1_1ops_1_1_unsorted_segment_join_1a753d6c70509d798ef017819a7c79e85e)() const` | `::tensorflow::Node *` | | `[operator::tensorflow::Input](#classtensorflow_1_1ops_1_1_unsorted_segment_join_1a9052ff6b4f535fde53718a0f8a3bc9ae)() const` | | | `[operator::tensorflow::Output](#classtensorflow_1_1ops_1_1_unsorted_segment_join_1af9befc42af0b571e7d88c8bdba3869c8)() const` | | | Public static functions | | --- | | `[Separator](#classtensorflow_1_1ops_1_1_unsorted_segment_join_1aea0ab0deec12be23090b276aa084b0d0)(StringPiece x)` | `[Attrs](../../../struct/tensorflow/ops/unsorted-segment-join/attrs#structtensorflow_1_1ops_1_1_unsorted_segment_join_1_1_attrs)` | | Structs | | --- | | [tensorflow::ops::UnsortedSegmentJoin::Attrs](../../../struct/tensorflow/ops/unsorted-segment-join/attrs) | Optional attribute setters for [UnsortedSegmentJoin](unsorted-segment-join#classtensorflow_1_1ops_1_1_unsorted_segment_join). | Public attributes ----------------- ### operation ``` Operation operation ``` ### output ``` ::tensorflow::Output output ``` Public functions ---------------- ### UnsortedSegmentJoin ``` UnsortedSegmentJoin( const ::tensorflow::Scope & scope, ::tensorflow::Input inputs, ::tensorflow::Input segment_ids, ::tensorflow::Input num_segments ) ``` ### UnsortedSegmentJoin ``` UnsortedSegmentJoin( const ::tensorflow::Scope & scope, ::tensorflow::Input inputs, ::tensorflow::Input segment_ids, ::tensorflow::Input num_segments, const UnsortedSegmentJoin::Attrs & attrs ) ``` ### node ``` ::tensorflow::Node * node() const ``` ### operator::tensorflow::Input ``` operator::tensorflow::Input() const ``` ### operator::tensorflow::Output ``` operator::tensorflow::Output() const ``` Public static functions ----------------------- ### Separator ``` Attrs Separator( StringPiece x ) ``` tensorflow_cpp tensorflow::ops::Atan tensorflow::ops::Atan ===================== `#include <math_ops.h>` Computes the trignometric inverse tangent of x element-wise. Summary ------- The `tf.math.atan` operation returns the inverse of `tf.math.tan`, such that if `y = tf.math.tan(x)` then, `x = tf.math.atan(y)`. **Note**: The output of `tf.math.atan` will lie within the invertible range of tan, i.e (-pi/2, pi/2). For example: ``` # Note: [1.047, 0.785] ~= [(pi/3), (pi/4)] x = tf.constant([1.047, 0.785]) y = tf.math.tan(x) # [1.731261, 0.99920404] ``` ``` tf.math.atan(y) # [1.047, 0.785] = x ``` Args: * scope: A [Scope](../scope#classtensorflow_1_1_scope) object Returns: * `[Output](../output#classtensorflow_1_1_output)`: The y tensor. | Constructors and Destructors | | --- | | `[Atan](#classtensorflow_1_1ops_1_1_atan_1a7b02bb9ab4e7cd8ff23d3e92c6686ee3)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) x)` | | Public attributes | | --- | | `[operation](#classtensorflow_1_1ops_1_1_atan_1a117cba9fcb527e14a8cd50fef2654b73)` | `[Operation](../operation#classtensorflow_1_1_operation)` | | `[y](#classtensorflow_1_1ops_1_1_atan_1a760de5766d91ab58baac9b30ef72e31b)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` | | Public functions | | --- | | `[node](#classtensorflow_1_1ops_1_1_atan_1a1cfef5ade7b9abd1e2950e75d91a0f9e)() const` | `::tensorflow::Node *` | | `[operator::tensorflow::Input](#classtensorflow_1_1ops_1_1_atan_1aeaf5812aa103244a12bf811b2132c160)() const` | | | `[operator::tensorflow::Output](#classtensorflow_1_1ops_1_1_atan_1a79805771e314a6c80bb73dcb34bb4e73)() const` | | Public attributes ----------------- ### operation ``` Operation operation ``` ### y ``` ::tensorflow::Output y ``` Public functions ---------------- ### Atan ``` Atan( const ::tensorflow::Scope & scope, ::tensorflow::Input x ) ``` ### node ``` ::tensorflow::Node * node() const ``` ### operator::tensorflow::Input ``` operator::tensorflow::Input() const ``` ### operator::tensorflow::Output ``` operator::tensorflow::Output() const ``` tensorflow_cpp tensorflow::ops::Maximum tensorflow::ops::Maximum ======================== `#include <math_ops.h>` Returns the max of x and y (i.e. Summary ------- x > y ? x : y) element-wise. *NOTE*: `[Maximum](maximum#classtensorflow_1_1ops_1_1_maximum)` supports broadcasting. More about broadcasting [here](http://docs.scipy.org/doc/numpy/user/basics.broadcasting.html) Args: * scope: A [Scope](../scope#classtensorflow_1_1_scope) object Returns: * `[Output](../output#classtensorflow_1_1_output)`: The z tensor. | Constructors and Destructors | | --- | | `[Maximum](#classtensorflow_1_1ops_1_1_maximum_1ac79424a52887ef929798b07849edddf5)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) x, ::[tensorflow::Input](../input#classtensorflow_1_1_input) y)` | | Public attributes | | --- | | `[operation](#classtensorflow_1_1ops_1_1_maximum_1a723405a62696f9642b43d047bf84be5c)` | `[Operation](../operation#classtensorflow_1_1_operation)` | | `[z](#classtensorflow_1_1ops_1_1_maximum_1aa602a2d0259c877daf0f45f107c2a3f8)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` | | Public functions | | --- | | `[node](#classtensorflow_1_1ops_1_1_maximum_1a0f57550d8c3670a06cbf3084dc7dd817)() const` | `::tensorflow::Node *` | | `[operator::tensorflow::Input](#classtensorflow_1_1ops_1_1_maximum_1a111016d9d1c22d5ef0beac58d3e1ff47)() const` | | | `[operator::tensorflow::Output](#classtensorflow_1_1ops_1_1_maximum_1a4f7ff2284ad8dc3870e677bf09726df8)() const` | | Public attributes ----------------- ### operation ``` Operation operation ``` ### z ``` ::tensorflow::Output z ``` Public functions ---------------- ### Maximum ``` Maximum( const ::tensorflow::Scope & scope, ::tensorflow::Input x, ::tensorflow::Input y ) ``` ### node ``` ::tensorflow::Node * node() const ``` ### operator::tensorflow::Input ``` operator::tensorflow::Input() const ``` ### operator::tensorflow::Output ``` operator::tensorflow::Output() const ``` tensorflow_cpp tensorflow::ops::Asin tensorflow::ops::Asin ===================== `#include <math_ops.h>` Computes the trignometric inverse sine of x element-wise. Summary ------- The `tf.math.asin` operation returns the inverse of `tf.math.sin`, such that if `y = tf.math.sin(x)` then, `x = tf.math.asin(y)`. **Note**: The output of `tf.math.asin` will lie within the invertible range of sine, i.e [-pi/2, pi/2]. For example: ``` # Note: [1.047, 0.785] ~= [(pi/3), (pi/4)] x = tf.constant([1.047, 0.785]) y = tf.math.sin(x) # [0.8659266, 0.7068252] ``` ``` tf.math.asin(y) # [1.047, 0.785] = x ``` Args: * scope: A [Scope](../scope#classtensorflow_1_1_scope) object Returns: * `[Output](../output#classtensorflow_1_1_output)`: The y tensor. | Constructors and Destructors | | --- | | `[Asin](#classtensorflow_1_1ops_1_1_asin_1ae176a4bc45c5fdb25d169c5dc78d5247)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) x)` | | Public attributes | | --- | | `[operation](#classtensorflow_1_1ops_1_1_asin_1a137926536926d3e892de672da53c022b)` | `[Operation](../operation#classtensorflow_1_1_operation)` | | `[y](#classtensorflow_1_1ops_1_1_asin_1a694b3f1e8701b15f6f1f995af7af328d)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` | | Public functions | | --- | | `[node](#classtensorflow_1_1ops_1_1_asin_1a19f9746483877a490643e00f2563f376)() const` | `::tensorflow::Node *` | | `[operator::tensorflow::Input](#classtensorflow_1_1ops_1_1_asin_1a8b6390623b94061992e7e965f0f9e9a2)() const` | | | `[operator::tensorflow::Output](#classtensorflow_1_1ops_1_1_asin_1ab7923c0c3cb13f53b540bcbf3153747e)() const` | | Public attributes ----------------- ### operation ``` Operation operation ``` ### y ``` ::tensorflow::Output y ``` Public functions ---------------- ### Asin ``` Asin( const ::tensorflow::Scope & scope, ::tensorflow::Input x ) ``` ### node ``` ::tensorflow::Node * node() const ``` ### operator::tensorflow::Input ``` operator::tensorflow::Input() const ``` ### operator::tensorflow::Output ``` operator::tensorflow::Output() const ``` tensorflow_cpp tensorflow::ops::DecodeAndCropJpeg tensorflow::ops::DecodeAndCropJpeg ================================== `#include <image_ops.h>` Decode and Crop a JPEG-encoded image to a uint8 tensor. Summary ------- The attr `channels` indicates the desired number of color channels for the decoded image. Accepted values are: * 0: Use the number of channels in the JPEG-encoded image. * 1: output a grayscale image. * 3: output an RGB image. If needed, the JPEG-encoded image is transformed to match the requested number of color channels. The attr `ratio` allows downscaling the image by an integer factor during decoding. Allowed values are: 1, 2, 4, and 8. This is much faster than downscaling the image later. It is equivalent to a combination of decode and crop, but much faster by only decoding partial jpeg image. Args: * scope: A [Scope](../scope#classtensorflow_1_1_scope) object * contents: 0-D. The JPEG-encoded image. * crop\_window: 1-D. The crop window: [crop\_y, crop\_x, crop\_height, crop\_width]. Optional attributes (see `[Attrs](../../../struct/tensorflow/ops/decode-and-crop-jpeg/attrs#structtensorflow_1_1ops_1_1_decode_and_crop_jpeg_1_1_attrs)`): * channels: Number of color channels for the decoded image. * ratio: Downscaling ratio. * fancy\_upscaling: If true use a slower but nicer upscaling of the chroma planes (yuv420/422 only). * try\_recover\_truncated: If true try to recover an image from truncated input. * acceptable\_fraction: The minimum required fraction of lines before a truncated input is accepted. * dct\_method: string specifying a hint about the algorithm used for decompression. Defaults to "" which maps to a system-specific default. Currently valid values are ["INTEGER\_FAST", "INTEGER\_ACCURATE"]. The hint may be ignored (e.g., the internal jpeg library changes to a version that does not have that specific option.) Returns: * `[Output](../output#classtensorflow_1_1_output)`: 3-D with shape `[height, width, channels]`.. | Constructors and Destructors | | --- | | `[DecodeAndCropJpeg](#classtensorflow_1_1ops_1_1_decode_and_crop_jpeg_1a40f8322a3956b1982d0d78a7452613fc)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) contents, ::[tensorflow::Input](../input#classtensorflow_1_1_input) crop_window)` | | `[DecodeAndCropJpeg](#classtensorflow_1_1ops_1_1_decode_and_crop_jpeg_1a04b3586218bf0c15f49ea73f733b7aa9)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) contents, ::[tensorflow::Input](../input#classtensorflow_1_1_input) crop_window, const [DecodeAndCropJpeg::Attrs](../../../struct/tensorflow/ops/decode-and-crop-jpeg/attrs#structtensorflow_1_1ops_1_1_decode_and_crop_jpeg_1_1_attrs) & attrs)` | | Public attributes | | --- | | `[image](#classtensorflow_1_1ops_1_1_decode_and_crop_jpeg_1ac86d4abf1b4381950b01a3d3b7b42033)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` | | `[operation](#classtensorflow_1_1ops_1_1_decode_and_crop_jpeg_1a7ca3572e2a7b2f2efbb2dfffca5d6bef)` | `[Operation](../operation#classtensorflow_1_1_operation)` | | Public functions | | --- | | `[node](#classtensorflow_1_1ops_1_1_decode_and_crop_jpeg_1ab81a0fc51718ab73147ccc00f8a859fe)() const` | `::tensorflow::Node *` | | `[operator::tensorflow::Input](#classtensorflow_1_1ops_1_1_decode_and_crop_jpeg_1a4bd46410ee7c7deb85a864042934ac25)() const` | | | `[operator::tensorflow::Output](#classtensorflow_1_1ops_1_1_decode_and_crop_jpeg_1a6676c18a287c62f936e7bc369b687625)() const` | | | Public static functions | | --- | | `[AcceptableFraction](#classtensorflow_1_1ops_1_1_decode_and_crop_jpeg_1a03aa63bbe5a02cfb5735272956cfe14a)(float x)` | `[Attrs](../../../struct/tensorflow/ops/decode-and-crop-jpeg/attrs#structtensorflow_1_1ops_1_1_decode_and_crop_jpeg_1_1_attrs)` | | `[Channels](#classtensorflow_1_1ops_1_1_decode_and_crop_jpeg_1aafeb21d91856f8799a33028b25ed30f5)(int64 x)` | `[Attrs](../../../struct/tensorflow/ops/decode-and-crop-jpeg/attrs#structtensorflow_1_1ops_1_1_decode_and_crop_jpeg_1_1_attrs)` | | `[DctMethod](#classtensorflow_1_1ops_1_1_decode_and_crop_jpeg_1a5aad56954952a3823b7446d5db735018)(StringPiece x)` | `[Attrs](../../../struct/tensorflow/ops/decode-and-crop-jpeg/attrs#structtensorflow_1_1ops_1_1_decode_and_crop_jpeg_1_1_attrs)` | | `[FancyUpscaling](#classtensorflow_1_1ops_1_1_decode_and_crop_jpeg_1ab270c3550997fa6825093eb3e76de49d)(bool x)` | `[Attrs](../../../struct/tensorflow/ops/decode-and-crop-jpeg/attrs#structtensorflow_1_1ops_1_1_decode_and_crop_jpeg_1_1_attrs)` | | `[Ratio](#classtensorflow_1_1ops_1_1_decode_and_crop_jpeg_1ab5ff568c17de19ad85cd4e78585603ce)(int64 x)` | `[Attrs](../../../struct/tensorflow/ops/decode-and-crop-jpeg/attrs#structtensorflow_1_1ops_1_1_decode_and_crop_jpeg_1_1_attrs)` | | `[TryRecoverTruncated](#classtensorflow_1_1ops_1_1_decode_and_crop_jpeg_1adb9221ee465f54e8ee30ea452d2bf2b9)(bool x)` | `[Attrs](../../../struct/tensorflow/ops/decode-and-crop-jpeg/attrs#structtensorflow_1_1ops_1_1_decode_and_crop_jpeg_1_1_attrs)` | | Structs | | --- | | [tensorflow::ops::DecodeAndCropJpeg::Attrs](../../../struct/tensorflow/ops/decode-and-crop-jpeg/attrs) | Optional attribute setters for [DecodeAndCropJpeg](decode-and-crop-jpeg#classtensorflow_1_1ops_1_1_decode_and_crop_jpeg). | Public attributes ----------------- ### image ``` ::tensorflow::Output image ``` ### operation ``` Operation operation ``` Public functions ---------------- ### DecodeAndCropJpeg ``` DecodeAndCropJpeg( const ::tensorflow::Scope & scope, ::tensorflow::Input contents, ::tensorflow::Input crop_window ) ``` ### DecodeAndCropJpeg ``` DecodeAndCropJpeg( const ::tensorflow::Scope & scope, ::tensorflow::Input contents, ::tensorflow::Input crop_window, const DecodeAndCropJpeg::Attrs & attrs ) ``` ### node ``` ::tensorflow::Node * node() const ``` ### operator::tensorflow::Input ``` operator::tensorflow::Input() const ``` ### operator::tensorflow::Output ``` operator::tensorflow::Output() const ``` Public static functions ----------------------- ### AcceptableFraction ``` Attrs AcceptableFraction( float x ) ``` ### Channels ``` Attrs Channels( int64 x ) ``` ### DctMethod ``` Attrs DctMethod( StringPiece x ) ``` ### FancyUpscaling ``` Attrs FancyUpscaling( bool x ) ``` ### Ratio ``` Attrs Ratio( int64 x ) ``` ### TryRecoverTruncated ``` Attrs TryRecoverTruncated( bool x ) ``` tensorflow_cpp tensorflow::ops::Cosh tensorflow::ops::Cosh ===================== `#include <math_ops.h>` Computes hyperbolic cosine of x element-wise. Summary ------- Given an input tensor, this function computes hyperbolic cosine of every element in the tensor. [Input](../input#classtensorflow_1_1_input) range is `[-inf, inf]` and output range is `[1, inf]`. ``` x = tf.constant([-float("inf"), -9, -0.5, 1, 1.2, 2, 10, float("inf")]) tf.math.cosh(x) ==> [inf 4.0515420e+03 1.1276259e+00 1.5430807e+00 1.8106556e+00 3.7621956e+00 1.1013233e+04 inf] ``` Args: * scope: A [Scope](../scope#classtensorflow_1_1_scope) object Returns: * `[Output](../output#classtensorflow_1_1_output)`: The y tensor. | Constructors and Destructors | | --- | | `[Cosh](#classtensorflow_1_1ops_1_1_cosh_1a03ce002815c91b3e9e551f178a9948fd)(const ::[tensorflow::Scope](../scope#classtensorflow_1_1_scope) & scope, ::[tensorflow::Input](../input#classtensorflow_1_1_input) x)` | | Public attributes | | --- | | `[operation](#classtensorflow_1_1ops_1_1_cosh_1a9e146c30bb44c25ed63fc55581c22a0c)` | `[Operation](../operation#classtensorflow_1_1_operation)` | | `[y](#classtensorflow_1_1ops_1_1_cosh_1a390e2a4558b9d1461f29be57ee0dadbf)` | `::[tensorflow::Output](../output#classtensorflow_1_1_output)` | | Public functions | | --- | | `[node](#classtensorflow_1_1ops_1_1_cosh_1a99d194a00f9e0765ccc92b75bb1c8d99)() const` | `::tensorflow::Node *` | | `[operator::tensorflow::Input](#classtensorflow_1_1ops_1_1_cosh_1ae34e8ebed3608f3c74458b161c0a56e6)() const` | | | `[operator::tensorflow::Output](#classtensorflow_1_1ops_1_1_cosh_1ae4a8b1e4d557b893f302f647462b37b3)() const` | | Public attributes ----------------- ### operation ``` Operation operation ``` ### y ``` ::tensorflow::Output y ``` Public functions ---------------- ### Cosh ``` Cosh( const ::tensorflow::Scope & scope, ::tensorflow::Input x ) ``` ### node ``` ::tensorflow::Node * node() const ``` ### operator::tensorflow::Input ``` operator::tensorflow::Input() const ``` ### operator::tensorflow::Output ``` operator::tensorflow::Output() const ```
programming_docs