-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Redesigns MainWindow and adds ProccessList
- Loading branch information
Gustavo Passos
committed
May 12, 2019
1 parent
b1fd221
commit a5656e0
Showing
12 changed files
with
2,260 additions
and
272 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
debug/main.o | ||
debug/mainwindow.o | ||
debug/addproccesswidget.o | ||
debug/operatingsystem.o | ||
debug/proccess.o | ||
debug/scheduler.o | ||
debug/proccesslist.o | ||
debug/moc_mainwindow.o | ||
debug/moc_addproccesswidget.o | ||
debug/moc_proccesslist.o |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
release/main.o | ||
release/mainwindow.o | ||
release/addproccesswidget.o | ||
release/operatingsystem.o | ||
release/proccess.o | ||
release/scheduler.o | ||
release/proccesslist.o | ||
release/moc_mainwindow.o | ||
release/moc_addproccesswidget.o | ||
release/moc_proccesslist.o |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
#include "proccesslist.h" | ||
#include "addproccesswidget.h" | ||
|
||
ProccessList::ProccessList(QWidget* parent) | ||
: QScrollArea(parent), | ||
m_mainLayout(nullptr), | ||
m_centralWidget(nullptr), | ||
m_numberOfProccesses(0) | ||
{ | ||
setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOn); | ||
setWidgetResizable(true); | ||
setFixedHeight(190); | ||
setFixedWidth(600); | ||
CreateMainLayout(); | ||
} | ||
|
||
void ProccessList::AddProccess(int index) | ||
{ | ||
AddProccessWidget* proccessBox = new AddProccessWidget(index, this); | ||
connect(proccessBox, &AddProccessWidget::RemoveProccessRequested, | ||
this, &ProccessList::RemoveProccess); | ||
m_mainLayout->insertWidget(m_numberOfProccesses, proccessBox, | ||
0, Qt::AlignLeft | Qt::AlignTop); | ||
|
||
m_numberOfProccesses++; | ||
|
||
emit NumberOfProccessesChanged(m_numberOfProccesses); | ||
} | ||
|
||
void ProccessList::RemoveProccess(QWidget* widget) | ||
{ | ||
m_numberOfProccesses--; | ||
m_mainLayout->removeWidget(widget); | ||
delete widget; | ||
widget = nullptr; | ||
|
||
emit NumberOfProccessesChanged(m_numberOfProccesses); | ||
} | ||
|
||
void ProccessList::CreateMainLayout() | ||
{ | ||
m_mainLayout = new QHBoxLayout(this); | ||
m_mainLayout->setAlignment(Qt::AlignLeft); | ||
m_centralWidget = new QWidget(this); | ||
this->setWidget(m_centralWidget); | ||
|
||
m_centralWidget->setLayout(m_mainLayout); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
#ifndef PROCCESLIST_H | ||
#define PROCCESSLIST_H | ||
|
||
#include <QtWidgets/QtWidgets> | ||
|
||
class ProccessList : public QScrollArea | ||
{ | ||
Q_OBJECT | ||
|
||
public: | ||
ProccessList(QWidget* parent = nullptr); | ||
void AddProccess(int index); | ||
|
||
signals: | ||
void NumberOfProccessesChanged(int value); | ||
|
||
private slots: | ||
void RemoveProccess(QWidget* widget); | ||
|
||
private: | ||
QHBoxLayout* m_mainLayout;; | ||
QWidget* m_centralWidget; | ||
|
||
int m_numberOfProccesses; | ||
|
||
void CreateMainLayout(); | ||
}; | ||
|
||
#endif |