From 2e23d6f0588230ee0bfa214177422dd506a3d9a8 Mon Sep 17 00:00:00 2001 From: Danny Robson Date: Sun, 14 Jun 2020 09:48:13 +1000 Subject: [PATCH] Add a trivial list of active tasks in the Qt app --- src/edible_elephant/qt.py | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/src/edible_elephant/qt.py b/src/edible_elephant/qt.py index 7912eaa..5ee6628 100755 --- a/src/edible_elephant/qt.py +++ b/src/edible_elephant/qt.py @@ -1,15 +1,21 @@ #!/usr/bin/env python3 +import db + if __name__ == '__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([]) window = QWidget() 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.show()