Qt画虚线

mainwindow.cpp

cpp 复制代码
{
    QComboBox *comboBox_penStyle = new QComboBox;
    QStringList SL_penStyle;
    SL_penStyle << "______" << "----------" << ".........." << "-.-.-.-.-." << "-..-..-..-.." << "CustomDashLine";
    comboBox_penStyle->addItems(SL_penStyle);
    ui->mainToolBar->addWidget(comboBox_penStyle);
    connect(comboBox_penStyle, SIGNAL(currentIndexChanged(int)), this, SLOT(comboBox_penStyle_changed(int)));
}

void MainWindow::comboBox_penStyle_changed(int index)
{
    Qt::PenStyle ps = static_cast<Qt::PenStyle>(index + 1);
    imageWidget->pen.setStyle(ps);
}

CustomDashLine还没做

相关推荐
蓝天智能2 小时前
立体字型效果的Qt QSS实现
开发语言·qt
得鹿梦鱼、4 小时前
QT案例 记录使用Halcon机器视觉的深度学习实现猫狗图像二分类
qt·halcon·猫狗图像二分类
q***235711 小时前
RabbitMQ介绍以及基本使用
qt·rabbitmq·ruby
王宪笙12 小时前
Qt之数据库使用示例
数据库·qt
Jonathan Star15 小时前
JSON-RPC 2.0 详解
qt·rpc·json
一只爱学习的小鱼儿16 小时前
QT中3D的使用
开发语言·数据库·qt
FL162386312918 小时前
Qt自定义控件之仪表盘和水波纹圆形进度条的完整实现
开发语言·qt
开始了码20 小时前
QT::对话框:字体对话框3
qt
rainbow_lucky01061 天前
Word-like编辑器
qt·编辑器·word-like
开始了码1 天前
QT::对话框:颜色对话框2
qt