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 deaa7a0

Browse files
How to make QLineEdit and QVBoxLayout - Python #PyQT6
How to make QLineEdit and QVBoxLayout - Python #PyQT6
1 parent bf96e3f commit deaa7a0

File tree

8 files changed

+85
-0
lines changed

8 files changed

+85
-0
lines changed

‎.idea/.gitignore

Lines changed: 3 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎.idea/.name

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎.idea/inspectionProfiles/Project_Default.xml

Lines changed: 22 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎.idea/inspectionProfiles/profiles_settings.xml

Lines changed: 6 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎.idea/misc.xml

Lines changed: 4 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎.idea/modules.xml

Lines changed: 8 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎.idea/python____project.iml

Lines changed: 8 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎main.py

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
from PyQt6.QtWidgets import QApplication, QMainWindow, QLabel, QLineEdit, QVBoxLayout, QWidget
2+
3+
import sys
4+
5+
6+
class MainWindow(QMainWindow):
7+
def __init__(self):
8+
super().__init__()
9+
10+
self.setWindowTitle("My App")
11+
12+
self.label = QLabel()
13+
14+
self.input = QLineEdit()
15+
self.input.textChanged.connect(self.label.setText)
16+
17+
layout = QVBoxLayout()
18+
layout.addWidget(self.input)
19+
layout.addWidget(self.label)
20+
21+
container = QWidget()
22+
container.setLayout(layout)
23+
24+
# Set the central widget of the Window.
25+
self.setCentralWidget(container)
26+
27+
28+
app = QApplication(sys.argv)
29+
30+
window = MainWindow()
31+
window.show()
32+
33+
app.exec()

0 commit comments

Comments
(0)

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