import sys
from PyQt4.QtGui import *
from PyQt4.Qt import *
from PyQt4.QtCore import *
class AboutUsDialog(QDialog):
def __init__(self):
super(AboutUsDialog,self).__init__()
self.setWindowFlags(Qt.FramelessWindowHint|Qt.Dialog)
def mousePressEvent(self, e):
if e.button()==Qt.LeftButton:
self.move1=e.globalPos()-self.frameGeometry().topLeft()
QApplication.postEvent(self,QEvent(174))
e.accept()
def mouseMoveEvent(self, e):
if e.buttons()==Qt.LeftButton:
self.move(e.globalPos()-self.move1)
e.accept()
app = QApplication(sys.argv)
aboutus = AboutUsDialog()
aboutus.show()
sys.exit(app.exec_())
如图:
时间: 2024-11-14 03:13:42