분류 전체보기402 Signals & Slots GUI 응용 프로그램을 만들 때 일반적으로 무언가를하기를 원합니다! 우리에게 필요한 것은 버튼을 누르는 동작을 무언가가 일어나게 하는 것과 연결하는 방법입니다. Qt에서 이것은 신호(signal)와 슬롯(slot)에 의해 제공됩니다. Signal 신호는 어떤 일이 발생할 때 위젯에서 방출(emit)되는 신호입니다. 버튼을 누르는 것부터 입력 상자의 텍스트가 변경되고 창의 텍스트가 변경되는 것까지 다양한 것이 될 수 있습니다. 많은 신호가 사용자 작업에 의해 시작되지만 이는 규칙이 아닙니다. 신호는 어떤 일이 일어나고 있는지 알리는 것 외에도 데이터를 보내 일어난 일에 대한 추가 컨텍스트를 제공할 수도 있습니다. Slot 슬롯은 Qt가 신호 receiver에 사용하는 이름입니다. 파이썬에서는 어플리케이션의.. 2023. 3. 10. Sizing windows and widgets import sys from PyQt6.QtCore import QSize, Qt from PyQt6.QtWidgets import QApplication, QMainWindow, QPushButton # Subclass QMainWindow to customize your application's main window class MainWindow (QMainWindow): def __init__(self): super().__init__() self.setWindowTitle("My App") button = QPushButton("Press Me!") self.setFixedSize(QSize( 400 , 300 )) # Set the central widget of the Window. self... 2023. 3. 10. 빈 창 from PyQt6.QtWidgets import QApplication, QWidget # Only needed for access to command line arguments import sys # You need one (and only one) QApplication instance per application. # Pass in sys.argv to allow command line arguments for your app. # If you know you won't use command line arguments QApplication([]) works too. app = QApplication(sys.argv) # Create a Qt widget, which will be our wind.. 2023. 3. 10. index source file download : http://www.pythonguis.com/d/pyqt6-source.zip book Home : pythonguis.com [ QT Home ] Qt Widgets C++ Classes : https://doc.qt.io/qt-5/qtwidgets-module.html 2023. 3. 10. Styling Qt Applications It is easy to appreciate the clean, native look that Qt effortlessly provides by default. But for less business-like applications, plain gray widgets and bog-standard fonts don't always set the right tone. Even the drabbest utility or data entry application occasionally benefits from the addition of icons or the judicious tweaking of fonts to enhance usability. Fortunately, Qt's flexibility allo.. 2023. 3. 8. Building Applications with QMainWindow import sys from PyQt5 import QtWidgets as qtw from PyQt5 import QtGui as qtg from PyQt5 import QtCore as qtc class SettingsDialog(qtw.QDialog): """Dialog for setting the settings""" def __init__(self, settings, parent=None): super().__init__(parent, modal=True) self.setLayout(qtw.QFormLayout()) self.settings = settings self.layout().addRow( qtw.QLabel('Application Settings'), ) self.show_warning.. 2023. 3. 8. Handling Events with Signals and Slots Support for Signals and Slots : https://www.riverbankcomputing.com/static/Docs/PyQt5/signals_slots.html Using Qt Designer : https://www.riverbankcomputing.com/static/Docs/PyQt5/designer.html 신호 및 슬롯 기본 사항 object1.signalName.connect(object2.slotName) 슬롯 은 신호를 수신하고 이에 응답하여 작동할 수 있는 객체 메서드입니다. 이벤트에 대한 애플리케이션의 응답을 구성하기 위해 신호를 슬롯에 연결합니다. 신호는 이벤트 유형에 대한 응답으로 방출될 수 있는 개체의 특수 속성입니다. 이벤트는 사용자 작업, 시간 제한 또.. 2023. 3. 8. Building Forms with QtWidgets 2 Building Forms with QtWidgets One of the first steps in application development is prototyping your app's GUI. With a wide range of ready-to-use widgets, PyQt makes this very easy. Best of all, we can move our prototype code directly into an actual application when we're done. In this chapter, we're going to get familiar with basic form design over the following topics: Creating ba.. 2023. 3. 8. Deep Dive into PyQt 1 Section 1: Deep Dive into PyQt In this section, you will explore the core features of PyQt. By the end of this section, you should be comfortable with the basic design workflow and coding idioms involved in writing PyQt applications and feel confident in your ability to construct simple PyQt interfaces. The following chapters are in this section: Chapter 1, Getting Started with PyQt Chapter 2,.. 2023. 3. 8. 이전 1 ··· 33 34 35 36 37 38 39 ··· 45 다음