• 大小: 206KB
    文件类型: .rar
    金币: 1
    下载: 0 次
    发布日期: 2021-06-11
  • 语言: 其他
  • 标签: Qt  

资源简介

功能: * 笔头绘图 * 多边形绘图 * 多边形图形删除、移动 * 橡皮擦(只允许擦除笔头绘图) * 线宽、线色、背景色 * 撤销、清空 * 保存、列表,打开列表后可继续作画 * 简易加密 编译环境: Qt12.4 Mingw exe下载: 链接:https://pan.baidu.com/s/17-i3uIK9XxqUBWVWXOi4kw 提取码:dt6y ----微信搜索"Qt_io_"或"Qt开发者中心"关注Qt微信公众号,获取源码并了解更多关于Qt开发知识 (笔者 - jxd)

资源截图

代码片段和文件信息

#include “ColorWidget.h“
#include “ui_ColorWidget.h“

ColorWidget::ColorWidget(const QColor &crQWidget *parent) :
    QWidget(parent)
    ui(new Ui::ColorWidget)
{
    ui->setupUi(this);

    color = cr;

    init();
}

ColorWidget::~ColorWidget()
{
    delete ui;
}

QColor ColorWidget::GetColor()
{
    return color;
}

void ColorWidget::init()
{
    if(color == COLORS::COLOR_Black)
        on_Button_Black_clicked();
    else if(color == COLORS::COLOR_Gray)
        on_Button_Gray_clicked();
    else if(color == COLORS::COLOR_Green)
        on_Button_Green_clicked();
    else if(color == COLORS::COLOR_Red)
        on_Button_Red_clicked();
    else if(color == COLORS::COLOR_Orangle)
        on_Button_Orangle_clicked();
    else if(color == COLORS::COLOR_White)
        on_Button_White_clicked();
    else if(color == COLORS::COLOR_Blue)
        on_Button_Blue_clicked();
    else if(color == COLORS::COLOR_Purple)
        on_Button_Purple_clicked();
    else if(color == COLORS::COLOR_Yellow)
        on_Button_Yellow_clicked();
    else if(color == COLORS::COLOR_Brown)
        on_Button_Brown_clicked();
}

void ColorWidget::on_Button_Black_clicked()
{
    color = COLORS::COLOR_Black;

    ui->Button_Black->setstyleSheet(“border-image: url(:/Color/Resource/Color_Black_Big.png);“);
    ui->Button_Gray->setstyleSheet(“border-image: url(:/Color/Resource/Color_Gray_Small.png);“);
    ui->Button_Green->setstyleSheet(“border-image: url(:/Color/Resource/Color_Green_Small.png);“);
    ui->Button_Red->setstyleSheet(“border-image: url(:/Color/Resource/Color_Red_Small.png);“);
    ui->Button_Orangle->setstyleSheet(“border-image: url(:/Color/Resource/Color_Orangle_Small.png);“);
    ui->Button_White->setstyleSheet(“border-image: url(:/Color/Resource/Color_White_Small.png);“);
    ui->Button_Blue->setstyleSheet(“border-image: url(:/Color/Resource/Color_Blue_Small.png);“);
    ui->Button_Purple->setstyleSheet(“border-image: url(:/Color/Resource/Color_Purple_Small.png);“);
    ui->Button_Yellow->setstyleSheet(“border-image: url(:/Color/Resource/Color_Yellow_Small.png);“);
    ui->Button_Brown->setstyleSheet(“border-image: url(:/Color/Resource/Color_Brown_Small.png);“);

    emit ColorChange();
}

void ColorWidget::on_Button_Gray_clicked()
{
    color = COLORS::COLOR_Gray;

    ui->Button_Black->setstyleSheet(“border-image: url(:/Color/Resource/Color_Black_Small.png);“);
    ui->Button_Gray->setstyleSheet(“border-image: url(:/Color/Resource/Color_Gray_Big.png);“);
    ui->Button_Green->setstyleSheet(“border-image: url(:/Color/Resource/Color_Green_Small.png);“);
    ui->Button_Red->setstyleSheet(“border-image: url(:/Color/Resource/Color_Red_Small.png);“);
    ui->Button_Orangle->setstyleSheet(“border-image: url(:/Color/Resource/Color_Orangle_Small.png);“);
    ui->Button_White->setstyleSheet(“border-image: url(:/Color/Resource/Color_White_Small.png);“);
    ui->Button_Blue->setstyleSheet(“borde

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----

     文件      12305  2019-08-07 13:59  NewWhiteBoard\ColorWidget.cpp

     文件        841  2019-08-07 13:59  NewWhiteBoard\ColorWidget.h

     文件       8085  2019-08-07 10:21  NewWhiteBoard\ColorWidget.ui

     文件       2598  2019-08-08 14:27  NewWhiteBoard\global.h

     文件        189  2019-08-06 14:55  NewWhiteBoard\main.cpp

     文件      10830  2019-08-08 14:39  NewWhiteBoard\NewWhiteBoard.cpp

     文件       1506  2019-08-08 14:26  NewWhiteBoard\NewWhiteBoard.h

     文件       1958  2019-08-08 10:25  NewWhiteBoard\NewWhiteBoard.pro

     文件      25004  2019-08-12 09:06  NewWhiteBoard\NewWhiteBoard.pro.user

     文件      25006  2019-08-08 14:56  NewWhiteBoard\NewWhiteBoard.pro.user.21

     文件      24555  2019-08-08 14:58  NewWhiteBoard\NewWhiteBoard.pro.user.4.8-pre1

     文件      11241  2019-08-08 14:43  NewWhiteBoard\NewWhiteBoard.ui

     文件       2879  2019-08-07 18:14  NewWhiteBoard\PaintListWidget.cpp

     文件        655  2019-08-07 18:14  NewWhiteBoard\PaintListWidget.h

     文件       2084  2019-08-07 17:17  NewWhiteBoard\PaintListWidget.ui

     文件      21510  2019-08-09 09:20  NewWhiteBoard\PaintWidget.cpp

     文件       1923  2019-08-08 10:45  NewWhiteBoard\PaintWidget.h

     文件       1745  2019-08-07 14:57  NewWhiteBoard\PloygonWidget.cpp

     文件        714  2019-08-07 14:57  NewWhiteBoard\PloygonWidget.h

     文件       3020  2019-08-07 10:21  NewWhiteBoard\PloygonWidget.ui

     文件       1054  2019-08-08 11:52  NewWhiteBoard\Resource\Background_1.png

     文件       3603  2019-08-08 12:09  NewWhiteBoard\Resource\Background_2.png

     文件       1586  2019-08-08 13:40  NewWhiteBoard\Resource\clearCurve_1.png

     文件       3857  2019-08-08 13:44  NewWhiteBoard\Resource\clearCurve_2.png

     文件       4609  2019-07-31 11:47  NewWhiteBoard\Resource\close.png

     文件       1215  2019-08-08 14:17  NewWhiteBoard\Resource\close_1.png

     文件       4092  2019-08-08 14:19  NewWhiteBoard\Resource\close_2.png

     文件       3230  2019-08-08 11:49  NewWhiteBoard\Resource\color_1.png

     文件       3634  2019-08-08 11:51  NewWhiteBoard\Resource\color_2.png

     文件       2906  2019-08-07 10:46  NewWhiteBoard\Resource\Color_Black_Big.png

............此处省略67个文件信息

评论

共有 条评论