mirror of
https://github.com/zhuzichu520/FluentUI.git
synced 2024-11-01 00:27:32 +08:00
28 lines
610 B
C++
28 lines
610 B
C++
|
#include "FluentUI.h"
|
|||
|
|
|||
|
#include <QPainter>
|
|||
|
|
|||
|
FluentUI::FluentUI(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);
|
|||
|
}
|
|||
|
|
|||
|
void FluentUI::paint(QPainter *painter)
|
|||
|
{
|
|||
|
QPen pen(QColorConstants::Red, 2);
|
|||
|
QBrush brush(QColorConstants::Red);
|
|||
|
|
|||
|
painter->setPen(pen);
|
|||
|
painter->setBrush(brush);
|
|||
|
painter->drawRect(0, 0, 100, 100);
|
|||
|
}
|
|||
|
|
|||
|
FluentUI::~FluentUI()
|
|||
|
{
|
|||
|
}
|