summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--CMakeLists.txt2
-rw-r--r--src/assignmentList.cpp8
-rw-r--r--src/assignmentList.h1
-rw-r--r--src/group.cpp23
-rw-r--r--src/group.h23
5 files changed, 54 insertions, 3 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 9d83e87..2ae8e9e 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -36,6 +36,8 @@ set(project_sources
"src/assignmentList.cpp"
"src/assignmentList.h"
"src/assignmentList.ui"
+ "src/group.cpp"
+ "src/group.h"
"src/main.cpp"
"src/preferences_dialog.ui"
"src/settings.cpp"
diff --git a/src/assignmentList.cpp b/src/assignmentList.cpp
index 91c4716..d755da7 100644
--- a/src/assignmentList.cpp
+++ b/src/assignmentList.cpp
@@ -24,7 +24,6 @@ AssignmentList::AssignmentList() {
// load uic
ui.setupUi(this);
-
this->initializeUI();
}
@@ -50,8 +49,8 @@ void AssignmentList::initializeUI() {
// create toolbar
ui.toolBar->addAction(ui.actionAdd_Group);
- //Config() // from config.h
this->setupDB();
+ this->displayDate();
this->displayWidgets();
this->show();
}
@@ -60,9 +59,12 @@ void AssignmentList::setupDB() {
qDebug() << "WIP";
}
-void AssignmentList::displayWidgets() {
+void AssignmentList::displayDate() {
QDate today = QDate::currentDate();
ui.title->setText(today.toString("dddd, MMM d yyyy"));
+}
+
+void AssignmentList::displayWidgets() {
//this->drawGroups();
}
diff --git a/src/assignmentList.h b/src/assignmentList.h
index 5df18e9..3e45351 100644
--- a/src/assignmentList.h
+++ b/src/assignmentList.h
@@ -20,6 +20,7 @@ class AssignmentList : public QMainWindow {
void initializeSettings();
void initializeUI();
void setupDB();
+ void displayDate();
void displayWidgets();
void editGroup(int id);
void removeGroup(int id);
diff --git a/src/group.cpp b/src/group.cpp
new file mode 100644
index 0000000..7b8f63d
--- /dev/null
+++ b/src/group.cpp
@@ -0,0 +1,23 @@
+#include <QLabel>
+#include <QString>
+
+#include "group.h"
+
+Group::Group(int id, QString name, QString column, QString link, bool hidden) {
+ this->id = id;
+ this->name = name;
+ this->column = column;
+ this->link = link;
+ this->hidden = hidden;
+
+ this->setContentsMargins(0, 10, 0, 10);
+
+ QLabel *name_label = new QLabel(this->name);
+ name_label->setTextInteractionFlags(Qt::TextSelectableByMouse);
+
+ QFont name_font = QFont("Arial", 13);
+ name_font.setUnderline(true);
+
+ name_label->setFont(name_font);
+ this->addWidget(name_label);
+}
diff --git a/src/group.h b/src/group.h
new file mode 100644
index 0000000..b6899a9
--- /dev/null
+++ b/src/group.h
@@ -0,0 +1,23 @@
+#ifndef GROUP_H
+#define GROUP_H
+
+#include <QString>
+#include <QVBoxLayout>
+
+class Group : QVBoxLayout {
+ public:
+ int id;
+ QString name;
+ QString column;
+ QString link;
+ bool hidden;
+
+ Group( int id,
+ QString name,
+ QString column = "left",
+ QString link = "",
+ bool hidden = false
+ );
+};
+
+#endif