광주인력개발원

여름 휴가 정보제공 프로그램 개발 - 1일차 - [2023-07-04 개발일지]

플광 2023. 7. 9. 16:20

 

팀 개발일지와 중복되는 내용은 작성하지 않겠습니다.

 

 

 

금일 개발 내용:

 

QWebEngineView 를 상속받는 BetterWebView 를 만들어 mousepress event를 활용하려 해보았으나 실제 좌표(경도, 위도)를 계산하여 지도에 표시하는 알고리즘을 설계하는 업무는 노력 대비 얻는 소득이 적어 다른 방식으로 요구사항 구현하기로 결정

 

class BetterWebView(QWebEngineView):
    def __init__(self):
        super().__init__()
        self.load(QtCore.QUrl())
        self.focusProxy().installEventFilter(self)

    def eventFilter(self, source, event):
        if (
                self.focusProxy() is source
                and event.type() == QtCore.QEvent.MouseButtonPress
        ):
            event: QtGui.QMouseEvent
            print('x', event.x(), end=', ')
            print('y', event.y())
        return super().eventFilter(source, event)

 

배너 사이즈가 300ms 동안 줄어드는 애니메이션 생성함

 

 

    def check_visible_widget(self, value):
        now_state = self.widget_banner.isVisible()
        if now_state != value:
            return True
        else:
            return False

    def show_banners(self, value):
        if not self.check_visible_widget(value):
            return
        if value is False:
            self.animation = QPropertyAnimation(self.widget_banner, b"size")
            self.animation.setDuration(300)
            self.animation.setStartValue(QSize(MainWindow.BANNER_WIDTH, self.widget_banner.height()))
            self.animation.setEndValue(QSize(0, self.widget_banner.height()))
            self.animation.start()
            self.animation_timer.singleShot(300, lambda: self.widget_banner.setVisible(False))
            # self.widget_banner.setVisible(False)
        else:
            # self.widget_banner.hide()
            self.animation = QPropertyAnimation(self.widget_banner, b"size")
            self.animation.setDuration(300)
            self.animation.setStartValue(QSize(0, self.widget_banner.height()))
            self.animation.setEndValue(QSize(MainWindow.BANNER_WIDTH, self.widget_banner.height()))
            self.animation.start()
            self.animation_timer.singleShot(0, lambda: self.widget_banner.setVisible(True))
            # self.widget_banner.setVisible(True)

 

git fetch, detached head 문제:

git이 원래 최초 흐름에서 변동되는 사항만 commit을 통해 최종 결과물이 나오는 구조임. 그래서 중간에 fetch를 하거나 checkout을 한 상태에서 작업을 해버리면, 메인 head에서 떨어져나가 변경사항을 반영하지 못하는 문제가 발생함

-> 파이참에서는 파일이 손실될 수 있다고 경고를 날리는데 무시하면, 큰 대가를 치르게 될 것임

-> 그래도 저번 팀프로젝트에서 git을 먼저 활용하신 시연이형님 의견에 의하면 이런 문제를 예방하기 위해 fork와 branch를 배제하고 pull 과 push를 통해서만 작업을 하고, 다른 사람이 같은 파일을 절대 건드리지 않는 내부의 룰이 있었다고 한다.

-> 파일 버전 관리 프로그램인 줄로만 알았더니 증발 삭제해줄 수도 있다는 것을 알게 되었으니, 백업을 두어 주의하면서 이것저것 테스트를 잘 해봐야겠다는 생각이 든다.

 

감사합니다.