-
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.
- Loading branch information
1 parent
687e7b9
commit f64eb3d
Showing
11 changed files
with
1,962 additions
and
0 deletions.
There are no files selected for viewing
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,31 @@ | ||
QT += core gui | ||
|
||
greaterThan(QT_MAJOR_VERSION, 4): QT += widgets | ||
|
||
CONFIG += c++11 | ||
|
||
# You can make your code fail to compile if it uses deprecated APIs. | ||
# In order to do so, uncomment the following line. | ||
#DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x060000 # disables all the APIs deprecated before Qt 6.0.0 | ||
|
||
SOURCES += \ | ||
deletebutton.cpp \ | ||
main.cpp \ | ||
mainwindow.cpp \ | ||
testswriter.cpp | ||
|
||
HEADERS += \ | ||
deletebutton.h \ | ||
exceptions.h \ | ||
mainwindow.h \ | ||
testswriter.h | ||
|
||
FORMS += \ | ||
mainwindow.ui | ||
|
||
INCLUDEPATH += C:\Users\Inspirate\Documents\jsoncpp\vcpkg\packages\nlohmann-json_x86-windows\include | ||
# Default rules for deployment. | ||
qnx: target.path = /tmp/$${TARGET}/bin | ||
else: unix:!android: target.path = /opt/$${TARGET}/bin | ||
!isEmpty(target.path): INSTALLS += target |
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,13 @@ | ||
#include "deletebutton.h" | ||
|
||
void DeleteButton::setMainWindow(MainWindow *const mainWindow) | ||
{ | ||
_mainWindow = mainWindow; | ||
setStyleSheet("icon: url(images/deleteBtn.png); padding: 4px; margin: 0px;"); | ||
connect(this, &DeleteButton::released, this, &DeleteButton::onDeleteButtonClicked); | ||
} | ||
|
||
void DeleteButton::onDeleteButtonClicked() | ||
{ | ||
emit _mainWindow->removeLineSignal(this); | ||
} |
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,19 @@ | ||
#ifndef DELETEBUTTON_H | ||
#define DELETEBUTTON_H | ||
|
||
#include <QPushButton> | ||
#include "mainwindow.h" | ||
|
||
class MainWindow; | ||
|
||
class DeleteButton: public QPushButton | ||
{ | ||
public: | ||
void setMainWindow(MainWindow *const mainWindow); | ||
void onDeleteButtonClicked(); | ||
|
||
private: | ||
MainWindow *_mainWindow; | ||
}; | ||
|
||
#endif // DELETEBUTTON_H |
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,31 @@ | ||
#ifndef EXCEPTIONS_H | ||
#define EXCEPTIONS_H | ||
|
||
#include <string> | ||
#include <exception> | ||
|
||
|
||
class BaseException : public std::exception | ||
{ | ||
public: | ||
explicit BaseException(std::string msg = "Не удалось выполнить действие.") : _msg(msg) { } | ||
|
||
virtual const char *what() const noexcept override { return _msg.c_str(); } | ||
|
||
protected: | ||
std::string _msg; | ||
}; | ||
|
||
class TestsWriterException : public BaseException | ||
{ | ||
public: | ||
explicit TestsWriterException(std::string msg = "Не удалось выполнить действие.") : BaseException(msg) { } | ||
}; | ||
|
||
class SavingException : public TestsWriterException | ||
{ | ||
public: | ||
explicit SavingException(std::string msg = "При сохранении теста возникла ошибка.") : TestsWriterException(msg) { } | ||
}; | ||
|
||
#endif // EXCEPTIONS_H |
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,11 @@ | ||
#include "mainwindow.h" | ||
|
||
#include <QApplication> | ||
|
||
int main(int argc, char *argv[]) | ||
{ | ||
QApplication a(argc, argv); | ||
MainWindow w; | ||
w.showMaximized(); | ||
return a.exec(); | ||
} |
Oops, something went wrong.