• 7330阅读
  • 4回复

请教:怎么在paintEvent()函数外使用QPainter? [复制链接]

上一主题 下一主题
离线huyoujun
 

只看楼主 正序阅读 楼主  发表于: 2008-04-02
— 本帖被 XChinux 执行加亮操作(2008-04-03) —
如题.最好给出示范代码,谢谢先.
离线huyoujun

只看该作者 4楼 发表于: 2008-04-03
太复杂了,算了,我绕路走
离线jollygrass

只看该作者 3楼 发表于: 2008-04-03
你可以看一看QT中QWidget::repaint的实现.
如QT3.12中:
void QWidget::repaint( const QRegion& reg, bool erase )
{
    if ( (widget_state & (WState_Visible|WState_BlockUpdates)) == WState_Visible && isVisible() ) {
    if ( erase )
        this->erase(reg);
    QPaintEvent e( reg, erase );
    qt_set_paintevent_clipping( this, reg );
    QApplication::sendEvent( this, &e );
    qt_clear_paintevent_clipping();
    }
}
离线newtype
只看该作者 2楼 发表于: 2008-04-03
尝试看看QWidget::setAttribute(Qt::WA_PaintOutsidePaintEvent)
离线mumutouv

只看该作者 1楼 发表于: 2008-04-02
我也不太清楚,
在paintEvent外部使用QPainter painter(this)不行
快速回复
限100 字节
 
上一个 下一个