Fluent-Qt

API 參考

PaintCompat

本標頭檔宣告的公開型別、函式與常數。

FluentRasterCachePainter

繼承自 QPainter

用於顯式影像/像素圖快取的繪製器,在舊版 Qt 忽略 DPR < 1.0 時自動補償縮放。

建構函式

Qt 基底類別文件:QPainter

Global

方法

template <class Device> inline void fluentSetRenderTargetDevicePixelRatio(Device& device, qreal dpr)

設定明確的轉譯目標 DPR,限制為 >= 1.0(Qt 5.15/6.2 與特效濾鏡所需);需搭配 fluentApplyRenderTargetScale() 使用。

inline void fluentApplyRenderTargetScale(QPainter& painter, qreal dpr)

在開始繪製已正規化的轉譯目標時,套用一次剩餘的小於 1.0 之縮放比例。

inline qreal fluentPainterDevicePixelRatio(const QPainter& painter)

繪製器目前繪製裝置的有效裝置像素比。

inline void fluentDrawPixmapInLogicalRect(QPainter& painter, const QRectF& logicalRect, const QPixmap& source)

依繪製裝置的 DPR 將點陣圖置中繪製於邏輯矩形內(適用於 HiDPI/分數縮放下的 1x 縮圖)。

inline void fluentDrawCoverPixmapInLogicalRect(QPainter& painter, const QRectF& logicalRect, const QPixmap& source)

將點陣圖等比縮放並置中裁切,以填滿邏輯矩形(cover 模式)。

型別與別名

using FluentColorComponent = float

QColor::getHsvF / getRgbF / getHslF 的分量指標型別(Qt 6 為 float,Qt 5 為 qreal)。