#include "myitem.h"
#include <QPainter>
MyItem::MyItem(QQuickItem *parent)
: QQuickPaintedItem(parent)
{
// By default, QQuickItem does not draw anything. If you subclass
// QQuickItem to create a visual item, you will need to uncomment the
// following line and re-implement updatePaintNode()
// setFlag(ItemHasContents, true);
}
MyItem::~MyItem()
{
}
QString MyItem::name() const
{
return m_name;
}
void MyItem::setName(const QString &name)
{
m_name = name;
}
QColor MyItem::color() const
{
return m_color;
}
void MyItem::setColor(const QColor &color)
{
m_color = color;
}
void MyItem::paint(QPainter *painter)
{
QPen pen(m_color, 2);
painter->setPen(pen);
painter->setRenderHints(QPainter::Antialiasing, true);
painter->drawPie(boundingRect().adjusted(1, 1, -1, -1), 90 * 16, 290 * 16);
}
void MyItem::clearChart()
{
setColor(QColor(Qt::transparent));
update();
emit chartCleared();
}
没有合适的资源?快使用搜索试试~ 我知道了~
qml扩展插件的创建与使用(仅C++插件) 测试源码
共10个文件
cpp:3个
h:2个
pro:2个
1.该资源内容由用户上传,如若侵权请联系客服进行举报
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
版权申诉
5星 · 超过95%的资源 3 下载量 85 浏览量
2022-05-31
15:01:36
上传
评论
收藏 3KB 7Z 举报
温馨提示
qml扩展插件的创建与使用(仅C++插件) 测试源码 https://blog.csdn.net/aggs1990/article/details/125060721 CSDN审核可能较慢,如无法下载,可以过段时间再回来看下 仅供相关爱好者交流使用,请于下载24小时内删除
资源推荐
资源详情
资源评论
收起资源包目录
qmlplugin.7z (10个子文件)
qmlplugindemo
main.cpp 1007B
qmlplugindemo.pro 744B
qml.qrc 92B
main.qml 289B
qmlplugintest
myitem.cpp 1014B
qmlplugintest_plugin.cpp 239B
myitem.h 748B
qmldir 58B
qmlplugintest.pro 887B
qmlplugintest_plugin.h 330B
共 10 条
- 1
资源评论
- microsoft21802022-07-27果断支持这个资源,资源解决了当前遇到的问题,给了新的灵感,感谢分享~
- m0_378574052022-10-18这个资源值得下载,资源内容详细全面,与描述一致,受益匪浅。
- JessZS2022-07-15果断支持这个资源,资源解决了当前遇到的问题,给了新的灵感,感谢分享~
꧁白杨树下꧂
- 粉丝: 678
- 资源: 192
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功