[SOLVED] CS代考计算机代写 #ifndef CANVASWIDGET_H

30 $

File Name: CS代考计算机代写_#ifndef_CANVASWIDGET_H.zip
File Size: 433.32 KB

SKU: 0986408877 Category: Tags: , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , ,

Or Upload Your Assignment Here:


#ifndef CANVASWIDGET_H
#define CANVASWIDGET_H

#include
class QImage;
#include “airbrush.h”
#include “image.h”

class CanvasWidget : public QWidget
{
Q_OBJECT
public:
explicit CanvasWidget(QWidget *parent = nullptr);

bool loadFromPath( const QString& path );
bool saveToPath( const QString& path );

bool isModified() const { return modified; }
QColor getColor() const { return color; }
QImage getBrushImage() const;

signals:
void brushChanged( const QImage& brushImage ) const;

public slots:
void clear();
void setRadius(int r);
void setFlowRate(int f);
void setShape(const QString& str);
void setColor(const QColor& c);

protected:
void mousePressEvent(QMouseEvent *event) override;
void mouseMoveEvent(QMouseEvent *event) override;
void mouseReleaseEvent(QMouseEvent *event) override;
void paintEvent(QPaintEvent *event) override;
void resizeEvent(QResizeEvent *event) override;
void timerEvent(QTimerEvent *event) override;

private:
void brushAt(const QPoint &point);
void updateBrushImage();

bool modified;

graphics101::Image image;
graphics101::Image airbrush_image;

int radius;
QColor color;
int flowRate;
graphics101::AirBrushShape shape;

int flowRateTimerID;
bool painting;
QPoint lastPos;
};

#endif // CANVASWIDGET_H

Reviews

There are no reviews yet.

Only logged in customers who have purchased this product may leave a review.

Shopping Cart
[SOLVED] CS代考计算机代写 #ifndef CANVASWIDGET_H
30 $