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还没做

相关推荐
galaxy_strive1 小时前
qtc++ qdebug日志生成
开发语言·c++·qt
TNTLWT1 小时前
Qt功能区:简介与安装
开发语言·qt
凯雀安全9 小时前
printspoofer的RPC调用接口的简单代码
qt·网络协议·rpc
六bring个六10 小时前
文件系统交互实现
开发语言·c++·qt·交互
__BMGT()11 小时前
C++ QT图片查看器
前端·c++·qt
chilavert31815 小时前
从RPA项目说说RPC和MQ的使用。
开发语言·qt·rpc·rabbitmq
Smile丶凉轩1 天前
Qt 界面优化(绘图)
开发语言·数据库·c++·qt
charlie1145141911 天前
基于Qt6 + MuPDF在 Arm IMX6ULL运行的PDF浏览器——MuPDF Adapter文档
arm开发·qt·学习·pdf·教程·设计·qt6
电信2301杨臣1 天前
QT---信号与槽
开发语言·qt