initial commit
This commit is contained in:
1
.gitignore
vendored
Normal file
1
.gitignore
vendored
Normal file
@@ -0,0 +1 @@
|
|||||||
|
__pycache__/pyqt5_gui.cpython-312.pyc
|
||||||
14
Teil_60_Qt_1.py
Normal file
14
Teil_60_Qt_1.py
Normal file
@@ -0,0 +1,14 @@
|
|||||||
|
from PySide6.QtWidgets import QApplication, QMainWindow
|
||||||
|
from pyqt5_gui import Ui_MainWindow
|
||||||
|
|
||||||
|
class Frm_main(QMainWindow, Ui_MainWindow):
|
||||||
|
def __init__(self):
|
||||||
|
super().__init__()
|
||||||
|
self.setupUi(self)
|
||||||
|
|
||||||
|
app = QApplication()
|
||||||
|
frm_main = Frm_main()
|
||||||
|
frm_main.lbl_eins.setText("Ein Label")
|
||||||
|
#self.lbl_eins.setText(QCoreApplication.translate("MainWindow", u"Das Label", None))
|
||||||
|
frm_main.show()
|
||||||
|
app.exec()
|
||||||
101
pyqt5.ui
Normal file
101
pyqt5.ui
Normal file
@@ -0,0 +1,101 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<ui version="4.0">
|
||||||
|
<class>MainWindow</class>
|
||||||
|
<widget class="QMainWindow" name="MainWindow">
|
||||||
|
<property name="geometry">
|
||||||
|
<rect>
|
||||||
|
<x>0</x>
|
||||||
|
<y>0</y>
|
||||||
|
<width>489</width>
|
||||||
|
<height>299</height>
|
||||||
|
</rect>
|
||||||
|
</property>
|
||||||
|
<property name="windowTitle">
|
||||||
|
<string>TestApp</string>
|
||||||
|
</property>
|
||||||
|
<widget class="QWidget" name="centralwidget">
|
||||||
|
<widget class="QWidget" name="layoutWidget">
|
||||||
|
<property name="geometry">
|
||||||
|
<rect>
|
||||||
|
<x>0</x>
|
||||||
|
<y>0</y>
|
||||||
|
<width>361</width>
|
||||||
|
<height>181</height>
|
||||||
|
</rect>
|
||||||
|
</property>
|
||||||
|
<layout class="QHBoxLayout" name="horizontalLayout">
|
||||||
|
<property name="leftMargin">
|
||||||
|
<number>0</number>
|
||||||
|
</property>
|
||||||
|
<item>
|
||||||
|
<layout class="QVBoxLayout" name="verticalLayout">
|
||||||
|
<item>
|
||||||
|
<widget class="QLabel" name="lbl_eins">
|
||||||
|
<property name="text">
|
||||||
|
<string>Das Label</string>
|
||||||
|
</property>
|
||||||
|
<property name="alignment">
|
||||||
|
<set>Qt::AlignCenter</set>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QPushButton" name="pBtn_laden">
|
||||||
|
<property name="text">
|
||||||
|
<string>Laden</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QPushButton" name="pBtn_schliessen">
|
||||||
|
<property name="text">
|
||||||
|
<string>Schließen</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QPushButton" name="pBtn_ok">
|
||||||
|
<property name="text">
|
||||||
|
<string>Okay</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QPushButton" name="pBtn_abbrechen">
|
||||||
|
<property name="text">
|
||||||
|
<string>Abbrechen</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</widget>
|
||||||
|
</widget>
|
||||||
|
<widget class="QMenuBar" name="menubar">
|
||||||
|
<property name="geometry">
|
||||||
|
<rect>
|
||||||
|
<x>0</x>
|
||||||
|
<y>0</y>
|
||||||
|
<width>489</width>
|
||||||
|
<height>22</height>
|
||||||
|
</rect>
|
||||||
|
</property>
|
||||||
|
<widget class="QMenu" name="menuDatei">
|
||||||
|
<property name="title">
|
||||||
|
<string>Datei</string>
|
||||||
|
</property>
|
||||||
|
<addaction name="action_oeffnen"/>
|
||||||
|
</widget>
|
||||||
|
<addaction name="menuDatei"/>
|
||||||
|
</widget>
|
||||||
|
<widget class="QStatusBar" name="statusbar"/>
|
||||||
|
<action name="action_oeffnen">
|
||||||
|
<property name="text">
|
||||||
|
<string>&öffnen</string>
|
||||||
|
</property>
|
||||||
|
</action>
|
||||||
|
</widget>
|
||||||
|
<resources/>
|
||||||
|
<connections/>
|
||||||
|
</ui>
|
||||||
98
pyqt5_gui.py
Normal file
98
pyqt5_gui.py
Normal file
@@ -0,0 +1,98 @@
|
|||||||
|
# -*- coding: utf-8 -*-
|
||||||
|
|
||||||
|
################################################################################
|
||||||
|
## Form generated from reading UI file 'pyqt5.ui'
|
||||||
|
##
|
||||||
|
## Created by: Qt User Interface Compiler version 6.6.0
|
||||||
|
##
|
||||||
|
## WARNING! All changes made in this file will be lost when recompiling UI file!
|
||||||
|
################################################################################
|
||||||
|
|
||||||
|
from PySide6.QtCore import (QCoreApplication, QDate, QDateTime, QLocale,
|
||||||
|
QMetaObject, QObject, QPoint, QRect,
|
||||||
|
QSize, QTime, QUrl, Qt)
|
||||||
|
from PySide6.QtGui import (QAction, QBrush, QColor, QConicalGradient,
|
||||||
|
QCursor, QFont, QFontDatabase, QGradient,
|
||||||
|
QIcon, QImage, QKeySequence, QLinearGradient,
|
||||||
|
QPainter, QPalette, QPixmap, QRadialGradient,
|
||||||
|
QTransform)
|
||||||
|
from PySide6.QtWidgets import (QApplication, QHBoxLayout, QLabel, QMainWindow,
|
||||||
|
QMenu, QMenuBar, QPushButton, QSizePolicy,
|
||||||
|
QStatusBar, QVBoxLayout, QWidget)
|
||||||
|
|
||||||
|
class Ui_MainWindow(object):
|
||||||
|
def setupUi(self, MainWindow):
|
||||||
|
if not MainWindow.objectName():
|
||||||
|
MainWindow.setObjectName(u"MainWindow")
|
||||||
|
MainWindow.resize(489, 299)
|
||||||
|
self.action_oeffnen = QAction(MainWindow)
|
||||||
|
self.action_oeffnen.setObjectName(u"action_oeffnen")
|
||||||
|
self.centralwidget = QWidget(MainWindow)
|
||||||
|
self.centralwidget.setObjectName(u"centralwidget")
|
||||||
|
self.layoutWidget = QWidget(self.centralwidget)
|
||||||
|
self.layoutWidget.setObjectName(u"layoutWidget")
|
||||||
|
self.layoutWidget.setGeometry(QRect(0, 0, 361, 181))
|
||||||
|
self.horizontalLayout = QHBoxLayout(self.layoutWidget)
|
||||||
|
self.horizontalLayout.setObjectName(u"horizontalLayout")
|
||||||
|
self.horizontalLayout.setContentsMargins(0, 0, 0, 0)
|
||||||
|
self.verticalLayout = QVBoxLayout()
|
||||||
|
self.verticalLayout.setObjectName(u"verticalLayout")
|
||||||
|
self.lbl_eins = QLabel(self.layoutWidget)
|
||||||
|
self.lbl_eins.setObjectName(u"lbl_eins")
|
||||||
|
self.lbl_eins.setAlignment(Qt.AlignCenter)
|
||||||
|
|
||||||
|
self.verticalLayout.addWidget(self.lbl_eins)
|
||||||
|
|
||||||
|
self.pBtn_laden = QPushButton(self.layoutWidget)
|
||||||
|
self.pBtn_laden.setObjectName(u"pBtn_laden")
|
||||||
|
|
||||||
|
self.verticalLayout.addWidget(self.pBtn_laden)
|
||||||
|
|
||||||
|
self.pBtn_schliessen = QPushButton(self.layoutWidget)
|
||||||
|
self.pBtn_schliessen.setObjectName(u"pBtn_schliessen")
|
||||||
|
|
||||||
|
self.verticalLayout.addWidget(self.pBtn_schliessen)
|
||||||
|
|
||||||
|
|
||||||
|
self.horizontalLayout.addLayout(self.verticalLayout)
|
||||||
|
|
||||||
|
self.pBtn_ok = QPushButton(self.layoutWidget)
|
||||||
|
self.pBtn_ok.setObjectName(u"pBtn_ok")
|
||||||
|
|
||||||
|
self.horizontalLayout.addWidget(self.pBtn_ok)
|
||||||
|
|
||||||
|
self.pBtn_abbrechen = QPushButton(self.layoutWidget)
|
||||||
|
self.pBtn_abbrechen.setObjectName(u"pBtn_abbrechen")
|
||||||
|
|
||||||
|
self.horizontalLayout.addWidget(self.pBtn_abbrechen)
|
||||||
|
|
||||||
|
MainWindow.setCentralWidget(self.centralwidget)
|
||||||
|
self.menubar = QMenuBar(MainWindow)
|
||||||
|
self.menubar.setObjectName(u"menubar")
|
||||||
|
self.menubar.setGeometry(QRect(0, 0, 489, 22))
|
||||||
|
self.menuDatei = QMenu(self.menubar)
|
||||||
|
self.menuDatei.setObjectName(u"menuDatei")
|
||||||
|
MainWindow.setMenuBar(self.menubar)
|
||||||
|
self.statusbar = QStatusBar(MainWindow)
|
||||||
|
self.statusbar.setObjectName(u"statusbar")
|
||||||
|
MainWindow.setStatusBar(self.statusbar)
|
||||||
|
|
||||||
|
self.menubar.addAction(self.menuDatei.menuAction())
|
||||||
|
self.menuDatei.addAction(self.action_oeffnen)
|
||||||
|
|
||||||
|
self.retranslateUi(MainWindow)
|
||||||
|
|
||||||
|
QMetaObject.connectSlotsByName(MainWindow)
|
||||||
|
# setupUi
|
||||||
|
|
||||||
|
def retranslateUi(self, MainWindow):
|
||||||
|
MainWindow.setWindowTitle(QCoreApplication.translate("MainWindow", u"TestApp", None))
|
||||||
|
self.action_oeffnen.setText(QCoreApplication.translate("MainWindow", u"&\u00f6ffnen", None))
|
||||||
|
self.lbl_eins.setText(QCoreApplication.translate("MainWindow", u"Das Label", None))
|
||||||
|
self.pBtn_laden.setText(QCoreApplication.translate("MainWindow", u"Laden", None))
|
||||||
|
self.pBtn_schliessen.setText(QCoreApplication.translate("MainWindow", u"Schlie\u00dfen", None))
|
||||||
|
self.pBtn_ok.setText(QCoreApplication.translate("MainWindow", u"Okay", None))
|
||||||
|
self.pBtn_abbrechen.setText(QCoreApplication.translate("MainWindow", u"Abbrechen", None))
|
||||||
|
self.menuDatei.setTitle(QCoreApplication.translate("MainWindow", u"Datei", None))
|
||||||
|
# retranslateUi
|
||||||
|
|
||||||
Reference in New Issue
Block a user