Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 17fd8ef

Browse files
committed
Creating your first app with PySide6
1 parent 451b189 commit 17fd8ef

File tree

2 files changed

+31
-0
lines changed

2 files changed

+31
-0
lines changed
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
import sys
2+
3+
from PySide6.QtCore import QSize
4+
from PySide6.QtWidgets import QApplication, QMainWindow, QPushButton
5+
6+
7+
class MainWindow(QMainWindow):
8+
def __init__(self):
9+
super().__init__()
10+
11+
self.setWindowTitle("My App")
12+
13+
button = QPushButton("Press Me!")
14+
15+
self.setFixedSize(QSize(400, 300))
16+
17+
self.setCentralWidget(button)
18+
19+
20+
app = QApplication(sys.argv)
21+
window = MainWindow()
22+
window.show()
23+
app.exec()
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
import sys
2+
3+
from PySide6.QtWidgets import QApplication, QWidget
4+
5+
app = QApplication(sys.argv)
6+
window = QWidget()
7+
window.show()
8+
app.exec()

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /