In questa pagina

QMediaTimeRange::Interval Struct

struct QMediaTimeRange::Interval

La classe ` QMediaTimeRange::Interval ` rappresenta un intervallo di tempo con precisione intera. Maggiori informazioni...

Funzioni pubbliche

Interval()
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)

Descrizione dettagliata

Un intervallo è specificato da un'ora inclusiva start() e da un'ora end(). Questi valori devono essere impostati nel costruttore, poiché si tratta di una classe immutabile. Le unità di tempo specifiche rappresentate dalla classe non sono state definite: essa è adatta a qualsiasi intervallo di tempo rappresentabile da un numero intero a 64 bit con segno.

Il metodo ` isNormal()` determina se un intervallo di tempo è normale (un intervallo di tempo normale ha ` start()` <= ` end()`). È possibile ottenere un intervallo normale da uno anomalo chiamando il metodo ` normalized()`.

Il metodo ` contains()` determina se un tempo specificato rientra nell’intervallo di tempo.

Il metodo ` translated()` restituisce un intervallo di tempo che è stato spostato in avanti o indietro nel tempo di un offset specificato.

Vedi anche QMediaTimeRange.

Documentazione sulle funzioni membro

[constexpr noexcept default] Interval::Interval()

Crea un'istanza di ` Interval` con i valori predefiniti.

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

Crea un intervallo con i tempi specificati in “ start ” e “ end ”.

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

Restituisce true se l'intervallo di tempo contiene l'time e specificata. In altre parole, start() <= time <= end().

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

Restituisce l'ora di fine dell'intervallo.

Vedi anche start().

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

Restituisce true se questo intervallo di tempo è normale. Un intervallo di tempo normale soddisfa la condizione start() <= end().

Vedi anche normalized().

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

Restituisce una versione normalizzata di questo intervallo.

Se l'ora start() dell'intervallo è maggiore dell'ora end(), l'intervallo restituito presenta le ore di inizio e di fine invertite.

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

Restituisce l'ora di inizio dell'intervallo.

Vedi anche end().

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

Restituisce una copia di questo intervallo di tempo, traslato di un valore pari a offset. Un intervallo può essere spostato in avanti nel tempo con un offset positivo, oppure indietro nel tempo con un offset negativo.

Elementi correlati non membri

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

Restituisce "true" se lhs non è esattamente uguale a rhs.

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

Restituisce "true" se lhs è esattamente uguale 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.