摘要: ***.h:#include <QPoint>#include <QMouseEvent>class xxx{……void mousePressEvent(QMouseEvent *event);void mouseMoveEvent(QMouseEvent *envet);private:QPoint relativePos; // store relative position ……}***.cppvoid Desktop::mousePressEvent(QMouseEvent *event){relativePos=this->pos()-event-&g 阅读全文
posted @ 2012-03-12 16:13 G背包 阅读(4356) 评论(0) 推荐(0) 编辑
摘要: /** set background image*/QPixmap bgImages(":/images/bg.png");QPalette bgPalette = this->palette();bgPalette.setBrush(QPalette::Background,bgImages);this->setPalette(bgPalette);setMask(bgImages.mask());// set background mask attribute same as background's image先上代码,这里作说明。1)将该段代码放 阅读全文
posted @ 2012-03-12 16:01 G背包 阅读(3050) 评论(1) 推荐(1) 编辑