⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 drawwidget.h

📁 linux窗口程序设计一书的第五章代码-- 图形与图画,希望对大家有用
💻 H
字号:
#ifndef DRAWWIDGET_H
#define DRAWWIDGET_H

#include <QWidget>

class QPoint;
class QPixmap;
class QColor;

class DrawWidget : public QWidget
{
    Q_OBJECT
public:
    DrawWidget();
    
    void mousePressEvent(QMouseEvent *);
    void mouseMoveEvent(QMouseEvent *);
    
    void paintEvent(QPaintEvent *);
    void resizeEvent(QResizeEvent *);

public slots:   
    void setStyle(int);
    void setWidth(int);
    void setColor(QColor);
    void clear();
    
private:
    QPixmap *pix;
    QPoint startPos; 
    QPoint endPos;
    int style;
    int weight;
    QColor color;
};

#endif 

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -