摘要:
***.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 阅读全文
摘要:
/** 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)将该段代码放 阅读全文