En esta página

QMediaTimeRange::Interval Struct

struct QMediaTimeRange::Interval

La clase QMediaTimeRange::Interval representa un intervalo de tiempo con precisión entera. Más...

Funciones públicas

Interval(qint64 start, qint64 end)
bool contains(qint64 time) const
qint64 end() const
bool isNormal() const
QMediaTimeRange::Interval normalized() const
qint64 start() const
QMediaTimeRange::Interval translated(qint64 offset) const
bool operator!=(QMediaTimeRange::Interval lhs, QMediaTimeRange::Interval rhs)
bool operator==(QMediaTimeRange::Interval lhs, QMediaTimeRange::Interval rhs)

Descripción detallada

Un intervalo se especifica mediante un tiempo inclusivo start() y end(). Estos deben establecerse en el constructor, ya que se trata de una clase inmutable. Las unidades específicas de tiempo representadas por la clase no se han definido - es adecuada para cualquier tiempo que pueda ser representado por un entero de 64 bits con signo.

El método isNormal() determina si un intervalo de tiempo es normal (un intervalo de tiempo normal tiene start() <= end()). Se puede recibir un intervalo normal a partir de un intervalo anormal llamando al método normalized().

El método contains() determina si un tiempo especificado se encuentra dentro del intervalo de tiempo.

El método translated() devuelve un intervalo de tiempo que ha sido trasladado hacia adelante o hacia atrás en el tiempo por un desplazamiento especificado.

Véase también QMediaTimeRange.

Documentación de las funciones miembro

[explicit constexpr noexcept] Interval::Interval(qint64 start, qint64 end)

Construye un intervalo con los tiempos start y end especificados.

[constexpr noexcept] bool Interval::contains(qint64 time) const

Devuelve verdadero si el intervalo de tiempo contiene el time especificado. Es decir, start() <= tiempo <= end().

[constexpr noexcept] qint64 Interval::end() const

Devuelve la hora de finalización del intervalo.

Véase también start().

[constexpr noexcept] bool Interval::isNormal() const

Devuelve true si este intervalo de tiempo es normal. Un intervalo de tiempo normal tiene start() <= end().

Véase también normalized().

[constexpr] QMediaTimeRange::Interval Interval::normalized() const

Devuelve una versión normalizada de este intervalo.

Si el tiempo start() del intervalo es mayor que el tiempo end(), entonces el intervalo devuelto tiene los tiempos de inicio y final intercambiados.

[constexpr noexcept] qint64 Interval::start() const

Devuelve la hora de inicio del intervalo.

Véase también end().

[constexpr] QMediaTimeRange::Interval Interval::translated(qint64 offset) const

Devuelve una copia de este intervalo de tiempo, trasladado por un valor de offset. Un intervalo puede moverse hacia adelante en el tiempo con un desplazamiento positivo, o hacia atrás en el tiempo con un desplazamiento negativo.

No miembros relacionados

[constexpr noexcept] bool operator!=(QMediaTimeRange::Interval lhs, QMediaTimeRange::Interval rhs)

Devuelve true si lhs no es exactamente igual a rhs.

[constexpr noexcept] bool operator==(QMediaTimeRange::Interval lhs, QMediaTimeRange::Interval rhs)

Devuelve verdadero si lhs es exactamente igual a rhs.

© 2026 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.