inflearn logo
Khóa học

Khóa học

Chia sẻ kiến thức

Bài viết của laodlhoya

laodlhoya laodlhoya

@laodlhoya1072

Số lượng đánh giá đã viết
-
Xếp hạng trung bình
-

Bài viết 3

Hỏi & Đáp

self.WebView.load 프로그램 종료 관련

이분이랑 같은 현상이신 분은 참고하세요. self.webView.load(QtCore.QUrl(url)) self.webView.load(QtCore.QUrl('about:blank')) 이렇게 하시면 정상작동합니다.

Lượt thích
0
Số bình luận
2
Lượt xem
309

Hỏi & Đáp

클래스 접근이 어려워요ㅠ 도와주세요

아래 처럼 main 에서는 조절이 가능합니다. 그런데 Form2.py 에서 조절이 안됩니다 ㅠㅠㅠ import sys , Form , Form2 from PyQt5.QtWidgets import QWidget , QApplication class MainWindow(QWidget , Form.Ui_Form): def __init__ ( self ): super (). __init__ () self .setupUI() # Form2.camera_set() # self.set_resize(200, 200) self .pb1.resize( 200 , 200 ) if __name__ == "__main__" : app = QApplication(sys.argv) form = MainWindow() form.show() app.exec_()

Lượt thích
0
Số bình luận
4
Lượt xem
392

Hỏi & Đáp

클래스 접근이 어려워요ㅠ 도와주세요

import sys , Form , Form2 from PyQt5.QtWidgets import QWidget , QApplication class MainWindow(QWidget , Form.Ui_Form): def __init__ ( self ): super (). __init__ () self .setupUI() Form2.camera_set() # self.set_resize(200, 200) if __name__ == "__main__" : app = QApplication(sys.argv) form = MainWindow() form.show() app.exec_()from PyQt5.QtWidgets import QPushButton class Ui_Form( object ): def setupUI ( self ): self .pb1 = QPushButton( 'test' , self ) # self.pb1.resize(200, 200) def set_resize ( self , width , height): self .pb1.resize(width , height)from Form import Ui_Form class camera_set(): def __init__ ( self ): Ui_Form.pb1.resize( 200 , 200 ) Traceback (most recent call last): File "D:/Research/Python/screen_shot/main3.py", line 14, in form = MainWindow() File "D:/Research/Python/screen_shot/main3.py", line 9, in __init__ Form2.camera_set() File "D:\Research\Python\screen_shot\Form2.py", line 6, in __init__ Ui_Form.pb1.resize(200, 200) AttributeError: type object 'Ui_Form' has no attribute 'pb1' Process finished with exit code 1 고쳣는데...이렇게 오류가 납니다 ㅠㅠ

Lượt thích
0
Số bình luận
4
Lượt xem
392