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

相关推荐
fzb5QsS1p1 天前
告别重复造轮子,Qt 快速开发脚手架
开发语言·qt·php
森G1 天前
58、最佳实践与注意事项---------多线程、竟态条件和同步
c++·qt
小樱花的樱花1 天前
1 项目概述
开发语言·c++·qt·ui
MinterFusion1 天前
如何在openKylin 2.0 SP2中安装Qt(v0.2.2)(上)
开发语言·qt·软件开发·系统维护·明德融创·openkylin
特立独行的猫a1 天前
HarmonyOS鸿蒙PC的QT应用开发:(一、开发环境搭建及第一个HelloWorld)
qt·华为·harmonyos·鸿蒙pc
青花瓷1 天前
采用QT下MingW编译opencv4.8.1
开发语言·qt
cpp_learners1 天前
Linux ARM架构 使用 linuxdeployqt 打包QT程序
linux·arm开发·qt
森G1 天前
3.1、移植Qt程序到ARM平台----移植Qt程序到ARM平台(扩展)
arm开发·c++·qt
白杆杆红伞伞1 天前
Qt Event
开发语言·qt
Magic--1 天前
Qt 桌面计算器项目
开发语言·qt