summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorLouie S <louie@example.com>2024-02-20 17:28:22 -0500
committerLouie S <louie@example.com>2024-02-20 17:34:18 -0500
commit0b7be46511ec752f1f28e73eac787da633c47f46 (patch)
tree1fdc0f66924350a7272af125144c352383f58672 /src
parenta276acd4e0c8031fdef41f11a4fa2285b671207d (diff)
Create group class
Diffstat (limited to 'src')
-rw-r--r--src/assignmentList.cpp8
-rw-r--r--src/assignmentList.h1
-rw-r--r--src/group.cpp23
-rw-r--r--src/group.h23
4 files changed, 52 insertions, 3 deletions
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