第6章Qt5图形与图画试题.ppt

6.2.3 主窗口的实现 ShowFillRule()槽函数的具体实现代码如下: void MainWidget::ShowFillRule() { Qt::FillRule rule = Qt::FillRule(fillRuleComboBox-itemData( fillRuleComboBox-currentIndex(),Qt::UserRole).toInt()); paintArea-setFillRule(rule); } ShowSpreadStyle()槽函数的具体实现代码如下: void MainWidget::ShowSpreadStyle() { spread = QGradient::Spread(spreadComboBox-itemData( spreadComboBox-currentIndex(),Qt::UserRole).toInt()); } 6.2.3 主窗口的实现 ShowBrushColor()槽函数,与设置画笔颜色函数类似,但选定颜色后并不直接调用PaintArea对象的setBrush()函数,而是调用ShowBrush()函数设置显示区的画刷属性,具体实现代码如下: void MainWidget::ShowBrushColor() { QColor color =

文档评论(0)

1亿VIP精品文档

相关文档