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 小时前
VS2015 调用QT5.9.9 的库文件 需要设置QT库的路径
开发语言·qt
feiyangqingyun2 小时前
Qt/C++地图最简示例/在线离线切换/地图视图切换/执行各种js函数交互
javascript·c++·qt
翻斗花园牛图图-3 小时前
Qt开发——系统相关3(Qt网络编程)
开发语言·qt
开始了码4 小时前
Qt:: 事件过滤器实战:图片点击缩放交互实现(含 QMatrix 详解)
qt
秦jh_4 小时前
【Qt】Qt 概述
开发语言·qt
韭菜钟17 小时前
在Qt中使用QuickJS
开发语言·qt
枫叶丹417 小时前
【Qt开发】Qt窗口(三) -> QStatusBar状态栏
c语言·开发语言·数据库·c++·qt·microsoft
t***316520 小时前
QT开发:事件循环与处理机制的概念和流程概括性总结
开发语言·qt
四维碎片1 天前
【Qt】OpenGL渲染框架
qt·opengl
西游音月1 天前
(10)功能实现:Qt实战项目之新建项目对话框
开发语言·qt