Skip to content

Commit

Permalink
Release v0.9.0 beta
Browse files Browse the repository at this point in the history
  • Loading branch information
Inspirate789 committed Aug 7, 2022
1 parent 687e7b9 commit f64eb3d
Show file tree
Hide file tree
Showing 11 changed files with 1,962 additions and 0 deletions.
31 changes: 31 additions & 0 deletions TestsWriter.pro
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
267 changes: 267 additions & 0 deletions TestsWriter.pro.user

Large diffs are not rendered by default.

13 changes: 13 additions & 0 deletions deletebutton.cpp
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);
}
19 changes: 19 additions & 0 deletions deletebutton.h
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
31 changes: 31 additions & 0 deletions exceptions.h
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
11 changes: 11 additions & 0 deletions main.cpp
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();
}
Loading

0 comments on commit f64eb3d

Please sign in to comment.