Qt无边框,可移动窗口

时间:2014-05-01 04:14:18   收藏:0   阅读:464



QPoint dragPosition;




void MainWindow::mousePressEvent(QMouseEvent *event)
{
if(event->button()==Qt::LeftButton)
{
dragPosition=event->globalPos()-frameGeometry().topLeft();
event->accept();
}
}
void MainWindow::mouseMoveEvent(QMouseEvent *event)
{
if(event->buttons()&&Qt::LeftButton)
{
move(event->globalPos()-dragPosition);
event->accept();
}
}


setStyleSheet("QProgressBar{border:none;background:rgb(210,225,240);border-radius:3px;text-align:center;}QProgressBar::chunk{background:rgb(60,140,220);border-radius:3px;}");


bubuko.com,布布扣


Qt无边框,可移动窗口,布布扣,bubuko.com

评论(0
© 2014 mamicode.com 版权所有 京ICP备13008772号-2  联系我们:gaon5@hotmail.com
迷上了代码!