applied some clang modernize (#2435)

This commit is contained in:
borgmanJeremy
2022-02-16 21:15:25 -06:00
committed by GitHub
parent 53698bca6f
commit 424b7fba37
24 changed files with 82 additions and 75 deletions

View File

@@ -1696,7 +1696,7 @@ void CaptureWidget::redo()
QRect CaptureWidget::extendedSelection() const
{
if (!m_selection->isVisible()) {
return QRect();
return {};
}
QRect r = m_selection->geometry();
return extendedRect(r);
@@ -1705,10 +1705,10 @@ QRect CaptureWidget::extendedSelection() const
QRect CaptureWidget::extendedRect(const QRect& r) const
{
auto devicePixelRatio = m_context.screenshot.devicePixelRatio();
return QRect(r.left() * devicePixelRatio,
r.top() * devicePixelRatio,
r.width() * devicePixelRatio,
r.height() * devicePixelRatio);
return { static_cast<int>(r.left() * devicePixelRatio),
static_cast<int>(r.top() * devicePixelRatio),
static_cast<int>(r.width() * devicePixelRatio),
static_cast<int>(r.height() * devicePixelRatio) };
}
QRect CaptureWidget::paddedUpdateRect(const QRect& r) const

View File

@@ -11,12 +11,13 @@
#include <QPainter>
#include <QPropertyAnimation>
#include <QTimer>
#include <utility>
#define MARGIN (m_THandle.width())
SelectionWidget::SelectionWidget(const QColor& c, QWidget* parent)
SelectionWidget::SelectionWidget(QColor c, QWidget* parent)
: QWidget(parent)
, m_color(c)
, m_color(std::move(c))
, m_activeSide(NO_SIDE)
, m_ignoreMouse(false)
{

View File

@@ -25,7 +25,7 @@ public:
CENTER = 0b10000,
};
explicit SelectionWidget(const QColor& c, QWidget* parent = nullptr);
explicit SelectionWidget(QColor c, QWidget* parent = nullptr);
SideType getMouseSide(const QPoint& mousePos) const;
QVector<QRect> handlerAreas();

View File

@@ -11,7 +11,6 @@
LoadSpinner::LoadSpinner(QWidget* parent)
: QWidget(parent)
, m_startAngle(0)
, m_span(0)
, m_growing(true)
{

View File

@@ -12,14 +12,15 @@
#include <QTimer>
#include <QVBoxLayout>
#include <QWheelEvent>
#include <utility>
UpdateNotificationWidget::UpdateNotificationWidget(
QWidget* parent,
const QString& appLatestVersion,
const QString& appLatestUrl)
QString appLatestUrl)
: QWidget(parent)
, m_appLatestVersion(appLatestVersion)
, m_appLatestUrl(appLatestUrl)
, m_appLatestUrl(std::move(appLatestUrl))
, m_layout(nullptr)
{
setMinimumSize(400, 100);

View File

@@ -20,7 +20,7 @@ class UpdateNotificationWidget : public QWidget
public:
explicit UpdateNotificationWidget(QWidget* parent,
const QString& appLatestVersion,
const QString& appLatestUrl);
QString appLatestUrl);
void setAppLatestVersion(const QString& latestVersion);
void hide();