コレクション
Timeline タイムライン
呼び出し元が所有するモデルの行を、テキスト、時刻ラベル、ノード状態付きのタイムラインとして表示します。
サンプル
プロパティプレビューを読み込めませんでした。もう一度「プロパティプレビュー」を選択して再試行してください。

使い方
モデル駆動のタイムライン
アプリケーションからテキスト、時刻ラベル、ノード状態を提供します。ボタンをクリックすると状態遷移を確認できます。
#include <FluentQt/Collections.h>
using namespace fluent::collections;
auto* timeline = new Timeline(this);
auto* model = new QStandardItemModel(3, 1, this);
for (int i = 0; i < 3; ++i) {
model->setData(model->index(i, 0), QString("Node %1").arg(i + 1));
model->setData(model->index(i, 0), "Optional supporting content supplied by the application.", Timeline::DescriptionRole);
model->setData(model->index(i, 0), QString("Time label %1").arg(i + 1), Timeline::TimestampRole);
}
model->setData(model->index(1, 0), Timeline::Active, Timeline::StatusRole);
timeline->setModel(model);
connect(changeState, &Button::clicked, model, [model] {
const auto index = model->index(1, 0);
model->setData(index, model->data(index, Timeline::StatusRole).toInt() == Timeline::Active
? Timeline::Success : Timeline::Active, Timeline::StatusRole);
});import fluentqt
from PySide6.QtGui import QStandardItemModel
timeline = fluentqt.Timeline()
roles = fluentqt.Timeline.DataRole
states = fluentqt.Timeline.Status
model = QStandardItemModel(3, 1, root)
detail = 'Optional supporting content supplied by the application.'
for i in range(3):
index = model.index(i, 0)
model.setData(index, f'Node {i + 1}')
model.setData(index, detail, roles.DescriptionRole)
model.setData(
index,
f'Time label {i + 1}',
roles.TimestampRole
)
model.setData(model.index(1, 0), states.Active, roles.StatusRole)
timeline.setModel(model)
change = fluentqt.Button('Change node state')
def change_state():
index = model.index(1, 0)
active = index.data(roles.StatusRole) == states.Active
state = states.Success if active else states.Active
model.setData(index, state, roles.StatusRole)
change.clicked.connect(change_state)API
宣言を表示一致する API メンバーはありません。
fluent::collections::Timeline
継承元 ListView
時系列のイベントノードとステータスを表示するモデル駆動のタイムラインビューです。タイトルに DisplayRole、任意のアイコンに DecorationRole、詳細に DataRole を読み取ります。
コンストラクタ
デストラクタ
列挙型
enum NodeAlignmentタイムラインのレールとノードを配置する側。
LeadingTrailingAlternate
enum Statusタイムラインノードの視覚的なステータストーンです。
NeutralActiveSuccessWarningError
enum DataRole説明テキスト、タイムスタンプラベル、およびノード状態用のオプションのモデルロール(既定値は Neutral)。
DescriptionRole = Qt::UserRole + 1TimestampRoleStatusRole
メソッド
void setModel(QAbstractItemModel* model) overrideタイムラインモデルを設定します(引き続き呼び出し元で管理されます)。
プロパティ
NodeAlignment nodeAlignment- 読み取り
nodeAlignment()書き込みsetNodeAlignment()通知シグナルnodeAlignmentChanged() bool animationEnabled- 読み取り
isAnimationEnabled()書き込みsetAnimationEnabled()通知シグナルanimationEnabledChanged()
シグナル
PySide6 拡張
protected メンバー
メソッド
fluent::collections::ListView から継承
列挙型
enum class IndicatorMotionDirectionNoneUpDownLeftRight
メソッド
Flow flow() constアイテムの配置方向(TopToBottom または LeftToRight)。
void setFlow(Flow flow)アイテムの配置方向(TopToBottom または LeftToRight)。
SelectionMode selectionMode() constコレクションビューで使用される選択モードです。
void setSelectionMode(SelectionMode mode)コレクションビューで使用される選択モードです。
Typography::FontRole fontRole() constテキスト描画に使用される Fluent タイポグラフィロール。
void setFontRole(Typography::FontRole role)テキスト描画に使用される Fluent タイポグラフィロール。
int trailingTextRole() const末尾の補助テキスト用のオプションのモデルロール。-1 を指定すると非表示になります。
void setTrailingTextRole(int role)デフォルトデリゲートが末尾テキストに使用するロールを設定します。カスタムデリゲートは独自のレイアウトを処理します。
bool borderVisible() constコントロールの枠線を描画するかどうか。
void setBorderVisible(bool visible)コントロールの枠線を描画するかどうか。
bool backgroundVisible() constコントロールの背景を描画するかどうか。
void setBackgroundVisible(bool visible)コントロールの背景を描画するかどうか。
QWidget* header() constListView のヘッダー領域にホストされるカスタムウィジェット。
void setHeader(QWidget* widget)ListView のヘッダー領域にホストされるカスタムウィジェット。
QString headerText() constヘッダー領域に表示される簡易テキスト。
void setHeaderText(const QString& text)ヘッダー領域に表示される簡易テキスト。
QString placeholderText() constモデルに項目がないときに表示されるテキストです。
void setPlaceholderText(const QString& text)モデルに項目がないときに表示されるテキストです。
bool viewportHovered() constビューポートが現在ホバーされているかどうか。
bool canReorderItems() constドラッグによる並べ替えが有効かどうかです。
void setCanReorderItems(bool enabled)ドラッグによる並べ替えが有効かどうかです。
bool isScrollChainingEnabled() constスクロール境界でのホイール入力を外側のスクローラーへ引き継ぐかどうかです。
void setScrollChainingEnabled(bool enabled)スクロール境界でのホイール入力を外側のスクローラーへ引き継ぐかどうかです。
bool sectionEnabled() constセクションキーコールバックを使用して、隣接する項目をセクションヘッダー配下にグループ化するかどうかです。
void setSectionEnabled(bool enabled)セクションキーコールバックを使用して、隣接する項目をセクションヘッダー配下にグループ化するかどうかです。
void setSectionKeyFunction(SectionKeyFunc func)行ごとにセクションキーを返すコールバックを設定します。同じキーを持つ連続した行はセクションヘッダーを共有します。
qreal selectedIndicatorProgress() const選択項目インジケーターのアニメーション進捗。
IndicatorMotionDirection selectedIndicatorMotionDirection() const選択インジケーターのモーションで使用される方向。
bool selectedIndicatorAnimationEnabled() const選択インジケーターが行間をアニメーション移動するかどうか。無効にすると、ターゲット矩形へ即座にスナップします。
void setSelectedIndicatorAnimationEnabled(bool enabled)選択インジケーターのアニメーションを有効にするかどうか。
bool selectionIndicatorVisible() const選択項目インジケーターを描画するかどうか。
void setSelectionIndicatorVisible(bool visible)選択動作に影響を与えずに、選択インジケーターを表示または非表示にします。
QRectF selectedIndicatorRect() constビューポート座標系における現在の選択インジケーター矩形を返します。表示されているものがない場合は空の矩形を返します。
QRectF selectedIndicatorRect(qreal progress) const[0, 1] の正規化されたアニメーション進行度における選択インジケーター矩形を返します。
QRectF selectedIndicatorRectForRow(int row) const特定の行の選択インジケーター矩形を返します(複数選択モードで使用されます)。
void refreshFluentScrollChrome()ネイティブスクロールバーを非表示にし、Fluent オーバーレイスクロールバーを更新します。QComboBox のポップアップ内などで表示後にプラットフォームスタイルがネイティブバーを復元する場合は、再度呼び出してください。
プロパティ
SelectionMode selectionModeコレクションビューで使用される選択モードです。
読み取りselectionMode()書き込みsetSelectionMode()通知シグナルselectionModeChanged()Typography::FontRole fontRoleテキスト描画に使用される Fluent タイポグラフィロール。
読み取りfontRole()書き込みsetFontRole()通知シグナルfontRoleChanged()int trailingTextRole末尾の補助テキスト用のオプションのモデルロール。-1 を指定すると非表示になります。
読み取りtrailingTextRole()書き込みsetTrailingTextRole()通知シグナルtrailingTextRoleChanged()bool viewportHoveredビューポートが現在ホバーされているかどうか。
読み取りviewportHovered()通知シグナルviewportHoveredChanged()Flow flowアイテムの配置方向(TopToBottom または LeftToRight)。
読み取りflow()書き込みsetFlow()通知シグナルflowChanged()qreal selectedIndicatorProgress選択項目インジケーターのアニメーション進捗。
読み取りselectedIndicatorProgress()通知シグナルselectedIndicatorProgressChanged()IndicatorMotionDirection selectedIndicatorMotionDirection選択インジケーターのモーションで使用される方向。
読み取りselectedIndicatorMotionDirection()通知シグナルselectedIndicatorMotionDirectionChanged()bool selectedIndicatorAnimationEnabled選択インジケーターのアニメーションを有効にするかどうか。
読み取りselectedIndicatorAnimationEnabled()書き込みsetSelectedIndicatorAnimationEnabled()通知シグナルselectedIndicatorAnimationEnabledChanged()bool selectionIndicatorVisible選択項目インジケーターを描画するかどうか。
読み取りselectionIndicatorVisible()書き込みsetSelectionIndicatorVisible()通知シグナルselectionIndicatorVisibleChanged()bool borderVisibleコントロールの枠線を描画するかどうか。
読み取りborderVisible()書き込みsetBorderVisible()通知シグナルborderVisibleChanged()bool backgroundVisibleコントロールの背景を描画するかどうか。
読み取りbackgroundVisible()書き込みsetBackgroundVisible()通知シグナルbackgroundVisibleChanged()QWidget* headerListView のヘッダー領域にホストされるカスタムウィジェット。
読み取りheader()書き込みsetHeader()通知シグナルheaderChanged()QString headerTextヘッダー領域に表示される簡易テキスト。
読み取りheaderText()書き込みsetHeaderText()通知シグナルheaderTextChanged()QString placeholderTextモデルに項目がないときに表示されるテキストです。
読み取りplaceholderText()書き込みsetPlaceholderText()通知シグナルplaceholderTextChanged()bool canReorderItemsドラッグによる並べ替えが有効かどうかです。
読み取りcanReorderItems()書き込みsetCanReorderItems()通知シグナルcanReorderItemsChanged()bool scrollChainingEnabledスクロール境界でのホイール入力を外側のスクローラーへ引き継ぐかどうかです。
読み取りisScrollChainingEnabled()書き込みsetScrollChainingEnabled()通知シグナルscrollChainingEnabledChanged()bool sectionEnabledセクションキーコールバックを使用して、隣接する項目をセクションヘッダー配下にグループ化するかどうかです。
読み取りsectionEnabled()書き込みsetSectionEnabled()通知シグナルsectionEnabledChanged()
シグナル
void selectionModeChanged()コレクションビューで使用される選択モードです。
void fontRoleChanged()テキスト描画に使用される Fluent タイポグラフィロール。
void trailingTextRoleChanged()末尾の補助テキスト用のオプションのモデルロール。-1 を指定すると非表示になります。
void viewportHoveredChanged()ビューポートが現在ホバーされているかどうか。
void flowChanged()アイテムの配置方向(TopToBottom または LeftToRight)。
void borderVisibleChanged()コントロールの枠線を描画するかどうか。
void backgroundVisibleChanged()コントロールの背景を描画するかどうか。
void headerChanged()ListView のヘッダー領域にホストされるカスタムウィジェット。
void headerTextChanged()ヘッダー領域に表示される簡易テキスト。
void placeholderTextChanged()モデルに項目がないときに表示されるテキストです。
void canReorderItemsChanged()ドラッグによる並べ替えが有効かどうかです。
void scrollChainingEnabledChanged()スクロール境界でのホイール入力を外側のスクローラーへ引き継ぐかどうかです。
void sectionEnabledChanged()セクションキーコールバックを使用して、隣接する項目をセクションヘッダー配下にグループ化するかどうかです。
void selectedIndicatorProgressChanged()選択項目インジケーターのアニメーション進捗。
void selectedIndicatorMotionDirectionChanged()選択インジケーターのモーションで使用される方向。
void selectedIndicatorAnimationEnabledChanged()選択インジケーターのアニメーションを有効にするかどうか。
void selectionIndicatorVisibleChanged()選択項目インジケーターを描画するかどうか。
void itemClicked(int index)QAbstractItemView::clicked() と併せて、クリックされた行インデックスを送出する便利なシグナル。
型とエイリアス
fluent::FluentElement から継承
列挙型
enum Themeデザイントークン解決時に使用されるグローバルな視覚テーマ。
Light = 0Dark = 1HighContrast = 2
メソッド
static void setTheme(Theme theme)グローバルテーマを更新し、アクティブな FluentElement インスタンスに通知します。
static void setThemeDeferred(Theme theme)現在の操作をブロックせずに、可視要素を優先したバッチ処理でテーマの更新をスケジュールします。
static Theme currentTheme()現在有効なグローバルテーマを返します。
static bool themeUsesDarkAppearance(Theme theme)テーマがダークベースのクロームおよびマテリアルトークンを使用するかどうかを返します。
static void refreshTheme()デザイントークンの変更後に再描画するため、現在のテーマを再ブロードキャストします。
static int themeGeneration()テーマ変更ごとに加算される単調増加カウンターです。鮮度チェックに使用されます。
Theme effectiveTheme() const継承された QWidget の上書きを尊重し、この要素が使用するテーマを解決します。
bool effectiveThemeUsesDarkAppearance() constこの要素の有効なテーマがダークベースのクロームを使用するかどうかを返します。
bool setThemeOverrides(const QJsonObject& overrides)この要素のスパースな色、角丸半径、フォントトークンの上書きを置き換えます。
QJsonObject themeOverrides() constこの要素に設定されたオーバーライドを返します。
void clearThemeOverrides()すべてのトークンフィールドをグローバルテーマの既定値に復元します。
const Colors& themeColorsRef() const描画のホットパス向けにアクティブなカラーセットへ非コピーでアクセスします。
Material::AcrylicToken themeAcrylic() constマテリアル、エレベーション、およびアダプティブレイアウトのトークン。
QColor themeBackdrop(bool active) const指定されたアクティブ状態に対するウィンドウ chrome の背景色。
virtual void onThemeUpdated()グローバルテーマの変更後に呼び出されます。
型とエイリアス
struct Colorsコンポーネントに返されるデザイントークンのスナップショット。
fluent::QMLPlus から継承
メソッド
AnchorLayout::Anchors* anchors()QWidget ホストの変更可能なアンカーを返します。
void setState(const QString& name)登録済みの状態を名前で適用するか、@p name が空の場合はデフォルト状態を復元します。未知の名前は無視され、その状態を離れると既存のバインディングが再開されます。
void addState(const QMLState& state)名前付き状態定義を登録または置換します。アクティブな状態を置換した場合は即座に適用されます。
void evaluateStates()登録順に状態条件を再評価し、最初に一致した状態(一致しない場合はデフォルト状態)をアクティブにします。依存プロパティの変更通知時にも自動実行され、extend を使用する派生状態は、循環や欠損がない限り祖先の変更を継承します。
QMLPlusRuntime* runtime()このホストが所有し、遅延生成される状態オブザーバーを返します。
void setAnchors(const AnchorLayout::Anchors& anchors)すべてのホストアンカーを置き換え、親レイアウトを無効化します。
void resetAnchors()ホストのすべてのアンカーをクリアし、親レイアウトを無効化します。
void bind(const char* targetProp, QObject* source, const char* sourceProp, PropertyBinder::Direction dir = PropertyBinder::OneWay)PropertyBinder::bind() を介して、@p source の @p sourceProp をこの QWidget ホストの @p targetProp にバインドします。
BindingHandle bindManaged(const char* targetProp, QObject* source, const char* sourceProp, PropertyBinder::Direction direction = PropertyBinder::OneWay, BindingOptions options = {})この QWidget ホストに管理された直接バインディングを設定します。
BindingHandle bindComputed(const char* targetProp, const QVector<BindingDependency>& dependencies, std::function<QVariant()> evaluate, BindingOptions options = {})この QWidget ホストに明示的依存関係を持つ C++ 式を設定します。
void addTransition(const StateTransition& transition)優先順位順に状態遷移を登録します。
void setBehavior(const char* propertyName, const PropertyAnimation& animation)writeProperty() またはバインディング経由で @p propertyName が書き込まれた際に使用されるデフォルトアニメーションを設定します。明示的な StateTransition ルールが優先され、C++ のセッターを直接呼び出した場合はアニメーションしません。
void clearBehavior(const char* propertyName)今後のマネージド書き込みに使用するデフォルトアニメーションを削除します。
bool writeProperty(const char* propertyName, const QVariant& value)バインディングを削除せずに Behavior 経由でホストプロパティに書き込みます。
Qt 基底クラスドキュメント:QListView