跳转至

ui/widget/material/base/painter_layer.h

Painter layer for Material Design widget rendering. More...

Namespaces

Name
cf
cf::ui
cf::ui::widget
cf::ui::widget::material
cf::ui::widget::material::base

Classes

Name
class cf::ui::widget::material::base::PainterLayer
Painter layer for Material Design widget rendering.

Detailed Description

Painter layer for Material Design widget rendering.

Author: N/A

Version: N/A

Since: N/A

Date: N/A

Provides a layer abstraction for painting operations with color and opacity control. Used for layered rendering in Material Design widgets.

Source code

#pragma once
#include "color.h"
#include "export.h"
#include <QObject>
class QPainter;
class QPainterPath;

namespace cf::ui::widget::material::base {

class CF_UI_EXPORT PainterLayer : public QObject {
    Q_OBJECT
  public:
    explicit PainterLayer(QObject* parent);

    void setColor(const cf::ui::base::CFColor& color) { cached_color_ = color; }

    void setOpacity(float opacity) { opacity_ = opacity; }

    void paint(QPainter* painter, const QPainterPath& clipPath);

  protected:
    cf::ui::base::CFColor cached_color_;
    float opacity_;
};

} // namespace cf::ui::widget::material::base

Updated on 2026-03-09 at 10:14:01 +0000