Code refactoring - change code style to the new clang-format rules

This commit is contained in:
Yuriy Puchkov
2020-09-23 15:24:16 +03:00
parent 5a62cd3b13
commit b88a5fbce8
175 changed files with 6200 additions and 5356 deletions

View File

@@ -17,59 +17,69 @@
#include "abstractpathtool.h"
AbstractPathTool::AbstractPathTool(QObject *parent) :
CaptureTool(parent), m_thickness(0), m_padding(0)
AbstractPathTool::AbstractPathTool(QObject* parent)
: CaptureTool(parent)
, m_thickness(0)
, m_padding(0)
{}
bool AbstractPathTool::isValid() const
{
}
bool AbstractPathTool::isValid() const {
return m_points.length() > 1;
}
bool AbstractPathTool::closeOnButtonPressed() const {
bool AbstractPathTool::closeOnButtonPressed() const
{
return false;
}
bool AbstractPathTool::isSelectable() const {
bool AbstractPathTool::isSelectable() const
{
return true;
}
bool AbstractPathTool::showMousePreview() const {
bool AbstractPathTool::showMousePreview() const
{
return true;
}
void AbstractPathTool::undo(QPixmap &pixmap) {
void AbstractPathTool::undo(QPixmap& pixmap)
{
QPainter p(&pixmap);
const int val = m_thickness + m_padding;
QRect area = m_backupArea + QMargins(val, val, val, val);
p.drawPixmap(area.intersected(pixmap.rect())
.topLeft(), m_pixmapBackup);
p.drawPixmap(area.intersected(pixmap.rect()).topLeft(), m_pixmapBackup);
}
void AbstractPathTool::drawEnd(const QPoint &p) {
void AbstractPathTool::drawEnd(const QPoint& p)
{
Q_UNUSED(p);
}
void AbstractPathTool::drawMove(const QPoint &p) {
void AbstractPathTool::drawMove(const QPoint& p)
{
addPoint(p);
}
void AbstractPathTool::colorChanged(const QColor &c) {
void AbstractPathTool::colorChanged(const QColor& c)
{
m_color = c;
}
void AbstractPathTool::thicknessChanged(const int th) {
void AbstractPathTool::thicknessChanged(const int th)
{
m_thickness = th;
}
void AbstractPathTool::updateBackup(const QPixmap &pixmap) {
void AbstractPathTool::updateBackup(const QPixmap& pixmap)
{
const int val = m_thickness + m_padding;
QRect area = m_backupArea.normalized() + QMargins(val, val, val, val);
m_pixmapBackup = pixmap.copy(area);
}
void AbstractPathTool::addPoint(const QPoint &point) {
void AbstractPathTool::addPoint(const QPoint& point)
{
if (m_backupArea.left() > point.x()) {
m_backupArea.setLeft(point.x());
} else if (m_backupArea.right() < point.x()) {