In questa pagina

QMediaTimeRange Class

La classe QMediaTimeRange rappresenta un insieme composto da zero o più intervalli di tempo disgiunti. Maggiori informazioni...

Intestazione: #include <QMediaTimeRange>
CMake: find_package(Qt6 REQUIRED COMPONENTS Multimedia)
target_link_libraries(mytarget PRIVATE Qt6::Multimedia)
qmake: QT += multimedia

Nota: tutte le funzioni di questa classe sono rientranti.

Tipi pubblici

struct Interval

Funzioni pubbliche

QMediaTimeRange()
QMediaTimeRange(const QMediaTimeRange::Interval &interval)
QMediaTimeRange(qint64 start, qint64 end)
QMediaTimeRange(const QMediaTimeRange &range)
QMediaTimeRange(QMediaTimeRange &&other)
~QMediaTimeRange()
void addInterval(const QMediaTimeRange::Interval &interval)
void addInterval(qint64 start, qint64 end)
void addTimeRange(const QMediaTimeRange &range)
void clear()
bool contains(qint64 time) const
qint64 earliestTime() const
QList<QMediaTimeRange::Interval> intervals() const
bool isContinuous() const
bool isEmpty() const
qint64 latestTime() const
void removeInterval(const QMediaTimeRange::Interval &interval)
void removeInterval(qint64 start, qint64 end)
void removeTimeRange(const QMediaTimeRange &range)
void swap(QMediaTimeRange &other)
QMediaTimeRange &operator+=(const QMediaTimeRange &other)
QMediaTimeRange &operator+=(const QMediaTimeRange::Interval &interval)
QMediaTimeRange &operator-=(const QMediaTimeRange &other)
QMediaTimeRange &operator-=(const QMediaTimeRange::Interval &interval)
QMediaTimeRange &operator=(QMediaTimeRange &&other)
QMediaTimeRange &operator=(const QMediaTimeRange &other)
QMediaTimeRange &operator=(const QMediaTimeRange::Interval &interval)
bool operator!=(const QMediaTimeRange &lhs, const QMediaTimeRange &rhs)
QMediaTimeRange operator+(const QMediaTimeRange &r1, const QMediaTimeRange &r2)
QMediaTimeRange operator-(const QMediaTimeRange &r1, const QMediaTimeRange &r2)
bool operator==(const QMediaTimeRange &lhs, const QMediaTimeRange &rhs)

Descrizione dettagliata

I metodi earliestTime(), latestTime(), intervals() e isEmpty() vengono utilizzati per ottenere informazioni sull'intervallo di tempo corrente.

I metodi addInterval(), removeInterval() e clear() vengono utilizzati per modificare l'intervallo di tempo corrente.

Quando si aggiungono o si rimuovono intervalli dall’intervallo di tempo, gli intervalli esistenti all’interno di esso possono essere estesi, ridotti, eliminati, uniti o suddivisi per garantire che tutti gli intervalli all’interno dell’intervallo di tempo rimangano distinti e disgiunti. Di conseguenza, tutti gli intervalli aggiunti o rimossi da un intervallo di tempo devono essere normal.

Vedi anche QMediaTimeRange::Interval.

Documentazione delle funzioni membro

QMediaTimeRange::QMediaTimeRange()

Crea un intervallo temporale vuoto.

QMediaTimeRange::QMediaTimeRange(const QMediaTimeRange::Interval &interval)

Crea un intervallo di tempo che contiene un intervallo iniziale, interval.

Se interval non è normal, l'intervallo di tempo risultante sarà vuoto.

Vedi anche addInterval().

[explicit] QMediaTimeRange::QMediaTimeRange(qint64 start, qint64 end)

Crea un intervallo di tempo che contiene un intervallo iniziale compreso tra start e end, inclusi.

Se l'intervallo non è normal, l'intervallo di tempo risultante sarà vuoto.

Vedi anche addInterval().

[noexcept] QMediaTimeRange::QMediaTimeRange(const QMediaTimeRange &range)

Crea un intervallo di tempo copiando un altro intervallo di tempo range.

[constexpr noexcept default] QMediaTimeRange::QMediaTimeRange(QMediaTimeRange &&other)

Crea un intervallo di tempo partendo da other.

[noexcept] QMediaTimeRange::~QMediaTimeRange()

Distruttore.

void QMediaTimeRange::addInterval(const QMediaTimeRange::Interval &interval)

Aggiunge l'interval e specificata all'intervallo di tempo.

L'aggiunta di intervalli che non sono normal non è valida e verrà ignorata.

Se l'intervallo specificato è adiacente o si sovrappone a intervalli esistenti all'interno dell'intervallo di tempo, tali intervalli verranno uniti.

Questa operazione richiede un tempo lineare.

Vedi anche removeInterval().

void QMediaTimeRange::addInterval(qint64 start, qint64 end)

Aggiunge all'intervallo di tempo i valori specificati da start e end.

Si tratta di una funzione sovraccaricata.

Vedi anche addInterval().

void QMediaTimeRange::addTimeRange(const QMediaTimeRange &range)

Aggiunge ciascuno degli intervalli presenti in range a questo intervallo di tempo.

Equivalente a chiamare ` addInterval()` per ciascun intervallo presente in ` range`.

void QMediaTimeRange::clear()

Rimuove tutti gli intervalli dall'intervallo di tempo.

Vedi anche removeInterval().

bool QMediaTimeRange::contains(qint64 time) const

Restituisce true se l'time e specificato rientra nell'intervallo di tempo.

qint64 QMediaTimeRange::earliestTime() const

Restituisce l'ora più precoce all'interno dell'intervallo di tempo.

Per gli intervalli di tempo vuoti, questo valore è pari a zero.

Vedi anche latestTime().

QList<QMediaTimeRange::Interval> QMediaTimeRange::intervals() const

Restituisce l'elenco degli intervalli compresi in questo intervallo di tempo.

bool QMediaTimeRange::isContinuous() const

Restituisce true se l'intervallo di tempo è costituito da un intervallo continuo. In altre parole, all'interno dell'intervallo di tempo è presente un solo intervallo disgiunto o nessun intervallo disgiunto.

bool QMediaTimeRange::isEmpty() const

Restituisce true se non sono presenti intervalli all'interno dell'intervallo di tempo specificato.

Vedi anche intervals().

qint64 QMediaTimeRange::latestTime() const

Restituisce l'ora più recente all'interno dell'intervallo di tempo.

Per gli intervalli di tempo vuoti, questo valore è pari a zero.

Vedi anche earliestTime().

void QMediaTimeRange::removeInterval(const QMediaTimeRange::Interval &interval)

Rimuove l'interval e specificato dall'intervallo di tempo.

La rimozione di intervalli che non sono " normal " non è consentita e verrà ignorata.

Gli intervalli all’interno dell’intervallo di tempo verranno ritagliati, suddivisi o eliminati in modo tale che nessun intervallo all’interno dell’intervallo di tempo includa alcuna parte dell’intervallo di destinazione.

Questa operazione richiede un tempo lineare.

Vedi anche addInterval().

void QMediaTimeRange::removeInterval(qint64 start, qint64 end)

Rimuove dall'intervallo di tempo l'intervallo specificato da start e end.

Si tratta di una funzione sovraccaricata.

Vedi anche removeInterval().

void QMediaTimeRange::removeTimeRange(const QMediaTimeRange &range)

Rimuove ciascuno degli intervalli presenti in range da questo intervallo di tempo.

Equivalente alla chiamata a ` removeInterval()` per ciascun intervallo presente in ` range`.

[noexcept] void QMediaTimeRange::swap(QMediaTimeRange &other)

Sostituisce l'istanza corrente con quella presente all'indirizzo other.

QMediaTimeRange &QMediaTimeRange::operator+=(const QMediaTimeRange &other)

Aggiunge ciascun intervallo presente in ` other ` all'intervallo di tempo e restituisce il risultato.

QMediaTimeRange &QMediaTimeRange::operator+=(const QMediaTimeRange::Interval &interval)

Aggiunge l'interval e specificato all'intervallo di tempo e restituisce il risultato.

QMediaTimeRange &QMediaTimeRange::operator-=(const QMediaTimeRange &other)

Rimuove ogni intervallo presente in other dall'intervallo di tempo e restituisce il risultato.

QMediaTimeRange &QMediaTimeRange::operator-=(const QMediaTimeRange::Interval &interval)

Rimuove l'interval e specificato dall'intervallo di tempo e restituisce il risultato.

[noexcept] QMediaTimeRange &QMediaTimeRange::operator=(QMediaTimeRange &&other)

Sposta " other " in questo intervallo di tempo.

[noexcept] QMediaTimeRange &QMediaTimeRange::operator=(const QMediaTimeRange &other)

Crea una copia dell'intervallo temporale di other e restituisce se stessa.

QMediaTimeRange &QMediaTimeRange::operator=(const QMediaTimeRange::Interval &interval)

Imposta l'intervallo di tempo su un unico intervallo continuo, interval.

Correlati per i non iscritti

bool operator!=(const QMediaTimeRange &lhs, const QMediaTimeRange &rhs)

Restituisce true se uno o più intervalli presenti in ` lhs ` non sono presenti in ` rhs`.

QMediaTimeRange operator+(const QMediaTimeRange &r1, const QMediaTimeRange &r2)

Restituisce un intervallo di tempo che contiene l'unione tra r1 e r2.

QMediaTimeRange operator-(const QMediaTimeRange &r1, const QMediaTimeRange &r2)

Restituisce un intervallo di tempo contenente il valore “ r2 ” sottratto da “ r1 ”.

bool operator==(const QMediaTimeRange &lhs, const QMediaTimeRange &rhs)

Restituisce true se tutti gli intervalli presenti in lhs sono presenti anche in 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.