---
# System prepended metadata

title: 取得螢幕尺寸
tags: [PyQt5]

---

取得螢幕尺寸
===

```python
# 回傳整個螢幕的位置和大小的QRect物件 (x, y, w, h)
screen = QtGui.QDesktopWidget().screenGeometry()

screen.width()
screen.height()
```

## Ref.

[視窗操作](https://codertw.com/%E7%A8%8B%E5%BC%8F%E8%AA%9E%E8%A8%80/446416/)





###### tags: `PyQt5`