분류 전체보기408 The Model View Architecture — Model View Controller https://doc.qt.io/qt-5/model-view-programming.html#model-classes Model View Architecture As you start to build more complex applications with PyQt6 you’ll likely come across issues keeping widgets in sync with your data. Data stored in widgets (e.g. a simple QListWidget) is not easy to manipulate from Python — changes require you to get an item, get the data, and then set it back. The default so.. 2023. 3. 13. Qt Style Sheets (QSS) https://doc.qt.io/qtforpython/overviews/stylesheet-examples.html Qt Style Sheets Examples - Qt for Python Copyright © 2022 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 (https://www.gn doc.qt.io https://github.com/topics/.. 2023. 3. 13. Icons 15. Icons Icons are small pictures which are used to aid navigation or understanding within a user interface. They are commonly found on buttons, either alongside or in place of text, or alongside actions in menus. By using easily recognizable indicators you can make your interface easier to use. In PyQt6 you have a number of different options for how to source and integrate icons into your appl.. 2023. 3. 13. Palettes Qt에서 사용자 인터페이스를 그리는 데 사용되는 색상 선택을 팔레트라고합니다. 응용 프로그램 수준과 위젯 별 팔레트는 모두 QPalette 개체를 통해 관리됩니다. 팔레트는 응용 프로그램 수준과 위젯 수준 모두에서 설정할 수 있으므로 전역 표준 팔레트를 설정하고 위젯별로 이를 재정의할 수 있습니다. 전역 팔레트는 일반적으로 Qt 테마 (일반적으로 OS에 따라 다름)에 의해 정의되지만이를 재정의하여 전체 앱의 모양을 변경할 수 있습니다. 활성 전역 팔레트는 QApplication.palette() 에서 액세스하거나 새로운 빈 QPalette 인스턴스를 만들어 액세스 할 수 있습니다. 예를 들면 다음과 같습니다. from PyQt6.QtGui import QPalette palette = QPalette().. 2023. 3. 13. Styles Styles 스타일은 Qt가 응용 프로그램의 모양과 느낌을 광범위하게 변경하고 위젯이 표시되고 동작하는 방식을 수정하는 방법입니다. Qt는 특정 플랫폼에서 애플리케이션을 실행할 때 플랫폼별 스타일을 자동으로 적용하기 때문에 애플리케이션이 macOS에서 실행될 때 macOS 애플리케이션처럼 보이고 Windows에서 Windows 애플리케이션을 실행할 때 응용 프로그램이 macOS 응용 프로그램처럼 보입니다. 이러한 플랫폼별 스타일은 호스트 플랫폼에서 기본 위젯을 사용하므로 다른 플랫폼에서는 사용할 수 없습니다. 그러나 플랫폼 스타일이 응용 프로그램의 스타일을 지정하는 유일한 옵션은 아닙니다. Qt는 또한 Fusion이라는 크로스 플랫폼 스타일과 함께 제공되어 애플리케이션에 일관된 크로스 플랫폼, 현대적인 .. 2023. 3. 13. Qt Designer Loading your .ui file in Python designer/example_1.py import os import sys from PyQt6 import QtWidgets, uic basedir = os.path.dirname(__file__) app = QtWidgets.QApplication(sys.argv) window = uic.loadUi(os.path.join(basedir, "mainwindow.ui")) window.show() app.exec() To load a UI from the __init__ block of an existing widget (e.g. a QMainWindow) you can use uic.loadUI(filename, self). designer/e.. 2023. 3. 13. Events 10. Events 사용자가 Qt 응용 프로그램과 갖는 모든 상호 작용은 이벤트입니다. 여러 유형의 이벤트가 있으며 각 이벤트는 서로 다른 유형의 상호 작용을 나타냅니다. Qt는 일어난 일에 대한 정보를 패키지화하는 이벤트 객체를 사용하여 이러한 이벤트를 나타냅니다. 이러한 이벤트는 상호 작용이 발생한 위젯의 특정 이벤트 처리기로 전달됩니다. 사용자 지정 이벤트 처리기를 정의하면 위젯이 이러한 이벤트에 응답하는 방식을 변경할 수 있습니다. 이벤트 처리기는 다른 메서드와 마찬가지로 정의되지만 이름은 처리하는 이벤트 유형에 따라 다릅니다. 위젯이 수신하는 주요 이벤트 중 하나는 QMouseEvent 입니다. QMouseEvent 이벤트는 위젯의 모든 마우스 움직임과 버튼 클릭에 대해 생성됩니다. 다음 이벤트.. 2023. 3. 13. Windows 2023. 3. 13. Windows Creating a new window basic/windows_1.py import sys from PyQt6.QtWidgets import ( QApplication, QLabel, QMainWindow, QPushButton, QVBoxLayout, QWidget, ) class AnotherWindow(QWidget): """ This "window" is a QWidget. If it has no parent, it will appear as a free-floating window. """ def __init__(self): super().__init__() layout = QVBoxLayout() self.label = QLabel("Another Window") layout.addWidge.. 2023. 3. 13. 이전 1 ··· 32 33 34 35 36 37 38 ··· 46 다음