Created
September 23, 2019 02:35
-
-
Save DataSolveProblems/85b89d888921a3f423a931448b283d5d to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import sys | |
from PyQt5.QtWidgets import (QApplication, QWidget, QMdiArea, QCalendarWidget, QTextEdit, QPushButton) | |
class AppDemo(QWidget): | |
def __init__(self): | |
super().__init__() | |
self.resize(800, 800) | |
workspace = QMdiArea(self) | |
workspace.resize(self.rect().width(), self.rect().height()) | |
self.calendar = QCalendarWidget() | |
self.calendar.clicked.connect(lambda date: print(date.getDate())) | |
workspace.addSubWindow(self.calendar) | |
self.button = QPushButton('My Button') | |
self.button.clicked.connect(lambda: print('button is clicked')) | |
workspace.addSubWindow(self.button) | |
textEditor = QTextEdit() | |
workspace.addSubWindow(textEditor) | |
if __name__ == '__main__': | |
app = QApplication(sys.argv) | |
demo = AppDemo() | |
demo.show() | |
sys.exit(app.exec_()) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment