このページでは

QMediaTimeRange Class

QMediaTimeRange クラスは、0個以上の互いに重ならない時間間隔の集合を表します。詳細...

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

注:このクラスのすべての関数は再入可能である。

パブリック型

struct Interval

パブリック関数

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)

詳細な説明

earliestTime()、latestTime()、intervals()、およびisEmpty() メソッドは、現在の時間範囲に関する情報を取得するために使用されます。

addInterval()、removeInterval()、およびclear() メソッドは、現在の時間範囲を変更するために使用されます。

時間範囲に区間を追加または削除する場合、その範囲内の既存の区間は、時間範囲内のすべての区間が互いに区別可能かつ互いに交わらない状態を維持するために、拡張、切り詰め、削除、結合、または分割されることがあります。その結果、時間範囲に追加または削除されるすべての区間は、normal である必要があります。

「QMediaTimeRange::Interval」も参照してください 。

メンバ関数のドキュメント

QMediaTimeRange::QMediaTimeRange()

空の時間範囲を作成します。

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

初期区間 `interval` を含む時間範囲を作成します。

interval がnormal でない場合、結果として得られる時間範囲は空になります。

addInterval()も参照してください 。

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

start からend までの初期区間を含む時間範囲を作成します(両端を含む)。

間隔がnormal でない場合、結果として得られる時間範囲は空になります。

addInterval()も参照してください 。

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

別の時間range をコピーして、時間範囲を作成します。

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

other から移動して、時間範囲を構築します。

[noexcept] QMediaTimeRange::~QMediaTimeRange()

デストラクタ。

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

指定されたinterval を時間範囲に追加します。

normal ではない区間を追加することは無効であり、無視されます。

指定された区間が、時間範囲内の既存の区間に隣接しているか、または重なっている場合、これらの区間は統合されます。

この操作には線形時間がかかります。

removeInterval()も参照してください 。

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

start およびend で指定された間隔を、時間範囲に追加します。

これはオーバーロードされた関数です。

addInterval()も参照してください 。

void QMediaTimeRange::addTimeRange(const QMediaTimeRange &range)

range に含まれる各区間を、この時間範囲に追加します。

これは、range 内の各間隔に対してaddInterval() を呼び出すことと同等です。

void QMediaTimeRange::clear()

指定された時間範囲からすべての区間を削除します。

removeInterval()も参照してください 。

bool QMediaTimeRange::contains(qint64 time) const

指定されたtime が指定された時間範囲内にある場合、trueを返します。

qint64 QMediaTimeRange::earliestTime() const

指定された時間範囲内で最も早い時刻を返します。

時間範囲が空の場合、この値は 0 になります。

latestTime()も参照してください 。

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

この時間範囲に含まれる区間のリストを返します。

bool QMediaTimeRange::isContinuous() const

時間範囲が連続した区間で構成されている場合、true を返します。つまり、その時間範囲内には、互いに重ならない区間が 1 つ以下しか存在しません。

bool QMediaTimeRange::isEmpty() const

指定された時間範囲内に区間が存在しない場合、true を返します。

intervals()も参照してください 。

qint64 QMediaTimeRange::latestTime() const

指定された時間範囲内の最新の時刻を返します。

時間範囲が空の場合、この値はゼロになります。

earliestTime()も参照してください 。

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

指定されたinterval を時間範囲から削除します。

normal ではない区間を削除しようとすると無効となり、無視されます。

時間範囲内の区間は、その時間範囲内のどの区間も対象の区間の一部を含まなくなるように、切り詰め、分割、または削除されます。

この操作には線形時間かかります。

addInterval()も参照してください 。

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

start およびend で指定された区間を、時間範囲から削除します。

これはオーバーロードされた関数です。

removeInterval()も参照してください 。

void QMediaTimeRange::removeTimeRange(const QMediaTimeRange &range)

range に含まれる各区間を、この時間範囲から削除します。

これは、range に含まれる各区間に対してremoveInterval()を呼び出すのと同じ効果があります。

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

現在のインスタンスをother と入れ替えます。

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

other に指定された各区間を時間範囲に追加し、その結果を返します。

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

指定されたinterval を時間範囲に追加し、その結果を返します。

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

other に指定された各区間を時間範囲から削除し、その結果を返します。

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

指定されたinterval を時間範囲から除外し、その結果を返します。

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

「other 」をこの時間範囲に移動します。

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

other の時間範囲のコピーを作成し、自分自身を返します。

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

時間範囲を単一の連続した区間(interval )に設定します。

関連する非メンバー

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

lhs に含まれる区間がrhs に存在しない場合、true を返します。

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

r1 とr2 の和集合を含む時間範囲を返します。

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

`r2 ` を `r1` から差し引いた時間範囲を返します。

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

lhs 内のすべての区間がrhs に含まれている場合、true を返します。

© 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.