查看完整版本: [-- C++ Qt中setBrush我只发现了一种实现方式,为何以下语句中有两种? --]

QTCN开发网 -> Qt基础编程 -> C++ Qt中setBrush我只发现了一种实现方式,为何以下语句中有两种? [打印本页] 登录 -> 注册 -> 回复主题 -> 发表主题

ceiwei 2017-02-10 14:52

C++ Qt中setBrush我只发现了一种实现方式,为何以下语句中有两种?

painter.setBrush(QBrush(Qt::blue,Qt::Dense3Pattern))

painter.setBrush(Qt::blue)

Qt帮助文档是这样的:

void QPainter::setBrush(const QBrush &brush)
Sets the painter's brush to the given brush.
The painter's brush defines how shapes are filled.
See also brush() and Settings.
void QPainter::setBrush(Qt::BrushStyle style)
This is an overloaded function.
Sets the painter's brush to black color and the specified style.

steinlee 2017-02-10 17:16
一样的。第二个是有default settings.第一个你可以设置你喜欢的


查看完整版本: [-- C++ Qt中setBrush我只发现了一种实现方式,为何以下语句中有两种? --] [-- top --]



Powered by phpwind v8.7 Code ©2003-2011 phpwind
Gzip disabled