Skip to content

Add files via upload#1

Open
Ar444ri wants to merge 2 commits into
masterfrom
web
Open

Add files via upload#1
Ar444ri wants to merge 2 commits into
masterfrom
web

Conversation

@Ar444ri

@Ar444ri Ar444ri commented Oct 30, 2023

Copy link
Copy Markdown
Owner

Сделана красивая паутинка, которая не только двигается за вашим курсором при зажатой левой кнопки мышки, но и меняет свои размеры при приближении/ отдалении от краев , чтобы всегда оставаться пропорциональной и не терять свою красоту. Также был установлен модуль для красивого кода, поэтому ошибок по типу отсутствия пробелов/ наличия лишних пространств быть не должно (надеюсь)

Сделана красивая паутинка, которая не только двигается за вашим курсором при зажатой левой кнопки мышки, но и меняет свои размеры при приближении/ отдалении от краев , чтобы всегда оставаться пропорциональной и не терять свою красоту

@hBuzzy hBuzzy left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Хорошее решение, но поправьте замечания.

Comment thread web task_2/widget.h Outdated

public:
Widget(QWidget *parent = nullptr);
void drawWeb(QPoint, int, QPainter *);

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Методы с большой буквы

Comment thread web task_2/widget.cpp Outdated
this->unsetCursor();
}

void Widget::mouseMoveEvent(QMouseEvent *event) //

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Остатки комментария

Comment thread web task_2/widget.cpp Outdated
recta_ = this->rect();
mousePressed_ = true;
this->setCursor(Qt::CrossCursor);
if (!recta_.contains(pos_)) {

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Если перед условиями или циклами есть какие-либо определения, то лучше сделать пустую строку перед ними.

Comment thread web task_2/widget.h Outdated

private:
QPoint pos_;
QRect recta_;

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Не сокращайте названия, если сокращения не общепринятые. Вроде min, max и т.д. Лучше все же в имя добавить больше конкретики. Что это за прямоугольник? Если геометрия виджета, то стоит так и указать.

Comment thread web task_2/widget.h Outdated
private:
QPoint pos_;
QRect recta_;
bool mousePressed_;

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Переменные типа bool должны задавать вопрос, на который мы должны иметь возможность дать ответ либо Да, либо Нет. Ваша переменная констатирует факт, а не задает вопрос. Называйте переменные bool с глаголов is, has, have и т.д. в вашем случае: isMousePressed_

Comment thread web task_2/widget.cpp Outdated
QPoint center = pos_;

int radius;
if (center.y() >= height() / 2) {

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

2 - магическое число. Создайте переменную.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants