
IT/파이썬 2021. 2. 2.
파이썬 윈도우 크기와 포지션 정보 가져오기 및 세팅하기
파이썬 윈도우 크기와 위치를 저장해 뒀다가 새로 시작할 때 가져올려 몇가지 검색.. 그런데 너무 쉽게 되어 있어서 쓸 게 없을 정도. 왜 딱 바로 안찾아 지는지 모르지만 QMainWindow 에서 만든 파이썬 응용 같으면 아주 쉽다. close 할때 이벤트에서 아래 정보를 저장하는 코드이다. 위치는 간단하게 .x(), .y() 크기도 간단하게 .width(), .height() 로 아주 손쉽게 정보를 가져올 수 있다. # close event 처리 def closeEvent(self, ev): if QMessageBox.question(self, 'Closing', 'Really close?') == QMessageBox.Yes: # # 이상하게 사이즈가 2px 크게 나오네.. # width = self..
