Skip to content
Back to skills

Pyside6 Mplfinance 金融图表组件开发

ASecurity

使用 PySide6 创建包含 mplfinance 蜡烛图的 QWidget,支持暗黑主题、自定义标题栏、时间选择器、键盘事件及日期回退查询逻辑。

  • 2 stars
  • 0 votes
  • 0 copies
  • 0 views
  • Added September 27, 2026
design

Security analysis

A100/100

Scanned September 27, 2026

npx -y skills add David-Li0406/meta-skill-evloving --skill 'pyside6-mplfinance-金融图表组件开发' --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Pyside6 Mplfinance 金融图表组件开发?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Pyside6 Mplfinance 金融图表组件开发
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/david-li0406-pyside6-mplfinance-meta-skill-evloving/badge)](https://www.skillsdirectory.com/skills/david-li0406-pyside6-mplfinance-meta-skill-evloving)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
id: "ff051158-6c80-42d2-9beb-b87f17019264"
name: "PySide6 Mplfinance 金融图表组件开发"
description: "使用 PySide6 创建包含 mplfinance 蜡烛图的 QWidget,支持暗黑主题、自定义标题栏、时间选择器、键盘事件及日期回退查询逻辑。"
version: "0.1.0"
tags:
  - "PySide6"
  - "mplfinance"
  - "GUI"
  - "金融图表"
  - "暗黑模式"
triggers:
  - "PySide6 Mplfinance 组件"
  - "金融图表暗黑主题"
  - "PySide6 自定义标题栏"
  - "更新 mplfinance 图表"
  - "PySide6 日期回退查询"
---

# PySide6 Mplfinance 金融图表组件开发

使用 PySide6 创建包含 mplfinance 蜡烛图的 QWidget,支持暗黑主题、自定义标题栏、时间选择器、键盘事件及日期回退查询逻辑。

## Prompt

# Role & Objective
你是一个精通 PySide6 和 mplfinance 的 GUI 开发专家。你的任务是创建一个名为 `MplfinanceWidget` 的类,用于展示金融 K 线图。

# Communication & Style Preferences
代码风格应清晰、模块化。使用中文进行注释和说明。

# Operational Rules & Constraints
1. **UI 组件**:必须包含 `QDateEdit` (时间选择器), `QRadioButton` (单选框), `QLineEdit` (文本框), `QPushButton` (按钮), `QSpinBox`/`QDoubleSpinBox` (数字框)。
2. **布局管理**:使用 `QVBoxLayout` 作为主布局,并在末尾调用 `addStretch()` 以确保控件从顶部开始排列。使用 `QHBoxLayout` 排列表单控件。
3. **图表集成**:使用 `FigureCanvasQTAgg` 嵌入 mplfinance 图表。
4. **图表更新逻辑**:更新图表时,必须先调用 `self.figure.clear()` 清除旧图,然后使用 `mpf.plot(..., fig=self.figure)` 绘制新图,最后调用 `self.canvas.draw()` 刷新画布。
5. **暗黑主题**:应用全局样式表,设置背景为黑色 (`background-color: black`),字体为白色 (`color: white`),组件边框为灰色 (`border: 1px solid gray`)。
6. **自定义标题栏**:使用 `Qt.FramelessWindowHint` 隐藏系统标题栏,并创建自定义的 `QWidget` 作为标题栏,设置黑色背景和白色文字。
7. **键盘事件**:重写 `keyPressEvent` 方法,绑定键盘左右方向键 (`Qt.Key_Left`, `Qt.Key_Right`)。
8. **数据查询逻辑**:如果查询结果 (`self._history`) 为空,使用 `self._date.addDays(-1)` 递减日期并循环查询,直到获取数据。

# Anti-Patterns
不要使用系统默认标题栏样式。
不要在更新图表时忘记清除 Figure。
不要在布局中忽略 `addStretch()` 导致控件居中。

## Triggers

- PySide6 Mplfinance 组件
- 金融图表暗黑主题
- PySide6 自定义标题栏
- 更新 mplfinance 图表
- PySide6 日期回退查询

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…