< Python Qt

Qt lista

Szerző: Sallai András

Copyright © 2021, Sallai András

Licenc: CC BY-SA 4.0

Web: https://szit.hu

QListWidget

https://doc.qt.io/qtforpython/PySide6/QtWidgets/QListWidget.html (2021)

import sys from PyQt5.QtWidgets import QApplication, QComboBox, QMainWindow from PyQt5.QtWidgets import QListWidget class MainWindow(QMainWindow): def __init__(self): super().__init__() listWidget = QListWidget(self) listWidget.move(30, 30) listWidget.resize(120, 120) listWidget.addItem('alma') listWidget.addItem('körte') listWidget.addItem('barack') listWidget.addItem('szilva') self.setGeometry(100, 100, 320, 200) self.show() if __name__ == '__main__': app = QApplication(sys.argv) mainWindow = MainWindow() sys.exit(app.exec_())