QPen pen(Qt::black); pen.setStyle(Qt::SolidLine);
QPen pen(Qt::red); pen.setStyle(Qt::DashLine);
QPen pen(Qt::blue); pen.setStyle(Qt::DashDotLine);This code creates a QPen object with a blue color and sets the pen style to a dash-dot line. These examples use the Qt C++ library.