Try this to move the window manually:
void PopupWindow::mousePressEvent(QMouseEvent *event){
mpos = event->pos();
}
void PopupWindow::mouseMoveEvent(QMouseEvent *event){
if (event->buttons() & Qt::LeftButton) {
QPoint diff = event->pos() - mpos;
QPoint newpos = this->pos() + diff;
this->move(newpos);
}
}
And declare QPoint mpos
somewhere.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…