Add a trivial list of active tasks in the Qt app

This commit is contained in:
Danny Robson 2020-06-14 09:48:13 +10:00
parent 13e135491c
commit 2e23d6f058

View File

@ -1,15 +1,21 @@
#!/usr/bin/env python3 #!/usr/bin/env python3
import db
if __name__ == '__main__': if __name__ == '__main__':
def main(): def main():
from PyQt5.QtWidgets import QApplication, QWidget, QPushButton, QVBoxLayout from PyQt5.QtWidgets import QApplication, QWidget, QPushButton, QVBoxLayout, QLabel
session = db.load_db()
app = QApplication([]) app = QApplication([])
window = QWidget() window = QWidget()
layout = QVBoxLayout() layout = QVBoxLayout()
layout.addWidget(QPushButton('Top'))
layout.addWidget(QPushButton('Bottom')) for task in session.query(db.Task).filter(db.Task.active == True):
layout.addWidget(QLabel(task.title))
window.setLayout(layout) window.setLayout(layout)
window.show() window.show()