diff options
author | Louie S <louie@example.com> | 2024-02-20 17:28:22 -0500 |
---|---|---|
committer | Louie S <louie@example.com> | 2024-02-20 17:34:18 -0500 |
commit | 0b7be46511ec752f1f28e73eac787da633c47f46 (patch) | |
tree | 1fdc0f66924350a7272af125144c352383f58672 | |
parent | a276acd4e0c8031fdef41f11a4fa2285b671207d (diff) |
Create group class
-rw-r--r-- | CMakeLists.txt | 2 | ||||
-rw-r--r-- | src/assignmentList.cpp | 8 | ||||
-rw-r--r-- | src/assignmentList.h | 1 | ||||
-rw-r--r-- | src/group.cpp | 23 | ||||
-rw-r--r-- | src/group.h | 23 |
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 |