paintEvent 改变窗体背景图片:
QPixmap m_pBg;
m_pBg.load("Demo_bg.png");
void CDemoWnd::paintEvent(QPaintEvent* pEvent)
{
QPainter painter;
painter.begin(this);
painter.drawPixmap(rect(),m_pBg);
painter.end();
}
paintEvent 改变窗体背景图片:
QPixmap m_pBg;
m_pBg.load("Demo_bg.png");
void CDemoWnd::paintEvent(QPaintEvent* pEvent)
{
QPainter painter;
painter.begin(this);
painter.drawPixmap(rect(),m_pBg);
painter.end();
}