import sys
from PyQt5.QtWidgets import *
def on_click():
print("ok1")
print("widget.x()=%d" %widget.x()) #250 窗口横坐标
print("widget.y()=%d" %widget.y()) #200 窗口纵坐标
print("widget.width()=%d" % widget.width()) #300 工作区宽度
print("ok2")
print("widget.geometry.x()=%d" % widget.geometry().x()) # 250 工作区横坐标
print("widget.geometry.y()=%d" % widget.geometry().y()) #222 工作区纵坐标
print("widget.width()=%d" % widget.width())
print("ok3")
print("widget.framegeometry.x()=%d" % widget.frameGeometry().x())
print("widget.framegeometry.y()=%d" % widget.frameGeometry().y())
print("widget.width()=%d" % widget.frameGeometry().width()) # 窗口宽度
App = QApplication(sys.argv)
widget = QWidget()
btn =QPushButton(widget)
btn.setText("按钮")
btn.move(20,30)
btn.clicked.connect(on_click)
widget.resize(300,300)
widget.move(250,200)
widget.setWindowTitle("屏幕坐标系")
widget.show()
sys.exit(App.exec_())
python 坐标转换包 python 坐标系
转载本文章为转载内容,我们尊重原作者对文章享有的著作权。如有内容错误或侵权问题,欢迎原作者联系我们进行内容更正或删除文章。
提问和评论都可以,用心的回复会被更多人看到
评论
发布评论
相关文章
-
谷歌地球引擎:实现坐标系转换与重投影的方法
本文主要对GEE中地理坐标系与投影坐标系的转换、重投影等操作加以介绍。本文是谷歌地球引擎(Google Earth Engine,GEE)系列教学文章的第十三篇~
谷歌地球引擎 Earth Engine JavaScript 坐标系 投影 -
世界坐标系,相机坐标系和图像坐标系的转换(Python)
世界坐标系,相机坐标系和图像坐标系的转换(Python)相机内参外参说明:http
世界坐标系 相机坐标系 图像坐标系 3d python