Removed using namespace directive for class member function definitions in source files

This commit is contained in:
Nav
2022-02-05 15:32:08 +00:00
parent 9bbc534973
commit 53a3c815d7
116 changed files with 13113 additions and 12664 deletions

View File

@@ -1,35 +1,36 @@
#include "LabeledSeparator.hpp"
using namespace Bloom::Widgets;
namespace Bloom::Widgets
{
LabeledSeparator::LabeledSeparator(QString title, QWidget* parent): title(std::move(title)), QWidget(parent) {
this->setSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::Fixed);
this->setFixedHeight(LabeledSeparator::DEFAULT_HEIGHT);
}
LabeledSeparator::LabeledSeparator(QString title, QWidget* parent): title(std::move(title)), QWidget(parent) {
this->setSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::Fixed);
this->setFixedHeight(LabeledSeparator::DEFAULT_HEIGHT);
}
void LabeledSeparator::paintEvent(QPaintEvent* event) {
auto painter = QPainter(this);
this->drawWidget(painter);
}
void LabeledSeparator::drawWidget(QPainter& painter) {
const auto fontMetrics = painter.fontMetrics();
const auto titleSize = fontMetrics.size(Qt::TextFlag::TextSingleLine, this->title);
const auto titleRect = QRect(
QPoint(this->marginLeft, (this->height() - titleSize.height()) / 2),
titleSize
);
const auto lineYPosition = titleRect.y() + (titleRect.height() / 2);
const auto line = QLine(
titleRect.right() + 8,
lineYPosition,
this->width() - this->marginRight,
lineYPosition
);
painter.drawText(titleRect, Qt::AlignCenter, this->title);
painter.setPen(this->lineColor);
painter.drawLine(line);
void LabeledSeparator::paintEvent(QPaintEvent* event) {
auto painter = QPainter(this);
this->drawWidget(painter);
}
void LabeledSeparator::drawWidget(QPainter& painter) {
const auto fontMetrics = painter.fontMetrics();
const auto titleSize = fontMetrics.size(Qt::TextFlag::TextSingleLine, this->title);
const auto titleRect = QRect(
QPoint(this->marginLeft, (this->height() - titleSize.height()) / 2),
titleSize
);
const auto lineYPosition = titleRect.y() + (titleRect.height() / 2);
const auto line = QLine(
titleRect.right() + 8,
lineYPosition,
this->width() - this->marginRight,
lineYPosition
);
painter.drawText(titleRect, Qt::AlignCenter, this->title);
painter.setPen(this->lineColor);
painter.drawLine(line);
}
}